@mastra/deployer-sandbox 0.0.0 → 0.1.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/LICENSE.md +30 -0
  3. package/dist/alias.d.ts +10 -0
  4. package/dist/alias.d.ts.map +1 -0
  5. package/dist/chunk-CSXC6CZL.cjs +115 -0
  6. package/dist/chunk-CSXC6CZL.cjs.map +1 -0
  7. package/dist/chunk-Z636GNUQ.js +101 -0
  8. package/dist/chunk-Z636GNUQ.js.map +1 -0
  9. package/dist/client/index.cjs +159 -0
  10. package/dist/client/index.cjs.map +1 -0
  11. package/dist/client/index.d.ts +98 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/client/index.js +155 -0
  14. package/dist/client/index.js.map +1 -0
  15. package/dist/deployer.d.ts +57 -0
  16. package/dist/deployer.d.ts.map +1 -0
  17. package/dist/engine.d.ts +19 -0
  18. package/dist/engine.d.ts.map +1 -0
  19. package/dist/index.cjs +381 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +372 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/manifest.d.ts +7 -0
  26. package/dist/manifest.d.ts.map +1 -0
  27. package/dist/shared.d.ts +63 -0
  28. package/dist/shared.d.ts.map +1 -0
  29. package/dist/studio/assets/CommitMono-400-Regular-DzkyLZ26.woff2 +0 -0
  30. package/dist/studio/assets/CommitMono-700-Regular-DmOSN4kd.woff2 +0 -0
  31. package/dist/studio/assets/MonaSans-VariableFont_wdth-wght-CX-7s9jm.ttf +0 -0
  32. package/dist/studio/assets/babel-lWBcy2sH.js +16 -0
  33. package/dist/studio/assets/bash-atvbtKCR.js +1 -0
  34. package/dist/studio/assets/core-CBT9ED6Q.js +12 -0
  35. package/dist/studio/assets/engine-compile-BkERmzkH.js +137 -0
  36. package/dist/studio/assets/engine-javascript-CSIo_1eZ.js +1 -0
  37. package/dist/studio/assets/estree-Dd9JfUIE.js +44 -0
  38. package/dist/studio/assets/github-dark-DHJKELXO.js +1 -0
  39. package/dist/studio/assets/github-light-DAi9KRSo.js +1 -0
  40. package/dist/studio/assets/index-CORJOrgI.js +2 -0
  41. package/dist/studio/assets/index-yUiD89B4.js +1 -0
  42. package/dist/studio/assets/javascript-ySlJ1b_l.js +1 -0
  43. package/dist/studio/assets/json-BQoSv7ci.js +1 -0
  44. package/dist/studio/assets/jsx-BAng5TT0.js +1 -0
  45. package/dist/studio/assets/livekit-client.esm-CKIgC2IJ.js +39 -0
  46. package/dist/studio/assets/main-BYaOwSFl.js +784 -0
  47. package/dist/studio/assets/markdown-UIAJJxZW.js +1 -0
  48. package/dist/studio/assets/preload-helper-PPVm8Dsz.js +1 -0
  49. package/dist/studio/assets/python-DhUJRlN_.js +1 -0
  50. package/dist/studio/assets/shell-CjFT_Tl9.js +1 -0
  51. package/dist/studio/assets/standalone-Dfz2oS5J.js +29 -0
  52. package/dist/studio/assets/style-DMLmyAwy.css +1 -0
  53. package/dist/studio/assets/tsx-B6W0miNI.js +1 -0
  54. package/dist/studio/assets/typescript-Dj6nwHGl.js +1 -0
  55. package/dist/studio/index.html +100 -0
  56. package/dist/studio/mastra.svg +17 -0
  57. package/dist/studio/routes-manifest.json +27 -0
  58. package/dist/types.d.ts +90 -0
  59. package/dist/types.d.ts.map +1 -0
  60. package/package.json +18 -18
