@datalayer/agent-runtimes 1.6.21 → 1.6.22

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 (81) hide show
  1. package/dist-embed/chunks/{CollapsiblePlugin-B85HBp8b.js → CollapsiblePlugin-Bn70jFpi.js} +1 -1
  2. package/dist-embed/chunks/{DeckComponent-DnMHEQJo.js → DeckComponent-DuxVpxzx.js} +1 -1
  3. package/dist-embed/chunks/{DocumentView-3aE4btpU.js → DocumentView-DKLkbwvh.js} +1 -1
  4. package/dist-embed/chunks/{EphemeralDocument-DLAoDnRi.js → EphemeralDocument-CAXNOtEL.js} +1 -1
  5. package/dist-embed/chunks/{ExcalidrawComponent-BJYnSolA.js → ExcalidrawComponent-mHitiMde.js} +1 -1
  6. package/dist-embed/chunks/{ExcalidrawModal-DmcKDOu0.js → ExcalidrawModal-KB4MTQbk.js} +1 -1
  7. package/dist-embed/chunks/{JupyterLexicalExtension-D-dDKj_U.js → JupyterLexicalExtension-BtjDYMne.js} +5 -5
  8. package/dist-embed/chunks/{YouTubePlugin-B26ThLdI.js → YouTubePlugin-B6JmeO6g.js} +1 -1
  9. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-DrKp-GT1.js → ar-SA-G6X2FPQ2-BtDm_vBV.js} +1 -1
  10. package/dist-embed/chunks/{az-AZ-76LH7QW2-kanwrGa7.js → az-AZ-76LH7QW2-CU9PzGa-.js} +1 -1
  11. package/dist-embed/chunks/babel-xT8DLG14.js +16 -0
  12. package/dist-embed/chunks/{bg-BG-XCXSNQG7-B-YkMqs9.js → bg-BG-XCXSNQG7-CcZG1sMf.js} +1 -1
  13. package/dist-embed/chunks/{bn-BD-2XOGV67Q-C2LRshMO.js → bn-BD-2XOGV67Q-CsBxRWS8.js} +1 -1
  14. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-CH-XjE7A.js → ca-ES-6MX7JW3Y-DiPlBY-L.js} +1 -1
  15. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-CZsinbV8.js → cs-CZ-2BRQDIVT-B2LG8kaF.js} +1 -1
  16. package/dist-embed/chunks/{da-DK-5WZEPLOC-BKE16CYd.js → da-DK-5WZEPLOC-CjiEJ2dL.js} +1 -1
  17. package/dist-embed/chunks/{de-DE-XR44H4JA-Bef67X55.js → de-DE-XR44H4JA-D2hSEI1m.js} +1 -1
  18. package/dist-embed/chunks/{el-GR-BZB4AONW-DdhJZ7Lx.js → el-GR-BZB4AONW-C7ps3kie.js} +1 -1
  19. package/dist-embed/chunks/{es-ES-U4NZUMDT-BYuerEZq.js → es-ES-U4NZUMDT-BfNMUvfg.js} +1 -1
  20. package/dist-embed/chunks/estree-BbkbXjhR.js +44 -0
  21. package/dist-embed/chunks/{eu-ES-A7QVB2H4-Bx1ZMbch.js → eu-ES-A7QVB2H4-CBQcRcNh.js} +1 -1
  22. package/dist-embed/chunks/{fa-IR-HGAKTJCU-DOlQSonG.js → fa-IR-HGAKTJCU-CKTkkQUk.js} +1 -1
  23. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-CEvqx_B0.js → fi-FI-Z5N7JZ37-B2flJw4O.js} +1 -1
  24. package/dist-embed/chunks/{fr-FR-RHASNOE6-B6dmIROy.js → fr-FR-RHASNOE6-DCWxP6nh.js} +1 -1
  25. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DET0-zSB.js → gl-ES-HMX3MZ6V-BGEA0PhL.js} +1 -1
  26. package/dist-embed/chunks/{he-IL-6SHJWFNN-D8q7vnmN.js → he-IL-6SHJWFNN-BaHixqAA.js} +1 -1
  27. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-WKOut6Ph.js → hi-IN-IWLTKZ5I-CrHbvHN0.js} +1 -1
  28. package/dist-embed/chunks/html-DVpylSNq.js +25 -0
  29. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-D8S_FCMc.js → hu-HU-A5ZG7DT2-B9wQnRpK.js} +1 -1
  30. package/dist-embed/chunks/{id-ID-SAP4L64H-C1MpnR6j.js → id-ID-SAP4L64H-T0pQVB4m.js} +1 -1
  31. package/dist-embed/chunks/{it-IT-JPQ66NNP-CmSi2-kQ.js → it-IT-JPQ66NNP-ECgWHvcY.js} +1 -1
  32. package/dist-embed/chunks/{ja-JP-DBVTYXUO-f3Xycaxf.js → ja-JP-DBVTYXUO-Cz96ctDW.js} +1 -1
  33. package/dist-embed/chunks/{kaa-6HZHGXH3-CDjiUexP.js → kaa-6HZHGXH3-Cu7gLGxC.js} +1 -1
  34. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-C7pc9jkA.js → kab-KAB-ZGHBKWFO-CoJI939s.js} +1 -1
  35. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DKB4lHwJ.js → kk-KZ-P5N5QNE5-DiEAZ9si.js} +1 -1
  36. package/dist-embed/chunks/{km-KH-HSX4SM5Z-Tct1wYe_.js → km-KH-HSX4SM5Z-CNF1qzO2.js} +1 -1
  37. package/dist-embed/chunks/{ko-KR-MTYHY66A-D75KXFFg.js → ko-KR-MTYHY66A-BCvHfgyK.js} +1 -1
  38. package/dist-embed/chunks/{ku-TR-6OUDTVRD-DFFv9y6o.js → ku-TR-6OUDTVRD-BV9JoFXu.js} +1 -1
  39. package/dist-embed/chunks/{lib-CWYlnae_.js → lib-BkW0DwuV.js} +1 -1
  40. package/dist-embed/chunks/{lt-LT-XHIRWOB4-b_ZSHKuX.js → lt-LT-XHIRWOB4-BpoBiZvj.js} +1 -1
  41. package/dist-embed/chunks/{lv-LV-5QDEKY6T-DOkd9vjo.js → lv-LV-5QDEKY6T-DWPLOycm.js} +1 -1
  42. package/dist-embed/chunks/markdown-Czq15M7Q.js +70 -0
  43. package/dist-embed/chunks/{mr-IN-CRQNXWMA-DgtGEhds.js → mr-IN-CRQNXWMA-C3XokKLN.js} +1 -1
  44. package/dist-embed/chunks/{my-MM-5M5IBNSE-Wx2nX-HX.js → my-MM-5M5IBNSE-bPDcBtIx.js} +1 -1
  45. package/dist-embed/chunks/{nb-NO-T6EIAALU-Bxg1hz2F.js → nb-NO-T6EIAALU-zGQywuc4.js} +1 -1
  46. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CuTty8ZU.js → nl-NL-IS3SIHDZ-D0N-QxdB.js} +1 -1
  47. package/dist-embed/chunks/{nn-NO-6E72VCQL-yF9Qjmvy.js → nn-NO-6E72VCQL-BeiBipEM.js} +1 -1
  48. package/dist-embed/chunks/{oc-FR-POXYY2M6-DzhTICBK.js → oc-FR-POXYY2M6-BSmiDtLw.js} +1 -1
  49. package/dist-embed/chunks/{pa-IN-N4M65BXN-BLaNcNfP.js → pa-IN-N4M65BXN-YTioBliU.js} +1 -1
  50. package/dist-embed/chunks/{percentages-BXMCSKIN-BSFk0Tks.js → percentages-BXMCSKIN-B5BZ64UL.js} +3 -3
  51. package/dist-embed/chunks/{pl-PL-T2D74RX3-Cny-MZTY.js → pl-PL-T2D74RX3-BmA-mIoA.js} +1 -1
  52. package/dist-embed/chunks/postcss-ClUAhyQz.js +62 -0
  53. package/dist-embed/chunks/{pt-BR-5N22H2LF-B0D69qws.js → pt-BR-5N22H2LF-DF1nGVg3.js} +1 -1
  54. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BstfsxvV.js → pt-PT-UZXXM6DQ-DhiSFYNH.js} +1 -1
  55. package/dist-embed/chunks/{ro-RO-JPDTUUEW-BP5Qc7BF.js → ro-RO-JPDTUUEW-DN5nT_8E.js} +1 -1
  56. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CnAMP9Hu.js → ru-RU-B4JR7IUQ-DJAZColu.js} +1 -1
  57. package/dist-embed/chunks/{si-LK-N5RQ5JYF-KUaQDZ4v.js → si-LK-N5RQ5JYF-BcJdGNJf.js} +1 -1
  58. package/dist-embed/chunks/{sk-SK-C5VTKIMK-CG7XdLGl.js → sk-SK-C5VTKIMK-Bs43X2b-.js} +1 -1
  59. package/dist-embed/chunks/{sl-SI-NN7IZMDC-e_SFsMsv.js → sl-SI-NN7IZMDC-CVhBQ31i.js} +1 -1
  60. package/dist-embed/chunks/standalone-BmUQQ5LE.js +29 -0
  61. package/dist-embed/chunks/{subset-shared.chunk-Cn_vjsJA.js → subset-shared.chunk-BkTdi2-W.js} +1 -1
  62. package/dist-embed/chunks/{subset-worker.chunk-W_rTkgB8.js → subset-worker.chunk-SkNsdM6t.js} +1 -1
  63. package/dist-embed/chunks/{sv-SE-XGPEYMSR-DHzvVSOu.js → sv-SE-XGPEYMSR-BR0XZMXJ.js} +1 -1
  64. package/dist-embed/chunks/{ta-IN-2NMHFXQM-opB0ehqF.js → ta-IN-2NMHFXQM-4CfGQQ8v.js} +1 -1
  65. package/dist-embed/chunks/{th-TH-HPSO5L25-DLQWbRw6.js → th-TH-HPSO5L25-CjO8TBa6.js} +1 -1
  66. package/dist-embed/chunks/{tr-TR-DEFEU3FU-BB46Zv5P.js → tr-TR-DEFEU3FU-B3tO43YQ.js} +1 -1
  67. package/dist-embed/chunks/typescript-BLZ3EhMp.js +22 -0
  68. package/dist-embed/chunks/{uk-UA-QMV73CPH-PSr9uqn6.js → uk-UA-QMV73CPH-DYk01HNs.js} +1 -1
  69. package/dist-embed/chunks/{vi-VN-M7AON7JQ-B8XFOV9x.js → vi-VN-M7AON7JQ-Dyd2Hf1G.js} +1 -1
  70. package/dist-embed/chunks/{zh-CN-LNUGB5OW-Cw-MnTuW.js → zh-CN-LNUGB5OW-Bs2W1BrY.js} +1 -1
  71. package/dist-embed/chunks/{zh-HK-E62DVLB3-C6TwyE2U.js → zh-HK-E62DVLB3-BwN2oc_m.js} +1 -1
  72. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CLS-sbQC.js → zh-TW-RAJ6MFWO-qOevWsjt.js} +1 -1
  73. package/dist-embed/datalayer-app-main.js +3 -3
  74. package/package.json +1 -1
  75. package/dist-embed/chunks/babel-DYThBADt.js +0 -16
  76. package/dist-embed/chunks/estree-C_HWBWad.js +0 -44
  77. package/dist-embed/chunks/html-BdbYoS8g.js +0 -25
  78. package/dist-embed/chunks/markdown-BWelGxUI.js +0 -70
  79. package/dist-embed/chunks/postcss-Bqhj58AT.js +0 -62
  80. package/dist-embed/chunks/standalone-Lm5oSWJc.js +0 -29
  81. package/dist-embed/chunks/typescript-Ctd41k9v.js +0 -22
