lforms
Version:
[LForms](http://lhncbc.github.io/lforms/), a.k.a. LHC-Forms, is a feature-rich, open-source Web Component that creates input forms, based on definition files, for Web-based applications. In addition to its native form-definition format, it partially sup
1 lines • 1.05 MB
JavaScript
!function(){var e={7080:function(e,t,n){const{Token:i}=n(5537),r=n(7318),{Interval:a}=n(7059);class o{}e.exports=class extends o{constructor(e){super(),this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(e){}reset(){this.seek(0)}seek(e){this.lazyInit(),this.index=this.adjustSeekIndex(e)}get(e){return this.lazyInit(),this.tokens[e]}consume(){let e=!1;if(e=this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length),!e&&this.LA(1)===i.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}sync(e){const t=e-this.tokens.length+1;if(t>0){return this.fetch(t)>=t}return!0}fetch(e){if(this.fetchedEOF)return 0;for(let t=0;t<e;t++){const e=this.tokenSource.nextToken();if(e.tokenIndex=this.tokens.length,this.tokens.push(e),e.type===i.EOF)return this.fetchedEOF=!0,t+1}return e}getTokens(e,t,n){if(void 0===n&&(n=null),e<0||t<0)return null;this.lazyInit();const r=[];t>=this.tokens.length&&(t=this.tokens.length-1);for(let a=e;a<t;a++){const e=this.tokens[a];if(e.type===i.EOF)break;(null===n||n.contains(e.type))&&r.push(e)}return r}LA(e){return this.LT(e).type}LB(e){return this.index-e<0?null:this.tokens[this.index-e]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);const t=this.index+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(e){this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(e,t){if(this.sync(e),e>=this.tokens.length)return-1;let n=this.tokens[e];for(;n.channel!==this.channel;){if(n.type===i.EOF)return-1;e+=1,this.sync(e),n=this.tokens[e]}return e}previousTokenOnChannel(e,t){for(;e>=0&&this.tokens[e].channel!==t;)e-=1;return e}getHiddenTokensToRight(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(e+1,r.DEFAULT_TOKEN_CHANNEL),i=e+1,a=-1===n?this.tokens.length-1:n;return this.filterForChannel(i,a,t)}getHiddenTokensToLeft(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(e-1,r.DEFAULT_TOKEN_CHANNEL);if(n===e-1)return null;const i=n+1,a=e-1;return this.filterForChannel(i,a,t)}filterForChannel(e,t,n){const i=[];for(let a=e;a<t+1;a++){const e=this.tokens[a];-1===n?e.channel!==r.DEFAULT_TOKEN_CHANNEL&&i.push(e):e.channel===n&&i.push(e)}return 0===i.length?null:i}getSourceName(){return this.tokenSource.getSourceName()}getText(e){this.lazyInit(),this.fill(),null==e&&(e=new a(0,this.tokens.length-1));let t=e.start;t instanceof i&&(t=t.tokenIndex);let n=e.stop;if(n instanceof i&&(n=n.tokenIndex),null===t||null===n||t<0||n<0)return"";n>=this.tokens.length&&(n=this.tokens.length-1);let r="";for(let e=t;e<n+1;e++){const t=this.tokens[e];if(t.type===i.EOF)break;r+=t.text}return r}fill(){for(this.lazyInit();1e3===this.fetch(1e3););}}},462:function(e,t,n){const i=n(5537).CommonToken;class r{}class a extends r{constructor(e){super(),this.copyText=void 0!==e&&e}create(e,t,n,r,a,o,s,l){const c=new i(e,t,r,a,o);return c.line=s,c.column=l,null!==n?c.text=n:this.copyText&&null!==e[1]&&(c.text=e[1].getText(a,o)),c}createThin(e,t){const n=new i(null,e);return n.text=t,n}}a.DEFAULT=new a,e.exports=a},8206:function(e,t,n){const i=n(5537).Token,r=n(7080);e.exports=class extends r{constructor(e,t){super(e),this.channel=void 0===t?i.DEFAULT_CHANNEL:t}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}LB(e){if(0===e||this.index-e<0)return null;let t=this.index,n=1;for(;n<=e;)t=this.previousTokenOnChannel(t-1,this.channel),n+=1;return t<0?null:this.tokens[t]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);let t=this.index,n=1;for(;n<e;)this.sync(t+1)&&(t=this.nextTokenOnChannel(t+1,this.channel)),n+=1;return this.tokens[t]}getNumberOfOnChannelTokens(){let e=0;this.fill();for(let t=0;t<this.tokens.length;t++){const n=this.tokens[t];if(n.channel===this.channel&&(e+=1),n.type===i.EOF)break}return e}}},916:function(e,t,n){const{Token:i}=n(5537);n(7767),n(7838);e.exports=class{constructor(e,t){if(this.name="<empty>",this.strdata=e,this.decodeToUnicodeCodePoints=t||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(let e=0;e<this.strdata.length;){const t=this.strdata.codePointAt(e);this.data.push(t),e+=t<=65535?1:2}else{this.data=new Array(this.strdata.length);for(let e=0;e<this.strdata.length;e++){const t=this.strdata.charCodeAt(e);this.data[e]=t}}this._size=this.data.length}reset(){this._index=0}consume(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}LA(e){if(0===e)return 0;e<0&&(e+=1);const t=this._index+e-1;return t<0||t>=this._size?i.EOF:this.data[t]}LT(e){return this.LA(e)}mark(){return-1}release(e){}seek(e){e<=this._index?this._index=e:this._index=Math.min(e,this._size)}getText(e,t){if(t>=this._size&&(t=this._size-1),e>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let i=e;i<=t;i++)n+=String.fromCodePoint(this.data[i]);return n}return this.strdata.slice(e,t+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}},7059:function(e,t,n){const{Token:i}=n(5537);class r{constructor(e,t){this.start=e,this.stop=t}clone(){return new r(this.start,this.stop)}contains(e){return e>=this.start&&e<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}class a{constructor(){this.intervals=null,this.readOnly=!1}first(e){return null===this.intervals||0===this.intervals.length?i.INVALID_TYPE:this.intervals[0].start}addOne(e){this.addInterval(new r(e,e+1))}addRange(e,t){this.addInterval(new r(e,t+1))}addInterval(e){if(null===this.intervals)this.intervals=[],this.intervals.push(e.clone());else{for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e.stop<n.start)return void this.intervals.splice(t,0,e);if(e.stop===n.start)return void(this.intervals[t]=new r(e.start,n.stop));if(e.start<=n.stop)return this.intervals[t]=new r(Math.min(n.start,e.start),Math.max(n.stop,e.stop)),void this.reduce(t)}this.intervals.push(e.clone())}}addSet(e){return null!==e.intervals&&e.intervals.forEach((e=>this.addInterval(e)),this),this}reduce(e){if(e<this.intervals.length-1){const t=this.intervals[e],n=this.intervals[e+1];t.stop>=n.stop?(this.intervals.splice(e+1,1),this.reduce(e)):t.stop>=n.start&&(this.intervals[e]=new r(t.start,n.stop),this.intervals.splice(e+1,1))}}complement(e,t){const n=new a;return n.addInterval(new r(e,t+1)),null!==this.intervals&&this.intervals.forEach((e=>n.removeRange(e))),n}contains(e){if(null===this.intervals)return!1;for(let t=0;t<this.intervals.length;t++)if(this.intervals[t].contains(e))return!0;return!1}removeRange(e){if(e.start===e.stop-1)this.removeOne(e.start);else if(null!==this.intervals){let t=0;for(let n=0;n<this.intervals.length;n++){const n=this.intervals[t];if(e.stop<=n.start)return;if(e.start>n.start&&e.stop<n.stop){this.intervals[t]=new r(n.start,e.start);const i=new r(e.stop,n.stop);return void this.intervals.splice(t,0,i)}e.start<=n.start&&e.stop>=n.stop?(this.intervals.splice(t,1),t-=1):e.start<n.stop?this.intervals[t]=new r(n.start,e.start):e.stop<n.stop&&(this.intervals[t]=new r(e.stop,n.stop)),t+=1}}}removeOne(e){if(null!==this.intervals)for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e<n.start)return;if(e===n.start&&e===n.stop-1)return void this.intervals.splice(t,1);if(e===n.start)return void(this.intervals[t]=new r(n.start+1,n.stop));if(e===n.stop-1)return void(this.intervals[t]=new r(n.start,n.stop-1));if(e<n.stop-1){const i=new r(n.start,e);return n.start=e+1,void this.intervals.splice(t,0,i)}}}toString(e,t,n){return e=e||null,t=t||null,n=n||!1,null===this.intervals?"{}":null!==e||null!==t?this.toTokenString(e,t):n?this.toCharString():this.toIndexString()}toCharString(){const e=[];for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];n.stop===n.start+1?n.start===i.EOF?e.push("<EOF>"):e.push("'"+String.fromCharCode(n.start)+"'"):e.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return e.length>1?"{"+e.join(", ")+"}":e[0]}toIndexString(){const e=[];for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];n.stop===n.start+1?n.start===i.EOF?e.push("<EOF>"):e.push(n.start.toString()):e.push(n.start.toString()+".."+(n.stop-1).toString())}return e.length>1?"{"+e.join(", ")+"}":e[0]}toTokenString(e,t){const n=[];for(let i=0;i<this.intervals.length;i++){const r=this.intervals[i];for(let i=r.start;i<r.stop;i++)n.push(this.elementName(e,t,i))}return n.length>1?"{"+n.join(", ")+"}":n[0]}elementName(e,t,n){return n===i.EOF?"<EOF>":n===i.EPSILON?"<EPSILON>":e[n]||t[n]}get length(){return this.intervals.map((e=>e.length)).reduce(((e,t)=>e+t))}}e.exports={Interval:r,IntervalSet:a}},3245:function(e,t,n){const{Set:i,BitSet:r}=n(2373),{Token:a}=n(5537),{ATNConfig:o}=n(5185),{IntervalSet:s}=n(7059),{RuleStopState:l}=n(2766),{RuleTransition:c,NotSetTransition:u,WildcardTransition:d,AbstractPredicateTransition:m}=n(5651),{predictionContextFromRuleContext:p,PredictionContext:f,SingletonPredictionContext:h}=n(6400);class g{constructor(e){this.atn=e}getDecisionLookahead(e){if(null===e)return null;const t=e.transitions.length,n=[];for(let a=0;a<t;a++){n[a]=new s;const t=new i,o=!1;this._LOOK(e.transition(a).target,null,f.EMPTY,n[a],t,new r,o,!1),(0===n[a].length||n[a].contains(g.HIT_PRED))&&(n[a]=null)}return n}LOOK(e,t,n){const a=new s,o=null!==(n=n||null)?p(e.atn,n):null;return this._LOOK(e,t,o,a,new i,new r,!0,!0),a}_LOOK(e,t,n,i,r,s,p,_){const y=new o({state:e,alt:0,context:n},null);if(!r.contains(y)){if(r.add(y),e===t){if(null===n)return void i.addOne(a.EPSILON);if(n.isEmpty()&&_)return void i.addOne(a.EOF)}if(e instanceof l){if(null===n)return void i.addOne(a.EPSILON);if(n.isEmpty()&&_)return void i.addOne(a.EOF);if(n!==f.EMPTY){const a=s.contains(e.ruleIndex);try{s.remove(e.ruleIndex);for(let e=0;e<n.length;e++){const a=this.atn.states[n.getReturnState(e)];this._LOOK(a,t,n.getParent(e),i,r,s,p,_)}}finally{a&&s.add(e.ruleIndex)}return}}for(let o=0;o<e.transitions.length;o++){const l=e.transitions[o];if(l.constructor===c){if(s.contains(l.target.ruleIndex))continue;const e=h.create(n,l.followState.stateNumber);try{s.add(l.target.ruleIndex),this._LOOK(l.target,t,e,i,r,s,p,_)}finally{s.remove(l.target.ruleIndex)}}else if(l instanceof m)p?this._LOOK(l.target,t,n,i,r,s,p,_):i.addOne(g.HIT_PRED);else if(l.isEpsilon)this._LOOK(l.target,t,n,i,r,s,p,_);else if(l.constructor===d)i.addRange(a.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{let e=l.label;null!==e&&(l instanceof u&&(e=e.complement(a.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),i.addSet(e))}}}}}g.HIT_PRED=a.INVALID_TYPE,e.exports=g},7318:function(e,t,n){const{Token:i}=n(5537),r=n(9612),a=n(462),{RecognitionException:o}=n(586),{LexerNoViableAltException:s}=n(586);class l extends r{constructor(e){super(),this._input=e,this._factory=a.DEFAULT,this._tokenFactorySourcePair=[this,e],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=i.DEFAULT_CHANNEL,this._type=i.INVALID_TYPE,this._modeStack=[],this._mode=l.DEFAULT_MODE,this._text=null}reset(){null!==this._input&&this._input.seek(0),this._token=null,this._type=i.INVALID_TYPE,this._channel=i.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=l.DEFAULT_MODE,this._modeStack=[],this._interp.reset()}nextToken(){if(null===this._input)throw"nextToken requires a non-null input stream.";const e=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=i.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;let e=!1;for(;;){this._type=i.INVALID_TYPE;let t=l.SKIP;try{t=this._interp.match(this._input,this._mode)}catch(e){if(!(e instanceof o))throw console.log(e.stack),e;this.notifyListeners(e),this.recover(e)}if(this._input.LA(1)===i.EOF&&(this._hitEOF=!0),this._type===i.INVALID_TYPE&&(this._type=t),this._type===l.SKIP){e=!0;break}if(this._type!==l.MORE)break}if(!e)return null===this._token&&this.emit(),this._token}}finally{this._input.release(e)}}skip(){this._type=l.SKIP}more(){this._type=l.MORE}mode(e){this._mode=e}pushMode(e){this._interp.debug&&console.log("pushMode "+e),this._modeStack.push(this._mode),this.mode(e)}popMode(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode}emitToken(e){this._token=e}emit(){const e=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(e),e}emitEOF(){const e=this.column,t=this.line,n=this._factory.create(this._tokenFactorySourcePair,i.EOF,null,i.DEFAULT_CHANNEL,this._input.index,this._input.index-1,t,e);return this.emitToken(n),n}getCharIndex(){return this._input.index}getAllTokens(){const e=[];let t=this.nextToken();for(;t.type!==i.EOF;)e.push(t),t=this.nextToken();return e}notifyListeners(e){const t=this._tokenStartCharIndex,n=this._input.index,i=this._input.getText(t,n),r="token recognition error at: '"+this.getErrorDisplay(i)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,r,e)}getErrorDisplay(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t.join("")}getErrorDisplayForChar(e){return e.charCodeAt(0)===i.EOF?"<EOF>":"\n"===e?"\\n":"\t"===e?"\\t":"\r"===e?"\\r":e}getCharErrorDisplay(e){return"'"+this.getErrorDisplayForChar(e)+"'"}recover(e){this._input.LA(1)!==i.EOF&&(e instanceof s?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(e){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=e,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(e){this._type=e}get line(){return this._interp.line}set line(e){this._interp.line=e}get column(){return this._interp.column}set column(e){this._interp.column=e}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(e){this._text=e}}l.DEFAULT_MODE=0,l.MORE=-2,l.SKIP=-3,l.DEFAULT_TOKEN_CHANNEL=i.DEFAULT_CHANNEL,l.HIDDEN=i.HIDDEN_CHANNEL,l.MIN_CHAR_VALUE=0,l.MAX_CHAR_VALUE=1114111,e.exports=l},233:function(e,t,n){const{Token:i}=n(5537),{ParseTreeListener:r,TerminalNode:a,ErrorNode:o}=n(5489),s=n(9612),{DefaultErrorStrategy:l}=n(422),c=n(6220),u=n(8550),d=n(7318);class m extends r{constructor(e){super(),this.parser=e}enterEveryRule(e){console.log("enter "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}visitTerminal(e){console.log("consume "+e.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}exitEveryRule(e){console.log("exit "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}class p extends s{constructor(e){super(),this._input=null,this._errHandler=new l,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(e)}reset(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()}match(e){let t=this.getCurrentToken();return t.type===e?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t}matchWildcard(){let e=this.getCurrentToken();return e.type>0?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this._buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}getParseListeners(){return this._parseListeners||[]}addParseListener(e){if(null===e)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(e)}removeParseListener(e){if(null!==this._parseListeners){const t=this._parseListeners.indexOf(e);t>=0&&this._parseListeners.splice(t,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.forEach((function(t){t.enterEveryRule(e),e.enterRule(t)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(t){e.exitRule(t),t.exitEveryRule(e)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(e){this._input.tokenSource._factory=e}getATNWithBypassAlts(){const e=this.getSerializedATN();if(null===e)throw"The current parser does not support an ATN with bypass alternatives.";let t=this.bypassAltsAtnCache[e];if(null===t){const n=new u;n.generateRuleBypassTransitions=!0,t=new c(n).deserialize(e),this.bypassAltsAtnCache[e]=t}return t}compileParseTreePattern(e,t,n){if(null===(n=n||null)&&null!==this.getTokenStream()){const e=this.getTokenStream().tokenSource;e instanceof d&&(n=e)}if(null===n)throw"Parser can't discover a lexer to use";return new ParseTreePatternMatcher(n,this).compile(e,t)}getInputStream(){return this.getTokenStream()}setInputStream(e){this.setTokenStream(e)}getTokenStream(){return this._input}setTokenStream(e){this._input=null,this.reset(),this._input=e}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(e,t,n){n=n||null,null===(t=t||null)&&(t=this.getCurrentToken()),this._syntaxErrors+=1;const i=t.line,r=t.column;this.getErrorListenerDispatch().syntaxError(this,t,i,r,e,n)}consume(){const e=this.getCurrentToken();e.type!==i.EOF&&this.getInputStream().consume();const t=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||t){let n;n=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(e):this._ctx.addTokenNode(e),n.invokingState=this.state,t&&this._parseListeners.forEach((function(e){n instanceof o||void 0!==n.isErrorNode&&n.isErrorNode()?e.visitErrorNode(n):n instanceof a&&e.visitTerminal(n)}))}return e}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(e,t,n){this.state=t,this._ctx=e,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(e,t){e.setAltNumber(t),this.buildParseTrees&&this._ctx!==e&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(e)),this._ctx=e}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(e,t,n,i){this.state=t,this._precedenceStack.push(i),this._ctx=e,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(e,t,n){const i=this._ctx;i.parentCtx=e,i.invokingState=t,i.stop=this._input.LT(-1),this._ctx=e,this._ctx.start=i.start,this.buildParseTrees&&this._ctx.addChild(i),this.triggerEnterRuleEvent()}unrollRecursionContexts(e){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const t=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==e;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=e;t.parentCtx=e,this.buildParseTrees&&null!==e&&e.addChild(t)}getInvokingContext(e){let t=this._ctx;for(;null!==t;){if(t.ruleIndex===e)return t;t=t.parentCtx}return null}precpred(e,t){return t>=this._precedenceStack[this._precedenceStack.length-1]}inContext(e){return!1}isExpectedToken(e){const t=this._interp.atn;let n=this._ctx;const r=t.states[this.state];let a=t.nextTokens(r);if(a.contains(e))return!0;if(!a.contains(i.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&a.contains(i.EPSILON);){const i=t.states[n.invokingState].transitions[0];if(a=t.nextTokens(i.followState),a.contains(e))return!0;n=n.parentCtx}return!(!a.contains(i.EPSILON)||e!==i.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const e=this._interp.atn,t=e.states[this.state];return e.nextTokens(t)}getRuleIndex(e){const t=this.getRuleIndexMap()[e];return null!==t?t:-1}getRuleInvocationStack(e){null===(e=e||null)&&(e=this._ctx);const t=[];for(;null!==e;){const n=e.ruleIndex;n<0?t.push("n/a"):t.push(this.ruleNames[n]),e=e.parentCtx}return t}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let e=!1;for(let t=0;t<this._interp.decisionToDFA.length;t++){const n=this._interp.decisionToDFA[t];n.states.length>0&&(e&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),e=!0)}}getSourceName(){return this._input.sourceName}setTrace(e){e?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new m(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}p.bypassAltsAtnCache={},e.exports=p},72:function(e,t,n){const i=n(2841),r=n(5489),a=r.INVALID_INTERVAL,o=r.TerminalNode,s=r.TerminalNodeImpl,l=r.ErrorNodeImpl,c=n(7059).Interval;class u extends i{constructor(e,t){super(e=e||null,t=t||null),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(e){this.parentCtx=e.parentCtx,this.invokingState=e.invokingState,this.children=null,this.start=e.start,this.stop=e.stop,e.children&&(this.children=[],e.children.map((function(e){e instanceof l&&(this.children.push(e),e.parentCtx=this)}),this))}enterRule(e){}exitRule(e){}addChild(e){return null===this.children&&(this.children=[]),this.children.push(e),e}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(e){const t=new s(e);return this.addChild(t),t.parentCtx=this,t}addErrorNode(e){const t=new l(e);return this.addChild(t),t.parentCtx=this,t}getChild(e,t){if(t=t||null,null===this.children||e<0||e>=this.children.length)return null;if(null===t)return this.children[e];for(let n=0;n<this.children.length;n++){const i=this.children[n];if(i instanceof t){if(0===e)return i;e-=1}}return null}getToken(e,t){if(null===this.children||t<0||t>=this.children.length)return null;for(let n=0;n<this.children.length;n++){const i=this.children[n];if(i instanceof o&&i.symbol.type===e){if(0===t)return i;t-=1}}return null}getTokens(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const i=this.children[n];i instanceof o&&i.symbol.type===e&&t.push(i)}return t}}getTypedRuleContext(e,t){return this.getChild(t,e)}getTypedRuleContexts(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const i=this.children[n];i instanceof e&&t.push(i)}return t}}getChildCount(){return null===this.children?0:this.children.length}getSourceInterval(){return null===this.start||null===this.stop?a:new c(this.start.tokenIndex,this.stop.tokenIndex)}}i.EMPTY=new u;e.exports=u},6400:function(e,t,n){const i=n(2841),{Hash:r,Map:a,equalArrays:o}=n(2373);class s{constructor(e){this.cachedHashCode=e}isEmpty(){return this===s.EMPTY}hasEmptyPath(){return this.getReturnState(this.length-1)===s.EMPTY_RETURN_STATE}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}}s.EMPTY=null,s.EMPTY_RETURN_STATE=2147483647,s.globalNodeCount=1,s.id=s.globalNodeCount;class l extends s{constructor(e,t){let n=0;const i=new r;null!==e?i.update(e,t):i.update(1),n=i.finish(),super(n),this.parentCtx=e,this.returnState=t}getParent(e){return this.parentCtx}getReturnState(e){return this.returnState}equals(e){return this===e||e instanceof l&&(this.hashCode()===e.hashCode()&&(this.returnState===e.returnState&&(null==this.parentCtx?null==e.parentCtx:this.parentCtx.equals(e.parentCtx))))}toString(){const e=null===this.parentCtx?"":this.parentCtx.toString();return 0===e.length?this.returnState===s.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+e}get length(){return 1}static create(e,t){return t===s.EMPTY_RETURN_STATE&&null===e?s.EMPTY:new l(e,t)}}class c extends l{constructor(){super(null,s.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(e){return null}getReturnState(e){return this.returnState}equals(e){return this===e}toString(){return"$"}}s.EMPTY=new c;class u extends s{constructor(e,t){const n=new r;n.update(e,t);return super(n.finish()),this.parents=e,this.returnStates=t,this}isEmpty(){return this.returnStates[0]===s.EMPTY_RETURN_STATE}getParent(e){return this.parents[e]}getReturnState(e){return this.returnStates[e]}equals(e){return this===e||e instanceof u&&(this.hashCode()===e.hashCode()&&(o(this.returnStates,e.returnStates)&&o(this.parents,e.parents)))}toString(){if(this.isEmpty())return"[]";{let e="[";for(let t=0;t<this.returnStates.length;t++)t>0&&(e+=", "),this.returnStates[t]!==s.EMPTY_RETURN_STATE?(e+=this.returnStates[t],null!==this.parents[t]?e=e+" "+this.parents[t]:e+="null"):e+="$";return e+"]"}}get length(){return this.returnStates.length}}function d(e,t,n,i){if(e===t)return e;if(e instanceof l&&t instanceof l)return function(e,t,n,i){if(null!==i){let n=i.get(e,t);if(null!==n)return n;if(n=i.get(t,e),null!==n)return n}const r=function(e,t,n){if(n){if(e===s.EMPTY)return s.EMPTY;if(t===s.EMPTY)return s.EMPTY}else{if(e===s.EMPTY&&t===s.EMPTY)return s.EMPTY;if(e===s.EMPTY){const e=[t.returnState,s.EMPTY_RETURN_STATE],n=[t.parentCtx,null];return new u(n,e)}if(t===s.EMPTY){const t=[e.returnState,s.EMPTY_RETURN_STATE],n=[e.parentCtx,null];return new u(n,t)}}return null}(e,t,n);if(null!==r)return null!==i&&i.set(e,t,r),r;if(e.returnState===t.returnState){const r=d(e.parentCtx,t.parentCtx,n,i);if(r===e.parentCtx)return e;if(r===t.parentCtx)return t;const a=l.create(r,e.returnState);return null!==i&&i.set(e,t,a),a}{let n=null;if((e===t||null!==e.parentCtx&&e.parentCtx===t.parentCtx)&&(n=e.parentCtx),null!==n){const r=[e.returnState,t.returnState];e.returnState>t.returnState&&(r[0]=t.returnState,r[1]=e.returnState);const a=new u([n,n],r);return null!==i&&i.set(e,t,a),a}const r=[e.returnState,t.returnState];let a=[e.parentCtx,t.parentCtx];e.returnState>t.returnState&&(r[0]=t.returnState,r[1]=e.returnState,a=[t.parentCtx,e.parentCtx]);const o=new u(a,r);return null!==i&&i.set(e,t,o),o}}(e,t,n,i);if(n){if(e instanceof c)return e;if(t instanceof c)return t}return e instanceof l&&(e=new u([e.getParent()],[e.returnState])),t instanceof l&&(t=new u([t.getParent()],[t.returnState])),function(e,t,n,i){if(null!==i){let n=i.get(e,t);if(null!==n)return n;if(n=i.get(t,e),null!==n)return n}let r=0,o=0,c=0,m=[],p=[];for(;r<e.returnStates.length&&o<t.returnStates.length;){const a=e.parents[r],l=t.parents[o];if(e.returnStates[r]===t.returnStates[o]){const t=e.returnStates[r];t===s.EMPTY_RETURN_STATE&&null===a&&null===l||null!==a&&null!==l&&a===l?(p[c]=a,m[c]=t):(p[c]=d(a,l,n,i),m[c]=t),r+=1,o+=1}else e.returnStates[r]<t.returnStates[o]?(p[c]=a,m[c]=e.returnStates[r],r+=1):(p[c]=l,m[c]=t.returnStates[o],o+=1);c+=1}if(r<e.returnStates.length)for(let t=r;t<e.returnStates.length;t++)p[c]=e.parents[t],m[c]=e.returnStates[t],c+=1;else for(let e=o;e<t.returnStates.length;e++)p[c]=t.parents[e],m[c]=t.returnStates[e],c+=1;if(c<p.length){if(1===c){const n=l.create(p[0],m[0]);return null!==i&&i.set(e,t,n),n}p=p.slice(0,c),m=m.slice(0,c)}const f=new u(p,m);if(f===e)return null!==i&&i.set(e,t,e),e;if(f===t)return null!==i&&i.set(e,t,t),t;(function(e){const t=new a;for(let n=0;n<e.length;n++){const i=e[n];t.containsKey(i)||t.put(i,i)}for(let n=0;n<e.length;n++)e[n]=t.get(e[n])})(p),null!==i&&i.set(e,t,f);return f}(e,t,n,i)}e.exports={merge:d,PredictionContext:s,PredictionContextCache:class{constructor(){this.cache=new a}add(e){if(e===s.EMPTY)return s.EMPTY;const t=this.cache.get(e)||null;return null!==t?t:(this.cache.put(e,e),e)}get(e){return this.cache.get(e)||null}get length(){return this.cache.length}},SingletonPredictionContext:l,predictionContextFromRuleContext:function e(t,n){if(null==n&&(n=i.EMPTY),null===n.parentCtx||n===i.EMPTY)return s.EMPTY;const r=e(t,n.parentCtx),a=t.states[n.invokingState].transitions[0];return l.create(r,a.followState.stateNumber)},getCachedPredictionContext:function e(t,n,i){if(t.isEmpty())return t;let r=i.get(t)||null;if(null!==r)return r;if(r=n.get(t),null!==r)return i.put(t,r),r;let a=!1,o=[];for(let r=0;r<o.length;r++){const s=e(t.getParent(r),n,i);if(a||s!==t.getParent(r)){if(!a){o=[];for(let e=0;e<t.length;e++)o[e]=t.getParent(e);a=!0}o[r]=s}}if(!a)return n.add(t),i.put(t,t),t;let c=null;return c=0===o.length?s.EMPTY:1===o.length?l.create(o[0],t.getReturnState(0)):new u(o,t.returnStates),n.add(c),i.put(c,c),i.put(t,c),c}}},9612:function(e,t,n){const{Token:i}=n(5537),{ConsoleErrorListener:r}=n(6207),{ProxyErrorListener:a}=n(6207);class o{constructor(){this._listeners=[r.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(e){const t="4.9.3";t!==e&&console.log("ANTLR runtime and generated code versions disagree: 4.9.3!="+e)}addErrorListener(e){this._listeners.push(e)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const e=this.getLiteralNames(),t=this.getSymbolicNames(),n=e.length>t.length?e.length:t.length;this.tokenNames=[];for(let i=0;i<n;i++)this.tokenNames[i]=e[i]||t[i]||"<INVALID"}return this.tokenNames}getTokenTypeMap(){const e=this.getTokenNames();if(null===e)throw"The current recognizer does not provide a list of token names.";let t=this.tokenTypeMapCache[e];return void 0===t&&(t=e.reduce((function(e,t,n){e[t]=n})),t.EOF=i.EOF,this.tokenTypeMapCache[e]=t),t}getRuleIndexMap(){const e=this.ruleNames;if(null===e)throw"The current recognizer does not provide a list of rule names.";let t=this.ruleIndexMapCache[e];return void 0===t&&(t=e.reduce((function(e,t,n){e[t]=n})),this.ruleIndexMapCache[e]=t),t}getTokenType(e){const t=this.getTokenTypeMap()[e];return void 0!==t?t:i.INVALID_TYPE}getErrorHeader(e){return"line "+e.getOffendingToken().line+":"+e.getOffendingToken().column}getTokenErrorDisplay(e){if(null===e)return"<no token>";let t=e.text;return null===t&&(t=e.type===i.EOF?"<EOF>":"<"+e.type+">"),t=t.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+t+"'"}getErrorListenerDispatch(){return new a(this._listeners)}sempred(e,t,n){return!0}precpred(e,t){return!0}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}o.tokenTypeMapCache={},o.ruleIndexMapCache={},e.exports=o},2841:function(e,t,n){const{RuleNode:i}=n(5489),{INVALID_INTERVAL:r}=n(5489),a=n(164);e.exports=class extends i{constructor(e,t){super(),this.parentCtx=e||null,this.invokingState=t||-1}depth(){let e=0,t=this;for(;null!==t;)t=t.parentCtx,e+=1;return e}isEmpty(){return-1===this.invokingState}getSourceInterval(){return r}getRuleContext(){return this}getPayload(){return this}getText(){return 0===this.getChildCount()?"":this.children.map((function(e){return e.getText()})).join("")}getAltNumber(){return 0}setAltNumber(e){}getChild(e){return null}getChildCount(){return 0}accept(e){return e.visitChildren(this)}toStringTree(e,t){return a.toStringTree(this,e,t)}toString(e,t){e=e||null,t=t||null;let n=this,i="[";for(;null!==n&&n!==t;){if(null===e)n.isEmpty()||(i+=n.invokingState);else{const t=n.ruleIndex;i+=t>=0&&t<e.length?e[t]:""+t}null===n.parentCtx||null===e&&n.parentCtx.isEmpty()||(i+=" "),n=n.parentCtx}return i+="]",i}}},5537:function(e){class t{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(e){this._text=e}}t.INVALID_TYPE=0,t.EPSILON=-2,t.MIN_USER_TOKEN_TYPE=1,t.EOF=-1,t.DEFAULT_CHANNEL=0,t.HIDDEN_CHANNEL=1;class n extends t{constructor(e,i,r,a,o){super(),this.source=void 0!==e?e:n.EMPTY_SOURCE,this.type=void 0!==i?i:null,this.channel=void 0!==r?r:t.DEFAULT_CHANNEL,this.start=void 0!==a?a:-1,this.stop=void 0!==o?o:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=e[0].line,this.column=e[0].column):this.column=-1}clone(){const e=new n(this.source,this.type,this.channel,this.start,this.stop);return e.tokenIndex=this.tokenIndex,e.line=this.line,e.column=this.column,e.text=this.text,e}toString(){let e=this.text;return e=null!==e?e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+e+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const e=this.getInputStream();if(null===e)return null;const t=e.size;return this.start<t&&this.stop<t?e.getText(this.start,this.stop):"<EOF>"}set text(e){this._text=e}}n.EMPTY_SOURCE=[null,null],e.exports={Token:t,CommonToken:n}},2373:function(e){function t(e){return null===e?"null":e}function n(e){return Array.isArray(e)?"["+e.map(t).join(", ")+"]":"null"}function i(e,t){return e?e.equals(t):e==t}function r(e){return e?e.hashCode():-1}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){const e=this.toString();let t,n;const i=3&e.length,r=e.length-i;let a=String.prototype.seed;const o=3432918353,s=461845907;let l=0;for(;l<r;)n=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,n=(65535&n)*o+(((n>>>16)*o&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295,a^=n,a=a<<13|a>>>19,t=5*(65535&a)+((5*(a>>>16)&65535)<<16)&4294967295,a=27492+(65535&t)+((58964+(t>>>16)&65535)<<16);switch(n=0,i){case 3:n^=(255&e.charCodeAt(l+2))<<16;case 2:n^=(255&e.charCodeAt(l+1))<<8;case 1:n^=255&e.charCodeAt(l),n=(65535&n)*o+(((n>>>16)*o&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295,a^=n}return a^=e.length,a^=a>>>16,a=2246822507*(65535&a)+((2246822507*(a>>>16)&65535)<<16)&4294967295,a^=a>>>13,a=3266489909*(65535&a)+((3266489909*(a>>>16)&65535)<<16)&4294967295,a^=a>>>16,a>>>0};class a{constructor(){this.data=[]}add(e){this.data[e]=!0}or(e){const t=this;Object.keys(e.data).map((function(e){t.add(e)}))}remove(e){delete this.data[e]}contains(e){return!0===this.data[e]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){const e=new s;return e.update(this.values()),e.finish()}equals(e){return e instanceof a&&this.hashCode()===e.hashCode()}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class o{constructor(e,t){this.data={},this.hashFunction=e||r,this.equalsFunction=t||i}put(e,t){const n="hash_"+this.hashFunction(e);if(n in this.data){const i=this.data[n];for(let n=0;n<i.length;n++){const r=i[n];if(this.equalsFunction(e,r.key)){const e=r.value;return r.value=t,e}}return i.push({key:e,value:t}),t}return this.data[n]=[{key:e,value:t}],t}containsKey(e){const t="hash_"+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const i=n[t];if(this.equalsFunction(e,i.key))return!0}}return!1}get(e){const t="hash_"+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const i=n[t];if(this.equalsFunction(e,i.key))return i.value}}return null}entries(){let e=[];for(const t in this.data)0===t.indexOf("hash_")&&(e=e.concat(this.data[t]));return e}getKeys(){return this.entries().map((function(e){return e.key}))}getValues(){return this.entries().map((function(e){return e.value}))}toString(){return"["+this.entries().map((function(e){return"{"+e.key+":"+e.value+"}"})).join(", ")+"]"}get length(){let e=0;for(const t in this.data)0===t.indexOf("hash_")&&(e+=this.data[t].length);return e}}class s{constructor(){this.count=0,this.hash=0}update(){for(let e=0;e<arguments.length;e++){const t=arguments[e];if(null!=t)if(Array.isArray(t))this.update.apply(this,t);else{let e=0;switch(typeof t){case"undefined":case"function":continue;case"number":case"boolean":e=t;break;case"string":e=t.hashCode();break;default:t.updateHashCode?t.updateHashCode(this):console.log("No updateHashCode for "+t.toString());continue}e*=3432918353,e=e<<15|e>>>17,e*=461845907,this.count=this.count+1;let n=this.hash^e;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let e=this.hash^4*this.count;return e^=e>>>16,e*=2246822507,e^=e>>>13,e*=3266489909,e^=e>>>16,e}}e.exports={Hash:s,Set:class{constructor(e,t){this.data={},this.hashFunction=e||r,this.equalsFunction=t||i}add(e){const t="hash_"+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t];return n.push(e),e}return this.data[t]=[e],e}contains(e){return null!=this.get(e)}get(e){const t="hash_"+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t]}return null}values(){let e=[];for(const t in this.data)0===t.indexOf("hash_")&&(e=e.concat(this.data[t]));return e}toString(){return n(this.values())}get length(){let e=0;for(const t in this.data)0===t.indexOf("hash_")&&(e+=this.data[t].length);return e}},Map:o,BitSet:a,AltDict:class{constructor(){this.data={}}get(e){return(e="k-"+e)in this.data?this.data[e]:null}put(e,t){e="k-"+e,this.data[e]=t}values(){const e=this.data;return Object.keys(this.data).map((function(t){return e[t]}))}},DoubleDict:class{constructor(e){this.defaultMapCtor=e||o,this.cacheMap=new this.defaultMapCtor}get(e,t){const n=this.cacheMap.get(e)||null;return null===n?null:n.get(t)||null}set(e,t,n){let i=this.cacheMap.get(e)||null;null===i&&(i=new this.defaultMapCtor,this.cacheMap.put(e,i)),i.put(t,n)}},hashStuff:function(){const e=new s;return e.update.apply(e,arguments),e.finish()},escapeWhitespace:function(e,t){return e=e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),t&&(e=e.replace(/ /g,"·")),e},arrayToString:n,titleCase:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1)}))},equalArrays:function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!(e[n]===t[n]||e[n].equals&&e[n].equals(t[n])))return!1;return!0}}},4471:function(e,t,n){const i=n(3245),{IntervalSet:r}=n(7059),{Token:a}=n(5537);class o{constructor(e,t){this.grammarType=e,this.maxTokenType=t,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[]}nextTokensInContext(e,t){return new i(this).LOOK(e,null,t)}nextTokensNoContext(e){return null!==e.nextTokenWithinRule||(e.nextTokenWithinRule=this.nextTokensInContext(e,null),e.nextTokenWithinRule.readOnly=!0),e.nextTokenWithinRule}nextTokens(e,t){return void 0===t?this.nextTokensNoContext(e):this.nextTokensInContext(e,t)}addState(e){null!==e&&(e.atn=this,e.stateNumber=this.states.length),this.states.push(e)}removeState(e){this.states[e.stateNumber]=null}defineDecisionState(e){return this.decisionToState.push(e),e.decision=this.decisionToState.length-1,e.decision}getDecisionState(e){return 0===this.decisionToState.length?null:this.decisionToState[e]}getExpectedTokens(e,t){if(e<0||e>=this.states.length)throw"Invalid state number.";const n=this.states[e];let i=this.nextTokens(n);if(!i.contains(a.EPSILON))return i;const o=new r;for(o.addSet(i),o.removeOne(a.EPSILON);null!==t&&t.invokingState>=0&&i.contains(a.EPSILON);){const e=this.states[t.invokingState].transitions[0];i=this.nextTokens(e.followState),o.addSet(i),o.removeOne(a.EPSILON),t=t.parentCtx}return i.contains(a.EPSILON)&&o.addOne(a.EOF),o}}o.INVALID_ALT_NUMBER=0,e.exports=o},5185:function(e,t,n){const{DecisionState:i}=n(2766),{SemanticContext:r}=n(6389),{Hash:a}=n(2373);function o(e,t){if(null===e){const e={state:null,alt:null,context:null,semanticContext:null};return t&&(e.reachesIntoOuterContext=0),e}{const n={};return n.state=e.state||null,n.alt=void 0===e.alt?null:e.alt,n.context=e.context||null,n.semanticContext=e.semanticContext||null,t&&(n.reachesIntoOuterContext=e.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=e.precedenceFilterSuppressed||!1),n}}class s{constructor(e,t){this.checkContext(e,t),e=o(e),t=o(t,!0),this.state=null!==e.state?e.state:t.state,this.alt=null!==e.alt?e.alt:t.alt,this.context=null!==e.context?e.context:t.context,this.semanticContext=null!==e.semanticContext?e.semanticContext:null!==t.semanticContext?t.semanticContext:r.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,this.precedenceFilterSuppressed=t.precedenceFilterSuppressed}checkContext(e,t){null!==e.context&&void 0!==e.context||null!==t&&null!==t.context&&void 0!==t.context||(this.context=null)}hashCode(){const e=new a;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(e){return this===e||e instanceof s&&(this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&(null===this.context?null===e.context:this.context.equals(e.context))&&this.semanticContext.equals(e.semanticContext)&&this.precedenceFilterSuppressed===e.precedenceFilterSuppressed)}hashCodeForConfigSet(){const e=new a;return e.update(this.state.stateNumber,this.alt,this.semanticContext),e.finish()}equalsForConfigSet(e){return this===e||e instanceof s&&(this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&this.semanticContext.equals(e.semanticContext))}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==r.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class l extends s{constructor(e,t){super(e,t);const n=e.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==t?t.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==t&&this.checkNonGreedyDecision(t,this.state),this.hashCodeForConfigSet=l.prototype.hashCode,this.equalsForConfigSet=l.prototype.equals,this}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)}equals(e){return this===e||e instanceof l&&this.passedThroughNonGreedyDecision===e.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(e.lexerActionExecutor):!e.lexerActionExecutor)&&super.equals(e)}checkNonGreedyDecision(e,t){return e.passedThroughNonGreedyDecision||t instanceof i&&t.nonGreedy}}e.exports.ATNConfig=s,e.exports.LexerATNConfig=l},7329:function(e,t,n){const i=n(4471),r=n(2373),{SemanticContext:a}=n(6389),{merge:o}=n(6400);function s(e){return e.hashCodeForConfigSet()}function l(e,t){return e===t||null!==e&&null!==t&&e.equalsForConfigSet(t)}class c{constructor(e){this.configLookup=new r.Set(s,l),this.fullCtx=void 0===e||e,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(e,t){if(void 0===t&&(t=null),this.readOnly)throw"This set is readonly";e.semanticContext!==a.NONE&&(this.hasSemanticContext=!0),e.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(e);if(n===e)return this.cachedHashCode=-1,this.configs.push(e),!0;const i=!this.fullCtx,r=o(n.context,e.context,i,t);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,e.reachesIntoOuterContext),e.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=r,!0}getStates(){const e=new r.Set;for(let t=0;t<this.configs.length;t++)e.add(this.configs[t].state);return e}getPredicates(){const e=[];for(let t=0;t<this.configs.length;t++){const n=this.configs[t].semanticContext;n!==a.NONE&&e.push(n.semanticContext)}return e}optimizeConfigs(e){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(let t=0;t<this.configs.length;t++){const n=this.configs[t];n.context=e.getCachedContext(n.context)}}addAll(e){for(let t=0;t<e.length;t++)this.add(e[t]);return!1}equals(e){return this===e||e instanceof c&&r.equalArrays(this.configs,e.configs)&&this.fullCtx===e.fullCtx&&this.uniqueAlt===e.uniqueAlt&&this.conflictingAlts===e.conflictingAlts&&this.hasSemanticContext===e.hasSemanticContext&&this.dipsIntoOuterContext===e.dipsIntoOuterContext}hashCode(){const e=new r.Hash;return e.update(this.configs),e.finish()}updateHashCode(e){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),e.update(this.cachedHashCode)):e.update(this.hashCode())}isEmpty(){return 0===this.configs.length}contains(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(e)}containsFast(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(e)}clear(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new r.Set}setReadonly(e){this.readOnly=e,e&&(this.configLookup=null)}toString(){return r.arrayToString(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==i.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}get items(){return this.configs}get length(){return this.configs.length}}e.exports={ATNConfigSet:c,OrderedATNConfigSet:class extends c{constructor(){super(),this.configLookup=new r.Set}}}},8550:function(e){class t{constructor(e){void 0===e&&(e=null),this.readOnly=!1,this.verifyATN=null===e||e.verifyATN,this.generateRuleBypassTransitions=null!==e&&e.generateRuleBypassTransitions}}t.defaultOptions=new t,t.defaultOptions.readOnly=!0,e.exports=t},6220:function(e,t,n){const{Token:i}=n(5537),r=n(4471),a=n(6095),{ATNState:o,BasicState:s,DecisionState:l,BlockStartState:c,BlockEndState:u,LoopEndState:d,RuleStartState:m,RuleStopState:p,TokensStartState:f,PlusLoopbackState:h,StarLoopbackState:g,StarLoopEntryState:_,PlusBlockStartState:y,StarBlockStartState:x,BasicBlockStartState:E}=n(2766),{Transition:v,AtomTransition:b,SetTransition:M,NotSetTransition:T,RuleTransition:S,RangeTransition:D,ActionTransition:C,EpsilonTransition:L,WildcardTransition:R,PredicateTransition:k,PrecedencePredicateTransition:w}=n(5651),{IntervalSet:I}=n(7059),A=n(8550),{LexerActionType:Y,LexerSkipAction:P,LexerChannelAction:O,LexerCustomAction:N,LexerMoreAction:H,LexerTypeAction:j,LexerPushModeAction:F,LexerPopModeAction:q,LexerModeAction:B}=n(2446),U="59627784-3BE5-417A-B9EB-8131A7286089",V=["AADB8D7E-AEEF-4415-AD2B-8204D6CF042E",U],W=U;function z(e,t){const n=[];return n[e-1]=t,n.map((function(e){return t}))}const G=function(){const e=[];for(let t=0;t<256;t++)e[t]=(t+256).toString(16).substr(1).toUpperCase();return e}();e.exports=class{constructor(e){null==e&&(e=A.defaultOptions),this.deserializationOptions=e,this.stateFactories=null,this.actionFactories=null}isFeatureSupported(e,t){const n=V.indexOf(e);if(n<0)return!1;return V.indexOf(t)>=n}deserialize(e){this.reset(e),this.checkVersion(),this.checkUUID();const t=this.readATN();this.readStates(t),this.readRules(t),this.readModes(t);const n=[];return this.readSets(t,n,this.readInt.bind(this)),this.isFeatureSupported(U,this.uuid)&&this.readSets(t,n,this.readInt32.bind(this)),this.readEdges(t,n),this.readDecisions(t),this.readLexerActions(t),this.markPrecedenceDecisions(t),this.verifyATN(t),this.deserializationOptions.generateRuleBypassTransitions&&t.grammarType===a.PARSER&&(this.generateRuleBypassTransitions(t),this.verifyATN(t)),t}reset(e){const t=e.split("").map((function(e){const t=e.charCodeAt(0);return t>1?t-2:t+65534}));t[0]=e.charCodeAt(0),this.data=t,this.pos=0}checkVersion(){const e=this.readInt();if(3!==e)throw"Could not deserialize ATN with version "+e+" (expected 3)."}checkUUID(){const e=this.readUUID();if(V.indexOf(e)<0)throw W;this.uuid=e}readATN(){const e=this.readInt(),t=this.readInt();return new r(e,t)}readStates(e){let t,n,i;const r=[],a=[],s=this.readInt();for(let t=0;t<s;t++){const t=this.readInt();if(t===o.INVALID_TYPE){e.addState(null);continue}let n=this.readInt();65535===n&&(n=-1);const i=this.stateFactory(t,n);if(t===o.LOOP_END){const e=this.readInt();r.push([i,e])}else if(i instanceof c){const e=this.readInt();a.push([i,e])}e.addState(i)}for(t=0;t<r.length;t++)n=r[t],n[0].loopBackState=e.states[n[1]];for(t=0;t<a.length;t++)n=a[t],n[0].endState=e.states[n[1]];let l=this.readInt();for(t=0;t<l;t++)i=this.readInt(),e.states[i].nonGreedy=!0;let u=this.readInt();for(t=0;t<u;t++)i=this.readInt(),e.states[i].isPrecedenceRule=!0}readRules(e){let t;const n=this.readInt();for(e.grammarType===a.LEXER&&(e.ruleToTokenType=z(n,0)),e.ruleToStartState=z(n,0),t=0;t<n;t++){const n=this.readInt();if(e.ruleToStartState[t]=e.states[n],e.grammarType===a.LEXER){let n=this.readInt();65535===n&&(n=i.EOF),e.ruleToTokenType[t]=n}}for(e.ruleToStopState