@@ -0,0 +1,16 @@
1
+ var us=Object.defineProperty,Fe=(t,e)=>{for(var s in e)us(t,s,{get:e[s],enumerable:!0})},ds={};Fe(ds,{parsers:()=>Sa});var wt={};Fe(wt,{__babel_estree:()=>ya,__js_expression:()=>Ct,__ts_expression:()=>It,__vue_event_binding:()=>St,__vue_expression:()=>Ct,__vue_ts_event_binding:()=>Et,__vue_ts_expression:()=>It,babel:()=>St,"babel-flow":()=>ls,"babel-ts":()=>Et});var Be=(t,e)=>(s,r,...i)=>s|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,i),ms=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},fs=Be("replaceAll",function(){if(typeof this=="string")return ms}),J=fs,ys=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),Ue=ys,v=class{constructor(t,e,s){this.line=void 0,this.column=void 0,s!==void 0&&(this.index=void 0),this.line=t,this.column=e,s!==void 0&&(this.index=s)}},xe=class{start;end;filename;identifierName;constructor(t,e){this.start=t,this.end=e}};function D(t,e){let{line:s,column:r,index:i}=t;return new v(s,r+e,i+e)}var Ze="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",xs={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ze},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ze}},et={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},ue=t=>t.type==="UpdateExpression"?et.UpdateExpression[`${t.prefix}`]:et[t.type],Ps={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
2
+ - Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
3
+ - Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:({phase:t})=>`\`import${t?`.${t}`:""}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:t})=>`Cannot use new with import${t?`.${t}`:""}().`,ImportCallSpreadArgument:({phase:t})=>`\`...\` is not allowed in \`import${t?`.${t}`:""}()\`.`,IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${ue(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${ue(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${ue(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},gs={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Ts={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:t})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(t)}\`.`},bs=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),As={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${ue({type:t})}; please wrap it in parentheses.`,PipelineUnparenthesized:"Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."},Ss={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."};function tt(t,e,s){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:s})}function Es({toMessage:t,code:e,reasonCode:s,syntaxPlugin:r}){let i=s==="MissingPlugin"||s==="MissingOneOfPlugins";return function a(n,o,l){let h=new SyntaxError;return h.code=e,h.reasonCode=s,h.loc=n,h.pos=o,h.syntaxPlugin=r,i&&(h.missingPlugin=l.missingPlugin),tt(h,"clone",function(u={}){let{line:d,column:y,index:g=o}=u.loc??n;return a(new v(d,y),g,{...l,...u.details})}),tt(h,"details",l),Object.defineProperty(h,"message",{configurable:!0,get(){let u=`${t(l)} (${n.line}:${n.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),h}}function F(t,e){if(Array.isArray(t))return r=>F(r,t[0]);let s={};for(let r of Object.keys(t)){let i=t[r],{message:a,...n}=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,o=typeof a=="string"?()=>a:a;s[r]=Es({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:o,...e?{syntaxPlugin:e}:{},...n})}return s}var p={...F(xs),...F(Ps),...F(gs),...F(Ts),...F`pipelineOperator`(As),...F`functionBind`(Ss)};function Cs(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Is(t){let e=Cs();if(t==null)return e;if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let s of Object.keys(e))t[s]!=null&&(e[s]=t[s]);if(e.startLine===1)t.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:t.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if(t.startColumn==null||t.startIndex==null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(e.sourceType==="commonjs"){if(t.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(t.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(t.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return e}function K(t){let{start:e,end:s}=t.loc;return t.loc.start=new v(e.line,e.column),t.loc.end=new v(s.line,s.column),t}var ws=t=>class extends t{createPosition(e){return new v(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(K)),K(e)}parseRegExpLiteral({pattern:e,flags:s}){let r=null;try{r=new RegExp(e,s)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:e,flags:s},i}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let r=this.estreeParseLiteral(s);return r.bigint=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,s){let r=this.startNodeAtNode(e);return r.expression=e,this.finishNodeAtNode(r,"ChainExpression",s)}directiveToStmt(e){let s=e.value;delete e.value,this.castNodeTo(s,"Literal"),s.raw=s.extra.raw,s.value=s.extra.expressionValue;let r=this.castNodeTo(e,"ExpressionStatement");return r.expression=s,r.directive=s.extra.rawValue,delete s.extra,r}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:s,end:r,loc:i,range:a,raw:n,value:o}=e,l=Object.create(e.constructor.prototype);return l.type="Literal",l.start=s,l.end=r,l.loc=i,l.range=a,l.raw=n,l.value=o,l}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!e.expression.extra?.parenthesized}parseBlockBody(e,s,r,i,a){super.parseBlockBody(e,s,r,i,a);let n=e.directives.map(o=>this.directiveToStmt(o));e.body=n.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return delete e.id,e.name=s,this.castNodeTo(e,"PrivateIdentifier")}isPrivateName(e){return e.type==="PrivateIdentifier"}getPrivateNameSV(e){return e.name}parseLiteral(e,s){let r=super.parseLiteral(e,s);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,s,r=!1){super.parseFunctionBody(e,s,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,r,i,a,n,o=!1){let l=this.startNode();l.kind=e.kind,l=super.parseMethod(l,s,r,i,a,n,o),delete l.kind;let{typeParameters:h}=e;h&&(delete e.typeParameters,l.typeParameters=h,this.resetStartLocationFromNode(l,h));let u=this.castNodeTo(l,this.hasPlugin("typescript")&&!l.body?"TSEmptyBodyFunctionExpression":"FunctionExpression");return e.value=u,n==="ClassPrivateMethod"&&(e.computed=!1),this.hasPlugin("typescript")&&e.abstract?(delete e.abstract,this.finishNode(e,"TSAbstractMethodDefinition")):n==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractPropertyDefinition")):this.castNodeTo(s,"PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return s.abstract&&this.hasPlugin("typescript")?this.castNodeTo(s,"TSAbstractPropertyDefinition"):this.castNodeTo(s,"PropertyDefinition"),s.computed=!1,s}parseClassAccessorProperty(e){let s=super.parseClassAccessorProperty(e);return s.abstract&&this.hasPlugin("typescript")?(delete s.abstract,this.castNodeTo(s,"TSAbstractAccessorProperty")):this.castNodeTo(s,"AccessorProperty"),s}parseObjectProperty(e,s,r,i){let a=super.parseObjectProperty(e,s,r,i);return a&&(a.kind="init",this.castNodeTo(a,"Property")),a}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}isValidLVal(e,s,r,i){return e==="Property"?"value":super.isValidLVal(e,s,r,i)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:i}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.start),this.toAssignable(i,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(p.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(p.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,r)}finishCallExpression(e,s){let r=super.finishCallExpression(e,s);return r.callee.type==="Import"?(this.castNodeTo(r,"ImportExpression"),r.source=r.arguments[0],r.options=r.arguments[1]??null,delete r.arguments,delete r.callee):r.type==="OptionalCallExpression"?this.castNodeTo(r,"CallExpression"):r.optional=!1,r}parseExport(e,s){let r=this.state.lastTokStartLoc,i=super.parseExport(e,s);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(i,"ExportAllDeclaration"),i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{let{declaration:a}=i;a?.type==="ClassDeclaration"&&a.decorators?.length>0&&a.start===i.start&&this.resetStartLocation(i,r)}break}return i}stopParseSubscript(e,s){let r=super.stopParseSubscript(e,s);return s.optionalChainMember?this.estreeParseChainExpression(r,e):r}parseMember(e,s,r,i,a){let n=super.parseMember(e,s,r,i,a);return n.type==="OptionalMemberExpression"?this.castNodeTo(n,"MemberExpression"):n.optional=!1,n}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}castNodeTo(e,s){let r=super.castNodeTo(e,s);return this.fillOptionalPropertiesForTSESLint(r),r}cloneIdentifier(e){let s=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(s),s}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,s,r){return K(super.finishNodeAt(e,s,r))}finishNodeAtNode(e,s,r){return K(super.finishNodeAtNode(e,s,r))}finishNode(e,s){let r=super.finishNode(e,s);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(e,s){super.resetStartLocation(e,s),K(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),K(e)}},b=!0,f=!0,Se=!0,Q=!0,_=!0,Ns=!0,Nt=class{label;keyword;beforeExpr;startsExpr;rightAssociative;isLoop;isAssign;prefix;postfix;binop;constructor(t,e={}){this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null}},Re=new Map;function A(t,e={}){e.keyword=t;let s=P(t,e);return Re.set(t,s),s}function k(t,e){return P(t,{beforeExpr:b,binop:e})}var ie=-1,je=[],_e=[],Ve=[],ze=[],He=[],$e=[];function P(t,e={}){return++ie,_e.push(t),Ve.push(e.binop??-1),ze.push(e.beforeExpr??!1),He.push(e.startsExpr??!1),$e.push(e.prefix??!1),je.push(new Nt(t,e)),ie}function T(t,e={}){return++ie,Re.set(t,ie),_e.push(t),Ve.push(e.binop??-1),ze.push(e.beforeExpr??!1),He.push(e.startsExpr??!1),$e.push(e.prefix??!1),je.push(new Nt("name",e)),ie}var ks={bracketL:P("[",{beforeExpr:b,startsExpr:f}),bracketR:P("]"),braceL:P("{",{beforeExpr:b,startsExpr:f}),braceBarL:P("{|",{beforeExpr:b,startsExpr:f}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:b,startsExpr:f}),parenR:P(")"),comma:P(",",{beforeExpr:b}),semi:P(";",{beforeExpr:b}),colon:P(":",{beforeExpr:b}),doubleColon:P("::",{beforeExpr:b}),dot:P("."),question:P("?",{beforeExpr:b}),questionDot:P("?."),arrow:P("=>",{beforeExpr:b}),template:P("template"),ellipsis:P("...",{beforeExpr:b}),backQuote:P("`",{startsExpr:f}),dollarBraceL:P("${",{beforeExpr:b,startsExpr:f}),templateTail:P("...`",{startsExpr:f}),templateNonTail:P("...${",{beforeExpr:b,startsExpr:f}),at:P("@"),hash:P("#",{startsExpr:f}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:b,isAssign:Q}),assign:P("_=",{beforeExpr:b,isAssign:Q}),slashAssign:P("_=",{beforeExpr:b,isAssign:Q}),xorAssign:P("_=",{beforeExpr:b,isAssign:Q}),moduloAssign:P("_=",{beforeExpr:b,isAssign:Q}),incDec:P("++/--",{prefix:_,postfix:Ns,startsExpr:f}),bang:P("!",{beforeExpr:b,prefix:_,startsExpr:f}),tilde:P("~",{beforeExpr:b,prefix:_,startsExpr:f}),doubleCaret:P("^^",{startsExpr:f}),doubleAt:P("@@",{startsExpr:f}),pipeline:k("|>",0),nullishCoalescing:k("??",1),logicalOR:k("||",1),logicalAND:k("&&",2),bitwiseOR:k("|",3),bitwiseXOR:k("^",4),bitwiseAND:k("&",5),equality:k("==/!=/===/!==",6),lt:k("</>/<=/>=",7),gt:k("</>/<=/>=",7),relational:k("</>/<=/>=",7),bitShift:k("<</>>/>>>",8),bitShiftL:k("<</>>/>>>",8),bitShiftR:k("<</>>/>>>",8),plusMin:P("+/-",{beforeExpr:b,binop:9,prefix:_,startsExpr:f}),modulo:P("%",{binop:10,startsExpr:f}),star:P("*",{binop:10}),slash:k("/",10),exponent:P("**",{beforeExpr:b,binop:11,rightAssociative:!0}),_in:A("in",{beforeExpr:b,binop:7}),_instanceof:A("instanceof",{beforeExpr:b,binop:7}),_break:A("break"),_case:A("case",{beforeExpr:b}),_catch:A("catch"),_continue:A("continue"),_debugger:A("debugger"),_default:A("default",{beforeExpr:b}),_else:A("else",{beforeExpr:b}),_finally:A("finally"),_function:A("function",{startsExpr:f}),_if:A("if"),_return:A("return",{beforeExpr:b}),_switch:A("switch"),_throw:A("throw",{beforeExpr:b,prefix:_,startsExpr:f}),_try:A("try"),_var:A("var"),_const:A("const"),_with:A("with"),_new:A("new",{beforeExpr:b,startsExpr:f}),_this:A("this",{startsExpr:f}),_super:A("super",{startsExpr:f}),_class:A("class",{startsExpr:f}),_extends:A("extends",{beforeExpr:b}),_export:A("export"),_import:A("import",{startsExpr:f}),_null:A("null",{startsExpr:f}),_true:A("true",{startsExpr:f}),_false:A("false",{startsExpr:f}),_typeof:A("typeof",{beforeExpr:b,prefix:_,startsExpr:f}),_void:A("void",{beforeExpr:b,prefix:_,startsExpr:f}),_delete:A("delete",{beforeExpr:b,prefix:_,startsExpr:f}),_do:A("do",{isLoop:Se,beforeExpr:b}),_for:A("for",{isLoop:Se}),_while:A("while",{isLoop:Se}),_as:T("as",{startsExpr:f}),_assert:T("assert",{startsExpr:f}),_async:T("async",{startsExpr:f}),_await:T("await",{startsExpr:f}),_defer:T("defer",{startsExpr:f}),_from:T("from",{startsExpr:f}),_get:T("get",{startsExpr:f}),_let:T("let",{startsExpr:f}),_meta:T("meta",{startsExpr:f}),_of:T("of",{startsExpr:f}),_sent:T("sent",{startsExpr:f}),_set:T("set",{startsExpr:f}),_source:T("source",{startsExpr:f}),_static:T("static",{startsExpr:f}),_using:T("using",{startsExpr:f}),_yield:T("yield",{startsExpr:f}),_asserts:T("asserts",{startsExpr:f}),_checks:T("checks",{startsExpr:f}),_exports:T("exports",{startsExpr:f}),_global:T("global",{startsExpr:f}),_implements:T("implements",{startsExpr:f}),_intrinsic:T("intrinsic",{startsExpr:f}),_infer:T("infer",{startsExpr:f}),_is:T("is",{startsExpr:f}),_mixins:T("mixins",{startsExpr:f}),_proto:T("proto",{startsExpr:f}),_require:T("require",{startsExpr:f}),_satisfies:T("satisfies",{startsExpr:f}),_keyof:T("keyof",{startsExpr:f}),_readonly:T("readonly",{startsExpr:f}),_unique:T("unique",{startsExpr:f}),_abstract:T("abstract",{startsExpr:f}),_declare:T("declare",{startsExpr:f}),_enum:T("enum",{startsExpr:f}),_module:T("module",{startsExpr:f}),_namespace:T("namespace",{startsExpr:f}),_interface:T("interface",{startsExpr:f}),_type:T("type",{startsExpr:f}),_opaque:T("opaque",{startsExpr:f}),name:P("name",{startsExpr:f}),placeholder:P("%%",{startsExpr:f}),string:P("string",{startsExpr:f}),num:P("num",{startsExpr:f}),bigint:P("bigint",{startsExpr:f}),regexp:P("regexp",{startsExpr:f}),privateName:P("#name",{startsExpr:f}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:b}),jsxTagStart:P("jsxTagStart",{startsExpr:f}),jsxTagEnd:P("jsxTagEnd")};function S(t){return t>=89&&t<=129}function vs(t){return t<=88}function B(t){return t>=54&&t<=129}function kt(t){return t>=54&&t<=132}function Ls(t){return ze[t]}function te(t){return He[t]}function Ms(t){return t>=25&&t<=29}function st(t){return t>=125&&t<=127}function Ds(t){return t>=86&&t<=88}function qe(t){return t>=54&&t<=88}function rt(t){return t>=35&&t<=55}function Os(t){return t===30}function Fs(t){return $e[t]}function Bs(t){return t>=117&&t<=119}function Us(t){return t>=120&&t<=126}function $(t){return _e[t]}function de(t){return Ve[t]}function Rs(t){return t===53}function ke(t){return t>=20&&t<=21}function vt(t){return je[t]}var le=class{constructor(t,e){this.token=t,this.preserveSpace=!!e}token;preserveSpace},E={brace:new le("{"),j_oTag:new le("<tag"),j_cTag:new le("</tag"),j_expr:new le("<tag>...</tag>",!0)},Lt="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",js="\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65",Mt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],_s=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Vs=new RegExp("["+Lt+"]"),zs=new RegExp("["+Lt+js+"]");function ve(t,e){let s=65536;for(let r=0,i=e.length;r<i;r+=2){if(s+=e[r],s>t)return!1;if(s+=e[r+1],s>=t)return!0}return!1}function U(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Vs.test(String.fromCharCode(t)):ve(t,Mt)}function q(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&zs.test(String.fromCharCode(t)):ve(t,Mt)||ve(t,_s)}var Ke={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Hs=new Set(Ke.keyword),$s=new Set(Ke.strict),qs=new Set(Ke.strictBind);function Dt(t,e){return e&&t==="await"||t==="enum"}function Ot(t,e){return Dt(t,e)||$s.has(t)}function Ft(t){return qs.has(t)}function Bt(t,e){return Ot(t,e)||Ft(t)}function Ks(t){return Hs.has(t)}function Ws(t,e,s){return t===64&&e===64&&U(s)}var Js=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Xs(t){return Js.has(t)}var We=class{flags=0;names=new Map;firstLexicalName="";constructor(t){this.flags=t}},Je=class{parser;scopeStack=[];inModule;undefinedExports=new Map;constructor(t,e){this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new We(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,t,e,s);let i=r.names.get(t)||0;e&16?i=i|4:(r.firstLexicalName||(r.firstLexicalName=t),i=i|2),r.names.set(t,i),e&8&&this.maybeExportDefined(r,t)}else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,t,e,s),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,r){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(p.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let r=t.names.get(e)||0;return s&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&3715)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&3779&&!(e&4))return e}}},Gs=class extends We{declareFunctions=new Set},Ys=class extends Je{createScope(t){return new Gs(t)}declareName(t,e,s){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let r=t.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Qs=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),Zs={AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:t})=>`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:e})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:e})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:e,explicitType:s})=>`Enum \`${t}\` has type \`${s}\`, so the initializer of \`${e}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:e,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${s}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:{message:"A binding pattern parameter cannot be optional in an implementation signature."},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:e})=>`\`declare export ${t}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."},x=F`flow`(Zs);function er(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function it(t){return t.importKind==="type"||t.importKind==="typeof"}var tr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function sr(t,e){let s=[],r=[];for(let i=0;i<t.length;i++)(e(t[i],i,t)?s:r).push(t[i]);return[s,r]}var rr=/\*?\s*@((?:no)?flow)\b/,ir=t=>class extends t{flowPragma=void 0;getScopeHandler(){return Ys}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=rr.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||10);let r=this.flowParseType();return this.state.inType=s,r}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>s.index+1&&this.raise(x.UnexpectedSpaceBetweenModuloChecks,s),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(10);let r=null,i=null;return e&&this.match(50)?(this.state.inType=s,i=this.flowParsePredicate()):(r=this.flowParseType(),this.state.inType=s,this.match(50)&&(i=this.flowParsePredicate())),[r,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),r=this.startNode(),i=this.startNode();this.match(43)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(6);let a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(7),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),i.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(s&&this.raise(x.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,s);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(130)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=this.startNode(),r=s.body=[];for(this.expect(2);!this.match(4);){let n=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(x.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),r.push(super.parseImport(n))):(this.expectContextual(121,x.UnsupportedStatementInDeclareModule),r.push(this.flowParseDeclare(n,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(s,"BlockStatement");let i=null,a=!1;return r.forEach(n=>{er(n)?(i==="CommonJS"&&this.raise(x.AmbiguousDeclareModuleKind,n),i="ES"):n.type==="DeclareModuleExports"&&(a&&this.raise(x.DuplicateDeclareModuleExports,n),i==="ES"&&this.raise(x.AmbiguousDeclareModuleKind,n),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!s){let r=this.state.value;throw this.raise(x.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:tr[r]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let r=this.parseExport(e,null);return r.type==="ExportNamedDeclaration"?(r.default=!1,delete r.exportKind,this.castNodeTo(r,"DeclareExportDeclaration")):this.castNodeTo(r,"DeclareExportAllDeclaration")}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return this.castNodeTo(s,"DeclareTypeAlias"),s}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(8));if(s){let r=[],i=[];if(this.eatContextual(113))do i.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do r.push(this.flowParseClassImplements());while(this.eat(8));e.implements=r,e.mixins=i}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(43)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(x.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,r){Qs.has(e)&&this.raise(r?x.AssignReservedType:x.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifierName(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,s){let r=this.startNode(),i=this.flowParseRestrictedIdentifierName(e,s);return this.createIdentifier(r,i)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,s?"DeclareOpaqueType":"OpaqueType")}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,"TypeAnnotation")}}flowParseTypeParameter(e=!1){let s=this.state.startLoc,r=this.startNode(),i=this.flowParseVariance();return r.name=this.flowParseRestrictedIdentifierName(),r.variance=i,r.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),r.default=this.flowParseType()):e&&this.raise(x.MissingTypeParamDefault,s),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let r=!1;do{let i=this.flowParseTypeParameter(r);s.params.push(i),i.default&&(r=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==E.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=r}),this.state.inType=s,!this.state.inType&&this.curContext()===E.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,r){return e.static=s,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let r=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:r,allowProto:i,allowInexact:a}){let n=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let l,h,u=!1;for(s&&this.match(3)?(this.expect(3),l=5,h=!0):(this.expect(2),l=4,h=!1),o.exact=h;!this.match(l);){let y=!1,g=null,w=null,N=this.startNode();if(i&&this.isContextual(114)){let I=this.lookahead();I.type!==10&&I.type!==13&&(this.next(),g=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let I=this.lookahead();I.type!==10&&I.type!==13&&(this.next(),y=!0)}let C=this.flowParseVariance();if(this.eat(0))g!=null&&this.unexpected(g),this.eat(0)?(C&&this.unexpected(C.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(N,y))):o.indexers.push(this.flowParseObjectTypeIndexer(N,y,C));else if(this.match(6)||this.match(43))g!=null&&this.unexpected(g),C&&this.unexpected(C.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(N,y));else{let I="init";if(this.isContextual(95)||this.isContextual(100)){let be=this.lookahead();kt(be.type)&&(I=this.state.value,this.next())}let L=this.flowParseObjectTypeProperty(N,y,g,C,I,r,a??!h);L===null?(u=!0,w=this.state.lastTokStartLoc):o.properties.push(L)}this.flowObjectTypeSemicolon(),w&&!this.match(4)&&!this.match(5)&&this.raise(x.UnexpectedExplicitInexactInObject,w)}this.expect(l),r&&(o.inexact=u);let d=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=n,d}flowParseObjectTypeProperty(e,s,r,i,a,n,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(n?o||this.raise(x.InexactInsideExact,this.state.lastTokStartLoc):this.raise(x.InexactInsideNonObject,this.state.lastTokStartLoc),i&&this.raise(x.InexactVariance,i),null):(n||this.raise(x.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),i&&this.raise(x.SpreadVariance,i),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=r!=null,e.kind=a;let l=!1;return this.match(43)||this.match(6)?(e.method=!0,r!=null&&this.unexpected(r),i&&this.unexpected(i.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),a==="get"||a==="set"?this.flowCheckGetterSetterParams(e):!s&&!n&&e.key.name==="constructor"&&e.value.this&&this.raise(x.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(13)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,r=e.value,i=r.params.length+(r.rest?1:0);r.this&&this.raise(e.kind==="get"?x.GetterMayNotHaveThisParam:x.SetterMayNotHaveThisParam,r.this),i!==s&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&r.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e??(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let i=this.startNodeAt(e);i.qualification=r,i.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(i,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(43)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(83),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let s=null,r=!1,i,a=this.startNode(),n=this.lookahead(),o=this.state.type===74;return n.type===10||n.type===13?(o&&!e&&this.raise(x.ThisParamMustBeFirst,a),s=this.parseIdentifier(o),this.eat(13)&&(r=!0,o&&this.raise(x.ThisParamMayNotBeOptional,a)),i=this.flowParseTypeInitialiser()):i=this.flowParseType(),a.name=s,a.optional=r,a.typeAnnotation=i,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let s=this.startNodeAtNode(e);return s.name=null,s.optional=!1,s.typeAnnotation=e,this.finishNode(s,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let s=null,r=null;for(this.match(74)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(s=this.flowParseFunctionTypeParam(!1)),{params:e,rest:s,_this:r}}flowIdentToTypeAnnotation(e,s,r){switch(r.name){case"any":return this.finishNode(s,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(s,"BooleanTypeAnnotation");case"mixed":return this.finishNode(s,"MixedTypeAnnotation");case"empty":return this.finishNode(s,"EmptyTypeAnnotation");case"number":return this.finishNode(s,"NumberTypeAnnotation");case"string":return this.finishNode(s,"StringTypeAnnotation");case"symbol":return this.finishNode(s,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),r,i,a=!1,n=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,i=this.flowParseTupleType(),this.state.noAnonFunctionType=n,i;case 43:{let o=this.startNode();return o.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),r=this.flowParseFunctionTypeParams(),o.params=r.params,o.rest=r.rest,o.this=r._this,this.expect(7),this.expect(15),o.returnType=this.flowParseType(),this.finishNode(o,"FunctionTypeAnnotation")}case 6:{let o=this.startNode();if(this.next(),!this.match(7)&&!this.match(17))if(S(this.state.type)||this.match(74)){let l=this.lookahead().type;a=l!==13&&l!==10}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=n,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),i;this.eat(8)}return i?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):r=this.flowParseFunctionTypeParams(),o.params=r.params,o.rest=r.rest,o.this=r._this,this.expect(7),this.expect(15),o.returnType=this.flowParseType(),o.typeParameters=null,this.finishNode(o,"FunctionTypeAnnotation")}case 130:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 81:case 82:return s.value=this.match(81),this.next(),this.finishNode(s,"BooleanLiteralTypeAnnotation");case 49:if(this.state.value==="-"){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(x.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 132:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 84:return this.next(),this.finishNode(s,"VoidTypeAnnotation");case 80:return this.next(),this.finishNode(s,"NullLiteralTypeAnnotation");case 74:return this.next(),this.finishNode(s,"ThisTypeAnnotation");case 51:return this.next(),this.finishNode(s,"ExistsTypeAnnotation");case 83:return this.flowParseTypeofType();default:if(qe(this.state.type)){let o=$(this.state.type);return this.next(),super.createIdentifier(s,o)}else if(S(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let i=this.startNodeAt(e),a=this.eat(14);r=r||a,this.expect(0),!a&&this.match(1)?(i.elementType=s,this.next(),s=this.finishNode(i,"ArrayTypeAnnotation")):(i.objectType=s,i.indexType=this.flowParseType(),this.expect(1),r?(i.optional=a,s=this.finishNode(i,"OptionalIndexedAccessType")):s=this.finishNode(i,"IndexedAccessType"))}return s}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let s=this.startNodeAtNode(e);return s.params=[this.reinterpretTypeAsFunctionTypeParam(e)],s.rest=null,s.this=null,s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let s=this.flowParseAnonFunctionWithoutParens();for(e.types=[s];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?s:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(39);let s=this.flowParseIntersectionType();for(e.types=[s];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?s:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let s=this.flowParseUnionType();return this.state.inType=e,s}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value==="_"){let e=this.state.startLoc,s=this.parseIdentifier();return this.flowParseGenericType(e,s)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),s=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,s)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,s,r=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,s,r=!1){if(this.match(10)){let i=this.startNode();s==="FunctionDeclaration"||s==="FunctionExpression"||s==="ArrowFunctionExpression"?[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):i.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=i.typeAnnotation?this.finishNode(i,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){let r=this.lookahead();if(B(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.isContextual(122)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,r){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(76)||S(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(S(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||st(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||st(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,r){if(!this.match(13))return e;if(r!=null){let y=this.lookaheadCharCode();if(y===44||y===61||y===58||y===41)return this.setOptionalParametersError(r),e}this.expect(13);let i=this.state.clone(),a=this.state.noArrowAt,n=this.startNodeAt(s),{consequent:o,failed:l}=this.tryParseConditionalConsequent(),h=this.getArrowLikeExpressions(o),u=h[0],d=h[1];if(l||d.length>0){let y=[...a];if(d.length>0){this.state=i,this.state.noArrowAt=y;for(let g=0;g<d.length;g++)y.push(d[g].start);({consequent:o,failed:l}=this.tryParseConditionalConsequent()),[u]=this.getArrowLikeExpressions(o)}l&&u.length>1&&this.raise(x.AmbiguousConditionalArrow,i.startLoc),l&&u.length===1&&(this.state=i,y.push(u[0].start),this.state.noArrowAt=y,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=a,this.expect(10),n.test=e,n.consequent=o,n.alternate=this.forwardNoArrowParamsConversionAt(n,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(n,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let r=[e],i=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return s?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):sr(i,a=>a.params.every(n=>this.isAssignable(n,!0)))}finishArrowValidation(e){this.toAssignableList(e.params,e.extra?.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),r=s(),this.state.noArrowParamsConversionAt.pop()):r=s(),r}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(13)&&(r.optional=!0,this.resetEndLocation(e)),this.match(10)){let i=this.startNodeAt(s);return i.expression=r,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(126)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(127)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(125)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(122)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(s),r}parseClassId(e,s,r){if((!s||r)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,s,r),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,r){let{startLoc:i}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,r),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(x.DeclareClassElement,i):s.value&&this.raise(x.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(128,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?s===46?this.finishOp(14,2):this.finishOp(13,1):Ws(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableListItem(e,s,r){let i=e[s];i.type==="TypeCastExpression"&&(e[s]=this.typeCastToParameter(i)),super.toAssignableListItem(e,s,r)}toReferencedList(e,s){for(let r=0;r<e.length;r++){let i=e[r];i?.type==="TypeCastExpression"&&!i.extra?.parenthesized&&(e.length>1||!s)&&this.raise(x.TypeCastInPattern,i.typeAnnotation)}return e}parseArrayLike(e,s){let r=super.parseArrayLike(e,s);return r.type==="ArrayExpression"&&this.toReferencedList(r.elements),r}isValidLVal(e,s,r,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,r,i)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,r,i,a,n){if(s.variance&&this.unexpected(s.variance.start),delete s.variance,this.match(43)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,r,i,a,n),s.params&&a){let o=s.params;o.length>0&&this.isThisParam(o[0])&&this.raise(x.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let o=s.value.params;o.length>0&&this.isThisParam(o[0])&&this.raise(x.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,r,i){s.variance&&this.unexpected(s.variance.start),delete s.variance,this.match(43)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,r,i)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),this.match(43)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"ClassImplements")}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let s=e.implements=[];do s.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let r=s[0];this.isThisParam(r)&&e.kind==="get"?this.raise(x.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(x.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,r,i,a,n,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let l;this.match(43)&&!n&&(l=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let h=super.parseObjPropValue(e,s,r,i,a,n,o);return l&&((h.value||h).typeParameters=l),h}parseFunctionParamType(e){return this.eat(13)&&(e.type!=="Identifier"&&this.raise(x.PatternIsOptional,e),this.isThisParam(e)&&this.raise(x.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(x.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(x.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(x.TypeBeforeInitializer,r.typeAnnotation),r}parseImportSpecifierLocal(e,s,r){s.local=it(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(83)}applyImportPhase(e,s,r,i){if(super.applyImportPhase(e,s,r,i),s){if(!r&&this.match(61))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(51)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,s,r,i,a){let n=e.imported,o=null;n.type==="Identifier"&&(n.name==="type"?o="type":n.name==="typeof"&&(o="typeof"));let l=!1;if(this.isContextual(89)&&!this.isLookaheadContextual("as")){let u=this.parseIdentifier(!0);o!==null&&!B(this.state.type)?(e.imported=u,e.importKind=o,e.local=this.cloneIdentifier(u)):(e.imported=n,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&B(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(s)throw this.raise(p.ImportBindingIsString,e,{importName:n.value});e.imported=n,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(l=!0,e.local=this.cloneIdentifier(e.imported))}let h=it(e);return r&&h&&this.raise(x.ImportTypeShorthandOnlyInPureImport,e),(r||h)&&this.checkReservedType(e.local.name,e.local.start,!0),l&&!r&&!h&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(e,s){let r=e.kind;r!=="get"&&r!=="set"&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){if(this.match(10)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){let r=null,i;if(this.hasPlugin("jsx")&&(this.match(138)||this.match(43))){if(r=this.state.clone(),i=this.tryParse(()=>super.parseMaybeAssign(e,s),r),!i.error)return i.node;let{context:a}=this.state,n=a[a.length-1];(n===E.j_oTag||n===E.j_expr)&&a.pop()}if(i?.error||this.match(43)){r=r||this.state.clone();let a,n=this.tryParse(l=>{a=this.flowParseTypeParameterDeclaration();let h=this.forwardNoArrowParamsConversionAt(a,()=>{let d=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(d,a),d});h.extra?.parenthesized&&l();let u=this.maybeUnwrapTypeCastExpression(h);return u.type!=="ArrowFunctionExpression"&&l(),u.typeParameters=a,this.resetStartLocationFromNode(u,a),h},r),o=null;if(n.node&&this.maybeUnwrapTypeCastExpression(n.node).type==="ArrowFunctionExpression"){if(!n.error&&!n.aborted)return n.node.async&&this.raise(x.UnexpectedTypeParameterBeforeAsyncArrowFunction,a),n.node;o=n.node}if(i?.node)return this.state=i.failState,i.node;if(o)return this.state=n.failState,o;throw i?.thrown?i.error:n.thrown?n.error:this.raise(x.UnexpectedTokenAfterTypeParameter,a)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(10)){let s=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),i});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,r,i=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(x.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,r,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let i=this.startNodeAt(s);i.callee=e,i.arguments=super.parseCallExpressionArguments(),e=this.finishNode(i,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(43)){let i=this.state.clone(),a=this.tryParse(o=>this.parseAsyncArrowWithTypeParameters(s)||o(),i);if(!a.error&&!a.aborted)return a.node;let n=this.tryParse(()=>super.parseSubscripts(e,s,r),i);if(n.node&&!n.error)return n.node;if(a.node)return this.state=a.failState,a.node;if(n.node)return this.state=n.failState,n.node;throw a.error||n.error}return super.parseSubscripts(e,s,r)}parseSubscript(e,s,r,i){if(this.match(14)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();let a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),a.arguments=this.parseCallExpressionArguments(),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let a=this.startNodeAt(s);a.callee=e;let n=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),a.arguments=super.parseCallExpressionArguments(),i.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,i.optionalChainMember)));if(n.node)return n.error&&(this.state=n.failState),n.node}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(43)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let r=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(x.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(x.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let r=this.input.charCodeAt(s+e),i=this.input.charCodeAt(s+e+1);return r===58&&i===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:r===58&&i!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,s){this.raise(x.EnumBooleanMemberNotInitialized,e,s)}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?x.EnumInvalidMemberInitializerSymbolType:x.EnumInvalidMemberInitializerPrimaryType:x.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(x.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(x.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let r=this.parseNumericLiteral(this.state.value);if(s())return{type:"number",loc:r.start,value:r};break}case 130:{let r=this.parseStringLiteral(this.state.value);if(s())return{type:"string",loc:r.start,value:r};break}case 81:case 82:{let r=this.parseBooleanLiteral(this.match(81));if(s())return{type:"boolean",loc:r.start,value:r}}}return{type:"invalid",loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),r=this.eat(25)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:r}}flowEnumCheckExplicitTypeMismatch(e,s,r){let{explicitType:i}=s;i!==null&&i!==r&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let r=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(4);){if(this.eat(17)){a=!0;break}let n=this.startNode(),{id:o,init:l}=this.flowEnumMemberRaw(),h=o.name;if(h==="")continue;/^[a-z]/.test(h)&&this.raise(x.EnumInvalidMemberName,o,{memberName:h,suggestion:h[0].toUpperCase()+h.slice(1),enumName:e}),r.has(h)&&this.raise(x.EnumDuplicateMemberName,o,{memberName:h,enumName:e}),r.add(h);let u={enumName:e,explicitType:s,memberName:h};switch(n.id=o,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"boolean"),n.init=l.value,i.booleanMembers.push(this.finishNode(n,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"number"),n.init=l.value,i.numberMembers.push(this.finishNode(n,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,u,"string"),n.init=l.value,i.stringMembers.push(this.finishNode(n,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,u);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,u);break;default:i.defaultedMembers.push(this.finishNode(n,"EnumDefaultedMember"))}}this.match(4)||this.expect(8)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:r}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return s}else{for(let i of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!S(this.state.type))throw this.raise(x.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(x.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let r=s.name,i=s.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(2);let{members:n,hasUnknownMembers:o}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=o,a){case"boolean":return e.explicitType=!0,e.members=n.booleanMembers,this.expect(4),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=n.numberMembers,this.expect(4),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(4),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=n.defaultedMembers,this.expect(4),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(4),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let h=n.booleanMembers.length,u=n.numberMembers.length,d=n.stringMembers.length,y=n.defaultedMembers.length;if(!h&&!u&&!d&&!y)return l();if(!h&&!u)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(4),this.finishNode(e,"EnumStringBody");if(!u&&!d&&h>=y){for(let g of n.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(g.start,{enumName:r,memberName:g.id.name});return e.members=n.booleanMembers,this.expect(4),this.finishNode(e,"EnumBooleanBody")}else if(!h&&!d&&u>=y){for(let g of n.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(g.start,{enumName:r,memberName:g.id.name});return e.members=n.numberMembers,this.expect(4),this.finishNode(e,"EnumNumberBody")}else return this.raise(x.EnumInconsistentMemberValues,i,{enumName:r}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(this.state.pos-=1,this.readToken_lt()):e===44&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},ar=/\r\n|[\r\n\u2028\u2029]/,he=new RegExp(ar.source,"g");function G(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function at(t,e,s){for(let r=e;r<s;r++)if(G(t.charCodeAt(r)))return!0;return!1}var Ee=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ce=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function nr(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var or={AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:e})=>`Unexpected token \`${t}\`. Did you mean \`${e}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"},R=F`jsx`(or);function V(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function X(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return X(t.object)+"."+X(t.property);throw new Error("Node had unexpected type: "+t.type)}var lr=t=>class extends t{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(R.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:this.raise(R.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:r===125?"&rbrace;":"&gt;"});default:G(r)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
4
+ `:`\r
5
+ `):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(p.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):G(i)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}s+=this.input.slice(r,this.state.pos++),this.finishToken(130,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(r){this.input.slice(e,this.state.pos);let i;++this.state.pos}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(q(e)||e===45);this.finishToken(136,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:qe(this.state.type)?e.name=$(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,s=this.jsxParseIdentifier();if(!this.eat(10))return s;let r=this.startNodeAt(e);return r.namespace=s,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(12);){let r=this.startNodeAt(e);r.object=s,r.property=this.jsxParseIdentifier(),s=this.finishNode(r,"JSXMemberExpression")}return s}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(E.brace),this.next(),e=this.jsxParseExpressionContainer(e,E.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(R.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(R.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(E.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,s){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();r.type==="SequenceExpression"&&!r.extra?.parenthesized&&this.raise(R.UnexpectedSequenceExpression,r.expressions[1]),e.expression=r}return this.setContext(s),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){if(this.match(2)){let s=this.startNode();return this.setContext(E.brace),this.next(),this.expect(17),s.argument=this.parseMaybeAssignAllowIn(),this.setContext(E.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(s,"JSXSpreadAttribute")}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute")}jsxParseOpeningElementAt(e){if(this.eat(139)){let r=this.startNodeAt(e);return this.finishNode(r,"JSXOpeningFragment")}let s=this.startNodeAt(e);return s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s)}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(52)&&!this.match(139);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){if(this.eat(139)){let r=this.startNodeAt(e);return this.finishNode(r,"JSXClosingFragment")}let s=this.startNodeAt(e);return s.name=this.jsxParseElementName(),this.expect(139),this.finishNode(s,"JSXClosingElement")}jsxParseElementAt(e){let s=this.startNodeAt(e),r=[],i=this.jsxParseOpeningElementAt(e),a=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 137:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 2:{let n=this.startNode();this.setContext(E.brace),this.next(),this.match(17)?r.push(this.jsxParseSpreadChild(n)):r.push(this.jsxParseExpressionContainer(n,E.j_expr));break}default:this.unexpected()}V(i)&&!V(a)&&a!==null?this.raise(R.MissingClosingTagFragment,a):!V(i)&&V(a)?this.raise(R.MissingClosingTagElement,a,{openingTagName:X(i.name)}):!V(i)&&!V(a)&&X(a.name)!==X(i.name)&&this.raise(R.MissingClosingTagElement,a,{openingTagName:X(i.name)})}if(V(i)?(s.openingFragment=i,s.closingFragment=a):(s.openingElement=i,s.closingElement=a),s.children=r,this.match(43))throw this.raise(R.UnwrappedAdjacentJSXElements,this.state.startLoc);return V(i)?this.finishNode(s,"JSXFragment"):this.finishNode(s,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:s}=this.state;s[s.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let s=this.curContext();if(s===E.j_expr){this.jsxReadToken();return}if(s===E.j_oTag||s===E.j_cTag){if(U(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&s===E.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:s,type:r}=this.state;if(r===52&&e===138)s.splice(-2,2,E.j_cTag),this.state.canStartJSXElement=!1;else if(r===138)s.push(E.j_oTag);else if(r===139){let i=s[s.length-1];i===E.j_oTag&&e===52||i===E.j_cTag?(s.pop(),this.state.canStartJSXElement=s[s.length-1]===E.j_expr):(this.setContext(E.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Ls(r)}},hr=class extends We{tsNames=new Map},pr=class extends Je{get inTSNamespace(){let t=this.scopeStack;return t.length>=2&&t[t.length-1].flags===0&&(t[t.length-2].flags&2048)>0}importsStack=[];createScope(t){return this.importsStack.push(new Set),new hr(t)}enter(t){t&3072&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t&3072&&this.importsStack.pop(),t}hasImport(t,e){let s=this.importsStack.length;if(this.importsStack[s-1].has(t))return!0;if(!e&&s>1){for(let r=0;r<s-1;r++)if(this.importsStack[r].has(t))return!0}return!1}declareName(t,e,s){if(e&4096){this.hasImport(t,!0)&&this.parser.raise(p.VarRedeclaration,s,{identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let r=this.currentScope(),i=r.tsNames.get(t)||0;if(e&1024){this.maybeExportDefined(r,t),r.tsNames.set(t,i|16);return}super.declareName(t,e,s),e&2&&(e&1||(this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t)),i=i|1),e&256&&(i=i|2),e&512&&(i=i|4),e&128&&(i=i|8),i&&r.tsNames.set(t,i)}isRedeclaredInScope(t,e,s){let r=t.tsNames.get(e);if((r&2)>0){if(s&256){let i=(s&512)>0,a=(r&4)>0;return i!==a}return!0}return s&128&&(r&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(r&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let r=s-1;r>=0;r--){let i=this.scopeStack[r].tsNames.get(e);if((i&1)>0||(i&16)>0)return}super.checkLocalExport(t)}},cr=class{sawUnambiguousESM=!1;ambiguousScriptDifferentAst=!1;sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let i of Object.keys(s))if(r?.[i]!==s[i])return!1;return!0}}getPluginOption(t,e){return this.plugins.get(t)?.[e]}};function Ut(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function ur(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function ne(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function z(t,e,s){let r=null,i=e.length;for(;r===null&&i>0;)r=e[--i];r===null||r.start>s.start?ne(t,s.comments):Ut(r,s.comments)}var dr=class extends cr{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let r=s-1,i=e[r];i.start===t.end&&(i.leadingNode=t,r--);let a=t.start;for(;r>=0;r--){let n=e[r],o=n.end;if(o>a)n.containingNode=t,this.finalizeComment(n),e.splice(r,1);else{o===a&&(n.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Ut(t.leadingNode,e),t.trailingNode!==null&&ur(t.trailingNode,e);else{let s=t.containingNode,r=t.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":z(s,s.properties,t);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":z(s,s.arguments,t);break;case"ImportExpression":z(s,[s.source,s.options??null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":z(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":z(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":z(s,s.specifiers,t);break;case"TSEnumBody":z(s,s.members,t);break;case"TSInterfaceBody":z(s,s.body,t);break;default:ne(s,e)}else ne(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let r=e[s-1];r.leadingNode===t&&(r.leadingNode=null)}takeSurroundingComments(t,e,s){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let n=r[a],o=n.end;if(n.start===s)n.leadingNode=t;else if(o===e)n.trailingNode=t;else if(o<e)break}}},mr=class Rt{flags=2048;get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}startIndex;curLine;lineStart;startLoc;endLoc;init({strictMode:e,sourceType:s,startIndex:r,startLine:i,startColumn:a}){this.strict=e===!1?!1:e===!0?!0:s==="module",this.startIndex=r,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new v(i,a,r)}errors=[];noArrowAt=[];noArrowParamsConversionAt=[];get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}labels=[];commentsLen=0;commentStack=[];pos=0;type=135;value=null;start=0;end=0;lastTokEndLoc=null;lastTokStartLoc=null;context=[E.brace];get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}firstInvalidTemplateEscapePos=null;get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}strictErrors=new Map;tokensLength=0;curPosition(){return new v(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let e=new Rt;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},fr=function(t){return t>=48&&t<=57},nt={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},pe={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function ot(t,e,s,r,i,a){let n=s,o=r,l=i,h="",u=null,d=s,{length:y}=e;for(;;){if(s>=y){a.unterminated(n,o,l),h+=e.slice(d,s);break}let g=e.charCodeAt(s);if(yr(t,g,e,s)){h+=e.slice(d,s);break}if(g===92){h+=e.slice(d,s);let w=xr(e,s,r,i,t==="template",a);w.ch===null&&!u?u={pos:s,lineStart:r,curLine:i}:h+=w.ch,{pos:s,lineStart:r,curLine:i}=w,d=s}else g===8232||g===8233?(++s,++i,r=s):g===10||g===13?t==="template"?(h+=e.slice(d,s)+`
6
+ `,++s,g===13&&e.charCodeAt(s)===10&&++s,++i,d=r=s):a.unterminated(n,o,l):++s}return{pos:s,str:h,firstInvalidLoc:u,lineStart:r,curLine:i}}function yr(t,e,s,r){return t==="template"?e===96||e===36&&s.charCodeAt(r+1)===123:e===(t==="double"?34:39)}function xr(t,e,s,r,i,a){let n=!i;e++;let o=h=>({pos:e,ch:h,lineStart:s,curLine:r}),l=t.charCodeAt(e++);switch(l){case 110:return o(`
7
+ `);case 114:return o("\r");case 120:{let h;return{code:h,pos:e}=Le(t,e,s,r,2,!1,n,a),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:e}=_t(t,e,s,r,n,a),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(e)===10&&++e;case 10:s=e,++r;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);a.strictNumericEscape(e-1,s,r);default:if(l>=48&&l<=55){let h=e-1,u=/^[0-7]+/.exec(t.slice(h,e+2))[0],d=parseInt(u,8);d>255&&(u=u.slice(0,-1),d=parseInt(u,8)),e+=u.length-1;let y=t.charCodeAt(e);if(u!=="0"||y===56||y===57){if(i)return o(null);a.strictNumericEscape(h,s,r)}return o(String.fromCharCode(d))}return o(String.fromCharCode(l))}}function Le(t,e,s,r,i,a,n,o){let l=e,h;return{n:h,pos:e}=jt(t,e,s,r,16,i,a,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(l,s,r):e=l-1),{code:h,pos:e}}function jt(t,e,s,r,i,a,n,o,l,h){let u=e,d=i===16?nt.hex:nt.decBinOct,y=i===16?pe.hex:i===10?pe.dec:i===8?pe.oct:pe.bin,g=!1,w=0;for(let N=0,C=a??1/0;N<C;++N){let I=t.charCodeAt(e),L;if(I===95&&o!=="bail"){let be=t.charCodeAt(e-1),Ae=t.charCodeAt(e+1);if(o){if(Number.isNaN(Ae)||!y(Ae)||d.has(be)||d.has(Ae)){if(h)return{n:null,pos:e};l.unexpectedNumericSeparator(e,s,r)}}else{if(h)return{n:null,pos:e};l.numericSeparatorInEscapeSequence(e,s,r)}++e;continue}if(I>=97?L=I-97+10:I>=65?L=I-65+10:fr(I)?L=I-48:L=1/0,L>=i){if(L<=9&&h)return{n:null,pos:e};if(L<=9&&l.invalidDigit(e,s,r,i))L=0;else if(n)L=0,g=!0;else break}++e,w=w*i+L}return e===u||a!=null&&e-u!==a||g?{n:null,pos:e}:{n:w,pos:e}}function _t(t,e,s,r,i,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=Le(t,e,s,r,t.indexOf("}",e)-e,!0,i,a),++e,o!==null&&o>1114111)if(i)a.invalidCodePoint(e,s,r);else return{code:null,pos:e}}else({code:o,pos:e}=Le(t,e,s,r,4,!1,i,a));return{code:o,pos:e}}function Z(t,e,s){return new v(s,t-e,t)}var Pr=new Set([103,109,115,105,121,117,100,118]),gr=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new xe(t.startLoc,t.endLoc)}},ce,Tr=class extends dr{isLookahead;tokens=[];constructor(t,e){super(),this.state=new mr,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1,(!ce||ce.length<(this.length+1)*2)&&(ce=new Uint32Array((this.length+1)*2)),this.locData=ce}setLoc(t){let e=this.offsetToSourcePos(t.index);this.locData[e*2]=t.line,this.locData[e*2+1]=t.column}getLoc(t){let e=this.offsetToSourcePos(t);return new v(this.locData[e*2],this.locData[e*2+1],t)}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new gr(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Ee.lastIndex=t,Ee.test(this.input)?Ee.lastIndex:t}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(t){return this.input.charCodeAt(this.nextTokenStartSince(t))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Ce.lastIndex=t,Ce.test(this.input)?Ce.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++t<this.input.length){let s=this.input.charCodeAt(t);(s&64512)===56320&&(e=65536+((e&1023)<<10)+(s&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,s])=>this.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,r=this.input.indexOf(t,s+2);if(r===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,he.lastIndex=s+2;he.test(this.input)&&he.lastIndex<=r;)++this.state.curLine,this.state.lineStart=he.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(s+2,r),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(r+t.length),loc:new xe(e,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!G(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:"CommentLine",value:this.input.slice(e+t,i),start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(i),loc:new xe(s,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let t=this.state.pos,e=this.optionFlags&8192?[]:null;e:for(;this.state.pos<this.length;){let s=this.input.charCodeAt(this.state.pos);switch(s){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),e?.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),e?.push(r));break}default:break e}break;default:if(nr(s))++this.state.pos;else if(s===45&&!this.inModule&&this.optionFlags&16384){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(t===0||this.state.lineStart>t)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),e?.push(i))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&16384){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let i=this.skipLineComment(4);i!==void 0&&(this.addComment(i),e?.push(i))}else break e}else break e}}if(e?.length>0){let s=this.state.pos,r={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(p.UnexpectedDigitAfterHash,this.state.curPosition());U(e)?(++this.state.pos,this.finishToken(134,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!G(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let s=this.input.slice(e+2,this.state.pos);return this.finishToken(24,s),!0}readToken_mult_modulo(t){let e=t===42?51:50,s=1,r=this.input.charCodeAt(this.state.pos+1);t===42&&r===42&&(s++,r=this.input.charCodeAt(this.state.pos+2),e=53),r===61&&!this.state.inType&&(s++,e=t===37?29:26),this.finishOp(e,s)}readToken_pipe_amp(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(t===124?37:38,2);return}if(t===124&&e===62){this.finishOp(35,2);return}if(e===61){this.finishOp(26,2);return}this.finishOp(t===124?39:41,1)}readToken_caret(){let t=this.input.charCodeAt(this.state.pos+1);t===61&&!this.state.inType?this.finishOp(28,2):t===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.finishOp(30,2);return}e===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===60){if(this.input.charCodeAt(t+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(e===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===62){let s=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+s)===61){this.finishOp(26,s+1);return}this.finishOp(48,s);return}if(e===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(t===61&&e===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(t===61?25:31,1)}readToken_question(){let t=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);t===63?e===61?this.finishOp(26,3):this.finishOp(36,2):t===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(U(t)){this.readWord(t);return}}throw this.raise(p.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(p.UnterminatedRegExp,D(t,1));let l=this.input.charCodeAt(i);if(G(l))throw this.raise(p.UnterminatedRegExp,D(t,1));if(s)s=!1;else{if(l===91)r=!0;else if(l===93&&r)r=!1;else if(l===47&&!r)break;s=l===92}}let a=this.input.slice(e,i);++i;let n="",o=()=>D(t,i+2-e);for(;i<this.length;){let l=this.codePointAtPos(i),h=String.fromCharCode(l);if(Pr.has(l))l===118?n.includes("u")&&this.raise(p.IncompatibleRegExpUVFlags,o()):l===117&&n.includes("v")&&this.raise(p.IncompatibleRegExpUVFlags,o()),n.includes(h)&&this.raise(p.DuplicateRegExpFlags,o());else if(q(l)||l===92)this.raise(p.MalformedRegExpFlags,o());else break;++i,n+=h}this.state.pos=i,this.finishToken(133,{pattern:a,flags:n})}readInt(t,e,s=!1,r=!0){let{n:i,pos:a}=jt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,s,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(t){let e=this.state.pos,s=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(t);if(i==null&&this.raise(p.InvalidDigit,D(s,2),{radix:t}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),U(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());if(r){let a=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(132,a);return}this.finishToken(131,i)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),r=!1,i=!1,a=!1;!t&&this.readInt(10)===null&&this.raise(p.InvalidNumber,this.state.curPosition());let n=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(n){let u=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(p.StrictOctalLiteral,s),!this.state.strict){let d=u.indexOf("_");d>0&&this.raise(p.ZeroDigitNumericSeparator,D(s,d))}a=n&&!/[89]/.test(u)}let o=this.input.charCodeAt(this.state.pos);o===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,o=this.input.charCodeAt(this.state.pos)),(o===69||o===101)&&!a&&(o=this.input.charCodeAt(++this.state.pos),(o===43||o===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(p.InvalidOrMissingExponent,s),r=!0,o=this.input.charCodeAt(this.state.pos));let l=J(0,this.input.slice(e,this.state.pos),"_","");if(o===110&&((r||n)&&this.raise(p.InvalidBigIntLiteral,s),++this.state.pos,i=!0),U(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,l);return}let h=a?parseInt(l,8):parseFloat(l);this.finishToken(131,h)}readCodePoint(t){let{code:e,pos:s}=_t(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:r,lineStart:i}=ot(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,e)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:r,curLine:i,lineStart:a}=ot("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,s&&(this.state.firstInvalidTemplateEscapePos=new v(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(r)===96?this.finishToken(20,s?null:t+e+"`"):(this.state.pos++,this.finishToken(21,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let i=this.codePointAtPos(this.state.pos);if(q(i))this.state.pos+=i<=65535?1:2;else if(i===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),n=this.state.pos===s?U:q;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(p.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let o=this.readCodePoint(!0);o!==null&&(n(o)||this.raise(p.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(o)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(t){let e=this.readWord1(t),s=Re.get(e);s!==void 0?this.finishToken(s,$(s)):this.finishToken(128,e)}checkKeywordEscapes(){let{type:t}=this.state;qe(t)&&this.state.containsEsc&&this.raise(p.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:$(t)})}raise(t,e,s={}){let r=e instanceof v?e:typeof e=="number"?this.getLoc(e):this.optionFlags&256?e.loc.start:this.getLoc(e.start),i=e instanceof v?r.index:typeof e=="number"?e:e.start,a=t(r,i,s);if(!(this.optionFlags&4096))throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(t,e,s={}){let r=e instanceof v?e:this.optionFlags&256?e.loc.start:this.getLoc(e.start),i=e instanceof v?r.index:e.start,a=this.state.errors;for(let n=a.length-1;n>=0;n--){let o=a[n];if(o.pos===i)return a[n]=t(r,i,s);if(o.pos<i)break}return this.raise(t,r,s)}updateContext(t){}unexpected(t,e){throw this.raise(p.UnexpectedToken,t??this.state.startLoc,{expected:e?$(e):null})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(p.MissingPlugin,e??this.state.startLoc,{missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,Z(e,s,r))}}errorHandlers_readInt={invalidDigit:(t,e,s,r)=>this.optionFlags&4096?(this.raise(p.InvalidDigit,Z(t,e,s),{radix:r}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)};errorHandlers_readCodePoint={...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)};errorHandlers_readStringContents_string={...this.errorHandlers_readCodePoint,strictNumericEscape:(t,e,s)=>{this.recordStrictModeErrors(p.StrictNumericEscape,Z(t,e,s))},unterminated:(t,e,s)=>{throw this.raise(p.UnterminatedString,Z(t-1,e,s))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(t,e,s)=>{throw this.raise(p.UnterminatedTemplate,Z(t,e,s))}}},br=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},Ar=class{parser;stack=[];constructor(t){this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new br)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,r):this.parser.raise(p.InvalidPrivateFieldResolution,r,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),n=r.has(t);if(e&3){let o=n&&i.get(t);if(o){let l=o&4,h=e&4,u=o&3,d=e&3;n=u===d||l!==h,n||i.delete(t)}else n||i.set(t,e)}n&&this.parser.raise(p.PrivateNameRedeclaration,s,{identifierName:t}),r.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(p.InvalidPrivateFieldResolution,e,{identifierName:t})}},Pe=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Vt=class extends Pe{declarationErrors=new Map;constructor(t){super(t)}recordDeclarationError(t,e){this.declarationErrors.set(e,t)}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},Sr=class{parser;stack=[new Pe];constructor(t){this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let{stack:s}=this,r=s.length-1,i=s[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,e);else return;i=s[--r]}this.parser.raise(t,e)}recordArrowParameterBindingError(t,e){let{stack:s}=this,r=s[s.length-1],i=e.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,i);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,r=e[s];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(p.AwaitBindingIdentifier,t),r=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors((s,r)=>{this.parser.raise(s,r);let i=t.length-2,a=t[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r),a=t[--i]})}};function Er(){return new Pe(3)}function Cr(){return new Vt(1)}function Ir(){return new Vt(2)}function zt(){return new Pe}var wr=class{stacks=[];enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return(this.currentFlags()&16)===0}};function me(t,e){return(t?2:0)|(e?1:0)}var Nr=class extends Tr{addExtra(t,e,s,r=!0){if(!t)return;let{extra:i}=t;i==null&&(i={},t.extra=i),r?i[e]=s:Object.defineProperty(i,e,{enumerable:r,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){if(this.input.startsWith(e,t)){let s=this.input.charCodeAt(t+e.length);return!(q(s)||(s&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return at(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return at(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(9))||this.raise(p.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let r=t((i=null)=>{throw s.node=i,s});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:n}=t,o=!!s||!!r||!!a||!!i||!!n;if(!e)return o;s!=null&&this.raise(p.InvalidCoverInitializedName,s),r!=null&&this.raise(p.DuplicateProto,r),i!=null&&this.raise(p.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),n!=null&&this.raise(p.InvalidCoverDiscardElement,n)}isLiteralPropertyName(){return kt(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let n=this.prodParam;this.prodParam=new wr;let o=this.classScope;this.classScope=new Ar(this);let l=this.expressionScope;return this.expressionScope=new Sr(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=r,this.scope=i,this.prodParam=n,this.classScope=o,this.expressionScope=l}}enterInitialScopes(){let t=0;(this.inModule||this.optionFlags&1)&&(t|=2),this.optionFlags&32&&(t|=1);let e=!this.inModule&&this.options.sourceType==="commonjs";(e||this.optionFlags&2)&&(t|=4),this.prodParam.enter(t);let s=e?514:1;this.optionFlags&4&&(s|=512),this.optionFlags&16&&(s|=48),this.scope.enter(s)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},fe=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},se=class{constructor(t,e,s,r){this.start=s,this.end=0,r!==void 0&&(this.loc=new xe(r)),t&128&&(this.range=[s,0]),r!==void 0&&e&&(this.loc.filename=e)}type=""},lt=se.prototype,kr=class extends Nr{createPosition(t){return t}startNode(){let{startLoc:t}=this.state;return this.setLoc(t),this.startNodeAt(t)}startNodeAt(t){let{optionFlags:e,filename:s}=this;return e&256?new se(e,s,t.index,this.createPosition(t)):new se(e,s,t.index)}startNodeAtNode(t){let{optionFlags:e,filename:s}=this;return e&256?new se(e,s,t.start,t.loc.start):new se(e,s,t.start)}finishNode(t,e){return this.finishNodeAt(t,e,this.state.lastTokEndLoc)}finishNodeAt(t,e,s){t.type=e,t.end=s.index;let{optionFlags:r}=this;return r&256&&(t.loc.end=this.createPosition(s)),r&128&&(t.range[1]=s.index),r&8192&&this.processComment(t),t}finishNodeAtNode(t,e,s){t.type=e,t.end=s.end;let{optionFlags:r}=this;return r&256&&(t.loc.end=s.loc.end),r&128&&(t.range[1]=t.end),r&8192&&this.processComment(t),t}resetStartLocation(t,e){t.start=e.index;let{optionFlags:s}=this;s&256&&(t.loc.start=this.createPosition(e)),s&128&&(t.range[0]=e.index)}resetEndLocation(t,e=this.state.lastTokEndLoc){t.end=e.index;let{optionFlags:s}=this;s&256&&(t.loc.end=this.createPosition(e)),s&128&&(t.range[1]=e.index)}resetStartLocationFromNode(t,e){t.start=e.start;let{optionFlags:s}=this;s&256&&(t.loc.start=e.loc.start),s&128&&(t.range[0]=e.start)}resetEndLocationFromNode(t,e){t.end=e.end;let{optionFlags:s}=this;s&256&&(t.loc.end=e.loc.end),s&128&&(t.range[1]=e.end)}castNodeTo(t,e){return t.type=e,t}cloneIdentifier(t){let{type:e,start:s,end:r,loc:i,range:a,name:n}=t,o=Object.create(lt);return o.type=e,o.start=s,o.end=r,o.loc=i,o.range=a,o.name=n,t.extra&&(o.extra=t.extra),o}cloneStringLiteral(t){let{type:e,start:s,end:r,loc:i,range:a,extra:n}=t,o=Object.create(lt);return o.type=e,o.start=s,o.end=r,o.loc=i,o.range=a,o.extra=n,o.value=t.value,o}},Me=t=>t.type==="ParenthesizedExpression"?Me(t.expression):t,vr=class extends kr{toAssignable(t,e=!1){let s;switch((t.type==="ParenthesizedExpression"||t.extra?.parenthesized)&&(s=Me(t),e?s.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):s.type!=="CallExpression"&&s.type!=="MemberExpression"&&!this.isOptionalMemberExpression(s)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let r=0,i=t.properties.length,a=i-1;r<i;r++){let n=t.properties[r],o=r===a;this.toAssignableObjectExpressionProp(n,o,e),o&&n.type==="RestElement"&&t.extra?.trailingCommaLoc&&this.raise(p.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:r,value:i}=t;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.start),this.toAssignable(i,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(t,"ArrayPattern"),this.toAssignableList(t.elements,t.extra?.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(p.MissingEqInAssignment,this.optionFlags&256?t.left.loc.end:t.left),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(p.VoidPatternInitializer,t.left),this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(s,e);break}}toAssignableObjectExpressionProp(t,e,s){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?p.PatternHasAccessor:p.PatternHasMethod,t.key);else if(t.type==="SpreadElement"){this.castNodeTo(t,"RestElement");let r=t.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,s),e||this.raise(p.RestTrailingComma,t)}else this.toAssignable(t,s)}toAssignableList(t,e,s){let r=t.length-1;for(let i=0;i<=r;i++){let a=t[i];a&&(this.toAssignableListItem(t,i,s),a.type==="RestElement"&&(i<r?this.raise(p.RestTrailingComma,a):e&&this.raise(p.RestTrailingComma,e)))}}toAssignableListItem(t,e,s){let r=t[e];if(r.type==="SpreadElement"){this.castNodeTo(r,"RestElement");let i=r.argument;this.checkToRestConversion(i,!0),this.toAssignable(i,s)}else this.toAssignable(r,s)}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let s=t.properties.length-1;return t.properties.every((r,i)=>r.type!=="ObjectMethod"&&(i===s||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();this.next();let e=this.parseBindingAtom();return e.type==="VoidPattern"&&this.raise(p.UnexpectedVoidPattern,e),t.argument=e,this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(1,93,1),this.finishNode(t,"ArrayPattern")}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(t,e,s){let r=s&1,i=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else{if(this.eat(t))break;if(this.match(17)){let n=this.parseRestBinding();if(s&2&&(n=this.parseFunctionParamType(n)),i.push(n),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let n=[];if(s&2)for(this.match(22)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)n.push(this.parseDecorator());i.push(this.parseBindingElement(s,n))}}return i}parseBindingRestProperty(t){return this.next(),this.hasPlugin("discardBinding")&&this.match(84)?(t.argument=this.parseVoidPattern(null),this.raise(p.UnexpectedVoidPattern,t.argument)):t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===17)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===134?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseBindingElement(t,e){let{startLoc:s}=this.state,r=this.parseMaybeDefault();return t&2&&this.parseFunctionParamType(r),e.length&&(r.decorators=e,this.resetStartLocationFromNode(r,e[0])),this.parseMaybeDefault(s,r)}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){if(t??(t=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(25))return e;let s=this.startNodeAt(t);return e.type==="VoidPattern"&&this.raise(p.VoidPatternInitializer,e),s.left=e,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(t,e,s,r){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!e&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,r=!1,i=!1,a=!1,n=!1){let o=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||o==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.start),e.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,s,i);let{name:N}=t;r&&(r.has(N)?this.raise(p.ParamDupe,t):r.add(N));return}else o==="VoidPattern"&&e.type==="CatchClause"&&this.raise(p.VoidPatternCatchClauseParam,t);let h=Me(t);n||(n=h.type==="CallExpression"&&(h.callee.type==="Import"||h.callee.type==="Super"));let u=this.isValidLVal(o,n,!(a||t.extra?.parenthesized)&&e.type==="AssignmentExpression",s);if(u===!0)return;if(u===!1){let N=s===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(N,t,{ancestor:e});return}let d,y;typeof u=="string"?(d=u,y=o==="ParenthesizedExpression"):[d,y]=u;let g=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:e,w=t[d];if(Array.isArray(w))for(let N of w)N&&this.checkLVal(N,g,s,r,i,y,!0);else w&&this.checkLVal(w,g,s,r,i,y,n)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Bt(t.name,this.inModule):Ft(t.name))&&(e===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(8)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}},Lr=class extends vr{checkProto(t,e,s){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return e;let r=t.key;return(r.type==="Identifier"?r.name:r.value)==="__proto__"?(e&&(s?s.doubleProtoLoc===null&&(s.doubleProtoLoc=this.getLoc(r.start)):this.raise(p.DuplicateProto,r)),!0):e}shouldExitDescending(t){return t.type==="ArrowFunctionExpression"&&!t.extra?.parenthesized}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(p.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(135))throw this.raise(p.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&512&&(t.tokens=Ht(this.tokens)),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(8)){let r=this.startNodeAt(e);for(r.expressions=[s];this.eat(8);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let n=this.parseYield(s);return e&&(n=e.call(this,n,s)),n}let i;t?i=!1:(t=new fe,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),Ms(this.state.type)){let n=this.startNodeAt(s),o=this.state.value;if(n.operator=o,this.match(25)){this.toAssignable(a,!0),n.left=a;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=l&&(t.voidPatternLoc=null)}else n.left=a;return this.next(),n.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(n,"AssignmentExpression"),void 0,void 0,void 0,void 0,o==="||="||o==="&&="||o==="??="),n}else i&&this.checkExpressionErrors(t,!0);if(r){let{type:n}=this.state;if((this.hasPlugin("v8intrinsic")?te(n):te(n)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.YieldNotInGeneratorFunction,s),this.parseYield(s)}return a}parseMaybeConditional(t){let e=this.state.startLoc,s=this.parseExprOps(t);return this.shouldExitDescending(s)?s:this.parseConditional(s,e,t)}parseConditional(t,e,s){if(this.eat(13)){let r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(s)?s:(this.state.canStartArrow=!1,this.parseExprOp(s,e,-1))}parseExprOp(t,e,s){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(s>=de(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(p.PrivateInExpectedIn,e,{identifierName:i}),this.classScope.usePrivateName(i,e)}let r=this.state.type;if(rt(r)&&(this.prodParam.hasIn||!this.match(54))){let i=de(r);if(i>s){if(r===35&&(this.expectPlugin("pipelineOperator"),this.prodParam.inFSharpPipelineDirectBody))return t;let a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;let n=r===37||r===38,o=r===36;o&&(i=de(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let l=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),h=this.state.type;if(o&&(h===37||h===38)||n&&h===36)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){switch(t){case 35:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.parseFSharpPipelineBody(e)}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,Rs(t)?e-1:e)}parseHackPipeBody(){let{startLoc:t}=this.state,e=this.parseMaybeAssign();return bs.has(e.type)&&!e.extra?.parenthesized&&this.raise(p.PipeUnparenthesizedBody,t,{type:e.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,t),e}checkExponentialAfterUnary(t){this.match(53)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let o=this.parseAwait(s);return e||this.checkExponentialAfterUnary(o),o}let i=this.match(30),a=this.startNode();if(Fs(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin("throwExpressions");let o=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&o){let l=a.argument;l.type==="Identifier"?this.raise(p.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(p.DeletePrivateField,a)}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let n=this.parseUpdate(a,i,t);if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?te(o):te(o)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.AwaitNotInAsyncContext,s),this.parseAwait(s)}return n}parseUpdate(t,e,s){if(e){let a=this.finishNode(t,"UpdateExpression");return this.checkLVal(a.argument,a),a}let r=this.state.startLoc,i=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return i;for(;Os(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(a,"UpdateExpression"))}return i}parseExprSubscripts(t){let e=this.state.startLoc;this.setLoc(e);let s=this.parseExprAtom(t);return this.shouldExitDescending(s)?s:this.parseSubscripts(s,e)}parseSubscripts(t,e,s){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,s,r){let{type:i}=this.state;if(!s&&i===11)return this.parseBind(t,e,r);if(ke(i))return this.parseTaggedTemplateExpression(t,e,r);let a=!1;if(i===14){if(s&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,r);r.optionalChainMember=a=!0,this.next()}if(!s&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(t,e,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(t,e,r,n,a):this.stopParseSubscript(t,r)}}stopParseSubscript(t,e){return e.stop=!0,t}parseMember(t,e,s,r,i){let a=this.startNodeAt(e);return a.object=t,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(t.type==="Super"&&this.raise(p.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s){let r=this.startNodeAt(e);r.object=t,this.next();let i=this.match(79),a=this.parseNoCallExpr();if(a.type==="Super"||i&&a.type==="ImportExpression"||a.type==="Import")throw this.raise(p.UnsupportedBindRHS,a);return r.callee=a,s.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,!1)}parseCoverCallAndAsyncArrowHead(t,e,s,r){let i=null;this.next();let a=this.startNodeAt(e);a.callee=t;let{maybeAsyncArrow:n,optionalChainMember:o}=s;n&&(this.expressionScope.enter(Ir()),i=new fe),o&&(a.optional=r),r?a.arguments=this.parseCallExpressionArguments():a.arguments=this.parseCallExpressionArguments(t.type!=="Super",a,i);let l=this.finishCallExpression(a,o);return n&&this.shouldParseAsyncArrow()&&!r?(s.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),l=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),l)):(n&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),l}parseTaggedTemplateExpression(t,e,s){let r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(p.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.state.canStartArrow}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){e&&this.addTrailingCommaExtraToNode(e),this.next();break}r.push(this.parseExprListItem(7,!1,s,t))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){return this.resetPreviousNodeTrailingComments(e),this.expect(15),this.parseArrowExpression(t,e.arguments,!0,e.extra?.trailingCommaLoc),e.innerComments&&ne(t,e.innerComments),e.callee.trailingComments&&ne(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return e=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(e):this.match(6)?this.optionFlags&1024?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 74:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,t);case 2:return this.parseObjectLike(4,!1,t);case 64:return this.parseFunctionOrFunctionSent();case 22:s=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{e=this.startNode(),this.next(),e.object=null;let i=e.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(p.UnsupportedBind,i)}case 134:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,"%");case 28:return this.parseTopicReferenceThenEqualsSign(40,"^");case 33:case 34:return this.parseTopicReference("hack");case 40:case 50:case 23:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);throw this.unexpected()}case 43:{let i=this.input.codePointAt(this.nextTokenStart());throw U(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(S(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:i,containsEsc:a}=this.state,n=this.parseIdentifier();if(!a&&n.name==="async"&&!this.canInsertSemicolon()){let{type:o}=this.state;if(o===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(S(o))return i&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(o===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return i&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=D(this.state.endLoc,-1),this.parseTopicReference(s);throw this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,s,t,r)}finishTopicReference(t,e,s,r){if(this.testTopicReferenceConfiguration(s,e,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(p.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference");throw this.raise(p.PipeTopicUnconfiguredToken,e,{token:$(r)})}testTopicReferenceConfiguration(t,e,s){if(t==="hack")return this.hasPlugin(["pipelineOperator",{topicToken:$(s)}]);throw this.raise(p.PipeTopicRequiresHackPipes,e)}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(me(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(p.SuperNotAllowed,t):this.scope.allowSuper||this.raise(p.UnexpectedSuper,t),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(p.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(D(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(99)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||r)&&this.raise(p.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(101)||this.isContextual(93)){let e=this.isContextual(101);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(p.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){let e;try{e=BigInt(t)}catch{e=null}return this.parseLiteral(e,"BigIntLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Cr());let r=this.state.startLoc,i=[],a=new fe,n=!0,o,l;for(;!this.match(7);){if(n)n=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){l=this.state.startLoc;break}if(this.match(17)){let d=this.state.startLoc;if(o=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),d)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,this.parseParenItem))}let h=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(e);return t&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),l&&this.unexpected(l),o&&this.unexpected(o),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(s=this.startNodeAt(r),s.expressions=i,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,h)):s=i[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&2048))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(15))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(12)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return this.scope.allowNewTarget||this.raise(p.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(6)){let e=this.parseExprList(7);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(79),s=this.parseNoCallExpr();t.callee=s,e&&s.type==="ImportExpression"&&this.raise(p.ImportCallNotNewExpression,s,s),s.type==="Import"&&this.raise(p.ImportCallNotNewExpression,s),s.type==="Super"&&this.raise(p.SuperCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:r,value:i}=this.state,a=e+1,n=this.startNodeAt(D(s,1));i===null&&(t||this.raise(p.InvalidEscapeSequenceTemplate,D(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(20),l=o?-1:-2,h=r+l;n.value={raw:this.input.slice(a,h).replace(/\r\n?/g,`
8
+ `),cooked:i===null?null:i.slice(1,l)},n.tail=o,this.next();let u=this.finishNode(n,"TemplateElement");return this.resetEndLocation(u,D(this.state.lastTokEndLoc,l)),u}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),r=[s],i=[];for(;!s.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(s=this.parseTemplateElement(t));return e.expressions=i,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(t);){if(i)i=!1;else if(this.expect(8),this.match(t)){this.addTrailingCommaExtraToNode(a);break}let o;e?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(s),r=this.checkProto(o,r,s)),a.properties.push(o)}this.next();let n=e?"ObjectPattern":"ObjectExpression";return this.finishNode(a,n)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(t){let e=[];if(this.match(22))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());let s=this.startNode(),r=!1,i=!1,a;if(this.match(17))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e),s.method=!1,t&&(a=this.state.startLoc);let n=this.eat(51);this.parsePropertyNamePrefixOperator(s);let o=this.state.containsEsc;if(this.parsePropertyName(s,t),!n&&!o&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,h=l.name;h==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(l),n=this.eat(51),this.parsePropertyName(s)),(h==="get"||h==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),s.kind=h,this.match(51)&&(n=!0,this.raise(p.AccessorIsGenerator,this.state.curPosition(),{kind:h}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,n,r,!1,i,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){let e=this.getGetterSetterExpectedParamCount(t),s=this.getObjectOrClassMethodParams(t);s.length!==e&&this.raise(t.kind==="get"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&s[s.length-1]?.type==="RestElement"&&this.raise(p.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,r,i){if(i){let a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(6))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r){if(t.shorthand=!1,this.eat(10))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.start,!0,!1),s)t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key));else if(this.match(25)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(p.InvalidCoverInitializedName,i),t.value=this.parseMaybeDefault(e,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,e,s,r,i,a,n){let o=this.parseObjectMethod(t,s,r,i,a)||this.parseObjectProperty(t,e,i,n);return o||this.unexpected(),o}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:s,value:r}=this.state,i;if(B(s))i=this.parseIdentifier(!0);else switch(s){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(p.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:this.unexpected()}t.key=i,s!==134&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,r,i,a,n=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(530|(n?576:0)|(i?32:0)),this.prodParam.enter(me(s,t.generator)),this.parseFunctionParams(t,r);let o=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(t,e){let s=this.startNode();return this.next(),s.elements=this.parseExprList(t,!0,e,s),this.finishNode(s,"ArrayExpression")}parseArrowExpression(t,e,s,r){this.scope.enter(518);let i=me(s,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(t,s),e&&this.setArrowFunctionParameters(t,e,r),this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let r=e&&!this.match(2);if(this.expressionScope.enter(zt()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,n=>{let o=!this.isSimpleParamList(t.params);n&&o&&this.raise(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?this.optionFlags&256?t.key.loc.end:t.key:t);let l=!i&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!o,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e<s;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,s,r=!0){let i=!e&&new Set,a={type:"FormalParameters"};for(let n of t.params)this.checkLVal(n,a,5,i,r)}parseExprList(t,e,s,r){let i=[],a=!0;for(;!this.eat(t);){if(a)a=!1;else if(this.expect(8),this.match(t)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(t,e,s))}return i}parseExprListItem(t,e,s,r){let i;if(this.match(8))e||this.raise(p.UnexpectedToken,this.state.curPosition(),{unexpected:","}),i=null;else if(this.match(17)){let a=this.state.startLoc;i=this.parseParenItem(this.parseSpread(s),a)}else if(this.match(13)){this.expectPlugin("partialApplication"),r||this.raise(p.UnexpectedArgumentPlaceholder,this.state.startLoc);let a=this.startNode();this.next(),i=this.finishNode(a,"ArgumentPlaceholder")}else i=this.parseMaybeAssignAllowInOrVoidPattern(t,s,this.parseParenItem);return i}parseIdentifier(t){let e=this.startNode(),s=this.parseIdentifierName(t);return this.createIdentifier(e,s)}createIdentifier(t,e){return t.name=e,this.optionFlags&256&&(t.loc.identifierName=e),this.finishNode(t,"Identifier")}createIdentifierAt(t,e,s){return t.name=e,this.optionFlags&256&&(t.loc.identifierName=e),this.finishNodeAt(t,"Identifier",s)}parseIdentifierName(t){let e,{start:s,type:r}=this.state;B(r)?e=this.state.value:this.unexpected();let i=vs(r);return t?i&&this.replaceToken(128):this.checkReservedWord(e,this.sourceToOffsetPos(s),i,!1),this.next(),e}checkReservedWord(t,e,s,r){if(!(t.length>10||!Xs(t))){if(s&&Ks(t)){this.raise(p.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?Bt:Ot:Dt)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,e);return}}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t,e){let s=t.index;this.setLoc(t);let r=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,s),this.eat(51)&&this.raise(p.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),e||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===49||t===6||t===0||ke(t)||t===98&&!this.state.containsEsc||t===133||t===52||this.hasPlugin("v8intrinsic")&&t===50}parseYield(t){this.setLoc(t);let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(p.YieldInParameter,t.index);let s=!1,r=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!s)break;default:r=this.parseMaybeAssign()}return e.delegate=s,e.argument=r,this.finishNode(e,"YieldExpression")}parseImportCall(t){this.next();let e=this.parseCallExpressionArguments();if(e.length===0||e.length>2)this.raise(p.ImportCallArity,t,t);else for(let s of e)s.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,s,t);return t.source=e[0],t.options=e[1]??null,this.finishNode(t,"ImportExpression")}withTopicBindingContext(t){let e=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let s=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return t()}finally{this.state.inHackPipelineBody=e,this.state.seenTopicReference=s}}allowInAnd(t){let e=this.prodParam.currentFlags();if(24&~e){this.prodParam.enter(e|8|16);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags(),s=8&e,r=16&~e;if(s||r){this.prodParam.enter(e&-9|16);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let s;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),s=this.parseAwait(e,!0);let r=this.state.type;rt(r)&&r!==35&&(this.prodParam.hasIn||r!==54)&&this.raise(p.PipelineUnparenthesized,e)}else this.state.canStartArrow=!0,s=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.prodParam.exit(),s}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,4,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parseVoidPattern(t){this.expectPlugin("discardBinding");let e=this.startNode();return t!=null&&(t.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(e,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(t,e,s){if(e!=null&&this.match(84)){let r=this.lookaheadCharCode();if(r===44||r===(t===1?93:t===4?125:41)||r===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(e))}return this.parseMaybeAssignAllowIn(e,s)}parsePropertyNamePrefixOperator(t){}},Ie={kind:1},Mr={kind:2},Dr=/[\uD800-\uDFFF]/u,we=/in(?:stanceof)?/y;function Ht(t){for(let e=0;e<t.length;e++){let s=t[e],{type:r}=s;typeof r=="number"&&(s.type=vt(r))}return t}var Or=class extends Lr{parseTopLevel(t,e){return t.program=this.parseProgram(e,135,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&512&&(t.tokens=Ht(this.tokens)),this.finishNode(t,"File")}parseProgram(t,e,s){if(t.sourceType=s,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(p.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===135?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",D(this.state.startLoc,-1)),r}stmtToDirective(t){let e=this.castNodeTo(t,"Directive"),s=this.castNodeTo(t.expression,"DirectiveLiteral"),r=s.value,i=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),a=s.value=i.slice(1,-1);return this.addExtra(s,"raw",i),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",r),e.value=s,delete t.expression,e}parseInterpreterDirective(){if(!this.match(24))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);if(this.isUnparsedContextual(t,"of")){let s=this.lookaheadCharCodeSince(t+2);if(s!==61&&s!==58&&s!==59)return!1}return!!(this.chStartsBindingIdentifier(e,t)||this.isUnparsedContextual(t,"void"))}nextTokenIsIdentifierOnSameLine(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}isAwaitUsing(){if(!this.isContextual(92))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return!0}return!1}chStartsBindingIdentifier(t,e){if(U(t)){if(we.lastIndex=e,we.test(this.input)){let s=this.codePointAtPos(we.lastIndex);if(!q(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(22)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,r=this.startNode(),i=!!(t&2),a=!!(t&4),n=t&1;switch(s){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,r):this.raise(p.UnexpectedLexicalDeclaration,r):this.raise(p.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 96:{if(this.state.containsEsc)break;let h=this.nextTokenStart(),u=this.codePointAtPos(h);if(u!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,h)&&u!==123))break}case 71:i||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let h=this.state.value;return this.parseVarStatement(r,h)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let h=this.lookaheadCharCode();if(h===40||h===46)break}case 78:{!(this.optionFlags&8)&&!n&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let h;return s===79?h=this.parseImport(r):h=this.parseExport(r,e),this.assertModuleNodeAllowed(h),h}default:if(this.isAsyncFunction())return i||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let o=this.state.value,l=this.parseExpression();return S(s)&&l.type==="Identifier"&&this.eat(10)?this.parseLabeledStatement(r,o,l,t):this.parseExpressionStatement(r,l,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}maybeTakeDecorators(t,e,s){return t&&(e.decorators?.length?(this.raise(p.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(22));if(this.match(78))t||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(p.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(6)){let r=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(7),s=this.wrapParenthesis(r,s);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,r),t.expression!==s&&this.raise(p.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(12);){let r=this.startNodeAt(e);r.object=s,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,s=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else this.state.canStartArrow=!1,t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(6)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;s<this.state.labels.length;++s){let r=this.state.labels[s];if((t.label==null||r.name===t.label.name)&&(r.kind!=null&&(e||r.kind===1)||t.label&&e))break}if(s===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(p.IllegalBreakContinue,t,{type:r})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(6);let t=this.parseExpression();return this.expect(7),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(Ie),t.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),t.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(Ie);let e=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(96);{let o=this.isAwaitUsing(),l=o||this.isForUsing(),h=s&&this.hasFollowingBindingAtom()||l;if(this.match(70)||this.match(71)||h){let u=this.startNode(),d;o?(d="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(u,!0,d);let y=this.finishNode(u,"VariableDeclaration"),g=this.match(54);return g&&l&&this.raise(p.ForInUsing,y),(g||this.isContextual(98))&&y.declarations.length===1?this.parseForIn(t,y,e):(e!==null&&this.unexpected(e),this.parseFor(t,y))}}let r=this.isContextual(91),i=new fe,a=this.parseExpression(!0,i),n=this.isContextual(98);if(n&&(s&&this.raise(p.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(p.ForOfAsync,a)),n||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let o=n?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:o}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(p.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(2),this.state.labels.push(Mr),this.scope.enter(256);let s;for(let r;!this.match(4);)if(this.match(57)||this.match(61)){let i=this.match(57);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),i?s.test=this.parseExpression():(r&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,s.test=null),this.expect(10)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(p.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(58)){let e=this.startNode();this.next(),this.match(6)?(this.expect(6),e.param=this.parseCatchClauseParam(),this.expect(7)):(e.param=null,this.scope.enter(0)),e.body=this.parseBlock(!1,!1),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(63)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(Ie),t.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.parseStatement(),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,r){for(let a of this.state.labels)a.name===e&&this.raise(p.LabelRedeclaration,s,{labelName:e});let i=Ds(this.state.type)?1:this.match(67)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let n=this.state.labels[a];if(n.statementStart===t.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(2),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,4,s),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,r,i){let a=t.body=[],n=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?n:void 0,s,r,i)}parseBlockOrModuleBlockBody(t,e,s,r,i){let a=this.state.strict,n=!1,o=!1;for(;!this.match(r);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!o){if(this.isValidDirective(l)){let h=this.stmtToDirective(l);e.push(h),!n&&h.value.value==="use strict"&&(n=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}t.push(l)}i?.call(this,n),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(7)?null:this.parseExpression(),this.expect(7),t.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let r=this.match(54);return this.next(),r?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(p.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),t.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,r=!1){let i=t.declarations=[];for(t.kind=s;;){let a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(25)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(54)||this.isContextual(98)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(54)||this.isContextual(98))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(8))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();e==="using"||e==="await using"?(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,s):s.type==="VoidPattern"&&this.raise(p.UnexpectedVoidPattern,s),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,r=!!(e&1),i=r&&!(e&4),a=!!(e&8);return this.initFunction(t,a),this.match(51)&&(s&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(me(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression"),this.prodParam.exit(),this.scope.exit(),r&&!s&&this.registerFunctionStatementId(t),t}parseFunctionId(t){return t||S(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(6),this.expressionScope.enter(Er()),t.params=this.parseBindingList(7,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.start)}parseClass(t,e,s){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,s)}if(this.state.strict=e,this.next(),r.length)throw this.raise(p.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=s,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=s,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(2)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,r)}parseClassMemberWithIsStatic(t,e,s,r){let i=e,a=e,n=e,o=e,l=e,h=i,u=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(51)){h.kind="method";let C=this.match(134);if(this.parseClassElementName(h),this.parsePostMemberNameModifiers(h),C){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&S(this.state.type),y=this.parseClassElementName(e),g=d?y.name:null,w=this.isPrivateName(y),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(h.kind="method",w){this.pushClassPrivateMethod(t,a,!1,!1);return}let C=this.isNonstaticConstructor(i),I=!1;C&&(i.kind="constructor",i.decorators&&i.decorators.length>0&&this.raise(p.DecoratorConstructor,e),s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,y),C&&this.hasPlugin("typescript")&&e.override&&this.raise(p.OverrideOnConstructor,y),s.hadConstructor=!0,I=s.hadSuperClass),this.pushClassMethod(t,i,!1,!1,C,I)}else if(this.isClassProperty())w?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(g==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(y);let C=this.eat(51);u.optional&&this.unexpected(N),h.kind="method";let I=this.match(134);this.parseClassElementName(h),this.parsePostMemberNameModifiers(u),I?this.pushClassPrivateMethod(t,a,C,!0):(this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,C,!0,!1,!1))}else if((g==="get"||g==="set")&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(y),h.kind=g;let C=this.match(134);this.parseClassElementName(i),C?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(g==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(y);let C=this.match(134);this.parseClassElementName(n),this.pushClassAccessorProperty(t,l,C)}else this.isLineTerminator()?w?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===128||e===130)&&t.static&&s==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),e===134){s==="constructor"&&this.raise(p.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){this.scope.enter(720);let s=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=s,t.body.push(this.finishNode(e,"StaticBlock")),e.decorators?.length&&this.raise(p.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(p.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);t.body.push(r),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(t,e,s,r,i,a){t.body.push(this.parseMethod(e,s,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,r){let i=this.parseMethod(e,s,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(592),this.expressionScope.enter(zt()),this.prodParam.enter(0),t.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,r=8331){if(S(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){this.eat(77)?(this.state.canStartArrow=!1,t.superClass=this.parseExprSubscripts()):t.superClass=null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,s),i=!r||this.eat(8),a=i&&this.eatExportStar(t),n=a&&this.maybeParseExportNamespaceSpecifier(t),o=i&&(!n||this.eat(8)),l=r||a;if(a&&!n){if(r&&this.unexpected(),e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let h=this.maybeParseExportNamedSpecifiers(t);r&&i&&!a&&!h&&this.unexpected(null,2),n&&o&&this.unexpected(null,94);let u;if(l||h){if(u=!1,e)throw this.raise(p.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else u=this.maybeParseExportDeclaration(t);if(l||h||u){let d=t;if(this.checkExport(d,!0,!1,!!d.source),d.declaration?.type==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(61)){let d=t,y=this.parseExportDefaultExpression();if(d.declaration=y,y.type==="ClassDeclaration")this.maybeTakeDecorators(e,y,d);else if(e)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(d,"ExportDefaultDeclaration")}throw this.unexpected(null,2)}eatExportStar(t){return this.eat(51)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.start);let s=e||this.parseIdentifier(!0),r=this.startNodeAtNode(s);return r.exported=s,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(89)){t.specifiers??(t.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(2)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(64))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(76))return this.parseClass(t,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(S(t)){if(t===91&&!this.state.containsEsc||t===96)return!1;if((t===126||t===125)&&!this.state.containsEsc){let r=this.nextTokenStart(),i=this.input.charCodeAt(r);if(i===123||this.chStartsBindingIdentifier(i,r)&&!this.input.startsWith("from",r))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(61))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||S(this.state.type)&&s)return!0;if(this.match(61)&&s){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(94)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===22&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?!0:this.isUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):t===70||t===71||t===64||t===76||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,r){if(e){if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){let i=t.declaration;i.type==="Identifier"&&i.name==="from"&&i.end-i.start===4&&!i.extra?.parenthesized&&this.raise(p.ExportDefaultFromAsIdentifier,i)}}else if(t.specifiers?.length)for(let i of t.specifiers){let{exported:a}=i,n=a.type==="Identifier"?a.name:a.value;if(this.checkDuplicateExports(i,n),!r&&i.local){let{local:o}=i;o.type!=="Identifier"?this.raise(p.ExportBindingIsString,i,{localName:o.value,exportName:n}):(this.checkReservedWord(o.name,o.start,!0,!1),this.scope.checkLocalExport(o))}}else if(t.declaration){let i=t.declaration;if(i.type==="FunctionDeclaration"||i.type==="ClassDeclaration"){let{id:a}=i;if(!a)throw new Error("Assertion failure");this.checkDuplicateExports(t,a.name)}else if(i.type==="VariableDeclaration")for(let a of i.declarations)this.checkDeclaration(a.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(2);!this.eat(4);){if(s)s=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,t,r))}return e}parseExportSpecifier(t,e,s,r){return this.eatContextual(89)?t.exported=this.parseModuleExportName():e?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(130)){let t=this.parseStringLiteral(this.state.value),e=Dr.exec(t.value);return e&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}checkImportPhase(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;t.phase==="source"?s!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,e[0]):t.phase==="defer"&&s!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,e[0])}isPotentialImportPhase(t){return t?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(t,e,s,r){e||(s==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(B(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(t,e,r,s.start),null):(this.applyImportPhase(t,e,null),this.createIdentifier(s,r))}isPrecedingIdImportPhase(t){let{type:e}=this.state;return S(e)?e!==94||this.lookaheadCharCode()===102:e!==8}parseImport(t){return this.match(130)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(8),r=s&&this.maybeParseStarImportSpecifier(t);return s&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(94),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){return t.specifiers??(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportPhase(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(2);let t=[],e=new Set;do{if(this.match(4))break;let s=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(130)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(8));return this.expect(4),t}maybeParseImportAttributes(t){let e;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),e=this.parseImportAttributes()}else e=[];t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(B(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(51)){let e=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(2);!this.eat(4);){if(e)e=!1;else{if(this.eat(10))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let s=this.startNode(),r=this.match(130),i=this.isContextual(126);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",i,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,r,i){if(this.eatContextual(89))t.local=this.parseIdentifier();else{let{imported:a}=t;if(e)throw this.raise(p.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.start,!0,!0),t.local||(t.local=this.cloneIdentifier(a))}return this.finishImportSpecifier(t,"ImportSpecifier",i)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Ne=/in(?:stanceof)?|as|satisfies/y;function Fr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function ht(t){if(!t)throw new Error("Assert fail")}var Br={AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"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:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DecoratorAbstractMethod:({kind:t})=>`Decorators can't be used with ${t.startsWith("a")?"an":"a"} ${t}.`,DuplicateAccessibilityModifier:({modifier:t})=>`Accessibility modifier already seen: '${t}'.`,DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' 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.",ExportAssignmentInTSNamespace:"An export assignment cannot be used in a namespace.",ExportInTSNamespace:"Export declarations are not permitted in a namespace.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportInTSNamespace:"Import declarations in a namespace cannot reference a module.",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,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.",InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:t})=>`'${t}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:t=>`'${t}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:t=>`'${t}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[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.",NamespaceExportInTSNamespace:"Global module exports may only appear at top level.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'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:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,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.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",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.",UnexpectedParameterInitializer:"A parameter initializer is only allowed in a function or constructor implementation.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnexpectedTypeDeclaration:t=>`'${t}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`,UsingDeclarationInAmbientContext:t=>`'${t}' declarations are not allowed in ambient contexts.`},m=F`typescript`(Br);function Ur(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}}function pt(t){return t==="private"||t==="public"||t==="protected"}function Rr(t){return t==="in"||t==="out"}function De(t){if(t.extra?.parenthesized)return!1;switch(t.type){case"Identifier":return!0;case"MemberExpression":return!t.computed&&De(t.object);case"TSInstantiationExpression":return De(t.expression);default:return!1}}var jr=t=>class extends t{getScopeHandler(){return pr}tsIsIdentifier(){return S(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s,r){if(!S(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let i=this.state.value;if(e.includes(i)){if(r&&this.match(102)||s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:r,errorTemplate:i=m.InvalidModifierOnTypeMember},a){let n=(l,h,u,d)=>{h===u&&a[d]&&this.raise(m.InvalidModifiersOrder,l,{orderedModifiers:[u,d]})},o=(l,h,u,d)=>{(a[u]&&h===d||a[d]&&h===u)&&this.raise(m.IncompatibleModifiers,l,{modifiers:[u,d]})};for(;;){let{startLoc:l}=this.state,h=this.tsParseModifier(e.concat(s??[]),r,a.static);if(!h)break;pt(h)?a.accessibility?this.raise(m.DuplicateAccessibilityModifier,l,{modifier:h}):(n(l,h,h,"override"),n(l,h,h,"static"),n(l,h,h,"readonly"),a.accessibility=h):Rr(h)?(a[h]&&this.raise(m.DuplicateModifier,l,{modifier:h}),a[h]=!0,n(l,h,"in","out")):(Ue(a,h)?this.raise(m.DuplicateModifier,l,{modifier:h}):(n(l,h,"static","readonly"),n(l,h,"static","override"),n(l,h,"override","readonly"),n(l,h,"abstract","override"),o(l,h,"declare","override"),o(l,h,"static","abstract")),a[h]=!0),s?.includes(h)&&this.raise(i,l,{modifier:h})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(4);case"HeritageClauseElement":return this.match(2);case"TupleElementTypes":return this.match(1);case"TypeParametersOrArguments":return this.match(44)}}tsParseList(e,s){let r=[];for(;!this.tsIsListTerminator(e);)r.push(s());return r}tsParseDelimitedList(e,s,r){return Fr(this.tsParseDelimitedListWorker(e,s,!0,r))}tsParseDelimitedListWorker(e,s,r,i){let a=[],n=-1;for(;!this.tsIsListTerminator(e);){n=-1;let o=s();if(o==null)return;if(a.push(o),this.eat(8)){n=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(8);return}return i&&(i.value=n),a}tsParseBracketedList(e,s,r,i,a){i||(r?this.expect(0):this.expect(43));let n=this.tsParseDelimitedList(e,s,a);return r?this.expect(1):this.expect(44),n}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(m.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),this.eat(8)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let s=this.startNode();return this.isContextual(72)?(s.method=!1,s.key=this.parseIdentifier(!0),s.computed=!1,s.shorthand=!1):this.unexpected(null,72),this.expect(10),s.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(s)],this.eat(8),this.expect(4),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),s=[];for(this.expect(2);!this.match(4);){let r=this.state.type;S(r)||r===130?s.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=s,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let s;if(e&1&&this.match(74))if(e&2)s=this.parseIdentifier(!0);else{let r=this.startNode();this.next(),s=this.finishNode(r,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let r=this.startNodeAtNode(s);r.left=s,r.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(r,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),this.match(79)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:m.InvalidModifierOnTypeParameter});tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:m.InvalidModifierOnTypeParameterPositions});tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:m.InvalidModifierOnTypeParameter});tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(77),s.default=this.tsEatThenParseType(25),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let r={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),s.params.length===0&&this.raise(m.EmptyTypeParameters,s),r.value!==-1&&this.addExtra(s,"trailingComma",r.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let r=e===15,i="params",a="returnType";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),s[i]=this.tsParseBindingListForSignature(),r?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let s of e){let{type:r}=s;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(m.UnsupportedSignatureParameterKind,s,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,s){return this.tsFillSignature(10,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),S(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(1),e.parameters=[s];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){s&&this.raise(m.ReadonlyForMethodSignature,e);let r=e;if(r.kind&&this.match(43)&&this.raise(m.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,r),this.tsParseTypeMemberSemicolon(),r.kind==="get")r.params.length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(r.params[0])&&this.raise(m.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r.params.length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let i=r.params[0];this.isThisParam(i)&&this.raise(m.AccessorCannotDeclareThisParameter,this.state.curPosition()),i.type==="Identifier"&&i.optional&&this.raise(m.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),i.type==="RestElement"&&this.raise(m.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r.returnType&&this.raise(m.SetAccessorCannotHaveReturnType,r.returnType)}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{let r=e;s&&(r.readonly=!0);let i=this.tsTryParseTypeAnnotation();return i&&(r.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(73)){let r=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(r=>{let{type:i}=r;s&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&r.optional)&&this.raise(m.OptionalTypeBeforeRequired,r),s||(s=i==="TSNamedTupleMember"&&r.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(17),{startLoc:r}=this.state,i,a,n,o,l=B(this.state.type)?this.lookaheadCharCode():null;if(l===58)i=!0,n=!1,a=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(l===63){n=!0;let h=this.state.value,u=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(i=!0,a=this.createIdentifier(this.startNodeAt(r),h),this.expect(13),this.expect(10),o=this.tsParseType()):(i=!1,o=u,this.expect(13))}else o=this.tsParseType(),n=this.eat(13),i=this.eat(10);if(i){let h;a?(h=this.startNodeAt(r),h.optional=n,h.label=a,h.elementType=o,this.eat(13)&&(h.optional=!0,this.raise(m.TupleOptionalAfterType,this.state.lastTokStartLoc))):(h=this.startNodeAt(r),h.optional=n,this.raise(m.InvalidTupleMemberLabel,o),h.label=o,h.elementType=this.tsParseType()),o=this.finishNode(h,"TSNamedTupleMember")}else if(n){let h=this.startNodeAt(r);h.typeAnnotation=o,o=this.finishNode(h,"TSOptionalType")}if(s){let h=this.startNodeAt(e);h.typeAnnotation=o,o=this.finishNode(h,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.state.startLoc,s=this.parseTemplateElement(!1),r=[s];if(s.tail){let i=this.startNodeAt(e),a=this.startNodeAt(e);return a.expressions=[],a.quasis=r,i.literal=this.finishNode(a,"TemplateLiteral"),this.finishNode(i,"TSLiteralType")}else{let i=[];for(;!s.tail;)i.push(this.tsParseType()),this.readTemplateContinuation(),r.push(s=this.parseTemplateElement(!1));let a=this.startNodeAt(e);return a.types=i,a.quasis=r,this.finishNode(a,"TSTemplateLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==131&&s.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let s=this.tsParseType();return this.expect(7),this.addExtra(s,"parenthesized",!0),this.addExtra(s,"parenStart",e.index),s}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(S(e)||e===84||e===80){let s=e===84?"TSVoidKeyword":e===80?"TSNullKeyword":Ur(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,s)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let r=this.startNodeAt(e);r.elementType=s,this.expect(1),s=this.finishNode(r,"TSArrayType")}else{let r=this.startNodeAt(e);r.objectType=s,r.indexType=this.tsParseType(),this.expect(1),s=this.finishNode(r,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(m.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return Bs(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,r){let i=this.startNode(),a=this.eat(r),n=[];do n.push(s());while(this.eat(r));return n.length===1&&!a?n[0]:(i.types=n,this.finishNode(i,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(S(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(4,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(1,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let r=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(74)){let o=this.tsParseThisTypeOrThisTypePredicate();return o.type==="TSThisType"?(r.parameterName=o,r.asserts=!0,r.typeAnnotation=null,o=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(o,r),o.asserts=!0),s.typeAnnotation=o,this.finishNode(s,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(r.parameterName=this.parseIdentifier(),r.asserts=i,r.typeAnnotation=null,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let n=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=n,r.asserts=i,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!S(this.state.type)&&!this.match(74)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){ht(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(73)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(m.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=(this.state.canStartArrow=!1,super.parseExprSubscripts());De(i)||this.raise(m.InvalidHeritageClauseType,i.start,{token:e});let a=e==="extends"?"TSInterfaceHeritage":"TSClassImplements";if(i.type==="TSInstantiationExpression")return i.type=a,i;let n=this.startNodeAtNode(i);return n.expression=i,(this.match(43)||this.match(47))&&(n.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(n,a)});return r.length||this.raise(m.EmptyHeritageClauseType,s,{token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),s.declare&&(e.declare=!0),S(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(m.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==E.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(e){let s=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(s.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(s,"TSModuleBlock")}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type==="Identifier"&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){let s=this.isContextual(108);return s?(e.kind="global",e.id=this.parseIdentifier()):(e.kind="module",e.id=super.parseStringLiteral(this.state.value)),this.match(2)?(s||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(s),this.prodParam.exit(),s||this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s){e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(m.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),r=e();return this.state=s,r}tsTryParseAndCatch(e){let s=this.tryParse(r=>e()||r());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type;return this.tsInAmbientContext(()=>{switch(s){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(m.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 92:if(this.isAwaitUsing())return this.raise(m.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 125:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(S(s))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,s,r,i){switch(s){case 120:if(this.tsCheckLineTerminator(r)&&(this.match(76)||S(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case 123:if(this.tsCheckLineTerminator(r))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(r)&&S(this.state.type))return e.kind="namespace",this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(r)&&S(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(43))return;let s=this.tsTryParseAndCatch(()=>{let r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),r});if(s)return super.parseArrowExpression(s,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(m.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===E.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Us(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,s){let r=s.length?null:this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,n=i.override,o=i.readonly;!(e&4)&&(a||o||n)&&this.raise(m.UnexpectedParameterModifier,r||s[0]);let l=this.state.startLoc,h=this.parseMaybeDefault(l);e&2&&this.parseFunctionParamType(h);let u=this.parseMaybeDefault(l,h);if(a||o||n){let d=r?this.startNodeAt(r):this.startNodeAtNode(s[0]);return s.length?d.decorators=s:this.setLoc(r),a&&(d.accessibility=a),o&&(d.readonly=o),n&&(d.override=n),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(m.UnsupportedParameterPropertyKind,r||s[0]),d.parameter=u,this.finishNode(d,"TSParameterProperty")}return s.length&&(h.decorators=s),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(m.PatternIsOptional,s)}setArrowFunctionParameters(e,s,r){super.setArrowFunctionParameters(e,s,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,r=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let i=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;if(i&&!this.match(2)&&this.isLineTerminator()){if(i==="TSDeclareMethod"&&e.kind==="constructor")for(let a of e.params)a.type==="TSParameterProperty"?this.raise(m.UnexpectedParameterModifier,a):a.type==="AssignmentPattern"&&this.raise(m.UnexpectedParameterInitializer,a);else for(let a of e.params)a.type==="AssignmentPattern"&&this.raise(m.UnexpectedParameterInitializer,a);return this.finishNode(e,i)}return i&&this.state.isAmbientContext&&(this.raise(m.DeclareFunctionHasImplementation,this.state.startLoc),i==="TSDeclareFunction"&&e.declare)?super.parseFunctionBodyAndFinish(e,i,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{s?.type==="TSTypeCastExpression"&&this.raise(m.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s){let r=super.parseArrayLike(e,s);return r.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(r.elements),r}parseSubscript(e,s,r,i){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(s);return n.expression=e,this.finishNode(n,"TSNonNullExpression")}let a=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(r)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(43)||this.match(47)){let n,o=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let d=this.tsTryParseGenericAsyncArrowFunction(s);if(d)return i.stop=!0,d}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(a&&!this.match(6)){n=this.state.curPosition();return}if(ke(this.state.type)){let d=super.parseTaggedTemplateExpression(e,s,i);return d.typeArguments=l,d}if(!r&&this.eat(6)){let d=this.startNodeAt(s);return d.callee=e,d.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(d.arguments),d.typeArguments=l,i.optionalChainMember&&(d.optional=a),this.finishCallExpression(d,i.optionalChainMember)}let h=this.state.type;if(h===44||h===48||h!==6&&h!==89&&h!==116&&te(h)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(s);return u.expression=e,u.typeArguments=l,this.finishNode(u,"TSInstantiationExpression")});if(n&&this.unexpected(n,6),o)return o.type==="TSInstantiationExpression"&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(m.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,i))),o}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){super.parseNewCallee(e);let{callee:s}=e;s.type==="TSInstantiationExpression"&&!s.extra?.parenthesized&&(e.typeArguments=s.typeArguments,e.callee=s.expression)}parseExprOp(e,s,r){let i;if(de(54)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(i=this.isContextual(116)))){let a=this.startNodeAt(s);a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(i&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType()));let n=this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression");return this.reScan_lt_gt(),this.parseExprOp(n,s,r)}return super.parseExprOp(e,s,r)}checkReservedWord(e,s,r,i){this.state.isAmbientContext||super.checkReservedWord(e,s,r,i)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(83)}applyImportPhase(e,s,r,i){super.applyImportPhase(e,s,r,i),s?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(130))return e.importKind="value",this.scope.inTSNamespace&&this.raise(m.ImportInTSNamespace,e),super.parseImport(e);let s;if(S(this.state.type)&&this.lookaheadCharCode()===61){e.importKind="value";let r=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&r.moduleReference.type==="TSExternalModuleReference"&&this.raise(m.ImportInTSNamespace,e),r}else if(this.isContextual(126)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(m.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,r);s=super.parseImportSpecifiersAndAfter(e,r)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"?this.raise(m.TypeImportCannotSpecifyDefaultAndNamed,s):this.scope.inTSNamespace&&this.raise(m.ImportInTSNamespace,s),s}parseExport(e,s){if(this.match(79)){let r=this.startNode();this.next();let i=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?i=this.parseMaybeImportPhase(r,!1):r.importKind="value";let a=this.tsParseImportEqualsDeclaration(r,i);return e.attributes=[],e.declaration=a,e.exportKind="value",e.source=null,e.specifiers=[],this.finishNode(e,"ExportNamedDeclaration")}else if(this.eat(25)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(m.ExportAssignmentInTSNamespace,r),this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(89)){let r=e;return this.expectContextual(124),r.id=this.parseIdentifier(),this.checkIdentifier(r.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(m.NamespaceExportInTSNamespace,r),this.finishNode(r,"TSNamespaceExportDeclaration")}else{let r=super.parseExport(e,s);return this.scope.inTSNamespace&&(r.type!=="ExportNamedDeclaration"||r.source||!r.declaration&&!this.state.isAmbientContext)&&this.raise(m.ExportInTSNamespace,r),r}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,r=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,s,r||i);if(!i)return a;if(!e.declare&&(s==="using"||s==="await using"))return this.raiseOverwrite(m.UsingDeclarationInAmbientContext,e,s),a;for(let{id:n,init:o}of a.declarations)o&&(s==="var"||s==="let"||n.typeAnnotation?this.raise(m.InitializerNotAllowedInAmbientContext,o):Vr(o,this.hasPlugin("estree"))||this.raise(m.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,o));return a}parseStatementContent(e,s){let r=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:{if(this.isLookaheadContextual("enum")){let i=this.startNode();return this.next(),this.tsParseEnumDeclaration(i,{const:!0})}break}case 120:case 121:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,a=this.startNode();this.next();let n=i===121?this.tsTryParseDeclare(a):this.tsParseAbstractDeclaration(a,s);return n?(i===121&&(n.declare=!0),n):(a.expression=this.createIdentifier(this.startNodeAtNode(a),i===121?"declare":"abstract"),this.semicolon(!1),this.finishNode(a,"ExpressionStatement"))}break}case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:{if(this.lookaheadCharCode()===123){let i=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(i)}break}case 125:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return r||this.raise(m.UnexpectedTypeDeclaration,i,"interface"),i;break}case 123:{if(this.nextTokenIsStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,123,!1,s)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(m.InlineModuleDeclarationMustUseString,this.state.startLoc);let i=this.startNode();return this.next(),this.tsParseDeclaration(i,124,!1,s)}break}case 124:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,124,!1,s)}break}case 126:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return r||this.raise(m.UnexpectedTypeDeclaration,i,"type"),this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(r=>pt(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:m.InvalidModifierOnTypeParameterPositions},s);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,i)&&this.raise(m.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(a):a(),s.decorators&&s.decorators.length>0&&!this.hasPlugin("decorators-legacy")&&(s.type==="TSAbstractMethodDefinition"||s.type==="TSDeclareMethod"?this.raise(m.DecoratorAbstractMethod,s,{kind:"abstract method"}):(s.type==="ClassProperty"&&s.abstract||s.type==="ClassProperty"&&s.declare||s.type==="TSAbstractPropertyDefinition"||s.type==="PropertyDefinition"&&s.declare)&&this.raise(m.DecoratorAbstractMethod,s,{kind:s.declare?"declare field":"abstract field"}))}parseClassMemberWithIsStatic(e,s,r,i){let a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(m.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(m.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(m.IndexSignatureHasDeclare,s),s.override&&this.raise(m.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(m.NonAbstractClassHasAbstractMethod,s),s.override&&(r.hadSuperClass||this.raise(m.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,r,i)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(m.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(m.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,r){if(!this.match(13))return e;if(r!=null){let n=this.lookaheadCharCode();if(n===44||n===61||n===58||n===41)return this.setOptionalParametersError(r),e}this.next();let i=this.startNodeAt(s);i.test=e;let a=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,i.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=a,this.expect(10),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(13)&&(r.optional=!0,this.resetEndLocation(e)),this.match(10)){let i=this.startNodeAt(s);return i.expression=e,i.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(i,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,r=this.eatContextual(121);if(r&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(m.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let i=S(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return i?((i.type==="TSInterfaceDeclaration"||i.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&i.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(i,s),i.declare=!0),i):null}parseClassId(e,s,r,i){if((!s||r)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,s,r,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(25)&&this.raise(m.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:s}=e;this.raise(m.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(m.PrivateElementHasAbstract,e),e.accessibility&&this.raise(m.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(m.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,i,a,n){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&a&&this.raise(m.ConstructorHasTypeParameters,o);let{declare:l=!1,kind:h}=s;l&&(h==="get"||h==="set")&&this.raise(m.DeclareAccessor,s,{kind:h}),o&&(s.typeParameters=o),super.pushClassMethod(e,s,r,i,a,n)}pushClassPrivateMethod(e,s,r,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,r,i)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type==="TSInstantiationExpression"){let s=e.superClass,r=s.expression;this.takeSurroundingComments(r,r.start,r.end);let i=s.typeArguments;this.takeSurroundingComments(i,i.start,i.end),e.superClass=r,e.superTypeArguments=i}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression());this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,r,i,a,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,r,i,a,n,o)}parseFunctionParams(e,s){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){let r,i,a;if(this.hasPlugin("jsx")&&(this.match(138)||this.match(43))){if(r=this.state.clone(),i=this.tryParse(()=>super.parseMaybeAssign(e,s),r),!i.error)return i.node;let{context:l}=this.state,h=l[l.length-1];(h===E.j_oTag||h===E.j_expr)&&l.pop()}if(!i?.error&&!this.match(43))return super.parseMaybeAssign(e,s);(!r||r===this.state)&&(r=this.state.clone());let n,o=this.tryParse(l=>{n=this.tsParseTypeParameters(this.tsParseConstModifier);let h=super.parseMaybeAssign(e,s);if((h.type!=="ArrowFunctionExpression"||h.extra?.parenthesized)&&l(),n?.params.length!==0&&this.resetStartLocationFromNode(h,n),h.typeParameters=n,this.hasPlugin("jsx")&&h.typeParameters.params.length===1&&!h.typeParameters.extra?.trailingComma){let u=h.typeParameters.params[0];u.constraint||this.raise(m.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?D(u.loc.end,1):u,{typeParameterName:u.name.name})}return h},r);if(!o.error&&!o.aborted)return n&&this.reportReservedArrowTypeParam(n),o.node;if(!i&&(ht(!this.hasPlugin("jsx")),a=this.tryParse(()=>super.parseMaybeAssign(e,s),r),!a.error))return a.node;if(i?.node)return this.state=i.failState,i.node;if(o.node)return this.state=o.failState,n&&this.reportReservedArrowTypeParam(n),o.node;if(a?.node)return this.state=a.failState,a.node;throw i?.error||o.error||a?.error}reportReservedArrowTypeParam(e){e.params.length===1&&!e.params[0].constraint&&!e.extra?.trailingComma&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(m.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(10)){let s=this.tryParse(r=>{let i=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&r(),i});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(m.UnexpectedTypeCastInParameter,e):this.raise(m.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,r,i){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(i!==64||!r)&&["expression",!0];default:return super.isValidLVal(e,s,r,i)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(43)||this.match(47)){let r=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let i=super.parseMaybeDecoratorArguments(e,s);return i.typeArguments=r,i}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(m.TypeAnnotationAfterAssign,r.typeAnnotation),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(this.state.pos-=1,this.readToken_lt()):e===44&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,s,r){let i=e[s];i.type==="TSTypeCastExpression"&&(e[s]=this.typeCastToParameter(i)),super.toAssignableListItem(e,s,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(s=>this.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let s=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let r=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=s,r}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeArguments=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=r}}parseClass(e,s,r){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,r)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,s){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(m.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,s,r,i,a,n,o){let l=super.parseMethod(e,s,r,i,a,n,o);if((l.abstract||l.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?l.value:l).body){let{key:h}=l;this.raise(m.AbstractMethodHasImplementation,l,{methodName:h.type==="Identifier"&&!l.computed?h.name:`[${this.input.slice(this.offsetToSourcePos(h.start),this.offsetToSourcePos(h.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,r,i){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,i))}parseImportSpecifier(e,s,r,i,a){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,i,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,r){let i=s?"imported":"local",a=s?"local":"exported",n=e[i],o,l=!1,h=!0,u=n.start;if(this.isContextual(89)){let y=this.parseIdentifier();if(this.isContextual(89)){let g=this.parseIdentifier();B(this.state.type)?(l=!0,n=y,o=s?this.parseIdentifier():this.parseModuleExportName(),h=!1):(o=g,h=!1)}else B(this.state.type)?(h=!1,o=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,n=y)}else B(this.state.type)&&(l=!0,s?(n=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(n.name,n.start,!0,!0)):n=this.parseModuleExportName());l&&r&&this.raise(s?m.TypeModifierIsUsedInTypeImports:m.TypeModifierIsUsedInTypeExports,u),e[i]=n,e[a]=o;let d=s?"importKind":"exportKind";e[d]=l?"type":"value",h&&this.eatContextual(89)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=this.cloneIdentifier(e[i])),s&&this.checkIdentifier(e[a],l?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case"ExpressionStatement":e.directive??(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":e.decorators??(e.decorators=[]),e.optional??(e.optional=!1),e.typeAnnotation??(e.typeAnnotation=void 0);return;case"TSParameterProperty":e.accessibility??(e.accessibility=void 0),e.decorators??(e.decorators=[]),e.override??(e.override=!1),e.readonly??(e.readonly=!1),e.static??(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":e.declare??(e.declare=!1),e.returnType??(e.returnType=void 0),e.typeParameters??(e.typeParameters=void 0);return;case"Property":e.optional??(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":e.optional??(e.optional=!1);case"TSIndexSignature":e.accessibility??(e.accessibility=void 0),e.readonly??(e.readonly=!1),e.static??(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":e.declare??(e.declare=!1),e.definite??(e.definite=!1),e.readonly??(e.readonly=!1),e.typeAnnotation??(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":e.accessibility??(e.accessibility=void 0),e.decorators??(e.decorators=[]),e.override??(e.override=!1),e.optional??(e.optional=!1);return;case"ClassExpression":e.id??(e.id=null);case"ClassDeclaration":e.abstract??(e.abstract=!1),e.declare??(e.declare=!1),e.decorators??(e.decorators=[]),e.implements??(e.implements=[]),e.superTypeArguments??(e.superTypeArguments=void 0),e.typeParameters??(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":e.declare??(e.declare=!1);return;case"VariableDeclarator":e.definite??(e.definite=!1);return;case"TSEnumDeclaration":e.const??(e.const=!1),e.declare??(e.declare=!1);return;case"TSEnumMember":e.computed??(e.computed=!1);return;case"TSImportType":e.qualifier??(e.qualifier=null),e.options??(e.options=null),e.typeArguments??(e.typeArguments=null);return;case"TSInterfaceDeclaration":e.declare??(e.declare=!1),e.extends??(e.extends=[]);return;case"TSMappedType":e.optional??(e.optional=!1),e.readonly??(e.readonly=void 0);return;case"TSModuleDeclaration":e.declare??(e.declare=!1),e.global??(e.global=e.kind==="global");return;case"TSTypeParameter":e.const??(e.const=!1),e.in??(e.in=!1),e.out??(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,s){if(U(e)){if(Ne.lastIndex=s,Ne.test(this.input)){let r=this.codePointAtPos(Ne.lastIndex);if(!q(r)&&r!==92)return!1}return!0}else return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),s=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(s,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),s=this.codePointAtPos(e);return s===34||s===39}};function _r(t){if(t.type!=="MemberExpression")return!1;let{computed:e,property:s}=t;return e&&s.type!=="StringLiteral"&&(s.type!=="TemplateLiteral"||s.expressions.length>0)?!1:qt(t.object)}function Vr(t,e){let{type:s}=t;if(t.extra?.parenthesized)return!1;if(e){if(s==="Literal"){let{value:r}=t;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!($t(t,e)||zr(t,e)||s==="TemplateLiteral"&&t.expressions.length===0||_r(t))}function $t(t,e){return e?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function zr(t,e){if(t.type==="UnaryExpression"){let{operator:s,argument:r}=t;if(s==="-"&&$t(r,e))return!0}return!1}function qt(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:qt(t.object)}var Hr={ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."},ct=F`placeholders`(Hr),$r=t=>class extends t{parsePlaceholder(e){if(this.match(129)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=s,r}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,r,i){e!==void 0&&super.checkReservedWord(e,s,r,i)}cloneIdentifier(e){let s=super.cloneIdentifier(e);return s.type==="Placeholder"&&(s.expectedNode=e.expectedNode),s}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,r,i){return e==="Placeholder"||super.isValidLVal(e,s,r,i)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){if(super.chStartsBindingIdentifier(e,s))return!0;let r=this.nextTokenStart();return this.input.charCodeAt(r)===37&&this.input.charCodeAt(r+1)===37}verifyBreakContinue(e,s){e.label?.type!=="Placeholder"&&super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){if(s.type!=="Placeholder"||s.extra?.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(10)){let i=e;return i.label=this.finishPlaceholder(s,"Identifier"),this.next(),i.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(i,"LabeledStatement")}this.semicolon();let r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,r){let i=s?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,n=this.parsePlaceholder("Identifier");if(n)if(this.match(77)||this.match(129)||this.match(2))e.id=n;else{if(r||!s)return e.id=null,e.body=this.finishPlaceholder(n,"ClassBody"),this.finishNode(e,i);throw this.raise(ct.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,s){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,s);let i=e;if(!this.isContextual(94)&&!this.match(8))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,i.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(i,s)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith($(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){return e.specifiers?.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s?.length&&(e.specifiers=s.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(s);return r.local=s,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(ct.UnexpectedSpace,this.state.lastTokEndLoc)}},qr=t=>class extends t{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,s=this.startNode();if(this.next(),S(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(s,r);if(this.castNodeTo(i,"V8IntrinsicIdentifier"),this.match(6))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},ut=["fsharp","hack"],dt=["^^","@@","^","%","#"];function Kr(t){if(t.has("decorators")&&t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");if(t.has("flow")&&t.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(t.has("placeholders")&&t.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(t.has("pipelineOperator")){let e=t.get("pipelineOperator").proposal;if(!ut.includes(e)){let s=ut.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${s}.`)}if(e==="hack"){if(t.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(t.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let s=t.get("pipelineOperator").topicToken;if(!dt.includes(s)){let r=dt.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}}}if(t.has("moduleAttributes"))throw new Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(t.has("importAssertions"))throw new Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(t.has("deprecatedImportAssert")?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):t.has("importAttributes")&&t.get("importAttributes").deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),t.has("recordAndTuple"))throw new Error("The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.");if(t.has("asyncDoExpressions")&&!t.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(t.has("optionalChainingAssign")&&t.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(t.has("discardBinding")&&t.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.");if(t.has("decimal"))throw new Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");if(t.has("importReflection"))throw new Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.")}var Kt={estree:ws,jsx:lr,flow:ir,typescript:jr,v8intrinsic:qr,placeholders:$r},Wr=Object.keys(Kt),Wt=class extends Or{constructor(t,e,s){let r=Is(t);super(r,e),this.options=r,this.initializeScopes(),this.plugins=s,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return Je}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();this.nextToken(),t.errors=[];let s=this.parseTopLevel(t,e);return s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function Jt(t,e){if(e?.sourceType==="unambiguous"){e={...e};try{e.sourceType="module";let s=re(e,t),r=s.parse();if(s.sawUnambiguousESM)return r;if(s.ambiguousScriptDifferentAst)try{return e.sourceType="script",re(e,t).parse()}catch{}else r.program.sourceType="script";return r}catch(s){try{return e.sourceType="script",re(e,t).parse()}catch{}throw s}}else return re(e,t).parse()}function Xt(t,e){let s=re(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function Jr(t){let e={};for(let s of Object.keys(t))e[s]=vt(t[s]);return e}Jr(ks);function re(t,e){let s=Wt,r=new Map;if(t?.plugins){for(let i of t.plugins){let a,n;typeof i=="string"?a=i:[a,n]=i,r.has(a)||r.set(a,n||{})}Kr(r),s=Xr(r)}return new s(t,e,r)}var mt=new Map;function Xr(t){let e=[];for(let i of Wr)t.has(i)&&e.push(i);let s=e.join("|"),r=mt.get(s);if(!r){r=Wt;for(let i of e)r=Kt[i](r);mt.set(s,r)}return r}function Gt(t){return(e,s,r)=>{if(s===!1)return!1;let i=!!r?.backwards,{length:a}=e,n=s;for(;n>=0&&n<a;){let o=e.charAt(n);if(t instanceof RegExp){if(!t.test(o))return n}else if(!t.includes(o))return n;i?n--:n++}return n===-1||n===a?n:!1}}var Gr=Gt(" "),Yr=Gt(/[^\n\r]/);function Qr(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let s=e+2;s<t.length;++s)if(t.charAt(s)==="*"&&t.charAt(s+1)==="/")return s+2}return e}var Zr=Qr,ft=t=>t===`
9
+ `||t==="\r"||t==="\u2028"||t==="\u2029";function ei(t,e,s){if(e===!1)return!1;let r=!!s?.backwards,i=t.charAt(e);if(r){if(t.charAt(e-1)==="\r"&&i===`
10
+ `)return e-2;if(ft(i))return e-1}else{if(i==="\r"&&t.charAt(e+1)===`
11
+ `)return e+2;if(ft(i))return e+1}return e}var ti=ei;function si(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?Yr(t,e):e}var ri=si;function ii(t,e){let s=null,r=e;for(;r!==s;)s=r,r=Gr(t,r),r=Zr(t,r),r=ri(t,r),r=ti(t,r);return r}var ai=ii;function ni(t){let e=[];for(let s of t)try{return s()}catch(r){e.push(r)}throw Object.assign(new Error("All combinations failed"),{errors:e})}function oi(t){if(!t.startsWith("#!"))return"";let e=t.indexOf(`
12
+ `);return e===-1?t:t.slice(0,e)}var Yt=oi,li=Array.prototype.findLast??function(t){for(let e=this.length-1;e>=0;e--){let s=this[e];if(t(s,e,this))return s}},hi=Be("findLast",function(){if(Array.isArray(this))return li}),pi=hi,Qt=Symbol.for("comments");function ci(t){return this[t<0?this.length+t:t]}var ui=Be("at",function(){if(Array.isArray(this)||typeof this=="string")return ci}),di=ui;function ge(t){let e=new Set(t);return s=>e.has(s?.type)}function Xe(t){return t.range?.[1]??t.end}function O(t){let e=t.range?.[0]??t.start,s=(t.declaration?.decorators??t.decorators)?.[0];return s?Math.min(O(s),e):e}var mi=5,fi=8,yi=8,yt=t=>e=>e.label?M(e.label):O(e)+t,xi=t=>t.__contentEnd??Xe(t),Zt=["ExpressionStatement","Directive","ImportDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ReturnStatement","ThrowStatement","DoWhileStatement"],Pi=new Map([["BreakStatement",yt(mi)],["ContinueStatement",yt(fi)],["DebuggerStatement",t=>O(t)+yi],["VariableDeclaration",t=>M(di(0,t.declarations,-1))],...Zt.map(t=>[t,xi])]),gi=ge(Zt);function M(t){let{type:e}=t;return e==="IfStatement"?M(t.alternate??t.consequent):e==="ForInStatement"||e==="ForOfStatement"||e==="ForStatement"||e==="LabeledStatement"||e==="WithStatement"||e==="WhileStatement"?M(t.body):Pi.get(e)?.(t)??Xe(t)}var Ge=ge(["Block","CommentBlock","MultiLine"]),Ti=ge(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]);function Ye(t,e,s){if(!t.has(e)){let r=s(e);t.set(e,r)}return t.get(e)}var bi=new WeakMap;function Ai(t){return Ye(bi,t,e=>Ge(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/.test(e.value))}function Si(t){return J(0,t,/[^\n]/g," ")}var Ei=Si;function Ci(t,e){for(let s of e){let r=O(s),i=M(s);t=t.slice(0,r)+Ei(t.slice(r,i))+t.slice(i)}return t}var Ii=new WeakMap;function wi(t){let e=t[Qt];return Ye(Ii,e,s=>Ci(t.originalText,s))}function Ni(t){if(!Ge(t))return[];if(!t.value.includes(`
13
+ `))return[];let e=[];for(let s of`*${t.value}*`.split(`
14
+ `)){if(s=s.trimStart(),!s.startsWith("*"))return[];e.push(s)}return e}var es=new WeakMap;function ki(t){return Ye(es,t,Ni)}function vi(t){es.delete(t)}function xt(t){return ki(t).length>0}function Li(t){if(t.length<2)return;let e;for(let s=t.length-1;s>=0;s--){let r=t[s];if(e&&M(r)===O(e)&&xt(r)&&xt(e)&&(t.splice(s+1,1),r.value+="*//*"+e.value,r.range=[O(r),M(e)],vi(r)),!Ti(r)&&!Ge(r))throw new TypeError(`Unknown comment type: "${r.type}".`);e=r}}function Mi(t){return t!==null&&typeof t=="object"}var Di=Mi,ee=null;function ae(t){if(ee!==null&&typeof ee.property){let e=ee;return ee=ae.prototype=null,e}return ee=ae.prototype=t??Object.create(null),new ae}var Oi=10;for(let t=0;t<=Oi;t++)ae();function Fi(t){return ae(t)}function Bi(t,e="type"){Fi(t);function s(r){let i=r[e],a=t[i];if(!Array.isArray(a))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:r});return a}return s}var Ui=Bi,c=[["elements"],["left","right"],["value"],["directives","body"],["label"],["callee","typeArguments","arguments"],["test","consequent","alternate"],["body","test"],["expression"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["object","property"],["properties"],["decorators","key","typeParameters","params","returnType","body"],["decorators","key","value"],["argument"],["expressions"],["id","init"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body"],["declaration","specifiers","source","attributes"],["local"],["exported"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeParameters"],["id","typeParameters","extends","body"],["id","body"],["typeAnnotation"],["id","typeParameters","right"],["name","typeAnnotation"],["types"],["qualification","id"],["elementTypes"],["expression","typeAnnotation"],["params"],["members"],["objectType","indexType"],["decorators","key","typeAnnotation","value"],["id","typeParameters","params","returnType","body"],["key","typeParameters","params","returnType"],["typeParameters","params","returnType"],["parameterName","typeAnnotation"],["checkType","extendsType","trueType","falseType"],["typeParameter"],["literal"],["expression","typeArguments"],["decorators","key","typeAnnotation"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],Ri={ArrayExpression:c[0],AssignmentExpression:c[1],BinaryExpression:c[1],InterpreterDirective:[],Directive:c[2],DirectiveLiteral:[],BlockStatement:c[3],BreakStatement:c[4],CallExpression:c[5],CatchClause:["param","body"],ConditionalExpression:c[6],ContinueStatement:c[4],DebuggerStatement:[],DoWhileStatement:c[7],EmptyStatement:[],ExpressionStatement:c[8],File:["program"],ForInStatement:c[9],ForStatement:["init","test","update","body"],FunctionDeclaration:c[10],FunctionExpression:c[10],Identifier:["typeAnnotation","decorators"],IfStatement:c[6],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:c[1],MemberExpression:c[11],NewExpression:c[5],Program:c[3],ObjectExpression:c[12],ObjectMethod:c[13],ObjectProperty:c[14],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:c[15],SequenceExpression:c[16],ParenthesizedExpression:c[8],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:c[15],TryStatement:["block","handler","finalizer"],UnaryExpression:c[15],UpdateExpression:c[15],VariableDeclaration:["declarations"],VariableDeclarator:c[17],WhileStatement:c[7],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:c[18],ClassExpression:c[19],ClassDeclaration:c[19],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:c[20],ExportSpecifier:["local","exported"],ForOfStatement:c[9],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:c[21],ImportNamespaceSpecifier:c[21],ImportSpecifier:["imported","local"],MetaProperty:["meta","property"],ClassMethod:c[13],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:c[15],Super:[],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:c[15],AwaitExpression:c[15],ImportExpression:["source","options"],BigIntLiteral:[],ExportNamespaceSpecifier:c[22],OptionalMemberExpression:c[11],OptionalCallExpression:c[5],ClassProperty:c[23],ClassPrivateProperty:c[23],ClassPrivateMethod:c[13],PrivateName:c[24],StaticBlock:c[18],ImportAttribute:c[25],AnyTypeAnnotation:[],ArrayTypeAnnotation:c[26],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:c[27],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:c[28],DeclareModule:c[29],DeclareModuleExports:c[30],DeclareTypeAlias:c[31],DeclareOpaqueType:["id","typeParameters","supertype","lowerBound","upperBound"],DeclareVariable:["id","declarations"],DeclareExportDeclaration:c[20],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:c[2],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:c[32],GenericTypeAnnotation:c[27],InferredPredicate:[],InterfaceExtends:c[27],InterfaceDeclaration:c[28],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:c[33],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:c[30],NumberLiteralTypeAnnotation:[],BigIntLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:c[2],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:c[15],OpaqueType:["id","typeParameters","supertype","impltype","lowerBound","upperBound"],QualifiedTypeIdentifier:c[34],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:c[35],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:c[31],TypeAnnotation:c[30],TypeCastExpression:c[36],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:c[37],TypeParameterInstantiation:c[37],UnionTypeAnnotation:c[33],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:c[29],EnumBooleanBody:c[38],EnumNumberBody:c[38],EnumStringBody:c[38],EnumSymbolBody:c[38],EnumBooleanMember:c[17],EnumNumberMember:c[17],EnumStringMember:c[17],EnumDefaultedMember:c[24],IndexedAccessType:c[39],OptionalIndexedAccessType:c[39],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:c[8],JSXSpreadChild:c[8],JSXIdentifier:[],JSXMemberExpression:c[11],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeArguments","attributes"],JSXSpreadAttribute:c[15],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ClassAccessorProperty:c[40],Decorator:c[8],DoExpression:c[18],ExportDefaultSpecifier:c[22],ModuleExpression:c[18],TopicReference:[],VoidPattern:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:c[41],TSDeclareMethod:c[42],TSQualifiedName:c[1],TSCallSignatureDeclaration:c[43],TSConstructSignatureDeclaration:c[43],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:c[42],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:c[43],TSConstructorType:c[43],TSTypeReference:["typeName","typeArguments"],TSTypePredicate:c[44],TSTypeQuery:["exprName","typeArguments"],TSTypeLiteral:c[38],TSArrayType:c[26],TSTupleType:c[35],TSOptionalType:c[30],TSRestType:c[30],TSNamedTupleMember:["label","elementType"],TSUnionType:c[33],TSIntersectionType:c[33],TSConditionalType:c[45],TSInferType:c[46],TSParenthesizedType:c[30],TSTypeOperator:c[30],TSIndexedAccessType:c[39],TSMappedType:["key","constraint","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:c[47],TSClassImplements:c[48],TSInterfaceHeritage:c[48],TSInterfaceDeclaration:c[28],TSInterfaceBody:c[18],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:c[48],TSAsExpression:c[36],TSSatisfiesExpression:c[36],TSTypeAssertion:c[36],TSEnumBody:c[38],TSEnumDeclaration:c[29],TSEnumMember:["id","initializer"],TSModuleDeclaration:c[29],TSModuleBlock:c[18],TSImportType:["source","options","qualifier","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:c[8],TSNonNullExpression:c[8],TSExportAssignment:c[8],TSNamespaceExportDeclaration:c[24],TSTypeAnnotation:c[30],TSTypeParameterInstantiation:c[37],TSTypeParameterDeclaration:c[37],TSTypeParameter:["name","constraint","default"],ChainExpression:c[8],Literal:[],MethodDefinition:c[14],PrivateIdentifier:[],Property:c[25],PropertyDefinition:c[23],AccessorProperty:c[40],TSAbstractAccessorProperty:c[49],TSAbstractKeyword:[],TSAbstractMethodDefinition:c[25],TSAbstractPropertyDefinition:c[49],TSAsyncKeyword:[],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:c[8],AsExpression:c[36],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:c[32],ConditionalTypeAnnotation:c[45],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:c[29],DeclareHook:c[24],DeclareNamespace:c[29],EnumBigIntBody:c[38],EnumBigIntMember:c[17],EnumBody:c[38],HookDeclaration:c[41],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:c[46],KeyofTypeAnnotation:c[15],MatchArrayPattern:["elements","rest"],MatchAsPattern:["pattern","target"],MatchBindingPattern:c[24],MatchExpression:c[50],MatchExpressionCase:c[51],MatchIdentifierPattern:c[24],MatchInstanceObjectPattern:c[52],MatchInstancePattern:["targetConstructor","properties"],MatchLiteralPattern:c[47],MatchMemberPattern:["base","property"],MatchObjectPattern:c[52],MatchObjectPatternProperty:["key","pattern"],MatchOrPattern:["patterns"],MatchRestPattern:c[15],MatchStatement:c[50],MatchStatementCase:c[51],MatchUnaryPattern:c[15],MatchWildcardPattern:[],NeverTypeAnnotation:[],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:c[34],RecordDeclaration:["id","typeParameters","implements","body"],RecordDeclarationBody:c[0],RecordDeclarationImplements:["id","typeArguments"],RecordDeclarationProperty:["key","typeAnnotation","defaultValue"],RecordDeclarationStaticProperty:["key","typeAnnotation","value"],RecordExpression:["recordConstructor","typeArguments","properties"],RecordExpressionProperties:c[12],SatisfiesExpression:c[36],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:c[30],TypePredicate:c[44],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],NGChainedExpression:c[16],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:c[18],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:c[25],NGRoot:c[53],JsExpressionRoot:c[53],JsonRoot:c[53],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:c[30],TSJSDocNonNullableType:c[30]},ji=Ui(Ri),_i=ji;function ye(t,e){if(!Di(t))return t;if(Array.isArray(t)){for(let r=0;r<t.length;r++)t[r]=ye(t[r],e);return t}if(e.onEnter){let r=e.onEnter(t)??t;if(r!==t)return ye(r,e);t=r}let s=_i(t);for(let r=0;r<s.length;r++)t[s[r]]=ye(t[s[r]],e);return e.onLeave&&(t=e.onLeave(t)||t),t}var Vi=ye;ge(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);function zi(t,e){let{text:s,astType:r}=e,i=r==="oxc-ts",{comments:a}=t;Li(a);let n=t.type==="File"?t.program:t;n.interpreter&&(a.unshift(n.interpreter),delete n.interpreter),t.hashbang&&(i&&a.unshift(t.hashbang),delete t.hashbang),t.type==="Program"&&(t.range=[0,s.length]);let o;return t=Vi(t,{onEnter(l){switch(Hi(l,a,s),l.type){case"ParenthesizedExpression":{let{expression:h}=l,u=O(l);if(h.type==="TypeCastExpression")return h.range=[u,M(l)],h;let d=!1;if(!i){if(!o){o=[];for(let g of a)Ai(g)&&o.push(M(g))}let y=pi(0,o,g=>g<=u);d=y&&s.slice(y,u).trim().length===0}return d?void 0:(h.extra={...h.extra,parenthesized:!0},h)}case"TemplateLiteral":if(l.expressions.length!==l.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if(r==="flow"||r==="hermes"||r==="espree"||r==="typescript"||i){let h=O(l)+1,u=M(l)-(l.tail?1:2);l.range=[h,u]}break;case"TSParenthesizedType":return l.typeAnnotation;case"TopicReference":t.extra={...t.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(l.types.length===1)return l.types[0];break;case"TupleTypeAnnotation":l.types&&!l.elementTypes&&(l.elementTypes=l.types);break;case"ImportDeclaration":r==="hermes"&&l.assertions&&!l.attributes&&(l.attributes=l.assertions,delete l.assertions);break}},onLeave(l){switch(l.type){case"LogicalExpression":if(ts(l))return Oe(l);break}}}),t}function ts(t){return t.type==="LogicalExpression"&&t.right.type==="LogicalExpression"&&t.operator===t.right.operator}function Oe(t){return ts(t)?Oe({type:"LogicalExpression",operator:t.operator,left:Oe({type:"LogicalExpression",operator:t.operator,left:t.left,right:t.right.left,range:[O(t.left),M(t.right.left)]}),right:t.right.right,range:[O(t),M(t)]}):t}function Hi(t,e,s){if(!gi(t))return;let r=Xe(t);if(s[r-1]!==";")return;let i=wi({[Qt]:e,originalText:s});r-=1;let a=i.slice(O(t),r),n=a.trimEnd();t.__contentEnd=r-(a.length-n.length)}var $i=zi;function qi(t,e){let s=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(s,e)}var ss=qi,Pt="Unexpected parseExpression() input: ";function Ki(t){let{message:e,loc:s,reasonCode:r}=t;if(!s)return t;let{line:i,column:a}=s,n=t;(r==="MissingPlugin"||r==="MissingOneOfPlugins")&&(e="Unexpected token.",n=void 0);let o=` (${i}:${a})`;return e.endsWith(o)&&(e=e.slice(0,-o.length)),e.startsWith(Pt)&&(e=e.slice(Pt.length)),ss(e,{loc:{start:{line:i,column:a+1}},cause:n})}var rs=Ki,Wi=/\*\/$/,Ji=/^\/\*\*?/,Xi=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Gi=/(^|\s+)\/\/([^\n\r]*)/g,gt=/^(\r?\n)+/,Yi=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Tt=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Qi=/(\r?\n|^) *\* ?/g,Zi=[];function ea(t){let e=t.match(Xi);return e?e[0].trimStart():""}function ta(t){t=J(0,t.replace(Ji,"").replace(Wi,""),Qi,"$1");let e="";for(;e!==t;)e=t,t=J(0,t,Yi,`
15
+ $1 $2
16
+ `);t=t.replace(gt,"").trimEnd();let s=Object.create(null),r=J(0,t,Tt,"").replace(gt,"").trimEnd(),i;for(;i=Tt.exec(t);){let a=J(0,i[2],Gi,"");if(typeof s[i[1]]=="string"||Array.isArray(s[i[1]])){let n=s[i[1]];s[i[1]]=[...Zi,...Array.isArray(n)?n:[n],a]}else s[i[1]]=a}return{comments:r,pragmas:s}}var sa=["noformat","noprettier"],ra=["format","prettier"];function is(t){let e=Yt(t);e&&(t=t.slice(e.length+1));let s=ea(t),{pragmas:r,comments:i}=ta(s);return{shebang:e,text:t,pragmas:r,comments:i}}function ia(t){let{pragmas:e}=is(t);return ra.some(s=>Ue(e,s))}function aa(t){let{pragmas:e}=is(t);return sa.some(s=>Ue(e,s))}function na(t){return t=typeof t=="function"?{parse:t}:t,{astFormat:"estree",hasPragma:ia,hasIgnorePragma:aa,locStart:O,locEnd:M,...t}}var oe=na,Qe="module",as="commonjs";function oa(t){if(typeof t=="string"){if(t=t.toLowerCase(),/\.(?:mjs|mts)$/i.test(t))return Qe;if(/\.(?:cjs|cts)$/i.test(t))return as}}function la(t){let{type:e="JsExpressionRoot",expression:s,comments:r=s?.comments??[],text:i,rootMarker:a}=t,n={type:e,comments:r,range:[0,i.length],rootMarker:a};return s&&(delete s.comments,n.node=s),n}var ns=la,Y=t=>oe(da(t)),ha={sourceType:Qe,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions",["partialApplication",{version:"2018-07"}],"decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],["discardBinding",{syntaxType:"void"}]],tokens:!1,ranges:!1},bt="v8intrinsic",At=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],j=(t,e=ha)=>({...e,plugins:[...e.plugins,...t]}),pa=/@(?:no)?flow\b/;function ca(t,e){if(e?.endsWith(".js.flow"))return!0;let s=Yt(t);s&&(t=t.slice(s.length));let r=ai(t,0);return r!==!1&&(t=t.slice(0,r)),pa.test(t)}function ua(t,e,s){let r=t(e,s),i=r.errors.find(a=>!fa.has(a.reasonCode));if(i)throw i;return r}function da({isExpression:t=!1,optionsCombinations:e}){return(s,r={})=>{let{filepath:i}=r;if(typeof i!="string"&&(i=void 0),(r.parser==="babel"||r.parser==="__babel_estree")&&ca(s,i))return r.parser="babel-flow",ls.parse(s,r);let a=e,n=r.__babelSourceType??oa(i);n&&n!==Qe&&(a=a.map(u=>({...u,sourceType:n,...n===as?{allowReturnOutsideFunction:void 0,allowNewTargetOutsideFunction:void 0}:void 0})));let o=/%[A-Z]/.test(s);s.includes("|>")?a=(o?[...At,bt]:At).flatMap(u=>a.map(d=>j([u],d))):o&&(a=a.map(u=>j([bt],u)));let l=t?Xt:Jt,h;try{h=ni(a.map(u=>()=>ua(l,s,u)))}catch({errors:[u]}){throw rs(u)}return t&&(h=ns({expression:h,text:s,rootMarker:r.rootMarker})),$i(h,{text:s})}}var ma=["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","ParamDupe","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","PatternIsOptional","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","DeclarationMissingInitializer","DecoratorAbstractMethod"],fa=new Set(ma),os=[j(["jsx"])],St=Y({optionsCombinations:os}),Et=Y({optionsCombinations:[j(["jsx","typescript"]),j(["typescript"])]}),Ct=Y({isExpression:!0,optionsCombinations:[j(["jsx"])]}),It=Y({isExpression:!0,optionsCombinations:[j(["typescript"])]}),ls=Y({optionsCombinations:[j(["jsx",["flow",{all:!0}],"flowComments"])]}),ya=Y({optionsCombinations:os.map(t=>j(["estree"],t))}),hs={};Fe(hs,{json:()=>ga,"json-stringify":()=>Aa,json5:()=>Ta,jsonc:()=>ba});function xa(t){return Array.isArray(t)&&t.length>0}var ps=xa,cs={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Pa(t){let e=Jt(t,cs),{program:s}=e;if(s.body.length===0&&s.directives.length===0&&!s.interpreter)return{comments:e.comments}}function Te(t,e={}){let{allowComments:s=!0,allowEmpty:r=!1}=e,i,a;try{i=Xt(t,cs),a=i.comments}catch(n){if(r&&n.code==="BABEL_PARSER_SYNTAX_ERROR"&&n.reasonCode==="ParseExpressionEmptyInput")try{({comments:a}=Pa(t))}catch{}if(!a)throw rs(n)}if(!s&&ps(a))throw H(a[0],"Comment");return(!r||i)&&W(i),i=ns({type:"JsonRoot",expression:i,comments:a,text:t}),i}function H(t,e){let[s,r]=[t.loc.start,t.loc.end].map(({line:i,column:a})=>({line:i,column:a+1}));return ss(`${e} is not allowed in JSON.`,{loc:{start:s,end:r}})}function W(t){switch(t.type){case"ArrayExpression":for(let e of t.elements)e!==null&&W(e);return;case"ObjectExpression":for(let e of t.properties)W(e);return;case"ObjectProperty":if(t.computed)throw H(t.key,"Computed key");if(t.shorthand)throw H(t.key,"Shorthand property");t.key.type!=="Identifier"&&W(t.key),W(t.value);return;case"UnaryExpression":{let{operator:e,argument:s}=t;if(e!=="+"&&e!=="-")throw H(t,`Operator '${t.operator}'`);if(s.type==="NumericLiteral"||s.type==="Identifier"&&(s.name==="Infinity"||s.name==="NaN"))return;throw H(s,`Operator '${e}' before '${s.type}'`)}case"Identifier":if(t.name!=="Infinity"&&t.name!=="NaN"&&t.name!=="undefined")throw H(t,`Identifier '${t.name}'`);return;case"TemplateLiteral":if(ps(t.expressions))throw H(t.expressions[0],"'TemplateLiteral' with expression");for(let e of t.quasis)W(e);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw H(t,`'${t.type}'`)}}var ga=oe({parse:t=>Te(t),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Ta=oe(t=>Te(t)),ba=oe(t=>Te(t,{allowEmpty:!0})),Aa=oe({parse:t=>Te(t,{allowComments:!1}),astFormat:"estree-json"}),Sa={...wt,...hs};export{ds as default,Sa as parsers};