@@ -0,0 +1,16 @@
1
+ import{as as Va}from"../datalayer-app-main.js";function za(se,ke){for(var j=0;j<ke.length;j++){const _=ke[j];if(typeof _!="string"&&!Array.isArray(_)){for(const U in _)if(U!=="default"&&!(U in se)){const re=Object.getOwnPropertyDescriptor(_,U);re&&Object.defineProperty(se,U,re.get?re:{enumerable:!0,get:()=>_[U]})}}}return Object.freeze(Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}))}var pt={exports:{}},Ss;function qa(){return Ss||(Ss=1,(function(se,ke){(function(j){function _(){var U=j();return U.default||U}se.exports=_()})(function(){var j=Object.defineProperty,_=Object.getOwnPropertyDescriptor,U=Object.getOwnPropertyNames,re=Object.prototype.hasOwnProperty,ve=(t,e)=>{for(var s in e)j(t,s,{get:e[s],enumerable:!0})},Is=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of U(e))!re.call(t,i)&&i!==s&&j(t,i,{get:()=>e[i],enumerable:!(r=_(e,i))||r.enumerable});return t},Cs=t=>Is(j({},"__esModule",{value:!0}),t),ct={};ve(ct,{parsers:()=>_a});var ut={};ve(ut,{__babel_estree:()=>Ma,__js_expression:()=>fs,__ts_expression:()=>ys,__vue_event_binding:()=>ds,__vue_expression:()=>fs,__vue_ts_event_binding:()=>ms,__vue_ts_expression:()=>ys,babel:()=>ds,"babel-flow":()=>xs,"babel-ts":()=>ms});var Le=(t,e)=>(s,r,...i)=>s|1&&r==null?void 0:(e.call(r)??r[t]).apply(r,i),Ns=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},ws=Le("replaceAll",function(){if(typeof this=="string")return Ns}),X=ws,ks=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),De=ks,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)}},ye=class{start;end;filename;identifierName;constructor(t,e){this.start=t,this.end=e}};function M(t,e){let{line:s,column:r,index:i}=t;return new v(s,r+e,i+e)}var dt="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",vs={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:dt},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:dt}},mt={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"},xe=t=>t.type==="UpdateExpression"?mt.UpdateExpression[`${t.prefix}`]:mt[t.type],Ls={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.',DeferExportInvalidAll:'`export defer * from "./module"` is invalid. Explicitly list the re-exported names.',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'.",FilteredNamespaceDuplicateName:({name:t})=>`Duplicate name '${t}' in filtered namespace.`,FilteredNamespaceRename:"Names in a filtered namespace cannot be renamed using `as`.",FilteredNamespaceTypeModifier:"Names in a filtered namespace cannot have a type modifier.",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,sync:e})=>`\`import${t?`.${t}`:e?".sync":""}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:t,sync:e})=>`Cannot use new with import${t?`.${t}`:e?".sync":""}().`,ImportCallSpreadArgument:({phase:t,sync:e})=>`\`...\` is not allowed in \`import${t?`.${t}`:e?".sync":""}()\`.`,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 ${xe(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${xe(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${xe(t)}.`,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."},Ds={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."},Ms={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)}\`.`},Os=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Fs={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 ${xe({type:t})}; please wrap it in parentheses.`,PipelineUnparenthesized:"Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."},Bs={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."};function ft(t,e,s){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:s})}function Us({toMessage:t,code:e,reasonCode:s,syntaxPlugin:r}){let i=s==="MissingPlugin"||s==="MissingOneOfPlugins";return function a(n,o,l){let p=new SyntaxError;return p.code=e,p.reasonCode=s,p.loc=n,p.pos=o,p.syntaxPlugin=r,i&&(p.missingPlugin=l.missingPlugin),ft(p,"clone",function(u={}){let{line:m,column:y,index:g=o}=u.loc??n;return a(new v(m,y),g,{...l,...u.details})}),ft(p,"details",l),Object.defineProperty(p,"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})}}),p}}function B(t,e){if(Array.isArray(t))return r=>B(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]=Us({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:o,...e?{syntaxPlugin:e}:{},...n})}return s}var h={...B(vs),...B(Ls),...B(Ds),...B(Ms),...B`pipelineOperator`(Fs),...B`functionBind`(Bs)};function Rs(){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 js(t){let e=Rs();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 Y(t){if(t.loc){let{start:e,end:s}=t.loc;t.loc.start=new v(e.line,e.column),t.loc.end=new v(s.line,s.column)}return t}var _s=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(Y)),Y(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=r.value!==null?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:p}=e;p&&(delete e.typeParameters,l.typeParameters=p,this.resetStartLocationFromNode(l,p));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(h.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(h.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"&&!i.specifiers[0].exportsFilter&&(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 Y(super.finishNodeAt(e,s,r))}finishNodeAtNode(e,s,r){return Y(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),Y(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),Y(e)}},b=!0,f=!0,Me=!0,ie=!0,$=!0,Vs=!0,yt=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}},Oe=new Map;function S(t,e={}){e.keyword=t;let s=P(t,e);return Oe.set(t,s),s}function k(t,e){return P(t,{beforeExpr:b,binop:e})}var ae=-1,Fe=[],Be=[],Ue=[],Re=[],je=[],_e=[];function P(t,e={}){return++ae,Be.push(t),Ue.push(e.binop??-1),Re.push(e.beforeExpr??!1),je.push(e.startsExpr??!1),_e.push(e.prefix??!1),Fe.push(new yt(t,e)),ae}function T(t,e={}){return++ae,Oe.set(t,ae),Be.push(t),Ue.push(e.binop??-1),Re.push(e.beforeExpr??!1),je.push(e.startsExpr??!1),_e.push(e.prefix??!1),Fe.push(new yt("name",e)),ae}var zs={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:ie}),assign:P("_=",{beforeExpr:b,isAssign:ie}),slashAssign:P("_=",{beforeExpr:b,isAssign:ie}),xorAssign:P("_=",{beforeExpr:b,isAssign:ie}),moduloAssign:P("_=",{beforeExpr:b,isAssign:ie}),incDec:P("++/--",{prefix:$,postfix:Vs,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:S("in",{beforeExpr:b,binop:7}),_instanceof:S("instanceof",{beforeExpr:b,binop:7}),_break:S("break"),_case:S("case",{beforeExpr:b}),_catch:S("catch"),_continue:S("continue"),_debugger:S("debugger"),_default:S("default",{beforeExpr:b}),_else:S("else",{beforeExpr:b}),_finally:S("finally"),_function:S("function",{startsExpr:f}),_if:S("if"),_return:S("return",{beforeExpr:b}),_switch:S("switch"),_throw:S("throw",{beforeExpr:b,prefix:$,startsExpr:f}),_try:S("try"),_var:S("var"),_const:S("const"),_with:S("with"),_new:S("new",{beforeExpr:b,startsExpr:f}),_this:S("this",{startsExpr:f}),_super:S("super",{startsExpr:f}),_class:S("class",{startsExpr:f}),_extends:S("extends",{beforeExpr:b}),_export:S("export"),_import:S("import",{startsExpr:f}),_null:S("null",{startsExpr:f}),_true:S("true",{startsExpr:f}),_false:S("false",{startsExpr:f}),_typeof:S("typeof",{beforeExpr:b,prefix:$,startsExpr:f}),_void:S("void",{beforeExpr:b,prefix:$,startsExpr:f}),_delete:S("delete",{beforeExpr:b,prefix:$,startsExpr:f}),_do:S("do",{isLoop:Me,beforeExpr:b}),_for:S("for",{isLoop:Me}),_while:S("while",{isLoop:Me}),_arguments:T("arguments",{startsExpr:f}),_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}),_struct:T("struct",{startsExpr:f}),_sync:T("sync",{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 A(t){return t>=89&&t<=132}function qs(t){return t<=88}function L(t){return t>=54&&t<=132}function xt(t){return t>=54&&t<=135}function $s(t){return Re[t]}function ne(t){return je[t]}function Hs(t){return t>=25&&t<=29}function Pt(t){return t>=128&&t<=130}function Ks(t){return t>=86&&t<=88}function Pe(t){return t>=54&&t<=88}function Ws(t){return t>=35&&t<=55}function Js(t){return t===30}function Xs(t){return _e[t]}function Gs(t){return t>=120&&t<=122}function Ys(t){return t>=123&&t<=129}function H(t){return Be[t]}function ge(t){return Ue[t]}function Qs(t){return t===53}function Ve(t){return t>=20&&t<=21}function gt(t){return Fe[t]}var Te=class{constructor(t,e){this.token=t,this.preserveSpace=!!e}token;preserveSpace},E={brace:new Te("{"),j_oTag:new Te("<tag"),j_cTag:new Te("</tag"),j_expr:new Te("<tag>...</tag>",!0)},Tt=/[\p{ID_Start}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d]/u,bt=/[\p{ID_Continue}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d\u05c8\u05c9\u0b53\u0b54\u1acf-\u1af0]/u,St=[1979,4,385,25,1388,2,18,21,3100,0,678,43,22,0,1662,0,6,10,209,310,18458,24,3,24,287,4,6146,7,1239,4,47,23,96,114,14,913,15,50,8017,5,64,0,9534,0,2169,5,7,86,15,6,55,50,1729,30,2,2,2,1,2,6,3,4,10,1,53307,5,223,0,5764,11,21763,4297,39815,11327],Zs=[3787,4,33,11,3173,7,633,9,7,0,45879,1,296,2,9,1,3,0,33,1,5218,0,3,0,8,1,6,0];function ze(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 R(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Tt.test(String.fromCharCode(t)):!isNaN(t)&&t<=1114111&&(Tt.test(String.fromCodePoint(t))||ze(t,St))}function K(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&&bt.test(String.fromCharCode(t)):!isNaN(t)&&t<=1114111&&(bt.test(String.fromCodePoint(t))||ze(t,St)||ze(t,Zs))}var qe={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"]},er=new Set(qe.keyword),tr=new Set(qe.strict),sr=new Set(qe.strictBind);function $e(t,e){return e&&t==="await"||t==="enum"}function At(t,e){return $e(t,e)||tr.has(t)}function Et(t){return sr.has(t)}function It(t,e){return At(t,e)||Et(t)}function Ct(t){return er.has(t)}function rr(t,e,s){return t===64&&e===64&&R(s)}var ir=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 ar(t){return ir.has(t)}var He=class{flags=0;names=new Map;firstLexicalName="";constructor(t){this.flags=t}},Ke=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 He(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(h.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}}},nr=class extends He{declareFunctions=new Set},or=class extends Ke{createScope(t){return new nr(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)}},lr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),hr={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=B`flow`(hr);function pr(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function We(t){return t.importKind==="type"||t.importKind==="typeof"}var cr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function ur(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 dr=/\*?\s*@((?:no)?flow)\b/,mr=t=>class extends t{flowPragma=void 0;getScopeHandler(){return or}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==133&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=dr.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(109),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(126))return this.match(12)?this.flowParseDeclareModuleExports(e):(s&&this.raise(x.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(129))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(130))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(128))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(133)?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(129)&&!this.match(83)&&this.raise(x.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),r.push(super.parseImport(n))):(this.expectContextual(124,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=>{pr(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(129)||this.isContextual(128))&&!s){let r=this.state.value;throw this.raise(x.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:cr[r]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(130))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(51)||this.match(2)||this.isContextual(128)||this.isContextual(129)||this.isContextual(130)){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(110),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(116))do i.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(112))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){lr.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(129),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(141)?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(128),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(134)||this.match(133)?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,p,u=!1;for(s&&this.match(3)?(this.expect(3),l=5,p=!0):(this.expect(2),l=4,p=!1),o.exact=p;!this.match(l);){let y=!1,g=null,N=null,w=this.startNode();if(i&&this.isContextual(117)){let C=this.lookahead();C.type!==10&&C.type!==13&&(this.next(),g=this.state.startLoc,e=!1)}if(e&&this.isContextual(103)){let C=this.lookahead();C.type!==10&&C.type!==13&&(this.next(),y=!0)}let I=this.flowParseVariance();if(this.eat(0))g!=null&&this.unexpected(g),this.eat(0)?(I&&this.unexpected(I.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(w,y))):o.indexers.push(this.flowParseObjectTypeIndexer(w,y,I));else if(this.match(6)||this.match(43))g!=null&&this.unexpected(g),I&&this.unexpected(I.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(w,y));else{let C="init";if(this.isContextual(96)||this.isContextual(101)){let ht=this.lookahead();xt(ht.type)&&(C=this.state.value,this.next())}let F=this.flowParseObjectTypeProperty(w,y,g,I,C,r,a??!p);F===null?(u=!0,N=this.state.lastTokStartLoc):o.properties.push(F)}this.flowObjectTypeSemicolon(),N&&!this.match(4)&&!this.match(5)&&this.raise(x.UnexpectedExplicitInexactInObject,N)}this.expect(l),r&&(o.inexact=u);let m=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=n,m}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"?h.BadGetterArity:h.BadSetterArity,e),e.kind==="set"&&r.rest&&this.raise(h.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(A(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 133: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(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(x.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135: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(Pe(this.state.type)){let o=H(this.state.type);return this.next(),super.createIdentifier(s,o)}else if(A(this.state.type))return this.isContextual(128)?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===131&&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(128)){let r=this.lookahead();if(L(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.isContextual(125)){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)||A(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(A(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===125||Pt(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===125||Pt(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(125)){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(),p=this.getArrowLikeExpressions(o),u=p[0],m=p[1];if(l||m.length>0){let y=[...a];if(m.length>0){this.state=i,this.state.noArrowAt=y;for(let g=0;g<m.length;g++)y.push(m[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()),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.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),a.body.type!=="BlockStatement"&&r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return s?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):ur(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(129)){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(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(128)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(125)){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(129)&&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}maybeParseExportNamedSpecifiers(e){if(!super.maybeParseExportNamedSpecifiers(e))return!1;let s=e.specifiers[e.specifiers.length-1];return e.exportKind==="type"&&s?.type==="ExportNamespaceSpecifier"&&this.unexpected(s.start),!0}parseClassId(e,s,r){if((!s||r)&&this.isContextual(112)){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(124)){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(h.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(131,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):rr(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(112)){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 p=super.parseObjPropValue(e,s,r,i,a,n,o);return l&&((p.value||p).typeParameters=l),p}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=We(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(129)){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"}parseNamedOrFilteredImportSpecifiers(e){super.parseNamedOrFilteredImportSpecifiers(e);let s=e.specifiers[e.specifiers.length-1];We(e)&&s?.type==="ImportNamespaceSpecifier"&&this.unexpected(s.start)}parseImportSpecifier(e,s,r,i){let a=e.imported,n=null;if(a.type==="Identifier"&&(a.name==="type"?n="type":a.name==="typeof"&&(n="typeof")),this.isContextual(90)&&!this.isLookaheadContextual("as")){let o=this.parseIdentifier(!0);n!==null&&!L(this.state.type)?(e.imported=o,e.importKind=n,e.local=this.cloneIdentifier(o)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else n!==null&&L(this.state.type)?(e.imported=this.parseIdentifier(!0),e.importKind=n):(e.imported=a,e.importKind=null),this.eatContextual(90)?e.local=this.parseIdentifier():e.local=this.cloneIdentifier(e.imported);return this.finishNode(e,"ImportSpecifier")}checkImportSpecifier(e,s){let r=We(e),i=s||r;if(i){s&&r&&this.raise(x.ImportTypeShorthandOnlyInPureImport,e);let{local:a}=e;this.checkReservedType(a.name,a.start,!0)}super.checkImportSpecifier(e,s,8201,!i)}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(141)||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 p=this.forwardNoArrowParamsConversionAt(a,()=>{let m=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(m,a),m});p.extra?.parenthesized&&l();let u=this.maybeUnwrapTypeCastExpression(p);return u.type!=="ArrowFunctionExpression"&&l(),u.typeParameters=a,this.resetStartLocationFromNode(u,a),p},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(h.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 134:{let r=this.parseNumericLiteral(this.state.value);if(s())return{type:"number",loc:r.start,value:r};break}case 133:{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(),p=o.name;if(p==="")continue;/^[a-z]/.test(p)&&this.raise(x.EnumInvalidMemberName,o,{memberName:p,suggestion:p[0].toUpperCase()+p.slice(1),enumName:e}),r.has(p)&&this.raise(x.EnumDuplicateMemberName,o,{memberName:p,enumName:e}),r.add(p);let u={enumName:e,explicitType:s,memberName:p};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(99))return null;if(!A(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 p=n.booleanMembers.length,u=n.numberMembers.length,m=n.stringMembers.length,y=n.defaultedMembers.length;if(!p&&!u&&!m&&!y)return l();if(!p&&!u)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(4),this.finishNode(e,"EnumStringBody");if(!u&&!m&&p>=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(!p&&!m&&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}},be=/\r\n|[\r\n\u2028\u2029]/g;function Q(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Je(t,e,s){for(let r=e;r<s;r++)if(Q(t.charCodeAt(r)))return!0;return!1}var fr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,yr=/(?:[^\S\n\r\u2028\u2029]|\/\*.*?\*\/)*(?:(?!-->)(?:\s|\/\/.*|\/\*[^]*?\*\/|<!--.*|-->.*)*)?/g,Xe=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function xr(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 Pr={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 <>...</>?"},V=B`jsx`(Pr);function W(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function Z(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return Z(t.object)+"."+Z(t.property);throw new Error("Node had unexpected type: "+t.type)}var gr=t=>class extends t{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(V.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(141)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(140,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(V.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:r===125?"&rbrace;":"&gt;"});default:Q(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(h.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):Q(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(133,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&&r<=1114111&&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(K(e)||e===45);this.finishToken(139,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(139)?e.name=this.state.value:Pe(this.state.type)?e.name=H(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(V.AttributeIsEmpty,e),e;case 141:case 133:return this.parseExprAtom();default:throw this.raise(V.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(V.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(142)){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(142);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(52),this.expect(142),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){if(this.eat(142)){let r=this.startNodeAt(e);return this.finishNode(r,"JSXClosingFragment")}let s=this.startNodeAt(e);return s.name=this.jsxParseElementName(),this.expect(142),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 141:if(e=this.state.startLoc,this.next(),this.eat(52)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 140: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()}W(i)&&!W(a)&&a!==null?this.raise(V.MissingClosingTagFragment,a):!W(i)&&W(a)?this.raise(V.MissingClosingTagElement,a,{openingTagName:Z(i.name)}):!W(i)&&!W(a)&&Z(a.name)!==Z(i.name)&&this.raise(V.MissingClosingTagElement,a,{openingTagName:Z(i.name)})}if(W(i)?(s.openingFragment=i,s.closingFragment=a):(s.openingElement=i,s.closingElement=a),s.children=r,this.match(43))throw this.raise(V.UnwrappedAdjacentJSXElements,this.state.startLoc);return W(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(141)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(141),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(R(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(142);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(141);return}super.getTokenFromCode(e)}updateContext(e){let{context:s,type:r}=this.state;if(r===52&&e===141)s.splice(-2,2,E.j_cTag),this.state.canStartJSXElement=!1;else if(r===141)s.push(E.j_oTag);else if(r===142){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=$s(r)}},Tr=class extends He{tsNames=new Map},br=class extends Ke{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 Tr(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(h.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)}},Sr=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 Nt(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function Ar(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function oe(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?oe(t,s.comments):Nt(r,s.comments)}var Er=class extends Sr{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&&Nt(t.leadingNode,e),t.trailingNode!==null&&Ar(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"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":z(s,s.exportsFilter??[],t);break;case"TSEnumBody":z(s,s.members,t);break;case"TSInterfaceBody":z(s,s.body,t);break;default:oe(s,e)}else oe(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)}replaceNodeInPendingComments(t,e){for(let s of this.state.commentStack)s.leadingNode===t&&(s.leadingNode=e),s.trailingNode===t&&(s.trailingNode=e)}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}}},Ir=class As{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=[];regExpAllowedAt=-1;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=138;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 As;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.regExpAllowedAt=this.regExpAllowedAt,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}},Cr=function(t){return t>=48&&t<=57},wt={decBinOct:new Set([46,66,69,79,95,98,101,111,43,45]),hex:new Set([46,88,95,120])},Se={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 kt(t,e,s,r,i,a){let n=s,o=r,l=i,p="",u=null,m=s,{length:y}=e;for(;;){if(s>=y){a.unterminated(n,o,l),p+=e.slice(m,s);break}let g=e.charCodeAt(s);if(Nr(t,g,e,s)){p+=e.slice(m,s);break}if(g===92){p+=e.slice(m,s);let N=wr(e,s,r,i,t==="template",a);N.ch===null&&!u?u={pos:s,lineStart:r,curLine:i}:p+=N.ch,{pos:s,lineStart:r,curLine:i}=N,m=s}else g===8232||g===8233?(++s,++i,r=s):g===10||g===13?t==="template"?(p+=e.slice(m,s)+`
6
+ `,++s,g===13&&e.charCodeAt(s)===10&&++s,++i,m=r=s):a.unterminated(n,o,l):++s}return{pos:s,str:p,firstInvalidLoc:u,lineStart:r,curLine:i}}function Nr(t,e,s,r){return t==="template"?e===96||e===36&&s.charCodeAt(r+1)===123:e===(t==="double"?34:39)}function wr(t,e,s,r,i,a){let n=!i;e++;let o=p=>({pos:e,ch:p,lineStart:s,curLine:r}),l=t.charCodeAt(e++);switch(l){case 110:return o(`
7
+ `);case 114:return o("\r");case 120:{let p;return{code:p,pos:e}=Ge(t,e,s,r,2,!1,n,a),o(p===null?null:String.fromCharCode(p))}case 117:{let p;return{code:p,pos:e}=Lt(t,e,s,r,n,a),o(p===null?null:String.fromCodePoint(p))}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 p=e-1,u=/^[0-7]+/.exec(t.slice(p,e+2))[0],m=parseInt(u,8);m>255&&(u=u.slice(0,-1),m=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(p,s,r)}return o(String.fromCharCode(m))}return o(String.fromCharCode(l))}}function Ge(t,e,s,r,i,a,n,o){let l=e,p;return{n:p,pos:e}=vt(t,e,s,r,16,i,a,!1,o,!n),p===null&&(n?o.invalidEscapeSequence(l,s,r):e=l-1),{code:p,pos:e}}function vt(t,e,s,r,i,a,n,o,l,p){let u=e,m=i===16?wt.hex:wt.decBinOct,y=i===16?Se.hex:i===10?Se.dec:i===8?Se.oct:Se.bin,g=!1,N=0;for(let w=0,I=a??1/0;w<I;++w){let C=t.charCodeAt(e),F;if(C===95&&o!=="bail"){let ht=t.charCodeAt(e-1),bs=t.charCodeAt(e+1);if(o){if(Number.isNaN(bs)||!y(bs)||m.has(ht)){if(p)return{n:null,pos:e};l.unexpectedNumericSeparator(e,s,r)}}else{if(p)return{n:null,pos:e};l.numericSeparatorInEscapeSequence(e,s,r)}++e;continue}if(C>=97?F=C-97+10:C>=65?F=C-65+10:Cr(C)?F=C-48:F=1/0,F>=i)if(F<=9){if(p)return{n:null,pos:e};l.invalidDigit(e,s,r,i),F=0}else if(n)F=0,g=!0;else break;++e,N=N*i+F}return e===u||a!=null&&e-u!==a||g?{n:null,pos:e}:{n:N,pos:e}}function Lt(t,e,s,r,i,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=Ge(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}=Ge(t,e,s,r,4,!1,i,a));return{code:o,pos:e}}function le(t,e,s){return new v(s,t-e,t)}var kr=new Set([103,109,115,105,121,117,100,118]),vr=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 ye(t.startLoc,t.endLoc)}},Ae,Lr=class extends Er{isLookahead;tokens=[];constructor(t,e){super(),this.state=new Ir,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1,(!Ae||Ae.length<(this.length+1)*2)&&(Ae=new Uint32Array((this.length+1)*2)),this.locData=Ae}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 vr(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,strict:t.strict,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){let e=this.inModule||!(this.optionFlags&16384)?fr:yr;return e.lastIndex=t,e.test(this.input)?e.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 Xe.lastIndex=t,Xe.test(this.input)?Xe.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(138);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(h.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,be.lastIndex=s+2;be.test(this.input)&&be.lastIndex<=r;)++this.state.curLine,this.state.lineStart=be.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 ye(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(;!Q(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 ye(s,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let t=this.state.pos,e=(this.optionFlags&8192)>0,s;e:for(;this.state.pos<this.length;){let r=this.input.charCodeAt(this.state.pos);switch(r){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 i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),e&&(s??(s=[])).push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),e&&(s??(s=[])).push(i));break}default:break e}break;default:if(xr(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&16384){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(t===0||this.state.lineStart>t)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),e&&(s??(s=[])).push(a))}else break e}else if(r===60&&!this.inModule&&this.optionFlags&16384){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),e&&(s??(s=[])).push(a))}else break e}else break e}}if(s?.length){let r=this.state.pos,i={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(r),comments:s,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}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(h.UnexpectedDigitAfterHash,this.state.curPosition());R(e)?(++this.state.pos,this.finishToken(137,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(137,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;!Q(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(R(t)){this.readWord(t);return}}throw this.raise(h.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(h.UnterminatedRegExp,M(t,1));let l=this.input.charCodeAt(i);if(Q(l))throw this.raise(h.UnterminatedRegExp,M(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=()=>M(t,i+2-e);for(;i<this.length;){let l=this.codePointAtPos(i),p=String.fromCharCode(l);if(kr.has(l))l===118?n.includes("u")&&this.raise(h.IncompatibleRegExpUVFlags,o()):l===117&&n.includes("v")&&this.raise(h.IncompatibleRegExpUVFlags,o()),n.includes(p)&&this.raise(h.DuplicateRegExpFlags,o());else if(K(l)||l===92)this.raise(h.MalformedRegExpFlags,o());else break;++i,n+=p}this.state.pos=i,this.finishToken(136,{pattern:a,flags:n})}readInt(t,e,s=!1,r=!0){let{n:i,pos:a}=vt(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}readLiteralInt(t){let e=this.state.pos,s=0,r;for(;;){r=this.input.charCodeAt(e);let i;if(r>=48&&r<=57)i=r-48;else{if(i=(r|32)-97,i<0||i>5)break;i+=10}if(i>=t)break;s=s*t+i,++e}return r===95||r>=48&&r<=57?this.readInt(t):e===this.state.pos?null:(this.state.pos=e,s)}readRadixNumber(t){let e=this.state.pos,s=this.state.curPosition();this.state.pos+=2;let r=this.readLiteralInt(t),i=this.state.pos;r==null&&this.raise(h.InvalidDigit,M(s,2),{radix:t});let a=this.input.charCodeAt(this.state.pos)===110;if(a&&++this.state.pos,R(this.codePointAtPos(this.state.pos)))throw this.raise(h.NumberIdentifier,this.state.curPosition());if(a||r!==null&&r>Number.MAX_SAFE_INTEGER){let n=X(0,this.input.slice(e,i),"_","");if(a){this.finishToken(135,n);return}r=Number(t!==16&&this.optionFlags&4096?n.replace(t===2?/[2-9]/g:/[89]/g,"0"):n)}this.finishToken(134,r)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),r=!1,i=!1,a=t?0:this.readLiteralInt(10),n=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(n){let y=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(h.StrictOctalLiteral,s),!this.state.strict){let g=y.indexOf("_");g>0&&this.raise(h.ZeroDigitNumericSeparator,M(s,g))}i=!/[89]/.test(y)}let o=this.input.charCodeAt(this.state.pos);o===46&&!i&&(++this.state.pos,this.readLiteralInt(10),r=!0,o=this.input.charCodeAt(this.state.pos)),(o===69||o===101)&&!i&&(o=this.input.charCodeAt(++this.state.pos),(o===43||o===45)&&++this.state.pos,this.readLiteralInt(10)===null&&this.raise(h.InvalidOrMissingExponent,s),r=!0,o=this.input.charCodeAt(this.state.pos));let l=this.state.pos,p=o===110;if(p&&((r||n)&&this.raise(h.InvalidBigIntLiteral,s),++this.state.pos),R(this.codePointAtPos(this.state.pos)))throw this.raise(h.NumberIdentifier,this.state.curPosition());if(!r&&!p&&!n&&a<=Number.MAX_SAFE_INTEGER){this.finishToken(134,a);return}let u=X(0,this.input.slice(e,l),"_","");if(p){this.finishToken(135,u);return}let m=i?parseInt(u,8):parseFloat(u);this.finishToken(134,m)}readCodePoint(t){let{code:e,pos:s}=Lt(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}=kt(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(133,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}=kt("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){if(this.isLookahead)return;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(K(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?R:K;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(h.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let o=this.readCodePoint(!0);o!==null&&(n(o)||this.raise(h.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=Oe.get(e);s!==void 0?this.finishToken(s,H(s)):this.finishToken(131,e)}checkKeywordEscapes(){let{type:t}=this.state;Pe(t)&&this.state.containsEsc&&this.raise(h.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:H(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(h.UnexpectedToken,t??this.state.startLoc,{expected:e?H(e):null})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(h.MissingPlugin,e??this.state.startLoc,{missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(h.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,le(e,s,r))}}errorHandlers_readInt={invalidDigit:(t,e,s,r)=>{this.raise(h.InvalidDigit,le(t,e,s),{radix:r})},numericSeparatorInEscapeSequence:this.errorBuilder(h.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(h.UnexpectedNumericSeparator)};errorHandlers_readCodePoint={...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(h.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(h.InvalidCodePoint)};errorHandlers_readStringContents_string={...this.errorHandlers_readCodePoint,strictNumericEscape:(t,e,s)=>{this.recordStrictModeErrors(h.StrictNumericEscape,le(t,e,s))},unterminated:(t,e,s)=>{throw this.raise(h.UnterminatedString,le(t-1,e,s))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(h.StrictNumericEscape),unterminated:(t,e,s)=>{throw this.raise(h.UnterminatedTemplate,le(t,e,s))}}},Dr=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},Mr=class{parser;stack=[];constructor(t){this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Dr)}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(h.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,p=e&4,u=o&3,m=e&3;n=u===m||l!==p,n||i.delete(t)}else n||i.set(t,e)}n&&this.parser.raise(h.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(h.InvalidPrivateFieldResolution,e,{identifierName:t})}},he=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}isInitializer(){return this.type===4}},Dt=class extends he{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)}},Or=class{parser;stack=[new he];constructor(t){this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}canBeInParameters(){let t=this.stack[this.stack.length-1];return t.canBeArrowParameterDeclaration()||t.isCertainlyParameterDeclaration()}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 if(!i.isInitializer())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;for(let s=e.length-1;;s--){let r=e[s];if(r.canBeArrowParameterDeclaration())r.type===2&&r.recordDeclarationError(h.AwaitBindingIdentifier,t);else if(!r.isInitializer())return}}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors((s,r)=>{this.parser.raise(s,r);for(let i=t.length-2;;i--){let a=t[i];if(a.canBeArrowParameterDeclaration())a.clearDeclarationError(r);else if(!a.isInitializer())break}})}};function Fr(){return new Dt(1)}function Br(){return new Dt(2)}var Ye=new he,Ur=new he(3),Rr=new he(4),jr=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 Ee(t,e){return(t?2:0)|(e?1:0)}var _r=class extends Lr{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!(K(s)||s===92||(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(138)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Je(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Je(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(h.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}snapshotScopeStacks(){return{scopeDepth:this.scope.scopeStack.length,prodParamDepth:this.prodParam.stacks.length,classScopeDepth:this.classScope.stack.length,expressionScopeDepth:this.expressionScope.stack.length}}restoreScopeStacks(t){let{scope:e}=this;for(;e.scopeStack.length>t.scopeDepth;)e.exit();this.prodParam.stacks.length=t.prodParamDepth,this.classScope.stack.length=t.classScopeDepth,this.expressionScope.stack.length=t.expressionScopeDepth}tryParse(t,e=this.state.clone()){let s={node:null},r=this.snapshotScopeStacks();try{let i=t((a=null)=>{throw s.node=a,s});if(this.state.errors.length>e.errors.length){let a=this.state;return this.state=e,this.state.tokensLength=a.tokensLength,{node:i,error:a.errors[e.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let a=this.state;if(this.state=e,this.restoreScopeStacks(r),i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:a};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:a};throw i}}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(h.InvalidCoverInitializedName,s),r!=null&&this.raise(h.DuplicateProto,r),i!=null&&this.raise(h.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),n!=null&&this.raise(h.InvalidCoverDiscardElement,n)}isLiteralPropertyName(){return xt(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 jr;let o=this.classScope;this.classScope=new Mr(this);let l=this.expressionScope;return this.expressionScope=new Or(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)}},pe=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},ce=class{constructor(t,e,s,r){this.start=s,this.end=0,r!==void 0&&(this.loc=new ye(r)),t&128&&(this.range=[s,0]),r!==void 0&&e&&(this.loc.filename=e)}type=""},Mt=ce.prototype,Vr=class extends _r{createPosition(t){return t}startNode(){return this.startNodeAt(this.state.startLoc)}startNodeAt(t){this.setLoc(t);let{optionFlags:e,filename:s}=this;return e&256?new ce(e,s,t.index,this.createPosition(t)):new ce(e,s,t.index)}startNodeAtNode(t){let{optionFlags:e,filename:s}=this;return e&256?new ce(e,s,t.start,t.loc.start):new ce(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(Mt);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(Mt);return o.type=e,o.start=s,o.end=r,o.loc=i,o.range=a,o.extra=n,o.value=t.value,o}},Ie=t=>t.type==="ParenthesizedExpression"?Ie(t.expression):t,zr=class extends Vr{raiseOnce(t,e){let{errors:s}=this.state,r=s.length,i=this.raise(t,e);if(s.length!==r){for(let a=r-1;a>=0;a--)if(s[a].pos===i.pos&&s[a].reasonCode===i.reasonCode){s.pop();return}}}toAssignable(t,e=!1){let s;switch((t.type==="ParenthesizedExpression"||t.extra?.parenthesized)&&(s=Ie(t),e?s.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(h.InvalidParenthesizedAssignment,t):s.type!=="CallExpression"&&s.type!=="MemberExpression"&&!this.isOptionalMemberExpression(s)&&this.raiseOnce(h.InvalidParenthesizedAssignment,t):this.raiseOnce(h.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(h.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(h.MissingEqInAssignment,this.optionFlags&256?t.left.loc.end:t.left),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(h.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"?h.PatternHasAccessor:h.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(h.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(h.RestTrailingComma,a):e&&this.raise(h.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),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();this.next();let e=this.parseBindingAtom();return e.type==="VoidPattern"&&this.raise(h.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(h.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(h.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===137?(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(h.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(h.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(h.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,s,i);let{name:w}=t;r&&(r.has(w)?this.raise(h.ParamDupe,t):r.add(w));return}else o==="VoidPattern"&&e.type==="CatchClause"&&this.raise(h.VoidPatternCatchClauseParam,t);let p=Ie(t);n||(n=s!==64||p.type==="CallExpression"&&(p.callee.type==="Import"||p.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 w=s===64?h.InvalidLhs:h.InvalidLhsBinding;this.raise(w,t,{ancestor:e});return}let m,y;typeof u=="string"?(m=u,y=o==="ParenthesizedExpression"):[m,y]=u;let g=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:e,N=t[m];if(Array.isArray(N))for(let w of N)w&&this.checkLVal(w,g,s,r,i,y,!0);else N&&this.checkLVal(N,g,s,r,i,y,n)}checkIdentifier(t,e,s=!1){this.checkStrictBindReservedWord(t,e,s),e&8192&&t.name==="let"&&this.raise(h.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}checkStrictBindReservedWord(t,e,s=!1){this.state.strict&&(s?It(t.name,this.inModule):Et(t.name))&&(e===64?this.raise(h.StrictEvalArguments,t,{referenceName:t.name}):this.raise(h.StrictEvalArgumentsBinding,t,{bindingName:t.name}))}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(h.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(8)?(this.raise(this.lookaheadCharCode()===t?h.RestTrailingComma:h.ElementAfterRest,this.state.startLoc),!0):!1}},qr=class extends zr{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(h.DuplicateProto,r)),!0):e}shouldExitDescending(t){return t.type==="ArrowFunctionExpression"&&!t.extra?.parenthesized}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(138))throw this.raise(h.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(138))throw this.raise(h.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=Ot(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){return this.disallowInAnd(()=>this.parseMaybeAssign(t))}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(107);if(r&&this.prodParam.hasYield){this.next();let o=this.parseYield(s);return e&&(o=this.parseParenItem(o,s)),o}let i,a=!1;t?i=!1:(t=new pe,i=!0,this.expressionScope.canBeInParameters()&&(this.expressionScope.enter(Rr),a=!0)),this.state.canStartArrow=!0;let n=this.parseMaybeConditional(t);if(e&&(n=this.parseParenItem(n,s)),Hs(this.state.type)&&!(this.match(27)&&this.state.lastTokEndLoc.index===this.state.regExpAllowedAt)){let o=this.startNodeAt(s),l=this.state.value;if(o.operator=l,this.match(25)){this.toAssignable(n,!0),o.left=n;let p=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=p&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=p&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=p&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=p&&(t.voidPatternLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),a&&this.expressionScope.exit(),this.checkLVal(n,this.finishNode(o,"AssignmentExpression"),void 0,void 0,void 0,void 0,l==="||="||l==="&&="||l==="??="),o}else i&&(this.checkExpressionErrors(t,!0),a&&this.expressionScope.exit());if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?ne(o):ne(o)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(h.YieldNotInGeneratorFunction,s),this.parseYield(s)}return n}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(137)?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))}isEscapedKeywordOperatorAfterLineBreak(){return Pe(this.state.type)&&this.state.containsEsc&&this.hasPrecedingLineBreak()}isBinaryOperator(t){return Ws(t)&&(this.prodParam.hasIn||t!==54)&&!this.isEscapedKeywordOperatorAfterLineBreak()}parseExprOp(t,e,s){let r=this.state.type,i=this.isBinaryOperator(r);if(this.isPrivateName(t)){let a=this.getPrivateNameSV(t);(s>=ge(54)||r!==54||!i)&&this.raise(h.PrivateInExpectedIn,e,{identifierName:a}),this.classScope.usePrivateName(a,e)}if(i){let a=ge(r);if(a>s){if(r===35&&(this.expectPlugin("pipelineOperator"),this.prodParam.inFSharpPipelineDirectBody))return t;let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=r===37||r===38,l=r===36;l&&(a=ge(38)),this.next(),n.right=this.parseExprOpRightExpr(r,a);let p=this.finishNode(n,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===37||u===38)||o&&u===36)throw this.raise(h.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(p,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,Qs(t)?e-1:e)}parseHackPipeBody(){let{startLoc:t}=this.state,e=this.parseMaybeAssign();return Os.has(e.type)&&!e.extra?.parenthesized&&this.raise(h.PipeUnparenthesizedBody,t,{type:e.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(h.PipeTopicUnused,t),e}checkExponentialAfterUnary(t){this.match(53)&&this.raise(h.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,r=this.isContextual(93);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(Xs(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=Ie(a.argument);l.type==="Identifier"?this.raise(h.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(h.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")?ne(o):ne(o)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(h.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(;Js(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;if(t!=null&&(this.match(2)||this.match(0))){let r=new pe,i=this.parseExprAtom(r),a=this.parseSubscripts(i,e);return a!==i?this.checkExpressionErrors(r,!0):(t.shorthandAssignLoc??(t.shorthandAssignLoc=r.shorthandAssignLoc),t.doubleProtoLoc??(t.doubleProtoLoc=r.doubleProtoLoc),t.privateKeyLoc??(t.privateKeyLoc=r.privateKeyLoc),t.optionalParametersLoc??(t.optionalParametersLoc=r.optionalParametersLoc),t.voidPatternLoc??(t.voidPatternLoc=r.voidPatternLoc)),a}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(Ve(i))return this.parseTaggedTemplateExpression(t,e,r);let a=!1;if(i===14){if(s&&(this.raise(h.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(137)?(t.type==="Super"&&this.raise(h.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.parseNoCallExpr(a=>{throw this.raise(h.UnsupportedBindRHS,a)});if(i.type==="Super"||i.type==="Import")throw this.raise(h.UnsupportedBindRHS,i);return r.callee=i,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(Br()),i=new pe),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(h.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(h.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(h.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&&oe(t,e.innerComments),e.callee.trailingComments&&oe(t,e.callee.trailingComments),t}parseNoCallExpr(t){let e=this.state.startLoc,s=this.match(79);this.state.canStartArrow=!1;let r=this.parseExprAtom();return s&&r.type==="ImportExpression"&&t(r),this.parseSubscripts(r,e,!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.parseImportMetaPropertyOrPhaseCallOrSyncCall(e):this.match(6)?this.optionFlags&1024?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(h.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 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 133: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(a=>{throw this.raise(h.UnsupportedBind,a)});if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(h.UnsupportedBind,i)}case 137:return this.raise(h.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(R(i)||i===62)&&this.expectOnePlugin(["jsx","flow","typescript"]),this.unexpected()}default:if(A(r)){if(this.isContextual(126)&&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(A(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=M(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(h.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference");throw this.raise(h.PipeTopicUnconfiguredToken,e,{token:H(r)})}testTopicReferenceConfiguration(t,e,s){if(t==="hack")return this.hasPlugin(["pipelineOperator",{topicToken:H(s)}]);throw this.raise(h.PipeTopicRequiresHackPipes,e)}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Ee(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(h.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(h.SuperNotAllowed,t):this.scope.allowSuper||this.raise(h.UnexpectedSuper,t),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(h.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(M(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(100)?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(h.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCallOrSyncCall(t){if(this.next(),this.isContextual(102)||this.isContextual(94)){let e=this.isContextual(102);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=e?"source":"defer",this.parseImportCall(t)}else{if(this.isContextual(105))return this.expectPlugin("importSync"),this.next(),t.sync=!0,this.parseImportCall(t);{let e=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(98)&&(this.inModule||this.raise(h.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(Fr());let r=this.state.startLoc,i=[],a=new pe,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 m=this.state.startLoc;if(o=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),m)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,!0))}let p=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,p)):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(h.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.parseNoCallExpr(s=>{this.raise(h.ImportCallNotNewExpression,s,s)});t.callee=e,e.type==="Import"&&this.raise(h.ImportCallNotNewExpression,e),e.type==="Super"&&this.raise(h.SuperCallNotNewExpression,e)}parseTemplateElement(t){let{start:e,startLoc:s,end:r,value:i}=this.state,a=e+1,n=this.startNodeAt(M(s,1));i===null&&(t||this.raise(h.InvalidEscapeSequenceTemplate,M(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(20),l=o?-1:-2,p=r+l;n.value={raw:this.input.slice(a,p).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,M(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(h.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,p=l.name;p==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(l),n=this.eat(51),this.parsePropertyName(s)),(p==="get"||p==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),s.kind=p,this.match(51)&&(n=!0,this.raise(h.AccessorIsGenerator,this.state.curPosition(),{kind:p}),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"?h.BadGetterArity:h.BadSetterArity,t),t.kind==="set"&&s[s.length-1]?.type==="RestElement"&&this.raise(h.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(h.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(L(s))i=this.parseIdentifier(!0);else switch(s){case 134:i=this.parseNumericLiteral(r);break;case 133:i=this.parseStringLiteral(r);break;case 135:i=this.parseBigIntLiteral(r);break;case 137:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(h.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:throw this.unexpected()}t.key=i,s!==137&&(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(Ee(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=Ee(s,!1),a=this.match(2);return a||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(t,s),e&&this.setArrowFunctionParameters(t,e,r),this.parseFunctionBody(t,!0),a&&(this.state.regExpAllowedAt=this.state.lastTokEndLoc.index),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(Ye),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(h.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),t.id&&this.checkStrictBindReservedWord(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(h.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(h.UnexpectedArgumentPlaceholder,this.state.startLoc);let a=this.startNode();this.next(),i=this.finishNode(a,"ArgumentPlaceholder")}else i=this.parseMaybeAssignAllowInOrVoidPattern(t,s,!0);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;L(r)?e=this.state.value:this.unexpected();let i=qs(r);return t?i&&this.replaceToken(131):this.checkReservedWord(e,this.sourceToOffsetPos(s),i,!1),this.next(),e}checkReservedWord(t,e,s,r){if(!(t.length>10||!ar(t))){if(s&&Ct(t)){this.raise(h.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?It:At:$e)(t,this.inModule)){this.raise(h.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(h.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(h.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(h.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(h.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,r=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(h.AwaitExpressionFormalParameter,s),this.eat(51)&&this.raise(h.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),e||(this.state.canStartArrow=!1,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||Ve(t)||t===99&&!this.state.containsEsc||t===136||t===52||this.hasPlugin("v8intrinsic")&&t===50}parseYield(t){let e=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(h.YieldInParameter,t.index);let s=!1,r=null;if(!this.hasPrecedingLineBreak())switch(s=this.eat(51),this.state.type){case 9:case 138:case 4:case 7:case 1:case 5:case 10:case 8:if(!s)break;case 54:if(this.options.annexB&&!s)break;default:r=this.parseMaybeAssign()}return r||(this.state.regExpAllowedAt=this.state.lastTokEndLoc.index),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(h.ImportCallArity,t,t);else for(let s of e)s.type==="SpreadElement"&&this.raise(h.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(93)&&this.recordAwaitIfAllowed()){this.next(),s=this.parseAwait(e,!0);let r=this.state.type;r!==35&&this.isBinaryOperator(r)&&this.raise(h.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){}},Qe={kind:1},$r={kind:2},Hr=/[\uD800-\uDFFF]/u,Ze=/in(?:stanceof)?/y,et=/[a-z]{2,10}/y;function Ot(t){for(let e=0;e<t.length;e++){let s=t[e],{type:r}=s;typeof r=="number"&&(s.type=gt(r))}return t}var Kr=class extends qr{parseTopLevel(t,e){return t.program=this.parseProgram(e,138,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&512&&(t.tokens=Ot(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(h.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===138?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",M(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(97)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(106)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(106))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(93))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(R(t)){if(Ze.lastIndex=e,Ze.test(this.input)){let s=this.codePointAtPos(Ze.lastIndex);if(!K(s)&&s!==92)return!1}return!0}else return t===92}isReservedWordOnNewLineAfterLet(t){if(!Je(this.input,this.state.end,t)||(et.lastIndex=t,!et.test(this.input)))return!1;let e=et.lastIndex,s=this.codePointAtPos(e);if(K(s)||s===92)return!1;let r=this.input.slice(t,e);return Ct(r)||$e(r,!1)}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?h.StrictFunction:this.options.annexB?h.SloppyFunctionAnnexB:h.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,t);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 104:if(!this.state.containsEsc&&this.nextTokenIsIdentifierOnSameLine())return this.expectPlugin("structs"),i||this.unexpected(),this.parseStructDeclaration(r,!1);break;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 93:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(h.AwaitUsingNotInAsyncContext,r):this.raise(h.UnexpectedLexicalDeclaration,r):this.raise(h.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 106:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(h.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(h.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 97:{if(this.state.containsEsc)break;let p=this.nextTokenStart(),u=this.codePointAtPos(p);if(u!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,p)&&u!==123||this.isReservedWordOnNewLineAfterLet(p)))break}case 71:i||this.raise(h.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let p=this.state.value;return this.parseVarStatement(r,p)}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 p=this.lookaheadCharCode();if(p===40||p===46)break}case 78:{!(this.optionFlags&8)&&!n&&this.raise(h.UnexpectedImportExport,this.state.startLoc),this.next();let p;return s===79?p=this.parseImport(r):p=this.parseExport(r,e),this.assertModuleNodeAllowed(p),p}default:if(this.isAsyncFunction())return i||this.raise(h.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,t)}let o=this.state.value;if(s===89&&this.lookahead().type===10){let p=this.parseIdentifier(!0);return this.next(),this.parseLabeledStatement(r,o,p,t)}let l=this.parseExpression();return A(s)&&l.type==="Identifier"&&this.eat(10)?this.parseLabeledStatement(r,o,l,t):this.parseExpressionStatement(r,l,t)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(h.ImportOutsideModule,t)}maybeTakeDecorators(t,e,s){return t&&(e.decorators?.length?(this.raise(h.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(h.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(h.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(12);){let r=this.startNodeAt(e);r.object=s,this.match(137)?(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.match(89)),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(h.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(Qe),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(Qe);let e=null;if(this.isContextual(93)&&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(97);{let o=this.isAwaitUsing(),l=o||this.isForUsing(),p=s&&this.hasFollowingBindingAtom()||l;if(this.match(70)||this.match(71)||p){let u=this.startNode(),m;o?(m="await using",this.recordAwaitIfAllowed()||this.raise(h.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):m=this.state.value,this.next(),this.parseVar(u,!0,m);let y=this.finishNode(u,"VariableDeclaration"),g=this.match(54);return g&&l&&this.raise(h.ForInUsing,y),(g||this.isContextual(99))&&y.declarations.length===1?this.parseForX(t,y,e):(e!==null&&this.unexpected(e),this.parseFor(t,y))}}let r=this.isContextual(92),i=new pe,a=this.parseExpression(!0,i),n=this.isContextual(99);if(n&&(s&&this.raise(h.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(h.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.parseForX(t,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){this.next();let r=1|(e?8:0);return!(s&2)&&s&4&&(r|=16,s&8||(r|=2)),this.parseFunction(t,r)}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(h.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($r),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(h.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(h.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(h.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(Qe),t.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(h.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(h.LabelRedeclaration,s,{labelName:e});let i=Ks(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 p=this.stmtToDirective(l);e.push(p),!n&&p.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")}parseForX(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(h.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(h.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&&!(e&&i.length===0&&(this.match(54)||this.isContextual(99)))&&(a.id.type!=="Identifier"?this.raise(h.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&this.raise(h.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(h.UsingDeclarationHasBindingPattern,s):s.type==="VoidPattern"&&this.raise(h.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&1),r=s&&!(e&4),i=!!(e&8);return this.initFunction(t,i),this.match(51)&&(e&16&&this.raise(h.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),s&&(t.id=this.parseFunctionId(r)),this.scope.enter(514),this.prodParam.enter(Ee(i,t.generator)),!s&&A(this.state.type)&&(this.expressionScope.enter(Ye),t.id=this.parseFunctionId(),this.expressionScope.exit()),this.parseFunctionParams(t,!1),this.parseFunctionBodyAndFinish(t,s?"FunctionDeclaration":"FunctionExpression"),this.prodParam.exit(),this.scope.exit(),s&&!(e&2)&&this.registerFunctionStatementId(t),t}parseFunctionId(t){return t||A(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(6),this.expressionScope.enter(Ur),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(h.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(h.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(103);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,p=i,u=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(51)){p.kind="method";let I=this.match(137);if(this.parseClassElementName(p),this.parsePostMemberNameModifiers(p),I){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(h.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let m=!this.state.containsEsc&&A(this.state.type),y=this.parseClassElementName(e),g=m?y.name:null,N=this.isPrivateName(y),w=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(p.kind="method",N){this.pushClassPrivateMethod(t,a,!1,!1);return}let I=this.isNonstaticConstructor(i),C=!1;I&&(i.kind="constructor",i.decorators&&i.decorators.length>0&&this.raise(h.DecoratorConstructor,e),s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(h.DuplicateConstructor,y),I&&this.hasPlugin("typescript")&&e.override&&this.raise(h.OverrideOnConstructor,y),s.hadConstructor=!0,C=s.hadSuperClass),this.pushClassMethod(t,i,!1,!1,I,C)}else if(this.isClassProperty())N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(g==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(y);let I=this.eat(51);u.optional&&this.unexpected(w),p.kind="method";let C=this.match(137);this.parseClassElementName(p),this.parsePostMemberNameModifiers(u),C?this.pushClassPrivateMethod(t,a,I,!0):(this.isNonstaticConstructor(i)&&this.raise(h.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,I,!0,!1,!1))}else if((g==="get"||g==="set")&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(y),p.kind=g;let I=this.match(137);this.parseClassElementName(i),I?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(h.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 I=this.match(137);this.parseClassElementName(n),this.pushClassAccessorProperty(t,l,I)}else this.isLineTerminator()?N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===131||e===133)&&t.static&&s==="prototype"&&this.raise(h.StaticPrototype,this.state.startLoc),e===137){s==="constructor"&&this.raise(h.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(h.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(h.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(h.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(Ye),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(A(this.state.type))t.id=this.parseIdentifier(),this.checkStrictBindReservedWord(t.id,r),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(h.MissingClassName,this.state.startLoc)}parseClassSuper(t){this.eat(77)?(this.state.canStartArrow=!1,t.superClass=this.parseExprSubscripts()):t.superClass=null}parseStructDeclaration(t,e){this.next();let s=this.state.strict;return this.state.strict=!0,this.parseClassId(t,!0,e),this.parseClassSuper(t),t.body=this.parseStructBody(!!t.superClass,s),this.finishNode(t,"StructDeclaration")}parseStructBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},r=this.startNode();for(r.body=[],this.expect(2);!this.match(4);){if(this.eat(9))continue;let i=this.startNode();this.parseClassMember(r,i,s)}return this.state.strict=e,this.next(),this.classScope.exit(),this.finishNode(r,"StructBody")}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;if(a&&!n){if(r&&this.unexpected(),e)throw this.raise(h.UnsupportedDecoratorExport,t);return t.phase==="defer"&&this.raise(h.DeferExportInvalidAll,t),this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let l=o&&this.maybeParseExportNamedSpecifiers(t),p=r||a||t.phase==="defer"||l&&t.specifiers[0]?.type==="ExportNamespaceSpecifier";r&&i&&!a&&!l&&this.unexpected(null,2);let u;if(p||l){if(u=!1,e)throw this.raise(h.UnsupportedDecoratorExport,t);this.parseExportFrom(t,p)}else u=this.maybeParseExportDeclaration(t);if(p||l||u){let m=t;if(this.checkNamedExport(m,!!m.source),m.declaration?.type==="ClassDeclaration")this.maybeTakeDecorators(e,m.declaration,m);else if(e)throw this.raise(h.UnsupportedDecoratorExport,t);return this.hasPlugin("deferredReexports")&&(m.phase??(m.phase=null)),this.sawUnambiguousESM=!0,this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(61)){let m=t,y=this.parseExportDefaultExpression();if(m.declaration=y,y.type==="ClassDeclaration")this.maybeTakeDecorators(e,y,m);else if(e)throw this.raise(h.UnsupportedDecoratorExport,t);return this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")&&y.type==="Identifier"&&y.name==="from"&&y.end-y.start===4&&!y.extra?.parenthesized&&this.raise(h.ExportDefaultFromAsIdentifier,y),this.sawUnambiguousESM=!0,this.finishNode(m,"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(90)){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",r=this.state.startLoc;this.setLoc(r);let i=this.parseExportSpecifiers(s);if(this.isContextual(90)&&!this.hasPrecedingLineBreak()){this.expectPlugin("namespaceImportFilter");let a=this.startNodeAt(r);a.exportsFilter=this.toNamespaceExportsFilter(i),this.next(),a.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(a,"ExportNamespaceSpecifier"))}else e.specifiers.push(...i);return 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(92))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.isContextual(104)){let s=this.nextTokenInLineStart(),r=this.codePointAtPos(s);if(r===123||this.chStartsBindingIdentifier(r,s))return this.expectPlugin("structs"),this.parseStructDeclaration(t,!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.isReservedWordOnNewLineAfterLet(this.nextTokenStart())||this.isUsing()||this.isAwaitUsing())throw this.raise(h.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.isContextual(104)&&this.nextTokenIsIdentifierOnSameLine()?(this.expectPlugin("structs"),this.parseStructDeclaration(this.startNode(),!1)):this.isContextual(97)?this.parseVarStatement(this.startNode(),"let"):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(A(t)){if(t===92&&!this.state.containsEsc||t===97)return!1;if((t===129||t===128||t===104)&&!this.state.containsEsc){let r=this.nextTokenStart(),i=this.input.charCodeAt(r);if(i===123||this.chStartsBindingIdentifier(i,r)&&!this.isUnparsedContextual(r,"from"))return t!==104&&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||A(this.state.type)&&s)return!0;if(this.match(61)&&s){let r=this.input.charCodeAt(this.hasPlugin("exportDefaultFrom")?this.nextTokenStartSince(e+4):this.nextTokenInLineStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(95)?(t.source=this.parseImportSource(),this.maybeParseImportAttributes(t)):e&&this.unexpected(null,95),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===22&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?!0:this.isUsing()?(this.raise(h.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(h.UsingDeclarationExport,this.state.startLoc),!0):t===70||t===71||t===64||t===76||this.isLet()||this.isAsyncFunction()||this.isContextual(104)&&this.nextTokenIsIdentifierOnSameLine()}checkNamedExport(t,e){if(t.specifiers?.length)for(let s of t.specifiers){let{exported:r}=s,i=r.type==="Identifier"?r.name:r.value;if(this.checkDuplicateExports(s,i),!e&&s.type==="ExportSpecifier"){let{local:a}=s;a.type!=="Identifier"?this.raise(h.ExportBindingIsString,s,{localName:a.value,exportName:i}):(this.checkReservedWord(a.name,a.start,!0,!1),this.scope.checkLocalExport(a))}}else if(t.declaration){let s=t.declaration;if(s.type==="FunctionDeclaration"||s.type==="ClassDeclaration"||s.type==="StructDeclaration"){let{id:r}=s;if(!r)throw new Error("Assertion failure");this.checkDuplicateExports(t,r.name)}else if(s.type==="VariableDeclaration")for(let r of s.declarations)this.checkDeclaration(r.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(h.DuplicateDefaultExport,t):this.raise(h.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(129),i=this.match(133),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(90)?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(133)){let t=this.parseStringLiteral(this.state.value),e=Hr.exec(t.value);return e&&this.raise(h.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}toNamespaceExportsFilter(t){let e=new Set;return t.map(s=>{let r,i,a;s.type==="ImportSpecifier"?{imported:r,local:i,importKind:a}=s:{local:r,exported:i,exportKind:a}=s;let n=r.type==="Identifier"?r.name:this.isStringModuleExportName(r)?r.value:null;n!==null&&(e.has(n)&&this.raise(h.FilteredNamespaceDuplicateName,r,{name:n}),e.add(n));let o=!1;return i.start!==r.start&&(this.raise(h.FilteredNamespaceRename,i),o=!0),(a==="type"||a==="typeof")&&(this.raise(h.FilteredNamespaceTypeModifier,s),o=!0),o?s:(this.replaceNodeInPendingComments(s,r),r)})}checkImportPhase(t){if(t.phase==null)return;let{specifiers:e}=t,s=e.length===1?e[0].type:null;t.phase==="source"?s!=="ImportDefaultSpecifier"&&this.raise(h.SourcePhaseImportRequiresDefault,t):t.phase==="defer"&&s!=="ImportNamespaceSpecifier"&&this.raise(h.DeferImportRequiresNamespace,t)}isPotentialImportPhase(t){if(t){if(!this.isContextual(94))return!1;let e=this.lookaheadCharCode();return e===123||e===42}return this.isContextual(102)||this.isContextual(94)}applyImportPhase(t,e,s,r){if(e){s==="defer"&&(this.expectPlugin("deferredReexports",r),t.phase="defer");return}s==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):(this.hasPlugin("sourcePhaseImports")||this.hasPlugin("deferredImportEvaluation"))&&(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(L(i)?i!==95||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 A(e)?e!==95||this.lookaheadCharCode()===102:e!==8}parseImport(t){return this.match(133)?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.parseNamedOrFilteredImportSpecifiers(t),this.expectContextual(95),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(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e){return this.checkLVal(t.local,{type:e},8201),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(h.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(133)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(10),!this.match(133))throw this.raise(h.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(L(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(90),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedOrFilteredImportSpecifiers(t){let e=this.state.startLoc;this.setLoc(e);let s=t.specifiers.length;if(this.parseNamedImportSpecifiers(t),this.isContextual(90)){this.expectPlugin("namespaceImportFilter");let i=this.startNodeAt(e);i.exportsFilter=this.toNamespaceExportsFilter(t.specifiers.splice(s)),this.next(),this.parseImportSpecifierLocal(t,i,"ImportNamespaceSpecifier");return}let r=t.importKind==="type"||t.importKind==="typeof";for(let i=s;i<t.specifiers.length;i++)this.checkImportSpecifier(t.specifiers[i],r)}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(2);!this.eat(4);){if(e)e=!1;else{if(this.eat(10))throw this.raise(h.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let s=this.startNode(),r=this.match(133),i=this.isContextual(129);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",i);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,r){return this.eatContextual(90)?t.local=this.parseIdentifier():t.local??(t.local=this.cloneIdentifier(t.imported)),this.finishNode(t,"ImportSpecifier")}checkImportSpecifier(t,e,s=8201,r=!0){let{imported:i,local:a}=t;if(this.isStringModuleExportName(a))throw this.raise(h.ImportBindingIsString,t,{importName:i.value});r&&a.start===i.start&&this.checkReservedWord(a.name,a.start,!0,!0),this.checkLVal(a,{type:"ImportSpecifier"},s)}isStringModuleExportName(t){return t.type==="StringLiteral"||t.type==="Literal"}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},tt=/in(?:stanceof)?|as|satisfies/y;function Wr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function Ft(t){if(!t)throw new Error("Assert fail")}var Jr={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.",DeclaratorDefiniteAssertionRequiresTypeAnnotation:"Declarations with definite assignment assertions must also have type annotations.",DeclaratorDefiniteAssertionWithInitializer:"Declarations with initializers cannot also have definite assignment assertions.",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.`,EmptyNamespaceName:"Namespace must be given a name.",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.`,InvalidNamespaceName:t=>`Namespace name cannot be '${t}'.`,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.`},d=B`typescript`(Jr);function Xr(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 Bt(t){return t==="private"||t==="public"||t==="protected"}function Gr(t){return t==="in"||t==="out"}function st(t){if(t.extra?.parenthesized)return!1;switch(t.type){case"Identifier":return!0;case"MemberExpression":return!t.computed&&st(t.object);case"TSInstantiationExpression":return st(t.expression);default:return!1}}function rt(t){switch(t.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":return!0;default:return!1}}var Yr=G(["declare","private","public","protected","override","abstract","readonly","static"],["in","out"]),Qr=G(["readonly"],["declare","abstract","private","protected","public","static","override"]),Zr=G(["public","private","protected","override","readonly"]),ei=G(["private","public","protected"]),ti=t=>class extends t{getScopeHandler(){return br}tsIsIdentifier(){return A(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(137)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(103)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s,r){if(!A(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let i=this.state.value;if(e.has(i)){if(r&&this.match(103)||s&&this.tsIsStartOfStaticBlocks())return;let a=this.state.containsEsc&&!A(this.state.type)?this.state.startLoc:null;if(a&&(this.state.containsEsc=!1),this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return a&&this.raise(h.InvalidEscapedReservedWord,a,{reservedWord:i}),i;a&&(this.state.containsEsc=!0)}}tsParseModifiers(e,s=d.InvalidModifierOnTypeMember,r,i=!1){let a=(o,l,p,u)=>{l===p&&r[u]&&this.raise(d.InvalidModifiersOrder,o,{orderedModifiers:[p,u]})},n=(o,l,p,u)=>{(r[p]&&l===u||r[u]&&l===p)&&this.raise(d.IncompatibleModifiers,o,{modifiers:[p,u]})};for(;;){let{startLoc:o}=this.state,l=this.tsParseModifier(e,i,r.static);if(!l)break;Bt(l)?r.accessibility?this.raise(d.DuplicateAccessibilityModifier,o,{modifier:l}):(a(o,l,l,"override"),a(o,l,l,"static"),a(o,l,l,"readonly"),r.accessibility=l):Gr(l)?(r[l]&&this.raise(d.DuplicateModifier,o,{modifier:l}),r[l]=!0,a(o,l,"in","out")):(De(r,l)?this.raise(d.DuplicateModifier,o,{modifier:l}):(a(o,l,"static","readonly"),a(o,l,"static","override"),a(o,l,"override","readonly"),a(o,l,"abstract","override"),n(o,l,"declare","override"),n(o,l,"static","abstract")),r[l]=!0),e.get(l)||this.raise(s,o,{modifier:l})}}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 Wr(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(133)?e.source=this.parseStringLiteral(this.state.value):(this.raise(d.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;A(r)||r===133?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,G(["in","out"],["const","public","private","protected","readonly","declare","abstract","override"]),d.InvalidModifierOnTypeParameter);tsParseConstModifier=this.tsParseModifiers.bind(this,G(["const"],["in","out"]),d.InvalidModifierOnTypeParameterPositions);tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,G(["in","out","const"],["public","private","protected","readonly","declare","abstract","override"]),d.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(141)?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(d.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(d.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(),A(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(d.ReadonlyForMethodSignature,e);let r=e;if(r.kind&&this.match(43)&&this.raise(d.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,r),this.tsParseTypeMemberSemicolon(),r.kind==="get")r.params.length>0&&(this.raise(h.BadGetterArity,this.state.curPosition()),this.isThisParam(r.params[0])&&this.raise(d.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r.params.length!==1)this.raise(h.BadSetterArity,this.state.curPosition());else{let i=r.params[0];this.isThisParam(i)&&this.raise(d.AccessorCannotDeclareThisParameter,this.state.curPosition()),i.type==="Identifier"&&i.optional&&this.raise(d.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),i.type==="RestElement"&&this.raise(d.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r.returnType&&this.raise(d.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(Qr,void 0,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(121):(this.isContextual(121)&&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(121)):this.eatContextual(121)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(90)?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(d.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=L(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 p=this.state.value,u=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(i=!0,a=this.createIdentifier(this.startNodeAt(r),p),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 p;a?(p=this.startNodeAt(r),p.optional=n,p.label=a,p.elementType=o,this.eat(13)&&(p.optional=!0,this.raise(d.TupleOptionalAfterType,this.state.lastTokStartLoc))):(p=this.startNodeAt(r),p.optional=n,this.raise(d.InvalidTupleMemberLabel,o),p.label=o,p.elementType=this.tsParseType()),o=this.finishNode(p,"TSNamedTupleMember")}else if(n){let p=this.startNodeAt(r);p.typeAnnotation=o,o=this.finishNode(p,"TSOptionalType")}if(s){let p=this.startNodeAt(e);p.typeAnnotation=o,o=this.finishNode(p,"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 134:case 135:case 133: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(115)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==134&&s.type!==135&&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(A(e)||e===84||e===80){let s=e===84?"TSVoidKeyword":e===80?"TSNullKeyword":Xr(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(d.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(114);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 Gs(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(114)?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(A(this.state.type)||this.match(74))return this.next(),!0;let e=this.match(2);if(e||this.match(0)){e||this.next();let{errors:s}=this.state,r=s.length,i=this.snapshotScopeStacks();try{return e?this.parseObjectLike(4,!0):super.parseBindingList(1,93,1),s.length===r}catch{return this.restoreScopeStacks(i),!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(115)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==108)return!1;let e=this.state.containsEsc;return this.next(),!A(this.state.type)&&!this.match(74)?!1:(e&&this.raise(h.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(){Ft(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(123)&&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(d.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),this.state.canStartArrow=!1,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());st(i)||this.raise(d.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(d.EmptyHeritageClauseType,s,{token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(128),s.declare&&(e.declare=!0),A(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(d.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(113)&&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(133)?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(125),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(111);if(s)e.kind="global",e.id=this.parseIdentifier();else{e.kind="module";let{type:r,value:i}=this.state;r===133?e.id=super.parseStringLiteral(i):A(r)?(this.raise(d.InlineModuleDeclarationMustUseString,this.state.startLoc),e.id=this.tsParseEntityName(0)):r===2?this.raise(d.EmptyNamespaceName,this.state.startLoc):(this.raise(d.InvalidNamespaceName,this.state.startLoc,i),e.id=super.parseExprAtom())}return 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(d.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(118)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(118),this.expect(6),this.match(133)||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,2);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 125:return this.tsParseEnumDeclaration(e,{declare:!0});case 111:return this.tsParseAmbientExternalModuleDeclaration(e);case 97: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 106:if(this.isUsing())return this.raise(d.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 93:if(this.isAwaitUsing())return this.raise(d.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 128:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(A(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 123:if(this.tsCheckLineTerminator(r)&&(this.match(76)||A(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case 126:if(this.tsCheckLineTerminator(r))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 127:if(this.tsCheckLineTerminator(r)&&A(this.state.type))return e.kind="namespace",this.tsParseNamespaceDeclaration(e);break;case 129:if(this.tsCheckLineTerminator(r)&&A(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(d.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===E.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Ys(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,s){let r=s.length?null:this.state.startLoc,i={};this.tsParseModifiers(Zr,void 0,i);let a=i.accessibility,n=i.override,o=i.readonly;!(e&4)&&(a||o||n)&&this.raise(d.UnexpectedParameterModifier,r||s[0]);let l=this.state.startLoc,p=this.parseMaybeDefault(l);e&2&&this.parseFunctionParamType(p);let u=this.parseMaybeDefault(l,p);if(a||o||n){let m=r?this.startNodeAt(r):this.startNodeAtNode(s[0]);return s.length&&(m.decorators=s),a&&(m.accessibility=a),o&&(m.readonly=o),n&&(m.override=n),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(d.UnsupportedParameterPropertyKind,r||s[0]),m.parameter=u,this.finishNode(m,"TSParameterProperty")}return s.length&&(p.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(d.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(d.UnexpectedParameterModifier,a):a.type==="AssignmentPattern"&&this.raise(d.UnexpectedParameterInitializer,a);else for(let a of e.params)a.type==="AssignmentPattern"&&this.raise(d.UnexpectedParameterInitializer,a);return this.finishNode(e,i)}return i&&this.state.isAmbientContext&&(this.raise(d.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(d.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 m=this.tsTryParseGenericAsyncArrowFunction(s);if(m)return i.stop=!0,m}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(a&&!this.match(6)){n=this.state.curPosition();return}if(Ve(this.state.type)){let m=super.parseTaggedTemplateExpression(e,s,i);return m.typeArguments=l,m}if(!r&&this.eat(6)){let m=this.startNodeAt(s);return m.callee=e,m.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(m.arguments),m.typeArguments=l,i.optionalChainMember&&(m.optional=a),this.finishCallExpression(m,i.optionalChainMember)}let p=this.state.type;if(p===44||p===48||p!==6&&p!==90&&p!==119&&ne(p)&&!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(d.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(ge(54)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(90)||(i=this.isContextual(119)))){let a=this.startNodeAt(s);a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(i&&this.raise(h.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(129)){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(133))return e.importKind="value",this.scope.inTSNamespace&&this.raise(d.ImportInTSNamespace,e),super.parseImport(e);let s;if(A(this.state.type)&&this.lookaheadCharCode()===61){e.importKind="value";let r=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&r.moduleReference.type==="TSExternalModuleReference"&&this.raise(d.ImportInTSNamespace,e),r}else if(this.isContextual(129)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(d.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(d.TypeImportCannotSpecifyDefaultAndNamed,s):this.scope.inTSNamespace&&this.raise(d.ImportInTSNamespace,s),s}parseExport(e,s){if(this.match(79)){let r=this.startNode();this.next();let i=null;this.isContextual(129)&&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(d.ExportAssignmentInTSNamespace,r),this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(90)){let r=e;return this.expectContextual(127),r.id=this.parseIdentifier(),this.checkIdentifier(r.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(d.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(d.ExportInTSNamespace,r),r}}isAbstractClass(){return this.isContextual(123)&&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(128)){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&&!e.declare&&(s==="using"||s==="await using"))return this.raiseOverwrite(d.UsingDeclarationInAmbientContext,e,s),a;for(let n of a.declarations){let{id:o,init:l,definite:p}=n;p&&(l?this.raise(d.DeclaratorDefiniteAssertionWithInitializer,o):o.typeAnnotation||this.raise(d.DeclaratorDefiniteAssertionRequiresTypeAnnotation,o)),i&&l&&(s==="var"||s==="let"||o.typeAnnotation?this.raise(d.InitializerNotAllowedInAmbientContext,l):ri(l,this.hasPlugin("estree"))||this.raise(d.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l))}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 123:case 124:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,a=this.startNode();this.next();let n=i===124?this.tsTryParseDeclare(a):this.tsParseAbstractDeclaration(a,s);return n?(i===124&&(n.declare=!0),n):(a.expression=this.createIdentifier(this.startNodeAtNode(a),i===124?"declare":"abstract"),this.semicolon(!1),this.finishNode(a,"ExpressionStatement"))}break}case 125:return this.tsParseEnumDeclaration(this.startNode());case 111:{if(this.lookaheadCharCode()===123){let i=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(i)}break}case 128:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return r||this.raise(d.UnexpectedTypeDeclaration,i,"interface"),i;break}case 126:{if(this.nextTokenIsStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,126,!1,s)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(d.InlineModuleDeclarationMustUseString,this.state.startLoc);let i=this.startNode();return this.next(),this.tsParseDeclaration(i,127,!1,s)}break}case 127:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,127,!1,s)}break}case 129:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return r||this.raise(d.UnexpectedTypeDeclaration,i,"type"),this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(ei)}tsHasSomeModifiers(e,s){return s.some(r=>Bt(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(103)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){this.tsParseModifiers(Yr,d.InvalidModifierOnTypeParameterPositions,s,!0);let i=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,["declare","private","public","protected","override","abstract","readonly","static"])&&this.raise(d.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(i):i(),s.decorators&&s.decorators.length>0&&!this.hasPlugin("decorators-legacy")&&(s.type==="TSAbstractMethodDefinition"||s.type==="TSDeclareMethod"?this.raise(d.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(d.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(d.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(d.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(d.IndexSignatureHasDeclare,s),s.override&&this.raise(d.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(d.NonAbstractClassHasAbstractMethod,s),s.override&&(r.hadSuperClass||this.raise(d.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,r,i)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(d.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(d.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(124))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,r=this.eatContextual(124);if(r&&(this.isContextual(124)||!this.shouldParseExportDeclaration()))throw this.raise(d.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let i=A(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(112)){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),e.definite&&(this.match(25)?this.raise(d.DeclaratorDefiniteAssertionWithInitializer,e):s||this.raise(d.DeclaratorDefiniteAssertionRequiresTypeAnnotation,e))}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(25)&&this.raise(d.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:s}=e;this.raise(d.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(d.PrivateElementHasAbstract,e),e.accessibility&&this.raise(d.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(d.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,i,a,n){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&a&&this.raise(d.ConstructorHasTypeParameters,o);let{declare:l=!1,kind:p}=s;l&&(p==="get"||p==="set")&&this.raise(d.DeclareAccessor,s,{kind:p}),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(112)&&(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(141)||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,p=l[l.length-1];(p===E.j_oTag||p===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 p=super.parseMaybeAssign(e,s);if((p.type!=="ArrowFunctionExpression"||p.extra?.parenthesized)&&l(),n?.params.length!==0&&this.resetStartLocationFromNode(p,n),p.typeParameters=n,this.hasPlugin("jsx")&&p.typeParameters.params.length===1&&!p.typeParameters.extra?.trailingComma){let u=p.typeParameters.params[0];u.constraint||this.raise(d.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?M(u.loc.end,1):u,{typeParameterName:u.name.name})}return p},r);if(!o.error&&!o.aborted)return n&&this.reportReservedArrowTypeParam(n),o.node;if(!i&&(Ft(!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(d.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){if(rt(e)){s?this.expressionScope.recordArrowParameterBindingError(d.UnexpectedTypeCastInParameter,e):this.raiseOnce(d.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);return}switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){rt(e.expression)||e.expression.type==="ParenthesizedExpression"?this.toAssignable(e.expression,s):super.toAssignable(e,s)}checkToRestConversion(e,s){rt(e)?this.checkToRestConversion(e.expression,!1):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(d.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(128))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(d.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:p}=l;this.raise(d.AbstractMethodHasImplementation,l,{methodName:p.type==="Identifier"&&!l.computed?p.name:`[${this.input.slice(this.offsetToSourcePos(p.start),this.offsetToSourcePos(p.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.parseTypeOnlyExportSpecifier(e,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,i))}parseImportSpecifier(e,s,r,i){return!s&&i?(this.parseTypeOnlyImportSpecifier(e),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,i))}checkImportSpecifier(e,s){let r=e.importKind==="type";r&&s&&this.raise(d.TypeModifierIsUsedInTypeImports,e),super.checkImportSpecifier(e,s,r||s?4098:4096)}parseTypeOnlyImportSpecifier(e){let s=e.imported,r=!1;if(this.isContextual(90)){let i=this.parseIdentifier();if(this.isContextual(90)){let a=this.parseIdentifier();L(this.state.type)?(r=!0,s=i,e.local=this.parseIdentifier()):e.local=a}else L(this.state.type)?e.local=this.parseIdentifier():(r=!0,s=i)}else L(this.state.type)&&(r=!0,s=this.parseIdentifier(!0));e.imported=s,e.importKind=r?"type":"value",e.local??(e.local=this.eatContextual(90)?this.parseIdentifier():this.cloneIdentifier(e.imported))}parseTypeOnlyExportSpecifier(e,s){let r=e.local,i=!1;if(this.isContextual(90)){let a=this.parseIdentifier();if(this.isContextual(90)){let n=this.parseIdentifier();L(this.state.type)?(i=!0,e.local=a,e.exported=this.parseModuleExportName()):e.exported=n}else L(this.state.type)?e.exported=this.parseModuleExportName():(i=!0,e.local=a)}else L(this.state.type)&&(i=!0,e.local=this.parseModuleExportName());i&&s&&this.raise(d.TypeModifierIsUsedInTypeExports,r),e.exportKind=i?"type":"value",e.exported??(e.exported=this.eatContextual(90)?this.parseModuleExportName():this.cloneIdentifier(e.local))}fillOptionalPropertiesForTSESLint(e){switch(e.type){case"ImportDeclaration":e.phase??(e.phase=null);return;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(R(e)){if(tt.lastIndex=s,tt.test(this.input)){let r=this.codePointAtPos(tt.lastIndex);if(!K(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 si(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:Rt(t.object)}function ri(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!!(Ut(t,e)||ii(t,e)||s==="TemplateLiteral"&&t.expressions.length===0||si(t))}function Ut(t,e){return e?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function ii(t,e){if(t.type==="UnaryExpression"){let{operator:s,argument:r}=t;if(s==="-"&&Ut(r,e))return!0}return!1}function Rt(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:Rt(t.object)}function G(t,e=[]){let s=new Map;for(let r of t)s.set(r,!0);for(let r of e)s.set(r,!1);return s}var ai={ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."},jt=B`placeholders`(ai),ni=t=>class extends t{parsePlaceholder(e){if(this.match(132)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(132),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(132,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,r){if(s.type!=="Placeholder"||s.extra?.parenthesized)return super.parseExpressionStatement(e,s,r);if(this.match(10)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=r&8?super.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):super.parseStatement(),this.finishNode(a,"LabeledStatement")}this.semicolon();let i=e;return i.name=s.name,this.finishPlaceholder(i,"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(132)||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(jt.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(95)&&!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(H(132),this.hasPlugin("exportDefaultFrom")?this.nextTokenStartSince(e+4):this.nextTokenInLineStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){return e.specifiers?.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkNamedExport(){}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(95)&&!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.parseNamedOrFilteredImportSpecifiers(e)),this.expectContextual(95),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(jt.UnexpectedSpace,this.state.lastTokEndLoc)}},oi=t=>class extends t{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,s=this.startNode();if(this.next(),A(this.state.type)){this.setLoc(this.state.startLoc);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)}},_t=["fsharp","hack"],Vt=["^^","@@","^","%","#"];function li(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(!_t.includes(e)){let s=_t.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(!Vt.includes(s)){let r=Vt.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.");if(t.has("deferredReexports")&&!t.has("deferredImportEvaluation"))throw new Error("The 'deferredReexports' plugin requires 'deferredImportEvaluation'.")}var zt={estree:_s,jsx:gr,flow:mr,typescript:ti,v8intrinsic:oi,placeholders:ni},hi=Object.keys(zt),qt=class extends Kr{constructor(t,e,s){let r=js(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 Ke}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 $t(t,e){if(e?.sourceType==="unambiguous"){e={...e};try{e.sourceType="module";let s=ue(e,t),r=s.parse();if(s.sawUnambiguousESM)return r;if(s.ambiguousScriptDifferentAst)try{return e.sourceType="script",ue(e,t).parse()}catch{}else r.program.sourceType="script";return r}catch(s){try{return e.sourceType="script",ue(e,t).parse()}catch{}throw s}}else return ue(e,t).parse()}function Ht(t,e){let s=ue(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function pi(t){let e={};for(let s of Object.keys(t))e[s]=gt(t[s]);return e}pi(zs);function ue(t,e){let s=qt,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||{})}li(r),s=ci(r)}return new s(t,e,r)}var Kt=new Map;function ci(t){let e=[];for(let i of hi)t.has(i)&&e.push(i);let s=e.join("|"),r=Kt.get(s);if(!r){r=qt;for(let i of e)r=zt[i](r);Kt.set(s,r)}return r}function Wt(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 ui=Wt(" "),di=Wt(/[^\n\r]/);function mi(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 fi=mi,Jt=t=>t===`
9
+ `||t==="\r"||t==="\u2028"||t==="\u2029";function yi(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(Jt(i))return e-1}else{if(i==="\r"&&t.charAt(e+1)===`
11
+ `)return e+2;if(Jt(i))return e+1}return e}var xi=yi;function Pi(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?di(t,e):e}var gi=Pi;function Ti(t,e){let s=null,r=e;for(;r!==s;)s=r,r=ui(t,r),r=fi(t,r),r=gi(t,r),r=xi(t,r);return r}var bi=Ti;function Si(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 Ai(t){if(!t.startsWith("#!"))return"";let e=t.indexOf(`
12
+ `);return e===-1?t:t.slice(0,e)}var Xt=Ai,Ei=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}},Ii=Le("findLast",function(){if(Array.isArray(this))return Ei}),Ci=Ii,Gt=Symbol.for("comments");function Ni(t){return this[t<0?this.length+t:t]}var wi=Le("at",function(){if(Array.isArray(this)||typeof this=="string")return Ni}),ki=wi;function Ce(t){let e=new Set(t);return s=>e.has(s?.type)}function it(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 vi=5,Li=8,Di=8,Yt=t=>e=>e.label?D(e.label):O(e)+t,Mi=t=>t.__contentEnd??it(t),Qt=["ExpressionStatement","Directive","ImportDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ReturnStatement","ThrowStatement","DoWhileStatement","ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","AbstractPropertyDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"],Oi=new Map([["BreakStatement",Yt(vi)],["ContinueStatement",Yt(Li)],["DebuggerStatement",t=>O(t)+Di],["VariableDeclaration",t=>D(ki(0,t.declarations,-1))],...Qt.map(t=>[t,Mi])]),Fi=Ce(Qt);function D(t){let{type:e}=t;return e==="IfStatement"?D(t.alternate??t.consequent):e==="ForInStatement"||e==="ForOfStatement"||e==="ForStatement"||e==="LabeledStatement"||e==="WithStatement"||e==="WhileStatement"?D(t.body):Oi.get(e)?.(t)??it(t)}var at=Ce(["Block","CommentBlock","MultiLine"]),Bi=Ce(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]);function nt(t,e,s){if(!t.has(e)){let r=s(e);t.set(e,r)}return t.get(e)}var Ui=new WeakMap;function Ri(t){return nt(Ui,t,e=>at(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/.test(e.value))}function ji(t){return X(0,t,/[^\n]/g," ")}var _i=ji;function Vi(t,e){if(e.length===0)return t;let s="",r=0;for(let i of e){let a=O(i),n=D(i);s+=t.slice(r,a)+_i(t.slice(a,n)),r=n}return s+t.slice(r)}var zi=new WeakMap;function qi(t){let e=t[Gt];return nt(zi,e,s=>Vi(t.originalText,s))}function $i(t){if(!at(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 Zt=new WeakMap;function Hi(t){return nt(Zt,t,$i)}function Ki(t){Zt.delete(t)}function es(t){return Hi(t).length>0}function Wi(t){if(t.length<2)return;let e;for(let s=t.length-1;s>=0;s--){let r=t[s];if(e&&D(r)===O(e)&&es(r)&&es(e)&&(t.splice(s+1,1),r.value+="*//*"+e.value,r.range=[O(r),D(e)],Ki(r)),!Bi(r)&&!at(r))throw new TypeError(`Unknown comment type: "${r.type}".`);e=r}}function Ji(t){return t!==null&&typeof t=="object"}var Xi=Ji,de=null;function me(t){if(de!==null&&typeof de.property){let e=de;return de=me.prototype=null,e}return de=me.prototype=t??Object.create(null),new me}var Gi=10;for(let t=0;t<=Gi;t++)me();function Yi(t){return me(t)}function Qi(t,e="type"){Yi(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 Zi=Qi,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"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeArguments"],["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"],["quasis","types"],["literal"],["expression","typeArguments"],["id","moduleReference"],["decorators","key","typeAnnotation"],["params","returnType","rest","typeParameters"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],ea={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:["local"],ImportNamespaceSpecifier:["exportsFilter","local"],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:["exportsFilter","exported"],OptionalMemberExpression:c[11],OptionalCallExpression:c[5],ClassProperty:c[21],ClassPrivateProperty:c[21],ClassPrivateMethod:c[13],PrivateName:c[22],StaticBlock:c[18],ImportAttribute:c[23],AnyTypeAnnotation:[],ArrayTypeAnnotation:c[24],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:c[25],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate","typeAnnotation"],DeclareInterface:c[26],DeclareModule:c[27],DeclareModuleExports:c[28],DeclareTypeAlias:c[29],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[30],GenericTypeAnnotation:c[25],InferredPredicate:[],InterfaceExtends:c[25],InterfaceDeclaration:c[26],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:c[31],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:c[28],NumberLiteralTypeAnnotation:[],BigIntLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:c[2],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance","init"],ObjectTypeSpreadProperty:c[15],OpaqueType:["id","typeParameters","supertype","impltype","lowerBound","upperBound"],QualifiedTypeIdentifier:c[32],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:c[33],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:c[29],TypeAnnotation:c[28],TypeCastExpression:c[34],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:c[35],TypeParameterInstantiation:c[35],UnionTypeAnnotation:c[31],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:c[27],EnumBooleanBody:c[36],EnumNumberBody:c[36],EnumStringBody:c[36],EnumSymbolBody:c[36],EnumBooleanMember:c[17],EnumNumberMember:c[17],EnumStringMember:c[17],EnumDefaultedMember:c[22],IndexedAccessType:c[37],OptionalIndexedAccessType:c[37],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[38],Decorator:c[8],DoExpression:c[18],ExportDefaultSpecifier:["exported"],ModuleExpression:c[18],TopicReference:[],VoidPattern:[],StructDeclaration:["id","superClass","body"],StructBody:c[18],TSParameterProperty:["decorators","parameter"],TSDeclareFunction:c[39],TSDeclareMethod:c[40],TSQualifiedName:c[1],TSCallSignatureDeclaration:c[41],TSConstructSignatureDeclaration:c[41],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:c[40],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:c[41],TSConstructorType:c[41],TSTypeReference:["typeName","typeArguments"],TSTypePredicate:c[42],TSTypeQuery:["exprName","typeArguments"],TSTypeLiteral:c[36],TSArrayType:c[24],TSTupleType:c[33],TSOptionalType:c[28],TSRestType:c[28],TSNamedTupleMember:["label","elementType"],TSUnionType:c[31],TSIntersectionType:c[31],TSConditionalType:c[43],TSInferType:c[44],TSParenthesizedType:c[28],TSTypeOperator:c[28],TSIndexedAccessType:c[37],TSMappedType:["key","constraint","nameType","typeAnnotation"],TSTemplateLiteralType:c[45],TSLiteralType:c[46],TSClassImplements:c[47],TSInterfaceHeritage:c[47],TSInterfaceDeclaration:c[26],TSInterfaceBody:c[18],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:c[47],TSAsExpression:c[34],TSSatisfiesExpression:c[34],TSTypeAssertion:c[34],TSEnumBody:c[36],TSEnumDeclaration:c[27],TSEnumMember:["id","initializer"],TSModuleDeclaration:c[27],TSModuleBlock:c[18],TSImportType:["source","options","qualifier","typeArguments"],TSImportEqualsDeclaration:c[48],TSExternalModuleReference:c[8],TSNonNullExpression:c[8],TSExportAssignment:c[8],TSNamespaceExportDeclaration:c[22],TSTypeAnnotation:c[28],TSTypeParameterInstantiation:c[35],TSTypeParameterDeclaration:c[35],TSTypeParameter:["name","constraint","default"],ChainExpression:c[8],Literal:[],MethodDefinition:c[14],PrivateIdentifier:[],Property:c[23],PropertyDefinition:c[21],AccessorProperty:c[38],TSAbstractAccessorProperty:c[49],TSAbstractKeyword:[],TSAbstractMethodDefinition:c[23],TSAbstractPropertyDefinition:c[49],TSAsyncKeyword:[],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AbstractMethodDefinition:c[23],AbstractPropertyDefinition:["key","value","typeAnnotation","variance"],AsConstExpression:c[8],AsExpression:c[34],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:c[30],ConditionalTypeAnnotation:c[43],ConstructorTypeAnnotation:c[50],DeclareClassExtendsCall:["callee","argument"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:c[27],DeclareHook:c[22],DeclareNamespace:c[27],EnumBigIntMember:c[17],EnumBody:c[36],ExportAssignment:c[8],ExternalModuleReference:c[8],HookDeclaration:c[39],HookTypeAnnotation:c[50],ImportEqualsDeclaration:c[48],ImportType:["source"],InferTypeAnnotation:c[44],KeyofTypeAnnotation:c[15],MatchArrayPattern:["elements","rest"],MatchAsPattern:["pattern","target"],MatchBindingPattern:c[22],MatchExpression:c[51],MatchExpressionCase:c[52],MatchIdentifierPattern:c[22],MatchInstanceObjectPattern:c[53],MatchInstancePattern:["targetConstructor","properties"],MatchLiteralPattern:c[46],MatchMemberPattern:["base","property"],MatchObjectPattern:c[53],MatchObjectPatternProperty:["key","pattern"],MatchOrPattern:["patterns"],MatchRestPattern:c[15],MatchStatement:c[51],MatchStatementCase:c[52],MatchUnaryPattern:c[15],MatchWildcardPattern:[],NamespaceExportDeclaration:c[22],NeverTypeAnnotation:[],NonNullExpression:c[8],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","nameType","variance"],ObjectTypePrivateField:["key"],ParameterProperty:c[21],QualifiedTypeofIdentifier:c[32],RecordDeclaration:["id","typeParameters","implements","body"],RecordDeclarationBody:c[0],RecordDeclarationImplements:c[25],RecordDeclarationProperty:["key","typeAnnotation","defaultValue"],RecordDeclarationStaticProperty:["key","typeAnnotation","value"],RecordExpression:["recordConstructor","typeArguments","properties"],RecordExpressionProperties:c[12],SatisfiesExpression:c[34],TemplateLiteralTypeAnnotation:c[45],TupleTypeElement:c[24],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:c[28],TypePredicate:c[42],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[23],NGRoot:c[54],JsExpressionRoot:c[54],JsonRoot:c[54],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:c[28],TSJSDocNonNullableType:c[28],EnumBigIntBody:c[36]},ta=Zi(ea),sa=ta;function Ne(t,e){if(!Xi(t))return t;if(Array.isArray(t)){for(let r=0;r<t.length;r++)t[r]=Ne(t[r],e);return t}if(e.onEnter){let r=e.onEnter(t)??t;if(r!==t)return Ne(r,e);t=r}let s=sa(t);for(let r=0;r<s.length;r++)t[s[r]]=Ne(t[s[r]],e);return e.onLeave&&(t=e.onLeave(t)||t),t}var ra=Ne;Ce(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);function ia(t,e){let{text:s,astType:r}=e,{comments:i}=t;Wi(i);let a=t.type==="File"?t.program:t;a.interpreter&&(i.unshift(a.interpreter),delete a.interpreter),t.hashbang&&((r==="oxc-ts"||r==="yuku-js"||r==="yuku-ts")&&i.unshift(t.hashbang),delete t.hashbang);let n;return t=ra(t,{onEnter(o){aa(o,i,s);let{type:l}=o;switch(l){case"ParenthesizedExpression":{let{expression:p}=o,u=O(o);if(p.type==="TypeCastExpression")return p.range=[u,D(o)],p;let m=!1;if(r!=="oxc-ts"){if(!n){n=[];for(let g of i)Ri(g)&&n.push(D(g))}let y=Ci(0,n,g=>g<=u);m=y&&s.slice(y,u).trim().length===0}return m?void 0:(p.extra={...p.extra,parenthesized:!0},p)}case"TemplateLiteral":if(o.expressions.length!==o.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if(r==="flow"||r==="hermes"||r==="espree"||r==="typescript"||r==="oxc-ts"||r==="yuku-ts"){let p=O(o)+1,u=D(o)-(o.tail?1:2);o.range=[p,u]}break;case"TSParenthesizedType":return o.typeAnnotation;case"TSUnionType":case"TSIntersectionType":if(o.types.length===1)return o.types[0];break;case"TupleTypeAnnotation":o.types&&!o.elementTypes&&(o.elementTypes=o.types,delete o.types);break;case"ImportDeclaration":r==="hermes"&&o.assertions&&!o.attributes&&(o.attributes=o.assertions,delete o.assertions);break;case"TypeParameter":r!=="flow"&&o.bound?.type==="TypeAnnotation"&&(o.bound=o.bound.typeAnnotation);break;case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":r==="hermes"&&((o.explicitType||l==="EnumSymbolBody")&&(o.explicitType=l.slice(4,-4).toLowerCase()),o.type="EnumBody");break;case"GenericTypeAnnotation":case"ClassImplements":case"InterfaceExtends":r!=="flow"&&o.typeParameters&&!o.typeArguments&&(o.typeArguments=o.typeParameters,delete o.typeParameters)}},onLeave(o){switch(o.type){case"LogicalExpression":if(ts(o))return ot(o);break}}}),t}function ts(t){return t.type==="LogicalExpression"&&t.right.type==="LogicalExpression"&&t.operator===t.right.operator}function ot(t){return ts(t)?ot({type:"LogicalExpression",operator:t.operator,left:ot({type:"LogicalExpression",operator:t.operator,left:t.left,right:t.right.left,range:[O(t.left),D(t.right.left)]}),right:t.right.right,range:[O(t),D(t)]}):t}function aa(t,e,s){if(!Fi(t))return;let r=it(t);if(s[r-1]!==";")return;let i=qi({[Gt]:e,originalText:s});r-=1;let a=i.slice(O(t),r),n=a.trimEnd();t.__contentEnd=r-(a.length-n.length)}var na=ia;function oa(t,e){let s=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(s,e)}var ss=oa,rs="Unexpected parseExpression() input: ";function la(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(rs)&&(e=e.slice(rs.length)),ss(e,{loc:{start:{line:i,column:a+1}},cause:n})}var is=la,ha=/\*\/$/,pa=/^\/\*\*?/,ca=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,ua=/(^|\s+)\/\/([^\n\r]*)/g,as=/^(\r?\n)+/,da=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ns=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ma=/(\r?\n|^) *\* ?/g,fa=[];function ya(t){let e=t.match(ca);return e?e[0].trimStart():""}function xa(t){t=X(0,t.replace(pa,"").replace(ha,""),ma,"$1");let e="";for(;e!==t;)e=t,t=X(0,t,da,`
15
+ $1 $2
16
+ `);t=t.replace(as,"").trimEnd();let s=Object.create(null),r=X(0,t,ns,"").replace(as,"").trimEnd(),i;for(;i=ns.exec(t);){let a=X(0,i[2],ua,"");if(typeof s[i[1]]=="string"||Array.isArray(s[i[1]])){let n=s[i[1]];s[i[1]]=[...fa,...Array.isArray(n)?n:[n],a]}else s[i[1]]=a}return{comments:r,pragmas:s}}var Pa=["noformat","noprettier"],ga=["format","prettier"];function os(t){let e=Xt(t);e&&(t=t.slice(e.length+1));let s=ya(t),{pragmas:r,comments:i}=xa(s);return{shebang:e,text:t,pragmas:r,comments:i}}function Ta(t){let{pragmas:e}=os(t);return ga.some(s=>De(e,s))}function ba(t){let{pragmas:e}=os(t);return Pa.some(s=>De(e,s))}function Sa(t){return t=typeof t=="function"?{parse:t}:t,{astFormat:"estree",hasPragma:Ta,hasIgnorePragma:ba,locStart:O,locEnd:D,...t}}var fe=Sa,ls="module",lt="commonjs",Aa=[ls,lt];function Ea(t){if(typeof t=="string"){if(/\.(?:mjs|mts)$/i.test(t))return ls;if(/\.(?:cjs|cts)$/i.test(t))return lt}}function Ia(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 hs=Ia,ee=t=>fe(va(t)),Ca={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"}],"structs","importSync","deferredReexports","namespaceImportFilter"],tokens:!1,ranges:!1},ps="v8intrinsic",cs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],q=(t,e=Ca)=>({...e,plugins:[...e.plugins,...t]}),Na=/@(?:no)?flow\b/;function wa(t,e){if(e?.endsWith(".js.flow"))return!0;let s=Xt(t);s&&(t=t.slice(s.length));let r=bi(t,0);return r!==!1&&(t=t.slice(0,r)),Na.test(t)}function ka(t,e,s){let r=t(e,s),i=r.errors.find(a=>!Da.has(a.reasonCode));if(i)throw i;return r}function va({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")&&wa(s,i))return r.parser="babel-flow",xs.parse(s,r);let a=e,n=r.__babelSourceType??Ea(i);a=(n?[n]:Aa).flatMap(u=>a.map(m=>({...m,sourceType:u,...u===lt?{allowReturnOutsideFunction:void 0,allowNewTargetOutsideFunction:void 0}:void 0})));let o=/%[A-Z]/.test(s);s.includes("|>")?a=(o?[...cs,ps]:cs).flatMap(u=>a.map(m=>q([u],m))):o&&(a=a.map(u=>q([ps],u)));let l=t?Ht:$t,p;try{p=Si(a.map(u=>()=>ka(l,s,u)))}catch({errors:[u]}){throw is(u)}return t&&(p=hs({expression:p,text:s,rootMarker:r.rootMarker})),na(p,{text:s})}}var La=["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","IllegalBreakContinue","ParamDupe","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","PatternIsOptional","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","DeclarationMissingInitializer","DecoratorAbstractMethod"],Da=new Set(La),us=[q(["jsx"])],ds=ee({optionsCombinations:us}),ms=ee({optionsCombinations:[q(["jsx","typescript"]),q(["typescript"])]}),fs=ee({isExpression:!0,optionsCombinations:[q(["jsx"])]}),ys=ee({isExpression:!0,optionsCombinations:[q(["typescript"])]}),xs=ee({optionsCombinations:[q(["jsx",["flow",{all:!0}],"flowComments"])]}),Ma=ee({optionsCombinations:us.map(t=>q(["estree"],t))}),Ps={};ve(Ps,{json:()=>Ba,"json-stringify":()=>ja,json5:()=>Ua,jsonc:()=>Ra});function Oa(t){return Array.isArray(t)&&t.length>0}var gs=Oa,Ts={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Fa(t){let e=$t(t,Ts),{program:s}=e;if(s.body.length===0&&s.directives.length===0&&!s.interpreter)return{comments:e.comments}}function we(t,e={}){let{allowComments:s=!0,allowEmpty:r=!1}=e,i,a;try{i=Ht(t,Ts),a=i.comments}catch(n){if(r&&n.code==="BABEL_PARSER_SYNTAX_ERROR"&&n.reasonCode==="ParseExpressionEmptyInput")try{({comments:a}=Fa(t))}catch{}if(!a)throw is(n)}if(!s&&gs(a))throw J(a[0],"Comment");return(!r||i)&&te(i),i=hs({type:"JsonRoot",expression:i,comments:a,text:t}),i}function J(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 te(t){switch(t.type){case"ArrayExpression":for(let e of t.elements)e!==null&&te(e);return;case"ObjectExpression":for(let e of t.properties)te(e);return;case"ObjectProperty":if(t.computed)throw J(t.key,"Computed key");if(t.shorthand)throw J(t.key,"Shorthand property");t.key.type!=="Identifier"&&te(t.key),te(t.value);return;case"UnaryExpression":{let{operator:e,argument:s}=t;if(e!=="+"&&e!=="-")throw J(t,`Operator '${t.operator}'`);if(s.type==="NumericLiteral"||s.type==="Identifier"&&(s.name==="Infinity"||s.name==="NaN"))return;throw J(s,`Operator '${e}' before '${s.type}'`)}case"Identifier":if(t.name!=="Infinity"&&t.name!=="NaN"&&t.name!=="undefined")throw J(t,`Identifier '${t.name}'`);return;case"TemplateLiteral":if(gs(t.expressions))throw J(t.expressions[0],"'TemplateLiteral' with expression");for(let e of t.quasis)te(e);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw J(t,`'${t.type}'`)}}var Ba=fe({parse:t=>we(t),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Ua=fe(t=>we(t)),Ra=fe(t=>we(t,{allowEmpty:!0})),ja=fe({parse:t=>we(t,{allowComments:!1}),astFormat:"estree-json"}),_a={...ut,...Ps};return Cs(ct)})})(pt)),pt.exports}var Es=qa();const $a=Va(Es),Ka=za({__proto__:null,default:$a},[Es]);export{Ka as b};