/*! chevrotain - v6.5.0 */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("chevrotain",[],e):"object"==typeof exports?exports.chevrotain=e():t.chevrotain=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=18)}([function(t,e,n){"use strict";function r(t){return t&&0===t.length}function i(t){return null==t?[]:Object.keys(t)}function o(t){for(var e=[],n=Object.keys(t),r=0;r IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the flag on the relevant DSL method instead."),this.ignoredIssues=o.has(n,"ignoredIssues")?n.ignoredIssues:e.DEFAULT_PARSER_CONFIG.ignoredIssues,this.skipValidations=o.has(n,"skipValidations")?n.skipValidations:e.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(t){t.performSelfAnalysis()},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var n;e.selfAnalysisDone=!0;var r=e.className;e.TRACE_INIT("toFastProps",function(){o.toFastProperties(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),o.forEach(e.definedRulesNames,function(t){var n=e[t].originalGrammarAction,r=void 0;e.TRACE_INIT(t+" Rule",function(){r=e.topLevelRuleRecord(t,n)}),e.gastProductionsCache[t]=r})}finally{e.disableRecording()}});var i=[];if(e.TRACE_INIT("Grammar Resolving",function(){i=l.resolveGrammar({rules:o.values(e.gastProductionsCache)}),e.definitionErrors.push.apply(e.definitionErrors,i)}),e.TRACE_INIT("Grammar Validations",function(){if(o.isEmpty(i)&&!1===e.skipValidations){var t=l.validateGrammar({rules:o.values(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:o.values(e.tokensMap),ignoredIssues:e.ignoredIssues,errMsgProvider:u.defaultGrammarValidatorErrorProvider,grammarName:r});e.definitionErrors.push.apply(e.definitionErrors,t)}}),o.isEmpty(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var t=a.computeAllProdsFollows(o.values(e.gastProductionsCache));e.resyncFollows=t}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions(o.values(e.gastProductionsCache))})),e.TRACE_INIT("expandAllNestedRuleNames",function(){var t=c.expandAllNestedRuleNames(o.values(e.gastProductionsCache),e.fullRuleNameToShort);e.allRuleNames=t.allRuleNames}),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!o.isEmpty(e.definitionErrors))throw n=o.map(e.definitionErrors,function(t){return t.message}),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();e.Parser=A,o.applyMixins(A,[p.Recoverable,h.LooksAhead,f.TreeBuilder,d.LexerAdapter,E.RecognizerEngine,m.RecognizerApi,T.ErrorHandler,y.ContentAssist,v.GastRecorder,R.PerformanceTracer]);var _=function(t){function n(n,r){void 0===r&&(r=e.DEFAULT_PARSER_CONFIG);var i=o.cloneObj(r);return i.outputCst=!0,t.call(this,n,i)||this}return i(n,t),n}(A);e.CstParser=_;var g=function(t){function n(n,r){void 0===r&&(r=e.DEFAULT_PARSER_CONFIG);var i=o.cloneObj(r);return i.outputCst=!1,t.call(this,n,i)||this}return i(n,t),n}(A);e.EmbeddedActionsParser=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(5);function a(t){return r.isString(t.LABEL)&&""!==t.LABEL}e.tokenLabel=function(t){return a(t)?t.LABEL:t.name},e.tokenName=function(t){return t.name},e.hasTokenLabel=a;var s="parent",c="categories",u="label",l="group",p="push_mode",h="pop_mode",f="longer_alt",d="line_breaks",m="start_chars_hint";function E(t){return function(t){var e=t.pattern,n={};n.name=t.name,r.isUndefined(e)||(n.PATTERN=e);if(r.has(t,s))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";r.has(t,c)&&(n.CATEGORIES=t[c]);o.augmentTokenTypes([n]),r.has(t,u)&&(n.LABEL=t[u]);r.has(t,l)&&(n.GROUP=t[l]);r.has(t,h)&&(n.POP_MODE=t[h]);r.has(t,p)&&(n.PUSH_MODE=t[p]);r.has(t,f)&&(n.LONGER_ALT=t[f]);r.has(t,d)&&(n.LINE_BREAKS=t[d]);r.has(t,m)&&(n.START_CHARS_HINT=t[m]);return n}(t)}e.createToken=E,e.EOF=E({name:"EOF",pattern:i.Lexer.NA}),o.augmentTokenTypes([e.EOF]),e.createTokenInstance=function(t,e,n,r,i,o,a,s){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}},e.tokenMatcher=function(t,e){return o.tokenStructuredMatcher(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(){}return t.prototype.visit=function(t){var e=t;switch(e.constructor){case r.NonTerminal:return this.visitNonTerminal(e);case r.Flat:return this.visitFlat(e);case r.Option:return this.visitOption(e);case r.RepetitionMandatory:return this.visitRepetitionMandatory(e);case r.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(e);case r.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(e);case r.Repetition:return this.visitRepetition(e);case r.Alternation:return this.visitAlternation(e);case r.Terminal:return this.visitTerminal(e);case r.Rule:return this.visitRule(e);default:throw Error("non exhaustive match")}},t.prototype.visitNonTerminal=function(t){},t.prototype.visitFlat=function(t){},t.prototype.visitOption=function(t){},t.prototype.visitRepetition=function(t){},t.prototype.visitRepetitionMandatory=function(t){},t.prototype.visitRepetitionMandatoryWithSeparator=function(t){},t.prototype.visitRepetitionWithSeparator=function(t){},t.prototype.visitAlternation=function(t){},t.prototype.visitTerminal=function(t){},t.prototype.visitRule=function(t){},t}();e.GAstVisitor=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);function i(t){for(var e=r.cloneArr(t),n=t,i=!0;i;){n=r.compact(r.flatten(r.map(n,function(t){return t.CATEGORIES})));var o=r.difference(n,e);e=e.concat(o),r.isEmpty(o)?i=!1:n=o}return e}function o(t){r.forEach(t,function(t){u(t)||(e.tokenIdxToClass[e.tokenShortNameIdx]=t,t.tokenTypeIdx=e.tokenShortNameIdx++),l(t)&&!r.isArray(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),l(t)||(t.CATEGORIES=[]),p(t)||(t.categoryMatches=[]),h(t)||(t.categoryMatchesMap={})})}function a(t){r.forEach(t,function(t){t.categoryMatches=[],r.forEach(t.categoryMatchesMap,function(n,r){t.categoryMatches.push(e.tokenIdxToClass[r].tokenTypeIdx)})})}function s(t){r.forEach(t,function(t){c([],t)})}function c(t,e){r.forEach(t,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),r.forEach(e.CATEGORIES,function(n){var i=t.concat(e);r.contains(i,n)||c(i,n)})}function u(t){return r.has(t,"tokenTypeIdx")}function l(t){return r.has(t,"CATEGORIES")}function p(t){return r.has(t,"categoryMatches")}function h(t){return r.has(t,"categoryMatchesMap")}e.tokenStructuredMatcher=function(t,e){var n=t.tokenTypeIdx;return n===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[n]},e.tokenStructuredMatcherNoCategories=function(t,e){return t.tokenTypeIdx===e.tokenTypeIdx},e.tokenShortNameIdx=1,e.tokenIdxToClass={},e.augmentTokenTypes=function(t){var e=i(t);o(e),s(e),a(e),r.forEach(e,function(t){t.isParent=t.categoryMatches.length>0})},e.expandCategories=i,e.assignTokenDefaultProps=o,e.assignCategoriesTokensProp=a,e.assignCategoriesMapProp=s,e.singleAssignCategoriesToksMap=c,e.hasShortKeyProperty=u,e.hasCategoriesProperty=l,e.hasExtendingTokensTypesProperty=p,e.hasExtendingTokensTypesMapProperty=h,e.isTokenType=function(t){return r.has(t,"tokenTypeIdx")}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(1),s=n(4);e.isSequenceProd=function(t){return t instanceof a.Flat||t instanceof a.Option||t instanceof a.Repetition||t instanceof a.RepetitionMandatory||t instanceof a.RepetitionMandatoryWithSeparator||t instanceof a.RepetitionWithSeparator||t instanceof a.Terminal||t instanceof a.Rule},e.isOptionalProd=function t(e,n){return void 0===n&&(n=[]),!!(e instanceof a.Option||e instanceof a.Repetition||e instanceof a.RepetitionWithSeparator)||(e instanceof a.Alternation?o.some(e.definition,function(e){return t(e,n)}):!(e instanceof a.NonTerminal&&o.contains(n,e))&&e instanceof a.AbstractProduction&&(e instanceof a.NonTerminal&&n.push(e),o.every(e.definition,function(e){return t(e,n)})))},e.isBranchingProd=function(t){return t instanceof a.Alternation},e.getProductionDslName=function(t){if(t instanceof a.NonTerminal)return"SUBRULE";if(t instanceof a.Option)return"OPTION";if(t instanceof a.Alternation)return"OR";if(t instanceof a.RepetitionMandatory)return"AT_LEAST_ONE";if(t instanceof a.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(t instanceof a.RepetitionWithSeparator)return"MANY_SEP";if(t instanceof a.Repetition)return"MANY";if(t instanceof a.Terminal)return"CONSUME";throw Error("non exhaustive match")};var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.separator="-",e.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},e}return i(e,t),e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var e=t.terminalType.name+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitNonTerminal=function(t){var e=t.nonTerminalName+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(s.GAstVisitor);e.DslMethodsCollectorVisitor=c;var u=new c;e.collectMethods=function(t){u.reset(),t.accept(u);var e=u.dslMethods;return u.reset(),e}},function(t,e,n){"use strict";function r(t,e,n){return n|e|t}Object.defineProperty(e,"__esModule",{value:!0}),e.BITS_FOR_METHOD_TYPE=4,e.BITS_FOR_OCCURRENCE_IDX=8,e.BITS_FOR_RULE_IDX=12,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1< property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.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),i.isArray(t)?((a={modes:{}}).modes[r.DEFAULT_MODE]=i.cloneArr(t),a[r.DEFAULT_MODE]=r.DEFAULT_MODE):(u=!1,a=i.cloneObj(t))}),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.performRuntimeChecks(a,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(r.performWarningRuntimeChecks(a,n.trackStartLines,n.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},i.forEach(a.modes,function(t,e){a.modes[e]=i.reject(t,function(t){return i.isUndefined(t)})});var l=i.keys(a.modes);if(i.forEach(a.modes,function(t,a){n.TRACE_INIT("Mode: <"+a+"> processing",function(){var s;(n.modes.push(a),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.validatePatterns(t,l))}),i.isEmpty(n.lexerDefinitionErrors))&&(o.augmentTokenTypes(t),n.TRACE_INIT("analyzeTokenTypes",function(){s=r.analyzeTokenTypes(t,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:n.TRACE_INIT.bind(n)})}),n.patternIdxToConfig[a]=s.patternIdxToConfig,n.charCodeToPatternIdxToConfig[a]=s.charCodeToPatternIdxToConfig,n.emptyGroups=i.merge(n.emptyGroups,s.emptyGroups),n.hasCustom=s.hasCustom||n.hasCustom,n.canModeBeOptimized[a]=s.canBeOptimized)})}),n.defaultMode=a.defaultMode,!i.isEmpty(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var p=i.map(n.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+p)}i.forEach(n.lexerDefinitionWarning,function(t){i.PRINT_WARNING(t.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if(r.SUPPORT_STICKY?(n.chopInput=i.IDENTITY,n.match=n.matchWithTest):(n.updateLastIndex=i.NOOP,n.match=n.matchWithExec),u&&(n.handleModes=i.NOOP),!1===n.trackStartLines&&(n.computeNewColumn=i.IDENTITY),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=i.NOOP),/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))throw Error('Invalid config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}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 t=i.reduce(n.canModeBeOptimized,function(t,e,n){return!1===e&&t.push(n),t},[]);if(e.ensureOptimizations&&!i.isEmpty(t))throw Error("Lexer Modes: < "+t.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')}),n.TRACE_INIT("clearRegExpParserCache",function(){s.clearRegExpParserCache()}),n.TRACE_INIT("toFastProperties",function(){i.toFastProperties(n)})})}return t.prototype.tokenize=function(t,e){if(void 0===e&&(e=this.defaultMode),!i.isEmpty(this.lexerDefinitionErrors)){var n=i.map(this.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(t,e)},t.prototype.tokenizeInternal=function(t,e){var n,o,a,s,c,u,l,p,h,f,d,m,E,T,y=this,v=t,R=v.length,A=0,_=0,g=this.hasCustom?0:Math.floor(t.length/10),N=new Array(g),I=[],O=this.trackStartLines?1:void 0,S=this.trackStartLines?1:void 0,L=r.cloneEmptyGroups(this.emptyGroups),P=this.trackStartLines,C=this.config.lineTerminatorsPattern,k=0,x=[],M=[],F=[],b=[];Object.freeze(b);var D=void 0;function U(){return x}function w(t){var e=r.charCodeToOptimizedIndex(t),n=M[e];return void 0===n?b:n}var G,K=function(t){if(1===F.length&&void 0===t.tokenType.PUSH_MODE){var e=y.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);I.push({offset:t.startOffset,line:void 0!==t.startLine?t.startLine:void 0,column:void 0!==t.startColumn?t.startColumn:void 0,length:t.image.length,message:e})}else{F.pop();var n=i.last(F);x=y.patternIdxToConfig[n],M=y.charCodeToPatternIdxToConfig[n],k=x.length;var r=y.canModeBeOptimized[n]&&!1===y.config.safeMode;D=M&&r?w:U}};function B(t){F.push(t),M=this.charCodeToPatternIdxToConfig[t],x=this.patternIdxToConfig[t],k=x.length,k=x.length;var e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;D=M&&e?w:U}for(B.call(this,e);Ac.length&&(c=a,u=l,G=X)}break}}if(null!==c){if(p=c.length,void 0!==(h=G.group)&&(f=G.tokenTypeIdx,d=this.createTokenInstance(c,A,f,G.tokenType,O,S,p),this.handlePayload(d,u),!1===h?_=this.addToken(N,_,d):L[h].push(d)),t=this.chopInput(t,p),A+=p,S=this.computeNewColumn(S,p),!0===P&&!0===G.canLineTerminator){var H=0,q=void 0,$=void 0;C.lastIndex=0;do{!0===(q=C.test(c))&&($=C.lastIndex-1,H++)}while(!0===q);0!==H&&(O+=H,S=p-$,this.updateTokenEndLineColumnLocation(d,h,$,H,O,S,p))}this.handleModes(G,K,B,d)}else{for(var Z=A,Q=O,J=S,tt=!1;!tt&&A");var r=i.timer(e),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,a}return e()},t.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",t.NA=/NOT_APPLICABLE/,t}();e.Lexer=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(0),o=n(0),a=n(1),s=n(6),c=n(11);e.defaultParserErrorProvider={buildMismatchTokenMessage:function(t){var e=t.expected,n=t.actual;t.previous,t.ruleName;return"Expecting "+(r.hasTokenLabel(e)?"--\x3e "+r.tokenLabel(e)+" <--":"token of type --\x3e "+e.name+" <--")+" but found --\x3e '"+n.image+"' <--"},buildNotAllInputParsedMessage:function(t){var e=t.firstRedundant;t.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(t){var e=t.expectedPathsPerAlt,n=t.actual,i=(t.previous,t.customUserDescription),a=(t.ruleName,"\nbut found: '"+o.first(n).image+"'");if(i)return"Expecting: "+i+a;var s=o.reduce(e,function(t,e){return t.concat(e)},[]),c=o.map(s,function(t){return"["+o.map(t,function(t){return r.tokenLabel(t)}).join(", ")+"]"});return"Expecting: "+("one of these possible Token sequences:\n"+o.map(c,function(t,e){return" "+(e+1)+". "+t}).join("\n"))+a},buildEarlyExitMessage:function(t){var e=t.expectedIterationPaths,n=t.actual,i=t.customUserDescription,a=(t.ruleName,"\nbut found: '"+o.first(n).image+"'");return i?"Expecting: "+i+a:"Expecting: "+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+o.map(e,function(t){return"["+o.map(t,function(t){return r.tokenLabel(t)}).join(",")+"]"}).join(" ,")+">")+a}},Object.freeze(e.defaultParserErrorProvider),e.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"}},e.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(t,e){var n,r=t.name,i=o.first(e),c=i.idx,u=s.getProductionDslName(i),l=(n=i)instanceof a.Terminal?n.terminalType.name:n instanceof a.NonTerminal?n.nonTerminalName:"",p="->"+u+(c>0?c:"")+"<- "+(l?"with argument: ->"+l+"<-":"")+"\n appears more than once ("+e.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return p=(p=p.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(t,e){return"Invalid nested rule name: ->"+e.name+"<- inside rule: ->"+t.name+"<-\nit must match the pattern: ->"+c.validNestedRuleName.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(t,e){return"Duplicate nested rule name: ->"+o.first(e).name+"<- inside rule: ->"+t.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(t){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;return"Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx,i="Ambiguous Alternatives Detected: <"+t.ambiguityIndices.join(" ,")+"> in inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\n";return i+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(t){var e=s.getProductionDslName(t.repetition);return 0!==t.repetition.idx&&(e+=t.repetition.idx),"The repetition <"+e+"> within Rule <"+t.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(t){return"Invalid Grammar Token name: ->"+t.tokenType.name+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(t){return"Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+"> in inside <"+t.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(t){return"An Alternation cannot have more than 256 alternatives:\n inside <"+t.topLevelRule.name+"> Rule.\n has "+(t.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(t){var e=t.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+e+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(e+" --\x3e "+i.map(t.leftRecursionPath,function(t){return t.name}).concat([e]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(t){return"Invalid grammar rule name: ->"+t.topLevelRule.name+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(t){return"Duplicate definition, rule: ->"+(t.topLevelRule instanceof a.Rule?t.topLevelRule.name:t.topLevelRule)+"<- is already defined in the grammar: ->"+t.grammarName+"<-"}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(0),s=n(2),c=n(6),u=n(12),l=n(17),p=n(13),h=n(1),f=n(4);function d(t){return c.getProductionDslName(t)+"_#_"+t.idx+"_#_"+m(t)}function m(t){return t instanceof h.Terminal?t.terminalType.name:t instanceof h.NonTerminal?t.nonTerminalName:""}e.validateGrammar=function(t,e,n,r,i,u){var p=o.map(t,function(t){return function(t,e){var n=new E;t.accept(n);var r=n.allProductions,i=o.groupBy(r,d),a=o.pick(i,function(t){return t.length>1});return o.map(o.values(a),function(n){var r=o.first(n),i=e.buildDuplicateFoundError(t,n),a=c.getProductionDslName(r),u={message:i,type:s.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:r.idx},l=m(r);return l&&(u.parameter=l),u})}(t,i)}),h=o.map(t,function(t){return A(t,t,i)}),f=[],_=[],g=[];a.every(h,a.isEmpty)&&(f=a.map(t,function(t){return N(t,i)}),_=a.map(t,function(t){return I(t,e,r,i)}),g=L(t,e,i));var O=function(t,e,n){var r=[],i=a.map(e,function(t){return t.name});return a.forEach(t,function(t){var e=t.name;if(a.contains(i,e)){var o=n.buildNamespaceConflictError(t);r.push({message:o,type:s.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}}),r}(t,n,i),P=o.map(n,function(t){return v(t,i)}),C=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.map(r.result,function(t){return t.orgProd});n.push(a.map(i,function(n){return y(t,n,e)}))}),a.flatten(n)}(t,i),k=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.groupBy(r.result,function(t){return t.name}),o=a.pick(i,function(t){return t.length>1});a.forEach(a.values(o),function(r){var i=a.map(r,function(t){return t.orgProd}),o=e.buildDuplicateNestedRuleNameError(t,i);n.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:t.name})})}),n}(t,i),x=a.map(t,function(t){return S(t,i)}),M=a.map(t,function(t){return T(t,i)}),F=a.map(t,function(e){return R(e,t,u,i)});return o.flatten(p.concat(P,C,k,g,h,f,_,O,x,M,F))},e.identifyProductionForDuplicates=d;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(f.GAstVisitor);function T(t,n){var r=[],i=t.name;return i.match(e.validTermsPattern)||r.push({message:n.buildInvalidRuleNameError({topLevelRule:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:i}),r}function y(t,n,r){var i,o=[];return n.name.match(e.validNestedRuleName)||(i=r.buildInvalidNestedRuleNameError(t,n),o.push({message:i,type:s.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:t.name})),o}function v(t,n){var r=[];return t.name.match(e.validTermsPattern)||r.push({message:n.buildTokenNameError({tokenType:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function R(t,e,n,r){var i=[];if(a.reduce(e,function(e,n){return n.name===t.name?e+1:e},0)>1){var o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function A(t,e,n,r){void 0===r&&(r=[]);var i=[],a=_(e.definition);if(o.isEmpty(a))return[];var c=t.name;o.contains(a,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:s.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:c});var u=o.difference(a,r.concat([t])),l=o.map(u,function(e){var i=o.cloneArr(r);return i.push(e),A(t,e,n,i)});return i.concat(o.flatten(l))}function _(t){var e=[];if(o.isEmpty(t))return e;var n=o.first(t);if(n instanceof h.NonTerminal)e.push(n.referencedRule);else if(n instanceof h.Flat||n instanceof h.Option||n instanceof h.RepetitionMandatory||n instanceof h.RepetitionMandatoryWithSeparator||n instanceof h.RepetitionWithSeparator||n instanceof h.Repetition)e=e.concat(_(n.definition));else if(n instanceof h.Alternation)e=o.flatten(o.map(n.definition,function(t){return _(t.definition)}));else if(!(n instanceof h.Terminal))throw Error("non exhaustive match");var r=c.isOptionalProd(n),i=t.length>1;if(r&&i){var a=o.drop(t);return e.concat(_(a))}return e}e.OccurrenceValidationCollector=E,e.validTermsPattern=/^[a-zA-Z_]\w*$/,e.validNestedRuleName=new RegExp(e.validTermsPattern.source.replace("^","^\\$")),e.validateRuleName=T,e.validateNestedRuleName=y,e.validateTokenName=v,e.validateRuleDoesNotAlreadyExist=R,e.validateRuleIsOverridden=function(t,e,n){var r,i=[];return o.contains(e,t)||(r="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+n+"<-as it is not defined in any of the super grammars ",i.push({message:r,type:s.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),i},e.validateNoLeftRecursion=A,e.getFirstNoneTerminal=_;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.alternations=[],e}return i(e,t),e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(f.GAstVisitor);function N(t,e){var n=new g;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){var i=o.dropRight(r.definition),a=o.map(i,function(n,i){var a=p.nextPossibleTokensAfter([n],[],null,1);return o.isEmpty(a)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:r,emptyChoiceIdx:i}),type:s.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:r.idx,alternative:i+1}:null});return n.concat(o.compact(a))},[])}function I(t,e,n,r){var i=new g;t.accept(i);var l=i.alternations,p=n[t.name];return p&&(l=a.reject(l,function(t){return p[c.getProductionDslName(t)+(0===t.idx?"":t.idx)]})),l=a.reject(l,function(t){return!0===t.ignoreAmbiguities}),o.reduce(l,function(n,i){var c=i.idx,l=i.maxLookahead||e,p=u.getLookaheadPathsForOr(c,t,l,i),h=function(t,e,n,r){var i=[],c=a.reduce(t,function(n,r,o){return!0===e.definition[o].ignoreAmbiguities?n:(a.forEach(r,function(r){var s=[o];a.forEach(t,function(t,n){o!==n&&u.containsPath(t,r)&&!0!==e.definition[n].ignoreAmbiguities&&s.push(n)}),s.length>1&&!u.containsPath(i,r)&&(i.push(r),n.push({alts:s,path:r}))}),n)},[]);return o.map(c,function(t){var i=a.map(t.alts,function(t){return t+1}),o=r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path});return{message:o,type:s.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:[t.alts]}})}(p,i,t,r),f=P(p,i,t,r);return n.concat(h,f)},[])}e.validateEmptyOrAlternative=N,e.validateAmbiguousAlternationAlternatives=I;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(f.GAstVisitor);function S(t,e){var n=new g;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){return r.definition.length>255&&n.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:s.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}),n},[])}function L(t,e,n){var r=[];return a.forEach(t,function(t){var i=new O;t.accept(i);var o=i.allProductions;a.forEach(o,function(i){var o=u.getProdType(i),c=i.maxLookahead||e,l=i.idx,p=u.getLookaheadPathsForOptionalProd(l,t,o,c)[0];if(a.isEmpty(a.flatten(p))){var h=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:h,type:s.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}})}),r}function P(t,e,n,r){var i=[],o=a.reduce(t,function(t,e,n){var r=a.map(e,function(t){return{idx:n,path:t}});return t.concat(r)},[]);return a.forEach(o,function(t){if(!0!==e.definition[t.idx].ignoreAmbiguities){var c=t.idx,l=t.path,p=a.findAll(o,function(t){return!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx=0;L--){var P={idx:d,def:y.definition[L].definition.concat(a.drop(f)),ruleStack:m,occurrenceStack:T};p.push(P),p.push("EXIT_ALTERNATIVE")}else if(y instanceof c.Flat)p.push({idx:d,def:y.definition.concat(a.drop(f)),ruleStack:m,occurrenceStack:T});else{if(!(y instanceof c.Rule))throw Error("non exhaustive match");p.push(E(y,d,m,T))}}}else o&&a.last(p).idx<=u&&p.pop()}return l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=function(){function t(){}return t.prototype.walk=function(t,e){var n=this;void 0===e&&(e=[]),r.forEach(t.definition,function(o,a){var s=r.drop(t.definition,a+1);if(o instanceof i.NonTerminal)n.walkProdRef(o,s,e);else if(o instanceof i.Terminal)n.walkTerminal(o,s,e);else if(o instanceof i.Flat)n.walkFlat(o,s,e);else if(o instanceof i.Option)n.walkOption(o,s,e);else if(o instanceof i.RepetitionMandatory)n.walkAtLeastOne(o,s,e);else if(o instanceof i.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(o,s,e);else if(o instanceof i.RepetitionWithSeparator)n.walkManySep(o,s,e);else if(o instanceof i.Repetition)n.walkMany(o,s,e);else{if(!(o instanceof i.Alternation))throw Error("non exhaustive match");n.walkOr(o,s,e)}})},t.prototype.walkTerminal=function(t,e,n){},t.prototype.walkProdRef=function(t,e,n){},t.prototype.walkFlat=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkOption=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkAtLeastOne=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkAtLeastOneSep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkMany=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkManySep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkOr=function(t,e,n){var o=this,a=e.concat(n);r.forEach(t.definition,function(t){var e=new i.Flat({definition:[t]});o.walk(e,a)})},t}();function a(t,e,n){return[new i.Option({definition:[new i.Terminal({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}e.RestWalker=o},function(t,e,n){var r,i,o;"undefined"!=typeof self&&self,i=[],void 0===(o="function"==typeof(r=function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx},t.prototype.pattern=function(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");var e=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(n,"global");break;case"i":s(n,"ignoreCase");break;case"m":s(n,"multiLine");break;case"u":s(n,"unicode");break;case"y":s(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e}},t.prototype.disjunction=function(){var t=[];for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t}},t.prototype.alternative=function(){for(var t=[];this.isTerm();)t.push(this.term());return{type:"Alternative",value:t}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}c(t);var e=this.disjunction();return this.consumeChar(")"),{type:t,value:e}}!function(){throw Error("Internal Error - Should never get here!")}()},t.prototype.quantifier=function(t){var e;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:n,atMost:n};break;case",":var r;this.isDigit()?(r=this.integerIncludingZero(),e={atLeast:n,atMost:r}):e={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;c(e)}if(!0!==t||void 0!==e)return c(e),"?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e},t.prototype.atom=function(){var t;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}return void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),c(t),this.isQuantifier()&&(t.quantifier=this.quantifier()),t},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},t.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()}},t.prototype.decimalEscapeAtom=function(){var t=this.positiveInteger();return{type:"GroupBackReference",value:t}},t.prototype.characterClassEscape=function(){var t,e=!1;switch(this.popChar()){case"d":t=u;break;case"D":t=u,e=!0;break;case"s":t=p;break;case"S":t=p,e=!0;break;case"w":t=l;break;case"W":t=l,e=!0}return c(t),{type:"Set",value:t,complement:e}},t.prototype.controlEscapeAtom=function(){var t;switch(this.popChar()){case"f":t=o("\f");break;case"n":t=o("\n");break;case"r":t=o("\r");break;case"t":t=o("\t");break;case"v":t=o("\v")}return c(t),{type:"Character",value:t}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");var e=t.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:e}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var t=this.popChar();return{type:"Character",value:o(t)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var t=this.popChar();return{type:"Character",value:o(t)}}},t.prototype.characterClass=function(){var t=[],e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){var n=this.classAtom(),r="Character"===n.type;if(r&&this.isRangeDash()){this.consumeChar("-");var i=this.classAtom(),s="Character"===i.type;if(s){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++};var e,n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function o(t){return t.charCodeAt(0)}function a(t,e){void 0!==t.length?t.forEach(function(t){e.push(t)}):e.push(t)}function s(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e]=!0}function c(t){if(void 0===t)throw Error("Internal Error - Should never get here!")}var u=[];for(e=o("0");e<=o("9");e++)u.push(e);var l=[o("_")].concat(u);for(e=o("a");e<=o("z");e++)l.push(e);for(e=o("A");e<=o("Z");e++)l.push(e);var p=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function h(){}return h.prototype.visitChildren=function(t){for(var e in t){var n=t[e];t.hasOwnProperty(e)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(function(t){this.visit(t)},this))}},h.prototype.visit=function(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)},h.prototype.visitPattern=function(t){},h.prototype.visitFlags=function(t){},h.prototype.visitDisjunction=function(t){},h.prototype.visitAlternative=function(t){},h.prototype.visitStartAnchor=function(t){},h.prototype.visitEndAnchor=function(t){},h.prototype.visitWordBoundary=function(t){},h.prototype.visitNonWordBoundary=function(t){},h.prototype.visitLookahead=function(t){},h.prototype.visitNegativeLookahead=function(t){},h.prototype.visitCharacter=function(t){},h.prototype.visitSet=function(t){},h.prototype.visitGroup=function(t){},h.prototype.visitGroupBackReference=function(t){},h.prototype.visitQuantifier=function(t){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.4.0"}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15),i={},o=new r.RegExpParser;e.getRegExpAst=function(t){var e=t.toString();if(i.hasOwnProperty(e))return i[e];var n=o.pattern(e);return i[e]=n,n},e.clearRegExpParserCache=function(){i={}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(7),s=n(1),c=n(4);e.setNodeLocationOnlyOffset=function(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset1;o.forEach(t.definition,function(r,i){if(!o.isUndefined(r.name)){var c=r.definition;c=n?[new s.Option({definition:r.definition})]:r.definition;var u=a.getKeyForAltIndex(e.ruleIdx,a.OR_IDX,t.idx,i);e.result.push({def:c,key:u,name:r.name,orgProd:r})}})},e}(c.GAstVisitor);e.NamedDSLMethodsCollectorVisitor=u,e.expandAllNestedRuleNames=function(t,e){var n={allRuleNames:[]};return o.forEach(t,function(t){var r=e[t.name];n.allRuleNames.push(t.name);var i=new u(r);t.accept(i),o.forEach(i.result,function(e){e.def,e.key;var r=e.name;n.allRuleNames.push(t.name+r)})}),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);e.VERSION=r.VERSION;var i=n(2);e.Parser=i.Parser,e.CstParser=i.CstParser,e.EmbeddedActionsParser=i.EmbeddedActionsParser,e.ParserDefinitionErrorType=i.ParserDefinitionErrorType,e.EMPTY_ALT=i.EMPTY_ALT;var o=n(9);e.Lexer=o.Lexer,e.LexerDefinitionErrorType=o.LexerDefinitionErrorType;var a=n(3);e.createToken=a.createToken,e.createTokenInstance=a.createTokenInstance,e.EOF=a.EOF,e.tokenLabel=a.tokenLabel,e.tokenMatcher=a.tokenMatcher,e.tokenName=a.tokenName;var s=n(10);e.defaultGrammarResolverErrorProvider=s.defaultGrammarResolverErrorProvider,e.defaultGrammarValidatorErrorProvider=s.defaultGrammarValidatorErrorProvider,e.defaultParserErrorProvider=s.defaultParserErrorProvider;var c=n(8);e.EarlyExitException=c.EarlyExitException,e.isRecognitionException=c.isRecognitionException,e.MismatchedTokenException=c.MismatchedTokenException,e.NotAllInputParsedException=c.NotAllInputParsedException,e.NoViableAltException=c.NoViableAltException;var u=n(21);e.defaultLexerErrorProvider=u.defaultLexerErrorProvider;var l=n(1);e.Alternation=l.Alternation,e.Flat=l.Flat,e.NonTerminal=l.NonTerminal,e.Option=l.Option,e.Repetition=l.Repetition,e.RepetitionMandatory=l.RepetitionMandatory,e.RepetitionMandatoryWithSeparator=l.RepetitionMandatoryWithSeparator,e.RepetitionWithSeparator=l.RepetitionWithSeparator,e.Rule=l.Rule,e.Terminal=l.Terminal;var p=n(1);e.serializeGrammar=p.serializeGrammar,e.serializeProduction=p.serializeProduction;var h=n(4);e.GAstVisitor=h.GAstVisitor;var f=n(24);e.assignOccurrenceIndices=f.assignOccurrenceIndices,e.resolveGrammar=f.resolveGrammar,e.validateGrammar=f.validateGrammar,e.clearCache=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")};var d=n(40);e.createSyntaxDiagramsCode=d.createSyntaxDiagramsCode;var m=n(41);e.generateParserFactory=m.generateParserFactory,e.generateParserModule=m.generateParserModule},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION="6.5.0"},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),a=n(9),s=n(0),c=n(28),u=n(16),l="PATTERN";function p(t){var e=s.filter(t,function(t){return!s.has(t,l)});return{errors:s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:a.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[t]}}),valid:s.difference(t,e)}}function h(t){var e=s.filter(t,function(t){var e=t[l];return!(s.isRegExp(e)||s.isFunction(e)||s.has(e,"exec")||s.isString(e))});return{errors:s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:a.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[t]}}),valid:s.difference(t,e)}}e.DEFAULT_MODE="defaultMode",e.MODES="modes",e.SUPPORT_STICKY="boolean"==typeof new RegExp("(?:)").sticky,e.disableSticky=function(){e.SUPPORT_STICKY=!1},e.enableSticky=function(){e.SUPPORT_STICKY=!0},e.analyzeTokenTypes=function(t,n){var r,i=(n=s.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(t,e){return e()}})).tracer;i("initCharCodeToOptimizedIndexMap",function(){!function(){if(s.isEmpty(x)){x=new Array(65536);for(var t=0;t<65536;t++)x[t]=t>255?255+~~(t/255):t}}()}),i("Reject Lexer.NA",function(){r=s.reject(t,function(t){return t[l]===a.Lexer.NA})});var o,u,p,h,f,d,m,E,T,y,v,R=!1;i("Transform Patterns",function(){R=!1,o=s.map(r,function(t){var e=t[l];if(s.isRegExp(e)){var r=e.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||s.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?n.useSticky?N(e):g(e):r[1]}if(s.isFunction(e))return R=!0,{exec:e};if(s.has(e,"exec"))return R=!0,e;if("string"==typeof e){if(1===e.length)return e;var i=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(i);return n.useSticky?N(o):g(o)}throw Error("non exhaustive match")})}),i("misc mapping",function(){u=s.map(r,function(t){return t.tokenTypeIdx}),p=s.map(r,function(t){var e=t.GROUP;if(e!==a.Lexer.SKIPPED){if(s.isString(e))return e;if(s.isUndefined(e))return!1;throw Error("non exhaustive match")}}),h=s.map(r,function(t){var e=t.LONGER_ALT;if(e)return s.indexOf(r,e)}),f=s.map(r,function(t){return t.PUSH_MODE}),d=s.map(r,function(t){return s.has(t,"POP_MODE")})}),i("Line Terminator Handling",function(){var t=P(n.lineTerminatorCharacters);m=s.map(r,function(t){return!1}),"onlyOffset"!==n.positionTracking&&(m=s.map(r,function(e){return s.has(e,"LINE_BREAKS")?e.LINE_BREAKS:!1===S(e,t)?c.canMatchCharCode(t,e.PATTERN):void 0}))}),i("Misc Mapping #2",function(){E=s.map(r,I),T=s.map(o,O),y=s.reduce(r,function(t,e){var n=e.GROUP;return s.isString(n)&&n!==a.Lexer.SKIPPED&&(t[n]=[]),t},{}),v=s.map(o,function(t,e){return{pattern:o[e],longerAlt:h[e],canLineTerminator:m[e],isCustom:E[e],short:T[e],group:p[e],push:f[e],pop:d[e],tokenTypeIdx:u[e],tokenType:r[e]}})});var A=!0,_=[];return n.safeMode||i("First Char Optimization",function(){_=s.reduce(r,function(t,e,r){if("string"==typeof e.PATTERN){var i=k(e.PATTERN.charCodeAt(0));C(t,i,v[r])}else if(s.isArray(e.START_CHARS_HINT)){var o;s.forEach(e.START_CHARS_HINT,function(e){var n=k("string"==typeof e?e.charCodeAt(0):e);o!==n&&(o=n,C(t,n,v[r]))})}else if(s.isRegExp(e.PATTERN))if(e.PATTERN.unicode)A=!1,n.ensureOptimizations&&s.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tUnable to analyze < "+e.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var a=c.getOptimizedStartCodesIndices(e.PATTERN,n.ensureOptimizations);s.isEmpty(a)&&(A=!1),s.forEach(a,function(e){C(t,e,v[r])})}else n.ensureOptimizations&&s.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tTokenType: <"+e.name+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),A=!1;return t},[])}),i("ArrayPacking",function(){_=s.packArray(_)}),{emptyGroups:y,patternIdxToConfig:v,charCodeToPatternIdxToConfig:_,hasCustom:R,canBeOptimized:A}},e.validatePatterns=function(t,e){var n=[],r=p(t);n=n.concat(r.errors);var i=h(r.valid),o=i.valid;return n=(n=(n=(n=(n=n.concat(i.errors)).concat(function(t){var e=[],n=s.filter(t,function(t){return s.isRegExp(t[l])});return e=(e=(e=(e=(e=e.concat(d(n))).concat(T(n))).concat(y(n))).concat(v(n))).concat(m(n))}(o))).concat(R(o))).concat(A(o,e))).concat(_(o))},e.findMissingPatterns=p,e.findInvalidPatterns=h;var f=/[^\\][\$]/;function d(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitEndAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=s.filter(t,function(t){var n=t[l];try{var r=u.getRegExpAst(n),i=new e;return i.visit(r),i.found}catch(t){return f.test(n.source)}});return s.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:a.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[t]}})}function m(t){var e=s.filter(t,function(t){return t[l].test("")});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:a.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[t]}})}e.findEndOfInputAnchor=d,e.findEmptyMatchRegExps=m;var E=/[^\\[][\^]|^\^/;function T(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitStartAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=s.filter(t,function(t){var n=t[l];try{var r=u.getRegExpAst(n),i=new e;return i.visit(r),i.found}catch(t){return E.test(n.source)}});return s.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:a.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[t]}})}function y(t){var e=s.filter(t,function(t){var e=t[l];return e instanceof RegExp&&(e.multiline||e.global)});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:a.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]}})}function v(t){var e=[],n=s.map(t,function(n){return s.reduce(t,function(t,r){return n.PATTERN.source!==r.PATTERN.source||s.contains(e,r)||r.PATTERN===a.Lexer.NA?t:(e.push(r),t.push(r),t)},[])});n=s.compact(n);var r=s.filter(n,function(t){return t.length>1});return s.map(r,function(t){var e=s.map(t,function(t){return t.name});return{message:"The same RegExp pattern ->"+s.first(t).PATTERN+"<-has been used in all of the following Token Types: "+e.join(", ")+" <-",type:a.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}})}function R(t){var e=s.filter(t,function(t){if(!s.has(t,"GROUP"))return!1;var e=t.GROUP;return e!==a.Lexer.SKIPPED&&e!==a.Lexer.NA&&!s.isString(e)});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:a.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]}})}function A(t,e){var n=s.filter(t,function(t){return void 0!==t.PUSH_MODE&&!s.contains(e,t.PUSH_MODE)});return s.map(n,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+t.PUSH_MODE+"<-which does not exist",type:a.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]}})}function _(t){var e=[],n=s.reduce(t,function(t,e,n){var r,i=e.PATTERN;return i===a.Lexer.NA?t:(s.isString(i)?t.push({str:i,idx:n,tokenType:e}):s.isRegExp(i)&&(r=i,void 0===s.find([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(t){return-1!==r.source.indexOf(t)}))&&t.push({str:i.source,idx:n,tokenType:e}),t)},[]);return s.forEach(t,function(t,r){s.forEach(n,function(n){var i=n.str,o=n.idx,c=n.tokenType;if(r"+t.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";e.push({message:u,type:a.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[t,c]})}})}),e}function g(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function N(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function I(t){var e=t.PATTERN;if(s.isRegExp(e))return!1;if(s.isFunction(e))return!0;if(s.has(e,"exec"))return!0;if(s.isString(e))return!1;throw Error("non exhaustive match")}function O(t){return!(!s.isString(t)||1!==t.length)&&t.charCodeAt(0)}function S(t,e){if(s.has(t,"LINE_BREAKS"))return!1;if(s.isRegExp(t.PATTERN)){try{c.canMatchCharCode(e,t.PATTERN)}catch(t){return{issue:a.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(s.isString(t.PATTERN))return!1;if(I(t))return{issue:a.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function L(t,e){if(e.issue===a.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+t.name+"> Token Type\n\t Root cause: "+e.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===a.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+t.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function P(t){return s.map(t,function(t){return s.isString(t)&&t.length>0?t.charCodeAt(0):t})}function C(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}function k(t){return t property in its definition\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),s.has(t,e.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.MODES+"> property in its definition\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),s.has(t,e.MODES)&&s.has(t,e.DEFAULT_MODE)&&!s.has(t.modes,t.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+e.DEFAULT_MODE+": <"+t.defaultMode+">which does not exist\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),s.has(t,e.MODES)&&s.forEach(t.modes,function(t,e){s.forEach(t,function(t,n){s.isUndefined(t)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+e+"> at index: <"+n+">\n",type:a.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i},e.performWarningRuntimeChecks=function(t,e,n){var r=[],i=!1,o=s.compact(s.flatten(s.mapValues(t.modes,function(t){return t}))),u=s.reject(o,function(t){return t[l]===a.Lexer.NA}),p=P(n);return e&&s.forEach(u,function(t){var e=S(t,p);if(!1!==e){var n={message:L(t,e),type:e.issue,tokenType:t};r.push(n)}else s.has(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):c.canMatchCharCode(p,t.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:a.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),r},e.cloneEmptyGroups=function(t){var e={},n=s.keys(t);return s.forEach(n,function(n){var r=t[n];if(!s.isArray(r))throw Error("non exhaustive match");e[n]=[]}),e},e.isCustomPattern=I,e.isShortPattern=O,e.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,n=this.lastIndex;n"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,n,r,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+", skipped "+n+" characters."}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(6);function a(t){if(t instanceof i.NonTerminal)return a(t.referencedRule);if(t instanceof i.Terminal)return u(t);if(o.isSequenceProd(t))return s(t);if(o.isBranchingProd(t))return c(t);throw Error("non exhaustive match")}function s(t){for(var e,n=[],i=t.definition,s=0,c=i.length>s,u=!0;c&&u;)e=i[s],u=o.isOptionalProd(e),n=n.concat(a(e)),s+=1,c=i.length>s;return r.uniq(n)}function c(t){var e=r.map(t.definition,function(t){return a(t)});return r.uniq(r.flatten(e))}function u(t){return[t.terminalType]}e.first=a,e.firstForSequence=s,e.firstForBranching=c,e.firstForTerminal=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IN="_~IN~_"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(29),o=n(11),a=n(10),s=n(6);e.resolveGrammar=function(t){t=r.defaults(t,{errMsgProvider:a.defaultGrammarResolverErrorProvider});var e={};return r.forEach(t.rules,function(t){e[t.name]=t}),i.resolveGrammar(e,t.errMsgProvider)},e.validateGrammar=function(t){return t=r.defaults(t,{errMsgProvider:a.defaultGrammarValidatorErrorProvider,ignoredIssues:{}}),o.validateGrammar(t.rules,t.maxLookahead,t.tokenTypes,t.ignoredIssues,t.errMsgProvider,t.grammarName)},e.assignOccurrenceIndices=function(t){r.forEach(t.rules,function(t){var e=new s.DslMethodsCollectorVisitor;t.accept(e),r.forEach(e.dslMethods,function(t){r.forEach(t,function(t,e){t.idx=e+1})})})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(0),o=n(8),a=n(23),s=n(2);function c(t){this.name=e.IN_RULE_RECOVERY_EXCEPTION,this.message=t}e.EOF_FOLLOW_KEY={},e.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException",e.InRuleRecoveryException=c,c.prototype=Error.prototype;var u=function(){function t(){}return t.prototype.initRecoverable=function(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=i.has(t,"recoveryEnabled")?t.recoveryEnabled:s.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=l)},t.prototype.getTokenToInsert=function(t){var e=r.createTokenInstance(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e},t.prototype.canTokenTypeBeInsertedInRecovery=function(t){return!0},t.prototype.tryInRepetitionRecovery=function(t,e,n,r){for(var a=this,s=this.findReSyncTokenType(),c=this.exportLexerState(),u=[],l=!1,p=this.LA(1),h=this.LA(1),f=function(){var t=a.LA(0),e=a.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:p,previous:t,ruleName:a.getCurrRuleFullName()}),n=new o.MismatchedTokenException(e,p,a.LA(0));n.resyncedTokens=i.dropRight(u),a.SAVE_ERROR(n)};!l;){if(this.tokenMatcher(h,r))return void f();if(n.call(this))return f(),void t.apply(this,e);this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,u))}this.importLexerState(c)},t.prototype.shouldInRepetitionRecoveryBeTried=function(t,e,n){return!1!==n&&(void 0!==t&&void 0!==e&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e)))))},t.prototype.getFollowsForInRuleRecovery=function(t,e){var n=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(n)},t.prototype.tryInRuleRecovery=function(t,e){if(this.canRecoverWithSingleTokenInsertion(t,e))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new c("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)},t.prototype.canRecoverWithSingleTokenInsertion=function(t,e){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(i.isEmpty(e))return!1;var r=this.LA(1);return void 0!==i.find(e,function(t){return n.tokenMatcher(r,t)})},t.prototype.canRecoverWithSingleTokenDeletion=function(t){return this.tokenMatcher(this.LA(2),t)},t.prototype.isInCurrentRuleReSyncSet=function(t){var e=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(e);return i.contains(n,t)},t.prototype.findReSyncTokenType=function(){for(var t=this.flattenFollowSet(),e=this.LA(1),n=2;;){var r=e.tokenType;if(i.contains(t,r))return r;e=this.LA(n),n++}},t.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return e.EOF_FOLLOW_KEY;var t=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}},t.prototype.buildFullFollowKeyStack=function(){var t=this,n=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return i.isEmpty(this.LAST_EXPLICIT_RULE_STACK)||(n=i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.RULE_STACK[e]}),r=i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.RULE_OCCURRENCE_STACK[e]})),i.map(n,function(i,o){return 0===o?e.EOF_FOLLOW_KEY:{ruleName:t.shortRuleNameToFullName(i),idxInCallingRule:r[o],inRule:t.shortRuleNameToFullName(n[o-1])}})},t.prototype.flattenFollowSet=function(){var t=this,e=i.map(this.buildFullFollowKeyStack(),function(e){return t.getFollowSetFromFollowKey(e)});return i.flatten(e)},t.prototype.getFollowSetFromFollowKey=function(t){if(t===e.EOF_FOLLOW_KEY)return[r.EOF];var n=t.ruleName+t.idxInCallingRule+a.IN+t.inRule;return this.resyncFollows[n]},t.prototype.addToResyncTokens=function(t,e){return this.tokenMatcher(t,r.EOF)||e.push(t),e},t.prototype.reSyncTo=function(t){for(var e=[],n=this.LA(1);!1===this.tokenMatcher(n,t);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,e);return i.dropRight(e)},t.prototype.attemptInRepetitionRecovery=function(t,e,n,r,i,o,a){},t.prototype.getCurrentGrammarPath=function(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:i.cloneArr(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}},t.prototype.getHumanReadableRuleStack=function(){var t=this;return i.isEmpty(this.LAST_EXPLICIT_RULE_STACK)?i.map(this.RULE_STACK,function(e){return t.shortRuleNameToFullName(e)}):i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.shortRuleNameToFullName(t.RULE_STACK[e])})},t}();function l(t,e,n,i,o,a,s){var c=this.getKeyForAutomaticLookahead(i,o),u=this.firstAfterRepMap[c];if(void 0===u){var l=this.getCurrRuleFullName();u=new a(this.getGAstProductions()[l],o).startWalking(),this.firstAfterRepMap[c]=u}var p=u.token,h=u.occurrence,f=u.isEndOfRule;1===this.RULE_STACK.length&&f&&void 0===p&&(p=r.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(p,h,s)&&this.tryInRepetitionRecovery(t,e,n,p)}e.Recoverable=u,e.attemptInRepetitionRecovery=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.classNameFromInstance=function(t){return a(t.constructor)};var i=/^\s*function\s*(\S*)\s*\(/,o="name";function a(t){var e=t.name;return e||t.toString().match(i)[1]}e.functionName=a,e.defineNameProp=function(t,e){var n=Object.getOwnPropertyDescriptor(t,o);return!(!r.isUndefined(n)&&!n.configurable||(Object.defineProperty(t,o,{enumerable:!1,configurable:!0,writable:!1,value:e}),0))}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(14),a=n(22),s=n(0),c=n(23),u=n(1),l=function(t){function e(e){var n=t.call(this)||this;return n.topProd=e,n.follows={},n}return i(e,t),e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,e,n){},e.prototype.walkProdRef=function(t,e,n){var r=p(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(n),o=new u.Flat({definition:i}),s=a.first(o);this.follows[r]=s},e}(o.RestWalker);function p(t,e){return t.name+e+c.IN}e.ResyncFollowsWalker=l,e.computeAllProdsFollows=function(t){var e={};return s.forEach(t,function(t){var n=new l(t).startWalking();s.assign(e,n)}),e},e.buildBetweenProdsFollowPrefix=p,e.buildInProdFollowPrefix=function(t){return t.terminalType.name+t.idx+c.IN}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),a=n(0),s=n(16),c=n(20),u="Complement Sets are not supported for first char optimization";function l(t,e,n){switch(t.type){case"Disjunction":for(var r=0;r=c.minOptimizationVal)for(var o=r.from>=c.minOptimizationVal?r.from:c.minOptimizationVal,a=r.to,s=c.charCodeToOptimizedIndex(o),u=c.charCodeToOptimizedIndex(a),l=s;l<=u;l++)e[l]=l}}});break;case"Group":l(s.value,e,n);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===f(s)||"Group"!==s.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return a.values(e)}function p(t,e,n){var r=c.charCodeToOptimizedIndex(t);e[r]=r,!0===n&&function(t,e){var n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){var i=c.charCodeToOptimizedIndex(r.charCodeAt(0));e[i]=i}else{var o=n.toLowerCase();if(o!==n){var i=c.charCodeToOptimizedIndex(o.charCodeAt(0));e[i]=i}}}(t,e)}function h(t,e){return a.find(t.value,function(t){if("number"==typeof t)return a.contains(e,t);var n=t;return void 0!==a.find(e,function(t){return n.from<=t&&t<=n.to})})}function f(t){return!(!t.quantifier||0!==t.quantifier.atLeast)||!!t.value&&(a.isArray(t.value)?a.every(t.value,f):f(t.value))}e.failedOptimizationPrefixMsg='Unable to use "first char" lexer optimizations:\n',e.getOptimizedStartCodesIndices=function(t,n){void 0===n&&(n=!1);try{var r=s.getRegExpAst(t);return l(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===u)n&&a.PRINT_WARNING(e.failedOptimizationPrefixMsg+"\tUnable to optimize: < "+t.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var i="";n&&(i="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),a.PRINT_ERROR(e.failedOptimizationPrefixMsg+"\n\tFailed parsing: < "+t.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]},e.firstCharOptimizedIndices=l;var d=function(t){function e(e){var n=t.call(this)||this;return n.targetCharCodes=e,n.found=!1,n}return i(e,t),e.prototype.visitChildren=function(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}t.prototype.visitChildren.call(this,e)}},e.prototype.visitCharacter=function(t){a.contains(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?void 0===h(t,this.targetCharCodes)&&(this.found=!0):void 0!==h(t,this.targetCharCodes)&&(this.found=!0)},e}(o.BaseRegExpVisitor);e.canMatchCharCode=function(t,e){if(e instanceof RegExp){var n=s.getRegExpAst(e),r=new d(t);return r.visit(n),r.found}return void 0!==a.find(e,function(e){return a.contains(t,e.charCodeAt(0))})}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=n(0),s=n(4);e.resolveGrammar=function(t,e){var n=new c(t,e);return n.resolveRefs(),n.errors};var c=function(t){function e(e,n){var r=t.call(this)||this;return r.nameToTopRule=e,r.errMsgProvider=n,r.errors=[],r}return i(e,t),e.prototype.resolveRefs=function(){var t=this;a.forEach(a.values(this.nameToTopRule),function(e){t.currTopLevel=e,e.accept(t)})},e.prototype.visitNonTerminal=function(t){var e=this.nameToTopRule[t.nonTerminalName];if(e)t.referencedRule=e;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:o.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(s.GAstVisitor);e.GastRefResolverVisitor=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(0),o=n(2),a=n(7),s=n(6),c=function(){function t(){}return t.prototype.initLooksAhead=function(t){this.dynamicTokensEnabled=i.has(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:o.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=i.has(t,"maxLookahead")?t.maxLookahead:o.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=i.isES2015MapSupported()?new Map:[],i.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(t){var e=this;i.forEach(t,function(t){e.TRACE_INIT(t.name+" Rule Lookahead",function(){var n=s.collectMethods(t),o=n.alternation,c=n.repetition,u=n.option,l=n.repetitionMandatory,p=n.repetitionMandatoryWithSeparator,h=n.repetitionWithSeparator;i.forEach(o,function(n){var i=0===n.idx?"":n.idx;e.TRACE_INIT(""+s.getProductionDslName(n)+i,function(){var i=r.buildLookaheadFuncForOr(n.idx,t,n.maxLookahead||e.maxLookahead,n.hasPredicates,e.dynamicTokensEnabled,e.lookAheadBuilderForAlternatives),o=a.getKeyForAutomaticLookahead(e.fullRuleNameToShort[t.name],a.OR_IDX,n.idx);e.setLaFuncCache(o,i)})}),i.forEach(c,function(n){e.computeLookaheadFunc(t,n.idx,a.MANY_IDX,r.PROD_TYPE.REPETITION,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(u,function(n){e.computeLookaheadFunc(t,n.idx,a.OPTION_IDX,r.PROD_TYPE.OPTION,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(l,function(n){e.computeLookaheadFunc(t,n.idx,a.AT_LEAST_ONE_IDX,r.PROD_TYPE.REPETITION_MANDATORY,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(p,function(n){e.computeLookaheadFunc(t,n.idx,a.AT_LEAST_ONE_SEP_IDX,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(h,function(n){e.computeLookaheadFunc(t,n.idx,a.MANY_SEP_IDX,r.PROD_TYPE.REPETITION_WITH_SEPARATOR,n.maxLookahead,s.getProductionDslName(n))})})})},t.prototype.computeLookaheadFunc=function(t,e,n,i,o,s){var c=this;this.TRACE_INIT(""+s+(0===e?"":e),function(){var s=r.buildLookaheadFuncForOptionalProd(e,t,o||c.maxLookahead,c.dynamicTokensEnabled,i,c.lookAheadBuilderForOptional),u=a.getKeyForAutomaticLookahead(c.fullRuleNameToShort[t.name],n,e);c.setLaFuncCache(u,s)})},t.prototype.lookAheadBuilderForOptional=function(t,e,n){return r.buildSingleAlternativeLookaheadFunction(t,e,n)},t.prototype.lookAheadBuilderForAlternatives=function(t,e,n,i){return r.buildAlternativesLookAheadFunc(t,e,n,i)},t.prototype.getKeyForAutomaticLookahead=function(t,e){var n=this.getLastExplicitRuleShortName();return a.getKeyForAutomaticLookahead(n,t,e)},t.prototype.getLaFuncFromCache=function(t){},t.prototype.getLaFuncFromMap=function(t){return this.lookAheadFuncsCache.get(t)},t.prototype.getLaFuncFromObj=function(t){return this.lookAheadFuncsCache[t]},t.prototype.setLaFuncCache=function(t,e){},t.prototype.setLaFuncCacheUsingMap=function(t,e){this.lookAheadFuncsCache.set(t,e)},t.prototype.setLaFuncUsingObj=function(t,e){this.lookAheadFuncsCache[t]=e},t}();e.LooksAhead=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),i=n(0),o=n(32),a=n(7),s=n(2),c=function(){function t(){}return t.prototype.initTreeBuilder=function(t){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=i.has(t,"outputCst")?t.outputCst:s.DEFAULT_PARSER_CONFIG.outputCst,this.nodeLocationTracking=i.has(t,"nodeLocationTracking")?t.nodeLocationTracking:s.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=r.setNodeLocationFull,this.setNodeLocationFromNode=r.setNodeLocationFull,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=r.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=r.setNodeLocationOnlyOffset,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid config option: "'+t.nodeLocationTracking+'"');this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=i.NOOP}else this.cstInvocationStateUpdate=i.NOOP,this.cstFinallyStateUpdate=i.NOOP,this.cstPostTerminal=i.NOOP,this.cstPostNonTerminal=i.NOOP,this.cstPostRule=i.NOOP,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(t){t.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(t){var e=this.LA(1);t.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstNestedInvocationStateUpdate=function(t,e){var n={name:t,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+t,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstInvocationStateUpdate=function(t,e){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var n={name:t,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},t.prototype.cstNestedFinallyStateUpdate=function(){var t=this.CST_STACK.pop();this.cstPostRule(t)},t.prototype.cstPostRuleFull=function(t){var e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?(n.endOffset=e.endOffset,n.endLine=e.endLine,n.endColumn=e.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(t){var e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?n.endOffset=e.endOffset:n.startOffset=NaN},t.prototype.cstPostTerminal=function(t,e){var n=this.CST_STACK[this.CST_STACK.length-1];r.addTerminalToCst(n,e,t),this.setNodeLocationFromToken(n.location,e)},t.prototype.cstPostNonTerminal=function(t,e){if(!0!==this.isBackTracking()){var n=this.CST_STACK[this.CST_STACK.length-1];r.addNoneTerminalToCst(n,e,t),this.setNodeLocationFromNode(n.location,t.location)}},t.prototype.getBaseCstVisitorConstructor=function(){if(i.isUndefined(this.baseCstVisitorConstructor)){var t=o.createBaseSemanticVisitorConstructor(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(i.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var t=o.createBaseVisitorConstructorWithDefaults(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.nestedRuleBeforeClause=function(t,e){var n;return void 0!==t.NAME?(n=t.NAME,this.nestedRuleInvocationStateUpdate(n,e),n):void 0},t.prototype.nestedAltBeforeClause=function(t,e,n,r){var i,o=this.getLastExplicitRuleShortName(),s=a.getKeyForAltIndex(o,n,e,r);return void 0!==t.NAME?(i=t.NAME,this.nestedRuleInvocationStateUpdate(i,s),{shortName:s,nestedName:i}):void 0},t.prototype.nestedRuleFinallyClause=function(t,e){var n=this.CST_STACK,i=n[n.length-1];this.nestedRuleFinallyStateUpdate();var o=n[n.length-1];r.addNoneTerminalToCst(o,e,i),this.setNodeLocationFromNode(o.location,i.location)},t.prototype.getLastExplicitRuleShortName=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[t]},t.prototype.getLastExplicitRuleShortNameNoCst=function(){var t=this.RULE_STACK;return t[t.length-1]},t.prototype.getPreviousExplicitRuleShortName=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[t]},t.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var t=this.RULE_STACK;return t[t.length-2]},t.prototype.getLastExplicitRuleOccurrenceIndex=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[t]},t.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]},t.prototype.nestedRuleInvocationStateUpdate=function(t,e){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(e),this.cstNestedInvocationStateUpdate(t,e)},t.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},t}();e.TreeBuilder=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),o=n(26),a=n(11);function s(t,e){for(var n=i.keys(t),r=n.length,o=0;o on "+o.functionName(t.constructor)+" CST Visitor.",type:r.MISSING_METHOD,methodName:e}});return i.compact(n)}e.defaultVisit=s,e.createBaseSemanticVisitorConstructor=function(t,e){var n=function(){};return o.defineNameProp(n,t+"BaseSemantics"),(n.prototype={visit:function(t,e){if(i.isArray(t)&&(t=t[0]),!i.isUndefined(t))return void 0!==t.fullName?this[t.fullName](t.children,e):this[t.name](t.children,e)},validateVisitor:function(){var t=c(this,e);if(!i.isEmpty(t)){var n=i.map(t,function(t){return t.msg});throw Error("Errors Detected in CST Visitor <"+o.functionName(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=n,n._RULE_NAMES=e,n},e.createBaseVisitorConstructorWithDefaults=function(t,e,n){var r=function(){};o.defineNameProp(r,t+"BaseSemanticsWithDefaults");var a=Object.create(n.prototype);return i.forEach(e,function(t){a[t]=s}),(r.prototype=a).constructor=r,r},function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"}(r=e.CstVisitorDefinitionError||(e.CstVisitorDefinitionError={})),e.validateVisitor=c,e.validateMissingCstMethods=u;var l=["constructor","visit","validateVisitor"];function p(t,e){var n=[];for(var s in t)a.validTermsPattern.test(s)&&i.isFunction(t[s])&&!i.contains(l,s)&&!i.contains(e,s)&&n.push({msg:"Redundant visitor method: <"+s+"> on "+o.functionName(t.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+a.validTermsPattern.source+"/.",type:r.REDUNDANT_METHOD,methodName:s});return n}e.validateRedundantMethods=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(t){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length},enumerable:!0,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):r.END_OF_FILE},t.prototype.LA=function(t){var e=this.currIdx+t;return e<0||this.tokVectorLength<=e?r.END_OF_FILE:this.tokVector[e]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(t){this.currIdx=t},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t}();e.LexerAdapter=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(8),o=n(2),a=n(10),s=n(11),c=n(1),u=function(){function t(){}return t.prototype.ACTION=function(t){return t.call(this)},t.prototype.consume=function(t,e,n){return this.consumeInternal(e,t,n)},t.prototype.subrule=function(t,e,n){return this.subruleInternal(e,t,n)},t.prototype.option=function(t,e){return this.optionInternal(e,t)},t.prototype.or=function(t,e){return this.orInternal(e,t)},t.prototype.many=function(t,e){return this.manyInternal(t,e)},t.prototype.atLeastOne=function(t,e){return this.atLeastOneInternal(t,e)},t.prototype.CONSUME=function(t,e){return this.consumeInternal(t,0,e)},t.prototype.CONSUME1=function(t,e){return this.consumeInternal(t,1,e)},t.prototype.CONSUME2=function(t,e){return this.consumeInternal(t,2,e)},t.prototype.CONSUME3=function(t,e){return this.consumeInternal(t,3,e)},t.prototype.CONSUME4=function(t,e){return this.consumeInternal(t,4,e)},t.prototype.CONSUME5=function(t,e){return this.consumeInternal(t,5,e)},t.prototype.CONSUME6=function(t,e){return this.consumeInternal(t,6,e)},t.prototype.CONSUME7=function(t,e){return this.consumeInternal(t,7,e)},t.prototype.CONSUME8=function(t,e){return this.consumeInternal(t,8,e)},t.prototype.CONSUME9=function(t,e){return this.consumeInternal(t,9,e)},t.prototype.SUBRULE=function(t,e){return this.subruleInternal(t,0,e)},t.prototype.SUBRULE1=function(t,e){return this.subruleInternal(t,1,e)},t.prototype.SUBRULE2=function(t,e){return this.subruleInternal(t,2,e)},t.prototype.SUBRULE3=function(t,e){return this.subruleInternal(t,3,e)},t.prototype.SUBRULE4=function(t,e){return this.subruleInternal(t,4,e)},t.prototype.SUBRULE5=function(t,e){return this.subruleInternal(t,5,e)},t.prototype.SUBRULE6=function(t,e){return this.subruleInternal(t,6,e)},t.prototype.SUBRULE7=function(t,e){return this.subruleInternal(t,7,e)},t.prototype.SUBRULE8=function(t,e){return this.subruleInternal(t,8,e)},t.prototype.SUBRULE9=function(t,e){return this.subruleInternal(t,9,e)},t.prototype.OPTION=function(t){return this.optionInternal(t,0)},t.prototype.OPTION1=function(t){return this.optionInternal(t,1)},t.prototype.OPTION2=function(t){return this.optionInternal(t,2)},t.prototype.OPTION3=function(t){return this.optionInternal(t,3)},t.prototype.OPTION4=function(t){return this.optionInternal(t,4)},t.prototype.OPTION5=function(t){return this.optionInternal(t,5)},t.prototype.OPTION6=function(t){return this.optionInternal(t,6)},t.prototype.OPTION7=function(t){return this.optionInternal(t,7)},t.prototype.OPTION8=function(t){return this.optionInternal(t,8)},t.prototype.OPTION9=function(t){return this.optionInternal(t,9)},t.prototype.OR=function(t){return this.orInternal(t,0)},t.prototype.OR1=function(t){return this.orInternal(t,1)},t.prototype.OR2=function(t){return this.orInternal(t,2)},t.prototype.OR3=function(t){return this.orInternal(t,3)},t.prototype.OR4=function(t){return this.orInternal(t,4)},t.prototype.OR5=function(t){return this.orInternal(t,5)},t.prototype.OR6=function(t){return this.orInternal(t,6)},t.prototype.OR7=function(t){return this.orInternal(t,7)},t.prototype.OR8=function(t){return this.orInternal(t,8)},t.prototype.OR9=function(t){return this.orInternal(t,9)},t.prototype.MANY=function(t){this.manyInternal(0,t)},t.prototype.MANY1=function(t){this.manyInternal(1,t)},t.prototype.MANY2=function(t){this.manyInternal(2,t)},t.prototype.MANY3=function(t){this.manyInternal(3,t)},t.prototype.MANY4=function(t){this.manyInternal(4,t)},t.prototype.MANY5=function(t){this.manyInternal(5,t)},t.prototype.MANY6=function(t){this.manyInternal(6,t)},t.prototype.MANY7=function(t){this.manyInternal(7,t)},t.prototype.MANY8=function(t){this.manyInternal(8,t)},t.prototype.MANY9=function(t){this.manyInternal(9,t)},t.prototype.MANY_SEP=function(t){this.manySepFirstInternal(0,t)},t.prototype.MANY_SEP1=function(t){this.manySepFirstInternal(1,t)},t.prototype.MANY_SEP2=function(t){this.manySepFirstInternal(2,t)},t.prototype.MANY_SEP3=function(t){this.manySepFirstInternal(3,t)},t.prototype.MANY_SEP4=function(t){this.manySepFirstInternal(4,t)},t.prototype.MANY_SEP5=function(t){this.manySepFirstInternal(5,t)},t.prototype.MANY_SEP6=function(t){this.manySepFirstInternal(6,t)},t.prototype.MANY_SEP7=function(t){this.manySepFirstInternal(7,t)},t.prototype.MANY_SEP8=function(t){this.manySepFirstInternal(8,t)},t.prototype.MANY_SEP9=function(t){this.manySepFirstInternal(9,t)},t.prototype.AT_LEAST_ONE=function(t){this.atLeastOneInternal(0,t)},t.prototype.AT_LEAST_ONE1=function(t){return this.atLeastOneInternal(1,t)},t.prototype.AT_LEAST_ONE2=function(t){this.atLeastOneInternal(2,t)},t.prototype.AT_LEAST_ONE3=function(t){this.atLeastOneInternal(3,t)},t.prototype.AT_LEAST_ONE4=function(t){this.atLeastOneInternal(4,t)},t.prototype.AT_LEAST_ONE5=function(t){this.atLeastOneInternal(5,t)},t.prototype.AT_LEAST_ONE6=function(t){this.atLeastOneInternal(6,t)},t.prototype.AT_LEAST_ONE7=function(t){this.atLeastOneInternal(7,t)},t.prototype.AT_LEAST_ONE8=function(t){this.atLeastOneInternal(8,t)},t.prototype.AT_LEAST_ONE9=function(t){this.atLeastOneInternal(9,t)},t.prototype.AT_LEAST_ONE_SEP=function(t){this.atLeastOneSepFirstInternal(0,t)},t.prototype.AT_LEAST_ONE_SEP1=function(t){this.atLeastOneSepFirstInternal(1,t)},t.prototype.AT_LEAST_ONE_SEP2=function(t){this.atLeastOneSepFirstInternal(2,t)},t.prototype.AT_LEAST_ONE_SEP3=function(t){this.atLeastOneSepFirstInternal(3,t)},t.prototype.AT_LEAST_ONE_SEP4=function(t){this.atLeastOneSepFirstInternal(4,t)},t.prototype.AT_LEAST_ONE_SEP5=function(t){this.atLeastOneSepFirstInternal(5,t)},t.prototype.AT_LEAST_ONE_SEP6=function(t){this.atLeastOneSepFirstInternal(6,t)},t.prototype.AT_LEAST_ONE_SEP7=function(t){this.atLeastOneSepFirstInternal(7,t)},t.prototype.AT_LEAST_ONE_SEP8=function(t){this.atLeastOneSepFirstInternal(8,t)},t.prototype.AT_LEAST_ONE_SEP9=function(t){this.atLeastOneSepFirstInternal(9,t)},t.prototype.RULE=function(t,e,n){if(void 0===n&&(n=o.DEFAULT_RULE_CONFIG),r.contains(this.definedRulesNames,t)){var i={message:a.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(i)}this.definedRulesNames.push(t);var s=this.defineRule(t,e,n);return this[t]=s,s},t.prototype.OVERRIDE_RULE=function(t,e,n){void 0===n&&(n=o.DEFAULT_RULE_CONFIG);var r=[];r=r.concat(s.validateRuleIsOverridden(t,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r);var i=this.defineRule(t,e,n);return this[t]=i,i},t.prototype.BACKTRACK=function(t,e){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(i.isRecognitionException(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return c.serializeGrammar(r.values(this.gastProductionsCache))},t}();e.RecognizerApi=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(7),o=n(8),a=n(12),s=n(13),c=n(2),u=n(25),l=n(3),p=n(5),h=n(26),f=function(){function t(){}return t.prototype.initRecognizerEngine=function(t,e){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=p.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},r.has(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(r.isArray(t)){if(r.isEmpty(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(r.isArray(t))this.tokensMap=r.reduce(t,function(t,e){return t[e.name]=e,t},{});else if(r.has(t,"modes")&&r.every(r.flatten(r.values(t.modes)),p.isTokenType)){var n=r.flatten(r.values(t.modes)),i=r.uniq(n);this.tokensMap=r.reduce(i,function(t,e){return t[e.name]=e,t},{})}else{if(!r.isObject(t))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=r.cloneObj(t)}this.tokensMap.EOF=l.EOF;var o=r.every(r.values(t),function(t){return r.isEmpty(t.categoryMatches)});this.tokenMatcher=o?p.tokenStructuredMatcherNoCategories:p.tokenStructuredMatcher,p.augmentTokenTypes(r.values(this.tokensMap))},t.prototype.defineRule=function(t,e,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+t+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var o,a=r.has(n,"resyncEnabled")?n.resyncEnabled:c.DEFAULT_RULE_CONFIG.resyncEnabled,s=r.has(n,"recoveryValueFunc")?n.recoveryValueFunc:c.DEFAULT_RULE_CONFIG.recoveryValueFunc,u=this.ruleShortNameIdx<e},t.prototype.orInternalNoCst=function(t,e){var n=r.isArray(t)?t:t.DEF,o=this.getKeyForAutomaticLookahead(i.OR_IDX,e),a=this.getLaFuncFromCache(o).call(this,n);if(void 0!==a)return n[a].ALT.call(this);this.raiseNoAltException(e,t.ERR_MSG)},t.prototype.orInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.OR_IDX,e),o=this.nestedRuleBeforeClause(t,n);try{var a=r.isArray(t)?t:t.DEF,s=this.getLaFuncFromCache(n).call(this,a);if(void 0!==s){var c=a[s],u=this.nestedAltBeforeClause(c,e,i.OR_IDX,s);try{return c.ALT.call(this)}finally{void 0!==u&&this.nestedRuleFinallyClause(u.shortName,u.nestedName)}}this.raiseNoAltException(e,t.ERR_MSG)}finally{void 0!==o&&this.nestedRuleFinallyClause(n,o)}},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new o.NotAllInputParsedException(e,t))}},t.prototype.subruleInternal=function(t,e,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=t.call(this,e,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),r}catch(e){this.subruleInternalError(e,n,t.ruleName)}},t.prototype.subruleInternalError=function(t,e,n){throw o.isRecognitionException(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:n),delete t.partialCstResult),t},t.prototype.consumeInternal=function(t,e,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,t)?(this.consumeToken(),r=i):this.consumeInternalError(t,i,n)}catch(n){r=this.consumeInternalRecovery(t,e,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.name,r),r},t.prototype.consumeInternalError=function(t,e,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o.MismatchedTokenException(r,e,i))},t.prototype.consumeInternalRecovery=function(t,e,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,r)}catch(t){throw t.name===u.IN_RULE_RECOVERY_EXCEPTION?n:t}},t.prototype.saveRecogState=function(){var t=this.errors,e=r.cloneArr(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},t.prototype.reloadRecogState=function(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e,t)},t.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},t.prototype.getCurrRuleFullName=function(){var t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]},t.prototype.shortRuleNameToFullName=function(t){return this.shortRuleNameToFull[t]},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),l.EOF)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t}();e.RecognizerEngine=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(0),o=n(12),a=n(2),s=function(){function t(){}return t.prototype.initErrorHandler=function(t){this._errors=[],this.errorMessageProvider=i.defaults(t.errorMessageProvider,a.DEFAULT_PARSER_CONFIG.errorMessageProvider)},t.prototype.SAVE_ERROR=function(t){if(r.isRecognitionException(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:i.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return i.cloneArr(this._errors)},set:function(t){this._errors=t},enumerable:!0,configurable:!0}),t.prototype.raiseEarlyExitException=function(t,e,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],s=o.getLookaheadPathsForOptionalProd(t,a,e,this.maxLookahead)[0],c=[],u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new r.EarlyExitException(l,this.LA(1),this.LA(0)))},t.prototype.raiseNoAltException=function(t,e){for(var n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=o.getLookaheadPathsForOr(t,i,this.maxLookahead),s=[],c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));var u=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:u,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new r.NoViableAltException(l,this.LA(1),u))},t}();e.ErrorHandler=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(13),i=n(0),o=function(){function t(){}return t.prototype.initContentAssist=function(){},t.prototype.computeContentAssist=function(t,e){var n=this.gastProductionsCache[t];if(i.isUndefined(n))throw Error("Rule ->"+t+"<- does not exist in this grammar.");return r.nextPossibleTokensAfter([n],e,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(t){var e=i.first(t.ruleStack),n=this.getGAstProductions()[e];return new r.NextAfterTokenWalker(n,t).startWalking()},t}();e.ContentAssist=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(9),a=n(5),s=n(3),c=n(2),u=n(7),l={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(l);var p=Math.pow(2,u.BITS_FOR_OCCURRENCE_IDX)-1,h=s.createToken({name:"RECORDING_PHASE_TOKEN",pattern:o.Lexer.NA});a.augmentTokenTypes([h]);var f=s.createTokenInstance(h,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(f);var d={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},m=function(){function t(){}return t.prototype.initGastRecorder=function(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var t=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var e=function(e){var n=e>0?e:"";t["CONSUME"+n]=function(t,n){return this.consumeInternalRecord(t,e,n)},t["SUBRULE"+n]=function(t,n){return this.subruleInternalRecord(t,e,n)},t["OPTION"+n]=function(t){return this.optionInternalRecord(t,e)},t["OR"+n]=function(t){return this.orInternalRecord(t,e)},t["MANY"+n]=function(t){this.manyInternalRecord(e,t)},t["MANY_SEP"+n]=function(t){this.manySepFirstInternalRecord(e,t)},t["AT_LEAST_ONE"+n]=function(t){this.atLeastOneInternalRecord(e,t)},t["AT_LEAST_ONE_SEP"+n]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}},n=0;n<10;n++)e(n);t.consume=function(t,e,n){return this.consumeInternalRecord(e,t,n)},t.subrule=function(t,e,n){return this.subruleInternalRecord(e,t,n)},t.option=function(t,e){return this.optionInternalRecord(e,t)},t.or=function(t,e){return this.orInternalRecord(e,t)},t.many=function(t,e){this.manyInternalRecord(t,e)},t.atLeastOne=function(t,e){this.atLeastOneInternalRecord(t,e)},t.ACTION=t.ACTION_RECORD,t.BACKTRACK=t.BACKTRACK_RECORD,t.LA=t.LA_RECORD})},t.prototype.disableRecording=function(){var t=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var e=0;e<10;e++){var n=e>0?e:"";delete t["CONSUME"+n],delete t["SUBRULE"+n],delete t["OPTION"+n],delete t["OR"+n],delete t["MANY"+n],delete t["MANY_SEP"+n],delete t["AT_LEAST_ONE"+n],delete t["AT_LEAST_ONE_SEP"+n]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA})},t.prototype.ACTION_RECORD=function(t){},t.prototype.BACKTRACK_RECORD=function(t,e){return function(){return!0}},t.prototype.LA_RECORD=function(t){return c.END_OF_FILE},t.prototype.topLevelRuleRecord=function(t,e){try{var n=new i.Rule({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),e.call(this),this.recordingProdStack.pop(),n}catch(t){if(!0!==t.KNOWN_RECORDER_ERROR)try{t.message=t.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(e){throw t}throw t}},t.prototype.optionInternalRecord=function(t,e){return E.call(this,i.Option,t,e)},t.prototype.atLeastOneInternalRecord=function(t,e){E.call(this,i.RepetitionMandatory,e,t)},t.prototype.atLeastOneSepFirstInternalRecord=function(t,e){E.call(this,i.RepetitionMandatoryWithSeparator,e,t,!0)},t.prototype.manyInternalRecord=function(t,e){E.call(this,i.Repetition,e,t)},t.prototype.manySepFirstInternalRecord=function(t,e){E.call(this,i.RepetitionWithSeparator,e,t,!0)},t.prototype.orInternalRecord=function(t,e){return function(t,e){var n=this;y(e);var o=r.peek(this.recordingProdStack),a=!1===r.isArray(t),s=!1===a?t:t.DEF,c=new i.Alternation({definition:[],idx:e,ignoreAmbiguities:a&&!0===t.IGNORE_AMBIGUITIES});r.has(t,"NAME")&&(c.name=t.NAME);r.has(t,"MAX_LOOKAHEAD")&&(c.maxLookahead=t.MAX_LOOKAHEAD);var u=r.some(s,function(t){return r.isFunction(t.GATE)});return c.hasPredicates=u,o.definition.push(c),r.forEach(s,function(t){var e=new i.Flat({definition:[]});c.definition.push(e),r.has(t,"NAME")&&(e.name=t.NAME),r.has(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:r.has(t,"GATE")&&(e.ignoreAmbiguities=!0),n.recordingProdStack.push(e),t.ALT.call(n),n.recordingProdStack.pop()}),l}.call(this,t,e)},t.prototype.subruleInternalRecord=function(t,e,n){if(y(e),!t||!1===r.has(t,"ruleName")){var o=new Error(" argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(t)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var a=r.peek(this.recordingProdStack),s=t.ruleName,c=new i.NonTerminal({idx:e,nonTerminalName:s,referencedRule:void 0});return a.definition.push(c),this.outputCst?d:l},t.prototype.consumeInternalRecord=function(t,e,n){if(y(e),!a.hasShortKeyProperty(t)){var o=new Error(" argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(t)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var s=r.peek(this.recordingProdStack),c=new i.Terminal({idx:e,terminalType:t});return s.definition.push(c),f},t}();function E(t,e,n,i){void 0===i&&(i=!1),y(n);var o=r.peek(this.recordingProdStack),a=r.isFunction(e)?e:e.DEF,s=new t({definition:[],idx:n});return r.has(e,"NAME")&&(s.name=e.NAME),i&&(s.separator=e.SEP),r.has(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),o.definition.push(s),this.recordingProdStack.pop(),l}function T(t){return 0===t?"":""+t}function y(t){if(t<0||t>p){var e=new Error("Invalid DSL Method idx value: <"+t+">\n\tIdx value must be a none negative value smaller than "+(p+1));throw e.KNOWN_RECORDER_ERROR=!0,e}}e.GastRecorder=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(2),o=function(){function t(){}return t.prototype.initPerformanceTracer=function(t){if(r.has(t,"traceInitPerf")){var e=t.traceInitPerf,n="number"==typeof e;this.traceInitMaxIdent=n?e:1/0,this.traceInitPerf=n?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=i.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent");var i=r.timer(e),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,a}return e()},t}();e.PerformanceTracer=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);e.createSyntaxDiagramsCode=function(t,e){var n=void 0===e?{}:e,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r.VERSION+"/diagrams/":i,a=n.css;return"\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n\n\n\n