@danielblomma/cortex-mcp 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -14
- package/package.json +2 -2
- package/scaffold/mcp/package-lock.json +3 -7
- package/scaffold/mcp/package.json +1 -1
- package/scaffold/scripts/dashboard.mjs +15 -1
- package/scaffold/scripts/ingest.mjs +323 -50
- package/scaffold/scripts/parsers/bash-treesitter.mjs +229 -0
- package/scaffold/scripts/parsers/cpp-dispatch.mjs +56 -0
- package/scaffold/scripts/parsers/cpp-treesitter.mjs +333 -0
- package/scaffold/scripts/parsers/csharp.mjs +197 -10
- package/scaffold/scripts/parsers/dotnet/CSharpParser/CSharpParser.csproj +1 -0
- package/scaffold/scripts/parsers/dotnet/CSharpParser/Program.cs +126 -21
- package/scaffold/scripts/parsers/go-treesitter.mjs +283 -0
- package/scaffold/scripts/parsers/java-treesitter.mjs +250 -0
- package/scaffold/scripts/parsers/javascript/ast.mjs +118 -12
- package/scaffold/scripts/parsers/javascript/chunks.mjs +4 -0
- package/scaffold/scripts/parsers/javascript/patterns.mjs +6 -0
- package/scaffold/scripts/parsers/javascript.mjs +4 -19
- package/scaffold/scripts/parsers/node_modules/.package-lock.json +57 -0
- package/scaffold/scripts/parsers/node_modules/acorn/CHANGELOG.md +972 -0
- package/scaffold/scripts/parsers/node_modules/acorn/LICENSE +21 -0
- package/scaffold/scripts/parsers/node_modules/acorn/README.md +301 -0
- package/scaffold/scripts/parsers/node_modules/acorn/bin/acorn +4 -0
- package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.d.mts +883 -0
- package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.d.ts +883 -0
- package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.js +6295 -0
- package/scaffold/scripts/parsers/node_modules/acorn/dist/acorn.mjs +6266 -0
- package/scaffold/scripts/parsers/node_modules/acorn/dist/bin.js +90 -0
- package/scaffold/scripts/parsers/node_modules/acorn/package.json +50 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/CHANGELOG.md +421 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/LICENSE +21 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/README.md +81 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.d.ts +103 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.js +78 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/error.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.d.ts +167 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.js +75 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/decorators.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.d.ts +177 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.js +56 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/import-assertions.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.d.ts +198 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.js +327 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/index.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.d.ts +256 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.js +256 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/extentions/jsx/xhtml.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.d.ts +472 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.js +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/index.mjs +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.d.ts +159 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.js +2 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/middleware.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.d.ts +10 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.js +38 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/parseutil.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.d.ts +12 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.js +29 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/scopeflags.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.d.ts +2 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.js +118 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/tokenType.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.d.ts +60 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.js +2 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/types.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.d.ts +2 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.js +19 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/lib/whitespace.js.map +1 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/package.json +53 -0
- package/scaffold/scripts/parsers/node_modules/acorn-typescript/tsconfig.json +19 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/CHANGELOG.md +209 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/LICENSE +21 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/README.md +124 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.d.mts +152 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.d.ts +152 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.js +485 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/dist/walk.mjs +467 -0
- package/scaffold/scripts/parsers/node_modules/acorn-walk/package.json +50 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/README.md +23 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/scaffold/scripts/parsers/node_modules/tree-sitter-wasms/package.json +64 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/LICENSE +21 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/README.md +198 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/package.json +37 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter-web.d.ts +242 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter.js +1 -0
- package/scaffold/scripts/parsers/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/scaffold/scripts/parsers/package-lock.json +19 -1
- package/scaffold/scripts/parsers/package.json +3 -1
- package/scaffold/scripts/parsers/python-treesitter.mjs +271 -0
- package/scaffold/scripts/parsers/ruby-treesitter.mjs +271 -0
- package/scaffold/scripts/parsers/rust-dispatch.mjs +43 -0
- package/scaffold/scripts/parsers/rust-treesitter.mjs +291 -0
- package/scaffold/scripts/parsers/tree-sitter/base.mjs +163 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/bash.calls.scm +7 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/bash.chunks.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/bash.imports.scm +5 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/cpp.calls.scm +17 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/cpp.chunks.scm +30 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/cpp.imports.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/go.calls.scm +11 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/go.chunks.scm +19 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/go.imports.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/java.calls.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/java.chunks.scm +23 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/java.imports.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/python.calls.scm +11 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/python.chunks.scm +11 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/python.imports.scm +13 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/ruby.calls.scm +6 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/ruby.chunks.scm +16 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/ruby.imports.scm +8 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/rust.calls.scm +31 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/rust.chunks.scm +29 -0
- package/scaffold/scripts/parsers/tree-sitter/queries/rust.imports.scm +5 -0
- package/scaffold/scripts/parsers/vb6.mjs +395 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=require("acorn");function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}}),e.default=t,e}var s=/*#__PURE__*/e(t);function i(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,"symbol"==typeof(r=function(t,e){if("object"!=typeof t||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key))?r:String(r),i)}var r}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t},r.apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}function h(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=function(t,e){if(t){if("string"==typeof t)return o(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=!0;function c(e,s){return void 0===s&&(s={}),new t.TokenType("name",s)}var l=new WeakMap,u=1024,d=new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*","y"),m=new RegExp("(?=("+d.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),y=function(){this.shorthandAssign=void 0,this.trailingComma=void 0,this.parenthesizedAssign=void 0,this.parenthesizedBind=void 0,this.doubleProto=void 0,this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};function f(t,e){var s=e.key.name,i=t[s],r="true";return"MethodDefinition"!==e.type||"get"!==e.kind&&"set"!==e.kind||(r=(e.static?"s":"i")+e.kind),"iget"===i&&"iset"===r||"iset"===i&&"iget"===r||"sget"===i&&"sset"===r||"sset"===i&&"sget"===r?(t[s]="true",!1):!!i||(t[s]=r,!1)}function x(t,e){var s=t.key;return!t.computed&&("Identifier"===s.type&&s.name===e||"Literal"===s.type&&s.value===e)}var T={AbstractMethodHasImplementation:function(t){return"Method '"+t.methodName+"' cannot have an implementation because it is marked abstract."},AbstractPropertyHasInitializer:function(t){return"Property '"+t.propertyName+"' cannot have an initializer because it is marked abstract."},AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:function(t){return"Cannot find name '"+t.name+"'."},ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:function(t){return"'declare' is not allowed in "+t.kind+"ters."},DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:function(){return"Accessibility modifier already seen."},DuplicateModifier:function(t){return"Duplicate modifier: '"+t.modifier+"'."},EmptyHeritageClauseType:function(t){return"'"+t.token+"' list cannot be empty."},EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:function(t){var e=t.modifiers;return"'"+e[0]+"' modifier cannot be used with '"+e[1]+"' modifier."},IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:function(t){return"Index signatures cannot have an accessibility modifier ('"+t.modifier+"')."},IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:function(t){return"'"+t.modifier+"' modifier cannot appear on a type member."},InvalidModifierOnTypeParameter:function(t){return"'"+t.modifier+"' modifier cannot appear on a type parameter."},InvalidModifierOnTypeParameterPositions:function(t){return"'"+t.modifier+"' modifier can only appear on a type parameter of a class, interface or type alias."},InvalidModifiersOrder:function(t){var e=t.orderedModifiers;return"'"+e[0]+"' modifier must precede '"+e[1]+"' modifier."},InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:function(t){return"Private elements cannot have an accessibility modifier ('"+t.modifier+"')."},PrivateMethodsHasAccessibility:function(t){return"Private methods cannot have an accessibility modifier ('"+t.modifier+"')."},ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:function(t){var e=t.typeParameterName;return"Single type parameter "+e+" should have a trailing comma. Example usage: <"+e+",>."},StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:function(t){return"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got "+t.type+"."},LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},v={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},P=/^[\da-fA-F]+$/,b=/^\d+$/;function g(t){return t?"JSXIdentifier"===t.type?t.name:"JSXNamespacedName"===t.type?t.namespace.name+":"+t.name.name:"JSXMemberExpression"===t.type?g(t.object)+"."+g(t.property):void 0:t}var A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function S(t){if(!t)throw new Error("Assert fail")}function k(t){return"accessor"===t}function C(t){return"in"===t||"out"===t}function E(t,e){return 2|(t?4:0)|(e?8:0)}function I(t){if("MemberExpression"!==t.type)return!1;var e=t.property;return(!t.computed||!("TemplateLiteral"!==e.type||e.expressions.length>0))&&N(t.object)}function N(t){return"Identifier"===t.type||"MemberExpression"===t.type&&!t.computed&&N(t.object)}function w(t){return"private"===t||"public"===t||"protected"===t}function L(e){var n=e||{},o=n.dts,d=void 0!==o&&o,N=n.allowSatisfies,L=void 0!==N&&N;return function(n){var o=n.acorn||s,N=function(e){var s=l.get(e.Parser.acorn||e);if(!s){var i={assert:c(0,{startsExpr:p}),asserts:c(0,{startsExpr:p}),global:c(0,{startsExpr:p}),keyof:c(0,{startsExpr:p}),readonly:c(0,{startsExpr:p}),unique:c(0,{startsExpr:p}),abstract:c(0,{startsExpr:p}),declare:c(0,{startsExpr:p}),enum:c(0,{startsExpr:p}),module:c(0,{startsExpr:p}),namespace:c(0,{startsExpr:p}),interface:c(0,{startsExpr:p}),type:c(0,{startsExpr:p})},a={at:new t.TokenType("@"),jsxName:new t.TokenType("jsxName"),jsxText:new t.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new t.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new t.TokenType("jsxTagEnd")},n={tc_oTag:new t.TokContext("<tag",!1,!1),tc_cTag:new t.TokContext("</tag",!1,!1),tc_expr:new t.TokContext("<tag>...</tag>",!0,!0)},o=new RegExp("^(?:"+Object.keys(i).join("|")+")$");a.jsxTagStart.updateContext=function(){this.context.push(n.tc_expr),this.context.push(n.tc_oTag),this.exprAllowed=!1},a.jsxTagEnd.updateContext=function(e){var s=this.context.pop();s===n.tc_oTag&&e===t.tokTypes.slash||s===n.tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===n.tc_expr):this.exprAllowed=!0},s={tokTypes:r({},i,a),tokContexts:r({},n),keywordsRegExp:o,tokenIsLiteralPropertyName:function(e){return[t.tokTypes.name,t.tokTypes.string,t.tokTypes.num].concat(Object.values(t.keywordTypes),Object.values(i)).includes(e)},tokenIsKeywordOrIdentifier:function(e){return[t.tokTypes.name].concat(Object.values(t.keywordTypes),Object.values(i)).includes(e)},tokenIsIdentifier:function(e){return[].concat(Object.values(i),[t.tokTypes.name]).includes(e)},tokenIsTSDeclarationStart:function(t){return[i.abstract,i.declare,i.enum,i.module,i.namespace,i.interface,i.type].includes(t)},tokenIsTSTypeOperator:function(t){return[i.keyof,i.readonly,i.unique].includes(t)},tokenIsTemplate:function(e){return e===t.tokTypes.invalidTemplate}}}return s}(o),M=o.tokTypes,O=o.keywordTypes,D=o.isIdentifierStart,_=o.lineBreak,R=o.isNewLine,j=o.tokContexts,F=o.isIdentifierChar,B=N.tokTypes,H=N.tokContexts,q=N.keywordsRegExp,U=N.tokenIsLiteralPropertyName,V=N.tokenIsTemplate,K=N.tokenIsTSDeclarationStart,z=N.tokenIsIdentifier,J=N.tokenIsKeywordOrIdentifier,X=N.tokenIsTSTypeOperator;function W(t,e,s){void 0===s&&(s=t.length);for(var i=e;i<s;i++){var r=t.charCodeAt(i);if(R(r))return i<s-1&&13===r&&10===t.charCodeAt(i+1)?i+2:i+1}return-1}n=function(t,e,s){var i=s.tokTypes,r=e.tokTypes;/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var s=e.prototype;return s.takeDecorators=function(t){var e=this.decoratorStack[this.decoratorStack.length-1];e.length&&(t.decorators=e,this.resetStartLocationFromNode(t,e[0]),this.decoratorStack[this.decoratorStack.length-1]=[])},s.parseDecorators=function(t){for(var e=this.decoratorStack[this.decoratorStack.length-1];this.match(r.at);){var s=this.parseDecorator();e.push(s)}this.match(i._export)?t||this.unexpected():this.canHaveLeadingDecorator()||this.raise(this.start,"Leading decorators must be attached to a class declaration.")},s.parseDecorator=function(){var t=this.startNode();this.next(),this.decoratorStack.push([]);var e,s=this.start,r=this.startLoc;if(this.match(i.parenL)){var a=this.start,n=this.startLoc;if(this.next(),e=this.parseExpression(),this.expect(i.parenR),this.options.preserveParens){var o=this.startNodeAt(a,n);o.expression=e,e=this.finishNode(o,"ParenthesizedExpression")}}else for(e=this.parseIdent(!1);this.eat(i.dot);){var h=this.startNodeAt(s,r);h.object=e,h.property=this.parseIdent(!0),h.computed=!1,e=this.finishNode(h,"MemberExpression")}return t.expression=this.parseMaybeDecoratorArguments(e),this.decoratorStack.pop(),this.finishNode(t,"Decorator")},s.parseMaybeDecoratorArguments=function(t){if(this.eat(i.parenL)){var e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseExprList(i.parenR,!1),this.finishNode(e,"CallExpression")}return t},e}(t)}(n,N,o),n=function(t,e,s,i){var r=t.tokTypes,n=e.tokTypes,o=t.isNewLine,h=t.isIdentifierChar,p=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},i||{});/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var s=e.prototype;return s.jsx_readToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");var s=this.input.charCodeAt(this.pos);switch(s){case 60:case 123:return this.pos===this.start?60===s&&this.exprAllowed?(++this.pos,this.finishToken(n.jsxTagStart)):this.getTokenFromCode(s):(t+=this.input.slice(e,this.pos),this.finishToken(n.jsxText,t));case 38:t+=this.input.slice(e,this.pos),t+=this.jsx_readEntity(),e=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===s?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:o(s)?(t+=this.input.slice(e,this.pos),t+=this.jsx_readNewLine(!0),e=this.pos):++this.pos}}},s.jsx_readNewLine=function(t){var e,s=this.input.charCodeAt(this.pos);return++this.pos,13===s&&10===this.input.charCodeAt(this.pos)?(++this.pos,e=t?"\n":"\r\n"):e=String.fromCharCode(s),this.options.locations&&(++this.curLine,this.lineStart=this.pos),e},s.jsx_readString=function(t){for(var e="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===t)break;38===i?(e+=this.input.slice(s,this.pos),e+=this.jsx_readEntity(),s=this.pos):o(i)?(e+=this.input.slice(s,this.pos),e+=this.jsx_readNewLine(!1),s=this.pos):++this.pos}return e+=this.input.slice(s,this.pos++),this.finishToken(r.string,e)},s.jsx_readEntity=function(){var t,e="",s=0,i=this.input[this.pos];"&"!==i&&this.raise(this.pos,"Entity must start with an ampersand");for(var r=++this.pos;this.pos<this.input.length&&s++<10;){if(";"===(i=this.input[this.pos++])){"#"===e[0]?"x"===e[1]?(e=e.substr(2),P.test(e)&&(t=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),b.test(e)&&(t=String.fromCharCode(parseInt(e,10)))):t=v[e];break}e+=i}return t||(this.pos=r,"&")},s.jsx_readWord=function(){var t,e=this.pos;do{t=this.input.charCodeAt(++this.pos)}while(h(t)||45===t);return this.finishToken(n.jsxName,this.input.slice(e,this.pos))},s.jsx_parseIdentifier=function(){var t=this.startNode();return this.type===n.jsxName?t.name=this.value:this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"JSXIdentifier")},s.jsx_parseNamespacedName=function(){var t=this.start,e=this.startLoc,s=this.jsx_parseIdentifier();if(!p.allowNamespaces||!this.eat(r.colon))return s;var i=this.startNodeAt(t,e);return i.namespace=s,i.name=this.jsx_parseIdentifier(),this.finishNode(i,"JSXNamespacedName")},s.jsx_parseElementName=function(){if(this.type===n.jsxTagEnd)return"";var t=this.start,e=this.startLoc,s=this.jsx_parseNamespacedName();for(this.type!==r.dot||"JSXNamespacedName"!==s.type||p.allowNamespacedObjects||this.unexpected();this.eat(r.dot);){var i=this.startNodeAt(t,e);i.object=s,i.property=this.jsx_parseIdentifier(),s=this.finishNode(i,"JSXMemberExpression")}return s},s.jsx_parseAttributeValue=function(){switch(this.type){case r.braceL:var t=this.jsx_parseExpressionContainer();return"JSXEmptyExpression"===t.expression.type&&this.raise(t.start,"JSX attributes must only be assigned a non-empty expression"),t;case n.jsxTagStart:case r.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}},s.jsx_parseEmptyExpression=function(){var t=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(t,"JSXEmptyExpression",this.start,this.startLoc)},s.jsx_parseExpressionContainer=function(){var t=this.startNode();return this.next(),t.expression=this.type===r.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(r.braceR),this.finishNode(t,"JSXExpressionContainer")},s.jsx_parseAttribute=function(){var t=this.startNode();return this.eat(r.braceL)?(this.expect(r.ellipsis),t.argument=this.parseMaybeAssign(),this.expect(r.braceR),this.finishNode(t,"JSXSpreadAttribute")):(t.name=this.jsx_parseNamespacedName(),t.value=this.eat(r.eq)?this.jsx_parseAttributeValue():null,this.finishNode(t,"JSXAttribute"))},s.jsx_parseOpeningElementAt=function(t,e){var s=this.startNodeAt(t,e);s.attributes=[];var i=this.jsx_parseElementName();for(i&&(s.name=i);this.type!==r.slash&&this.type!==n.jsxTagEnd;)s.attributes.push(this.jsx_parseAttribute());return s.selfClosing=this.eat(r.slash),this.expect(n.jsxTagEnd),this.finishNode(s,i?"JSXOpeningElement":"JSXOpeningFragment")},s.jsx_parseClosingElementAt=function(t,e){var s=this.startNodeAt(t,e),i=this.jsx_parseElementName();return i&&(s.name=i),this.expect(n.jsxTagEnd),this.finishNode(s,i?"JSXClosingElement":"JSXClosingFragment")},s.jsx_parseElementAt=function(t,e){var s=this.startNodeAt(t,e),i=[],a=this.jsx_parseOpeningElementAt(t,e),o=null;if(!a.selfClosing){t:for(;;)switch(this.type){case n.jsxTagStart:if(t=this.start,e=this.startLoc,this.next(),this.eat(r.slash)){o=this.jsx_parseClosingElementAt(t,e);break t}i.push(this.jsx_parseElementAt(t,e));break;case n.jsxText:i.push(this.parseExprAtom());break;case r.braceL:i.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}g(o.name)!==g(a.name)&&this.raise(o.start,"Expected corresponding JSX closing tag for <"+g(a.name)+">")}var h=a.name?"Element":"Fragment";return s["opening"+h]=a,s["closing"+h]=o,s.children=i,this.type===r.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(s,"JSX"+h)},s.jsx_parseText=function(){var t=this.parseLiteral(this.value);return t.type="JSXText",t},s.jsx_parseElement=function(){var t=this.start,e=this.startLoc;return this.next(),this.jsx_parseElementAt(t,e)},e}(s)}(o,N,n,null==e?void 0:e.jsx),n=function(t,e,s){var i=e.tokTypes,r=s.tokTypes;/*#__PURE__*/return function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var s=e.prototype;return s.parseMaybeImportAttributes=function(t){if(this.type===r._with||this.type===i.assert){this.next();var e=this.parseImportAttributes();e&&(t.attributes=e)}},s.parseImportAttributes=function(){this.expect(r.braceL);var t=this.parseWithEntries();return this.expect(r.braceR),t},s.parseWithEntries=function(){var t=[],e=new Set;do{if(this.type===r.braceR)break;var s,i=this.startNode();s=this.type===r.string?this.parseLiteral(this.value):this.parseIdent(!0),this.next(),i.key=s,e.has(i.key.name)&&this.raise(this.pos,"Duplicated key in attributes"),e.add(i.key.name),this.type!==r.string&&this.raise(this.pos,"Only string is supported as an attribute value"),i.value=this.parseLiteral(this.value),t.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(r.comma));return t},e}(t)}(n,N,o);var Y=/*#__PURE__*/function(t){function e(e,s,i){var r;return(r=t.call(this,e,s,i)||this).preValue=null,r.preToken=null,r.isLookahead=!1,r.isAmbientContext=!1,r.inAbstractClass=!1,r.inType=!1,r.inDisallowConditionalTypesContext=!1,r.maybeInArrowParameters=!1,r.shouldParseArrowReturnType=void 0,r.shouldParseAsyncArrowReturnType=void 0,r.decoratorStack=[[]],r.importsStack=[[]],r.importOrExportOuterKind=void 0,r.tsParseConstModifier=r.tsParseModifiers.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r),{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:T.InvalidModifierOnTypeParameterPositions}),r}a(e,t);var s,r,n,p=e.prototype;return p.getTokenFromCodeInType=function(e){return 62===e||60===e?this.finishOp(M.relational,1):t.prototype.getTokenFromCode.call(this,e)},p.readToken=function(e){if(!this.inType){var s=this.curContext();if(s===H.tc_expr)return this.jsx_readToken();if(s===H.tc_oTag||s===H.tc_cTag){if(D(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(B.jsxTagEnd);if((34===e||39===e)&&s==H.tc_oTag)return this.jsx_readString(e)}if(60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1))return++this.pos,this.finishToken(B.jsxTagStart)}return t.prototype.readToken.call(this,e)},p.getTokenFromCode=function(e){return this.inType?this.getTokenFromCodeInType(e):64===e?(++this.pos,this.finishToken(B.at)):t.prototype.getTokenFromCode.call(this,e)},p.isAbstractClass=function(){return this.ts_isContextual(B.abstract)&&this.lookahead().type===M._class},p.finishNode=function(e,s){return""!==e.type&&0!==e.end?e:t.prototype.finishNode.call(this,e,s)},p.tryParse=function(t,e){void 0===e&&(e=this.cloneCurLookaheadState());var s={node:null};try{return{node:t(function(t){throw void 0===t&&(t=null),s.node=t,s}),error:null,thrown:!1,aborted:!1,failState:null}}catch(t){var i=this.getCurLookaheadState();if(this.setLookaheadState(e),t instanceof SyntaxError)return{node:null,error:t,thrown:!0,aborted:!1,failState:i};if(t===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw t}},p.setOptionalParametersError=function(t,e){var s;t.optionalParametersLoc=null!=(s=null==e?void 0:e.loc)?s:this.startLoc},p.reScan_lt_gt=function(){this.type===M.relational&&(this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos()))},p.reScan_lt=function(){var t=this.type;return t===M.bitShift?(this.pos-=2,this.finishOp(M.relational,1),M.relational):t},p.resetEndLocation=function(t,e){void 0===e&&(e=this.lastTokEndLoc),t.end=e.column,t.loc.end=e,this.options.ranges&&(t.range[1]=e.column)},p.startNodeAtNode=function(e){return t.prototype.startNodeAt.call(this,e.start,e.loc.start)},p.nextTokenStart=function(){return this.nextTokenStartSince(this.pos)},p.tsHasSomeModifiers=function(t,e){return e.some(function(e){return w(e)?t.accessibility===e:!!t[e]})},p.tsIsStartOfStaticBlocks=function(){return this.isContextual("static")&&123===this.lookaheadCharCode()},p.tsCheckForInvalidTypeCasts=function(t){var e=this;t.forEach(function(t){"TSTypeCastExpression"===(null==t?void 0:t.type)&&e.raise(t.typeAnnotation.start,T.UnexpectedTypeAnnotation)})},p.atPossibleAsyncArrow=function(t){return"Identifier"===t.type&&"async"===t.name&&this.lastTokEndLoc.column===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&t.start===this.potentialArrowAt},p.tsIsIdentifier=function(){return z(this.type)},p.tsTryParseTypeOrTypePredicateAnnotation=function(){return this.match(M.colon)?this.tsParseTypeOrTypePredicateAnnotation(M.colon):void 0},p.tsTryParseGenericAsyncArrowFunction=function(e,s,i){var r=this;if(this.tsMatchLeftRelational()){var a=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var n=this.tsTryParseAndCatch(function(){var i=r.startNodeAt(e,s);return i.typeParameters=r.tsParseTypeParameters(),t.prototype.parseFunctionParams.call(r,i),i.returnType=r.tsTryParseTypeOrTypePredicateAnnotation(),r.expect(M.arrow),i});if(this.maybeInArrowParameters=a,n)return t.prototype.parseArrowExpression.call(this,n,null,!0,i)}},p.tsParseTypeArgumentsInExpression=function(){if(this.reScan_lt()===M.relational)return this.tsParseTypeArguments()},p.tsInNoContext=function(t){var e=this.context;this.context=[e[0]];try{return t()}finally{this.context=e}},p.tsTryParseTypeAnnotation=function(){return this.match(M.colon)?this.tsParseTypeAnnotation():void 0},p.isUnparsedContextual=function(t,e){var s=t+e.length;if(this.input.slice(t,s)===e){var i=this.input.charCodeAt(s);return!(F(i)||55296==(64512&i))}return!1},p.isAbstractConstructorSignature=function(){return this.ts_isContextual(B.abstract)&&this.lookahead().type===M._new},p.nextTokenStartSince=function(t){return A.lastIndex=t,A.test(this.input)?A.lastIndex:t},p.lookaheadCharCode=function(){return this.input.charCodeAt(this.nextTokenStart())},p.compareLookaheadState=function(t,e){for(var s=0,i=Object.keys(t);s<i.length;s++){var r=i[s];if(t[r]!==e[r])return!1}return!0},p.createLookaheadState=function(){this.value=null,this.context=[this.curContext()]},p.getCurLookaheadState=function(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}},p.cloneCurLookaheadState=function(){return{pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context&&this.context.slice(),startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}},p.setLookaheadState=function(t){this.pos=t.pos,this.value=t.value,this.endLoc=t.endLoc,this.lastTokEnd=t.lastTokEnd,this.lastTokStart=t.lastTokStart,this.lastTokStartLoc=t.lastTokStartLoc,this.type=t.type,this.start=t.start,this.end=t.end,this.context=t.context,this.startLoc=t.startLoc,this.lastTokEndLoc=t.lastTokEndLoc,this.curLine=t.curLine,this.lineStart=t.lineStart,this.curPosition=t.curPosition,this.containsEsc=t.containsEsc},p.tsLookAhead=function(t){var e=this.getCurLookaheadState(),s=t();return this.setLookaheadState(e),s},p.lookahead=function(t){var e=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,void 0!==t)for(var s=0;s<t;s++)this.nextToken();else this.nextToken();this.isLookahead=!1;var i=this.getCurLookaheadState();return this.setLookaheadState(e),i},p.readWord=function(){var t=this.readWord1(),e=M.name;return this.keywords.test(t)?e=O[t]:new RegExp(q).test(t)&&(e=B[t]),this.finishToken(e,t)},p.skipBlockComment=function(){var t;this.isLookahead||(t=this.options.onComment&&this.curPosition());var e=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(var i,r=e;(i=W(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=i;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,s),e,this.pos,t,this.curPosition())},p.skipLineComment=function(t){var e,s=this.pos;this.isLookahead||(e=this.options.onComment&&this.curPosition());for(var i=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!R(i);)i=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(s+t,this.pos),s,this.pos,e,this.curPosition())},p.finishToken=function(t,e){this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=t,this.value=e,this.isLookahead||this.updateContext(s)},p.resetStartLocation=function(t,e,s){t.start=e,t.loc.start=s,this.options.ranges&&(t.range[0]=e)},p.isLineTerminator=function(){return this.eat(M.semi)||t.prototype.canInsertSemicolon.call(this)},p.hasFollowingLineBreak=function(){return m.lastIndex=this.end,m.test(this.input)},p.addExtra=function(t,e,s,i){if(void 0===i&&(i=!0),t){var r=t.extra=t.extra||{};i?r[e]=s:Object.defineProperty(r,e,{enumerable:i,value:s})}},p.isLiteralPropertyName=function(){return U(this.type)},p.hasPrecedingLineBreak=function(){return _.test(this.input.slice(this.lastTokEndLoc.index,this.start))},p.createIdentifier=function(t,e){return t.name=e,this.finishNode(t,"Identifier")},p.resetStartLocationFromNode=function(t,e){this.resetStartLocation(t,e.start,e.loc.start)},p.isThisParam=function(t){return"Identifier"===t.type&&"this"===t.name},p.isLookaheadContextual=function(t){var e=this.nextTokenStart();return this.isUnparsedContextual(e,t)},p.ts_type_isContextual=function(t,e){return t===e&&!this.containsEsc},p.ts_isContextual=function(t){return this.type===t&&!this.containsEsc},p.ts_isContextualWithState=function(t,e){return t.type===e&&!t.containsEsc},p.isContextualWithState=function(t,e){return e.type===M.name&&e.value===t&&!e.containsEsc},p.tsIsStartOfMappedType=function(){return this.next(),this.eat(M.plusMin)?this.ts_isContextual(B.readonly):(this.ts_isContextual(B.readonly)&&this.next(),!!this.match(M.bracketL)&&(this.next(),!!this.tsIsIdentifier()&&(this.next(),this.match(M._in))))},p.tsInDisallowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},p.tsTryParseType=function(){return this.tsEatThenParseType(M.colon)},p.match=function(t){return this.type===t},p.matchJsx=function(t){return this.type===N.tokTypes[t]},p.ts_eatWithState=function(t,e,s){if(t===s.type){for(var i=0;i<e;i++)this.next();return!0}return!1},p.ts_eatContextualWithState=function(t,e,s){if(q.test(t)){if(this.ts_isContextualWithState(s,B[t])){for(var i=0;i<e;i++)this.next();return!0}return!1}if(!this.isContextualWithState(t,s))return!1;for(var r=0;r<e;r++)this.next();return!0},p.canHaveLeadingDecorator=function(){return this.match(M._class)},p.eatContextual=function(e){return q.test(e)?!!this.ts_isContextual(B[e])&&(this.next(),!0):t.prototype.eatContextual.call(this,e)},p.tsIsExternalModuleReference=function(){return this.isContextual("require")&&40===this.lookaheadCharCode()},p.tsParseExternalModuleReference=function(){var t=this.startNode();return this.expectContextual("require"),this.expect(M.parenL),this.match(M.string)||this.unexpected(),t.expression=this.parseExprAtom(),this.expect(M.parenR),this.finishNode(t,"TSExternalModuleReference")},p.tsParseEntityName=function(t){void 0===t&&(t=!0);for(var e=this.parseIdent(t);this.eat(M.dot);){var s=this.startNodeAtNode(e);s.left=e,s.right=this.parseIdent(t),e=this.finishNode(s,"TSQualifiedName")}return e},p.tsParseEnumMember=function(){var t=this.startNode();return t.id=this.match(M.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(M.eq)&&(t.initializer=this.parseMaybeAssign()),this.finishNode(t,"TSEnumMember")},p.tsParseEnumDeclaration=function(t,e){return void 0===e&&(e={}),e.const&&(t.const=!0),e.declare&&(t.declare=!0),this.expectContextual("enum"),t.id=this.parseIdent(),this.checkLValSimple(t.id),this.expect(M.braceL),t.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(M.braceR),this.finishNode(t,"TSEnumDeclaration")},p.tsParseModuleBlock=function(){var e=this.startNode();for(t.prototype.enterScope.call(this,512),this.expect(M.braceL),e.body=[];this.type!==M.braceR;){var s=this.parseStatement(null,!0);e.body.push(s)}return this.next(),t.prototype.exitScope.call(this),this.finishNode(e,"TSModuleBlock")},p.tsParseAmbientExternalModuleDeclaration=function(e){return this.ts_isContextual(B.global)?(e.global=!0,e.id=this.parseIdent()):this.match(M.string)?e.id=this.parseLiteral(this.value):this.unexpected(),this.match(M.braceL)?(t.prototype.enterScope.call(this,u),e.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this)):t.prototype.semicolon.call(this),this.finishNode(e,"TSModuleDeclaration")},p.tsTryParseDeclare=function(t){var e=this;if(!this.isLineTerminator()){var s,i=this.type;return this.isContextual("let")&&(i=M._var,s="let"),this.tsInAmbientContext(function(){if(i===M._function)return t.declare=!0,e.parseFunctionStatement(t,!1,!0);if(i===M._class)return t.declare=!0,e.parseClass(t,!0);if(i===B.enum)return e.tsParseEnumDeclaration(t,{declare:!0});if(i===B.global)return e.tsParseAmbientExternalModuleDeclaration(t);if(i===M._const||i===M._var)return e.match(M._const)&&e.isLookaheadContextual("enum")?(e.expect(M._const),e.tsParseEnumDeclaration(t,{const:!0,declare:!0})):(t.declare=!0,e.parseVarStatement(t,s||e.value,!0));if(i===B.interface){var r=e.tsParseInterfaceDeclaration(t,{declare:!0});if(r)return r}return z(i)?e.tsParseDeclaration(t,e.value,!0):void 0})}},p.tsIsListTerminator=function(t){switch(t){case"EnumMembers":case"TypeMembers":return this.match(M.braceR);case"HeritageClauseElement":return this.match(M.braceL);case"TupleElementTypes":return this.match(M.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}},p.tsParseDelimitedListWorker=function(t,e,s,i){for(var r=[],a=-1;!this.tsIsListTerminator(t);){a=-1;var n=e();if(null==n)return;if(r.push(n),!this.eat(M.comma)){if(this.tsIsListTerminator(t))break;return void(s&&this.expect(M.comma))}a=this.lastTokStart}return i&&(i.value=a),r},p.tsParseDelimitedList=function(t,e,s){return function(t){if(null==t)throw new Error("Unexpected "+t+" value.");return t}(this.tsParseDelimitedListWorker(t,e,!0,s))},p.tsParseBracketedList=function(t,e,s,i,r){i||this.expect(s?M.bracketL:M.relational);var a=this.tsParseDelimitedList(t,e,r);return this.expect(s?M.bracketR:M.relational),a},p.tsParseTypeParameterName=function(){return this.parseIdent().name},p.tsEatThenParseType=function(t){return this.match(t)?this.tsNextThenParseType():void 0},p.tsExpectThenParseType=function(t){var e=this;return this.tsDoThenParseType(function(){return e.expect(t)})},p.tsNextThenParseType=function(){var t=this;return this.tsDoThenParseType(function(){return t.next()})},p.tsDoThenParseType=function(t){var e=this;return this.tsInType(function(){return t(),e.tsParseType()})},p.tsSkipParameterStart=function(){if(z(this.type)||this.match(M._this))return this.next(),!0;if(this.match(M.braceL))try{return this.parseObj(!0),!0}catch(t){return!1}if(this.match(M.bracketL)){this.next();try{return this.parseBindingList(M.bracketR,!0,!0),!0}catch(t){return!1}}return!1},p.tsIsUnambiguouslyStartOfFunctionType=function(){if(this.next(),this.match(M.parenR)||this.match(M.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(M.colon)||this.match(M.comma)||this.match(M.question)||this.match(M.eq))return!0;if(this.match(M.parenR)&&(this.next(),this.match(M.arrow)))return!0}return!1},p.tsIsStartOfFunctionType=function(){return!!this.tsMatchLeftRelational()||this.match(M.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))},p.tsInAllowConditionalTypesContext=function(t){var e=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return t()}finally{this.inDisallowConditionalTypesContext=e}},p.tsParseBindingListForSignature=function(){var e=this;return t.prototype.parseBindingList.call(this,M.parenR,!0,!0).map(function(t){return"Identifier"!==t.type&&"RestElement"!==t.type&&"ObjectPattern"!==t.type&&"ArrayPattern"!==t.type&&e.raise(t.start,T.UnsupportedSignatureParameterKind(t.type)),t})},p.tsParseTypePredicateAsserts=function(){if(this.type!==B.asserts)return!1;var t=this.containsEsc;return this.next(),!(!z(this.type)&&!this.match(M._this)||(t&&this.raise(this.lastTokStart,"Escape sequence in keyword asserts"),0))},p.tsParseThisTypeNode=function(){var t=this.startNode();return this.next(),this.finishNode(t,"TSThisType")},p.tsParseTypeAnnotation=function(t,e){var s=this;return void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),this.tsInType(function(){t&&s.expect(M.colon),e.typeAnnotation=s.tsParseType()}),this.finishNode(e,"TSTypeAnnotation")},p.tsParseThisTypePredicate=function(t){this.next();var e=this.startNodeAtNode(t);return e.parameterName=t,e.typeAnnotation=this.tsParseTypeAnnotation(!1),e.asserts=!1,this.finishNode(e,"TSTypePredicate")},p.tsParseThisTypeOrThisTypePredicate=function(){var t=this.tsParseThisTypeNode();return this.isContextual("is")&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(t):t},p.tsParseTypePredicatePrefix=function(){var t=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),t},p.tsParseTypeOrTypePredicateAnnotation=function(t){var e=this;return this.tsInType(function(){var s=e.startNode();e.expect(t);var i=e.startNode(),r=!!e.tsTryParse(e.tsParseTypePredicateAsserts.bind(e));if(r&&e.match(M._this)){var a=e.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===a.type?(i.parameterName=a,i.asserts=!0,i.typeAnnotation=null,a=e.finishNode(i,"TSTypePredicate")):(e.resetStartLocationFromNode(a,i),a.asserts=!0),s.typeAnnotation=a,e.finishNode(s,"TSTypeAnnotation")}var n=e.tsIsIdentifier()&&e.tsTryParse(e.tsParseTypePredicatePrefix.bind(e));if(!n)return r?(i.parameterName=e.parseIdent(),i.asserts=r,i.typeAnnotation=null,s.typeAnnotation=e.finishNode(i,"TSTypePredicate"),e.finishNode(s,"TSTypeAnnotation")):e.tsParseTypeAnnotation(!1,s);var o=e.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=r,s.typeAnnotation=e.finishNode(i,"TSTypePredicate"),e.finishNode(s,"TSTypeAnnotation")})},p.tsFillSignature=function(t,e){var s=t===M.arrow;e.typeParameters=this.tsTryParseTypeParameters(),this.expect(M.parenL),e.parameters=this.tsParseBindingListForSignature(),(s||this.match(t))&&(e.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(t))},p.tsTryNextParseConstantContext=function(){if(this.lookahead().type!==M._const)return null;this.next();var t=this.tsParseTypeReference();return t.typeParameters&&this.raise(t.typeName.start,T.CannotFindName({name:"const"})),t},p.tsParseFunctionOrConstructorType=function(t,e){var s=this,i=this.startNode();return"TSConstructorType"===t&&(i.abstract=!!e,e&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(function(){return s.tsFillSignature(M.arrow,i)}),this.finishNode(i,t)},p.tsParseUnionOrIntersectionType=function(t,e,s){var i=this.startNode(),r=this.eat(s),a=[];do{a.push(e())}while(this.eat(s));return 1!==a.length||r?(i.types=a,this.finishNode(i,t)):a[0]},p.tsCheckTypeAnnotationForReadOnly=function(t){switch(t.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(t.start,T.UnexpectedReadonly)}},p.tsParseTypeOperator=function(){var t=this.startNode(),e=this.value;return this.next(),t.operator=e,t.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===e&&this.tsCheckTypeAnnotationForReadOnly(t),this.finishNode(t,"TSTypeOperator")},p.tsParseConstraintForInferType=function(){var t=this;if(this.eat(M._extends)){var e=this.tsInDisallowConditionalTypesContext(function(){return t.tsParseType()});if(this.inDisallowConditionalTypesContext||!this.match(M.question))return e}},p.tsParseInferType=function(){var t=this,e=this.startNode();this.expectContextual("infer");var s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(function(){return t.tsParseConstraintForInferType()}),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")},p.tsParseLiteralTypeNode=function(){var t=this,e=this.startNode();return e.literal=function(){switch(t.type){case M.num:case M.string:case M._true:case M._false:return t.parseExprAtom();default:t.unexpected()}}(),this.finishNode(e,"TSLiteralType")},p.tsParseImportType=function(){var t=this.startNode();return this.expect(M._import),this.expect(M.parenL),this.match(M.string)||this.raise(this.start,T.UnsupportedImportTypeArgument),t.argument=this.parseExprAtom(),this.expect(M.parenR),this.eat(M.dot)&&(t.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSImportType")},p.tsParseTypeQuery=function(){var t=this.startNode();return this.expect(M._typeof),t.exprName=this.match(M._import)?this.tsParseImportType():this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeQuery")},p.tsParseMappedTypeParameter=function(){var t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(M._in),this.finishNode(t,"TSTypeParameter")},p.tsParseMappedType=function(){var t=this.startNode();return this.expect(M.braceL),this.match(M.plusMin)?(t.readonly=this.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(t.readonly=!0),this.expect(M.bracketL),t.typeParameter=this.tsParseMappedTypeParameter(),t.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(M.bracketR),this.match(M.plusMin)?(t.optional=this.value,this.next(),this.expect(M.question)):this.eat(M.question)&&(t.optional=!0),t.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(M.braceR),this.finishNode(t,"TSMappedType")},p.tsParseTypeLiteral=function(){var t=this.startNode();return t.members=this.tsParseObjectTypeMembers(),this.finishNode(t,"TSTypeLiteral")},p.tsParseTupleElementType=function(){var t=this.startLoc,e=this.start,s=this.eat(M.ellipsis),i=this.tsParseType(),r=this.eat(M.question);if(this.eat(M.colon)){var a=this.startNodeAtNode(i);a.optional=r,"TSTypeReference"!==i.type||i.typeParameters||"Identifier"!==i.typeName.type?(this.raise(i.start,T.InvalidTupleMemberLabel),a.label=i):a.label=i.typeName,a.elementType=this.tsParseType(),i=this.finishNode(a,"TSNamedTupleMember")}else if(r){var n=this.startNodeAtNode(i);n.typeAnnotation=i,i=this.finishNode(n,"TSOptionalType")}if(s){var o=this.startNodeAt(e,t);o.typeAnnotation=i,i=this.finishNode(o,"TSRestType")}return i},p.tsParseTupleType=function(){var t=this,e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);var s=!1,i=null;return e.elementTypes.forEach(function(e){var r=e.type;!s||"TSRestType"===r||"TSOptionalType"===r||"TSNamedTupleMember"===r&&e.optional||t.raise(e.start,T.OptionalTypeBeforeRequired),s||(s="TSNamedTupleMember"===r&&e.optional||"TSOptionalType"===r);var a=r;"TSRestType"===r&&(a=(e=e.typeAnnotation).type);var n="TSNamedTupleMember"===a;null!=i||(i=n),i!==n&&t.raise(e.start,T.MixedLabeledAndUnlabeledElements)}),this.finishNode(e,"TSTupleType")},p.tsParseTemplateLiteralType=function(){var t=this.startNode();return t.literal=this.parseTemplate({isTagged:!1}),this.finishNode(t,"TSLiteralType")},p.tsParseTypeReference=function(){var t=this.startNode();return t.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(t.typeParameters=this.tsParseTypeArguments()),this.finishNode(t,"TSTypeReference")},p.tsMatchLeftRelational=function(){return this.match(M.relational)&&"<"===this.value},p.tsMatchRightRelational=function(){return this.match(M.relational)&&">"===this.value},p.tsParseParenthesizedType=function(){var t=this.startNode();return this.expect(M.parenL),t.typeAnnotation=this.tsParseType(),this.expect(M.parenR),this.finishNode(t,"TSParenthesizedType")},p.tsParseNonArrayType=function(){switch(this.type){case M.string:case M.num:case M._true:case M._false:return this.tsParseLiteralTypeNode();case M.plusMin:if("-"===this.value){var t=this.startNode();return this.lookahead().type!==M.num&&this.unexpected(),t.literal=this.parseMaybeUnary(),this.finishNode(t,"TSLiteralType")}break;case M._this:return this.tsParseThisTypeOrThisTypePredicate();case M._typeof:return this.tsParseTypeQuery();case M._import:return this.tsParseImportType();case M.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case M.bracketL:return this.tsParseTupleType();case M.parenL:return this.tsParseParenthesizedType();case M.backQuote:case M.dollarBraceL:return this.tsParseTemplateLiteralType();default:var e=this.type;if(z(e)||e===M._void||e===M._null){var s=e===M._void?"TSVoidKeyword":e===M._null?"TSNullKeyword":function(t){switch(t){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}(this.value);if(void 0!==s&&46!==this.lookaheadCharCode()){var i=this.startNode();return this.next(),this.finishNode(i,s)}return this.tsParseTypeReference()}}this.unexpected()},p.tsParseArrayTypeOrHigher=function(){for(var t=this.tsParseNonArrayType();!this.hasPrecedingLineBreak()&&this.eat(M.bracketL);)if(this.match(M.bracketR)){var e=this.startNodeAtNode(t);e.elementType=t,this.expect(M.bracketR),t=this.finishNode(e,"TSArrayType")}else{var s=this.startNodeAtNode(t);s.objectType=t,s.indexType=this.tsParseType(),this.expect(M.bracketR),t=this.finishNode(s,"TSIndexedAccessType")}return t},p.tsParseTypeOperatorOrHigher=function(){var t=this;return X(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(function(){return t.tsParseArrayTypeOrHigher()})},p.tsParseIntersectionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),M.bitwiseAND)},p.tsParseUnionTypeOrHigher=function(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),M.bitwiseOR)},p.tsParseNonConditionalType=function(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(M._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()},p.tsParseType=function(){var t=this;S(this.inType);var e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(M._extends))return e;var s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(function(){return t.tsParseNonConditionalType()}),this.expect(M.question),s.trueType=this.tsInAllowConditionalTypesContext(function(){return t.tsParseType()}),this.expect(M.colon),s.falseType=this.tsInAllowConditionalTypesContext(function(){return t.tsParseType()}),this.finishNode(s,"TSConditionalType")},p.tsIsUnambiguouslyIndexSignature=function(){return this.next(),!!z(this.type)&&(this.next(),this.match(M.colon))},p.tsInType=function(t){var e=this.inType;this.inType=!0;try{return t()}finally{this.inType=e}},p.tsTryParseIndexSignature=function(t){if(this.match(M.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))){this.expect(M.bracketL);var e=this.parseIdent();e.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(e),this.expect(M.bracketR),t.parameters=[e];var s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(t,"TSIndexSignature")}},p.tsParseNoneModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:T.InvalidModifierOnTypeParameterPositions})},p.tsParseTypeParameter=function(t){void 0===t&&(t=this.tsParseNoneModifiers.bind(this));var e=this.startNode();return t(e),e.name=this.tsParseTypeParameterName(),e.constraint=this.tsEatThenParseType(M._extends),e.default=this.tsEatThenParseType(M.eq),this.finishNode(e,"TSTypeParameter")},p.tsParseTypeParameters=function(t){var e=this.startNode();this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart")?this.next():this.unexpected();var s={value:-1};return e.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,t),!1,!0,s),0===e.params.length&&this.raise(this.start,T.EmptyTypeParameters),-1!==s.value&&this.addExtra(e,"trailingComma",s.value),this.finishNode(e,"TSTypeParameterDeclaration")},p.tsTryParseTypeParameters=function(t){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(t)},p.tsTryParse=function(t){var e=this.getCurLookaheadState(),s=t();return void 0!==s&&!1!==s?s:void this.setLookaheadState(e)},p.tsTokenCanFollowModifier=function(){return(this.match(M.bracketL)||this.match(M.braceL)||this.match(M.star)||this.match(M.ellipsis)||this.match(M.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()},p.tsNextTokenCanFollowModifier=function(){return this.next(!0),this.tsTokenCanFollowModifier()},p.tsParseModifier=function(t,e){if(z(this.type)||this.type===M._in){var s=this.value;if(-1!==t.indexOf(s)&&!this.containsEsc){if(e&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}},p.tsParseModifiersByMap=function(t){for(var e=t.modified,s=t.map,i=0,r=Object.keys(s);i<r.length;i++){var a=r[i];e[a]=s[a]}},p.tsParseModifiers=function(t){for(var e=this,s=t.modified,i=t.allowedModifiers,r=t.disallowedModifiers,a=t.stopOnStartOfClassStaticBlock,n=t.errorTemplate,o=void 0===n?T.InvalidModifierOnTypeMember:n,h={},p=function(t,i,r,a){i===r&&s[a]&&e.raise(t.column,T.InvalidModifiersOrder({orderedModifiers:[r,a]}))},c=function(t,i,r,a){(s[r]&&i===a||s[a]&&i===r)&&e.raise(t.column,T.IncompatibleModifiers({modifiers:[r,a]}))};;){var l=this.startLoc,u=this.tsParseModifier(i.concat(null!=r?r:[]),a);if(!u)break;w(u)?s.accessibility?this.raise(this.start,T.DuplicateAccessibilityModifier()):(p(l,u,u,"override"),p(l,u,u,"static"),p(l,u,u,"readonly"),p(l,u,u,"accessor"),h.accessibility=u,s.accessibility=u):C(u)?s[u]?this.raise(this.start,T.DuplicateModifier({modifier:u})):(p(l,u,"in","out"),h[u]=u,s[u]=!0):k(u)?s[u]?this.raise(this.start,T.DuplicateModifier({modifier:u})):(c(l,u,"accessor","readonly"),c(l,u,"accessor","static"),c(l,u,"accessor","override"),h[u]=u,s[u]=!0):Object.hasOwnProperty.call(s,u)?this.raise(this.start,T.DuplicateModifier({modifier:u})):(p(l,u,"static","readonly"),p(l,u,"static","override"),p(l,u,"override","readonly"),p(l,u,"abstract","override"),c(l,u,"declare","override"),c(l,u,"static","abstract"),h[u]=u,s[u]=!0),null!=r&&r.includes(u)&&this.raise(this.start,o)}return h},p.tsParseInOutModifiers=function(t){this.tsParseModifiers({modified:t,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:T.InvalidModifierOnTypeParameter})},p.tsParseTypeArguments=function(){var t=this,e=this.startNode();return e.params=this.tsInType(function(){return t.tsInNoContext(function(){return t.expect(M.relational),t.tsParseDelimitedList("TypeParametersOrArguments",t.tsParseType.bind(t))})}),0===e.params.length&&this.raise(this.start,T.EmptyTypeArguments),this.exprAllowed=!1,this.expect(M.relational),this.finishNode(e,"TSTypeParameterInstantiation")},p.tsParseHeritageClause=function(t){var e=this,s=this.start,i=this.tsParseDelimitedList("HeritageClauseElement",function(){var t=e.startNode();return t.expression=e.tsParseEntityName(),e.tsMatchLeftRelational()&&(t.typeParameters=e.tsParseTypeArguments()),e.finishNode(t,"TSExpressionWithTypeArguments")});return i.length||this.raise(s,T.EmptyHeritageClauseType({token:t})),i},p.tsParseTypeMemberSemicolon=function(){this.eat(M.comma)||this.isLineTerminator()||this.expect(M.semi)},p.tsTryParseAndCatch=function(t){var e=this.tryParse(function(e){return t()||e()});if(!e.aborted&&e.node)return e.error&&this.setLookaheadState(e.failState),e.node},p.tsParseSignatureMember=function(t,e){return this.tsFillSignature(M.colon,e),this.tsParseTypeMemberSemicolon(),this.finishNode(e,t)},p.tsParsePropertyOrMethodSignature=function(t,e){this.eat(M.question)&&(t.optional=!0);var s=t;if(this.match(M.parenL)||this.tsMatchLeftRelational()){e&&this.raise(t.start,T.ReadonlyForMethodSignature);var i=s;i.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,T.AccesorCannotHaveTypeParameters),this.tsFillSignature(M.colon,i),this.tsParseTypeMemberSemicolon();var r="parameters",a="typeAnnotation";if("get"===i.kind)i[r].length>0&&(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(i[r][0])&&this.raise(this.start,T.AccesorCannotDeclareThisParameter));else if("set"===i.kind){if(1!==i[r].length)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{var n=i[r][0];this.isThisParam(n)&&this.raise(this.start,T.AccesorCannotDeclareThisParameter),"Identifier"===n.type&&n.optional&&this.raise(this.start,T.SetAccesorCannotHaveOptionalParameter),"RestElement"===n.type&&this.raise(this.start,T.SetAccesorCannotHaveRestParameter)}i[a]&&this.raise(i[a].start,T.SetAccesorCannotHaveReturnType)}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}var o=s;e&&(o.readonly=!0);var h=this.tsTryParseTypeAnnotation();return h&&(o.typeAnnotation=h),this.tsParseTypeMemberSemicolon(),this.finishNode(o,"TSPropertySignature")},p.tsParseTypeMember=function(){var t=this.startNode();if(this.match(M.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",t);if(this.match(M._new)){var e=this.startNode();return this.next(),this.match(M.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember("TSConstructSignatureDeclaration",t):(t.key=this.createIdentifier(e,"new"),this.tsParsePropertyOrMethodSignature(t,!1))}return this.tsParseModifiers({modified:t,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]}),this.tsTryParseIndexSignature(t)||(this.parsePropertyName(t),t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||!this.tsTokenCanFollowModifier()||(t.kind=t.key.name,this.parsePropertyName(t)),this.tsParsePropertyOrMethodSignature(t,!!t.readonly))},p.tsParseList=function(t,e){for(var s=[];!this.tsIsListTerminator(t);)s.push(e());return s},p.tsParseObjectTypeMembers=function(){this.expect(M.braceL);var t=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(M.braceR),t},p.tsParseInterfaceDeclaration=function(t,e){if(void 0===e&&(e={}),this.hasFollowingLineBreak())return null;this.expectContextual("interface"),e.declare&&(t.declare=!0),z(this.type)?(t.id=this.parseIdent(),this.checkLValSimple(t.id,7)):(t.id=null,this.raise(this.start,T.MissingInterfaceName)),t.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(M._extends)&&(t.extends=this.tsParseHeritageClause("extends"));var s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),t.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(t,"TSInterfaceDeclaration")},p.tsParseAbstractDeclaration=function(t){if(this.match(M._class))return t.abstract=!0,this.parseClass(t,!0);if(this.ts_isContextual(B.interface)){if(!this.hasFollowingLineBreak())return t.abstract=!0,this.tsParseInterfaceDeclaration(t)}else this.unexpected(t.start)},p.tsIsDeclarationStart=function(){return K(this.type)},p.tsParseExpressionStatement=function(e,s){switch(s.name){case"declare":var i=this.tsTryParseDeclare(e);if(i)return i.declare=!0,i;break;case"global":if(this.match(M.braceL)){t.prototype.enterScope.call(this,u);var r=e;return r.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1)}},p.tsParseModuleReference=function(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)},p.tsIsExportDefaultSpecifier=function(){var t=this.type,e=this.isAsyncFunction(),s=this.isLet();if(z(t)){if(e&&!this.containsEsc||s)return!1;if((t===B.type||t===B.interface)&&!this.containsEsc){var i=this.lookahead();if(z(i.type)&&!this.isContextualWithState("from",i)||i.type===M.braceL)return!1}}else if(!this.match(M._default))return!1;var r=this.nextTokenStart(),a=this.isUnparsedContextual(r,"from");if(44===this.input.charCodeAt(r)||z(this.type)&&a)return!0;if(this.match(M._default)&&a){var n=this.input.charCodeAt(this.nextTokenStartSince(r+4));return 34===n||39===n}return!1},p.tsInAmbientContext=function(t){var e=this.isAmbientContext;this.isAmbientContext=!0;try{return t()}finally{this.isAmbientContext=e}},p.tsCheckLineTerminator=function(t){return t?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()},p.tsParseModuleOrNamespaceDeclaration=function(e,s){if(void 0===s&&(s=!1),e.id=this.parseIdent(),s||this.checkLValSimple(e.id,8),this.eat(M.dot)){var i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else t.prototype.enterScope.call(this,u),e.body=this.tsParseModuleBlock(),t.prototype.exitScope.call(this);return this.finishNode(e,"TSModuleDeclaration")},p.checkLValSimple=function(e,s,i){return void 0===s&&(s=0),t.prototype.checkLValSimple.call(this,e,s,i)},p.tsParseTypeAliasDeclaration=function(t){var e=this;return t.id=this.parseIdent(),this.checkLValSimple(t.id,6),t.typeAnnotation=this.tsInType(function(){if(t.typeParameters=e.tsTryParseTypeParameters(e.tsParseInOutModifiers.bind(e)),e.expect(M.eq),e.ts_isContextual(B.interface)&&e.lookahead().type!==M.dot){var s=e.startNode();return e.next(),e.finishNode(s,"TSIntrinsicKeyword")}return e.tsParseType()}),this.semicolon(),this.finishNode(t,"TSTypeAliasDeclaration")},p.tsParseDeclaration=function(t,e,s){switch(e){case"abstract":if(this.tsCheckLineTerminator(s)&&(this.match(M._class)||z(this.type)))return this.tsParseAbstractDeclaration(t);break;case"module":if(this.tsCheckLineTerminator(s)){if(this.match(M.string))return this.tsParseAmbientExternalModuleDeclaration(t);if(z(this.type))return this.tsParseModuleOrNamespaceDeclaration(t)}break;case"namespace":if(this.tsCheckLineTerminator(s)&&z(this.type))return this.tsParseModuleOrNamespaceDeclaration(t);break;case"type":if(this.tsCheckLineTerminator(s)&&z(this.type))return this.tsParseTypeAliasDeclaration(t)}},p.tsTryParseExportDeclaration=function(){return this.tsParseDeclaration(this.startNode(),this.value,!0)},p.tsParseImportEqualsDeclaration=function(e,s){e.isExport=s||!1,e.id=this.parseIdent(),this.checkLValSimple(e.id,2),t.prototype.expect.call(this,M.eq);var i=this.tsParseModuleReference();return"type"===e.importKind&&"TSExternalModuleReference"!==i.type&&this.raise(i.start,T.ImportAliasHasImportType),e.moduleReference=i,t.prototype.semicolon.call(this),this.finishNode(e,"TSImportEqualsDeclaration")},p.isExportDefaultSpecifier=function(){if(this.tsIsDeclarationStart())return!1;var t=this.type;if(z(t)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((t===B.type||t===B.interface)&&!this.containsEsc){var e=this.lookahead();if(z(e.type)&&!this.isContextualWithState("from",e)||e.type===M.braceL)return!1}}else if(!this.match(M._default))return!1;var s=this.nextTokenStart(),i=this.isUnparsedContextual(s,"from");if(44===this.input.charCodeAt(s)||z(this.type)&&i)return!0;if(this.match(M._default)&&i){var r=this.input.charCodeAt(this.nextTokenStartSince(s+4));return 34===r||39===r}return!1},p.parseTemplate=function(t){var e=(void 0===t?{}:t).isTagged,s=void 0!==e&&e,i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:s});for(i.quasis=[r];!r.tail;)this.type===M.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(M.dollarBraceL),i.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(M.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:s}));return this.next(),this.finishNode(i,"TemplateLiteral")},p.parseFunction=function(t,e,s,i,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===M.star&&2&e&&this.unexpected(),t.generator=this.eat(M.star)),this.options.ecmaVersion>=8&&(t.async=!!i),1&e&&(t.id=4&e&&this.type!==M.name?null:this.parseIdent());var a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos,h=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(E(t.async,t.generator)),1&e||(t.id=this.type===M.name?this.parseIdent():null),this.parseFunctionParams(t);var p=1&e;return this.parseFunctionBody(t,s,!1,r,{isFunctionDeclaration:p}),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,1&e&&t.id&&!(2&e)&&this.checkLValSimple(t.id,t.body?this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3:0),this.maybeInArrowParameters=h,this.finishNode(t,p?"FunctionDeclaration":"FunctionExpression")},p.parseFunctionBody=function(e,s,i,r,a){void 0===s&&(s=!1),void 0===i&&(i=!1),void 0===r&&(r=!1),this.match(M.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(M.colon));var n=null!=a&&a.isFunctionDeclaration?"TSDeclareFunction":null!=a&&a.isClassMethod?"TSDeclareMethod":void 0;return n&&!this.match(M.braceL)&&this.isLineTerminator()?this.finishNode(e,n):"TSDeclareFunction"===n&&this.isAmbientContext&&(this.raise(e.start,T.DeclareFunctionHasImplementation),e.declare)?(t.prototype.parseFunctionBody.call(this,e,s,i,!1),this.finishNode(e,n)):(t.prototype.parseFunctionBody.call(this,e,s,i,r),e)},p.parseNew=function(){var t;this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),s=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(M.dot)){e.meta=s;var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,a=this.startLoc,n=this.type===M._import;e.callee=this.parseSubscripts(this.parseExprAtom(),r,a,!0,!1),n&&"ImportExpression"===e.callee.type&&this.raise(r,"Cannot use new with import()");var o=e.callee;return"TSInstantiationExpression"!==o.type||null!=(t=o.extra)&&t.parenthesized||(e.typeParameters=o.typeParameters,e.callee=o.expression),e.arguments=this.eat(M.parenL)?this.parseExprList(M.parenR,this.options.ecmaVersion>=8,!1):[],this.finishNode(e,"NewExpression")},p.parseExprOp=function(e,s,i,r,a){var n;if(M._in.binop>r&&!this.hasPrecedingLineBreak()&&(this.isContextual("as")&&(n="TSAsExpression"),L&&this.isContextual("satisfies")&&(n="TSSatisfiesExpression"),n)){var o=this.startNodeAt(s,i);o.expression=e;var h=this.tsTryNextParseConstantContext();return o.typeAnnotation=h||this.tsNextThenParseType(),this.finishNode(o,n),this.reScan_lt_gt(),this.parseExprOp(o,s,i,r,a)}return t.prototype.parseExprOp.call(this,e,s,i,r,a)},p.parseImportSpecifiers=function(){var t=[],e=!0;if(N.tokenIsIdentifier(this.type)&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(M.comma)))return t;if(this.type===M.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(M.braceL);!this.eat(M.braceR);){if(e)e=!1;else if(this.expect(M.comma),this.afterTrailingComma(M.braceR))break;t.push(this.parseImportSpecifier())}return t},p.parseImport=function(t){var e=this.lookahead();if(t.importKind="value",this.importOrExportOuterKind="value",z(e.type)||this.match(M.star)||this.match(M.braceL)){var s=this.lookahead(2);if(s.type!==M.comma&&!this.isContextualWithState("from",s)&&s.type!==M.eq&&this.ts_eatContextualWithState("type",1,e)&&(this.importOrExportOuterKind="type",t.importKind="type",e=this.lookahead(),s=this.lookahead(2)),z(e.type)&&s.type===M.eq){this.next();var i=this.tsParseImportEqualsDeclaration(t);return this.importOrExportOuterKind="value",i}}return this.next(),this.type===M.string?(t.specifiers=[],t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===M.string?this.parseExprAtom():this.unexpected()),this.parseMaybeImportAttributes(t),this.semicolon(),this.finishNode(t,"ImportDeclaration"),this.importOrExportOuterKind="value","type"===t.importKind&&t.specifiers.length>1&&"ImportDefaultSpecifier"===t.specifiers[0].type&&this.raise(t.start,T.TypeImportCannotSpecifyDefaultAndNamed),t},p.parseExportDefaultDeclaration=function(){if(this.isAbstractClass()){var e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0)}if(this.match(B.interface)){var s=this.tsParseInterfaceDeclaration(this.startNode());if(s)return s}return t.prototype.parseExportDefaultDeclaration.call(this)},p.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==M.string&&this.unexpected(),t.source=this.parseExprAtom(),this.parseMaybeImportAttributes(t),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")},p.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.eat(M.comma)){var e=this.parseExpression();t.arguments=[e]}if(!this.eat(M.parenR)){var s=this.start;this.eat(M.comma)&&this.eat(M.parenR)?this.raiseRecoverable(s,"Trailing comma is not allowed in import()"):this.unexpected(s)}return this.finishNode(t,"ImportExpression")},p.parseExport=function(t,e){var s=this.lookahead();if(this.ts_eatWithState(M._import,2,s)){this.ts_isContextual(B.type)&&61!==this.lookaheadCharCode()?(t.importKind="type",this.importOrExportOuterKind="type",this.next()):(t.importKind="value",this.importOrExportOuterKind="value");var i=this.tsParseImportEqualsDeclaration(t,!0);return this.importOrExportOuterKind=void 0,i}if(this.ts_eatWithState(M.eq,2,s)){var r=t;return r.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(r,"TSExportAssignment")}if(this.ts_eatContextualWithState("as",2,s)){var a=t;return this.expectContextual("namespace"),a.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(a,"TSNamespaceExportDeclaration")}if(this.ts_isContextualWithState(s,B.type)&&this.lookahead(2).type===M.braceL?(this.next(),this.importOrExportOuterKind="type",t.exportKind="type"):(this.importOrExportOuterKind="value",t.exportKind="value"),this.next(),this.eat(M.star))return this.parseExportAllDeclaration(t,e);if(this.eat(M._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==M.string&&this.unexpected(),t.source=this.parseExprAtom(),this.parseMaybeImportAttributes(t);else{for(var n,o=h(t.specifiers);!(n=o()).done;){var p=n.value;this.checkUnreserved(p.local),this.checkLocalExport(p.local),"Literal"===p.local.type&&this.raise(p.local.start,"A string literal cannot be used as an exported binding without `from`.")}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},p.checkExport=function(t,e,s){t&&("string"!=typeof e&&(e="Identifier"===e.type?e.name:e.value),t[e]=!0)},p.parseMaybeDefault=function(e,s,i){var r=t.prototype.parseMaybeDefault.call(this,e,s,i);return"AssignmentPattern"===r.type&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(r.typeAnnotation.start,T.TypeAnnotationAfterAssign),r},p.typeCastToParameter=function(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.end),t.expression},p.toAssignableList=function(e,s){for(var i=0;i<e.length;i++){var r=e[i];"TSTypeCastExpression"===(null==r?void 0:r.type)&&(e[i]=this.typeCastToParameter(r))}return t.prototype.toAssignableList.call(this,e,s)},p.reportReservedArrowTypeParam=function(t){},p.parseExprAtom=function(e,s,i){if(this.type===B.jsxText)return this.jsx_parseText();if(this.type===B.jsxTagStart)return this.jsx_parseElement();if(this.type===B.at)return this.parseDecorators(),this.parseExprAtom();if(z(this.type)){var r=this.potentialArrowAt===this.start,a=this.start,n=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===h.name&&!this.canInsertSemicolon()&&this.eat(M._function))return this.overrideContext(j.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,s);if(r&&!this.canInsertSemicolon()){if(this.eat(M.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[h],!1,s);if(this.options.ecmaVersion>=8&&"async"===h.name&&this.type===M.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return h=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(M.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[h],!0,s)}return h}return t.prototype.parseExprAtom.call(this,e,s,i)},p.parseExprAtomDefault=function(){if(z(this.type)){var t=this.potentialArrowAt===this.start,e=this.containsEsc,s=this.parseIdent();if(!e&&"async"===s.name&&!this.canInsertSemicolon()){var i=this.type;if(i===M._function)return this.next(),this.parseFunction(this.startNodeAtNode(s),void 0,!0,!0);if(z(i)){if(61===this.lookaheadCharCode()){var r=this.parseIdent(!1);return!this.canInsertSemicolon()&&this.eat(M.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(s),[r],!0)}return s}}return t&&this.match(M.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(s),[s],!1)):s}this.unexpected()},p.parseIdentNode=function(){var e=this.startNode();return J(this.type)?(e.name=this.value,e):t.prototype.parseIdentNode.call(this)},p.parseVarStatement=function(e,s,i){void 0===i&&(i=!1);var r=this.isAmbientContext;this.next(),t.prototype.parseVar.call(this,e,!1,s,i||r),this.semicolon();var a=this.finishNode(e,"VariableDeclaration");if(!r)return a;for(var n,o=h(a.declarations);!(n=o()).done;){var p=n.value,c=p.init;c&&("const"!==s||p.id.typeAnnotation?this.raise(c.start,T.InitializerNotAllowedInAmbientContext):"StringLiteral"!==c.type&&"BooleanLiteral"!==c.type&&"NumericLiteral"!==c.type&&"BigIntLiteral"!==c.type&&("TemplateLiteral"!==c.type||c.expressions.length>0)&&!I(c)&&this.raise(c.start,T.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference))}return a},p.parseStatement=function(e,s,i){if(this.match(B.at)&&this.parseDecorators(!0),this.match(M._const)&&this.isLookaheadContextual("enum")){var r=this.startNode();return this.expect(M._const),this.tsParseEnumDeclaration(r,{const:!0})}if(this.ts_isContextual(B.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(B.interface)){var a=this.tsParseInterfaceDeclaration(this.startNode());if(a)return a}return t.prototype.parseStatement.call(this,e,s,i)},p.parseAccessModifier=function(){return this.tsParseModifier(["public","protected","private"])},p.parsePostMemberNameModifiers=function(t){this.eat(M.question)&&(t.optional=!0),t.readonly&&this.match(M.parenL)&&this.raise(t.start,T.ClassMethodHasReadonly),t.declare&&this.match(M.parenL)&&this.raise(t.start,T.ClassMethodHasDeclare)},p.parseExpressionStatement=function(e,s){return("Identifier"===s.type?this.tsParseExpressionStatement(e,s):void 0)||t.prototype.parseExpressionStatement.call(this,e,s)},p.shouldParseExportStatement=function(){return!!this.tsIsDeclarationStart()||!!this.match(B.at)||t.prototype.shouldParseExportStatement.call(this)},p.parseConditional=function(t,e,s,i,r){if(this.eat(M.question)){var a=this.startNodeAt(e,s);return a.test=t,a.consequent=this.parseMaybeAssign(),this.expect(M.colon),a.alternate=this.parseMaybeAssign(i),this.finishNode(a,"ConditionalExpression")}return t},p.parseMaybeConditional=function(t,e){var s=this,i=this.start,r=this.startLoc,a=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return a;if(!this.maybeInArrowParameters||!this.match(M.question))return this.parseConditional(a,i,r,t,e);var n=this.tryParse(function(){return s.parseConditional(a,i,r,t,e)});return n.node?(n.error&&this.setLookaheadState(n.failState),n.node):(n.error&&this.setOptionalParametersError(e,n.error),a)},p.parseParenItem=function(e){var s=this.start,i=this.startLoc;if(e=t.prototype.parseParenItem.call(this,e),this.eat(M.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(M.colon)){var r=this.startNodeAt(s,i);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e},p.parseExportDeclaration=function(t){var e=this;if(!this.isAmbientContext&&this.ts_isContextual(B.declare))return this.tsInAmbientContext(function(){return e.parseExportDeclaration(t)});var s=this.start,i=this.startLoc,r=this.eatContextual("declare");!r||!this.ts_isContextual(B.declare)&&this.shouldParseExportStatement()||this.raise(this.start,T.ExpectedAmbientAfterExportDeclare);var a=z(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return a?(("TSInterfaceDeclaration"===a.type||"TSTypeAliasDeclaration"===a.type||r)&&(t.exportKind="type"),r&&(this.resetStartLocation(a,s,i),a.declare=!0),a):null},p.parseClassId=function(e,s){if(s||!this.isContextual("implements")){t.prototype.parseClassId.call(this,e,s);var i=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));i&&(e.typeParameters=i)}},p.parseClassPropertyAnnotation=function(t){t.optional||("!"===this.value&&this.eat(M.prefix)?t.definite=!0:this.eat(M.question)&&(t.optional=!0));var e=this.tsTryParseTypeAnnotation();e&&(t.typeAnnotation=e)},p.parseClassField=function(e){if("PrivateIdentifier"===e.key.type)e.abstract&&this.raise(e.start,T.PrivateElementHasAbstract),e.accessibility&&this.raise(e.start,T.PrivateElementHasAccessibility({modifier:e.accessibility})),this.parseClassPropertyAnnotation(e);else if(this.parseClassPropertyAnnotation(e),this.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(M.eq)&&this.raise(this.start,T.DeclareClassFieldHasInitializer),e.abstract&&this.match(M.eq)){var s=e.key;this.raise(this.start,T.AbstractPropertyHasInitializer({propertyName:"Identifier"!==s.type||e.computed?"["+this.input.slice(s.start,s.end)+"]":s.name}))}return t.prototype.parseClassField.call(this,e)},p.parseClassMethod=function(t,e,s,i){var r="constructor"===t.kind,a="PrivateIdentifier"===t.key.type,n=this.tsTryParseTypeParameters();a?(n&&(t.typeParameters=n),t.accessibility&&this.raise(t.start,T.PrivateMethodsHasAccessibility({modifier:t.accessibility}))):n&&r&&this.raise(n.start,T.ConstructorHasTypeParameters);var o=t.declare,h=t.kind;!(void 0!==o&&o)||"get"!==h&&"set"!==h||this.raise(t.start,T.DeclareAccessor({kind:h})),n&&(t.typeParameters=n);var p=t.key;"constructor"===t.kind?(e&&this.raise(p.start,"Constructor can't be a generator"),s&&this.raise(p.start,"Constructor can't be an async method")):t.static&&x(t,"prototype")&&this.raise(p.start,"Classes may not have a static property named prototype");var c=t.value=this.parseMethod(e,s,i,!0,t);return"get"===t.kind&&0!==c.params.length&&this.raiseRecoverable(c.start,"getter should have no params"),"set"===t.kind&&1!==c.params.length&&this.raiseRecoverable(c.start,"setter should have exactly one param"),"set"===t.kind&&"RestElement"===c.params[0].type&&this.raiseRecoverable(c.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")},p.isClassMethod=function(){return this.match(M.relational)},p.parseClassElement=function(e){var s=this;if(this.eat(M.semi))return null;var i,r=this.options.ecmaVersion,a=this.startNode(),n="",o=!1,h=!1,p="method",c=["declare","private","public","protected","accessor","override","abstract","readonly","static"],l=this.tsParseModifiers({modified:a,allowedModifiers:c,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:T.InvalidModifierOnTypeParameterPositions});i=Boolean(l.static);var u=function(){if(!s.tsIsStartOfStaticBlocks()){var l=s.tsTryParseIndexSignature(a);if(l)return a.abstract&&s.raise(a.start,T.IndexSignatureHasAbstract),a.accessibility&&s.raise(a.start,T.IndexSignatureHasAccessibility({modifier:a.accessibility})),a.declare&&s.raise(a.start,T.IndexSignatureHasDeclare),a.override&&s.raise(a.start,T.IndexSignatureHasOverride),l;if(!s.inAbstractClass&&a.abstract&&s.raise(a.start,T.NonAbstractClassHasAbstractMethod),a.override&&e&&s.raise(a.start,T.OverrideNotInSubClass),a.static=i,i&&(s.isClassElementNameStart()||s.type===M.star||(n="static")),!n&&r>=8&&s.eatContextual("async")&&(!s.isClassElementNameStart()&&s.type!==M.star||s.canInsertSemicolon()?n="async":h=!0),!n&&(r>=9||!h)&&s.eat(M.star)&&(o=!0),!n&&!h&&!o){var u=s.value;(s.eatContextual("get")||s.eatContextual("set"))&&(s.isClassElementNameStart()?p=u:n=u)}if(n?(a.computed=!1,a.key=s.startNodeAt(s.lastTokStart,s.lastTokStartLoc),a.key.name=n,s.finishNode(a.key,"Identifier")):s.parseClassElementName(a),s.parsePostMemberNameModifiers(a),s.isClassMethod()||r<13||s.type===M.parenL||"method"!==p||o||h){var d=!a.static&&x(a,"constructor"),m=d&&e;d&&"method"!==p&&s.raise(a.key.start,"Constructor can't have get/set modifier"),a.kind=d?"constructor":p,s.parseClassMethod(a,o,h,m)}else s.parseClassField(a);return a}if(s.next(),s.next(),s.tsHasSomeModifiers(a,c)&&s.raise(s.start,T.StaticBlockCannotHaveModifier),r>=13)return t.prototype.parseClassStaticBlock.call(s,a),a};return a.declare?this.tsInAmbientContext(u):u(),a},p.isClassElementNameStart=function(){return!!this.tsIsIdentifier()||t.prototype.isClassElementNameStart.call(this)},p.parseClassSuper=function(e){t.prototype.parseClassSuper.call(this,e),e.superClass&&(this.tsMatchLeftRelational()||this.match(M.bitShift))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual("implements")&&(e.implements=this.tsParseHeritageClause("implements"))},p.parseFunctionParams=function(e){var s=this.tsTryParseTypeParameters();s&&(e.typeParameters=s),t.prototype.parseFunctionParams.call(this,e)},p.parseVarId=function(e,s){t.prototype.parseVarId.call(this,e,s),"Identifier"===e.id.type&&!this.hasPrecedingLineBreak()&&"!"===this.value&&this.eat(M.prefix)&&(e.definite=!0);var i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))},p.parseArrowExpression=function(t,e,s,i){this.match(M.colon)&&(t.returnType=this.tsParseTypeAnnotation());var r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;this.enterScope(16|E(s,!1)),this.initFunction(t);var o=this.maybeInArrowParameters;return this.options.ecmaVersion>=8&&(t.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,t.params=this.toAssignableList(e,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0,!1,i),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.maybeInArrowParameters=o,this.finishNode(t,"ArrowFunctionExpression")},p.parseMaybeAssignOrigin=function(t,e,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var i=!1,r=-1,a=-1,n=-1;e?(r=e.parenthesizedAssign,a=e.trailingComma,n=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new y,i=!0);var o=this.start,h=this.startLoc;(this.type===M.parenL||z(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===t);var p=this.parseMaybeConditional(t,e);if(s&&(p=s.call(this,p,o,h)),this.type.isAssign){var c=this.startNodeAt(o,h);return c.operator=this.value,this.type===M.eq&&(p=this.toAssignable(p,!0,e)),i||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=p.start&&(e.shorthandAssign=-1),this.type===M.eq?this.checkLValPattern(p):this.checkLValSimple(p),c.left=p,this.next(),c.right=this.parseMaybeAssign(t),n>-1&&(e.doubleProto=n),this.finishNode(c,"AssignmentExpression")}return i&&this.checkExpressionErrors(e,!0),r>-1&&(e.parenthesizedAssign=r),a>-1&&(e.trailingComma=a),p},p.parseMaybeAssign=function(t,e,s){var i,r,a,n,o,h,p,c,l,u,d,m=this;if(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational()){if(c=this.cloneCurLookaheadState(),!(l=this.tryParse(function(){return m.parseMaybeAssignOrigin(t,e,s)},c)).error)return l.node;var y=this.context,f=y[y.length-1];f===N.tokContexts.tc_oTag&&y[y.length-2]===N.tokContexts.tc_expr?(y.pop(),y.pop()):f!==N.tokContexts.tc_oTag&&f!==N.tokContexts.tc_expr||y.pop()}if(!(null!=(i=l)&&i.error||this.tsMatchLeftRelational()))return this.parseMaybeAssignOrigin(t,e,s);c&&!this.compareLookaheadState(c,this.getCurLookaheadState())||(c=this.cloneCurLookaheadState());var x=this.tryParse(function(i){var r,a;d=m.tsParseTypeParameters();var n=m.parseMaybeAssignOrigin(t,e,s);return("ArrowFunctionExpression"!==n.type||null!=(r=n.extra)&&r.parenthesized)&&i(),0!==(null==(a=d)?void 0:a.params.length)&&m.resetStartLocationFromNode(n,d),n.typeParameters=d,n},c);if(!x.error&&!x.aborted)return d&&this.reportReservedArrowTypeParam(d),x.node;if(!l&&(S(!0),!(u=this.tryParse(function(){return m.parseMaybeAssignOrigin(t,e,s)},c)).error))return u.node;if(null!=(r=l)&&r.node)return this.setLookaheadState(l.failState),l.node;if(x.node)return this.setLookaheadState(x.failState),d&&this.reportReservedArrowTypeParam(d),x.node;if(null!=(a=u)&&a.node)return this.setLookaheadState(u.failState),u.node;if(null!=(n=l)&&n.thrown)throw l.error;if(x.thrown)throw x.error;if(null!=(o=u)&&o.thrown)throw u.error;throw(null==(h=l)?void 0:h.error)||x.error||(null==(p=u)?void 0:p.error)},p.parseAssignableListItem=function(t){for(var e=[];this.match(B.at);)e.push(this.parseDecorator());var s,i=this.start,r=this.startLoc,a=!1,n=!1;if(void 0!==t){var o={};this.tsParseModifiers({modified:o,allowedModifiers:["public","private","protected","override","readonly"]}),s=o.accessibility,n=o.override,a=o.readonly,!1===t&&(s||a||n)&&this.raise(r.start,T.UnexpectedParameterModifier)}var h=this.parseMaybeDefault(i,r);this.parseBindingListItem(h);var p=this.parseMaybeDefault(h.start,h.loc,h);if(e.length&&(p.decorators=e),s||a||n){var c=this.startNodeAt(i,r);return s&&(c.accessibility=s),a&&(c.readonly=a),n&&(c.override=n),"Identifier"!==p.type&&"AssignmentPattern"!==p.type&&this.raise(c.start,T.UnsupportedParameterPropertyKind),c.parameter=p,this.finishNode(c,"TSParameterProperty")}return p},p.checkLValInnerPattern=function(e,s,i){void 0===s&&(s=0),"TSParameterProperty"===e.type?this.checkLValInnerPattern(e.parameter,s,i):t.prototype.checkLValInnerPattern.call(this,e,s,i)},p.parseBindingListItem=function(t){this.eat(M.question)&&("Identifier"===t.type||this.isAmbientContext||this.inType||this.raise(t.start,T.PatternIsOptional),t.optional=!0);var e=this.tsTryParseTypeAnnotation();return e&&(t.typeAnnotation=e),this.resetEndLocation(t),t},p.isAssignable=function(t,e){var s=this;switch(t.type){case"TSTypeCastExpression":return this.isAssignable(t.expression,e);case"TSParameterProperty":case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":var i=t.properties.length-1;return t.properties.every(function(t,e){return"ObjectMethod"!==t.type&&(e===i||"SpreadElement"!==t.type)&&s.isAssignable(t)});case"Property":case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(function(t){return null===t||s.isAssignable(t)});case"AssignmentExpression":return"="===t.operator;case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}},p.toAssignable=function(e,s,i){switch(void 0===s&&(s=!1),void 0===i&&(i=new y),e.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(e,s,i);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":return s||this.raise(e.start,T.UnexpectedTypeCastInParameter),this.toAssignable(e.expression,s,i);case"MemberExpression":break;case"AssignmentExpression":return s||"TSTypeCastExpression"!==e.left.type||(e.left=this.typeCastToParameter(e.left)),t.prototype.toAssignable.call(this,e,s,i);case"TSTypeCastExpression":return this.typeCastToParameter(e);default:return t.prototype.toAssignable.call(this,e,s,i)}return e},p.toAssignableParenthesizedExpression=function(e,s,i){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":return this.toAssignable(e.expression,s,i);default:return t.prototype.toAssignable.call(this,e,s,i)}},p.curPosition=function(){if(this.options.locations){var e=t.prototype.curPosition.call(this);return Object.defineProperty(e,"offset",{get:function(){return function(t){var e=new o.Position(this.line,this.column+t);return e.index=this.index+t,e}}}),e.index=this.pos,e}},p.parseBindingAtom=function(){return this.type===M._this?this.parseIdent(!0):t.prototype.parseBindingAtom.call(this)},p.shouldParseArrow=function(t){var e,s=this;if(e=this.match(M.colon)?t.every(function(t){return s.isAssignable(t,!0)}):!this.canInsertSemicolon()){if(this.match(M.colon)){var i=this.tryParse(function(t){var e=s.tsParseTypeOrTypePredicateAnnotation(M.colon);return!s.canInsertSemicolon()&&s.match(M.arrow)||t(),e});if(i.aborted)return this.shouldParseArrowReturnType=void 0,!1;i.thrown||(i.error&&this.setLookaheadState(i.failState),this.shouldParseArrowReturnType=i.node)}return!!this.match(M.arrow)||(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,e},p.parseParenArrowList=function(t,e,s,i){var r=this.startNodeAt(t,e);return r.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(r,s,!1,i)},p.parseParenAndDistinguishExpression=function(t,e){var s,i=this.start,r=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){var n=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();var o,h=this.start,p=this.startLoc,c=[],l=!0,u=!1,d=new y,m=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==M.parenR;){if(l?l=!1:this.expect(M.comma),a&&this.afterTrailingComma(M.parenR,!0)){u=!0;break}if(this.type===M.ellipsis){o=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===M.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(e,d,this.parseParenItem))}var x=this.lastTokEnd,T=this.lastTokEndLoc;if(this.expect(M.parenR),this.maybeInArrowParameters=n,t&&this.shouldParseArrow(c)&&this.eat(M.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=f,this.parseParenArrowList(i,r,c,e);c.length&&!u||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=f||this.awaitPos,c.length>1?((s=this.startNodeAt(h,p)).expressions=c,this.finishNodeAt(s,"SequenceExpression",x,T)):s=c[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(i,r);return v.expression=s,this.finishNode(v,"ParenthesizedExpression")}return s},p.parseTaggedTemplateExpression=function(t,e,s,i){var r=this.startNodeAt(e,s);return r.tag=t,r.quasi=this.parseTemplate({isTagged:!0}),i&&this.raise(e,"Tagged Template Literals are not allowed in optionalChain."),this.finishNode(r,"TaggedTemplateExpression")},p.shouldParseAsyncArrow=function(){var t=this;if(!this.match(M.colon))return!this.canInsertSemicolon()&&this.eat(M.arrow);var e=this.tryParse(function(e){var s=t.tsParseTypeOrTypePredicateAnnotation(M.colon);return!t.canInsertSemicolon()&&t.match(M.arrow)||e(),s});return e.aborted?(this.shouldParseAsyncArrowReturnType=void 0,!1):e.thrown?void 0:(e.error&&this.setLookaheadState(e.failState),this.shouldParseAsyncArrowReturnType=e.node,!this.canInsertSemicolon()&&this.eat(M.arrow))},p.parseSubscriptAsyncArrow=function(t,e,s,i){var r=this.startNodeAt(t,e);return r.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(r,s,!0,i)},p.parseExprList=function(t,e,s,i){for(var r=[],a=!0;!this.eat(t);){if(a)a=!1;else if(this.expect(M.comma),e&&this.afterTrailingComma(t))break;var n=void 0;s&&this.type===M.comma?n=null:this.type===M.ellipsis?(n=this.parseSpread(i),i&&this.type===M.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):n=this.parseMaybeAssign(!1,i,this.parseParenItem),r.push(n)}return r},p.parseSubscript=function(t,e,s,i,r,a,n){var o=this,h=a;if(!this.hasPrecedingLineBreak()&&"!"===this.value&&this.match(M.prefix)){this.exprAllowed=!1,this.next();var p=this.startNodeAt(e,s);return p.expression=t,t=this.finishNode(p,"TSNonNullExpression")}var c=!1;if(this.match(M.questionDot)&&60===this.lookaheadCharCode()){if(i)return t;t.optional=!0,h=c=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(M.bitShift)){var l,u=this.tsTryParseAndCatch(function(){if(!i&&o.atPossibleAsyncArrow(t)){var r=o.tsTryParseGenericAsyncArrowFunction(e,s,n);if(r)return t=r}var a=o.tsParseTypeArgumentsInExpression();if(!a)return t;if(c&&!o.match(M.parenL))return l=o.curPosition(),t;if(V(o.type)||o.type===M.backQuote){var p=o.parseTaggedTemplateExpression(t,e,s,h);return p.typeParameters=a,p}if(!i&&o.eat(M.parenL)){var u=new y,d=o.startNodeAt(e,s);return d.callee=t,d.arguments=o.parseExprList(M.parenR,o.options.ecmaVersion>=8,!1,u),o.tsCheckForInvalidTypeCasts(d.arguments),d.typeParameters=a,h&&(d.optional=c),o.checkExpressionErrors(u,!0),t=o.finishNode(d,"CallExpression")}var m=o.type;if(!(o.tsMatchRightRelational()||m===M.bitShift||m!==M.parenL&&(f=m,Boolean(f.startsExpr))&&!o.hasPrecedingLineBreak())){var f,x=o.startNodeAt(e,s);return x.expression=t,x.typeParameters=a,o.finishNode(x,"TSInstantiationExpression")}});if(l&&this.unexpected(l),u)return"TSInstantiationExpression"===u.type&&(this.match(M.dot)||this.match(M.questionDot)&&40!==this.lookaheadCharCode())&&this.raise(this.start,T.InvalidPropertyAccessAfterInstantiationExpression),t=u}var d=this.options.ecmaVersion>=11,m=d&&this.eat(M.questionDot);i&&m&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var f=this.eat(M.bracketL);if(f||m&&this.type!==M.parenL&&this.type!==M.backQuote||this.eat(M.dot)){var x=this.startNodeAt(e,s);x.object=t,f?(x.property=this.parseExpression(),this.expect(M.bracketR)):x.property=this.type===M.privateId&&"Super"!==t.type?this.parsePrivateIdent():this.parseIdent("never"!==this.options.allowReserved),x.computed=!!f,d&&(x.optional=m),t=this.finishNode(x,"MemberExpression")}else if(!i&&this.eat(M.parenL)){var v=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;var P=new y,b=this.yieldPos,g=this.awaitPos,A=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(M.parenR,this.options.ecmaVersion>=8,!1,P);if(r&&!m&&this.shouldParseAsyncArrow())this.checkPatternErrors(P,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=b,this.awaitPos=g,this.awaitIdentPos=A,t=this.parseSubscriptAsyncArrow(e,s,S,n);else{this.checkExpressionErrors(P,!0),this.yieldPos=b||this.yieldPos,this.awaitPos=g||this.awaitPos,this.awaitIdentPos=A||this.awaitIdentPos;var k=this.startNodeAt(e,s);k.callee=t,k.arguments=S,d&&(k.optional=m),t=this.finishNode(k,"CallExpression")}this.maybeInArrowParameters=v}else if(this.type===M.backQuote){(m||h)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var C=this.startNodeAt(e,s);C.tag=t,C.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(C,"TaggedTemplateExpression")}return t},p.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e="get"===t.kind?0:1,s=t.value.params[0],i=s&&this.isThisParam(s);t.value.params.length!==(e=i?e+1:e)?this.raiseRecoverable(t.value.start,"get"===t.kind?"getter should have no params":"setter should have exactly one param"):"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")},p.parseProperty=function(e,s){if(!e){var i=[];if(this.match(B.at))for(;this.match(B.at);)i.push(this.parseDecorator());var r=t.prototype.parseProperty.call(this,e,s);return"SpreadElement"===r.type&&i.length&&this.raise(r.start,"Decorators can't be used with SpreadElement"),i.length&&(r.decorators=i,i=[]),r}return t.prototype.parseProperty.call(this,e,s)},p.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e="Identifier"===t.type;this.enterScope(e?32:0),this.checkLValPattern(t,e?4:2);var s=this.tsTryParseTypeAnnotation();return s&&(t.typeAnnotation=s,this.resetEndLocation(t)),this.expect(M.parenR),t},p.parseClass=function(t,e){var s=this.inAbstractClass;this.inAbstractClass=!!t.abstract;try{this.next(),this.takeDecorators(t);var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var r=this.enterClassBody(),a=this.startNode(),n=!1;a.body=[];var o=[];for(this.expect(M.braceL);this.type!==M.braceR;)if(this.match(B.at))o.push(this.parseDecorator());else{var h=this.parseClassElement(null!==t.superClass);o.length&&(h.decorators=o,this.resetStartLocationFromNode(h,o[0]),o=[]),h&&(a.body.push(h),"MethodDefinition"===h.type&&"constructor"===h.kind&&"FunctionExpression"===h.value.type?(n&&this.raiseRecoverable(h.start,"Duplicate constructor in the same class"),n=!0,h.decorators&&h.decorators.length>0&&this.raise(h.start,"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")):h.key&&"PrivateIdentifier"===h.key.type&&f(r,h)&&this.raiseRecoverable(h.key.start,"Identifier '#"+h.key.name+"' has already been declared"))}return this.strict=i,this.next(),o.length&&this.raise(this.start,"Decorators must be attached to a class element."),t.body=this.finishNode(a,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=s}},p.parseClassFunctionParams=function(){var t=this.tsTryParseTypeParameters(this.tsParseConstModifier),e=this.parseBindingList(M.parenR,!1,this.options.ecmaVersion>=8,!0);return t&&(e.typeParameters=t),e},p.parseMethod=function(t,e,s,i,r){var a=this.startNode(),n=this.yieldPos,o=this.awaitPos,h=this.awaitIdentPos;if(this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=t),this.options.ecmaVersion>=8&&(a.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|E(e,a.generator)|(s?128:0)),this.expect(M.parenL),a.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1,{isClassMethod:i}),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=h,r&&r.abstract&&a.body){var p=r.key;this.raise(r.start,T.AbstractMethodHasImplementation({methodName:"Identifier"!==p.type||r.computed?"["+this.input.slice(p.start,p.end)+"]":p.name}))}return this.finishNode(a,"FunctionExpression")},e.parse=function(t,e){if(!1===e.locations)throw new Error("You have to enable options.locations while using acorn-typescript");e.locations=!0;var s=new this(e,t);return d&&(s.isAmbientContext=!0),s.parse()},e.parseExpressionAt=function(t,e,s){if(!1===s.locations)throw new Error("You have to enable options.locations while using acorn-typescript");s.locations=!0;var i=new this(s,t,e);return d&&(i.isAmbientContext=!0),i.nextToken(),i.parseExpression()},p.parseImportSpecifier=function(){if(this.ts_isContextual(B.type)){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(e,!0,"type"===this.importOrExportOuterKind),this.finishNode(e,"ImportSpecifier")}var s=t.prototype.parseImportSpecifier.call(this);return s.importKind="value",s},p.parseExportSpecifier=function(e){var s=this.ts_isContextual(B.type);if(!this.match(M.string)&&s){var i=this.startNode();return i.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(i,!1,"type"===this.importOrExportOuterKind),this.finishNode(i,"ExportSpecifier"),this.checkExport(e,i.exported,i.exported.start),i}var r=t.prototype.parseExportSpecifier.call(this,e);return r.exportKind="value",r},p.parseTypeOnlyImportExportSpecifier=function(e,s,i){var r,a=s?"imported":"local",n=s?"local":"exported",o=e[a],h=!1,p=!0,c=o.start;if(this.isContextual("as")){var l=this.parseIdent();if(this.isContextual("as")){var u=this.parseIdent();J(this.type)?(h=!0,o=l,r=s?this.parseIdent():this.parseModuleExportName(),p=!1):(r=u,p=!1)}else J(this.type)?(p=!1,r=s?this.parseIdent():this.parseModuleExportName()):(h=!0,o=l)}else J(this.type)&&(h=!0,s?(o=t.prototype.parseIdent.call(this,!0),this.isContextual("as")||this.checkUnreserved(o)):o=this.parseModuleExportName());h&&i&&this.raise(c,s?T.TypeModifierIsUsedInTypeImports:T.TypeModifierIsUsedInTypeExports),e[a]=o,e[n]=r,e[s?"importKind":"exportKind"]=h?"type":"value",p&&this.eatContextual("as")&&(e[n]=s?this.parseIdent():this.parseModuleExportName()),e[n]||(e[n]=this.copyNode(e[a])),s&&this.checkLValSimple(e[n],2)},p.raiseCommonCheck=function(e,s,i){return"Comma is not permitted after the rest element"===s?this.isAmbientContext&&this.match(M.comma)&&41===this.lookaheadCharCode()?void this.next():t.prototype.raise.call(this,e,s):i?t.prototype.raiseRecoverable.call(this,e,s):t.prototype.raise.call(this,e,s)},p.raiseRecoverable=function(t,e){return this.raiseCommonCheck(t,e,!0)},p.raise=function(t,e){return this.raiseCommonCheck(t,e,!0)},p.updateContext=function(e){var s=this.type;if(s==M.braceL){var i=this.curContext();i==H.tc_oTag?this.context.push(j.b_expr):i==H.tc_expr?this.context.push(j.b_tmpl):t.prototype.updateContext.call(this,e),this.exprAllowed=!0}else{if(s!==M.slash||e!==B.jsxTagStart)return t.prototype.updateContext.call(this,e);this.context.length-=2,this.context.push(H.tc_cTag),this.exprAllowed=!1}},p.jsx_parseOpeningElementAt=function(t,e){var s=this,i=this.startNodeAt(t,e),r=this.jsx_parseElementName();if(r&&(i.name=r),this.match(M.relational)||this.match(M.bitShift)){var a=this.tsTryParseAndCatch(function(){return s.tsParseTypeArgumentsInExpression()});a&&(i.typeParameters=a)}for(i.attributes=[];this.type!==M.slash&&this.type!==B.jsxTagEnd;)i.attributes.push(this.jsx_parseAttribute());return i.selfClosing=this.eat(M.slash),this.expect(B.jsxTagEnd),this.finishNode(i,r?"JSXOpeningElement":"JSXOpeningFragment")},p.enterScope=function(e){e===u&&this.importsStack.push([]),t.prototype.enterScope.call(this,e);var s=t.prototype.currentScope.call(this);s.types=[],s.enums=[],s.constEnums=[],s.classes=[],s.exportOnlyBindings=[]},p.exitScope=function(){t.prototype.currentScope.call(this).flags===u&&this.importsStack.pop(),t.prototype.exitScope.call(this)},p.hasImport=function(t,e){var s=this.importsStack.length;if(this.importsStack[s-1].indexOf(t)>-1)return!0;if(!e&&s>1)for(var i=0;i<s-1;i++)if(this.importsStack[i].indexOf(t)>-1)return!0;return!1},p.maybeExportDefined=function(t,e){this.inModule&&1&t.flags&&this.undefinedExports.delete(e)},p.isRedeclaredInScope=function(e,s,i){return!!(0&i)&&(2&i?e.lexical.indexOf(s)>-1||e.functions.indexOf(s)>-1||e.var.indexOf(s)>-1:3&i?e.lexical.indexOf(s)>-1||!t.prototype.treatFunctionsAsVarInScope.call(this,e)&&e.var.indexOf(s)>-1:e.lexical.indexOf(s)>-1&&!(32&e.flags&&e.lexical[0]===s)||!this.treatFunctionsAsVarInScope(e)&&e.functions.indexOf(s)>-1)},p.checkRedeclarationInScope=function(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.raise(i,"Identifier '"+e+"' has already been declared.")},p.declareName=function(e,s,i){if(4096&s)return this.hasImport(e,!0)&&this.raise(i,"Identifier '"+e+"' has already been declared."),void this.importsStack[this.importsStack.length-1].push(e);var r=this.currentScope();if(1024&s)return this.maybeExportDefined(r,e),void r.exportOnlyBindings.push(e);t.prototype.declareName.call(this,e,s,i),0&s&&(0&s||(this.checkRedeclarationInScope(r,e,s,i),this.maybeExportDefined(r,e)),r.types.push(e)),256&s&&r.enums.push(e),512&s&&r.constEnums.push(e),128&s&&r.classes.push(e)},p.checkLocalExport=function(e){var s=e.name;if(!this.hasImport(s)){for(var i=this.scopeStack.length-1;i>=0;i--){var r=this.scopeStack[i];if(r.types.indexOf(s)>-1||r.exportOnlyBindings.indexOf(s)>-1)return}t.prototype.checkLocalExport.call(this,e)}},s=e,n=[{key:"acornTypeScript",get:function(){return N}}],(r=[{key:"acornTypeScript",get:function(){return N}}])&&i(s.prototype,r),n&&i(s,n),Object.defineProperty(s,"prototype",{writable:!1}),e}(n);return Y}}exports.default=L,exports.tsPlugin=L;
|