TreasureTrails/node_modules/chevrotain/lib_esm/chevrotain.min.mjs

153 lines
207 KiB
JavaScript
Raw Normal View History

2026-03-18 09:02:21 -05:00
var u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ta=u(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.VERSION=void 0;On.VERSION="10.5.0"});var Lt=u((gw,rs)=>{var xm=Object.prototype;function bm(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||xm;return e===r}rs.exports=bm});var ra=u((Tw,ns)=>{function Cm(e,t){return function(r){return e(t(r))}}ns.exports=Cm});var as=u((Ew,is)=>{var Lm=ra(),km=Lm(Object.keys,Object);is.exports=km});var na=u((Aw,os)=>{var qm=Lt(),Mm=as(),Fm=Object.prototype,wm=Fm.hasOwnProperty;function Dm(e){if(!qm(e))return Mm(e);var t=[];for(var r in Object(e))wm.call(e,r)&&r!="constructor"&&t.push(r);return t}os.exports=Dm});var ia=u((Ow,ss)=>{var Um=typeof global=="object"&&global&&global.Object===Object&&global;ss.exports=Um});var me=u((Rw,us)=>{var jm=ia(),Gm=typeof self=="object"&&self&&self.Object===Object&&self,Bm=jm||Gm||Function("return this")();us.exports=Bm});var yt=u((Iw,cs)=>{var Wm=me(),Km=Wm.Symbol;cs.exports=Km});var ps=u((Nw,ds)=>{var ls=yt(),fs=Object.prototype,Vm=fs.hasOwnProperty,Hm=fs.toString,Lr=ls?ls.toStringTag:void 0;function zm(e){var t=Vm.call(e,Lr),r=e[Lr];try{e[Lr]=void 0;var n=!0}catch{}var i=Hm.call(e);return n&&(t?e[Lr]=r:delete e[Lr]),i}ds.exports=zm});var vs=u((Sw,hs)=>{var Xm=Object.prototype,Ym=Xm.toString;function $m(e){return Ym.call(e)}hs.exports=$m});var it=u((Pw,ms)=>{var _s=yt(),Zm=ps(),Jm=vs(),Qm="[object Null]",eg="[object Undefined]",ys=_s?_s.toStringTag:void 0;function tg(e){return e==null?e===void 0?eg:Qm:ys&&ys in Object(e)?Zm(e):Jm(e)}ms.exports=tg});var ge=u((xw,gs)=>{function rg(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}gs.exports=rg});var kt=u((bw,Ts)=>{var ng=it(),ig=ge(),ag="[object AsyncFunction]",og="[object Function]",sg="[object GeneratorFunction]",ug="[object Proxy]";function cg(e){if(!ig(e))return!1;var t=ng(e);return t==og||t==sg||t==ag||t==ug}Ts.exports=cg});var As=u((Cw,Es)=>{var lg=me(),fg=lg["__core-js_shared__"];Es.exports=fg});var Is=u((Lw,Rs)=>{var aa=As(),Os=function(){var e=/[^.]+$/.exec(aa&&aa.keys&&aa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function dg(e){return!!Os&&Os in e}Rs.exports=dg});var oa=u((kw,Ns)=>{var pg=Function.prototype,hg=pg.toString;function vg(e){if(e!=null){try{return hg.call(e)}catch{}try{return e+""}catch{}}return""}Ns.exports=vg});var Ps=u((qw,Ss)=>{var _g=kt(),yg=Is(),mg=ge(),gg=oa(),Tg=/[\\^$.*+?()[\]{}|]/g,Eg=/^\[object .+?Constructor\]$/,Ag=Function.prototype,Og=Object.prototype,Rg=Ag.toString,Ig=Og.hasOwnProperty,Ng=RegExp("^"+Rg.call(Ig).replace(Tg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sg(e){if(!mg(e)||yg(e))return!1;var t=_g(e)?Ng:Eg;return t.test(gg(e))}Ss.exports=Sg});var bs=u((Mw,xs)=>{function Pg(e,t){return e?.[t]}xs.exports=Pg});var at=u((Fw,Cs)=>{var xg=Ps(),bg=bs();function Cg(e,t){var r=bg(e,t);return xg(r)?r:void 0}Cs.exports=Cg});var ks=u((ww,Ls)=>{var Lg=at(),kg=me(),qg=Lg(kg,"DataView");Ls.exports=qg});var Rn=u((Dw,qs)=>{var Mg=at(),Fg=me(),wg=Mg(Fg,"Map");qs.exports=wg});var Fs=u((Uw,Ms)=>{var Dg=at(),Ug=me(),jg=Dg(Ug,"Promise");Ms.exports=jg});var sa=u((jw,ws)=>{var Gg=at(),Bg=me(),Wg=Gg(Bg,"Set");ws.exports=Wg});var Us=u((Gw,Ds)=>{var Kg=at(),Vg=me(),Hg=Kg(Vg,"WeakMap");Ds.exports=Hg});var Mt=u((Bw,Hs)=>{var ua=ks(),ca=Rn(),la=Fs(),fa=sa(),da=Us(),Vs=it(),qt=oa(),js="[object Map]",zg="[object Object]",Gs="[object Promise]",Bs="[object Set]",Ws="[object WeakMap]",Ks="[object DataView]",Xg=qt(ua),Yg=qt(ca),$g=qt(la),Zg=qt(fa),Jg=qt(da),mt=Vs;(ua&&mt(new ua(new ArrayBuffer(1)))!=Ks||ca&&mt(new ca)!=js||la&&mt(la.resolve())!=Gs||fa&&mt(new fa)!=Bs||da&&mt(new da)!=Ws)&&(mt=function(e){var t=Vs(e),r=t==zg?e.constructor:void 0,n=r?qt(r):"";if(n)switch(n){case Xg:return Ks;case Yg:return js;case $g:return Gs;case Zg:return Bs;case Jg:return Ws}return t});Hs.exports=mt});var Te=u((Ww,zs)=>{function Qg(e){return e!=null&&typeof e=="object"}zs.exports=Qg});var Ys=u((Kw,Xs)=>{var eT=it(),tT=Te(),rT="[object Arguments]";function nT(e){return tT(e)&&eT(e)==
`),i("\r"),i("\u2028"),i("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){var l=this.positiveInteger();return{type:"GroupBackReference",value:l}},e.prototype.characterClassEscape=function(){var l,v=!1;switch(this.popChar()){case"d":l=p;break;case"D":l=p,v=!0;break;case"s":l=h;break;case"S":l=h,v=!0;break;case"w":l=d;break;case"W":l=d,v=!0;break}return s(l),{type:"Set",value:l,complement:v}},e.prototype.controlEscapeAtom=function(){var l;switch(this.popChar()){case"f":l=i("\f");break;case"n":l=i(`
`);break;case"r":l=i("\r");break;case"t":l=i(" ");break;case"v":l=i("\v");break}return s(l),{type:"Character",value:l}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var l=this.popChar();if(/[a-zA-Z]/.test(l)===!1)throw Error("Invalid ");var v=l.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:v}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:i("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){var l=this.popChar();return{type:"Character",value:i(l)}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var l=this.popChar();return{type:"Character",value:i(l)}}},e.prototype.characterClass=function(){var l=[],v=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),v=!0);this.isClassAtom();){var y=this.classAtom(),T=y.type==="Character";if(T&&this.isRangeDash()){this.consumeChar("-");var A=this.classAtom(),g=A.type==="Character";if(g){if(A.value<y.value)throw Error("Range out of order in character class");l.push({from:y.value,to:A.value})}else a(y.value,l),l.push(i("-")),a(A.value,l)}else a(y.value,l)}return this.consumeChar("]"),{type:"Set",complement:v,value:l}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:i("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var l=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),l=!1;break;default:this.groupIdx++;break}var v=this.disjunction();this.consumeChar(")");var y={type:"Group",capturing:l,value:v};return l&&(y.idx=this.groupIdx),y},e.prototype.positiveInteger=function(){var l=this.popChar();if(n.test(l)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},e.prototype.integerIncludingZero=function(){var l=this.popChar();if(r.test(l)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)l+=this.popChar();return parseInt(l,10)},e.prototype.patternCharacter=function(){var l=this.popChar();switch(l){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:i(l)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},e.prototype.isDigit=function(){return r.test(this.peekChar(0))},e.prototype.isClassAtom=function(l){switch(l===void 0&&(l=0),this.peekChar(l)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}},e.prototype.isQuantifier=function(){var l=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(l)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(l){for(var v="",y=0;y<l;y++){var T=this.popChar();if(t.test(T)===!1)throw Error("Expecting a HexDecimal digits");v+=T}var A=parseInt(v,16);return{type:"Character",value:A}},e.prototype.peekChar=function(l){return l===void 0&&(l=0),this.input[this.idx+l]},e.prototype.popChar=function(){var l=this.peekChar(0);return this.consumeChar(),l},e.prototype.consumeChar=function(l){if(l!==void 0&&this.input[this.idx]!==l)throw Error("Expected: '"+l+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},e.prototype.loc=function(l){return{begin:l,end:this.idx}};var t=/[0-9a-fA-F]/,r=/[0-9]/,n=/[1-9]/;function i(l){return l.charCodeAt(0)}function a(l,v){l.length!==void 0?l.forEach(function(y){v.push(y)}):v.push(l)}function o(l,v){if(l[v]===!0)throw"duplicate flag "+v;l[v]=!0}function s(l){if(l===void 0)throw Error("Internal Error - Should never get here!")}function c(){throw Error("Internal Error - Should never get here!")}var f,p=[];for(f=i("0");f<=i("9");f++)p.push(f);var d=[i("_")].concat(p);for(f=i("a");f<=i("z");f++)d.push(f);for(f=i("A");f<=i("Z");f++)d.push(f);var h=[i(" "),i("\f"),i(`
`),i("\r"),i(" "),i("\v"),i(" "),i("\xA0"),i("\u1680"),i("\u2000"),i("\u2001"),i("\u2002"),i("\u2003"),i("\u2004"),i("\u2005"),i("\u2006"),i("\u2007"),i("\u2008"),i("\u2009"),i("\u200A"),i("\u2028"),i("\u2029"),i("\u202F"),i("\u205F"),i("\u3000"),i("\uFEFF")];function _(){}return _.prototype.visitChildren=function(l){for(var v in l){var y=l[v];l.hasOwnProperty(v)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(T){this.visit(T)},this))}},_.prototype.visit=function(l){switch(l.type){case"Pattern":this.visitPattern(l);break;case"Flags":this.visitFlags(l);break;case"Disjunction":this.visitDisjunction(l);break;case"Alternative":this.visitAlternative(l);break;case"StartAnchor":this.visitStartAnchor(l);break;case"EndAnchor":this.visitEndAnchor(l);break;case"WordBoundary":this.visitWordBoundary(l);break;case"NonWordBoundary":this.visitNonWordBoundary(l);break;case"Lookahead":this.visitLookahead(l);break;case"NegativeLookahead":this.visitNegativeLookahead(l);break;case"Character":this.visitCharacter(l);break;case"Set":this.visitSet(l);break;case"Group":this.visitGroup(l);break;case"GroupBackReference":this.visitGroupBackReference(l);break;case"Quantifier":this.visitQuantifier(l);break}this.visitChildren(l)},_.prototype.visitPattern=function(l){},_.prototype.visitFlags=function(l){},_.prototype.visitDisjunction=function(l){},_.prototype.visitAlternative=function(l){},_.prototype.visitStartAnchor=function(l){},_.prototype.visitEndAnchor=function(l){},_.prototype.visitWordBoundary=function(l){},_.prototype.visitNonWordBoundary=function(l){},_.prototype.visitLookahead=function(l){},_.prototype.visitNegativeLookahead=function(l){},_.prototype.visitCharacter=function(l){},_.prototype.visitSet=function(l){},_.prototype.visitGroup=function(l){},_.prototype.visitGroupBackReference=function(l){},_.prototype.visitQuantifier=function(l){},{RegExpParser:e,BaseRegExpVisitor:_,VERSION:"0.5.0"}})});var bh=u((hG,xh)=>{function SC(e){return e&&e.length?e[0]:void 0}xh.exports=SC});var er=u((vG,Ch)=>{Ch.exports=bh()});var en=u((_G,Lh)=>{function PC(e){for(var t=-1,r=e==null?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i}Lh.exports=PC});var za=u((yG,kh)=>{var xC=ot();function bC(e,t){var r=[];return xC(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}kh.exports=bC});var Mh=u((mG,qh)=>{var CC="Expected a function";function LC(e){if(typeof e!="function")throw new TypeError(CC);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}qh.exports=LC});var oi=u((gG,Fh)=>{var kC=qn(),qC=za(),MC=Ae(),FC=C(),wC=Mh();function DC(e,t){var r=FC(e)?kC:qC;return r(e,wC(MC(t,3)))}Fh.exports=DC});var Dh=u((TG,wh)=>{var UC=bn(),jC=ja(),GC=Ga(),BC=Ut(),WC=wt(),KC=Cn(),VC=200;function HC(e,t,r,n){var i=-1,a=jC,o=!0,s=e.length,c=[],f=t.length;if(!s)return c;r&&(t=BC(t,WC(r))),n?(a=GC,o=!1):t.length>=VC&&(a=KC,o=!1,t=new UC(t));e:for(;++i<s;){var p=e[i],d=r==null?p:r(p);if(p=n||p!==0?p:0,o&&d===d){for(var h=f;h--;)if(t[h]===d)continue e;c.push(p)}else a(t,d,n)||c.push(p)}return c}wh.exports=HC});var jh=u((EG,Uh)=>{var zC=Ee(),XC=Te();function YC(e){return XC(e)&&zC(e)}Uh.exports=YC});var si=u((AG,Bh)=>{var $C=Dh(),ZC=Qn(),JC=Vn(),Gh=jh(),QC=JC(function(e,t){return Gh(e)?$C(e,ZC(t,1,Gh,!0)):[]});Bh.exports=QC});var Kh=u((OG,Wh)=>{var eL=$n(),tL=Zt(),rL=Math.max;function nL(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:tL(r);return i<0&&(i=rL(n+i,0)),eL(e,t,i)}Wh.exports=nL});var Hh=u((RG,Vh)=>{var iL=Ae(),aL=Ee(),oL=ce();function sL(e){return function(t,r,n){var i=Object(t);if(!aL(t)){var a=iL(r,3);t=oL(t),r=function(s){return a(i[s],s,i)}}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}Vh.exports=sL});var Xh=u((IG,zh)=>{var uL=wa(),cL=Ae(),lL=Zt(),fL=Math.max;function dL(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:lL(r);return i<0&&(i=fL(n+i,0)),uL(e,cL(t,3),i)}zh.exports=dL});var ui=u((NG,Yh)=>{var pL=Hh(),hL=Xh(),vL=pL(hL);Yh.exports=vL});var ci=u((SG,
`;function KL(e,t){t===void 0&&(t=!1);try{var r=(0,sv.getRegExpAst)(e),n=pi(r.value,{},r.flags.ignoreCase);return n}catch(a){if(a.message===uv)t&&(0,iv.PRINT_WARNING)("".concat($.failedOptimizationPrefixMsg)+" Unable to optimize: < ".concat(e.toString(),` >
`)+` Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";t&&(i=`
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,iv.PRINT_ERROR)("".concat($.failedOptimizationPrefixMsg,`
`)+" Failed parsing: < ".concat(e.toString(),` >
`)+" Using the regexp-to-ast library version: ".concat(ov.VERSION,`
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}$.getOptimizedStartCodesIndices=KL;function pi(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n<e.value.length;n++)pi(e.value[n],t,r);break;case"Alternative":for(var i=e.value,n=0;n<i.length;n++){var a=i[n];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=a;switch(o.type){case"Character":di(o.value,t,r);break;case"Set":if(o.complement===!0)throw Error(uv);(0,BL.default)(o.value,function(f){if(typeof f=="number")di(f,t,r);else{var p=f;if(r===!0)for(var d=p.from;d<=p.to;d++)di(d,t,r);else{for(var d=p.from;d<=p.to&&d<ze.minOptimizationVal;d++)di(d,t,r);if(p.to>=ze.minOptimizationVal)for(var h=p.from>=ze.minOptimizationVal?p.from:ze.minOptimizationVal,_=p.to,l=(0,ze.charCodeToOptimizedIndex)(h),v=(0,ze.charCodeToOptimizedIndex)(_),y=l;y<=v;y++)t[y]=y}}});break;case"Group":pi(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}var s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&$a(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return(0,WL.default)(t)}$.firstCharOptimizedIndices=pi;function di(e,t,r){var n=(0,ze.charCodeToOptimizedIndex)(e);t[n]=n,r===!0&&VL(e,t)}function VL(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){var i=(0,ze.charCodeToOptimizedIndex)(n.charCodeAt(0));t[i]=i}else{var a=r.toLowerCase();if(a!==r){var i=(0,ze.charCodeToOptimizedIndex)(a.charCodeAt(0));t[i]=i}}}function av(e,t){return(0,Ya.default)(e.value,function(r){if(typeof r=="number")return(0,Za.default)(t,r);var n=r;return(0,Ya.default)(t,function(i){return n.from<=i&&i<=n.to})!==void 0})}function $a(e){var t=e.quantifier;return t&&t.atLeast===0?!0:e.value?(0,jL.default)(e.value)?(0,GL.default)(e.value,$a):$a(e.value):!1}var HL=function(e){UL(t,e);function t(r){var n=e.call(this)||this;return n.targetCharCodes=r,n.found=!1,n}return t.prototype.visitChildren=function(r){if(this.found!==!0){switch(r.type){case"Lookahead":this.visitLookahead(r);return;case"NegativeLookahead":this.visitNegativeLookahead(r);return}e.prototype.visitChildren.call(this,r)}},t.prototype.visitCharacter=function(r){(0,Za.default)(this.targetCharCodes,r.value)&&(this.found=!0)},t.prototype.visitSet=function(r){r.complement?av(r,this.targetCharCodes)===void 0&&(this.found=!0):av(r,this.targetCharCodes)!==void 0&&(this.found=!0)},t}(ov.BaseRegExpVisitor);function zL(e,t){if(t instanceof RegExp){var r=(0,sv.getRegExpAst)(t),n=new HL(e);return n.visit(r),n.found}else return(0,Ya.default)(t,function(i){return(0,Za.default)(e,i.charCodeAt(0))})!==void 0}$.canMatchCharCode=zL});var Ja=u(E=>{"use strict";var dv=E&&E.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),j=E&&E.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0});E.charCodeToOptimizedIndex=E.minOptimizationVal=E.buildLineBreakIssueMessage=E.LineTerminatorOptimizedTester=E.isShortPattern=E.isCustomPattern=E.cloneEmptyGroups=E.performWarningRuntimeChecks=E.performRuntimeChecks=E.addStickyFlag=E.addStartOfInput=E.findUnreachablePatterns=E.findModesThatDoNotExist=E.findInvalidGroupType=E.findDuplicatePatterns=E.findUnsupportedFlags=E.findStartOfInputAnchor=E.findEmptyMatchRegExps=E.findEndOfInputAnchor=E.findInvalidPatterns=E.findMissingPatterns=E.validatePatterns=E.analyzeTokenTypes=E.enableSticky=E.disableSticky=E.SUPPORT_STICKY=E.MODES=E.DEFAULT_MODE=void 0;var pv=ai(),k=tn(),XL=j(er()),hv=j(pe()),vv=j(en()),vi=j(C()),YL=j(Pe()),$L=j(qe(
`],tracer:function(A,g){return g()}});var r=t.tracer;r("initCharCodeToOptimizedIndexMap",function(){dk()});var n;r("Reject Lexer.NA",function(){n=(0,_v.default)(e,function(A){return A[Tt]===k.Lexer.NA})});var i=!1,a;r("Transform Patterns",function(){i=!1,a=(0,D.default)(n,function(A){var g=A[Tt];if((0,ut.default)(g)){var R=g.source;return R.length===1&&R!=="^"&&R!=="$"&&R!=="."&&!g.ignoreCase?R:R.length===2&&R[0]==="\\"&&!(0,mi.default)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],R[1])?R[1]:t.useSticky?ro(g):to(g)}else{if((0,yi.default)(g))return i=!0,{exec:g};if(typeof g=="object")return i=!0,g;if(typeof g=="string"){if(g.length===1)return g;var V=g.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),L=new RegExp(V);return t.useSticky?ro(L):to(L)}else throw Error("non exhaustive match")}})});var o,s,c,f,p;r("misc mapping",function(){o=(0,D.default)(n,function(A){return A.tokenTypeIdx}),s=(0,D.default)(n,function(A){var g=A.GROUP;if(g!==k.Lexer.SKIPPED){if((0,Ye.default)(g))return g;if((0,eo.default)(g))return!1;throw Error("non exhaustive match")}}),c=(0,D.default)(n,function(A){var g=A.LONGER_ALT;if(g){var R=(0,vi.default)(g)?(0,D.default)(g,function(V){return(0,lv.default)(n,V)}):[(0,lv.default)(n,g)];return R}}),f=(0,D.default)(n,function(A){return A.PUSH_MODE}),p=(0,D.default)(n,function(A){return(0,Z.default)(A,"POP_MODE")})});var d;r("Line Terminator Handling",function(){var A=Lv(t.lineTerminatorCharacters);d=(0,D.default)(n,function(g){return!1}),t.positionTracking!=="onlyOffset"&&(d=(0,D.default)(n,function(g){return(0,Z.default)(g,"LINE_BREAKS")?!!g.LINE_BREAKS:bv(g,A)===!1&&(0,nr.canMatchCharCode)(A,g.PATTERN)}))});var h,_,l,v;r("Misc Mapping #2",function(){h=(0,D.default)(n,io),_=(0,D.default)(a,xv),l=(0,_i.default)(n,function(A,g){var R=g.GROUP;return(0,Ye.default)(R)&&R!==k.Lexer.SKIPPED&&(A[R]=[]),A},{}),v=(0,D.default)(a,function(A,g){return{pattern:a[g],longerAlt:c[g],canLineTerminator:d[g],isCustom:h[g],short:_[g],group:s[g],push:f[g],pop:p[g],tokenTypeIdx:o[g],tokenType:n[g]}})});var y=!0,T=[];return t.safeMode||r("First Char Optimization",function(){T=(0,_i.default)(n,function(A,g,R){if(typeof g.PATTERN=="string"){var V=g.PATTERN.charCodeAt(0),L=no(V);Qa(A,L,v[R])}else if((0,vi.default)(g.START_CHARS_HINT)){var re;(0,Xe.default)(g.START_CHARS_HINT,function(Y){var oe=typeof Y=="string"?Y.charCodeAt(0):Y,se=no(oe);re!==se&&(re=se,Qa(A,se,v[R]))})}else if((0,ut.default)(g.PATTERN))if(g.PATTERN.unicode)y=!1,t.ensureOptimizations&&(0,fv.PRINT_ERROR)("".concat(nr.failedOptimizationPrefixMsg)+" Unable to analyze < ".concat(g.PATTERN.toString(),` > pattern.
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var Ne=(0,nr.getOptimizedStartCodesIndices)(g.PATTERN,t.ensureOptimizations);(0,hv.default)(Ne)&&(y=!1),(0,Xe.default)(Ne,function(Y){Qa(A,Y,v[R])})}else t.ensureOptimizations&&(0,fv.PRINT_ERROR)("".concat(nr.failedOptimizationPrefixMsg)+" TokenType: <".concat(g.name,`> is using a custom token pattern without providing <start_chars_hint> parameter.
`)+` This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return A},[])}),{emptyGroups:l,patternIdxToConfig:v,charCodeToPatternIdxToConfig:T,hasCustom:i,canBeOptimized:y}}E.analyzeTokenTypes=rk;function nk(e,t){var r=[],n=gv(e);r=r.concat(n.errors);var i=Tv(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(ik(a)),r=r.concat(Nv(a)),r=r.concat(Sv(a,t)),r=r.concat(Pv(a)),r}E.validatePatterns=nk;function ik(e){var t=[],r=(0,Me.default)(e,function(n){return(0,ut.default)(n[Tt])});return t=t.concat(Ev(r)),t=t.concat(Ov(r)),t=t.concat(Rv(r)),t=t.concat(Iv(r)),t=t.concat(Av(r)),t}function gv(e){var t=(0,Me.default)(e,function(i){return!(0,Z.default)(i,Tt)}),r=(0,D.default)(t,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:k.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[i]}}),n=(0,yv.default)(e,t);return{errors:r,valid:n}}E.findMissingPatterns=gv;function Tv(e){var t=(0,Me.default)(e,function(i){var a=i[Tt];return!(0,ut.default)(a)&&!(0,yi.default)(a)&&!(0,Z.default)(a,"exec")&&!(0,Ye.default)(a)}),r=(0,D.default)(t,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:k.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[i]}}),n=(0,yv.default)(e,t);return{errors:r,valid:n}}E.findInvalidPatterns=Tv;var ak=/[^\\][$]/;function Ev(e){var t=function(i){dv(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitEndAnchor=function(o){this.found=!0},a}(pv.BaseRegExpVisitor),r=(0,Me.default)(e,function(i){var a=i.PATTERN;try{var o=(0,mv.getRegExpAst)(a),s=new t;return s.visit(o),s.found}catch(c){return ak.test(a.source)}}),n=(0,D.default)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:k.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}E.findEndOfInputAnchor=Ev;function Av(e){var t=(0,Me.default)(e,function(n){var i=n.PATTERN;return i.test("")}),r=(0,D.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:k.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[n]}});return r}E.findEmptyMatchRegExps=Av;var ok=/[^\\[][\^]|^\^/;function Ov(e){var t=function(i){dv(a,i);function a(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return a.prototype.visitStartAnchor=function(o){this.found=!0},a}(pv.BaseRegExpVisitor),r=(0,Me.default)(e,function(i){var a=i.PATTERN;try{var o=(0,mv.getRegExpAst)(a),s=new t;return s.visit(o),s.found}catch(c){return ok.test(a.source)}}),n=(0,D.default)(r,function(i){return{message:`Unexpected RegExp Anchor Error:
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:k.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return n}E.findStartOfInputAnchor=Ov;function Rv(e){var t=(0,Me.default)(e,function(n){var i=n[Tt];return i instanceof RegExp&&(i.multiline||i.global)}),r=(0,D.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:k.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}});return r}E.findUnsupportedFlags=Rv;function Iv(e){var t=[],r=(0,D.default)(e,function(a){return(0,_i.default)(e,function(o,s){return a.PATTERN.source===s.PATTERN.source&&!(0,mi.default)(t,s)&&s.PATTERN!==k.Lexer.NA&&(t.push(s),o.push(s)),o},[])});r=(0,vv.default)(r);var n=(0,Me.default)(r,function(a){return a.length>1}),i=(0,D.default)(n,function(a){var o=(0,D.default)(a,function(c){return c.name}),s=(0,XL.default)(a).PATTERN;return{message:"The same RegExp pattern ->".concat(s,"<-")+"has been used in all of the following Token Types: ".concat(o.join(", ")," <-"),type:k.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}});return i}E.findDuplicatePatterns=Iv;function Nv(e){var t=(0,Me.default)(e,function(n){if(!(0,Z.default)(n,"GROUP"))return!1;var i=n.GROUP;return i!==k.Lexer.SKIPPED&&i!==k.Lexer.NA&&!(0,Ye.default)(i)}),r=(0,D.default)(t,function(n){return{message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:k.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}});return r}E.findInvalidGroupType=Nv;function Sv(e,t){var r=(0,Me.default)(e,function(i){return i.PUSH_MODE!==void 0&&!(0,mi.default)(t,i.PUSH_MODE)}),n=(0,D.default)(r,function(i){var a="Token Type: ->".concat(i.name,"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->").concat(i.PUSH_MODE,"<-")+"which does not exist";return{message:a,type:k.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return n}E.findModesThatDoNotExist=Sv;function Pv(e){var t=[],r=(0,_i.default)(e,function(n,i,a){var o=i.PATTERN;return o===k.Lexer.NA||((0,Ye.default)(o)?n.push({str:o,idx:a,tokenType:i}):(0,ut.default)(o)&&uk(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return(0,Xe.default)(e,function(n,i){(0,Xe.default)(r,function(a){var o=a.str,s=a.idx,c=a.tokenType;if(i<s&&sk(o,n.PATTERN)){var f="Token: ->".concat(c.name,`<- can never be matched.
`)+"Because it appears AFTER the Token Type ->".concat(n.name,"<-")+`in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:f,type:k.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[n,c]})}})}),t}E.findUnreachablePatterns=Pv;function sk(e,t){if((0,ut.default)(t)){var r=t.exec(e);return r!==null&&r.index===0}else{if((0,yi.default)(t))return t(e,0,[],{});if((0,Z.default)(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function uk(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,ZL.default)(t,function(r){return e.source.indexOf(r)!==-1})===void 0}function to(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:".concat(e.source,")"),t)}E.addStartOfInput=to;function ro(e){var t=e.ignoreCase?"iy":"y";return new RegExp("".concat(e.source),t)}E.addStickyFlag=ro;function ck(e,t,r){var n=[];return(0,Z.default)(e,E.DEFAULT_MODE)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+E.DEFAULT_MODE+`> property in its definition
`,type:k.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Z.default)(e,E.MODES)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+E.MODES+`> property in its definition
`,type:k.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Z.default)(e,E.MODES)&&(0,Z.default)(e,E.DEFAULT_MODE)&&!(0,Z.default)(e.modes,e.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a ".concat(E.DEFAULT_MODE,": <").concat(e.defaultMode,">")+`which does not exist
`,type:k.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Z.default)(e,E.MODES)&&(0,Xe.default)(e.modes,function(i,a){(0,Xe.default)(i,function(o,s){if((0,eo.default)(o))n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+"<".concat(a,"> at index: <").concat(s,`>
`),type:k.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if((0,Z.default)(o,"LONGER_ALT")){var c=(0,vi.default)(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];(0,Xe.default)(c,function(f){!(0,eo.default)(f)&&!(0,mi.default)(i,f)&&n.push({message:"A MultiMode Lexer cannot be initialized with a longer_alt <".concat(f.name,"> on token <").concat(o.name,"> outside of mode <").concat(a,`>
`),type:k.LexerDefinitionErrorType.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}E.performRuntimeChecks=ck;function lk(e,t,r){var n=[],i=!1,a=(0,vv.default)((0,$L.default)((0,YL.default)(e.modes))),o=(0,_v.default)(a,function(c){return c[Tt]===k.Lexer.NA}),s=Lv(r);return t&&(0,Xe.default)(o,function(c){var f=bv(c,s);if(f!==!1){var p=Cv(c,f),d={message:p,type:f.issue,tokenType:c};n.push(d)}else(0,Z.default)(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):(0,nr.canMatchCharCode)(s,c.PATTERN)&&(i=!0)}),t&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
for details.`,type:k.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}E.performWarningRuntimeChecks=lk;function fk(e){var t={},r=(0,JL.default)(e);return(0,Xe.default)(r,function(n){var i=e[n];if((0,vi.default)(i))t[n]=[];else throw Error("non exhaustive match")}),t}E.cloneEmptyGroups=fk;function io(e){var t=e.PATTERN;if((0,ut.default)(t))return!1;if((0,yi.default)(t))return!0;if((0,Z.default)(t,"exec"))return!0;if((0,Ye.default)(t))return!1;throw Error("non exhaustive match")}E.isCustomPattern=io;function xv(e){return(0,Ye.default)(e)&&e.length===1?e.charCodeAt(0):!1}E.isShortPattern=xv;E.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,r=this.lastIndex;r<t;r++){var n=e.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return e.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function bv(e,t){if((0,Z.default)(e,"LINE_BREAKS"))return!1;if((0,ut.default)(e.PATTERN)){try{(0,nr.canMatchCharCode)(t,e.PATTERN)}catch(r){return{issue:k.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if((0,Ye.default)(e.PATTERN))return!1;if(io(e))return{issue:k.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Cv(e,t){if(t.issue===k.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
`+" The problem is in the <".concat(e.name,`> Token Type
`)+" Root cause: ".concat(t.errMsg,`.
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===k.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
`+" The problem is in the <".concat(e.name,`> Token Type
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}E.buildLineBreakIssueMessage=Cv;function Lv(e){var t=(0,D.default)(e,function(r){return(0,Ye.default)(r)?r.charCodeAt(0):r});return t}function Qa(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}E.minOptimizationVal=256;var hi=[];function no(e){return e<E.minOptimizationVal?e:hi[e]}E.charCodeToOptimizedIndex=no;function dk(){if((0,hv.default)(hi)){hi=new Array(65536);for(var e=0;e<65536;e++)hi[e]=e>255?255+~~(e/255):e}}});var gi=u((MG,kv)=>{function pk(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}kv.exports=pk});var At=u(O=>{"use strict";var Fe=O&&O.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0});O.isTokenType=O.hasExtendingTokensTypesMapProperty=O.hasExtendingTokensTypesProperty=O.hasCategoriesProperty=O.hasShortKeyProperty=O.singleAssignCategoriesToksMap=O.assignCategoriesMapProp=O.assignCategoriesTokensProp=O.assignTokenDefaultProps=O.expandCategories=O.augmentTokenTypes=O.tokenIdxToClass=O.tokenShortNameIdx=O.tokenStructuredMatcherNoCategories=O.tokenStructuredMatcher=void 0;var hk=Fe(pe()),vk=Fe(en()),_k=Fe(C()),yk=Fe(qe()),mk=Fe(si()),gk=Fe(Q()),Et=Fe(z()),rn=Fe(le()),Tk=Fe(He()),Ek=Fe(Ke());function Ak(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}O.tokenStructuredMatcher=Ak;function Ok(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}O.tokenStructuredMatcherNoCategories=Ok;O.tokenShortNameIdx=1;O.tokenIdxToClass={};function Rk(e){var t=qv(e);Mv(t),wv(t),Fv(t),(0,Et.default)(t,function(r){r.isParent=r.categoryMatches.length>0})}O.augmentTokenTypes=Rk;function qv(e){for(var t=(0,Ek.default)(e),r=e,n=!0;n;){r=(0,vk.default)((0,yk.default)((0,gk.default)(r,function(a){return a.CATEGORIES})));var i=(0,mk.default)(r,t);t=t.concat(i),(0,hk.default)(i)?n=!1:r=i}return t}O.expandCategories=qv;function Mv(e){(0,Et.default)(e,function(t){Dv(t)||(O.tokenIdxToClass[O.tokenShortNameIdx]=t,t.tokenTypeIdx=O.tokenShortNameIdx++),ao(t)&&!(0,_k.default)(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),ao(t)||(t.CATEGORIES=[]),Uv(t)||(t.categoryMatches=[]),jv(t)||(t.categoryMatchesMap={})})}O.assignTokenDefaultProps=Mv;function Fv(e){(0,Et.default)(e,function(t){t.categoryMatches=[],(0,Et.default)(t.categoryMatchesMap,function(r,n){t.categoryMatches.push(O.tokenIdxToClass[n].tokenTypeIdx)})})}O.assignCategoriesTokensProp=Fv;function wv(e){(0,Et.default)(e,function(t){oo([],t)})}O.assignCategoriesMapProp=wv;function oo(e,t){(0,Et.default)(e,function(r){t.categoryMatchesMap[r.tokenTypeIdx]=!0}),(0,Et.default)(t.CATEGORIES,function(r){var n=e.concat(t);(0,Tk.default)(n,r)||oo(n,r)})}O.singleAssignCategoriesToksMap=oo;function Dv(e){return(0,rn.default)(e,"tokenTypeIdx")}O.hasShortKeyProperty=Dv;function ao(e){return(0,rn.default)(e,"CATEGORIES")}O.hasCategoriesProperty=ao;function Uv(e){return(0,rn.default)(e,"categoryMatches")}O.hasExtendingTokensTypesProperty=Uv;function jv(e){return(0,rn.default)(e,"categoryMatchesMap")}O.hasExtendingTokensTypesMapProperty=jv;function Ik(e){return(0,rn.default)(e,"tokenTypeIdx")}O.isTokenType=Ik});var so=u(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.defaultLexerErrorProvider=void 0;Ti.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->".concat(e.image,"<- The Mode Stack is empty")},buildUnexpectedCharactersMessage:function(e,t,r,n,i){return"unexpected character: ->".concat(e.charAt(t),"<- at offset: ").concat(t,",")+" skipped ".concat(r," characters.")}}});var tn=u(Ze=>{"use strict";var fe=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.Lexer=Ze.LexerDefinitionErrorType=void 0;var $e=Ja(),uo=fe(ei()),Ei=fe(pe()),Nk=fe(C()),Sk=fe(gi()),Pk=fe(oi()),Gv=fe(Q()),co=fe(z()),xk=fe(ce()),bk=fe(gt()),Bv=fe(Ht()),Wv=fe(Zr()),Ck=fe(st()),Kv=fe(Ke()),lo=$t(),Lk=At(),kk=so(),qk=fi(
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:kk.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(nn);var Fk=function(){function e(t,r){r===void 0&&(r=nn);var n=this;if(this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=function(a,o){if(n.traceInitPerf===!0){n.traceInitIndent++;var s=new Array(n.traceInitIndent+1).join(" ");n.traceInitIndent<n.traceInitMaxIdent&&console.log("".concat(s,"--> <").concat(a,">"));var c=(0,lo.timer)(o),f=c.time,p=c.value,d=f>10?console.warn:console.log;return n.traceInitIndent<n.traceInitMaxIdent&&d("".concat(s,"<-- <").concat(a,"> time: ").concat(f,"ms")),n.traceInitIndent--,p}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=(0,Wv.default)({},nn,r);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var a,o=!0;n.TRACE_INIT("Lexer Config handling",function(){if(n.config.lineTerminatorsPattern===nn.lineTerminatorsPattern)n.config.lineTerminatorsPattern=$e.LineTerminatorOptimizedTester;else if(n.config.lineTerminatorCharacters===nn.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),(0,Nk.default)(t)?a={modes:{defaultMode:(0,Kv.default)(t)},defaultMode:$e.DEFAULT_MODE}:(o=!1,a=(0,Kv.default)(t))}),n.config.skipValidations===!1&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,$e.performRuntimeChecks)(a,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat((0,$e.performWarningRuntimeChecks)(a,n.trackStartLines,n.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},(0,co.default)(a.modes,function(p,d){a.modes[d]=(0,Pk.default)(p,function(h){return(0,bk.default)(h)})});var s=(0,xk.default)(a.modes);if((0,co.default)(a.modes,function(p,d){n.TRACE_INIT("Mode: <".concat(d,"> processing"),function(){if(n.modes.push(d),n.config.skipValidations===!1&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat((0,$e.validatePatterns)(p,s))}),(0,Ei.default)(n.lexerDefinitionErrors)){(0,Lk.augmentTokenTypes)(p);var h;n.TRACE_INIT("analyzeTokenTypes",function(){h=(0,$e.analyzeTokenTypes)(p,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT})}),n.patternIdxToConfig[d]=h.patternIdxToConfig,n.charCodeToPatternIdxToConfig[d]=h.charCodeToPatternIdxToConfig,n.emptyGroups=(0,Wv.default)({},n.emptyGroups,h.emptyGroups),n.hasCustom=h.hasCustom||n.hasCustom,n.canModeBeOptimized[d]=h.canBeOptimized}})}),n.defaultMode=a.defaultMode,!(0,Ei.default)(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var c=(0,Gv.default)(n.lexerDefinitionErrors,function(p){return p.message}),f=c.join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+f)}(0,co.default)(n.lexerDefinitionWarning,function(p){(0,lo.PRINT_WARNING)(p.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if($e.SUPPORT_STICKY?(n.chopInput=Bv.default,n.match=n.matchWithTest):(n.updateLastIndex=uo.default,n.match=n.matchWithExec),o&&(n.handleModes=uo.default),n.trackStartLines===!1&&(n.computeNewColumn=Bv.default),n.trackEndLines===!1&&(n.updateTokenEndLineColumnLocation=uo.default),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else if(/onlyOffset/i.test(n.config.positionTracking))n.createTokenInstance=n.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'.concat(n.config.positionTracking,'"'));n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)}),n.TRACE_INIT("Failed Optimization Warnings",function(){var p=(0,Ck.default)(n.canModeBeOptimized,function(d,h,_){return h===!1&&d.push(_),d},[]);if(r.ensureOptimizations&&!(0,Ei.default)(p))throw Error("Lexer Modes: < ".concat(p.join(", "),` > cannot be optimized.
`)+` Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),n.TRACE_INIT("clearRegExpParserCache",function(){(0,qk.clearRegExpParserCache)()}),n.TRACE_INIT("toFastProperties",function(){(0,lo.toFastProperties)(n)})})}return e.prototype.tokenize=function(t,r){if(r===void 0&&(r=this.defaultMode),!(0,Ei.default)(this.lexerDefinitionErrors)){var n=(0,Gv.default)(this.lexerDefinitionErrors,function(a){return a.message}),i=n.join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+i)}return this.tokenizeInternal(t,r)},e.prototype.tokenizeInternal=function(t,r){var n=this,i,a,o,s,c,f,p,d,h,_,l,v,y,T,A,g,R=t,V=R.length,L=0,re=0,Ne=this.hasCustom?0:Math.floor(t.length/10),Y=new Array(Ne),oe=[],se=this.trackStartLines?1:void 0,Se=this.trackStartLines?1:void 0,We=(0,$e.cloneEmptyGroups)(this.emptyGroups),Xi=this.trackStartLines,Nr=this.config.lineTerminatorsPattern,Tn=0,rt=[],Sr=[],En=[],zo=[];Object.freeze(zo);var Pr;function Xo(){return rt}function Yo(ue){var Cr=(0,$e.charCodeToOptimizedIndex)(ue),Ct=Sr[Cr];return Ct===void 0?zo:Ct}var Im=function(ue){if(En.length===1&&ue.tokenType.PUSH_MODE===void 0){var Cr=n.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ue);oe.push({offset:ue.startOffset,line:ue.startLine,column:ue.startColumn,length:ue.image.length,message:Cr})}else{En.pop();var Ct=(0,Sk.default)(En);rt=n.patternIdxToConfig[Ct],Sr=n.charCodeToPatternIdxToConfig[Ct],Tn=rt.length;var Pm=n.canModeBeOptimized[Ct]&&n.config.safeMode===!1;Sr&&Pm?Pr=Yo:Pr=Xo}};function $o(ue){En.push(ue),Sr=this.charCodeToPatternIdxToConfig[ue],rt=this.patternIdxToConfig[ue],Tn=rt.length,Tn=rt.length;var Cr=this.canModeBeOptimized[ue]&&this.config.safeMode===!1;Sr&&Cr?Pr=Yo:Pr=Xo}$o.call(this,r);for(var ye,Zo=this.config.recoveryEnabled;L<V;){f=null;var Jo=R.charCodeAt(L),Qo=Pr(Jo),Nm=Qo.length;for(i=0;i<Nm;i++){ye=Qo[i];var nt=ye.pattern;p=null;var xr=ye.short;if(xr!==!1?Jo===xr&&(f=nt):ye.isCustom===!0?(g=nt.exec(R,L,Y,We),g!==null?(f=g[0],g.payload!==void 0&&(p=g.payload)):f=null):(this.updateLastIndex(nt,L),f=this.match(nt,t,L)),f!==null){if(c=ye.longerAlt,c!==void 0){var Sm=c.length;for(o=0;o<Sm;o++){var Yi=rt[c[o]],$i=Yi.pattern;if(d=null,Yi.isCustom===!0?(g=$i.exec(R,L,Y,We),g!==null?(s=g[0],g.payload!==void 0&&(d=g.payload)):s=null):(this.updateLastIndex($i,L),s=this.match($i,t,L)),s&&s.length>f.length){f=s,p=d,ye=Yi;break}}}break}}if(f!==null){if(h=f.length,_=ye.group,_!==void 0&&(l=ye.tokenTypeIdx,v=this.createTokenInstance(f,L,l,ye.tokenType,se,Se,h),this.handlePayload(v,p),_===!1?re=this.addToken(Y,re,v):We[_].push(v)),t=this.chopInput(t,h),L=L+h,Se=this.computeNewColumn(Se,h),Xi===!0&&ye.canLineTerminator===!0){var An=0,Zi=void 0,Ji=void 0;Nr.lastIndex=0;do Zi=Nr.test(f),Zi===!0&&(Ji=Nr.lastIndex-1,An++);while(Zi===!0);An!==0&&(se=se+An,Se=h-Ji,this.updateTokenEndLineColumnLocation(v,_,Ji,An,se,Se,h))}this.handleModes(ye,Im,$o,v)}else{for(var Qi=L,es=se,ts=Se,br=Zo===!1;br===!1&&L<V;)for(t=this.chopInput(t,1),L++,a=0;a<Tn;a++){var ea=rt[a],nt=ea.pattern,xr=ea.short;if(xr!==!1?R.charCodeAt(L)===xr&&(br=!0):ea.isCustom===!0?br=nt.exec(R,L,Y,We)!==null:(this.updateLastIndex(nt,L),br=nt.exec(t)!==null),br===!0)break}if(y=L-Qi,A=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,Qi,y,es,ts),oe.push({offset:Qi,line:es,column:ts,length:y,message:A}),Zo===!1)break}}return this.hasCustom||(Y.length=re),{tokens:Y,groups:We,errors:oe}},e.prototype.handleModes=function(t,r,n,i){if(t.pop===!0){var a=t.push;r(i),a!==void 0&&n.call(this,a)}else t.push!==void 0&&n.call(this,t.push)},e.prototype.chopInput=function(t,r){return t.substring(r)},e.prototype.updateLastIndex=function(t,r){t.lastIndex=r},e.prototype.updateTokenEndLineColumnLocation=function(t,r,n,i,a,o,s){var c,f;r!==void 0&&(c=n===s-1,f=c?-1:0,i===1&&c===!0||(t.endLine=a+f,t.endColumn=o-1+-f))},e.prototype.computeNewColumn=function(t,r){return t+r},e.prototype.createOffsetOnlyToken=function(t,r,n,i){return{image:t,startOffset:r,tokenTypeIdx:n,tokenType:i}},e.prototype.createStartOnlyToken=function(t,r,n,i,a,o){return{image:t,startOffset:r,startLine:a,startColumn:o,tokenTypeIdx:n,tokenType:i}},e.prototype.createFullToken=function(t,r,n,i,a,o,s){return{image:t,startOffset:r,endOffset:r+s-1,startLine:a,endLine:a,startColumn:o,endColumn:o+s-1,tokenTypeIdx:n,tokenType:i}},e.prototype.addTokenUsingPush=function(t,r,n){return t.push(n),r},e.prototype.addTokenUsingMemberAccess=function(t,r,n){return t[r]=n,r++,r},e.prototype.handlePayloadNoCustom=function(t,r){},e.prototype.handlePayloadWithCustom=function(t,r){r!==null&&(t.payload=r)},e
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Je.default)(e,Vv)&&(r.CATEGORIES=e[Vv]),(0,po.augmentTokenTypes)([r]),(0,Je.default)(e,Hv)&&(r.LABEL=e[Hv]),(0,Je.default)(e,zv)&&(r.GROUP=e[zv]),(0,Je.default)(e,Yv)&&(r.POP_MODE=e[Yv]),(0,Je.default)(e,Xv)&&(r.PUSH_MODE=e[Xv]),(0,Je.default)(e,$v)&&(r.LONGER_ALT=e[$v]),(0,Je.default)(e,Zv)&&(r.LINE_BREAKS=e[Zv]),(0,Je.default)(e,Jv)&&(r.START_CHARS_HINT=e[Jv]),r}K.EOF=e_({name:"EOF",pattern:Uk.Lexer.NA});(0,po.augmentTokenTypes)([K.EOF]);function Kk(e,t,r,n,i,a,o,s){return{image:t,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}K.createTokenInstance=Kk;function Vk(e,t){return(0,po.tokenStructuredMatcher)(e,t)}K.tokenMatcher=Vk});var ar=u(Oe=>{"use strict";var _o=Oe&&Oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.defaultGrammarValidatorErrorProvider=Oe.defaultGrammarResolverErrorProvider=Oe.defaultParserErrorProvider=void 0;var ir=Ot(),vo=_o(er()),ct=_o(Q()),Hk=_o(st()),ho=G(),t_=G();Oe.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual,n=e.previous,i=e.ruleName,a=(0,ir.hasTokenLabel)(t),o=a?"--> ".concat((0,ir.tokenLabel)(t)," <--"):"token of type --> ".concat(t.name," <--"),s="Expecting ".concat(o," but found --> '").concat(r.image,"' <--");return s},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant,r=e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,n=e.previous,i=e.customUserDescription,a=e.ruleName,o="Expecting: ",s=(0,vo.default)(r).image,c=`
but found: '`+s+"'";if(i)return o+i+c;var f=(0,Hk.default)(t,function(_,l){return _.concat(l)},[]),p=(0,ct.default)(f,function(_){return"[".concat((0,ct.default)(_,function(l){return(0,ir.tokenLabel)(l)}).join(", "),"]")}),d=(0,ct.default)(p,function(_,l){return" ".concat(l+1,". ").concat(_)}),h=`one of these possible Token sequences:
`.concat(d.join(`
`));return o+h+c},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,n=e.customUserDescription,i=e.ruleName,a="Expecting: ",o=(0,vo.default)(r).image,s=`
but found: '`+o+"'";if(n)return a+n+s;var c=(0,ct.default)(t,function(p){return"[".concat((0,ct.default)(p,function(d){return(0,ir.tokenLabel)(d)}).join(","),"]")}),f=`expecting at least one iteration which starts with one of these possible Token sequences::
`+"<".concat(c.join(" ,"),">");return a+f+s}};Object.freeze(Oe.defaultParserErrorProvider);Oe.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){var r="Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
inside top level rule: ->`+e.name+"<-";return r}};Oe.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){function r(p){return p instanceof ho.Terminal?p.terminalType.name:p instanceof ho.NonTerminal?p.nonTerminalName:""}var n=e.name,i=(0,vo.default)(t),a=i.idx,o=(0,t_.getProductionDslName)(i),s=r(i),c=a>0,f="->".concat(o).concat(c?a:"","<- ").concat(s?"with argument: ->".concat(s,"<-"):"",`
appears more than once (`).concat(t.length," times) in the top level rule: ->").concat(n,`<-.
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
`);return f=f.replace(/[ \t]+/g," "),f=f.replace(/\s\s+/g,`
`),f},buildNamespaceConflictError:function(e){var t=`Namespace conflict found in grammar.
`+"The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <".concat(e.name,`>.
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`;return t},buildAlternationPrefixAmbiguityError:function(e){var t=(0,ct.default)(e.prefixPath,function(i){return(0,ir.tokenLabel)(i)}).join(", "),r=e.alternation.idx===0?"":e.alternation.idx,n="Ambiguous alternatives: <".concat(e.ambiguityIndices.join(" ,"),`> due to common lookahead prefix
`)+"in <OR".concat(r,"> inside <").concat(e.topLevelRule.name,`> Rule,
`)+"<".concat(t,`> may appears as a prefix path in all these alternatives.
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`;return n},buildAlternationAmbiguityError:function(e){var t=(0,ct.default)(e.prefixPath,function(i){return(0,ir.tokenLabel)(i)}).join(", "),r=e.alternation.idx===0?"":e.alternation.idx,n="Ambiguous Alternatives Detected: <".concat(e.ambiguityIndices.join(" ,"),"> in <OR").concat(r,">")+" inside <".concat(e.topLevelRule.name,`> Rule,
`)+"<".concat(t,`> may appears as a prefix path in all these alternatives.
`);return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n},buildEmptyRepetitionError:function(e){var t=(0,t_.getProductionDslName)(e.repetition);e.repetition.idx!==0&&(t+=e.repetition.idx);var r="The repetition <".concat(t,"> within Rule <").concat(e.topLevelRule.name,`> can never consume any tokens.
`)+"This could lead to an infinite loop.";return r},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){var t="Ambiguous empty alternative: <".concat(e.emptyChoiceIdx+1,">")+" in <OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,`> Rule.
`)+"Only the last alternative may be an empty alternative.";return t},buildTooManyAlternativesError:function(e){var t=`An Alternation cannot have more than 256 alternatives:
`+"<OR".concat(e.alternation.idx,"> inside <").concat(e.topLevelRule.name,`> Rule.
has `).concat(e.alternation.definition.length+1," alternatives.");return t},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=(0,ct.default)(e.leftRecursionPath,function(a){return a.name}),n="".concat(t," --> ").concat(r.concat([t]).join(" --> ")),i=`Left Recursion found in grammar.
`+"rule: <".concat(t,`> can be invoked from itself (directly or indirectly)
`)+`without consuming any Tokens. The grammar path that causes this is:
`.concat(n,`
`)+` To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;return i},buildInvalidRuleNameError:function(e){return"deprecated"},buildDuplicateRuleNameError:function(e){var t;e.topLevelRule instanceof ho.Rule?t=e.topLevelRule.name:t=e.topLevelRule;var r="Duplicate definition, rule: ->".concat(t,"<- is already defined in the grammar: ->").concat(e.grammarName,"<-");return r}}});var i_=u(we=>{"use strict";var zk=we&&we.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),r_=we&&we.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(we,"__esModule",{value:!0});we.GastRefResolverVisitor=we.resolveGrammar=void 0;var Xk=ae(),Yk=r_(z()),$k=r_(Pe()),Zk=G();function Jk(e,t){var r=new n_(e,t);return r.resolveRefs(),r.errors}we.resolveGrammar=Jk;var n_=function(e){zk(t,e);function t(r,n){var i=e.call(this)||this;return i.nameToTopRule=r,i.errMsgProvider=n,i.errors=[],i}return t.prototype.resolveRefs=function(){var r=this;(0,Yk.default)((0,$k.default)(this.nameToTopRule),function(n){r.currTopLevel=n,n.accept(r)})},t.prototype.visitNonTerminal=function(r){var n=this.nameToTopRule[r.nonTerminalName];if(n)r.referencedRule=n;else{var i=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,r);this.errors.push({message:i,type:Xk.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:r.nonTerminalName})}},t}(Zk.GAstVisitor);we.GastRefResolverVisitor=n_});var o_=u((BG,a_)=>{function Qk(e,t,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(n,o,r(o),e)}return n}a_.exports=Qk});var u_=u((WG,s_)=>{var eq=ot();function tq(e,t,r,n){return eq(e,function(i,a,o){t(n,i,r(i),o)}),n}s_.exports=tq});var l_=u((KG,c_)=>{var rq=o_(),nq=u_(),iq=Ae(),aq=C();function oq(e,t){return function(r,n){var i=aq(r)?rq:nq,a=t?t():{};return i(r,e,iq(n,2),a)}}c_.exports=oq});var yo=u((VG,f_)=>{var sq=Un(),uq=l_(),cq=Object.prototype,lq=cq.hasOwnProperty,fq=uq(function(e,t,r){lq.call(e,r)?e[r].push(t):sq(e,r,[t])});f_.exports=fq});var mo=u((HG,d_)=>{var dq=Qn(),pq=Q();function hq(e,t){return dq(pq(e,t),1)}d_.exports=hq});var Ai=u((zG,p_)=>{var vq=Wn(),_q=Zt();function yq(e,t,r){var n=e==null?0:e.length;return n?(t=r||t===void 0?1:_q(t),t=n-t,vq(e,0,t<0?0:t)):[]}p_.exports=yq});var on=u(U=>{"use strict";var It=U&&U.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nt=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U,"__esModule",{value:!0});U.nextPossibleTokensAfter=U.possiblePathsFrom=U.NextTerminalAfterAtLeastOneSepWalker=U.NextTerminalAfterAtLeastOneWalker=U.NextTerminalAfterManySepWalker=U.NextTerminalAfterManyWalker=U.AbstractNextTerminalAfterProductionWalker=U.NextAfterTokenWalker=U.AbstractNextPossibleTokensWalker=void 0;var v_=Jn(),Ri=Nt(er()),Oi=Nt(pe()),h_=Nt(Ai()),ee=Nt(Kn()),mq=Nt(gi()),gq=Nt(z()),Rt=Nt(Ke()),Tq=Va(),I=G(),__=function(e){It(t,e);function t(r,n){var i=e.call(this)||this;return i.topProd=r,i.path=n,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker
`)+"".concat(a.join(`
`).replace(/\n/g,`
`)))}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}X.createBaseSemanticVisitorConstructor=$M;function ZM(e,t,r){var n=function(){};(0,iy.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,VM.default)(t,function(a){i[a]=ay}),n.prototype=i,n.prototype.constructor=n,n}X.createBaseVisitorConstructorWithDefaults=ZM;var oy;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(oy=X.CstVisitorDefinitionError||(X.CstVisitorDefinitionError={}));function sy(e,t){var r=uy(e,t);return r}X.validateVisitor=sy;function uy(e,t){var r=(0,HM.default)(t,function(i){return(0,XM.default)(e[i])===!1}),n=(0,ny.default)(r,function(i){return{msg:"Missing visitor method: <".concat(i,"> on ").concat(e.constructor.name," CST Visitor."),type:oy.MISSING_METHOD,methodName:i}});return(0,WM.default)(n)}X.validateMissingCstMethods=uy});var py=u(fr=>{"use strict";var Mi=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0});fr.TreeBuilder=void 0;var lr=ty(),te=Mi(ei()),JM=Mi(le()),ly=Mi(ce()),fy=Mi(gt()),dy=cy(),QM=ae(),e1=function(){function e(){}return e.prototype.initTreeBuilder=function(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=(0,JM.default)(t,"nodeLocationTracking")?t.nodeLocationTracking:QM.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=te.default,this.cstFinallyStateUpdate=te.default,this.cstPostTerminal=te.default,this.cstPostNonTerminal=te.default,this.cstPostRule=te.default;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=lr.setNodeLocationFull,this.setNodeLocationFromNode=lr.setNodeLocationFull,this.cstPostRule=te.default,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=te.default,this.setNodeLocationFromNode=te.default,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=lr.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=lr.setNodeLocationOnlyOffset,this.cstPostRule=te.default,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=te.default,this.setNodeLocationFromNode=te.default,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=te.default,this.setNodeLocationFromNode=te.default,this.cstPostRule=te.default,this.setInitialNodeLocation=te.default;else throw Error('Invalid <nodeLocationTracking> config option: "'.concat(t.nodeLocationTracking,'"'))},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(t){t.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(t){var r=this.LA(1);t.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(t){var r={name:t,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(t){var r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(t){var r=this.LA(0),n=t.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=fu
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
For Further details.`);if((0,Do.default)(t)){if((0,my.default)(t))throw Error(`A Token Vocabulary cannot be empty.
Note that the first argument for the parser constructor
is no longer a Token vector (since v4.0).`);if(typeof t[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
For Further details.`)}if((0,Do.default)(t))this.tokensMap=(0,Ty.default)(t,function(s,c){return s[c.name]=c,s},{});else if((0,pn.default)(t,"modes")&&(0,gy.default)((0,Uo.default)((0,hn.default)(t.modes)),vn.isTokenType)){var n=(0,Uo.default)((0,hn.default)(t.modes)),i=(0,c1.default)(n);this.tokensMap=(0,Ty.default)(i,function(s,c){return s[c.name]=c,s},{})}else if((0,l1.default)(t))this.tokensMap=(0,Ey.default)(t);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ry.EOF;var a=(0,pn.default)(t,"modes")?(0,Uo.default)((0,hn.default)(t.modes)):(0,hn.default)(t),o=(0,gy.default)(a,function(s){return(0,my.default)(s.categoryMatches)});this.tokenMatcher=o?vn.tokenStructuredMatcherNoCategories:vn.tokenStructuredMatcher,(0,vn.augmentTokenTypes)((0,hn.default)(this.tokensMap))},e.prototype.defineRule=function(t,r,n){if(this.selfAnalysisDone)throw Error("Grammar rule <".concat(t,`> may not be defined after the 'performSelfAnalysis' method has been called'
`)+"Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var i=(0,pn.default)(n,"resyncEnabled")?n.resyncEnabled:Oy.DEFAULT_RULE_CONFIG.resyncEnabled,a=(0,pn.default)(n,"recoveryValueFunc")?n.recoveryValueFunc:Oy.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<<de.BITS_FOR_METHOD_TYPE+de.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=t,this.fullRuleNameToShort[t]=o;var s;this.outputCst===!0?s=function(){for(var p=[],d=0;d<arguments.length;d++)p[d]=arguments[d];try{this.ruleInvocationStateUpdate(o,t,this.subruleIdx),r.apply(this,p);var h=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(h),h}catch(_){return this.invokeRuleCatch(_,i,a)}finally{this.ruleFinallyStateUpdate()}}:s=function(){for(var p=[],d=0;d<arguments.length;d++)p[d]=arguments[d];try{return this.ruleInvocationStateUpdate(o,t,this.subruleIdx),r.apply(this,p)}catch(h){return this.invokeRuleCatch(h,i,a)}finally{this.ruleFinallyStateUpdate()}};var c=Object.assign(s,{ruleName:t,originalGrammarAction:r});return c},e.prototype.invokeRuleCatch=function(t,r,n){var i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if((0,wi.isRecognitionException)(t)){var o=t;if(a){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(o.resyncedTokens=this.reSyncTo(s),this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n(t);else{if(this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),n(t);throw o}}else throw t},e.prototype.optionInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(de.OPTION_IDX,r);return this.optionInternalLogic(t,r,n)},e.prototype.optionInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof t!="function"){o=t.DEF;var s=t.GATE;if(s!==void 0){var c=a;a=function(){return s.call(i)&&c.call(i)}}}else o=t;if(a.call(this)===!0)return o.call(this)},e.prototype.atLeastOneInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(de.AT_LEAST_ONE_IDX,t);return this.atLeastOneInternalLogic(t,r,n)},e.prototype.atLeastOneInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;var s=r.GATE;if(s!==void 0){var c=a;a=function(){return s.call(i)&&c.call(i)}}}else o=r;if(a.call(this)===!0)for(var f=this.doSingleRepetition(o);a.call(this)===!0&&f===!0;)f=this.doSingleRepetition(o);else throw this.raiseEarlyExitException(t,Ay.PROD_TYPE.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,r],a,de.AT_LEAST_ONE_IDX,t,pr.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(de.AT_LEAST_ONE_SEP_IDX,t);this.atLeastOneSepFirstInternalLogic(t,r,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(t,r,n){var i=this,a=r.DEF,o=r.SEP,s=this.getLaFuncFromCache(n);if(s.call(this)===!0){a.call(this);for(var c=function(){return i.tokenMatcher(i.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,c,a,pr.NextTerminalAfterAtLeastOneSepWalker],c,de.AT_LEAST_ONE_SEP_IDX,t,pr.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(t,Ay.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)},e.prototype.manyInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(de.MANY_IDX,t);return this.manyInternalLogic(t,r,n)},e.prototype.manyInternalLogic=function(t,r,n){var i=this,a=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;var s=r.GATE;if(s!==void 0){var c=a;a=function(){return s.call(i)&&c.call(i)}}}else o=r;for(var f=!0;a.call(this)===!0&&f===!0;)f=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[t,r],a,de.MANY_IDX,t,pr.NextTerminalAfterManyWalker,f)},e.prototype.manySepFirstInternal=function(t,r){var n=this.getKeyForAutomaticLookahead(de.MANY_SEP_IDX
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(jy);var I1={name:`This CSTNode indicates the Parser is in Recording Phase
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},N1=function(){function e(){}return e.prototype.initGastRecorder=function(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var t=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var r=function(i){var a=i>0?i:"";t["CONSUME".concat(a)]=function(o,s){return this.consumeInternalRecord(o,i,s)},t["SUBRULE".concat(a)]=function(o,s){return this.subruleInternalRecord(o,i,s)},t["OPTION".concat(a)]=function(o){return this.optionInternalRecord(o,i)},t["OR".concat(a)]=function(o){return this.orInternalRecord(o,i)},t["MANY".concat(a)]=function(o){this.manyInternalRecord(i,o)},t["MANY_SEP".concat(a)]=function(o){this.manySepFirstInternalRecord(i,o)},t["AT_LEAST_ONE".concat(a)]=function(o){this.atLeastOneInternalRecord(i,o)},t["AT_LEAST_ONE_SEP".concat(a)]=function(o){this.atLeastOneSepFirstInternalRecord(i,o)}},n=0;n<10;n++)r(n);t.consume=function(i,a,o){return this.consumeInternalRecord(a,i,o)},t.subrule=function(i,a,o){return this.subruleInternalRecord(a,i,o)},t.option=function(i,a){return this.optionInternalRecord(a,i)},t.or=function(i,a){return this.orInternalRecord(a,i)},t.many=function(i,a){this.manyInternalRecord(i,a)},t.atLeastOne=function(i,a){this.atLeastOneInternalRecord(i,a)},t.ACTION=t.ACTION_RECORD,t.BACKTRACK=t.BACKTRACK_RECORD,t.LA=t.LA_RECORD})},e.prototype.disableRecording=function(){var t=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var r=t,n=0;n<10;n++){var i=n>0?n:"";delete r["CONSUME".concat(i)],delete r["SUBRULE".concat(i)],delete r["OPTION".concat(i)],delete r["OR".concat(i)],delete r["MANY".concat(i)],delete r["MANY_SEP".concat(i)],delete r["AT_LEAST_ONE".concat(i)],delete r["AT_LEAST_ONE_SEP".concat(i)]}delete r.consume,delete r.subrule,delete r.option,delete r.or,delete r.many,delete r.atLeastOne,delete r.ACTION,delete r.BACKTRACK,delete r.LA})},e.prototype.ACTION_RECORD=function(t){},e.prototype.BACKTRACK_RECORD=function(t,r){return function(){return!0}},e.prototype.LA_RECORD=function(t){return O1.END_OF_FILE},e.prototype.topLevelRuleRecord=function(t,r){try{var n=new Ge.Rule({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(i){if(i.KNOWN_RECORDER_ERROR!==!0)try{i.message=i.message+`
This error was thrown during the "grammar recording phase" For more info see:
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(a){throw i}throw i}},e.prototype.optionInternalRecord=function(t,r){return _n.call(this,Ge.Option,t,r)},e.prototype.atLeastOneInternalRecord=function(t,r){_n.call(this,Ge.RepetitionMandatory,r,t)},e.prototype.atLeastOneSepFirstInternalRecord=function(t,r){_n.call(this,Ge.RepetitionMandatoryWithSeparator,r,t,ky)},e.prototype.manyInternalRecord=function(t,r){_n.call(this,Ge.Repetition,r,t)},e.prototype.manySepFirstInternalRecord=function(t,r){_n.call(this,Ge.RepetitionWithSeparator,r,t,ky)},e.prototype.orInternalRecord=function(t,r){return S1.call(this,t,r)},e.prototype.subruleInternalRecord=function(t,r,n){if(Ui(r),!t||(0,yn.default)(t,"ruleName")===!1){var i=new Error("<SUBRULE".concat(My(r),"> argument is invalid")+" expecting a Parser method reference but got: <".concat(JSON.stringify(t),">")+`
inside top level rule: <`.concat(this.recordingProdStack[0].name,">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var a=(0,Di.default)(this.recordingProdStack),o=t.ruleName,s=new Ge.NonTerminal({idx:r,nonTerminalName:o,label:n==null?void 0:n.LABEL,referencedRule:void 0});return a.definition.push(s),this.outputCst?I1:ji},e.prototype.consumeInternalRecord=function(t,r,n){if(Ui(r),!(0,wy.hasShortKeyProperty)(t)){var i=new Error("<CONSUME".concat(My(r),"> argument is invalid")+" expecting a TokenType reference but got: <".concat(JSON.stringify(t),">")+`
inside top level rule: <`.concat(this.recordingProdStack[0].name,">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var a=(0,Di.default)(this.recordingProdStack),o=new Ge.Terminal({idx:r,terminalType:t,label:n==null?void 0:n.LABEL});return a.definition.push(o),jy},e}();yr.GastRecorder=N1;function _n(e,t,r,n){n===void 0&&(n=!1),Ui(r);var i=(0,Di.default)(this.recordingProdStack),a=(0,Fy.default)(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),(0,yn.default)(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),ji}function S1(e,t){var r=this;Ui(t);var n=(0,Di.default)(this.recordingProdStack),i=(0,g1.default)(e)===!1,a=i===!1?e:e.DEF,o=new Ge.Alternation({definition:[],idx:t,ignoreAmbiguities:i&&e.IGNORE_AMBIGUITIES===!0});(0,yn.default)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);var s=(0,T1.default)(a,function(c){return(0,Fy.default)(c.GATE)});return o.hasPredicates=s,n.definition.push(o),(0,E1.default)(a,function(c){var f=new Ge.Alternative({definition:[]});o.definition.push(f),(0,yn.default)(c,"IGNORE_AMBIGUITIES")?f.ignoreAmbiguities=c.IGNORE_AMBIGUITIES:(0,yn.default)(c,"GATE")&&(f.ignoreAmbiguities=!0),r.recordingProdStack.push(f),c.ALT.call(r),r.recordingProdStack.pop()}),ji}function My(e){return e===0?"":"".concat(e)}function Ui(e){if(e<0||e>qy){var t=new Error("Invalid DSL Method idx value: <".concat(e,`>
`)+"Idx value must be a none negative value smaller than ".concat(qy+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}});var By=u(gr=>{"use strict";var P1=gr&&gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gr,"__esModule",{value:!0});gr.PerformanceTracer=void 0;var x1=P1(le()),b1=$t(),C1=ae(),L1=function(){function e(){}return e.prototype.initPerformanceTracer=function(t){if((0,x1.default)(t,"traceInitPerf")){var r=t.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=C1.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(t,r){if(this.traceInitPerf===!0){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log("".concat(n,"--> <").concat(t,">"));var i=(0,b1.timer)(r),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s("".concat(n,"<-- <").concat(t,"> time: ").concat(a,"ms")),this.traceInitIndent--,o}else return r()},e}();gr.PerformanceTracer=L1});var Wy=u(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.applyMixins=void 0;function k1(e,t){t.forEach(function(r){var n=r.prototype;Object.getOwnPropertyNames(n).forEach(function(i){if(i!=="constructor"){var a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(e.prototype,i,a):e.prototype[i]=r.prototype[i]}})})}Gi.applyMixins=k1});var ae=u(q=>{"use strict";var zy=q&&q.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tr=q&&q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0});q.EmbeddedActionsParser=q.CstParser=q.Parser=q.EMPTY_ALT=q.ParserDefinitionErrorType=q.DEFAULT_RULE_CONFIG=q.DEFAULT_PARSER_CONFIG=q.END_OF_FILE=void 0;var Go=Tr(pe()),q1=Tr(Q()),M1=Tr(z()),vt=Tr(Pe()),Ky=Tr(le()),Xy=Tr(Ke()),F1=$t(),w1=Nh(),Vy=Ot(),Yy=ar(),Hy=j_(),D1=ko(),U1=ey(),j1=py(),G1=vy(),B1=yy(),W1=Iy(),K1=xy(),V1=Ly(),H1=Gy(),z1=By(),X1=Wy(),Y1=cn();q.END_OF_FILE=(0,Vy.createTokenInstance)(Vy.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(q.END_OF_FILE);q.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Yy.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});q.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var $1;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})($1=q.ParserDefinitionErrorType||(q.ParserDefinitionErrorType={}));function Z1(e){return e===void 0&&(e=void 0),function(){return e}}q.EMPTY_ALT=Z1;var Bi=function(){function e(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssis
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
For further details.`);this.skipValidations=(0,Ky.default)(r,"skipValidations")?r.skipValidations:q.DEFAULT_PARSER_CONFIG.skipValidations}return e.performSelfAnalysis=function(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",function(){(0,F1.toFastProperties)(t)}),t.TRACE_INIT("Grammar Recording",function(){try{t.enableRecording(),(0,M1.default)(t.definedRulesNames,function(a){var o=t[a],s=o.originalGrammarAction,c;t.TRACE_INIT("".concat(a," Rule"),function(){c=t.topLevelRuleRecord(a,s)}),t.gastProductionsCache[a]=c})}finally{t.disableRecording()}});var i=[];if(t.TRACE_INIT("Grammar Resolving",function(){i=(0,Hy.resolveGrammar)({rules:(0,vt.default)(t.gastProductionsCache)}),t.definitionErrors=t.definitionErrors.concat(i)}),t.TRACE_INIT("Grammar Validations",function(){if((0,Go.default)(i)&&t.skipValidations===!1){var a=(0,Hy.validateGrammar)({rules:(0,vt.default)(t.gastProductionsCache),tokenTypes:(0,vt.default)(t.tokensMap),errMsgProvider:Yy.defaultGrammarValidatorErrorProvider,grammarName:n}),o=(0,Y1.validateLookahead)({lookaheadStrategy:t.lookaheadStrategy,rules:(0,vt.default)(t.gastProductionsCache),tokenTypes:(0,vt.default)(t.tokensMap),grammarName:n});t.definitionErrors=t.definitionErrors.concat(a,o)}}),(0,Go.default)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",function(){var a=(0,w1.computeAllProdsFollows)((0,vt.default)(t.gastProductionsCache));t.resyncFollows=a}),t.TRACE_INIT("ComputeLookaheadFunctions",function(){var a,o;(o=(a=t.lookaheadStrategy).initialize)===null||o===void 0||o.call(a,{rules:(0,vt.default)(t.gastProductionsCache)}),t.preComputeLookaheadFunctions((0,vt.default)(t.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,Go.default)(t.definitionErrors))throw r=(0,q1.default)(t.definitionErrors,function(a){return a.message}),new Error(`Parser Definition Errors detected:
`.concat(r.join(`
-------------------------------
`)))})},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();q.Parser=Bi;(0,X1.applyMixins)(Bi,[D1.Recoverable,U1.LooksAhead,j1.TreeBuilder,G1.LexerAdapter,W1.RecognizerEngine,B1.RecognizerApi,K1.ErrorHandler,V1.ContentAssist,H1.GastRecorder,z1.PerformanceTracer]);var J1=function(e){zy(t,e);function t(r,n){n===void 0&&(n=q.DEFAULT_PARSER_CONFIG);var i=(0,Xy.default)(n);return i.outputCst=!0,e.call(this,r,i)||this}return t}(Bi);q.CstParser=J1;var Q1=function(e){zy(t,e);function t(r,n){n===void 0&&(n=q.DEFAULT_PARSER_CONFIG);var i=(0,Xy.default)(n);return i.outputCst=!1,e.call(this,r,i)||this}return t}(Bi);q.EmbeddedActionsParser=Q1});var Zy=u(_t=>{"use strict";var eF=_t&&_t.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Er=_t&&_t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_t,"__esModule",{value:!0});_t.buildModel=void 0;var $y=G(),mn=Er(Q()),tF=Er(qe()),rF=Er(Pe()),nF=Er(Yn()),iF=Er(yo()),aF=Er(Zr());function oF(e){var t=new sF,r=(0,rF.default)(e);return(0,mn.default)(r,function(n){return t.visitRule(n)})}_t.buildModel=oF;var sF=function(e){eF(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.visitRule=function(r){var n=this.visitEach(r.definition),i=(0,iF.default)(n,function(o){return o.propertyName}),a=(0,mn.default)(i,function(o,s){var c=!(0,nF.default)(o,function(p){return!p.canBeNull}),f=o[0].type;return o.length>1&&(f=(0,mn.default)(o,function(p){return p.type})),{name:s,type:f,optional:c}});return{name:r.name,properties:a}},t.prototype.visitAlternative=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitOption=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitRepetition=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitRepetitionMandatory=function(r){return this.visitEach(r.definition)},t.prototype.visitRepetitionMandatoryWithSeparator=function(r){return this.visitEach(r.definition).concat({propertyName:r.separator.name,canBeNull:!0,type:Wi(r.separator)})},t.prototype.visitRepetitionWithSeparator=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0}).concat({propertyName:r.separator.name,canBeNull:!0,type:Wi(r.separator)})},t.prototype.visitAlternation=function(r){return this.visitEachAndOverrideWith(r.definition,{canBeNull:!0})},t.prototype.visitTerminal=function(r){return[{propertyName:r.label||r.terminalType.name,canBeNull:!1,type:Wi(r)}]},t.prototype.visitNonTerminal=function(r){return[{propertyName:r.label||r.nonTerminalName,canBeNull:!1,type:Wi(r)}]},t.prototype.visitEachAndOverrideWith=function(r,n){return(0,mn.default)(this.visitEach(r),function(i){return(0,aF.default)({},i,n)})},t.prototype.visitEach=function(r){var n=this;return(0,tF.default)((0,mn.default)(r,function(i){return n.visit(i)}))},t}($y.GAstVisitor);function Wi(e){return e instanceof $y.NonTerminal?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}});var Qy=u((mB,Jy)=>{var uF=Wn();function cF(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:uF(e,t,r)}Jy.exports=cF});var Bo=u((gB,em)=>{var lF="\\ud800-\\udfff",fF="\\u0300-\\u036f",dF="\\ufe20-\\ufe2f",pF="\\u20d0-\\u20ff",hF=fF+dF+pF,vF="\\ufe0e\\ufe0f",_F="\\u200d",yF=RegExp("["+_F+lF+hF+vF+"]");function mF(e){return yF.test(e)}em.exports=mF});var rm=u((TB,tm)=>{function gF(e){return e.split("")}tm.exports=gF});var lm=u((EB,cm)=>{var nm="\\ud800-\\udfff",TF="\\u0300-\\u036f",EF="\\ufe20-\\ufe2f",AF="\\u20d0-\\u20ff",OF=TF+EF+AF,RF="\\ufe0e\\ufe0f",IF="["+nm+"]",Wo="["+OF+"]",Ko="\\ud83c[\\udffb-\\udfff]",NF="(?:"+Wo+"|"+Ko+")"
`)+`
`}Ar.genDts=XF;function YF(e){var t=$F(e),r=ZF(e);return[t,r]}function $F(e){var t=gm(e.name),r=Vo(e.name);return"export interface ".concat(t,` extends CstNode {
name: "`).concat(e.name,`";
children: `).concat(r,`;
}`)}function ZF(e){var t=Vo(e.name);return"export type ".concat(t,` = {
`).concat((0,Ki.default)(e.properties,function(r){return JF(r)}).join(`
`),`
};`)}function JF(e){var t=tw(e.type);return"".concat(e.name).concat(e.optional?"?":"",": ").concat(t,"[];")}function QF(e,t){return"export interface ".concat(e,`<IN, OUT> extends ICstVisitor<IN, OUT> {
`).concat((0,Ki.default)(t,function(r){return ew(r)}).join(`
`),`
}`)}function ew(e){var t=Vo(e.name);return"".concat(e.name,"(children: ").concat(t,", param?: IN): OUT;")}function tw(e){if((0,VF.default)(e)){var t=(0,zF.default)((0,Ki.default)(e,function(n){return ym(n)})),r=(0,HF.default)(t,function(n,i){return n+" | "+i});return"("+r+")"}else return ym(e)}function ym(e){return e.kind==="token"?"IToken":gm(e.name)}function gm(e){return(0,mm.default)(e)+"CstNode"}function Vo(e){return(0,mm.default)(e)+"CstChildren"}});var Em=u(Rr=>{"use strict";var Vi=Rr&&Rr.__assign||function(){return Vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vi.apply(this,arguments)};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.generateCstDts=void 0;var rw=Zy(),nw=Tm(),iw={includeVisitorInterface:!0,visitorInterfaceName:"ICstNodeVisitor"};function aw(e,t){var r=Vi(Vi({},iw),t),n=(0,rw.buildModel)(e);return(0,nw.genDts)(n,r)}Rr.generateCstDts=aw});var Om=u(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.createSyntaxDiagramsCode=void 0;var Am=ta();function ow(e,t){var r=t===void 0?{}:t,n=r.resourceBase,i=n===void 0?"https://unpkg.com/chevrotain@".concat(Am.VERSION,"/diagrams/"):n,a=r.css,o=a===void 0?"https://unpkg.com/chevrotain@".concat(Am.VERSION,"/diagrams/diagrams.css"):a,s=`
<!-- This is a generated file -->
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background-color: hsl(30, 20%, 95%)
}
</style>
`,c=`
<link rel='stylesheet' href='`.concat(o,`'>
`),f=`
<script src='`.concat(i,`vendor/railroad-diagrams.js'><\/script>
<script src='`).concat(i,`src/diagrams_builder.js'><\/script>
<script src='`).concat(i,`src/diagrams_behavior.js'><\/script>
<script src='`).concat(i,`src/main.js'><\/script>
`),p=`
<div id="diagrams" align="center"></div>
`,d=`
<script>
window.serializedGrammar = `.concat(JSON.stringify(e,null," "),`;
<\/script>
`),h=`
<script>
var diagramsDiv = document.getElementById("diagrams");
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
<\/script>
`;return s+c+f+p+d+h}Hi.createSyntaxDiagramsCode=ow});var _w=u(m=>{Object.defineProperty(m,"__esModule",{value:!0});m.Parser=m.createSyntaxDiagramsCode=m.clearCache=m.generateCstDts=m.GAstVisitor=m.serializeProduction=m.serializeGrammar=m.Terminal=m.Rule=m.RepetitionWithSeparator=m.RepetitionMandatoryWithSeparator=m.RepetitionMandatory=m.Repetition=m.Option=m.NonTerminal=m.Alternative=m.Alternation=m.defaultLexerErrorProvider=m.NoViableAltException=m.NotAllInputParsedException=m.MismatchedTokenException=m.isRecognitionException=m.EarlyExitException=m.defaultParserErrorProvider=m.LLkLookaheadStrategy=m.getLookaheadPaths=m.tokenName=m.tokenMatcher=m.tokenLabel=m.EOF=m.createTokenInstance=m.createToken=m.LexerDefinitionErrorType=m.Lexer=m.EMPTY_ALT=m.ParserDefinitionErrorType=m.EmbeddedActionsParser=m.CstParser=m.VERSION=void 0;var sw=ta();Object.defineProperty(m,"VERSION",{enumerable:!0,get:function(){return sw.VERSION}});var zi=ae();Object.defineProperty(m,"CstParser",{enumerable:!0,get:function(){return zi.CstParser}});Object.defineProperty(m,"EmbeddedActionsParser",{enumerable:!0,get:function(){return zi.EmbeddedActionsParser}});Object.defineProperty(m,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return zi.ParserDefinitionErrorType}});Object.defineProperty(m,"EMPTY_ALT",{enumerable:!0,get:function(){return zi.EMPTY_ALT}});var Rm=tn();Object.defineProperty(m,"Lexer",{enumerable:!0,get:function(){return Rm.Lexer}});Object.defineProperty(m,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return Rm.LexerDefinitionErrorType}});var Ir=Ot();Object.defineProperty(m,"createToken",{enumerable:!0,get:function(){return Ir.createToken}});Object.defineProperty(m,"createTokenInstance",{enumerable:!0,get:function(){return Ir.createTokenInstance}});Object.defineProperty(m,"EOF",{enumerable:!0,get:function(){return Ir.EOF}});Object.defineProperty(m,"tokenLabel",{enumerable:!0,get:function(){return Ir.tokenLabel}});Object.defineProperty(m,"tokenMatcher",{enumerable:!0,get:function(){return Ir.tokenMatcher}});Object.defineProperty(m,"tokenName",{enumerable:!0,get:function(){return Ir.tokenName}});var uw=or();Object.defineProperty(m,"getLookaheadPaths",{enumerable:!0,get:function(){return uw.getLookaheadPaths}});var cw=Mo();Object.defineProperty(m,"LLkLookaheadStrategy",{enumerable:!0,get:function(){return cw.LLkLookaheadStrategy}});var lw=ar();Object.defineProperty(m,"defaultParserErrorProvider",{enumerable:!0,get:function(){return lw.defaultParserErrorProvider}});var gn=ur();Object.defineProperty(m,"EarlyExitException",{enumerable:!0,get:function(){return gn.EarlyExitException}});Object.defineProperty(m,"isRecognitionException",{enumerable:!0,get:function(){return gn.isRecognitionException}});Object.defineProperty(m,"MismatchedTokenException",{enumerable:!0,get:function(){return gn.MismatchedTokenException}});Object.defineProperty(m,"NotAllInputParsedException",{enumerable:!0,get:function(){return gn.NotAllInputParsedException}});Object.defineProperty(m,"NoViableAltException",{enumerable:!0,get:function(){return gn.NoViableAltException}});var fw=so();Object.defineProperty(m,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return fw.defaultLexerErrorProvider}});var Be=G();Object.defineProperty(m,"Alternation",{enumerable:!0,get:function(){return Be.Alternation}});Object.defineProperty(m,"Alternative",{enumerable:!0,get:function(){return Be.Alternative}});Object.defineProperty(m,"NonTerminal",{enumerable:!0,get:function(){return Be.NonTerminal}});Object.defineProperty(m,"Option",{enumerable:!0,get:function(){return Be.Option}});Object.defineProperty(m,"Repetition",{enumerable:!0,get:function(){return Be.Repetition}});Object.defineProperty(m,"RepetitionMandatory",{enumerable:!0,get:function(){return Be.RepetitionMandatory}});Object.defineProperty(m,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return Be.RepetitionMandatoryWithSeparator}});Object.defineProperty(m,"RepetitionWithSeparator",{enumerable:!0,get:function(){return Be.RepetitionWithSeparator}});Object.defineProperty(m,"Rule",{enumera
It performs no action other than printing this message.
Please avoid using it as it will be completely removed in the future`)}m.clearCache=pw;var hw=Om();Object.defineProperty(m,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return hw.createSyntaxDiagramsCode}});var vw=function(){function e(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return e}();m.Parser=vw});export default _w();
//# sourceMappingURL=chevrotain.min.mjs.map