- Your insights are incredibly valuable to us. Whether you’ve encountered a hiccup, have questions, or ideas
- to make our platform better, we're all ears! If you wish, leave your email and we’ll get back to you. You
- can even share your code snippet with us for a clearer picture.
-
- {
- this.type = e.detail.value;
- }}>
-
- {
- this.descriptionField.invalid = !1, this.descriptionField.placeholder = "";
- }}
- @value-changed=${(e) => {
- this.description = e.detail.value;
- }}
- label="Tell Us More"
- helper-text="Describe what you're experiencing, wondering about, or envisioning. The more you share, the better we can understand and act on your feedback">
- {
- this.email = e.detail.value;
- }}
- id="email"
- label="Your Email (Optional)"
- helper-text="Leave your email if you’d like us to follow up. Totally optional, but we’d love to keep the conversation going.">
- ` : d`
${this.message}
`;
- }
- renderFooter() {
- return this.message === void 0 ? d`
-
- ` : d` `;
- }
- close() {
- h.updatePanel("copilot-feedback-panel", {
- floating: !1
- });
- }
- submit() {
- if (f("feedback"), this.description.trim() === "") {
- this.descriptionField.invalid = !0, this.descriptionField.placeholder = "Please tell us more before sending", this.descriptionField.value = "";
- return;
- }
- const e = {
- description: this.description,
- email: this.email,
- type: this.type
- };
- c.emit("system-info-with-callback", {
- callback: (t) => v(`${b}feedback`, { ...e, versions: t }),
- notify: !1
- }), this.parentNode?.style.setProperty("--section-height", "150px"), this.message = "Thank you for sharing feedback.";
- }
- keyDown(e) {
- (e.key === "Backspace" || e.key === "Delete") && e.stopPropagation();
- }
- openGithub(e, t) {
- if (this.type === "idea") {
- window.open(`${u}${T}`);
- return;
- }
- const l = e.replace(/\n/g, "%0A"), n = `${t.items.find((r) => r.value === this.type)?.ghTitle}`, a = t.description !== "" ? t.description : F, s = D.replace("{description}", a).replace("{versionsInfo}", l);
- window.open(`${u}?title=${n}&body=${s}`, "_blank")?.focus();
- }
-};
-o([
- p()
-], i.prototype, "description", 2);
-o([
- p()
-], i.prototype, "type", 2);
-o([
- p()
-], i.prototype, "email", 2);
-o([
- p()
-], i.prototype, "message", 2);
-o([
- p()
-], i.prototype, "items", 2);
-o([
- k("vaadin-text-area")
-], i.prototype, "descriptionField", 2);
-i = o([
- g("copilot-feedback-panel")
-], i);
-const E = m({
- header: "Help Us Improve!",
- tag: "copilot-feedback-panel",
- width: 500,
- height: 500,
- floatingPosition: {
- top: 50,
- left: 50
- }
-}), _ = {
- init(e) {
- e.addPanel(E);
- }
-};
-window.Vaadin.copilot.plugins.push(_);
-export {
- i as CopilotFeedbackPanel
-};
diff --git a/src/main/frontend/generated/jar-resources/copilot/copilot-global-vars-later-D3wCoPsN.js b/src/main/frontend/generated/jar-resources/copilot/copilot-global-vars-later-D3wCoPsN.js
deleted file mode 100644
index 7e35729..0000000
--- a/src/main/frontend/generated/jar-resources/copilot/copilot-global-vars-later-D3wCoPsN.js
+++ /dev/null
@@ -1,157149 +0,0 @@
-import { g as C_t, a as E_t, c as p7e, b as ZP, t as D_t, s as d7e, P as m7e, d as P_t, e as sme, f as w_t, h as x7e, v as A_t, p as g7e, i as h7e, j as N_t, k as I_t } from "./copilot-DD4YG2QN.js";
-import { g as y7e, a as O_t, i as F_t, b as L_t, c as M_t, d as ame, e as v7e, f as b7e, h as R_t, j as cme, k as j_t, l as B_t, m as J_t, n as z_t, o as W_t } from "./react-utils-YFiRIXn7.js";
-function S7e(su) {
- throw new Error('Could not dynamically require "' + su + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
-}
-var k7e = { exports: {} };
-const U_t = {}, V_t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: U_t
-}, Symbol.toStringTag, { value: "Module" })), DE = /* @__PURE__ */ C_t(V_t);
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at http://www.apache.org/licenses/LICENSE-2.0
-
-THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-MERCHANTABLITY OR NON-INFRINGEMENT.
-
-See the Apache Version 2.0 License for specific language governing permissions
-and limitations under the License.
-***************************************************************************** */
-(function(su) {
- var sa = {};
- (($a) => {
- var qu = Object.defineProperty, La = (e, t) => {
- for (var n in t)
- qu(e, n, { get: t[n], enumerable: !0 });
- }, Pf = (e) => e, KP = {};
- La(KP, {
- ANONYMOUS: () => wV,
- AccessFlags: () => _Q,
- AssertionLevel: () => SX,
- AssignmentDeclarationKind: () => bQ,
- AssignmentKind: () => qZ,
- Associativity: () => KZ,
- BreakpointResolver: () => Eq,
- BuilderFileEmit: () => Hne,
- BuilderProgramKind: () => eie,
- BuilderState: () => Ld,
- CallHierarchy: () => nk,
- CharacterCodes: () => NQ,
- CheckFlags: () => oQ,
- CheckMode: () => Xz,
- ClassificationType: () => RU,
- ClassificationTypeNames: () => rse,
- CommentDirectiveType: () => HX,
- Comparison: () => cX,
- CompletionInfoFlags: () => Xie,
- CompletionTriggerKind: () => LU,
- Completions: () => ck,
- ContainerFlags: () => Pre,
- ContextFlags: () => KX,
- Debug: () => E,
- DiagnosticCategory: () => SI,
- Diagnostics: () => p,
- DocumentHighlights: () => C9,
- ElementFlags: () => uQ,
- EmitFlags: () => VR,
- EmitHint: () => MQ,
- EmitOnly: () => $X,
- EndOfLineState: () => Zie,
- ExitStatus: () => XX,
- ExportKind: () => $se,
- Extension: () => IQ,
- ExternalEmitHelpers: () => LQ,
- FileIncludeKind: () => FR,
- FilePreprocessingDiagnosticsKind: () => GX,
- FileSystemEntryKind: () => qQ,
- FileWatcherEventKind: () => WQ,
- FindAllReferences: () => Eo,
- FlattenLevel: () => Xre,
- FlowFlags: () => bI,
- ForegroundColorEscapeSequences: () => jne,
- FunctionFlags: () => YZ,
- GeneratedIdentifierFlags: () => OR,
- GetLiteralTextFlags: () => aZ,
- GoToDefinition: () => L6,
- HighlightSpanKind: () => Gie,
- IdentifierNameMap: () => _6,
- ImportKind: () => Gse,
- ImportsNotUsedAsValues: () => EQ,
- IndentStyle: () => $ie,
- IndexFlags: () => fQ,
- IndexKind: () => mQ,
- InferenceFlags: () => yQ,
- InferencePriority: () => hQ,
- InlayHintKind: () => Hie,
- InlayHints: () => gH,
- InternalEmitFlags: () => OQ,
- InternalNodeBuilderFlags: () => tQ,
- InternalSymbolName: () => cQ,
- IntersectionFlags: () => ZX,
- InvalidatedProjectKind: () => xie,
- JSDocParsingMode: () => zQ,
- JsDoc: () => wv,
- JsTyping: () => Dm,
- JsxEmit: () => CQ,
- JsxFlags: () => WX,
- JsxReferenceKind: () => pQ,
- LanguageFeatureMinimumTarget: () => FQ,
- LanguageServiceMode: () => Vie,
- LanguageVariant: () => wQ,
- LexicalEnvironmentFlags: () => jQ,
- ListFormat: () => BQ,
- LogLevel: () => NX,
- MapCode: () => hH,
- MemberOverrideStatus: () => QX,
- ModifierFlags: () => NR,
- ModuleDetectionKind: () => SQ,
- ModuleInstanceState: () => Ere,
- ModuleKind: () => lw,
- ModuleResolutionKind: () => zE,
- ModuleSpecifierEnding: () => QK,
- NavigateTo: () => hae,
- NavigationBar: () => vae,
- NewLineKind: () => DQ,
- NodeBuilderFlags: () => eQ,
- NodeCheckFlags: () => RR,
- NodeFactoryFlags: () => xee,
- NodeFlags: () => AR,
- NodeResolutionFeatures: () => gre,
- ObjectFlags: () => BR,
- OperationCanceledException: () => JE,
- OperatorPrecedence: () => eK,
- OrganizeImports: () => Av,
- OrganizeImportsMode: () => FU,
- OuterExpressionKinds: () => RQ,
- OutliningElementsCollector: () => vH,
- OutliningSpanKind: () => Qie,
- OutputFileType: () => Yie,
- PackageJsonAutoImportPreference: () => Uie,
- PackageJsonDependencyGroup: () => Wie,
- PatternMatchKind: () => $V,
- PollingInterval: () => qR,
- PollingWatchKind: () => kQ,
- PragmaKindFlags: () => JQ,
- PredicateSemantics: () => UX,
- PrivateIdentifierKind: () => Oee,
- ProcessLevel: () => Kre,
- ProgramUpdateLevel: () => One,
- QuotePreference: () => kse,
- RegularExpressionFlags: () => VX,
- RelationComparisonResult: () => IR,
- Rename: () => uL,
- ScriptElementKind: () => ese,
- ScriptElementKindModifier: () => tse,
- ScriptKind: () => zR,
- ScriptSnapshot: () => RF,
- ScriptTarget: () => PQ,
- SemanticClassificationFormat: () => qie,
- SemanticMeaning: () => nse,
- SemicolonPreference: () => MU,
- SignatureCheckMode: () => Qz,
- SignatureFlags: () => JR,
- SignatureHelp: () => U8,
- SignatureInfo: () => qne,
- SignatureKind: () => dQ,
- SmartSelectionRange: () => TH,
- SnippetKind: () => UR,
- StatisticType: () => Iie,
- StructureIsReused: () => LR,
- SymbolAccessibility: () => iQ,
- SymbolDisplay: () => j0,
- SymbolDisplayPartKind: () => BF,
- SymbolFlags: () => MR,
- SymbolFormatFlags: () => nQ,
- SyntaxKind: () => wR,
- Ternary: () => vQ,
- ThrottledCancellationToken: () => Doe,
- TokenClass: () => Kie,
- TokenFlags: () => qX,
- TransformFlags: () => WR,
- TypeFacts: () => $z,
- TypeFlags: () => jR,
- TypeFormatFlags: () => rQ,
- TypeMapKind: () => gQ,
- TypePredicateKind: () => sQ,
- TypeReferenceSerializationKind: () => aQ,
- UnionReduction: () => YX,
- UpToDateStatusType: () => gie,
- VarianceFlags: () => lQ,
- Version: () => Sd,
- VersionRange: () => vI,
- WatchDirectoryFlags: () => AQ,
- WatchDirectoryKind: () => xQ,
- WatchFileKind: () => TQ,
- WatchLogLevel: () => Lne,
- WatchType: () => Tl,
- accessPrivateIdentifier: () => $re,
- addEmitFlags: () => hm,
- addEmitHelper: () => Tx,
- addEmitHelpers: () => Ih,
- addInternalEmitFlags: () => bx,
- addNodeFactoryPatcher: () => the,
- addObjectAllocatorPatcher: () => zge,
- addRange: () => Fn,
- addRelatedInfo: () => Rs,
- addSyntheticLeadingComment: () => Z4,
- addSyntheticTrailingComment: () => j5,
- addToSeen: () => zp,
- advancedAsyncSuperHelper: () => W5,
- affectsDeclarationPathOptionDeclarations: () => Bte,
- affectsEmitOptionDeclarations: () => jte,
- allKeysStartWithDot: () => RO,
- altDirectorySeparator: () => CI,
- and: () => gI,
- append: () => wr,
- appendIfUnique: () => bh,
- arrayFrom: () => as,
- arrayIsEqualTo: () => Af,
- arrayIsHomogeneous: () => see,
- arrayOf: () => hX,
- arrayReverseIterator: () => lR,
- arrayToMap: () => Yk,
- arrayToMultiMap: () => nw,
- arrayToNumericMap: () => vX,
- assertType: () => yme,
- assign: () => z2,
- asyncSuperHelper: () => z5,
- attachFileToDiagnostics: () => px,
- base64decode: () => xK,
- base64encode: () => TK,
- binarySearch: () => hy,
- binarySearchKey: () => IT,
- bindSourceFile: () => wre,
- breakIntoCharacterSpans: () => lae,
- breakIntoWordSpans: () => uae,
- buildLinkParts: () => Ise,
- buildOpts: () => hA,
- buildOverload: () => WDe,
- bundlerModuleNameResolver: () => hre,
- canBeConvertedToAsync: () => eq,
- canHaveDecorators: () => Vb,
- canHaveExportModifier: () => U3,
- canHaveFlowNode: () => f3,
- canHaveIllegalDecorators: () => nz,
- canHaveIllegalModifiers: () => yte,
- canHaveIllegalType: () => Dhe,
- canHaveIllegalTypeParameters: () => hte,
- canHaveJSDoc: () => p3,
- canHaveLocals: () => tg,
- canHaveModifiers: () => Hp,
- canHaveModuleSpecifier: () => WZ,
- canHaveSymbol: () => kd,
- canIncludeBindAndCheckDiagnostics: () => U4,
- canJsonReportNoInputFiles: () => vD,
- canProduceDiagnostics: () => eF,
- canUsePropertyAccess: () => dJ,
- canWatchAffectingLocation: () => cie,
- canWatchAtTypes: () => oie,
- canWatchDirectoryOrFile: () => bF,
- cartesianProduct: () => wX,
- cast: () => Bs,
- chainBundle: () => Fd,
- chainDiagnosticMessages: () => vs,
- changeAnyExtension: () => fw,
- changeCompilerHostLikeToUseCache: () => MD,
- changeExtension: () => zy,
- changeFullExtension: () => DI,
- changesAffectModuleResolution: () => e7,
- changesAffectingProgramStructure: () => ZY,
- characterCodeToRegularExpressionFlag: () => rj,
- childIsDecorated: () => m4,
- classElementOrClassElementParameterIsDecorated: () => tB,
- classHasClassThisAssignment: () => uW,
- classHasDeclaredOrExplicitlyAssignedName: () => _W,
- classHasExplicitlyAssignedName: () => YO,
- classOrConstructorParameterIsDecorated: () => v0,
- classicNameResolver: () => kre,
- classifier: () => Noe,
- cleanExtendedConfigCache: () => sF,
- clear: () => Ap,
- clearMap: () => D_,
- clearSharedExtendedConfigFileWatcher: () => CW,
- climbPastPropertyAccess: () => WF,
- clone: () => bX,
- cloneCompilerOptions: () => nV,
- closeFileWatcher: () => fd,
- closeFileWatcherOf: () => mp,
- codefix: () => xu,
- collapseTextChangeRangesAcrossMultipleVersions: () => pY,
- collectExternalModuleInfo: () => aW,
- combine: () => NT,
- combinePaths: () => Bn,
- commandLineOptionOfCustomType: () => Wte,
- commentPragmas: () => TI,
- commonOptionsWithBuild: () => gO,
- compact: () => tw,
- compareBooleans: () => J1,
- compareDataObjects: () => VB,
- compareDiagnostics: () => R4,
- compareEmitHelpers: () => Lee,
- compareNumberOfDirectorySeparators: () => z3,
- comparePaths: () => Sh,
- comparePathsCaseInsensitive: () => zme,
- comparePathsCaseSensitive: () => Jme,
- comparePatternKeys: () => zz,
- compareProperties: () => CX,
- compareStringsCaseInsensitive: () => sw,
- compareStringsCaseInsensitiveEslintCompatible: () => TX,
- compareStringsCaseSensitive: () => au,
- compareStringsCaseSensitiveUI: () => aw,
- compareTextSpans: () => dI,
- compareValues: () => ho,
- compilerOptionsAffectDeclarationPath: () => UK,
- compilerOptionsAffectEmit: () => WK,
- compilerOptionsAffectSemanticDiagnostics: () => zK,
- compilerOptionsDidYouMeanDiagnostics: () => bO,
- compilerOptionsIndicateEsModules: () => lV,
- computeCommonSourceDirectoryOfFilenames: () => Mne,
- computeLineAndCharacterOfPosition: () => nC,
- computeLineOfPosition: () => HE,
- computeLineStarts: () => BT,
- computePositionOfLineAndCharacter: () => NI,
- computeSignatureWithDiagnostics: () => HW,
- computeSuggestionDiagnostics: () => YV,
- computedOptions: () => rl,
- concatenate: () => Qi,
- concatenateDiagnosticMessageChains: () => MK,
- consumesNodeCoreModules: () => g9,
- contains: () => ss,
- containsIgnoredPath: () => H4,
- containsObjectRestOrSpread: () => pA,
- containsParseError: () => GT,
- containsPath: () => np,
- convertCompilerOptionsForTelemetry: () => ire,
- convertCompilerOptionsFromJson: () => L0e,
- convertJsonOption: () => kS,
- convertToBase64: () => SK,
- convertToJson: () => bA,
- convertToObject: () => Yte,
- convertToOptionsWithAbsolutePaths: () => kO,
- convertToRelativePath: () => VE,
- convertToTSConfig: () => Cz,
- convertTypeAcquisitionFromJson: () => M0e,
- copyComments: () => NS,
- copyEntries: () => t7,
- copyLeadingComments: () => D6,
- copyProperties: () => mR,
- copyTrailingAsLeadingComments: () => p8,
- copyTrailingComments: () => ZD,
- couldStartTrivia: () => eY,
- countWhere: () => py,
- createAbstractBuilder: () => V1e,
- createAccessorPropertyBackingField: () => az,
- createAccessorPropertyGetRedirector: () => Ete,
- createAccessorPropertySetRedirector: () => Dte,
- createBaseNodeFactory: () => yee,
- createBinaryExpressionTrampoline: () => fO,
- createBuilderProgram: () => GW,
- createBuilderProgramUsingIncrementalBuildInfo: () => iie,
- createBuilderStatusReporter: () => wF,
- createCacheableExportInfoMap: () => JV,
- createCachedDirectoryStructureHost: () => nF,
- createClassifier: () => Tbe,
- createCommentDirectivesMap: () => iZ,
- createCompilerDiagnostic: () => Go,
- createCompilerDiagnosticForInvalidCustomType: () => Ute,
- createCompilerDiagnosticFromMessageChain: () => a5,
- createCompilerHost: () => Rne,
- createCompilerHostFromProgramHost: () => fU,
- createCompilerHostWorker: () => aF,
- createDetachedDiagnostic: () => fx,
- createDiagnosticCollection: () => x3,
- createDiagnosticForFileFromMessageChain: () => Qj,
- createDiagnosticForNode: () => Kr,
- createDiagnosticForNodeArray: () => gC,
- createDiagnosticForNodeArrayFromMessageChain: () => Uw,
- createDiagnosticForNodeFromMessageChain: () => Rg,
- createDiagnosticForNodeInSourceFile: () => sp,
- createDiagnosticForRange: () => yZ,
- createDiagnosticMessageChainFromDiagnostic: () => hZ,
- createDiagnosticReporter: () => $x,
- createDocumentPositionMapper: () => Ure,
- createDocumentRegistry: () => Zse,
- createDocumentRegistryInternal: () => qV,
- createEmitAndSemanticDiagnosticsBuilderProgram: () => YW,
- createEmitHelperFactory: () => Fee,
- createEmptyExports: () => aA,
- createEvaluator: () => mee,
- createExpressionForJsxElement: () => _te,
- createExpressionForJsxFragment: () => fte,
- createExpressionForObjectLiteralElementLike: () => pte,
- createExpressionForPropertyName: () => YJ,
- createExpressionFromEntityName: () => oA,
- createExternalHelpersImportDeclarationIfNeeded: () => ez,
- createFileDiagnostic: () => fl,
- createFileDiagnosticFromMessageChain: () => f7,
- createFlowNode: () => _g,
- createForOfBindingStatement: () => QJ,
- createFutureSourceFile: () => T9,
- createGetCanonicalFileName: () => zl,
- createGetIsolatedDeclarationErrors: () => Tne,
- createGetSourceFile: () => AW,
- createGetSymbolAccessibilityDiagnosticForNode: () => I0,
- createGetSymbolAccessibilityDiagnosticForNodeName: () => Sne,
- createGetSymbolWalker: () => Are,
- createIncrementalCompilerHost: () => PF,
- createIncrementalProgram: () => mie,
- createJsxFactoryExpression: () => XJ,
- createLanguageService: () => Poe,
- createLanguageServiceSourceFile: () => z9,
- createMemberAccessForPropertyName: () => TS,
- createModeAwareCache: () => a6,
- createModeAwareCacheKey: () => xD,
- createModeMismatchDetails: () => Fj,
- createModuleNotFoundChain: () => n7,
- createModuleResolutionCache: () => o6,
- createModuleResolutionLoader: () => RW,
- createModuleResolutionLoaderUsingGlobalCache: () => fie,
- createModuleSpecifierResolutionHost: () => Zx,
- createMultiMap: () => Ip,
- createNameResolver: () => vJ,
- createNodeConverters: () => See,
- createNodeFactory: () => G3,
- createOptionNameMap: () => yO,
- createOverload: () => LH,
- createPackageJsonImportFilter: () => P6,
- createPackageJsonInfo: () => IV,
- createParenthesizerRules: () => vee,
- createPatternMatcher: () => nae,
- createPrinter: () => Ky,
- createPrinterWithDefaults: () => Nne,
- createPrinterWithRemoveComments: () => $b,
- createPrinterWithRemoveCommentsNeverAsciiEscape: () => Ine,
- createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => kW,
- createProgram: () => WA,
- createProgramHost: () => pU,
- createPropertyNameNodeForIdentifierOrLiteral: () => w5,
- createQueue: () => iw,
- createRange: () => op,
- createRedirectedBuilderProgram: () => QW,
- createResolutionCache: () => KW,
- createRuntimeTypeSerializer: () => ine,
- createScanner: () => Og,
- createSemanticDiagnosticsBuilderProgram: () => U1e,
- createSet: () => gR,
- createSolutionBuilder: () => bie,
- createSolutionBuilderHost: () => yie,
- createSolutionBuilderWithWatch: () => Sie,
- createSolutionBuilderWithWatchHost: () => vie,
- createSortedArray: () => cR,
- createSourceFile: () => Bx,
- createSourceMapGenerator: () => jre,
- createSourceMapSource: () => she,
- createSuperAccessVariableStatement: () => KO,
- createSymbolTable: () => Js,
- createSymlinkCache: () => eJ,
- createSyntacticTypeNodeBuilder: () => Bie,
- createSystemWatchFunctions: () => HQ,
- createTextChange: () => s8,
- createTextChangeFromStartLength: () => t9,
- createTextChangeRange: () => Tw,
- createTextRangeFromNode: () => aV,
- createTextRangeFromSpan: () => e9,
- createTextSpan: () => Ul,
- createTextSpanFromBounds: () => kc,
- createTextSpanFromNode: () => t_,
- createTextSpanFromRange: () => L0,
- createTextSpanFromStringLiteralLikeContent: () => sV,
- createTextWriter: () => E3,
- createTokenRange: () => JB,
- createTypeChecker: () => Mre,
- createTypeReferenceDirectiveResolutionCache: () => OO,
- createTypeReferenceResolutionLoader: () => lF,
- createWatchCompilerHost: () => eve,
- createWatchCompilerHostOfConfigFile: () => dU,
- createWatchCompilerHostOfFilesAndCompilerOptions: () => mU,
- createWatchFactory: () => _U,
- createWatchHost: () => uU,
- createWatchProgram: () => gU,
- createWatchStatusReporter: () => eU,
- createWriteFileMeasuringIO: () => NW,
- declarationNameToString: () => _o,
- decodeMappings: () => nW,
- decodedTextSpanIntersectsWith: () => Sw,
- deduplicate: () => cb,
- defaultInitCompilerOptions: () => yz,
- defaultMaximumTruncationLength: () => l4,
- diagnosticCategoryName: () => U2,
- diagnosticToString: () => e2,
- diagnosticsEqualityComparer: () => o5,
- directoryProbablyExists: () => Dd,
- directorySeparator: () => Vo,
- displayPart: () => w_,
- displayPartsToString: () => P8,
- disposeEmitNodes: () => xJ,
- documentSpansEqual: () => gV,
- dumpTracingLegend: () => zX,
- elementAt: () => gy,
- elideNodes: () => Cte,
- emitDetachedComments: () => _K,
- emitFiles: () => TW,
- emitFilesAndReportErrors: () => kF,
- emitFilesAndReportErrorsAndGetExitStatus: () => lU,
- emitModuleKindIsNonNodeESM: () => j3,
- emitNewLineBeforeLeadingCommentOfPosition: () => uK,
- emitResolverSkipsTypeChecking: () => SW,
- emitSkippedWithNoDiagnostics: () => zW,
- emptyArray: () => Ue,
- emptyFileSystemEntries: () => aJ,
- emptyMap: () => eR,
- emptyOptions: () => Gp,
- endsWith: () => Zo,
- ensurePathIsNonModuleName: () => q2,
- ensureScriptKind: () => v5,
- ensureTrailingDirectorySeparator: () => ul,
- entityNameToString: () => $_,
- enumerateInsertsAndDeletes: () => yI,
- equalOwnProperties: () => yX,
- equateStringsCaseInsensitive: () => Sy,
- equateStringsCaseSensitive: () => ub,
- equateValues: () => by,
- escapeJsxAttributeString: () => CB,
- escapeLeadingUnderscores: () => tc,
- escapeNonAsciiString: () => B7,
- escapeSnippetText: () => Ob,
- escapeString: () => cg,
- escapeTemplateSubstitution: () => xB,
- evaluatorResult: () => pl,
- every: () => Mi,
- executeCommandLine: () => Ove,
- expandPreOrPostfixIncrementOrDecrementExpression: () => aO,
- explainFiles: () => iU,
- explainIfFileIsRedirectAndImpliedFormat: () => sU,
- exportAssignmentIsAlias: () => h3,
- expressionResultIsUnused: () => oee,
- extend: () => pI,
- extensionFromPath: () => z4,
- extensionIsTS: () => C5,
- extensionsNotSupportingExtensionlessResolution: () => x5,
- externalHelpersModuleNameText: () => X1,
- factory: () => A,
- fileContainsPackageImport: () => b8,
- fileExtensionIs: () => qo,
- fileExtensionIsOneOf: () => xc,
- fileIncludeReasonToDiagnostics: () => cU,
- fileShouldUseJavaScriptRequire: () => BV,
- filter: () => Ln,
- filterMutate: () => nR,
- filterSemanticDiagnostics: () => dF,
- find: () => On,
- findAncestor: () => or,
- findBestPatternMatch: () => TR,
- findChildOfKind: () => Ya,
- findComputedPropertyNameCacheAssignment: () => pO,
- findConfigFile: () => PW,
- findConstructorDeclaration: () => H3,
- findContainingList: () => GF,
- findDiagnosticForNode: () => Vse,
- findFirstNonJsxWhitespaceToken: () => _se,
- findIndex: () => ac,
- findLast: () => ob,
- findLastIndex: () => uI,
- findListItemInfo: () => use,
- findModifier: () => k6,
- findNextToken: () => Zb,
- findPackageJson: () => Use,
- findPackageJsons: () => NV,
- findPrecedingMatchingToken: () => ZF,
- findPrecedingToken: () => sl,
- findSuperStatementIndexPath: () => GO,
- findTokenOnLeftOfPosition: () => r8,
- findUseStrictPrologue: () => KJ,
- first: () => xa,
- firstDefined: () => Tc,
- firstDefinedIterator: () => ew,
- firstIterator: () => _R,
- firstOrOnly: () => LV,
- firstOrUndefined: () => el,
- firstOrUndefinedIterator: () => rw,
- fixupCompilerOptions: () => tq,
- flatMap: () => ta,
- flatMapIterator: () => iR,
- flatMapToMutable: () => AE,
- flatten: () => Np,
- flattenCommaList: () => Pte,
- flattenDestructuringAssignment: () => DS,
- flattenDestructuringBinding: () => Gb,
- flattenDiagnosticMessageText: () => Em,
- forEach: () => ir,
- forEachAncestor: () => KY,
- forEachAncestorDirectory: () => Fp,
- forEachChild: () => bs,
- forEachChildRecursively: () => jx,
- forEachEmittedFile: () => hW,
- forEachEnclosingBlockScopeContainer: () => dZ,
- forEachEntry: () => El,
- forEachExternalModuleToImportFrom: () => WV,
- forEachImportClauseDeclaration: () => UZ,
- forEachKey: () => Ch,
- forEachLeadingCommentRange: () => mw,
- forEachNameInAccessChainWalkingLeft: () => NK,
- forEachNameOfDefaultExport: () => k9,
- forEachPropertyAssignment: () => vC,
- forEachResolvedProjectReference: () => jW,
- forEachReturnStatement: () => y0,
- forEachRight: () => lX,
- forEachTrailingCommentRange: () => gw,
- forEachTsConfigPropArray: () => $w,
- forEachUnique: () => yV,
- forEachYieldExpression: () => TZ,
- formatColorAndReset: () => Xb,
- formatDiagnostic: () => IW,
- formatDiagnostics: () => m1e,
- formatDiagnosticsWithColorAndContext: () => zne,
- formatGeneratedName: () => mv,
- formatGeneratedNamePart: () => r6,
- formatLocation: () => OW,
- formatMessage: () => dx,
- formatStringFromArgs: () => zg,
- formatting: () => Yc,
- generateDjb2Hash: () => WE,
- generateTSConfig: () => Kte,
- getAdjustedReferenceLocation: () => YU,
- getAdjustedRenameLocation: () => XF,
- getAliasDeclarationFromName: () => pB,
- getAllAccessorDeclarations: () => My,
- getAllDecoratorsOfClass: () => cW,
- getAllDecoratorsOfClassElement: () => XO,
- getAllJSDocTags: () => jI,
- getAllJSDocTagsOfKind: () => uge,
- getAllKeys: () => dme,
- getAllProjectOutputs: () => rF,
- getAllSuperTypeNodes: () => T4,
- getAllowJSCompilerOption: () => By,
- getAllowSyntheticDefaultImports: () => mx,
- getAncestor: () => nv,
- getAnyExtensionFromPath: () => rC,
- getAreDeclarationMapsEnabled: () => l5,
- getAssignedExpandoInitializer: () => ZT,
- getAssignedName: () => LI,
- getAssignmentDeclarationKind: () => Cc,
- getAssignmentDeclarationPropertyAccessKind: () => o3,
- getAssignmentTargetKind: () => rv,
- getAutomaticTypeDirectiveNames: () => NO,
- getBaseFileName: () => Hc,
- getBinaryOperatorPrecedence: () => T3,
- getBuildInfo: () => xW,
- getBuildInfoFileVersionMap: () => XW,
- getBuildInfoText: () => wne,
- getBuildOrderFromAnyBuildOrder: () => HA,
- getBuilderCreationParameters: () => yF,
- getBuilderFileEmit: () => e1,
- getCanonicalDiagnostic: () => vZ,
- getCheckFlags: () => gc,
- getClassExtendsHeritageElement: () => Cb,
- getClassLikeDeclarationOfSymbol: () => Ah,
- getCombinedLocalAndExportSymbolFlags: () => FC,
- getCombinedModifierFlags: () => U1,
- getCombinedNodeFlags: () => xh,
- getCombinedNodeFlagsAlwaysIncludeJSDoc: () => cj,
- getCommentRange: () => ym,
- getCommonSourceDirectory: () => LD,
- getCommonSourceDirectoryOfConfig: () => Gx,
- getCompilerOptionValue: () => f5,
- getCompilerOptionsDiffValue: () => Zte,
- getConditions: () => Qy,
- getConfigFileParsingDiagnostics: () => Qb,
- getConstantValue: () => Eee,
- getContainerFlags: () => Uz,
- getContainerNode: () => AS,
- getContainingClass: () => Ol,
- getContainingClassExcludingClassDecorators: () => b7,
- getContainingClassStaticBlock: () => IZ,
- getContainingFunction: () => yf,
- getContainingFunctionDeclaration: () => NZ,
- getContainingFunctionOrClassStaticBlock: () => v7,
- getContainingNodeArray: () => cee,
- getContainingObjectLiteralElement: () => w8,
- getContextualTypeFromParent: () => u9,
- getContextualTypeFromParentOrAncestorTypeNode: () => $F,
- getDeclarationDiagnostics: () => xne,
- getDeclarationEmitExtensionForPath: () => W7,
- getDeclarationEmitOutputFilePath: () => iK,
- getDeclarationEmitOutputFilePathWorker: () => z7,
- getDeclarationFileExtension: () => uz,
- getDeclarationFromName: () => S4,
- getDeclarationModifierFlagsFromSymbol: () => lp,
- getDeclarationOfKind: () => Jo,
- getDeclarationsOfKind: () => YY,
- getDeclaredExpandoInitializer: () => y4,
- getDecorators: () => Cy,
- getDefaultCompilerOptions: () => J9,
- getDefaultFormatCodeSettings: () => jF,
- getDefaultLibFileName: () => yw,
- getDefaultLibFilePath: () => woe,
- getDefaultLikeExportInfo: () => x9,
- getDefaultLikeExportNameFromDeclaration: () => MV,
- getDefaultResolutionModeForFileWorker: () => pF,
- getDiagnosticText: () => g_,
- getDiagnosticsWithinSpan: () => qse,
- getDirectoryPath: () => Xn,
- getDirectoryToWatchFailedLookupLocation: () => ZW,
- getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => uie,
- getDocumentPositionMapper: () => QV,
- getDocumentSpansEqualityComparer: () => hV,
- getESModuleInterop: () => Wg,
- getEditsForFileRename: () => eae,
- getEffectiveBaseTypeNode: () => _m,
- getEffectiveConstraintOfTypeParameter: () => oC,
- getEffectiveContainerForJSDocTemplateTag: () => I7,
- getEffectiveImplementsTypeNodes: () => DC,
- getEffectiveInitializer: () => i3,
- getEffectiveJSDocHost: () => tv,
- getEffectiveModifierFlags: () => Mu,
- getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => mK,
- getEffectiveModifierFlagsNoCache: () => gK,
- getEffectiveReturnTypeNode: () => Y_,
- getEffectiveSetAccessorTypeAnnotationNode: () => lK,
- getEffectiveTypeAnnotationNode: () => Gc,
- getEffectiveTypeParameterDeclarations: () => Ey,
- getEffectiveTypeRoots: () => TD,
- getElementOrPropertyAccessArgumentExpressionOrName: () => N7,
- getElementOrPropertyAccessName: () => Eh,
- getElementsOfBindingOrAssignmentPattern: () => t6,
- getEmitDeclarations: () => P_,
- getEmitFlags: () => ya,
- getEmitHelpers: () => B5,
- getEmitModuleDetectionKind: () => jK,
- getEmitModuleFormatOfFileWorker: () => BD,
- getEmitModuleKind: () => Ru,
- getEmitModuleResolutionKind: () => yu,
- getEmitScriptTarget: () => pa,
- getEmitStandardClassFields: () => ZB,
- getEnclosingBlockScopeContainer: () => Cd,
- getEnclosingContainer: () => _7,
- getEncodedSemanticClassifications: () => UV,
- getEncodedSyntacticClassifications: () => VV,
- getEndLinePosition: () => jw,
- getEntityNameFromTypeNode: () => Yw,
- getEntrypointsFromPackageJsonInfo: () => jz,
- getErrorCountForSummary: () => TF,
- getErrorSpanForNode: () => tS,
- getErrorSummaryText: () => rU,
- getEscapedTextOfIdentifierOrLiteral: () => C4,
- getEscapedTextOfJsxAttributeName: () => X4,
- getEscapedTextOfJsxNamespacedName: () => yx,
- getExpandoInitializer: () => K1,
- getExportAssignmentExpression: () => dB,
- getExportInfoMap: () => S8,
- getExportNeedsImportStarHelper: () => Vre,
- getExpressionAssociativity: () => SB,
- getExpressionPrecedence: () => E4,
- getExternalHelpersModuleName: () => lO,
- getExternalModuleImportEqualsDeclarationExpression: () => g4,
- getExternalModuleName: () => KT,
- getExternalModuleNameFromDeclaration: () => rK,
- getExternalModuleNameFromPath: () => PB,
- getExternalModuleNameLiteral: () => Rx,
- getExternalModuleRequireArgument: () => nB,
- getFallbackOptions: () => BA,
- getFileEmitOutput: () => Vne,
- getFileMatcherPatterns: () => y5,
- getFileNamesFromConfigSpecs: () => bD,
- getFileWatcherEventKind: () => $R,
- getFilesInErrorForSummary: () => xF,
- getFirstConstructorWithBody: () => Bg,
- getFirstIdentifier: () => E_,
- getFirstNonSpaceCharacterPosition: () => Lse,
- getFirstProjectOutput: () => bW,
- getFixableErrorSpanExpression: () => OV,
- getFormatCodeSettingsForWriting: () => b9,
- getFullWidth: () => Rw,
- getFunctionFlags: () => Jc,
- getHeritageClause: () => y3,
- getHostSignatureFromJSDoc: () => ev,
- getIdentifierAutoGenerate: () => che,
- getIdentifierGeneratedImportReference: () => Iee,
- getIdentifierTypeArguments: () => _S,
- getImmediatelyInvokedFunctionExpression: () => bb,
- getImpliedNodeFormatForEmitWorker: () => PS,
- getImpliedNodeFormatForFile: () => zA,
- getImpliedNodeFormatForFileWorker: () => fF,
- getImportNeedsImportDefaultHelper: () => sW,
- getImportNeedsImportStarHelper: () => qO,
- getIndentString: () => J7,
- getInferredLibraryNameResolveFrom: () => _F,
- getInitializedVariables: () => F4,
- getInitializerOfBinaryExpression: () => oB,
- getInitializerOfBindingOrAssignmentElement: () => uA,
- getInterfaceBaseTypeNodes: () => x4,
- getInternalEmitFlags: () => _d,
- getInvokedExpression: () => x7,
- getIsFileExcluded: () => Xse,
- getIsolatedModules: () => Wp,
- getJSDocAugmentsTag: () => xY,
- getJSDocClassTag: () => _j,
- getJSDocCommentRanges: () => Zj,
- getJSDocCommentsAndTags: () => cB,
- getJSDocDeprecatedTag: () => fj,
- getJSDocDeprecatedTagNoCache: () => AY,
- getJSDocEnumTag: () => pj,
- getJSDocHost: () => xb,
- getJSDocImplementsTags: () => kY,
- getJSDocOverloadTags: () => uB,
- getJSDocOverrideTagNoCache: () => wY,
- getJSDocParameterTags: () => aC,
- getJSDocParameterTagsNoCache: () => vY,
- getJSDocPrivateTag: () => age,
- getJSDocPrivateTagNoCache: () => EY,
- getJSDocProtectedTag: () => oge,
- getJSDocProtectedTagNoCache: () => DY,
- getJSDocPublicTag: () => sge,
- getJSDocPublicTagNoCache: () => CY,
- getJSDocReadonlyTag: () => cge,
- getJSDocReadonlyTagNoCache: () => PY,
- getJSDocReturnTag: () => NY,
- getJSDocReturnType: () => kw,
- getJSDocRoot: () => EC,
- getJSDocSatisfiesExpressionType: () => gJ,
- getJSDocSatisfiesTag: () => dj,
- getJSDocTags: () => H1,
- getJSDocTemplateTag: () => lge,
- getJSDocThisTag: () => MI,
- getJSDocType: () => q1,
- getJSDocTypeAliasName: () => rz,
- getJSDocTypeAssertionType: () => mD,
- getJSDocTypeParameterDeclarations: () => G7,
- getJSDocTypeParameterTags: () => bY,
- getJSDocTypeParameterTagsNoCache: () => SY,
- getJSDocTypeTag: () => V1,
- getJSXImplicitImportBase: () => d5,
- getJSXRuntimeImport: () => m5,
- getJSXTransformEnabled: () => p5,
- getKeyForCompilerOptions: () => Oz,
- getLanguageVariant: () => F3,
- getLastChild: () => qB,
- getLeadingCommentRanges: () => Ig,
- getLeadingCommentRangesOfNode: () => Yj,
- getLeftmostAccessExpression: () => LC,
- getLeftmostExpression: () => MC,
- getLibraryNameFromLibFileName: () => BW,
- getLineAndCharacterOfPosition: () => Qs,
- getLineInfo: () => rW,
- getLineOfLocalPosition: () => D4,
- getLineStartPositionForPosition: () => $p,
- getLineStarts: () => Ag,
- getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => PK,
- getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => DK,
- getLinesBetweenPositions: () => GE,
- getLinesBetweenRangeEndAndRangeStart: () => zB,
- getLinesBetweenRangeEndPositions: () => Bge,
- getLiteralText: () => oZ,
- getLocalNameForExternalImport: () => e6,
- getLocalSymbolForExportDefault: () => N4,
- getLocaleSpecificMessage: () => ms,
- getLocaleTimeString: () => qA,
- getMappedContextSpan: () => vV,
- getMappedDocumentSpan: () => o9,
- getMappedLocation: () => XD,
- getMatchedFileSpec: () => aU,
- getMatchedIncludeSpec: () => oU,
- getMeaningFromDeclaration: () => JF,
- getMeaningFromLocation: () => wS,
- getMembersOfDeclaration: () => xZ,
- getModeForFileReference: () => oF,
- getModeForResolutionAtIndex: () => S1e,
- getModeForUsageLocation: () => LW,
- getModifiedTime: () => RT,
- getModifiers: () => fb,
- getModuleInstanceState: () => Rh,
- getModuleNameStringLiteralAt: () => UA,
- getModuleSpecifierEndingPreference: () => YK,
- getModuleSpecifierResolverHost: () => uV,
- getNameForExportedSymbol: () => h9,
- getNameFromImportAttribute: () => O5,
- getNameFromIndexInfo: () => mZ,
- getNameFromPropertyName: () => o8,
- getNameOfAccessExpression: () => GB,
- getNameOfCompilerOptionValue: () => Ez,
- getNameOfDeclaration: () => os,
- getNameOfExpando: () => iB,
- getNameOfJSDocTypedef: () => yY,
- getNameOfScriptTarget: () => _5,
- getNameOrArgument: () => a3,
- getNameTable: () => Cq,
- getNamespaceDeclarationNode: () => kC,
- getNewLineCharacter: () => k0,
- getNewLineKind: () => v8,
- getNewLineOrDefaultFromHost: () => jh,
- getNewTargetContainer: () => FZ,
- getNextJSDocCommentLocation: () => lB,
- getNodeChildren: () => GJ,
- getNodeForGeneratedName: () => fA,
- getNodeId: () => Ma,
- getNodeKind: () => Yb,
- getNodeModifiers: () => HD,
- getNodeModulePathParts: () => A5,
- getNonAssignedNameOfDeclaration: () => FI,
- getNonAssignmentOperatorForCompoundAssignment: () => wD,
- getNonAugmentationDeclaration: () => Vj,
- getNonDecoratorTokenPosOfNode: () => jj,
- getNonIncrementalBuildInfoRoots: () => sie,
- getNonModifierTokenPosOfNode: () => sZ,
- getNormalizedAbsolutePath: () => es,
- getNormalizedAbsolutePathWithoutRoot: () => ZR,
- getNormalizedPathComponents: () => _w,
- getObjectFlags: () => wn,
- getOperatorAssociativity: () => TB,
- getOperatorPrecedence: () => S3,
- getOptionFromName: () => bz,
- getOptionsForLibraryResolution: () => Fz,
- getOptionsNameMap: () => i6,
- getOrCreateEmitNode: () => lu,
- getOrUpdate: () => NE,
- getOriginalNode: () => Ho,
- getOriginalNodeId: () => e_,
- getOutputDeclarationFileName: () => p6,
- getOutputDeclarationFileNameWorker: () => yW,
- getOutputExtension: () => tF,
- getOutputFileNames: () => p1e,
- getOutputJSFileNameWorker: () => vW,
- getOutputPathsFor: () => FD,
- getOwnEmitOutputFilePath: () => nK,
- getOwnKeys: () => rm,
- getOwnValues: () => OT,
- getPackageJsonTypesVersionsPaths: () => AO,
- getPackageNameFromTypesPackageName: () => ED,
- getPackageScopeForPath: () => CD,
- getParameterSymbolFromJSDoc: () => d3,
- getParentNodeInSpan: () => l8,
- getParseTreeNode: () => fs,
- getParsedCommandLineOfConfigFile: () => yA,
- getPathComponents: () => Cl,
- getPathFromPathComponents: () => p0,
- getPathUpdater: () => GV,
- getPathsBasePath: () => U7,
- getPatternFromSpec: () => GK,
- getPendingEmitKindWithSeen: () => hF,
- getPositionOfLineAndCharacter: () => pw,
- getPossibleGenericSignatures: () => KU,
- getPossibleOriginalInputExtensionForExtension: () => sK,
- getPossibleTypeArgumentsInfo: () => eV,
- getPreEmitDiagnostics: () => d1e,
- getPrecedingNonSpaceCharacterPosition: () => c9,
- getPrivateIdentifier: () => lW,
- getProperties: () => oW,
- getProperty: () => fI,
- getPropertyArrayElementValue: () => AZ,
- getPropertyAssignmentAliasLikeExpression: () => QZ,
- getPropertyNameForPropertyNameNode: () => oS,
- getPropertyNameFromType: () => _p,
- getPropertyNameOfBindingOrAssignmentElement: () => tz,
- getPropertySymbolFromBindingElement: () => a9,
- getPropertySymbolsFromContextualType: () => W9,
- getQuoteFromPreference: () => fV,
- getQuotePreference: () => bf,
- getRangesWhere: () => oR,
- getRefactorContextSpan: () => Kx,
- getReferencedFileLocation: () => jD,
- getRegexFromPattern: () => Jy,
- getRegularExpressionForWildcard: () => j4,
- getRegularExpressionsForWildcards: () => g5,
- getRelativePathFromDirectory: () => ld,
- getRelativePathFromFile: () => qE,
- getRelativePathToDirectoryOrUrl: () => jT,
- getRenameLocation: () => f8,
- getReplacementSpanForContextToken: () => iV,
- getResolutionDiagnostic: () => UW,
- getResolutionModeOverride: () => d6,
- getResolveJsonModule: () => Ab,
- getResolvePackageJsonExports: () => M3,
- getResolvePackageJsonImports: () => c5,
- getResolvedExternalModuleName: () => DB,
- getResolvedModuleFromResolution: () => HT,
- getResolvedTypeReferenceDirectiveFromResolution: () => r7,
- getRestIndicatorOfBindingOrAssignmentElement: () => uO,
- getRestParameterElementType: () => Kj,
- getRightMostAssignedExpression: () => s3,
- getRootDeclaration: () => pm,
- getRootDirectoryOfResolutionCache: () => _ie,
- getRootLength: () => Km,
- getScriptKind: () => xV,
- getScriptKindFromFileName: () => b5,
- getScriptTargetFeatures: () => Bj,
- getSelectedEffectiveModifierFlags: () => ox,
- getSelectedSyntacticModifierFlags: () => pK,
- getSemanticClassifications: () => Qse,
- getSemanticJsxChildren: () => wC,
- getSetAccessorTypeAnnotationNode: () => oK,
- getSetAccessorValueParameter: () => IC,
- getSetExternalModuleIndicator: () => L3,
- getShebang: () => II,
- getSingleVariableOfVariableStatement: () => rx,
- getSnapshotText: () => Yx,
- getSnippetElement: () => kJ,
- getSourceFileOfModule: () => s7,
- getSourceFileOfNode: () => Tr,
- getSourceFilePathInNewDir: () => q7,
- getSourceFileVersionAsHashFromText: () => CF,
- getSourceFilesToEmit: () => V7,
- getSourceMapRange: () => E0,
- getSourceMapper: () => fae,
- getSourceTextOfNodeFromSourceFile: () => gb,
- getSpanOfTokenAtPosition: () => cm,
- getSpellingSuggestion: () => _b,
- getStartPositionOfLine: () => Iy,
- getStartPositionOfRange: () => O4,
- getStartsOnNewLine: () => Y4,
- getStaticPropertiesAndClassStaticBlock: () => $O,
- getStrictOptionValue: () => cu,
- getStringComparer: () => Kk,
- getSubPatternFromSpec: () => h5,
- getSuperCallFromStatement: () => HO,
- getSuperContainer: () => Xw,
- getSupportedCodeFixes: () => xq,
- getSupportedExtensions: () => B4,
- getSupportedExtensionsWithJsonIfResolveJsonModule: () => J3,
- getSwitchedType: () => PV,
- getSymbolId: () => na,
- getSymbolNameForPrivateIdentifier: () => v3,
- getSymbolTarget: () => kV,
- getSyntacticClassifications: () => Yse,
- getSyntacticModifierFlags: () => T0,
- getSyntacticModifierFlagsNoCache: () => OB,
- getSynthesizedDeepClone: () => Ja,
- getSynthesizedDeepCloneWithReplacements: () => _8,
- getSynthesizedDeepClones: () => Kb,
- getSynthesizedDeepClonesWithReplacements: () => CV,
- getSyntheticLeadingComments: () => UC,
- getSyntheticTrailingComments: () => Y3,
- getTargetLabel: () => UF,
- getTargetOfBindingOrAssignmentElement: () => $y,
- getTemporaryModuleResolutionState: () => kD,
- getTextOfConstantValue: () => cZ,
- getTextOfIdentifierOrLiteral: () => Jp,
- getTextOfJSDocComment: () => Cw,
- getTextOfJsxAttributeName: () => q3,
- getTextOfJsxNamespacedName: () => Q4,
- getTextOfNode: () => nc,
- getTextOfNodeFromSourceText: () => _4,
- getTextOfPropertyName: () => QT,
- getThisContainer: () => Lu,
- getThisParameter: () => Eb,
- getTokenAtPosition: () => xi,
- getTokenPosOfNode: () => Oy,
- getTokenSourceMapRange: () => ahe,
- getTouchingPropertyName: () => h_,
- getTouchingToken: () => T6,
- getTrailingCommentRanges: () => ky,
- getTrailingSemicolonDeferringWriter: () => EB,
- getTransformers: () => Ene,
- getTsBuildInfoEmitOutputFilePath: () => bv,
- getTsConfigObjectLiteralExpression: () => d4,
- getTsConfigPropArrayElementValue: () => y7,
- getTypeAnnotationNode: () => cK,
- getTypeArgumentOrTypeParameterList: () => yse,
- getTypeKeywordOfTypeOnlyImport: () => mV,
- getTypeNode: () => Aee,
- getTypeNodeIfAccessible: () => eP,
- getTypeParameterFromJsDoc: () => VZ,
- getTypeParameterOwner: () => tge,
- getTypesPackageName: () => jO,
- getUILocale: () => xX,
- getUniqueName: () => IS,
- getUniqueSymbolId: () => Fse,
- getUseDefineForClassFields: () => R3,
- getWatchErrorSummaryDiagnosticMessage: () => tU,
- getWatchFactory: () => DW,
- group: () => Zk,
- groupBy: () => dR,
- guessIndentation: () => XY,
- handleNoEmitOptions: () => WW,
- handleWatchOptionsConfigDirTemplateSubstitution: () => CO,
- hasAbstractModifier: () => wb,
- hasAccessorModifier: () => dm,
- hasAmbientModifier: () => IB,
- hasChangesInResolutions: () => Lj,
- hasContextSensitiveParameters: () => P5,
- hasDecorators: () => Ff,
- hasDocComment: () => gse,
- hasDynamicName: () => Dh,
- hasEffectiveModifier: () => Z_,
- hasEffectiveModifiers: () => NB,
- hasEffectiveReadonlyModifier: () => P4,
- hasExtension: () => tC,
- hasImplementationTSFileExtension: () => XK,
- hasIndexSignature: () => DV,
- hasInferredType: () => hee,
- hasInitializer: () => m0,
- hasInvalidEscape: () => kB,
- hasJSDocNodes: () => gf,
- hasJSDocParameterTags: () => TY,
- hasJSFileExtension: () => Ug,
- hasJsonModuleEmitEnabled: () => u5,
- hasOnlyExpressionInitializer: () => K2,
- hasOverrideModifier: () => $7,
- hasPossibleExternalModuleReference: () => pZ,
- hasProperty: () => co,
- hasPropertyAccessExpressionWithName: () => ZA,
- hasQuestionToken: () => tx,
- hasRecordedExternalHelpers: () => gte,
- hasResolutionModeOverride: () => pee,
- hasRestParameter: () => Aj,
- hasScopeMarker: () => zY,
- hasStaticModifier: () => tl,
- hasSyntacticModifier: () => Gn,
- hasSyntacticModifiers: () => fK,
- hasTSFileExtension: () => gx,
- hasTabstop: () => uee,
- hasTrailingDirectorySeparator: () => xy,
- hasType: () => YI,
- hasTypeArguments: () => wge,
- hasZeroOrOneAsteriskCharacter: () => KB,
- hostGetCanonicalFileName: () => S0,
- hostUsesCaseSensitiveFileNames: () => sx,
- idText: () => Nn,
- identifierIsThisKeyword: () => AB,
- identifierToKeywordKind: () => G2,
- identity: () => go,
- identitySourceMapConsumer: () => iW,
- ignoreSourceNewlines: () => EJ,
- ignoredPaths: () => kI,
- importFromModuleSpecifier: () => v4,
- importSyntaxAffectsModuleResolution: () => YB,
- indexOfAnyCharCode: () => _X,
- indexOfNode: () => mC,
- indicesOf: () => _I,
- inferredTypesContainingFile: () => RD,
- injectClassNamedEvaluationHelperBlockIfMissing: () => ZO,
- injectClassThisAssignmentIfMissing: () => Zre,
- insertImports: () => dV,
- insertSorted: () => my,
- insertStatementAfterCustomPrologue: () => eS,
- insertStatementAfterStandardPrologue: () => Tge,
- insertStatementsAfterCustomPrologue: () => Mj,
- insertStatementsAfterStandardPrologue: () => Mg,
- intersperse: () => rR,
- intrinsicTagNameToString: () => hJ,
- introducesArgumentsExoticObject: () => DZ,
- inverseJsxOptionMap: () => gA,
- isAbstractConstructorSymbol: () => wK,
- isAbstractModifier: () => Wee,
- isAccessExpression: () => xo,
- isAccessibilityModifier: () => rV,
- isAccessor: () => Ay,
- isAccessorModifier: () => Vee,
- isAliasableExpression: () => O7,
- isAmbientModule: () => Fu,
- isAmbientPropertyDeclaration: () => Hj,
- isAnyDirectorySeparator: () => XR,
- isAnyImportOrBareOrAccessedRequire: () => _Z,
- isAnyImportOrReExport: () => zw,
- isAnyImportOrRequireStatement: () => fZ,
- isAnyImportSyntax: () => XT,
- isAnySupportedFileExtension: () => Zge,
- isApplicableVersionedTypesKey: () => CA,
- isArgumentExpressionOfElementAccess: () => VU,
- isArray: () => us,
- isArrayBindingElement: () => qI,
- isArrayBindingOrAssignmentElement: () => Nw,
- isArrayBindingOrAssignmentPattern: () => kj,
- isArrayBindingPattern: () => w0,
- isArrayLiteralExpression: () => $l,
- isArrayLiteralOrObjectLiteralDestructuringPattern: () => F0,
- isArrayTypeNode: () => rA,
- isArrowFunction: () => Co,
- isAsExpression: () => iD,
- isAssertClause: () => Qee,
- isAssertEntry: () => hhe,
- isAssertionExpression: () => $1,
- isAssertsKeyword: () => Jee,
- isAssignmentDeclaration: () => h4,
- isAssignmentExpression: () => Dl,
- isAssignmentOperator: () => Ph,
- isAssignmentPattern: () => o4,
- isAssignmentTarget: () => b0,
- isAsteriskToken: () => K3,
- isAsyncFunction: () => k4,
- isAsyncModifier: () => tD,
- isAutoAccessorPropertyDeclaration: () => u_,
- isAwaitExpression: () => Hy,
- isAwaitKeyword: () => NJ,
- isBigIntLiteral: () => eD,
- isBinaryExpression: () => dn,
- isBinaryLogicalOperator: () => D3,
- isBinaryOperatorToken: () => kte,
- isBindableObjectDefinePropertyCall: () => sS,
- isBindableStaticAccessExpression: () => Tb,
- isBindableStaticElementAccessExpression: () => A7,
- isBindableStaticNameExpression: () => aS,
- isBindingElement: () => va,
- isBindingElementOfBareOrAccessedRequire: () => RZ,
- isBindingName: () => Y2,
- isBindingOrAssignmentElement: () => RY,
- isBindingOrAssignmentPattern: () => ww,
- isBindingPattern: () => As,
- isBlock: () => Cs,
- isBlockLike: () => ek,
- isBlockOrCatchScoped: () => Jj,
- isBlockScope: () => Gj,
- isBlockScopedContainerTopLevel: () => uZ,
- isBooleanLiteral: () => a4,
- isBreakOrContinueStatement: () => t4,
- isBreakStatement: () => dhe,
- isBuild: () => Oie,
- isBuildInfoFile: () => Dne,
- isBuilderProgram: () => nU,
- isBundle: () => ete,
- isCallChain: () => $2,
- isCallExpression: () => Fs,
- isCallExpressionTarget: () => jU,
- isCallLikeExpression: () => mb,
- isCallLikeOrFunctionLikeExpression: () => Cj,
- isCallOrNewExpression: () => am,
- isCallOrNewExpressionTarget: () => BU,
- isCallSignatureDeclaration: () => Dx,
- isCallToHelper: () => K4,
- isCaseBlock: () => cD,
- isCaseClause: () => XC,
- isCaseKeyword: () => qee,
- isCaseOrDefaultClause: () => XI,
- isCatchClause: () => Ub,
- isCatchClauseVariableDeclaration: () => lee,
- isCatchClauseVariableDeclarationOrBindingElement: () => zj,
- isCheckJsEnabledForFile: () => W4,
- isCircularBuildOrder: () => Xx,
- isClassDeclaration: () => Xc,
- isClassElement: () => _l,
- isClassExpression: () => $c,
- isClassInstanceProperty: () => LY,
- isClassLike: () => Zn,
- isClassMemberModifier: () => Sj,
- isClassNamedEvaluationHelperBlock: () => Hx,
- isClassOrTypeElement: () => VI,
- isClassStaticBlockDeclaration: () => oc,
- isClassThisAssignmentBlock: () => ND,
- isColonToken: () => jee,
- isCommaExpression: () => cA,
- isCommaListExpression: () => aD,
- isCommaSequence: () => dD,
- isCommaToken: () => Ree,
- isComment: () => KF,
- isCommonJsExportPropertyAssignment: () => g7,
- isCommonJsExportedExpression: () => CZ,
- isCompoundAssignment: () => PD,
- isComputedNonLiteralName: () => Ww,
- isComputedPropertyName: () => ma,
- isConciseBody: () => GI,
- isConditionalExpression: () => Ix,
- isConditionalTypeNode: () => Mb,
- isConstAssertion: () => yJ,
- isConstTypeReference: () => xd,
- isConstructSignatureDeclaration: () => tA,
- isConstructorDeclaration: () => Qo,
- isConstructorTypeNode: () => VC,
- isContextualKeyword: () => L7,
- isContinueStatement: () => phe,
- isCustomPrologue: () => Gw,
- isDebuggerStatement: () => mhe,
- isDeclaration: () => ql,
- isDeclarationBindingElement: () => Pw,
- isDeclarationFileName: () => wl,
- isDeclarationName: () => og,
- isDeclarationNameOfEnumOrNamespace: () => WB,
- isDeclarationReadonly: () => Vw,
- isDeclarationStatement: () => qY,
- isDeclarationWithTypeParameterChildren: () => Xj,
- isDeclarationWithTypeParameters: () => $j,
- isDecorator: () => dl,
- isDecoratorTarget: () => sse,
- isDefaultClause: () => uD,
- isDefaultImport: () => ex,
- isDefaultModifier: () => H5,
- isDefaultedExpandoInitializer: () => jZ,
- isDeleteExpression: () => Gee,
- isDeleteTarget: () => fB,
- isDeprecatedDeclaration: () => y9,
- isDestructuringAssignment: () => x0,
- isDiskPathRoot: () => QR,
- isDoStatement: () => fhe,
- isDocumentRegistryEntry: () => T8,
- isDotDotDotToken: () => V5,
- isDottedName: () => w3,
- isDynamicName: () => R7,
- isEffectiveExternalModule: () => $T,
- isEffectiveStrictModeSourceFile: () => qj,
- isElementAccessChain: () => mj,
- isElementAccessExpression: () => ko,
- isEmittedFileOfProgram: () => Fne,
- isEmptyArrayLiteral: () => bK,
- isEmptyBindingElement: () => mY,
- isEmptyBindingPattern: () => dY,
- isEmptyObjectLiteral: () => jB,
- isEmptyStatement: () => MJ,
- isEmptyStringLiteral: () => rB,
- isEntityName: () => l_,
- isEntityNameExpression: () => yo,
- isEnumConst: () => Y1,
- isEnumDeclaration: () => Bb,
- isEnumMember: () => A0,
- isEqualityOperatorKind: () => _9,
- isEqualsGreaterThanToken: () => Bee,
- isExclamationToken: () => eA,
- isExcludedFile: () => tre,
- isExclusivelyTypeOnlyImportOrExport: () => FW,
- isExpandoPropertyDeclaration: () => vx,
- isExportAssignment: () => wo,
- isExportDeclaration: () => Nc,
- isExportModifier: () => Cx,
- isExportName: () => oO,
- isExportNamespaceAsDefaultDeclaration: () => c7,
- isExportOrDefaultModifier: () => _A,
- isExportSpecifier: () => vu,
- isExportsIdentifier: () => iS,
- isExportsOrModuleExportsOrAlias: () => qb,
- isExpression: () => _t,
- isExpressionNode: () => Ed,
- isExpressionOfExternalModuleImportEqualsDeclaration: () => cse,
- isExpressionOfOptionalChainRoot: () => JI,
- isExpressionStatement: () => Pl,
- isExpressionWithTypeArguments: () => Oh,
- isExpressionWithTypeArgumentsInClassExtendsClause: () => Q7,
- isExternalModule: () => il,
- isExternalModuleAugmentation: () => yb,
- isExternalModuleImportEqualsDeclaration: () => Z1,
- isExternalModuleIndicator: () => Ow,
- isExternalModuleNameRelative: () => Sl,
- isExternalModuleReference: () => Fh,
- isExternalModuleSymbol: () => fC,
- isExternalOrCommonJsModule: () => X_,
- isFileLevelReservedGeneratedIdentifier: () => Dw,
- isFileLevelUniqueName: () => a7,
- isFileProbablyExternalModule: () => dA,
- isFirstDeclarationOfSymbolParameter: () => bV,
- isFixablePromiseHandler: () => KV,
- isForInOrOfStatement: () => Z2,
- isForInStatement: () => Z5,
- isForInitializer: () => ip,
- isForOfStatement: () => nA,
- isForStatement: () => fv,
- isFullSourceFile: () => sg,
- isFunctionBlock: () => vb,
- isFunctionBody: () => Dj,
- isFunctionDeclaration: () => Ec,
- isFunctionExpression: () => vo,
- isFunctionExpressionOrArrowFunction: () => Wy,
- isFunctionLike: () => ys,
- isFunctionLikeDeclaration: () => no,
- isFunctionLikeKind: () => WT,
- isFunctionLikeOrClassStaticBlockDeclaration: () => lC,
- isFunctionOrConstructorTypeNode: () => MY,
- isFunctionOrModuleBlock: () => Tj,
- isFunctionSymbol: () => zZ,
- isFunctionTypeNode: () => lg,
- isGeneratedIdentifier: () => jo,
- isGeneratedPrivateIdentifier: () => Q2,
- isGetAccessor: () => d0,
- isGetAccessorDeclaration: () => Lf,
- isGetOrSetAccessorDeclaration: () => Ew,
- isGlobalScopeAugmentation: () => ig,
- isGlobalSourceFile: () => g0,
- isGrammarError: () => nZ,
- isHeritageClause: () => ef,
- isHoistedFunction: () => d7,
- isHoistedVariableStatement: () => m7,
- isIdentifier: () => Oe,
- isIdentifierANonContextualKeyword: () => hB,
- isIdentifierName: () => XZ,
- isIdentifierOrThisTypeNode: () => bte,
- isIdentifierPart: () => Th,
- isIdentifierStart: () => eg,
- isIdentifierText: () => k_,
- isIdentifierTypePredicate: () => PZ,
- isIdentifierTypeReference: () => iee,
- isIfStatement: () => _v,
- isIgnoredFileFromWildCardWatching: () => jA,
- isImplicitGlob: () => rJ,
- isImportAttribute: () => Yee,
- isImportAttributeName: () => FY,
- isImportAttributes: () => hS,
- isImportCall: () => hf,
- isImportClause: () => Ad,
- isImportDeclaration: () => ic,
- isImportEqualsDeclaration: () => gl,
- isImportKeyword: () => nD,
- isImportMeta: () => yC,
- isImportOrExportSpecifier: () => G1,
- isImportOrExportSpecifierName: () => Ose,
- isImportSpecifier: () => Zu,
- isImportTypeAssertionContainer: () => ghe,
- isImportTypeNode: () => bm,
- isImportableFile: () => zV,
- isInComment: () => O0,
- isInCompoundLikeAssignment: () => _B,
- isInExpressionContext: () => k7,
- isInJSDoc: () => e3,
- isInJSFile: () => cn,
- isInJSXText: () => mse,
- isInJsonFile: () => E7,
- isInNonReferenceComment: () => Sse,
- isInReferenceComment: () => bse,
- isInRightSideOfInternalImportEqualsDeclaration: () => zF,
- isInString: () => Qx,
- isInTemplateString: () => ZU,
- isInTopLevelContext: () => S7,
- isInTypeQuery: () => ax,
- isIncrementalBuildInfo: () => VA,
- isIncrementalBundleEmitBuildInfo: () => Kne,
- isIncrementalCompilation: () => Nb,
- isIndexSignatureDeclaration: () => Fb,
- isIndexedAccessTypeNode: () => Rb,
- isInferTypeNode: () => pS,
- isInfinityOrNaNString: () => G4,
- isInitializedProperty: () => AA,
- isInitializedVariable: () => O3,
- isInsideJsxElement: () => YF,
- isInsideJsxElementOrAttribute: () => dse,
- isInsideNodeModules: () => g8,
- isInsideTemplateLiteral: () => i8,
- isInstanceOfExpression: () => Y7,
- isInstantiatedModule: () => Zz,
- isInterfaceDeclaration: () => Xl,
- isInternalDeclaration: () => QY,
- isInternalModuleImportEqualsDeclaration: () => nS,
- isInternalName: () => ZJ,
- isIntersectionTypeNode: () => Ax,
- isIntrinsicJsxName: () => AC,
- isIterationStatement: () => Ny,
- isJSDoc: () => Id,
- isJSDocAllType: () => nte,
- isJSDocAugmentsTag: () => Mx,
- isJSDocAuthorTag: () => She,
- isJSDocCallbackTag: () => JJ,
- isJSDocClassTag: () => ste,
- isJSDocCommentContainingNode: () => QI,
- isJSDocConstructSignature: () => CC,
- isJSDocDeprecatedTag: () => qJ,
- isJSDocEnumTag: () => sA,
- isJSDocFunctionType: () => YC,
- isJSDocImplementsTag: () => iO,
- isJSDocImportTag: () => Cm,
- isJSDocIndexSignature: () => P7,
- isJSDocLikeText: () => oz,
- isJSDocLink: () => tte,
- isJSDocLinkCode: () => rte,
- isJSDocLinkLike: () => qT,
- isJSDocLinkPlain: () => vhe,
- isJSDocMemberName: () => dv,
- isJSDocNameReference: () => _D,
- isJSDocNamepathType: () => bhe,
- isJSDocNamespaceBody: () => mge,
- isJSDocNode: () => uC,
- isJSDocNonNullableType: () => eO,
- isJSDocNullableType: () => QC,
- isJSDocOptionalParameter: () => N5,
- isJSDocOptionalType: () => BJ,
- isJSDocOverloadTag: () => ZC,
- isJSDocOverrideTag: () => rO,
- isJSDocParameterTag: () => dp,
- isJSDocPrivateTag: () => WJ,
- isJSDocPropertyLikeTag: () => r4,
- isJSDocPropertyTag: () => ate,
- isJSDocProtectedTag: () => UJ,
- isJSDocPublicTag: () => zJ,
- isJSDocReadonlyTag: () => VJ,
- isJSDocReturnTag: () => nO,
- isJSDocSatisfiesExpression: () => mJ,
- isJSDocSatisfiesTag: () => sO,
- isJSDocSeeTag: () => The,
- isJSDocSignature: () => Lh,
- isJSDocTag: () => _C,
- isJSDocTemplateTag: () => qp,
- isJSDocThisTag: () => HJ,
- isJSDocThrowsTag: () => khe,
- isJSDocTypeAlias: () => Bp,
- isJSDocTypeAssertion: () => xS,
- isJSDocTypeExpression: () => pv,
- isJSDocTypeLiteral: () => bS,
- isJSDocTypeTag: () => fD,
- isJSDocTypedefTag: () => SS,
- isJSDocUnknownTag: () => xhe,
- isJSDocUnknownType: () => ite,
- isJSDocVariadicType: () => tO,
- isJSXTagName: () => SC,
- isJsonEqual: () => E5,
- isJsonSourceFile: () => Rp,
- isJsxAttribute: () => km,
- isJsxAttributeLike: () => $I,
- isJsxAttributeName: () => fee,
- isJsxAttributes: () => Wb,
- isJsxChild: () => Mw,
- isJsxClosingElement: () => Jb,
- isJsxClosingFragment: () => Kee,
- isJsxElement: () => Gg,
- isJsxExpression: () => lD,
- isJsxFragment: () => zb,
- isJsxNamespacedName: () => Nd,
- isJsxOpeningElement: () => xm,
- isJsxOpeningFragment: () => vS,
- isJsxOpeningLikeElement: () => ou,
- isJsxOpeningLikeElementTagName: () => ase,
- isJsxSelfClosingElement: () => yS,
- isJsxSpreadAttribute: () => Lx,
- isJsxTagNameExpression: () => c4,
- isJsxText: () => xx,
- isJumpStatementTarget: () => KA,
- isKeyword: () => p_,
- isKeywordOrPunctuation: () => F7,
- isKnownSymbol: () => b3,
- isLabelName: () => WU,
- isLabelOfLabeledStatement: () => zU,
- isLabeledStatement: () => Gy,
- isLateVisibilityPaintedStatement: () => u7,
- isLeftHandSideExpression: () => __,
- isLet: () => p7,
- isLineBreak: () => gu,
- isLiteralComputedPropertyDeclarationName: () => g3,
- isLiteralExpression: () => X2,
- isLiteralExpressionOfObject: () => vj,
- isLiteralImportTypeNode: () => h0,
- isLiteralKind: () => n4,
- isLiteralNameOfPropertyDeclarationOrIndexAccess: () => VF,
- isLiteralTypeLiteral: () => JY,
- isLiteralTypeNode: () => P0,
- isLocalName: () => Mh,
- isLogicalOperator: () => hK,
- isLogicalOrCoalescingAssignmentExpression: () => FB,
- isLogicalOrCoalescingAssignmentOperator: () => w4,
- isLogicalOrCoalescingBinaryExpression: () => P3,
- isLogicalOrCoalescingBinaryOperator: () => X7,
- isMappedTypeNode: () => mS,
- isMemberName: () => Fg,
- isMetaProperty: () => sD,
- isMethodDeclaration: () => hc,
- isMethodOrAccessor: () => UT,
- isMethodSignature: () => vm,
- isMinusToken: () => AJ,
- isMissingDeclaration: () => yhe,
- isMissingPackageJsonInfo: () => pre,
- isModifier: () => ra,
- isModifierKind: () => wy,
- isModifierLike: () => Bo,
- isModuleAugmentationExternal: () => Uj,
- isModuleBlock: () => Sm,
- isModuleBody: () => WY,
- isModuleDeclaration: () => zc,
- isModuleExportName: () => K5,
- isModuleExportsAccessExpression: () => jg,
- isModuleIdentifier: () => sB,
- isModuleName: () => xte,
- isModuleOrEnumDeclaration: () => Fw,
- isModuleReference: () => GY,
- isModuleSpecifierLike: () => s9,
- isModuleWithStringLiteralName: () => l7,
- isNameOfFunctionDeclaration: () => HU,
- isNameOfModuleDeclaration: () => qU,
- isNamedDeclaration: () => Vl,
- isNamedEvaluation: () => Q_,
- isNamedEvaluationSource: () => yB,
- isNamedExportBindings: () => hj,
- isNamedExports: () => pp,
- isNamedImportBindings: () => Pj,
- isNamedImports: () => Tm,
- isNamedImportsOrExports: () => i5,
- isNamedTupleMember: () => qC,
- isNamespaceBody: () => dge,
- isNamespaceExport: () => ug,
- isNamespaceExportDeclaration: () => iA,
- isNamespaceImport: () => Hg,
- isNamespaceReexportDeclaration: () => MZ,
- isNewExpression: () => jb,
- isNewExpressionTarget: () => UD,
- isNoSubstitutionTemplateLiteral: () => fS,
- isNodeArray: () => pb,
- isNodeArrayMultiLine: () => EK,
- isNodeDescendantOf: () => kb,
- isNodeKind: () => WI,
- isNodeLikeSystem: () => CR,
- isNodeModulesDirectory: () => PI,
- isNodeWithPossibleHoistedDeclaration: () => GZ,
- isNonContextualKeyword: () => gB,
- isNonGlobalAmbientModule: () => Wj,
- isNonNullAccess: () => _ee,
- isNonNullChain: () => zI,
- isNonNullExpression: () => Ox,
- isNonStaticMethodOrAccessorWithPrivateName: () => qre,
- isNotEmittedStatement: () => Zee,
- isNullishCoalesce: () => gj,
- isNumber: () => yy,
- isNumericLiteral: () => d_,
- isNumericLiteralName: () => qg,
- isObjectBindingElementWithoutPropertyName: () => c8,
- isObjectBindingOrAssignmentElement: () => Aw,
- isObjectBindingOrAssignmentPattern: () => xj,
- isObjectBindingPattern: () => Mf,
- isObjectLiteralElement: () => wj,
- isObjectLiteralElementLike: () => kh,
- isObjectLiteralExpression: () => Ks,
- isObjectLiteralMethod: () => jp,
- isObjectLiteralOrClassExpressionMethodOrAccessor: () => h7,
- isObjectTypeDeclaration: () => _x,
- isOmittedExpression: () => ml,
- isOptionalChain: () => hu,
- isOptionalChainRoot: () => KE,
- isOptionalDeclaration: () => WC,
- isOptionalJSDocPropertyLikeTag: () => V3,
- isOptionalTypeNode: () => G5,
- isOuterExpression: () => cO,
- isOutermostOptionalChain: () => e4,
- isOverrideModifier: () => Uee,
- isPackageJsonInfo: () => IO,
- isPackedArrayLiteral: () => pJ,
- isParameter: () => Ii,
- isParameterPropertyDeclaration: () => G_,
- isParameterPropertyModifier: () => s4,
- isParenthesizedExpression: () => Yu,
- isParenthesizedTypeNode: () => dS,
- isParseTreeNode: () => ZE,
- isPartOfParameterDeclaration: () => iv,
- isPartOfTypeNode: () => um,
- isPartOfTypeQuery: () => C7,
- isPartiallyEmittedExpression: () => LJ,
- isPatternMatch: () => mI,
- isPinnedComment: () => o7,
- isPlainJsFile: () => u4,
- isPlusToken: () => wJ,
- isPossiblyTypeArgumentPosition: () => n8,
- isPostfixUnaryExpression: () => FJ,
- isPrefixUnaryExpression: () => uv,
- isPrimitiveLiteralValue: () => F5,
- isPrivateIdentifier: () => Di,
- isPrivateIdentifierClassElementDeclaration: () => Ou,
- isPrivateIdentifierPropertyAccessExpression: () => cC,
- isPrivateIdentifierSymbol: () => ZZ,
- isProgramUptoDate: () => JW,
- isPrologueDirective: () => lm,
- isPropertyAccessChain: () => BI,
- isPropertyAccessEntityNameExpression: () => A3,
- isPropertyAccessExpression: () => Cn,
- isPropertyAccessOrQualifiedName: () => Iw,
- isPropertyAccessOrQualifiedNameOrImportTypeNode: () => jY,
- isPropertyAssignment: () => Qc,
- isPropertyDeclaration: () => cs,
- isPropertyName: () => Bc,
- isPropertyNameLiteral: () => fm,
- isPropertySignature: () => m_,
- isPrototypeAccess: () => Ry,
- isPrototypePropertyAssignment: () => c3,
- isPunctuation: () => mB,
- isPushOrUnshiftIdentifier: () => vB,
- isQualifiedName: () => Xu,
- isQuestionDotToken: () => q5,
- isQuestionOrExclamationToken: () => vte,
- isQuestionOrPlusOrMinusToken: () => Tte,
- isQuestionToken: () => Vy,
- isReadonlyKeyword: () => zee,
- isReadonlyKeywordOrPlusOrMinusToken: () => Ste,
- isRecognizedTripleSlashComment: () => Rj,
- isReferenceFileLocation: () => m6,
- isReferencedFile: () => Sv,
- isRegularExpressionLiteral: () => DJ,
- isRequireCall: () => f_,
- isRequireVariableStatement: () => r3,
- isRestParameter: () => rg,
- isRestTypeNode: () => $5,
- isReturnStatement: () => Up,
- isReturnStatementWithFixablePromiseHandler: () => E9,
- isRightSideOfAccessExpression: () => RB,
- isRightSideOfInstanceofExpression: () => vK,
- isRightSideOfPropertyAccess: () => b6,
- isRightSideOfQualifiedName: () => ose,
- isRightSideOfQualifiedNameOrPropertyAccess: () => A4,
- isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => yK,
- isRootedDiskPath: () => H_,
- isSameEntityName: () => TC,
- isSatisfiesExpression: () => Y5,
- isSemicolonClassElement: () => $ee,
- isSetAccessor: () => om,
- isSetAccessorDeclaration: () => K_,
- isShiftOperatorOrHigher: () => iz,
- isShorthandAmbientModuleSymbol: () => Jw,
- isShorthandPropertyAssignment: () => uu,
- isSideEffectImport: () => bJ,
- isSignedNumericLiteral: () => M7,
- isSimpleCopiableExpression: () => Hb,
- isSimpleInlineableExpression: () => fg,
- isSimpleParameterList: () => NA,
- isSingleOrDoubleQuote: () => n3,
- isSourceElement: () => dee,
- isSourceFile: () => Si,
- isSourceFileFromLibrary: () => w6,
- isSourceFileJS: () => Gu,
- isSourceFileNotJson: () => D7,
- isSourceMapping: () => Wre,
- isSpecialPropertyDeclaration: () => JZ,
- isSpreadAssignment: () => $g,
- isSpreadElement: () => fp,
- isStatement: () => bi,
- isStatementButNotDeclaration: () => Lw,
- isStatementOrBlock: () => HY,
- isStatementWithLocals: () => rZ,
- isStatic: () => zs,
- isStaticModifier: () => Ex,
- isString: () => _s,
- isStringANonContextualKeyword: () => ix,
- isStringAndEmptyAnonymousObjectIntersection: () => vse,
- isStringDoubleQuoted: () => w7,
- isStringLiteral: () => oa,
- isStringLiteralLike: () => Xa,
- isStringLiteralOrJsxExpression: () => $Y,
- isStringLiteralOrTemplate: () => Bse,
- isStringOrNumericLiteralLike: () => Of,
- isStringOrRegularExpressionOrTemplateLiteral: () => tV,
- isStringTextContainingNode: () => bj,
- isSuperCall: () => rS,
- isSuperKeyword: () => rD,
- isSuperProperty: () => C_,
- isSupportedSourceFileName: () => ZK,
- isSwitchStatement: () => oD,
- isSyntaxList: () => KC,
- isSyntheticExpression: () => _he,
- isSyntheticReference: () => Fx,
- isTagName: () => UU,
- isTaggedTemplateExpression: () => lv,
- isTaggedTemplateTag: () => ise,
- isTemplateExpression: () => X5,
- isTemplateHead: () => kx,
- isTemplateLiteral: () => VT,
- isTemplateLiteralKind: () => Dy,
- isTemplateLiteralToken: () => IY,
- isTemplateLiteralTypeNode: () => Hee,
- isTemplateLiteralTypeSpan: () => IJ,
- isTemplateMiddle: () => PJ,
- isTemplateMiddleOrTemplateTail: () => UI,
- isTemplateSpan: () => $C,
- isTemplateTail: () => U5,
- isTextWhiteSpaceLike: () => Cse,
- isThis: () => S6,
- isThisContainerOrFunctionBlock: () => OZ,
- isThisIdentifier: () => Ly,
- isThisInTypeQuery: () => Pb,
- isThisInitializedDeclaration: () => T7,
- isThisInitializedObjectBindingExpression: () => LZ,
- isThisProperty: () => Qw,
- isThisTypeNode: () => HC,
- isThisTypeParameter: () => $4,
- isThisTypePredicate: () => wZ,
- isThrowStatement: () => jJ,
- isToken: () => zT,
- isTokenKind: () => yj,
- isTraceEnabled: () => Xy,
- isTransientSymbol: () => Lg,
- isTrivia: () => PC,
- isTryStatement: () => gS,
- isTupleTypeNode: () => wx,
- isTypeAlias: () => _3,
- isTypeAliasDeclaration: () => Vp,
- isTypeAssertionExpression: () => OJ,
- isTypeDeclaration: () => hx,
- isTypeElement: () => db,
- isTypeKeyword: () => GD,
- isTypeKeywordTokenOrIdentifier: () => r9,
- isTypeLiteralNode: () => Qu,
- isTypeNode: () => fi,
- isTypeNodeKind: () => HB,
- isTypeOfExpression: () => GC,
- isTypeOnlyExportDeclaration: () => OY,
- isTypeOnlyImportDeclaration: () => i4,
- isTypeOnlyImportOrExportDeclaration: () => Py,
- isTypeOperatorNode: () => cv,
- isTypeParameterDeclaration: () => zo,
- isTypePredicateNode: () => Px,
- isTypeQueryNode: () => Lb,
- isTypeReferenceNode: () => vf,
- isTypeReferenceType: () => ZI,
- isTypeUsableAsPropertyName: () => up,
- isUMDExportSymbol: () => n5,
- isUnaryExpression: () => Ej,
- isUnaryExpressionWithWrite: () => BY,
- isUnicodeIdentifierStart: () => AI,
- isUnionTypeNode: () => qy,
- isUrl: () => $Q,
- isValidBigIntString: () => D5,
- isValidESSymbolDeclaration: () => EZ,
- isValidTypeOnlyAliasUseSite: () => av,
- isValueSignatureDeclaration: () => nx,
- isVarAwaitUsing: () => qw,
- isVarConst: () => hC,
- isVarConstLike: () => SZ,
- isVarUsing: () => Hw,
- isVariableDeclaration: () => ii,
- isVariableDeclarationInVariableStatement: () => p4,
- isVariableDeclarationInitializedToBareOrAccessedRequire: () => Sb,
- isVariableDeclarationInitializedToRequire: () => t3,
- isVariableDeclarationList: () => Fl,
- isVariableLike: () => YT,
- isVariableLikeOrAccessor: () => kZ,
- isVariableStatement: () => yc,
- isVoidExpression: () => Nx,
- isWatchSet: () => UB,
- isWhileStatement: () => RJ,
- isWhiteSpaceLike: () => Ng,
- isWhiteSpaceSingleLine: () => sm,
- isWithStatement: () => Xee,
- isWriteAccess: () => ux,
- isWriteOnlyAccess: () => r5,
- isYieldExpression: () => Q5,
- jsxModeNeedsExplicitImport: () => jV,
- keywordPart: () => sf,
- last: () => _a,
- lastOrUndefined: () => Ro,
- length: () => Nr,
- libMap: () => pz,
- libs: () => mO,
- lineBreakPart: () => E6,
- loadModuleFromGlobalCache: () => Cre,
- loadWithModeAwareCache: () => JA,
- makeIdentifierFromModuleName: () => lZ,
- makeImport: () => t1,
- makeStringLiteral: () => $D,
- mangleScopedPackageName: () => l6,
- map: () => lr,
- mapAllOrFail: () => sR,
- mapDefined: () => Ai,
- mapDefinedIterator: () => dy,
- mapEntries: () => dX,
- mapIterator: () => wE,
- mapOneOrMany: () => FV,
- mapToDisplayParts: () => xv,
- matchFiles: () => nJ,
- matchPatternOrExact: () => oJ,
- matchedText: () => PX,
- matchesExclude: () => PO,
- maxBy: () => hR,
- maybeBind: () => Ms,
- maybeSetLocalizedDiagnosticMessages: () => LK,
- memoize: () => Iu,
- memoizeOne: () => im,
- min: () => yR,
- minAndMax: () => tee,
- missingFileModifiedTime: () => q_,
- modifierToFlag: () => cx,
- modifiersToFlags: () => mm,
- moduleExportNameIsDefault: () => ng,
- moduleExportNameTextEscaped: () => hb,
- moduleExportNameTextUnescaped: () => Fy,
- moduleOptionDeclaration: () => Lte,
- moduleResolutionIsEqualTo: () => eZ,
- moduleResolutionNameAndModeGetter: () => cF,
- moduleResolutionOptionDeclarations: () => mz,
- moduleResolutionSupportsPackageJsonExportsAndImports: () => RC,
- moduleResolutionUsesNodeModules: () => n9,
- moduleSpecifierToValidIdentifier: () => y8,
- moduleSpecifiers: () => N0,
- moduleSymbolToValidIdentifier: () => h8,
- moveEmitHelpers: () => Pee,
- moveRangeEnd: () => e5,
- moveRangePastDecorators: () => wh,
- moveRangePastModifiers: () => gm,
- moveRangePos: () => sv,
- moveSyntheticComments: () => Cee,
- mutateMap: () => M4,
- mutateMapSkippingNewValues: () => Jg,
- needsParentheses: () => l9,
- needsScopeMarker: () => HI,
- newCaseClauseTracker: () => S9,
- newPrivateEnvironment: () => Gre,
- noEmitNotification: () => FA,
- noEmitSubstitution: () => OD,
- noTransformers: () => Cne,
- noTruncationMaximumTruncationLength: () => Ij,
- nodeCanBeDecorated: () => Zw,
- nodeHasName: () => xw,
- nodeIsDecorated: () => bC,
- nodeIsMissing: () => rc,
- nodeIsPresent: () => Mp,
- nodeIsSynthesized: () => fo,
- nodeModuleNameResolver: () => yre,
- nodeModulesPathPart: () => Xg,
- nodeNextJsonConfigResolver: () => vre,
- nodeOrChildIsDecorated: () => Kw,
- nodeOverlapsWithStartEnd: () => qF,
- nodePosToString: () => yge,
- nodeSeenTracker: () => x6,
- nodeStartsNewLexicalEnvironment: () => bB,
- noop: () => ja,
- noopFileWatcher: () => JD,
- normalizePath: () => Os,
- normalizeSlashes: () => Wl,
- normalizeSpans: () => oj,
- not: () => hI,
- notImplemented: () => Vs,
- notImplementedResolver: () => Ane,
- nullNodeConverters: () => Tee,
- nullParenthesizerRules: () => bee,
- nullTransformationContext: () => MA,
- objectAllocator: () => Gl,
- operatorPart: () => QD,
- optionDeclarations: () => Od,
- optionMapToObject: () => TO,
- optionsAffectingProgramStructure: () => Jte,
- optionsForBuild: () => hz,
- optionsForWatch: () => zx,
- optionsHaveChanges: () => pC,
- or: () => Nf,
- orderedRemoveItem: () => OE,
- orderedRemoveItemAt: () => Ty,
- packageIdToPackageName: () => i7,
- packageIdToString: () => Q1,
- parameterIsThisKeyword: () => Db,
- parameterNamePart: () => Dse,
- parseBaseNodeFactory: () => wte,
- parseBigInt: () => nee,
- parseBuildCommand: () => $te,
- parseCommandLine: () => Hte,
- parseCommandLineWorker: () => vz,
- parseConfigFileTextToJson: () => Sz,
- parseConfigFileWithSystem: () => pie,
- parseConfigHostFromCompilerHostLike: () => mF,
- parseCustomTypeOption: () => vO,
- parseIsolatedEntityName: () => Jx,
- parseIsolatedJSDocComment: () => Nte,
- parseJSDocTypeExpressionForTests: () => $he,
- parseJsonConfigFileContent: () => x0e,
- parseJsonSourceFileConfigFileContent: () => SA,
- parseJsonText: () => mA,
- parseListTypeOption: () => Vte,
- parseNodeFactory: () => gv,
- parseNodeModuleFromPath: () => kA,
- parsePackageName: () => MO,
- parsePseudoBigInt: () => V4,
- parseValidBigInt: () => _J,
- pasteEdits: () => FH,
- patchWriteFileEnsuringDirectory: () => GQ,
- pathContainsNodeModules: () => Yy,
- pathIsAbsolute: () => UE,
- pathIsBareSpecifier: () => YR,
- pathIsRelative: () => If,
- patternText: () => DX,
- performIncrementalCompilation: () => die,
- performance: () => MX,
- positionBelongsToNode: () => $U,
- positionIsASICandidate: () => f9,
- positionIsSynthesized: () => Pd,
- positionsAreOnSameLine: () => cp,
- preProcessFile: () => Mbe,
- probablyUsesSemicolons: () => d8,
- processCommentPragmas: () => _z,
- processPragmasIntoFields: () => fz,
- processTaggedTemplateExpression: () => fW,
- programContainsEsModules: () => xse,
- programContainsModules: () => Tse,
- projectReferenceIsEqualTo: () => Oj,
- propertyNamePart: () => Pse,
- pseudoBigIntToString: () => Ib,
- punctuationPart: () => Tu,
- pushIfUnique: () => tp,
- quote: () => KD,
- quotePreferenceFromString: () => _V,
- rangeContainsPosition: () => VD,
- rangeContainsPositionExclusive: () => e8,
- rangeContainsRange: () => nf,
- rangeContainsRangeExclusive: () => lse,
- rangeContainsStartEnd: () => t8,
- rangeEndIsOnSameLineAsRangeStart: () => I3,
- rangeEndPositionsAreOnSameLine: () => kK,
- rangeEquals: () => uR,
- rangeIsOnSingleLine: () => lS,
- rangeOfNode: () => lJ,
- rangeOfTypeParameters: () => uJ,
- rangeOverlapsWithStartEnd: () => qD,
- rangeStartIsOnSameLineAsRangeEnd: () => CK,
- rangeStartPositionsAreOnSameLine: () => t5,
- readBuilderProgram: () => DF,
- readConfigFile: () => vA,
- readJson: () => I4,
- readJsonConfigFile: () => Xte,
- readJsonOrUndefined: () => BB,
- reduceEachLeadingCommentRange: () => rY,
- reduceEachTrailingCommentRange: () => nY,
- reduceLeft: () => Hu,
- reduceLeftIterator: () => uX,
- reducePathComponents: () => V2,
- refactor: () => rk,
- regExpEscape: () => Gge,
- regularExpressionFlagToCharacterCode: () => Hme,
- relativeComplement: () => mX,
- removeAllComments: () => X3,
- removeEmitHelper: () => ohe,
- removeExtension: () => W3,
- removeFileExtension: () => $u,
- removeIgnoredPath: () => vF,
- removeMinAndVersionNumbers: () => SR,
- removePrefix: () => FE,
- removeSuffix: () => eC,
- removeTrailingDirectorySeparator: () => W1,
- repeatString: () => a8,
- replaceElement: () => pR,
- replaceFirstStar: () => uS,
- resolutionExtensionIsTSOrJson: () => J4,
- resolveConfigFileProjectName: () => hU,
- resolveJSModule: () => mre,
- resolveLibrary: () => FO,
- resolveModuleName: () => Vx,
- resolveModuleNameFromCache: () => K0e,
- resolvePackageNameToPackageJson: () => Iz,
- resolvePath: () => z1,
- resolveProjectReferencePath: () => g6,
- resolveTripleslashReference: () => wW,
- resolveTypeReferenceDirective: () => _re,
- resolvingEmptyArray: () => Nj,
- returnFalse: () => nm,
- returnNoopFileWatcher: () => zD,
- returnTrue: () => B1,
- returnUndefined: () => lb,
- returnsPromise: () => ZV,
- sameFlatMap: () => fX,
- sameMap: () => qc,
- sameMapping: () => Uye,
- scanTokenAtPosition: () => bZ,
- scanner: () => ju,
- semanticDiagnosticsOptionDeclarations: () => Rte,
- serializeCompilerOptions: () => xO,
- server: () => IPe,
- servicesVersion: () => ESe,
- setCommentRange: () => nl,
- setConfigFileInOptions: () => Dz,
- setConstantValue: () => Dee,
- setEmitFlags: () => an,
- setGetSourceFileAsHashVersioned: () => EF,
- setIdentifierAutoGenerate: () => Z3,
- setIdentifierGeneratedImportReference: () => Nee,
- setIdentifierTypeArguments: () => D0,
- setInternalEmitFlags: () => Q3,
- setLocalizedDiagnosticMessages: () => FK,
- setNodeChildren: () => ote,
- setNodeFlags: () => aee,
- setObjectAllocator: () => OK,
- setOriginalNode: () => kn,
- setParent: () => Aa,
- setParentRecursive: () => Nh,
- setPrivateIdentifier: () => ES,
- setSnippetElement: () => CJ,
- setSourceMapRange: () => da,
- setStackTraceLimit: () => Ame,
- setStartsOnNewLine: () => R5,
- setSyntheticLeadingComments: () => ov,
- setSyntheticTrailingComments: () => Sx,
- setSys: () => Mme,
- setSysLog: () => VQ,
- setTextRange: () => lt,
- setTextRangeEnd: () => zC,
- setTextRangePos: () => q4,
- setTextRangePosEnd: () => wd,
- setTextRangePosWidth: () => fJ,
- setTokenSourceMapRange: () => kee,
- setTypeNode: () => wee,
- setUILocale: () => kX,
- setValueDeclaration: () => l3,
- shouldAllowImportingTsExtension: () => u6,
- shouldPreserveConstEnums: () => jy,
- shouldUseUriStyleNodeCoreModules: () => v9,
- showModuleSpecifier: () => AK,
- signatureHasRestParameter: () => Su,
- signatureToDisplayParts: () => TV,
- single: () => fR,
- singleElementArray: () => MT,
- singleIterator: () => pX,
- singleOrMany: () => Ym,
- singleOrUndefined: () => Qm,
- skipAlias: () => Hl,
- skipConstraint: () => cV,
- skipOuterExpressions: () => Dc,
- skipParentheses: () => Ba,
- skipPartiallyEmittedExpressions: () => ud,
- skipTrivia: () => aa,
- skipTypeChecking: () => JC,
- skipTypeCheckingIgnoringNoCheck: () => ree,
- skipTypeParentheses: () => b4,
- skipWhile: () => AX,
- sliceAfter: () => cJ,
- some: () => ut,
- sortAndDeduplicate: () => IE,
- sortAndDeduplicateDiagnostics: () => sC,
- sourceFileAffectingCompilerOptions: () => gz,
- sourceFileMayBeEmitted: () => cS,
- sourceMapCommentRegExp: () => eW,
- sourceMapCommentRegExpDontCareLineStart: () => Bre,
- spacePart: () => uc,
- spanMap: () => aR,
- startEndContainsRange: () => GU,
- startEndOverlapsWithStartEnd: () => HF,
- startOnNewLine: () => bu,
- startTracing: () => JX,
- startsWith: () => Ui,
- startsWithDirectory: () => ej,
- startsWithUnderscore: () => RV,
- startsWithUseStrict: () => dte,
- stringContainsAt: () => Hse,
- stringToToken: () => H2,
- stripQuotes: () => ap,
- supportedDeclarationExtensions: () => T5,
- supportedJSExtensionsFlat: () => jC,
- supportedLocaleDirectories: () => hY,
- supportedTSExtensionsFlat: () => iJ,
- supportedTSImplementationExtensions: () => B3,
- suppressLeadingAndTrailingTrivia: () => af,
- suppressLeadingTrivia: () => EV,
- suppressTrailingTrivia: () => Mse,
- symbolEscapedNameNoDefault: () => i9,
- symbolName: () => mc,
- symbolNameNoDefault: () => pV,
- symbolToDisplayParts: () => YD,
- sys: () => ll,
- sysLog: () => uw,
- tagNamesAreEquivalent: () => yv,
- takeWhile: () => kR,
- targetOptionDeclaration: () => dz,
- testFormatSettings: () => nbe,
- textChangeRangeIsUnchanged: () => fY,
- textChangeRangeNewSpan: () => YE,
- textChanges: () => sn,
- textOrKeywordPart: () => SV,
- textPart: () => Jf,
- textRangeContainsPositionInclusive: () => vw,
- textRangeContainsTextSpan: () => aY,
- textRangeIntersectsWithTextSpan: () => uY,
- textSpanContainsPosition: () => sj,
- textSpanContainsTextRange: () => aj,
- textSpanContainsTextSpan: () => sY,
- textSpanEnd: () => ec,
- textSpanIntersection: () => _Y,
- textSpanIntersectsWith: () => bw,
- textSpanIntersectsWithPosition: () => lY,
- textSpanIntersectsWithTextSpan: () => cY,
- textSpanIsEmpty: () => iY,
- textSpanOverlap: () => oY,
- textSpanOverlapsWith: () => ege,
- textSpansEqual: () => C6,
- textToKeywordObj: () => wI,
- timestamp: () => lo,
- toArray: () => FT,
- toBuilderFileEmit: () => rie,
- toBuilderStateFileInfoForMultiEmit: () => tie,
- toEditorSettings: () => D8,
- toFileNameLowerCase: () => vy,
- toPath: () => uo,
- toProgramEmitPending: () => nie,
- toSorted: () => V_,
- tokenIsIdentifierOrKeyword: () => c_,
- tokenIsIdentifierOrKeywordOrGreaterThan: () => QQ,
- tokenToString: () => qs,
- trace: () => Zi,
- tracing: () => rn,
- tracingEnabled: () => cw,
- transferSourceFileChildren: () => cte,
- transform: () => MSe,
- transformClassFields: () => nne,
- transformDeclarations: () => gW,
- transformECMAScriptModule: () => mW,
- transformES2015: () => hne,
- transformES2016: () => gne,
- transformES2017: () => one,
- transformES2018: () => cne,
- transformES2019: () => lne,
- transformES2020: () => une,
- transformES2021: () => _ne,
- transformESDecorators: () => ane,
- transformESNext: () => fne,
- transformGenerators: () => yne,
- transformImpliedNodeFormatDependentModule: () => bne,
- transformJsx: () => mne,
- transformLegacyDecorators: () => sne,
- transformModule: () => dW,
- transformNamedEvaluation: () => tf,
- transformNodes: () => LA,
- transformSystemModule: () => vne,
- transformTypeScript: () => rne,
- transpile: () => qbe,
- transpileDeclaration: () => Ube,
- transpileModule: () => dae,
- transpileOptionValueCompilerOptions: () => zte,
- tryAddToSet: () => Xm,
- tryAndIgnoreErrors: () => m9,
- tryCast: () => Wn,
- tryDirectoryExists: () => d9,
- tryExtractTSExtension: () => Z7,
- tryFileExists: () => m8,
- tryGetClassExtendingExpressionWithTypeArguments: () => LB,
- tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => MB,
- tryGetDirectories: () => p9,
- tryGetExtensionFromPath: () => Vg,
- tryGetImportFromModuleSpecifier: () => u3,
- tryGetJSDocSatisfiesTypeNode: () => I5,
- tryGetModuleNameFromFile: () => lA,
- tryGetModuleSpecifierFromDeclaration: () => xC,
- tryGetNativePerformanceHooks: () => LX,
- tryGetPropertyAccessOrIdentifierToString: () => N3,
- tryGetPropertyNameOfBindingOrAssignmentElement: () => _O,
- tryGetSourceMappingURL: () => Jre,
- tryGetTextOfPropertyName: () => f4,
- tryParseJson: () => K7,
- tryParsePattern: () => BC,
- tryParsePatterns: () => k5,
- tryParseRawSourceMap: () => zre,
- tryReadDirectory: () => AV,
- tryReadFile: () => yD,
- tryRemoveDirectoryPrefix: () => tJ,
- tryRemoveExtension: () => eee,
- tryRemovePrefix: () => xR,
- tryRemoveSuffix: () => EX,
- typeAcquisitionDeclarations: () => hO,
- typeAliasNamePart: () => wse,
- typeDirectiveIsEqualTo: () => tZ,
- typeKeywords: () => oV,
- typeParameterNamePart: () => Ase,
- typeToDisplayParts: () => u8,
- unchangedPollThresholds: () => xI,
- unchangedTextChangeRange: () => OI,
- unescapeLeadingUnderscores: () => Ei,
- unmangleScopedPackageName: () => EA,
- unorderedRemoveItem: () => LT,
- unreachableCodeIsError: () => BK,
- unsetNodeChildren: () => $J,
- unusedLabelIsError: () => JK,
- unwrapInnermostStatementOfLabel: () => eB,
- unwrapParenthesizedExpression: () => gee,
- updateErrorForNoInputFiles: () => DO,
- updateLanguageServiceSourceFile: () => kq,
- updateMissingFilePathsWatch: () => EW,
- updateResolutionField: () => s6,
- updateSharedExtendedConfigFileWatcher: () => iF,
- updateSourceFile: () => cz,
- updateWatchingWildcardDirectories: () => RA,
- usingSingleLineStringWriter: () => dC,
- utf16EncodeAsString: () => QE,
- validateLocaleAndSetLanguage: () => lj,
- version: () => U_,
- versionMajorMinor: () => wf,
- visitArray: () => wA,
- visitCommaListElements: () => VO,
- visitEachChild: () => br,
- visitFunctionBody: () => Bf,
- visitIterationBody: () => Ku,
- visitLexicalEnvironment: () => Kz,
- visitNode: () => Ge,
- visitNodes: () => Fr,
- visitParameterList: () => cc,
- walkUpBindingElementsAndPatterns: () => JT,
- walkUpOuterExpressions: () => mte,
- walkUpParenthesizedExpressions: () => ag,
- walkUpParenthesizedTypes: () => m3,
- walkUpParenthesizedTypesAndGetParentAndChild: () => $Z,
- whitespaceOrMapCommentRegExp: () => tW,
- writeCommentRange: () => OC,
- writeFile: () => H7,
- writeFileEnsuringDirectories: () => wB,
- zipWith: () => tR
- }), $a.exports = Pf(KP);
- var wf = "5.6", U_ = "5.6.3", cX = /* @__PURE__ */ ((e) => (e[e.LessThan = -1] = "LessThan", e[e.EqualTo = 0] = "EqualTo", e[e.GreaterThan = 1] = "GreaterThan", e))(cX || {}), Ue = [], eR = /* @__PURE__ */ new Map();
- function Nr(e) {
- return e !== void 0 ? e.length : 0;
- }
- function ir(e, t) {
- if (e !== void 0)
- for (let n = 0; n < e.length; n++) {
- const i = t(e[n], n);
- if (i)
- return i;
- }
- }
- function lX(e, t) {
- if (e !== void 0)
- for (let n = e.length - 1; n >= 0; n--) {
- const i = t(e[n], n);
- if (i)
- return i;
- }
- }
- function Tc(e, t) {
- if (e !== void 0)
- for (let n = 0; n < e.length; n++) {
- const i = t(e[n], n);
- if (i !== void 0)
- return i;
- }
- }
- function ew(e, t) {
- for (const n of e) {
- const i = t(n);
- if (i !== void 0)
- return i;
- }
- }
- function uX(e, t, n) {
- let i = n;
- if (e) {
- let s = 0;
- for (const o of e)
- i = t(i, o, s), s++;
- }
- return i;
- }
- function tR(e, t, n) {
- const i = [];
- E.assertEqual(e.length, t.length);
- for (let s = 0; s < e.length; s++)
- i.push(n(e[s], t[s], s));
- return i;
- }
- function rR(e, t) {
- if (e.length <= 1)
- return e;
- const n = [];
- for (let i = 0, s = e.length; i < s; i++)
- i !== 0 && n.push(t), n.push(e[i]);
- return n;
- }
- function Mi(e, t) {
- if (e !== void 0) {
- for (let n = 0; n < e.length; n++)
- if (!t(e[n], n))
- return !1;
- }
- return !0;
- }
- function On(e, t, n) {
- if (e !== void 0)
- for (let i = n ?? 0; i < e.length; i++) {
- const s = e[i];
- if (t(s, i))
- return s;
- }
- }
- function ob(e, t, n) {
- if (e !== void 0)
- for (let i = n ?? e.length - 1; i >= 0; i--) {
- const s = e[i];
- if (t(s, i))
- return s;
- }
- }
- function ac(e, t, n) {
- if (e === void 0) return -1;
- for (let i = n ?? 0; i < e.length; i++)
- if (t(e[i], i))
- return i;
- return -1;
- }
- function uI(e, t, n) {
- if (e === void 0) return -1;
- for (let i = n ?? e.length - 1; i >= 0; i--)
- if (t(e[i], i))
- return i;
- return -1;
- }
- function ss(e, t, n = by) {
- if (e !== void 0) {
- for (let i = 0; i < e.length; i++)
- if (n(e[i], t))
- return !0;
- }
- return !1;
- }
- function _X(e, t, n) {
- for (let i = n ?? 0; i < e.length; i++)
- if (ss(t, e.charCodeAt(i)))
- return i;
- return -1;
- }
- function py(e, t) {
- let n = 0;
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = e[i];
- t(s, i) && n++;
- }
- return n;
- }
- function Ln(e, t) {
- if (e !== void 0) {
- const n = e.length;
- let i = 0;
- for (; i < n && t(e[i]); ) i++;
- if (i < n) {
- const s = e.slice(0, i);
- for (i++; i < n; ) {
- const o = e[i];
- t(o) && s.push(o), i++;
- }
- return s;
- }
- }
- return e;
- }
- function nR(e, t) {
- let n = 0;
- for (let i = 0; i < e.length; i++)
- t(e[i], i, e) && (e[n] = e[i], n++);
- e.length = n;
- }
- function Ap(e) {
- e.length = 0;
- }
- function lr(e, t) {
- let n;
- if (e !== void 0) {
- n = [];
- for (let i = 0; i < e.length; i++)
- n.push(t(e[i], i));
- }
- return n;
- }
- function* wE(e, t) {
- for (const n of e)
- yield t(n);
- }
- function qc(e, t) {
- if (e !== void 0)
- for (let n = 0; n < e.length; n++) {
- const i = e[n], s = t(i, n);
- if (i !== s) {
- const o = e.slice(0, n);
- for (o.push(s), n++; n < e.length; n++)
- o.push(t(e[n], n));
- return o;
- }
- }
- return e;
- }
- function Np(e) {
- const t = [];
- for (let n = 0; n < e.length; n++) {
- const i = e[n];
- i && (us(i) ? Fn(t, i) : t.push(i));
- }
- return t;
- }
- function ta(e, t) {
- let n;
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = t(e[i], i);
- s && (us(s) ? n = Fn(n, s) : n = wr(n, s));
- }
- return n ?? Ue;
- }
- function AE(e, t) {
- const n = [];
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = t(e[i], i);
- s && (us(s) ? Fn(n, s) : n.push(s));
- }
- return n;
- }
- function* iR(e, t) {
- for (const n of e) {
- const i = t(n);
- i && (yield* i);
- }
- }
- function fX(e, t) {
- let n;
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = e[i], o = t(s, i);
- (n || s !== o || us(o)) && (n || (n = e.slice(0, i)), us(o) ? Fn(n, o) : n.push(o));
- }
- return n ?? e;
- }
- function sR(e, t) {
- const n = [];
- for (let i = 0; i < e.length; i++) {
- const s = t(e[i], i);
- if (s === void 0)
- return;
- n.push(s);
- }
- return n;
- }
- function Ai(e, t) {
- const n = [];
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = t(e[i], i);
- s !== void 0 && n.push(s);
- }
- return n;
- }
- function* dy(e, t) {
- for (const n of e) {
- const i = t(n);
- i !== void 0 && (yield i);
- }
- }
- function NE(e, t, n) {
- if (e.has(t))
- return e.get(t);
- const i = n();
- return e.set(t, i), i;
- }
- function Xm(e, t) {
- return e.has(t) ? !1 : (e.add(t), !0);
- }
- function* pX(e) {
- yield e;
- }
- function aR(e, t, n) {
- let i;
- if (e !== void 0) {
- i = [];
- const s = e.length;
- let o, c, _ = 0, u = 0;
- for (; _ < s; ) {
- for (; u < s; ) {
- const d = e[u];
- if (c = t(d, u), u === 0)
- o = c;
- else if (c !== o)
- break;
- u++;
- }
- if (_ < u) {
- const d = n(e.slice(_, u), o, _, u);
- d && i.push(d), _ = u;
- }
- o = c, u++;
- }
- }
- return i;
- }
- function dX(e, t) {
- if (e === void 0)
- return;
- const n = /* @__PURE__ */ new Map();
- return e.forEach((i, s) => {
- const [o, c] = t(s, i);
- n.set(o, c);
- }), n;
- }
- function ut(e, t) {
- if (e !== void 0)
- if (t !== void 0) {
- for (let n = 0; n < e.length; n++)
- if (t(e[n]))
- return !0;
- } else
- return e.length > 0;
- return !1;
- }
- function oR(e, t, n) {
- let i;
- for (let s = 0; s < e.length; s++)
- t(e[s]) ? i = i === void 0 ? s : i : i !== void 0 && (n(i, s), i = void 0);
- i !== void 0 && n(i, e.length);
- }
- function Qi(e, t) {
- return t === void 0 || t.length === 0 ? e : e === void 0 || e.length === 0 ? t : [...e, ...t];
- }
- function O7e(e, t) {
- return t;
- }
- function _I(e) {
- return e.map(O7e);
- }
- function F7e(e, t, n) {
- const i = _I(e);
- R7e(e, i, n);
- let s = e[i[0]];
- const o = [i[0]];
- for (let c = 1; c < i.length; c++) {
- const _ = i[c], u = e[_];
- t(s, u) || (o.push(_), s = u);
- }
- return o.sort(), o.map((c) => e[c]);
- }
- function L7e(e, t) {
- const n = [];
- for (let i = 0; i < e.length; i++)
- tp(n, e[i], t);
- return n;
- }
- function cb(e, t, n) {
- return e.length === 0 ? [] : e.length === 1 ? e.slice() : n ? F7e(e, t, n) : L7e(e, t);
- }
- function M7e(e, t) {
- if (e.length === 0) return Ue;
- let n = e[0];
- const i = [n];
- for (let s = 1; s < e.length; s++) {
- const o = e[s];
- switch (t(o, n)) {
- case !0:
- case 0:
- continue;
- case -1:
- return E.fail("Array is unsorted.");
- }
- i.push(n = o);
- }
- return i;
- }
- function cR() {
- return [];
- }
- function my(e, t, n, i, s) {
- if (e.length === 0)
- return e.push(t), !0;
- const o = hy(e, t, go, n);
- if (o < 0) {
- if (i && !s) {
- const c = ~o;
- if (c > 0 && i(t, e[c - 1]))
- return !1;
- if (c < e.length && i(t, e[c]))
- return e.splice(c, 1, t), !0;
- }
- return e.splice(~o, 0, t), !0;
- }
- return s ? (e.splice(o, 0, t), !0) : !1;
- }
- function IE(e, t, n) {
- return M7e(V_(e, t), n ?? t ?? au);
- }
- function Af(e, t, n = by) {
- if (e === void 0 || t === void 0)
- return e === t;
- if (e.length !== t.length)
- return !1;
- for (let i = 0; i < e.length; i++)
- if (!n(e[i], t[i], i))
- return !1;
- return !0;
- }
- function tw(e) {
- let t;
- if (e !== void 0)
- for (let n = 0; n < e.length; n++) {
- const i = e[n];
- (t ?? !i) && (t ?? (t = e.slice(0, n)), i && t.push(i));
- }
- return t ?? e;
- }
- function mX(e, t, n) {
- if (!t || !e || t.length === 0 || e.length === 0) return t;
- const i = [];
- e:
- for (let s = 0, o = 0; o < t.length; o++) {
- o > 0 && E.assertGreaterThanOrEqual(
- n(t[o], t[o - 1]),
- 0
- /* EqualTo */
- );
- t:
- for (const c = s; s < e.length; s++)
- switch (s > c && E.assertGreaterThanOrEqual(
- n(e[s], e[s - 1]),
- 0
- /* EqualTo */
- ), n(t[o], e[s])) {
- case -1:
- i.push(t[o]);
- continue e;
- case 0:
- continue e;
- case 1:
- continue t;
- }
- }
- return i;
- }
- function wr(e, t) {
- return t === void 0 ? e : e === void 0 ? [t] : (e.push(t), e);
- }
- function NT(e, t) {
- return e === void 0 ? t : t === void 0 ? e : us(e) ? us(t) ? Qi(e, t) : wr(e, t) : us(t) ? wr(t, e) : [e, t];
- }
- function gX(e, t) {
- return t < 0 ? e.length + t : t;
- }
- function Fn(e, t, n, i) {
- if (t === void 0 || t.length === 0) return e;
- if (e === void 0) return t.slice(n, i);
- n = n === void 0 ? 0 : gX(t, n), i = i === void 0 ? t.length : gX(t, i);
- for (let s = n; s < i && s < t.length; s++)
- t[s] !== void 0 && e.push(t[s]);
- return e;
- }
- function tp(e, t, n) {
- return ss(e, t, n) ? !1 : (e.push(t), !0);
- }
- function bh(e, t, n) {
- return e !== void 0 ? (tp(e, t, n), e) : [t];
- }
- function R7e(e, t, n) {
- t.sort((i, s) => n(e[i], e[s]) || ho(i, s));
- }
- function V_(e, t) {
- return e.length === 0 ? Ue : e.slice().sort(t);
- }
- function* lR(e) {
- for (let t = e.length - 1; t >= 0; t--)
- yield e[t];
- }
- function uR(e, t, n, i) {
- for (; n < i; ) {
- if (e[n] !== t[n])
- return !1;
- n++;
- }
- return !0;
- }
- var gy = Array.prototype.at ? (e, t) => e?.at(t) : (e, t) => {
- if (e !== void 0 && (t = gX(e, t), t < e.length))
- return e[t];
- };
- function el(e) {
- return e === void 0 || e.length === 0 ? void 0 : e[0];
- }
- function rw(e) {
- if (e !== void 0)
- for (const t of e)
- return t;
- }
- function xa(e) {
- return E.assert(e.length !== 0), e[0];
- }
- function _R(e) {
- for (const t of e)
- return t;
- E.fail("iterator is empty");
- }
- function Ro(e) {
- return e === void 0 || e.length === 0 ? void 0 : e[e.length - 1];
- }
- function _a(e) {
- return E.assert(e.length !== 0), e[e.length - 1];
- }
- function Qm(e) {
- return e !== void 0 && e.length === 1 ? e[0] : void 0;
- }
- function fR(e) {
- return E.checkDefined(Qm(e));
- }
- function Ym(e) {
- return e !== void 0 && e.length === 1 ? e[0] : e;
- }
- function pR(e, t, n) {
- const i = e.slice(0);
- return i[t] = n, i;
- }
- function hy(e, t, n, i, s) {
- return IT(e, n(t), n, i, s);
- }
- function IT(e, t, n, i, s) {
- if (!ut(e))
- return -1;
- let o = s ?? 0, c = e.length - 1;
- for (; o <= c; ) {
- const _ = o + (c - o >> 1), u = n(e[_], _);
- switch (i(u, t)) {
- case -1:
- o = _ + 1;
- break;
- case 0:
- return _;
- case 1:
- c = _ - 1;
- break;
- }
- }
- return ~o;
- }
- function Hu(e, t, n, i, s) {
- if (e && e.length > 0) {
- const o = e.length;
- if (o > 0) {
- let c = i === void 0 || i < 0 ? 0 : i;
- const _ = s === void 0 || c + s > o - 1 ? o - 1 : c + s;
- let u;
- for (arguments.length <= 2 ? (u = e[c], c++) : u = n; c <= _; )
- u = t(u, e[c], c), c++;
- return u;
- }
- }
- return n;
- }
- var j1 = Object.prototype.hasOwnProperty;
- function co(e, t) {
- return j1.call(e, t);
- }
- function fI(e, t) {
- return j1.call(e, t) ? e[t] : void 0;
- }
- function rm(e) {
- const t = [];
- for (const n in e)
- j1.call(e, n) && t.push(n);
- return t;
- }
- function dme(e) {
- const t = [];
- do {
- const n = Object.getOwnPropertyNames(e);
- for (const i of n)
- tp(t, i);
- } while (e = Object.getPrototypeOf(e));
- return t;
- }
- function OT(e) {
- const t = [];
- for (const n in e)
- j1.call(e, n) && t.push(e[n]);
- return t;
- }
- function hX(e, t) {
- const n = new Array(e);
- for (let i = 0; i < e; i++)
- n[i] = t(i);
- return n;
- }
- function as(e, t) {
- const n = [];
- for (const i of e)
- n.push(t ? t(i) : i);
- return n;
- }
- function z2(e, ...t) {
- for (const n of t)
- if (n !== void 0)
- for (const i in n)
- co(n, i) && (e[i] = n[i]);
- return e;
- }
- function yX(e, t, n = by) {
- if (e === t) return !0;
- if (!e || !t) return !1;
- for (const i in e)
- if (j1.call(e, i) && (!j1.call(t, i) || !n(e[i], t[i])))
- return !1;
- for (const i in t)
- if (j1.call(t, i) && !j1.call(e, i))
- return !1;
- return !0;
- }
- function Yk(e, t, n = go) {
- const i = /* @__PURE__ */ new Map();
- for (let s = 0; s < e.length; s++) {
- const o = e[s], c = t(o);
- c !== void 0 && i.set(c, n(o));
- }
- return i;
- }
- function vX(e, t, n = go) {
- const i = [];
- for (let s = 0; s < e.length; s++) {
- const o = e[s];
- i[t(o)] = n(o);
- }
- return i;
- }
- function nw(e, t, n = go) {
- const i = Ip();
- for (let s = 0; s < e.length; s++) {
- const o = e[s];
- i.add(t(o), n(o));
- }
- return i;
- }
- function Zk(e, t, n = go) {
- return as(nw(e, t).values(), n);
- }
- function dR(e, t) {
- const n = {};
- if (e !== void 0)
- for (let i = 0; i < e.length; i++) {
- const s = e[i], o = `${t(s)}`;
- (n[o] ?? (n[o] = [])).push(s);
- }
- return n;
- }
- function bX(e) {
- const t = {};
- for (const n in e)
- j1.call(e, n) && (t[n] = e[n]);
- return t;
- }
- function pI(e, t) {
- const n = {};
- for (const i in t)
- j1.call(t, i) && (n[i] = t[i]);
- for (const i in e)
- j1.call(e, i) && (n[i] = e[i]);
- return n;
- }
- function mR(e, t) {
- for (const n in t)
- j1.call(t, n) && (e[n] = t[n]);
- }
- function Ms(e, t) {
- return t?.bind(e);
- }
- function Ip() {
- const e = /* @__PURE__ */ new Map();
- return e.add = j7e, e.remove = B7e, e;
- }
- function j7e(e, t) {
- let n = this.get(e);
- return n !== void 0 ? n.push(t) : this.set(e, n = [t]), n;
- }
- function B7e(e, t) {
- const n = this.get(e);
- n !== void 0 && (LT(n, t), n.length || this.delete(e));
- }
- function iw(e) {
- const t = e?.slice() ?? [];
- let n = 0;
- function i() {
- return n === t.length;
- }
- function s(...c) {
- t.push(...c);
- }
- function o() {
- if (i())
- throw new Error("Queue is empty");
- const c = t[n];
- if (t[n] = void 0, n++, n > 100 && n > t.length >> 1) {
- const _ = t.length - n;
- t.copyWithin(
- /*target*/
- 0,
- /*start*/
- n
- ), t.length = _, n = 0;
- }
- return c;
- }
- return {
- enqueue: s,
- dequeue: o,
- isEmpty: i
- };
- }
- function gR(e, t) {
- const n = /* @__PURE__ */ new Map();
- let i = 0;
- function* s() {
- for (const c of n.values())
- us(c) ? yield* c : yield c;
- }
- const o = {
- has(c) {
- const _ = e(c);
- if (!n.has(_)) return !1;
- const u = n.get(_);
- return us(u) ? ss(u, c, t) : t(u, c);
- },
- add(c) {
- const _ = e(c);
- if (n.has(_)) {
- const u = n.get(_);
- if (us(u))
- ss(u, c, t) || (u.push(c), i++);
- else {
- const d = u;
- t(d, c) || (n.set(_, [d, c]), i++);
- }
- } else
- n.set(_, c), i++;
- return this;
- },
- delete(c) {
- const _ = e(c);
- if (!n.has(_)) return !1;
- const u = n.get(_);
- if (us(u)) {
- for (let d = 0; d < u.length; d++)
- if (t(u[d], c))
- return u.length === 1 ? n.delete(_) : u.length === 2 ? n.set(_, u[1 - d]) : hme(u, d), i--, !0;
- } else if (t(u, c))
- return n.delete(_), i--, !0;
- return !1;
- },
- clear() {
- n.clear(), i = 0;
- },
- get size() {
- return i;
- },
- forEach(c) {
- for (const _ of as(n.values()))
- if (us(_))
- for (const u of _)
- c(u, u, o);
- else {
- const u = _;
- c(u, u, o);
- }
- },
- keys() {
- return s();
- },
- values() {
- return s();
- },
- *entries() {
- for (const c of s())
- yield [c, c];
- },
- [Symbol.iterator]: () => s(),
- [Symbol.toStringTag]: n[Symbol.toStringTag]
- };
- return o;
- }
- function us(e) {
- return Array.isArray(e);
- }
- function FT(e) {
- return us(e) ? e : [e];
- }
- function _s(e) {
- return typeof e == "string";
- }
- function yy(e) {
- return typeof e == "number";
- }
- function Wn(e, t) {
- return e !== void 0 && t(e) ? e : void 0;
- }
- function Bs(e, t) {
- return e !== void 0 && t(e) ? e : E.fail(`Invalid cast. The supplied value ${e} did not pass the test '${E.getFunctionName(t)}'.`);
- }
- function ja(e) {
- }
- function nm() {
- return !1;
- }
- function B1() {
- return !0;
- }
- function lb() {
- }
- function go(e) {
- return e;
- }
- function J7e(e) {
- return e.toLowerCase();
- }
- var mme = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
- function vy(e) {
- return mme.test(e) ? e.replace(mme, J7e) : e;
- }
- function Vs() {
- throw new Error("Not implemented");
- }
- function Iu(e) {
- let t;
- return () => (e && (t = e(), e = void 0), t);
- }
- function im(e) {
- const t = /* @__PURE__ */ new Map();
- return (n) => {
- const i = `${typeof n}:${n}`;
- let s = t.get(i);
- return s === void 0 && !t.has(i) && (s = e(n), t.set(i, s)), s;
- };
- }
- var SX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Normal = 1] = "Normal", e[e.Aggressive = 2] = "Aggressive", e[e.VeryAggressive = 3] = "VeryAggressive", e))(SX || {});
- function by(e, t) {
- return e === t;
- }
- function Sy(e, t) {
- return e === t || e !== void 0 && t !== void 0 && e.toUpperCase() === t.toUpperCase();
- }
- function ub(e, t) {
- return by(e, t);
- }
- function gme(e, t) {
- return e === t ? 0 : e === void 0 ? -1 : t === void 0 ? 1 : e < t ? -1 : 1;
- }
- function ho(e, t) {
- return gme(e, t);
- }
- function dI(e, t) {
- return ho(e?.start, t?.start) || ho(e?.length, t?.length);
- }
- function hR(e, t, n) {
- for (let i = 0; i < e.length; i++)
- t = Math.max(t, n(e[i]));
- return t;
- }
- function yR(e, t) {
- return Hu(e, (n, i) => t(n, i) === -1 ? n : i);
- }
- function sw(e, t) {
- return e === t ? 0 : e === void 0 ? -1 : t === void 0 ? 1 : (e = e.toUpperCase(), t = t.toUpperCase(), e < t ? -1 : e > t ? 1 : 0);
- }
- function TX(e, t) {
- return e === t ? 0 : e === void 0 ? -1 : t === void 0 ? 1 : (e = e.toLowerCase(), t = t.toLowerCase(), e < t ? -1 : e > t ? 1 : 0);
- }
- function au(e, t) {
- return gme(e, t);
- }
- function Kk(e) {
- return e ? sw : au;
- }
- var z7e = /* @__PURE__ */ (() => {
- return t;
- function e(n, i, s) {
- if (n === i) return 0;
- if (n === void 0) return -1;
- if (i === void 0) return 1;
- const o = s(n, i);
- return o < 0 ? -1 : o > 0 ? 1 : 0;
- }
- function t(n) {
- const i = new Intl.Collator(n, { usage: "sort", sensitivity: "variant", numeric: !0 }).compare;
- return (s, o) => e(s, o, i);
- }
- })(), vR, bR;
- function xX() {
- return bR;
- }
- function kX(e) {
- bR !== e && (bR = e, vR = void 0);
- }
- function aw(e, t) {
- return vR ?? (vR = z7e(bR)), vR(e, t);
- }
- function CX(e, t, n, i) {
- return e === t ? 0 : e === void 0 ? -1 : t === void 0 ? 1 : i(e[n], t[n]);
- }
- function J1(e, t) {
- return ho(e ? 1 : 0, t ? 1 : 0);
- }
- function _b(e, t, n) {
- const i = Math.max(2, Math.floor(e.length * 0.34));
- let s = Math.floor(e.length * 0.4) + 1, o;
- for (const c of t) {
- const _ = n(c);
- if (_ !== void 0 && Math.abs(_.length - e.length) <= i) {
- if (_ === e || _.length < 3 && _.toLowerCase() !== e.toLowerCase())
- continue;
- const u = W7e(e, _, s - 0.1);
- if (u === void 0)
- continue;
- E.assert(u < s), s = u, o = c;
- }
- }
- return o;
- }
- function W7e(e, t, n) {
- let i = new Array(t.length + 1), s = new Array(t.length + 1);
- const o = n + 0.01;
- for (let _ = 0; _ <= t.length; _++)
- i[_] = _;
- for (let _ = 1; _ <= e.length; _++) {
- const u = e.charCodeAt(_ - 1), d = Math.ceil(_ > n ? _ - n : 1), g = Math.floor(t.length > n + _ ? n + _ : t.length);
- s[0] = _;
- let h = _;
- for (let T = 1; T < d; T++)
- s[T] = o;
- for (let T = d; T <= g; T++) {
- const C = e[_ - 1].toLowerCase() === t[T - 1].toLowerCase() ? i[T - 1] + 0.1 : i[T - 1] + 2, D = u === t.charCodeAt(T - 1) ? i[T - 1] : Math.min(
- /*delete*/
- i[T] + 1,
- /*insert*/
- s[T - 1] + 1,
- /*substitute*/
- C
- );
- s[T] = D, h = Math.min(h, D);
- }
- for (let T = g + 1; T <= t.length; T++)
- s[T] = o;
- if (h > n)
- return;
- const S = i;
- i = s, s = S;
- }
- const c = i[t.length];
- return c > n ? void 0 : c;
- }
- function Zo(e, t, n) {
- const i = e.length - t.length;
- return i >= 0 && (n ? Sy(e.slice(i), t) : e.indexOf(t, i) === i);
- }
- function eC(e, t) {
- return Zo(e, t) ? e.slice(0, e.length - t.length) : e;
- }
- function EX(e, t) {
- return Zo(e, t) ? e.slice(0, e.length - t.length) : void 0;
- }
- function SR(e) {
- let t = e.length;
- for (let n = t - 1; n > 0; n--) {
- let i = e.charCodeAt(n);
- if (i >= 48 && i <= 57)
- do
- --n, i = e.charCodeAt(n);
- while (n > 0 && i >= 48 && i <= 57);
- else if (n > 4 && (i === 110 || i === 78)) {
- if (--n, i = e.charCodeAt(n), i !== 105 && i !== 73 || (--n, i = e.charCodeAt(n), i !== 109 && i !== 77))
- break;
- --n, i = e.charCodeAt(n);
- } else
- break;
- if (i !== 45 && i !== 46)
- break;
- t = n;
- }
- return t === e.length ? e : e.slice(0, t);
- }
- function OE(e, t) {
- for (let n = 0; n < e.length; n++)
- if (e[n] === t)
- return Ty(e, n), !0;
- return !1;
- }
- function Ty(e, t) {
- for (let n = t; n < e.length - 1; n++)
- e[n] = e[n + 1];
- e.pop();
- }
- function hme(e, t) {
- e[t] = e[e.length - 1], e.pop();
- }
- function LT(e, t) {
- return U7e(e, (n) => n === t);
- }
- function U7e(e, t) {
- for (let n = 0; n < e.length; n++)
- if (t(e[n]))
- return hme(e, n), !0;
- return !1;
- }
- function zl(e) {
- return e ? go : vy;
- }
- function DX({ prefix: e, suffix: t }) {
- return `${e}*${t}`;
- }
- function PX(e, t) {
- return E.assert(mI(e, t)), t.substring(e.prefix.length, t.length - e.suffix.length);
- }
- function TR(e, t, n) {
- let i, s = -1;
- for (let o = 0; o < e.length; o++) {
- const c = e[o], _ = t(c);
- mI(_, n) && _.prefix.length > s && (s = _.prefix.length, i = c);
- }
- return i;
- }
- function Ui(e, t, n) {
- return n ? Sy(e.slice(0, t.length), t) : e.lastIndexOf(t, 0) === 0;
- }
- function FE(e, t) {
- return Ui(e, t) ? e.substr(t.length) : e;
- }
- function xR(e, t, n = go) {
- return Ui(n(e), n(t)) ? e.substring(t.length) : void 0;
- }
- function mI({ prefix: e, suffix: t }, n) {
- return n.length >= e.length + t.length && Ui(n, e) && Zo(n, t);
- }
- function gI(e, t) {
- return (n) => e(n) && t(n);
- }
- function Nf(...e) {
- return (...t) => {
- let n;
- for (const i of e)
- if (n = i(...t), n)
- return n;
- return n;
- };
- }
- function hI(e) {
- return (...t) => !e(...t);
- }
- function yme(e) {
- }
- function MT(e) {
- return e === void 0 ? void 0 : [e];
- }
- function yI(e, t, n, i, s, o) {
- o ?? (o = ja);
- let c = 0, _ = 0;
- const u = e.length, d = t.length;
- let g = !1;
- for (; c < u && _ < d; ) {
- const h = e[c], S = t[_], T = n(h, S);
- T === -1 ? (i(h), c++, g = !0) : T === 1 ? (s(S), _++, g = !0) : (o(S, h), c++, _++);
- }
- for (; c < u; )
- i(e[c++]), g = !0;
- for (; _ < d; )
- s(t[_++]), g = !0;
- return g;
- }
- function wX(e) {
- const t = [];
- return vme(
- e,
- t,
- /*outer*/
- void 0,
- 0
- ), t;
- }
- function vme(e, t, n, i) {
- for (const s of e[i]) {
- let o;
- n ? (o = n.slice(), o.push(s)) : o = [s], i === e.length - 1 ? t.push(o) : vme(e, t, o, i + 1);
- }
- }
- function kR(e, t) {
- if (e !== void 0) {
- const n = e.length;
- let i = 0;
- for (; i < n && t(e[i]); )
- i++;
- return e.slice(0, i);
- }
- }
- function AX(e, t) {
- if (e !== void 0) {
- const n = e.length;
- let i = 0;
- for (; i < n && t(e[i]); )
- i++;
- return e.slice(i);
- }
- }
- function CR() {
- return typeof process < "u" && !!process.nextTick && !process.browser && typeof S7e < "u";
- }
- var NX = /* @__PURE__ */ ((e) => (e[e.Off = 0] = "Off", e[e.Error = 1] = "Error", e[e.Warning = 2] = "Warning", e[e.Info = 3] = "Info", e[e.Verbose = 4] = "Verbose", e))(NX || {}), E;
- ((e) => {
- let t = 0;
- e.currentLogLevel = 2, e.isDebugging = !1;
- function n(Fe) {
- return e.currentLogLevel <= Fe;
- }
- e.shouldLog = n;
- function i(Fe, Ot) {
- e.loggingHost && n(Fe) && e.loggingHost.log(Fe, Ot);
- }
- function s(Fe) {
- i(3, Fe);
- }
- e.log = s, ((Fe) => {
- function Ot(qn) {
- i(1, qn);
- }
- Fe.error = Ot;
- function Ar(qn) {
- i(2, qn);
- }
- Fe.warn = Ar;
- function mn(qn) {
- i(3, qn);
- }
- Fe.log = mn;
- function ti(qn) {
- i(4, qn);
- }
- Fe.trace = ti;
- })(s = e.log || (e.log = {}));
- const o = {};
- function c() {
- return t;
- }
- e.getAssertionLevel = c;
- function _(Fe) {
- const Ot = t;
- if (t = Fe, Fe > Ot)
- for (const Ar of rm(o)) {
- const mn = o[Ar];
- mn !== void 0 && e[Ar] !== mn.assertion && Fe >= mn.level && (e[Ar] = mn, o[Ar] = void 0);
- }
- }
- e.setAssertionLevel = _;
- function u(Fe) {
- return t >= Fe;
- }
- e.shouldAssert = u;
- function d(Fe, Ot) {
- return u(Fe) ? !0 : (o[Ot] = { level: Fe, assertion: e[Ot] }, e[Ot] = ja, !1);
- }
- function g(Fe, Ot) {
- debugger;
- const Ar = new Error(Fe ? `Debug Failure. ${Fe}` : "Debug Failure.");
- throw Error.captureStackTrace && Error.captureStackTrace(Ar, Ot || g), Ar;
- }
- e.fail = g;
- function h(Fe, Ot, Ar) {
- return g(
- `${Ot || "Unexpected node."}\r
-Node ${oe(Fe.kind)} was unexpected.`,
- Ar || h
- );
- }
- e.failBadSyntaxKind = h;
- function S(Fe, Ot, Ar, mn) {
- Fe || (Ot = Ot ? `False expression: ${Ot}` : "False expression.", Ar && (Ot += `\r
-Verbose Debug Information: ` + (typeof Ar == "string" ? Ar : Ar())), g(Ot, mn || S));
- }
- e.assert = S;
- function T(Fe, Ot, Ar, mn, ti) {
- if (Fe !== Ot) {
- const qn = Ar ? mn ? `${Ar} ${mn}` : Ar : "";
- g(`Expected ${Fe} === ${Ot}. ${qn}`, ti || T);
- }
- }
- e.assertEqual = T;
- function C(Fe, Ot, Ar, mn) {
- Fe >= Ot && g(`Expected ${Fe} < ${Ot}. ${Ar || ""}`, mn || C);
- }
- e.assertLessThan = C;
- function D(Fe, Ot, Ar) {
- Fe > Ot && g(`Expected ${Fe} <= ${Ot}`, Ar || D);
- }
- e.assertLessThanOrEqual = D;
- function P(Fe, Ot, Ar) {
- Fe < Ot && g(`Expected ${Fe} >= ${Ot}`, Ar || P);
- }
- e.assertGreaterThanOrEqual = P;
- function I(Fe, Ot, Ar) {
- Fe == null && g(Ot, Ar || I);
- }
- e.assertIsDefined = I;
- function F(Fe, Ot, Ar) {
- return I(Fe, Ot, Ar || F), Fe;
- }
- e.checkDefined = F;
- function O(Fe, Ot, Ar) {
- for (const mn of Fe)
- I(mn, Ot, Ar || O);
- }
- e.assertEachIsDefined = O;
- function B(Fe, Ot, Ar) {
- return O(Fe, Ot, Ar || B), Fe;
- }
- e.checkEachDefined = B;
- function z(Fe, Ot = "Illegal value:", Ar) {
- const mn = typeof Fe == "object" && co(Fe, "kind") && co(Fe, "pos") ? "SyntaxKind: " + oe(Fe.kind) : JSON.stringify(Fe);
- return g(`${Ot} ${mn}`, Ar || z);
- }
- e.assertNever = z;
- function X(Fe, Ot, Ar, mn) {
- d(1, "assertEachNode") && S(
- Ot === void 0 || Mi(Fe, Ot),
- Ar || "Unexpected node.",
- () => `Node array did not pass test '${re(Ot)}'.`,
- mn || X
- );
- }
- e.assertEachNode = X;
- function q(Fe, Ot, Ar, mn) {
- d(1, "assertNode") && S(
- Fe !== void 0 && (Ot === void 0 || Ot(Fe)),
- Ar || "Unexpected node.",
- () => `Node ${oe(Fe?.kind)} did not pass test '${re(Ot)}'.`,
- mn || q
- );
- }
- e.assertNode = q;
- function V(Fe, Ot, Ar, mn) {
- d(1, "assertNotNode") && S(
- Fe === void 0 || Ot === void 0 || !Ot(Fe),
- Ar || "Unexpected node.",
- () => `Node ${oe(Fe.kind)} should not have passed test '${re(Ot)}'.`,
- mn || V
- );
- }
- e.assertNotNode = V;
- function ae(Fe, Ot, Ar, mn) {
- d(1, "assertOptionalNode") && S(
- Ot === void 0 || Fe === void 0 || Ot(Fe),
- Ar || "Unexpected node.",
- () => `Node ${oe(Fe?.kind)} did not pass test '${re(Ot)}'.`,
- mn || ae
- );
- }
- e.assertOptionalNode = ae;
- function ee(Fe, Ot, Ar, mn) {
- d(1, "assertOptionalToken") && S(
- Ot === void 0 || Fe === void 0 || Fe.kind === Ot,
- Ar || "Unexpected node.",
- () => `Node ${oe(Fe?.kind)} was not a '${oe(Ot)}' token.`,
- mn || ee
- );
- }
- e.assertOptionalToken = ee;
- function G(Fe, Ot, Ar) {
- d(1, "assertMissingNode") && S(
- Fe === void 0,
- Ot || "Unexpected node.",
- () => `Node ${oe(Fe.kind)} was unexpected'.`,
- Ar || G
- );
- }
- e.assertMissingNode = G;
- function ue(Fe) {
- }
- e.type = ue;
- function re(Fe) {
- if (typeof Fe != "function")
- return "";
- if (co(Fe, "name"))
- return Fe.name;
- {
- const Ot = Function.prototype.toString.call(Fe), Ar = /^function\s+([\w$]+)\s*\(/.exec(Ot);
- return Ar ? Ar[1] : "";
- }
- }
- e.getFunctionName = re;
- function ne(Fe) {
- return `{ name: ${Ei(Fe.escapedName)}; flags: ${we(Fe.flags)}; declarations: ${lr(Fe.declarations, (Ot) => oe(Ot.kind))} }`;
- }
- e.formatSymbol = ne;
- function ie(Fe = 0, Ot, Ar) {
- const mn = J(Ot);
- if (Fe === 0)
- return mn.length > 0 && mn[0][0] === 0 ? mn[0][1] : "0";
- if (Ar) {
- const ti = [];
- let qn = Fe;
- for (const [Oi, Ws] of mn) {
- if (Oi > Fe)
- break;
- Oi !== 0 && Oi & Fe && (ti.push(Ws), qn &= ~Oi);
- }
- if (qn === 0)
- return ti.join("|");
- } else
- for (const [ti, qn] of mn)
- if (ti === Fe)
- return qn;
- return Fe.toString();
- }
- e.formatEnum = ie;
- const Se = /* @__PURE__ */ new Map();
- function J(Fe) {
- const Ot = Se.get(Fe);
- if (Ot)
- return Ot;
- const Ar = [];
- for (const ti in Fe) {
- const qn = Fe[ti];
- typeof qn == "number" && Ar.push([qn, ti]);
- }
- const mn = V_(Ar, (ti, qn) => ho(ti[0], qn[0]));
- return Se.set(Fe, mn), mn;
- }
- function oe(Fe) {
- return ie(
- Fe,
- wR,
- /*isFlags*/
- !1
- );
- }
- e.formatSyntaxKind = oe;
- function _e(Fe) {
- return ie(
- Fe,
- UR,
- /*isFlags*/
- !1
- );
- }
- e.formatSnippetKind = _e;
- function he(Fe) {
- return ie(
- Fe,
- zR,
- /*isFlags*/
- !1
- );
- }
- e.formatScriptKind = he;
- function le(Fe) {
- return ie(
- Fe,
- AR,
- /*isFlags*/
- !0
- );
- }
- e.formatNodeFlags = le;
- function me(Fe) {
- return ie(
- Fe,
- RR,
- /*isFlags*/
- !0
- );
- }
- e.formatNodeCheckFlags = me;
- function ve(Fe) {
- return ie(
- Fe,
- NR,
- /*isFlags*/
- !0
- );
- }
- e.formatModifierFlags = ve;
- function tt(Fe) {
- return ie(
- Fe,
- WR,
- /*isFlags*/
- !0
- );
- }
- e.formatTransformFlags = tt;
- function Te(Fe) {
- return ie(
- Fe,
- VR,
- /*isFlags*/
- !0
- );
- }
- e.formatEmitFlags = Te;
- function we(Fe) {
- return ie(
- Fe,
- MR,
- /*isFlags*/
- !0
- );
- }
- e.formatSymbolFlags = we;
- function fe(Fe) {
- return ie(
- Fe,
- jR,
- /*isFlags*/
- !0
- );
- }
- e.formatTypeFlags = fe;
- function Me(Fe) {
- return ie(
- Fe,
- JR,
- /*isFlags*/
- !0
- );
- }
- e.formatSignatureFlags = Me;
- function Qe(Fe) {
- return ie(
- Fe,
- BR,
- /*isFlags*/
- !0
- );
- }
- e.formatObjectFlags = Qe;
- function et(Fe) {
- return ie(
- Fe,
- bI,
- /*isFlags*/
- !0
- );
- }
- e.formatFlowFlags = et;
- function Re(Fe) {
- return ie(
- Fe,
- IR,
- /*isFlags*/
- !0
- );
- }
- e.formatRelationComparisonResult = Re;
- function ft(Fe) {
- return ie(
- Fe,
- Xz,
- /*isFlags*/
- !0
- );
- }
- e.formatCheckMode = ft;
- function Wt(Fe) {
- return ie(
- Fe,
- Qz,
- /*isFlags*/
- !0
- );
- }
- e.formatSignatureCheckMode = Wt;
- function _r(Fe) {
- return ie(
- Fe,
- $z,
- /*isFlags*/
- !0
- );
- }
- e.formatTypeFacts = _r;
- let Ir = !1, jr;
- function Nt(Fe) {
- "__debugFlowFlags" in Fe || Object.defineProperties(Fe, {
- // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
- __tsDebuggerDisplay: {
- value() {
- const Ot = this.flags & 2 ? "FlowStart" : this.flags & 4 ? "FlowBranchLabel" : this.flags & 8 ? "FlowLoopLabel" : this.flags & 16 ? "FlowAssignment" : this.flags & 32 ? "FlowTrueCondition" : this.flags & 64 ? "FlowFalseCondition" : this.flags & 128 ? "FlowSwitchClause" : this.flags & 256 ? "FlowArrayMutation" : this.flags & 512 ? "FlowCall" : this.flags & 1024 ? "FlowReduceLabel" : this.flags & 1 ? "FlowUnreachable" : "UnknownFlow", Ar = this.flags & -2048;
- return `${Ot}${Ar ? ` (${et(Ar)})` : ""}`;
- }
- },
- __debugFlowFlags: {
- get() {
- return ie(
- this.flags,
- bI,
- /*isFlags*/
- !0
- );
- }
- },
- __debugToString: {
- value() {
- return ji(this);
- }
- }
- });
- }
- function Qt(Fe) {
- return Ir && (typeof Object.setPrototypeOf == "function" ? (jr || (jr = Object.create(Object.prototype), Nt(jr)), Object.setPrototypeOf(Fe, jr)) : Nt(Fe)), Fe;
- }
- e.attachFlowNodeDebugInfo = Qt;
- let Br;
- function xr(Fe) {
- "__tsDebuggerDisplay" in Fe || Object.defineProperties(Fe, {
- __tsDebuggerDisplay: {
- value(Ot) {
- return Ot = String(Ot).replace(/(?:,[\s\w]+:[^,]+)+\]$/, "]"), `NodeArray ${Ot}`;
- }
- }
- });
- }
- function zn(Fe) {
- Ir && (typeof Object.setPrototypeOf == "function" ? (Br || (Br = Object.create(Array.prototype), xr(Br)), Object.setPrototypeOf(Fe, Br)) : xr(Fe));
- }
- e.attachNodeArrayDebugInfo = zn;
- function ki() {
- if (Ir) return;
- const Fe = /* @__PURE__ */ new WeakMap(), Ot = /* @__PURE__ */ new WeakMap();
- Object.defineProperties(Gl.getSymbolConstructor().prototype, {
- // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
- __tsDebuggerDisplay: {
- value() {
- const mn = this.flags & 33554432 ? "TransientSymbol" : "Symbol", ti = this.flags & -33554433;
- return `${mn} '${mc(this)}'${ti ? ` (${we(ti)})` : ""}`;
- }
- },
- __debugFlags: {
- get() {
- return we(this.flags);
- }
- }
- }), Object.defineProperties(Gl.getTypeConstructor().prototype, {
- // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
- __tsDebuggerDisplay: {
- value() {
- const mn = this.flags & 67359327 ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 ? "NullableType" : this.flags & 384 ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 ? "UniqueESSymbolType" : this.flags & 32 ? "EnumType" : this.flags & 1048576 ? "UnionType" : this.flags & 2097152 ? "IntersectionType" : this.flags & 4194304 ? "IndexType" : this.flags & 8388608 ? "IndexedAccessType" : this.flags & 16777216 ? "ConditionalType" : this.flags & 33554432 ? "SubstitutionType" : this.flags & 262144 ? "TypeParameter" : this.flags & 524288 ? this.objectFlags & 3 ? "InterfaceType" : this.objectFlags & 4 ? "TypeReference" : this.objectFlags & 8 ? "TupleType" : this.objectFlags & 16 ? "AnonymousType" : this.objectFlags & 32 ? "MappedType" : this.objectFlags & 1024 ? "ReverseMappedType" : this.objectFlags & 256 ? "EvolvingArrayType" : "ObjectType" : "Type", ti = this.flags & 524288 ? this.objectFlags & -1344 : 0;
- return `${mn}${this.symbol ? ` '${mc(this.symbol)}'` : ""}${ti ? ` (${Qe(ti)})` : ""}`;
- }
- },
- __debugFlags: {
- get() {
- return fe(this.flags);
- }
- },
- __debugObjectFlags: {
- get() {
- return this.flags & 524288 ? Qe(this.objectFlags) : "";
- }
- },
- __debugTypeToString: {
- value() {
- let mn = Fe.get(this);
- return mn === void 0 && (mn = this.checker.typeToString(this), Fe.set(this, mn)), mn;
- }
- }
- }), Object.defineProperties(Gl.getSignatureConstructor().prototype, {
- __debugFlags: {
- get() {
- return Me(this.flags);
- }
- },
- __debugSignatureToString: {
- value() {
- var mn;
- return (mn = this.checker) == null ? void 0 : mn.signatureToString(this);
- }
- }
- });
- const Ar = [
- Gl.getNodeConstructor(),
- Gl.getIdentifierConstructor(),
- Gl.getTokenConstructor(),
- Gl.getSourceFileConstructor()
- ];
- for (const mn of Ar)
- co(mn.prototype, "__debugKind") || Object.defineProperties(mn.prototype, {
- // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
- __tsDebuggerDisplay: {
- value() {
- return `${jo(this) ? "GeneratedIdentifier" : Oe(this) ? `Identifier '${Nn(this)}'` : Di(this) ? `PrivateIdentifier '${Nn(this)}'` : oa(this) ? `StringLiteral ${JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")}` : d_(this) ? `NumericLiteral ${this.text}` : eD(this) ? `BigIntLiteral ${this.text}n` : zo(this) ? "TypeParameterDeclaration" : Ii(this) ? "ParameterDeclaration" : Qo(this) ? "ConstructorDeclaration" : Lf(this) ? "GetAccessorDeclaration" : K_(this) ? "SetAccessorDeclaration" : Dx(this) ? "CallSignatureDeclaration" : tA(this) ? "ConstructSignatureDeclaration" : Fb(this) ? "IndexSignatureDeclaration" : Px(this) ? "TypePredicateNode" : vf(this) ? "TypeReferenceNode" : lg(this) ? "FunctionTypeNode" : VC(this) ? "ConstructorTypeNode" : Lb(this) ? "TypeQueryNode" : Qu(this) ? "TypeLiteralNode" : rA(this) ? "ArrayTypeNode" : wx(this) ? "TupleTypeNode" : G5(this) ? "OptionalTypeNode" : $5(this) ? "RestTypeNode" : qy(this) ? "UnionTypeNode" : Ax(this) ? "IntersectionTypeNode" : Mb(this) ? "ConditionalTypeNode" : pS(this) ? "InferTypeNode" : dS(this) ? "ParenthesizedTypeNode" : HC(this) ? "ThisTypeNode" : cv(this) ? "TypeOperatorNode" : Rb(this) ? "IndexedAccessTypeNode" : mS(this) ? "MappedTypeNode" : P0(this) ? "LiteralTypeNode" : qC(this) ? "NamedTupleMember" : bm(this) ? "ImportTypeNode" : oe(this.kind)}${this.flags ? ` (${le(this.flags)})` : ""}`;
- }
- },
- __debugKind: {
- get() {
- return oe(this.kind);
- }
- },
- __debugNodeFlags: {
- get() {
- return le(this.flags);
- }
- },
- __debugModifierFlags: {
- get() {
- return ve(gK(this));
- }
- },
- __debugTransformFlags: {
- get() {
- return tt(this.transformFlags);
- }
- },
- __debugIsParseTreeNode: {
- get() {
- return ZE(this);
- }
- },
- __debugEmitFlags: {
- get() {
- return Te(ya(this));
- }
- },
- __debugGetText: {
- value(ti) {
- if (fo(this)) return "";
- let qn = Ot.get(this);
- if (qn === void 0) {
- const Oi = fs(this), Ws = Oi && Tr(Oi);
- qn = Ws ? gb(Ws, Oi, ti) : "", Ot.set(this, qn);
- }
- return qn;
- }
- }
- });
- Ir = !0;
- }
- e.enableDebugInfo = ki;
- function rs(Fe) {
- const Ot = Fe & 7;
- let Ar = Ot === 0 ? "in out" : Ot === 3 ? "[bivariant]" : Ot === 2 ? "in" : Ot === 1 ? "out" : Ot === 4 ? "[independent]" : "";
- return Fe & 8 ? Ar += " (unmeasurable)" : Fe & 16 && (Ar += " (unreliable)"), Ar;
- }
- e.formatVariance = rs;
- class ei {
- __debugToString() {
- var Ot;
- switch (this.kind) {
- case 3:
- return ((Ot = this.debugInfo) == null ? void 0 : Ot.call(this)) || "(function mapper)";
- case 0:
- return `${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;
- case 1:
- return tR(
- this.sources,
- this.targets || lr(this.sources, () => "any"),
- (Ar, mn) => `${Ar.__debugTypeToString()} -> ${typeof mn == "string" ? mn : mn.__debugTypeToString()}`
- ).join(", ");
- case 2:
- return tR(
- this.sources,
- this.targets,
- (Ar, mn) => `${Ar.__debugTypeToString()} -> ${mn().__debugTypeToString()}`
- ).join(", ");
- case 5:
- case 4:
- return `m1: ${this.mapper1.__debugToString().split(`
-`).join(`
- `)}
-m2: ${this.mapper2.__debugToString().split(`
-`).join(`
- `)}`;
- default:
- return z(this);
- }
- }
- }
- e.DebugTypeMapper = ei;
- function Ri(Fe) {
- return e.isDebugging ? Object.setPrototypeOf(Fe, ei.prototype) : Fe;
- }
- e.attachDebugPrototypeIfDebug = Ri;
- function Jr(Fe) {
- return console.log(ji(Fe));
- }
- e.printControlFlowGraph = Jr;
- function ji(Fe) {
- let Ot = -1;
- function Ar(be) {
- return be.id || (be.id = Ot, Ot--), be.id;
- }
- let mn;
- ((be) => {
- be.lr = "─", be.ud = "│", be.dr = "╭", be.dl = "╮", be.ul = "╯", be.ur = "╰", be.udr = "├", be.udl = "┤", be.dlr = "┬", be.ulr = "┴", be.udlr = "╫";
- })(mn || (mn = {}));
- let ti;
- ((be) => {
- be[be.None = 0] = "None", be[be.Up = 1] = "Up", be[be.Down = 2] = "Down", be[be.Left = 4] = "Left", be[be.Right = 8] = "Right", be[be.UpDown = 3] = "UpDown", be[be.LeftRight = 12] = "LeftRight", be[be.UpLeft = 5] = "UpLeft", be[be.UpRight = 9] = "UpRight", be[be.DownLeft = 6] = "DownLeft", be[be.DownRight = 10] = "DownRight", be[be.UpDownLeft = 7] = "UpDownLeft", be[be.UpDownRight = 11] = "UpDownRight", be[be.UpLeftRight = 13] = "UpLeftRight", be[be.DownLeftRight = 14] = "DownLeftRight", be[be.UpDownLeftRight = 15] = "UpDownLeftRight", be[be.NoChildren = 16] = "NoChildren";
- })(ti || (ti = {}));
- const qn = 2032, Oi = 882, Ws = /* @__PURE__ */ Object.create(
- /*o*/
- null
- ), Hs = [], rr = Ke(Fe, /* @__PURE__ */ new Set());
- for (const be of Hs)
- be.text = vn(be.flowNode, be.circular), at(be);
- const Ea = $e(rr), Xe = bt(Ea);
- return He(rr, 0), M();
- function Tt(be) {
- return !!(be.flags & 128);
- }
- function te(be) {
- return !!(be.flags & 12) && !!be.antecedent;
- }
- function ze(be) {
- return !!(be.flags & qn);
- }
- function K(be) {
- return !!(be.flags & Oi);
- }
- function De(be) {
- const Z = [];
- for (const ht of be.edges)
- ht.source === be && Z.push(ht.target);
- return Z;
- }
- function Ve(be) {
- const Z = [];
- for (const ht of be.edges)
- ht.target === be && Z.push(ht.source);
- return Z;
- }
- function Ke(be, Z) {
- const ht = Ar(be);
- let Le = Ws[ht];
- if (Le && Z.has(be))
- return Le.circular = !0, Le = {
- id: -1,
- flowNode: be,
- edges: [],
- text: "",
- lane: -1,
- endLane: -1,
- level: -1,
- circular: "circularity"
- }, Hs.push(Le), Le;
- if (Z.add(be), !Le)
- if (Ws[ht] = Le = { id: ht, flowNode: be, edges: [], text: "", lane: -1, endLane: -1, level: -1, circular: !1 }, Hs.push(Le), te(be))
- for (const Ie of be.antecedent)
- xe(Le, Ie, Z);
- else ze(be) && xe(Le, be.antecedent, Z);
- return Z.delete(be), Le;
- }
- function xe(be, Z, ht) {
- const Le = Ke(Z, ht), Ie = { source: be, target: Le };
- be.edges.push(Ie), Le.edges.push(Ie);
- }
- function at(be) {
- if (be.level !== -1)
- return be.level;
- let Z = 0;
- for (const ht of Ve(be))
- Z = Math.max(Z, at(ht) + 1);
- return be.level = Z;
- }
- function $e(be) {
- let Z = 0;
- for (const ht of De(be))
- Z = Math.max(Z, $e(ht));
- return Z + 1;
- }
- function bt(be) {
- const Z = dt(Array(be), 0);
- for (const ht of Hs)
- Z[ht.level] = Math.max(Z[ht.level], ht.text.length);
- return Z;
- }
- function He(be, Z) {
- if (be.lane === -1) {
- be.lane = Z, be.endLane = Z;
- const ht = De(be);
- for (let Le = 0; Le < ht.length; Le++) {
- Le > 0 && Z++;
- const Ie = ht[Le];
- He(Ie, Z), Ie.endLane > be.endLane && (Z = Ie.endLane);
- }
- be.endLane = Z;
- }
- }
- function Vt(be) {
- if (be & 2) return "Start";
- if (be & 4) return "Branch";
- if (be & 8) return "Loop";
- if (be & 16) return "Assignment";
- if (be & 32) return "True";
- if (be & 64) return "False";
- if (be & 128) return "SwitchClause";
- if (be & 256) return "ArrayMutation";
- if (be & 512) return "Call";
- if (be & 1024) return "ReduceLabel";
- if (be & 1) return "Unreachable";
- throw new Error();
- }
- function Zt(be) {
- const Z = Tr(be);
- return gb(
- Z,
- be,
- /*includeTrivia*/
- !1
- );
- }
- function vn(be, Z) {
- let ht = Vt(be.flags);
- if (Z && (ht = `${ht}#${Ar(be)}`), Tt(be)) {
- const Le = [], { switchStatement: Ie, clauseStart: At, clauseEnd: Dr } = be.node;
- for (let yr = At; yr < Dr; yr++) {
- const $r = Ie.caseBlock.clauses[yr];
- uD($r) ? Le.push("default") : Le.push(Zt($r.expression));
- }
- ht += ` (${Le.join(", ")})`;
- } else K(be) && be.node && (ht += ` (${Zt(be.node)})`);
- return Z === "circularity" ? `Circular(${ht})` : ht;
- }
- function M() {
- const be = Xe.length, Z = hR(Hs, 0, (Dr) => Dr.lane) + 1, ht = dt(Array(Z), ""), Le = Xe.map(() => Array(Z)), Ie = Xe.map(() => dt(Array(Z), 0));
- for (const Dr of Hs) {
- Le[Dr.level][Dr.lane] = Dr;
- const yr = De(Dr);
- for (let nt = 0; nt < yr.length; nt++) {
- const ot = yr[nt];
- let wt = 8;
- ot.lane === Dr.lane && (wt |= 4), nt > 0 && (wt |= 1), nt < yr.length - 1 && (wt |= 2), Ie[Dr.level][ot.lane] |= wt;
- }
- yr.length === 0 && (Ie[Dr.level][Dr.lane] |= 16);
- const $r = Ve(Dr);
- for (let nt = 0; nt < $r.length; nt++) {
- const ot = $r[nt];
- let wt = 4;
- nt > 0 && (wt |= 1), nt < $r.length - 1 && (wt |= 2), Ie[Dr.level - 1][ot.lane] |= wt;
- }
- }
- for (let Dr = 0; Dr < be; Dr++)
- for (let yr = 0; yr < Z; yr++) {
- const $r = Dr > 0 ? Ie[Dr - 1][yr] : 0, nt = yr > 0 ? Ie[Dr][yr - 1] : 0;
- let ot = Ie[Dr][yr];
- ot || ($r & 8 && (ot |= 12), nt & 2 && (ot |= 3), Ie[Dr][yr] = ot);
- }
- for (let Dr = 0; Dr < be; Dr++)
- for (let yr = 0; yr < ht.length; yr++) {
- const $r = Ie[Dr][yr], nt = $r & 4 ? "─" : " ", ot = Le[Dr][yr];
- ot ? (At(yr, ot.text), Dr < be - 1 && (At(yr, " "), At(yr, U(nt, Xe[Dr] - ot.text.length)))) : Dr < be - 1 && At(yr, U(nt, Xe[Dr] + 1)), At(yr, Ae($r)), At(yr, $r & 8 && Dr < be - 1 && !Le[Dr + 1][yr] ? "─" : " ");
- }
- return `
-${ht.join(`
-`)}
-`;
- function At(Dr, yr) {
- ht[Dr] += yr;
- }
- }
- function Ae(be) {
- switch (be) {
- case 3:
- return "│";
- case 12:
- return "─";
- case 5:
- return "╯";
- case 9:
- return "╰";
- case 6:
- return "╮";
- case 10:
- return "╭";
- case 7:
- return "┤";
- case 11:
- return "├";
- case 13:
- return "┴";
- case 14:
- return "┬";
- case 15:
- return "╫";
- }
- return " ";
- }
- function dt(be, Z) {
- if (be.fill)
- be.fill(Z);
- else
- for (let ht = 0; ht < be.length; ht++)
- be[ht] = Z;
- return be;
- }
- function U(be, Z) {
- if (be.repeat)
- return Z > 0 ? be.repeat(Z) : "";
- let ht = "";
- for (; ht.length < Z; )
- ht += be;
- return ht;
- }
- }
- e.formatControlFlowGraph = ji;
- })(E || (E = {}));
- var V7e = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i, q7e = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i, H7e = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i, G7e = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i, $7e = /^[a-z0-9-]+$/i, bme = /^(?:0|[1-9]\d*)$/, IX = class lI {
- constructor(t, n = 0, i = 0, s = "", o = "") {
- typeof t == "string" && ({ major: t, minor: n, patch: i, prerelease: s, build: o } = E.checkDefined(Sme(t), "Invalid version")), E.assert(t >= 0, "Invalid argument: major"), E.assert(n >= 0, "Invalid argument: minor"), E.assert(i >= 0, "Invalid argument: patch");
- const c = s ? us(s) ? s : s.split(".") : Ue, _ = o ? us(o) ? o : o.split(".") : Ue;
- E.assert(Mi(c, (u) => H7e.test(u)), "Invalid argument: prerelease"), E.assert(Mi(_, (u) => $7e.test(u)), "Invalid argument: build"), this.major = t, this.minor = n, this.patch = i, this.prerelease = c, this.build = _;
- }
- static tryParse(t) {
- const n = Sme(t);
- if (!n) return;
- const { major: i, minor: s, patch: o, prerelease: c, build: _ } = n;
- return new lI(i, s, o, c, _);
- }
- compareTo(t) {
- return this === t ? 0 : t === void 0 ? 1 : ho(this.major, t.major) || ho(this.minor, t.minor) || ho(this.patch, t.patch) || X7e(this.prerelease, t.prerelease);
- }
- increment(t) {
- switch (t) {
- case "major":
- return new lI(this.major + 1, 0, 0);
- case "minor":
- return new lI(this.major, this.minor + 1, 0);
- case "patch":
- return new lI(this.major, this.minor, this.patch + 1);
- default:
- return E.assertNever(t);
- }
- }
- with(t) {
- const {
- major: n = this.major,
- minor: i = this.minor,
- patch: s = this.patch,
- prerelease: o = this.prerelease,
- build: c = this.build
- } = t;
- return new lI(n, i, s, o, c);
- }
- toString() {
- let t = `${this.major}.${this.minor}.${this.patch}`;
- return ut(this.prerelease) && (t += `-${this.prerelease.join(".")}`), ut(this.build) && (t += `+${this.build.join(".")}`), t;
- }
- };
- IX.zero = new IX(0, 0, 0, ["0"]);
- var Sd = IX;
- function Sme(e) {
- const t = V7e.exec(e);
- if (!t) return;
- const [, n, i = "0", s = "0", o = "", c = ""] = t;
- if (!(o && !q7e.test(o)) && !(c && !G7e.test(c)))
- return {
- major: parseInt(n, 10),
- minor: parseInt(i, 10),
- patch: parseInt(s, 10),
- prerelease: o,
- build: c
- };
- }
- function X7e(e, t) {
- if (e === t) return 0;
- if (e.length === 0) return t.length === 0 ? 0 : 1;
- if (t.length === 0) return -1;
- const n = Math.min(e.length, t.length);
- for (let i = 0; i < n; i++) {
- const s = e[i], o = t[i];
- if (s === o) continue;
- const c = bme.test(s), _ = bme.test(o);
- if (c || _) {
- if (c !== _) return c ? -1 : 1;
- const u = ho(+s, +o);
- if (u) return u;
- } else {
- const u = au(s, o);
- if (u) return u;
- }
- }
- return ho(e.length, t.length);
- }
- var vI = class C7e {
- constructor(t) {
- this._alternatives = t ? E.checkDefined(Tme(t), "Invalid range spec.") : Ue;
- }
- static tryParse(t) {
- const n = Tme(t);
- if (n) {
- const i = new C7e("");
- return i._alternatives = n, i;
- }
- }
- /**
- * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
- * in `node-semver`.
- */
- test(t) {
- return typeof t == "string" && (t = new Sd(t)), n5e(t, this._alternatives);
- }
- toString() {
- return a5e(this._alternatives);
- }
- }, Q7e = /\|\|/, Y7e = /\s+/, Z7e = /^([x*0]|[1-9]\d*)(?:\.([x*0]|[1-9]\d*)(?:\.([x*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i, K7e = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i, e5e = /^([~^<>=]|<=|>=)?\s*([a-z0-9-+.*]+)$/i;
- function Tme(e) {
- const t = [];
- for (let n of e.trim().split(Q7e)) {
- if (!n) continue;
- const i = [];
- n = n.trim();
- const s = K7e.exec(n);
- if (s) {
- if (!t5e(s[1], s[2], i)) return;
- } else
- for (const o of n.split(Y7e)) {
- const c = e5e.exec(o.trim());
- if (!c || !r5e(c[1], c[2], i)) return;
- }
- t.push(i);
- }
- return t;
- }
- function OX(e) {
- const t = Z7e.exec(e);
- if (!t) return;
- const [, n, i = "*", s = "*", o, c] = t;
- return { version: new Sd(
- Op(n) ? 0 : parseInt(n, 10),
- Op(n) || Op(i) ? 0 : parseInt(i, 10),
- Op(n) || Op(i) || Op(s) ? 0 : parseInt(s, 10),
- o,
- c
- ), major: n, minor: i, patch: s };
- }
- function t5e(e, t, n) {
- const i = OX(e);
- if (!i) return !1;
- const s = OX(t);
- return s ? (Op(i.major) || n.push(Zm(">=", i.version)), Op(s.major) || n.push(
- Op(s.minor) ? Zm("<", s.version.increment("major")) : Op(s.patch) ? Zm("<", s.version.increment("minor")) : Zm("<=", s.version)
- ), !0) : !1;
- }
- function r5e(e, t, n) {
- const i = OX(t);
- if (!i) return !1;
- const { version: s, major: o, minor: c, patch: _ } = i;
- if (Op(o))
- (e === "<" || e === ">") && n.push(Zm("<", Sd.zero));
- else switch (e) {
- case "~":
- n.push(Zm(">=", s)), n.push(Zm(
- "<",
- s.increment(
- Op(c) ? "major" : "minor"
- )
- ));
- break;
- case "^":
- n.push(Zm(">=", s)), n.push(Zm(
- "<",
- s.increment(
- s.major > 0 || Op(c) ? "major" : s.minor > 0 || Op(_) ? "minor" : "patch"
- )
- ));
- break;
- case "<":
- case ">=":
- n.push(
- Op(c) || Op(_) ? Zm(e, s.with({ prerelease: "0" })) : Zm(e, s)
- );
- break;
- case "<=":
- case ">":
- n.push(
- Op(c) ? Zm(e === "<=" ? "<" : ">=", s.increment("major").with({ prerelease: "0" })) : Op(_) ? Zm(e === "<=" ? "<" : ">=", s.increment("minor").with({ prerelease: "0" })) : Zm(e, s)
- );
- break;
- case "=":
- case void 0:
- Op(c) || Op(_) ? (n.push(Zm(">=", s.with({ prerelease: "0" }))), n.push(Zm("<", s.increment(Op(c) ? "major" : "minor").with({ prerelease: "0" })))) : n.push(Zm("=", s));
- break;
- default:
- return !1;
- }
- return !0;
- }
- function Op(e) {
- return e === "*" || e === "x" || e === "X";
- }
- function Zm(e, t) {
- return { operator: e, operand: t };
- }
- function n5e(e, t) {
- if (t.length === 0) return !0;
- for (const n of t)
- if (i5e(e, n)) return !0;
- return !1;
- }
- function i5e(e, t) {
- for (const n of t)
- if (!s5e(e, n.operator, n.operand)) return !1;
- return !0;
- }
- function s5e(e, t, n) {
- const i = e.compareTo(n);
- switch (t) {
- case "<":
- return i < 0;
- case "<=":
- return i <= 0;
- case ">":
- return i > 0;
- case ">=":
- return i >= 0;
- case "=":
- return i === 0;
- default:
- return E.assertNever(t);
- }
- }
- function a5e(e) {
- return lr(e, o5e).join(" || ") || "*";
- }
- function o5e(e) {
- return lr(e, c5e).join(" ");
- }
- function c5e(e) {
- return `${e.operator}${e.operand}`;
- }
- function l5e() {
- if (CR())
- try {
- const { performance: e } = DE;
- if (e)
- return {
- shouldWriteNativeEvents: !1,
- performance: e
- };
- } catch {
- }
- if (typeof performance == "object")
- return {
- shouldWriteNativeEvents: !0,
- performance
- };
- }
- function u5e() {
- const e = l5e();
- if (!e) return;
- const { shouldWriteNativeEvents: t, performance: n } = e, i = {
- shouldWriteNativeEvents: t,
- performance: void 0,
- performanceTime: void 0
- };
- return typeof n.timeOrigin == "number" && typeof n.now == "function" && (i.performanceTime = n), i.performanceTime && typeof n.mark == "function" && typeof n.measure == "function" && typeof n.clearMarks == "function" && typeof n.clearMeasures == "function" && (i.performance = n), i;
- }
- var FX = u5e(), xme = FX?.performanceTime;
- function LX() {
- return FX;
- }
- var lo = xme ? () => xme.now() : Date.now, MX = {};
- La(MX, {
- clearMarks: () => wme,
- clearMeasures: () => Pme,
- createTimer: () => ER,
- createTimerIf: () => kme,
- disable: () => BX,
- enable: () => PR,
- forEachMark: () => Dme,
- forEachMeasure: () => DR,
- getCount: () => Eme,
- getDuration: () => BE,
- isEnabled: () => jX,
- mark: () => Ko,
- measure: () => rp,
- nullTimer: () => RX
- });
- var LE, W2;
- function kme(e, t, n, i) {
- return e ? ER(t, n, i) : RX;
- }
- function ER(e, t, n) {
- let i = 0;
- return {
- enter: s,
- exit: o
- };
- function s() {
- ++i === 1 && Ko(t);
- }
- function o() {
- --i === 0 ? (Ko(n), rp(e, t, n)) : i < 0 && E.fail("enter/exit count does not match.");
- }
- }
- var RX = { enter: ja, exit: ja }, ME = !1, Cme = lo(), RE = /* @__PURE__ */ new Map(), ow = /* @__PURE__ */ new Map(), jE = /* @__PURE__ */ new Map();
- function Ko(e) {
- if (ME) {
- const t = ow.get(e) ?? 0;
- ow.set(e, t + 1), RE.set(e, lo()), W2?.mark(e), typeof onProfilerEvent == "function" && onProfilerEvent(e);
- }
- }
- function rp(e, t, n) {
- if (ME) {
- const i = (n !== void 0 ? RE.get(n) : void 0) ?? lo(), s = (t !== void 0 ? RE.get(t) : void 0) ?? Cme, o = jE.get(e) || 0;
- jE.set(e, o + (i - s)), W2?.measure(e, t, n);
- }
- }
- function Eme(e) {
- return ow.get(e) || 0;
- }
- function BE(e) {
- return jE.get(e) || 0;
- }
- function DR(e) {
- jE.forEach((t, n) => e(n, t));
- }
- function Dme(e) {
- RE.forEach((t, n) => e(n));
- }
- function Pme(e) {
- e !== void 0 ? jE.delete(e) : jE.clear(), W2?.clearMeasures(e);
- }
- function wme(e) {
- e !== void 0 ? (ow.delete(e), RE.delete(e)) : (ow.clear(), RE.clear()), W2?.clearMarks(e);
- }
- function jX() {
- return ME;
- }
- function PR(e = ll) {
- var t;
- return ME || (ME = !0, LE || (LE = LX()), LE?.performance && (Cme = LE.performance.timeOrigin, (LE.shouldWriteNativeEvents || (t = e?.cpuProfilingEnabled) != null && t.call(e) || e?.debugMode) && (W2 = LE.performance))), !0;
- }
- function BX() {
- ME && (RE.clear(), ow.clear(), jE.clear(), W2 = void 0, ME = !1);
- }
- var rn, cw;
- ((e) => {
- let t, n = 0, i = 0, s;
- const o = [];
- let c;
- const _ = [];
- function u(X, q, V) {
- if (E.assert(!rn, "Tracing already started"), t === void 0)
- try {
- t = DE;
- } catch (re) {
- throw new Error(`tracing requires having fs
-(original error: ${re.message || re})`);
- }
- s = X, o.length = 0, c === void 0 && (c = Bn(q, "legend.json")), t.existsSync(q) || t.mkdirSync(q, { recursive: !0 });
- const ae = s === "build" ? `.${process.pid}-${++n}` : s === "server" ? `.${process.pid}` : "", ee = Bn(q, `trace${ae}.json`), G = Bn(q, `types${ae}.json`);
- _.push({
- configFilePath: V,
- tracePath: ee,
- typesPath: G
- }), i = t.openSync(ee, "w"), rn = e;
- const ue = { cat: "__metadata", ph: "M", ts: 1e3 * lo(), pid: 1, tid: 1 };
- t.writeSync(
- i,
- `[
-` + [{ name: "process_name", args: { name: "tsc" }, ...ue }, { name: "thread_name", args: { name: "Main" }, ...ue }, { name: "TracingStartedInBrowser", ...ue, cat: "disabled-by-default-devtools.timeline" }].map((re) => JSON.stringify(re)).join(`,
-`)
- );
- }
- e.startTracing = u;
- function d() {
- E.assert(rn, "Tracing is not in progress"), E.assert(!!o.length == (s !== "server")), t.writeSync(i, `
-]
-`), t.closeSync(i), rn = void 0, o.length ? B(o) : _[_.length - 1].typesPath = void 0;
- }
- e.stopTracing = d;
- function g(X) {
- s !== "server" && o.push(X);
- }
- e.recordType = g, ((X) => {
- X.Parse = "parse", X.Program = "program", X.Bind = "bind", X.Check = "check", X.CheckTypes = "checkTypes", X.Emit = "emit", X.Session = "session";
- })(e.Phase || (e.Phase = {}));
- function h(X, q, V) {
- F("I", X, q, V, '"s":"g"');
- }
- e.instant = h;
- const S = [];
- function T(X, q, V, ae = !1) {
- ae && F("B", X, q, V), S.push({ phase: X, name: q, args: V, time: 1e3 * lo(), separateBeginAndEnd: ae });
- }
- e.push = T;
- function C(X) {
- E.assert(S.length > 0), I(S.length - 1, 1e3 * lo(), X), S.length--;
- }
- e.pop = C;
- function D() {
- const X = 1e3 * lo();
- for (let q = S.length - 1; q >= 0; q--)
- I(q, X);
- S.length = 0;
- }
- e.popAll = D;
- const P = 1e3 * 10;
- function I(X, q, V) {
- const { phase: ae, name: ee, args: G, time: ue, separateBeginAndEnd: re } = S[X];
- re ? (E.assert(!V, "`results` are not supported for events with `separateBeginAndEnd`"), F(
- "E",
- ae,
- ee,
- G,
- /*extras*/
- void 0,
- q
- )) : P - ue % P <= q - ue && F("X", ae, ee, { ...G, results: V }, `"dur":${q - ue}`, ue);
- }
- function F(X, q, V, ae, ee, G = 1e3 * lo()) {
- s === "server" && q === "checkTypes" || (Ko("beginTracing"), t.writeSync(i, `,
-{"pid":1,"tid":1,"ph":"${X}","cat":"${q}","ts":${G},"name":"${V}"`), ee && t.writeSync(i, `,${ee}`), ae && t.writeSync(i, `,"args":${JSON.stringify(ae)}`), t.writeSync(i, "}"), Ko("endTracing"), rp("Tracing", "beginTracing", "endTracing"));
- }
- function O(X) {
- const q = Tr(X);
- return q ? {
- path: q.path,
- start: V(Qs(q, X.pos)),
- end: V(Qs(q, X.end))
- } : void 0;
- function V(ae) {
- return {
- line: ae.line + 1,
- character: ae.character + 1
- };
- }
- }
- function B(X) {
- var q, V, ae, ee, G, ue, re, ne, ie, Se, J, oe, _e, he, le, me, ve, tt, Te;
- Ko("beginDumpTypes");
- const we = _[_.length - 1].typesPath, fe = t.openSync(we, "w"), Me = /* @__PURE__ */ new Map();
- t.writeSync(fe, "[");
- const Qe = X.length;
- for (let et = 0; et < Qe; et++) {
- const Re = X[et], ft = Re.objectFlags, Wt = Re.aliasSymbol ?? Re.symbol;
- let _r;
- if (ft & 16 | Re.flags & 2944)
- try {
- _r = (q = Re.checker) == null ? void 0 : q.typeToString(Re);
- } catch {
- _r = void 0;
- }
- let Ir = {};
- if (Re.flags & 8388608) {
- const ei = Re;
- Ir = {
- indexedAccessObjectType: (V = ei.objectType) == null ? void 0 : V.id,
- indexedAccessIndexType: (ae = ei.indexType) == null ? void 0 : ae.id
- };
- }
- let jr = {};
- if (ft & 4) {
- const ei = Re;
- jr = {
- instantiatedType: (ee = ei.target) == null ? void 0 : ee.id,
- typeArguments: (G = ei.resolvedTypeArguments) == null ? void 0 : G.map((Ri) => Ri.id),
- referenceLocation: O(ei.node)
- };
- }
- let Nt = {};
- if (Re.flags & 16777216) {
- const ei = Re;
- Nt = {
- conditionalCheckType: (ue = ei.checkType) == null ? void 0 : ue.id,
- conditionalExtendsType: (re = ei.extendsType) == null ? void 0 : re.id,
- conditionalTrueType: ((ne = ei.resolvedTrueType) == null ? void 0 : ne.id) ?? -1,
- conditionalFalseType: ((ie = ei.resolvedFalseType) == null ? void 0 : ie.id) ?? -1
- };
- }
- let Qt = {};
- if (Re.flags & 33554432) {
- const ei = Re;
- Qt = {
- substitutionBaseType: (Se = ei.baseType) == null ? void 0 : Se.id,
- constraintType: (J = ei.constraint) == null ? void 0 : J.id
- };
- }
- let Br = {};
- if (ft & 1024) {
- const ei = Re;
- Br = {
- reverseMappedSourceType: (oe = ei.source) == null ? void 0 : oe.id,
- reverseMappedMappedType: (_e = ei.mappedType) == null ? void 0 : _e.id,
- reverseMappedConstraintType: (he = ei.constraintType) == null ? void 0 : he.id
- };
- }
- let xr = {};
- if (ft & 256) {
- const ei = Re;
- xr = {
- evolvingArrayElementType: ei.elementType.id,
- evolvingArrayFinalType: (le = ei.finalArrayType) == null ? void 0 : le.id
- };
- }
- let zn;
- const ki = Re.checker.getRecursionIdentity(Re);
- ki && (zn = Me.get(ki), zn || (zn = Me.size, Me.set(ki, zn)));
- const rs = {
- id: Re.id,
- intrinsicName: Re.intrinsicName,
- symbolName: Wt?.escapedName && Ei(Wt.escapedName),
- recursionId: zn,
- isTuple: ft & 8 ? !0 : void 0,
- unionTypes: Re.flags & 1048576 ? (me = Re.types) == null ? void 0 : me.map((ei) => ei.id) : void 0,
- intersectionTypes: Re.flags & 2097152 ? Re.types.map((ei) => ei.id) : void 0,
- aliasTypeArguments: (ve = Re.aliasTypeArguments) == null ? void 0 : ve.map((ei) => ei.id),
- keyofType: Re.flags & 4194304 ? (tt = Re.type) == null ? void 0 : tt.id : void 0,
- ...Ir,
- ...jr,
- ...Nt,
- ...Qt,
- ...Br,
- ...xr,
- destructuringPattern: O(Re.pattern),
- firstDeclaration: O((Te = Wt?.declarations) == null ? void 0 : Te[0]),
- flags: E.formatTypeFlags(Re.flags).split("|"),
- display: _r
- };
- t.writeSync(fe, JSON.stringify(rs)), et < Qe - 1 && t.writeSync(fe, `,
-`);
- }
- t.writeSync(fe, `]
-`), t.closeSync(fe), Ko("endDumpTypes"), rp("Dump types", "beginDumpTypes", "endDumpTypes");
- }
- function z() {
- c && t.writeFileSync(c, JSON.stringify(_));
- }
- e.dumpLegend = z;
- })(cw || (cw = {}));
- var JX = cw.startTracing, zX = cw.dumpLegend, wR = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EndOfFileToken = 1] = "EndOfFileToken", e[e.SingleLineCommentTrivia = 2] = "SingleLineCommentTrivia", e[e.MultiLineCommentTrivia = 3] = "MultiLineCommentTrivia", e[e.NewLineTrivia = 4] = "NewLineTrivia", e[e.WhitespaceTrivia = 5] = "WhitespaceTrivia", e[e.ShebangTrivia = 6] = "ShebangTrivia", e[e.ConflictMarkerTrivia = 7] = "ConflictMarkerTrivia", e[e.NonTextFileMarkerTrivia = 8] = "NonTextFileMarkerTrivia", e[e.NumericLiteral = 9] = "NumericLiteral", e[e.BigIntLiteral = 10] = "BigIntLiteral", e[e.StringLiteral = 11] = "StringLiteral", e[e.JsxText = 12] = "JsxText", e[e.JsxTextAllWhiteSpaces = 13] = "JsxTextAllWhiteSpaces", e[e.RegularExpressionLiteral = 14] = "RegularExpressionLiteral", e[e.NoSubstitutionTemplateLiteral = 15] = "NoSubstitutionTemplateLiteral", e[e.TemplateHead = 16] = "TemplateHead", e[e.TemplateMiddle = 17] = "TemplateMiddle", e[e.TemplateTail = 18] = "TemplateTail", e[e.OpenBraceToken = 19] = "OpenBraceToken", e[e.CloseBraceToken = 20] = "CloseBraceToken", e[e.OpenParenToken = 21] = "OpenParenToken", e[e.CloseParenToken = 22] = "CloseParenToken", e[e.OpenBracketToken = 23] = "OpenBracketToken", e[e.CloseBracketToken = 24] = "CloseBracketToken", e[e.DotToken = 25] = "DotToken", e[e.DotDotDotToken = 26] = "DotDotDotToken", e[e.SemicolonToken = 27] = "SemicolonToken", e[e.CommaToken = 28] = "CommaToken", e[e.QuestionDotToken = 29] = "QuestionDotToken", e[e.LessThanToken = 30] = "LessThanToken", e[e.LessThanSlashToken = 31] = "LessThanSlashToken", e[e.GreaterThanToken = 32] = "GreaterThanToken", e[e.LessThanEqualsToken = 33] = "LessThanEqualsToken", e[e.GreaterThanEqualsToken = 34] = "GreaterThanEqualsToken", e[e.EqualsEqualsToken = 35] = "EqualsEqualsToken", e[e.ExclamationEqualsToken = 36] = "ExclamationEqualsToken", e[e.EqualsEqualsEqualsToken = 37] = "EqualsEqualsEqualsToken", e[e.ExclamationEqualsEqualsToken = 38] = "ExclamationEqualsEqualsToken", e[e.EqualsGreaterThanToken = 39] = "EqualsGreaterThanToken", e[e.PlusToken = 40] = "PlusToken", e[e.MinusToken = 41] = "MinusToken", e[e.AsteriskToken = 42] = "AsteriskToken", e[e.AsteriskAsteriskToken = 43] = "AsteriskAsteriskToken", e[e.SlashToken = 44] = "SlashToken", e[e.PercentToken = 45] = "PercentToken", e[e.PlusPlusToken = 46] = "PlusPlusToken", e[e.MinusMinusToken = 47] = "MinusMinusToken", e[e.LessThanLessThanToken = 48] = "LessThanLessThanToken", e[e.GreaterThanGreaterThanToken = 49] = "GreaterThanGreaterThanToken", e[e.GreaterThanGreaterThanGreaterThanToken = 50] = "GreaterThanGreaterThanGreaterThanToken", e[e.AmpersandToken = 51] = "AmpersandToken", e[e.BarToken = 52] = "BarToken", e[e.CaretToken = 53] = "CaretToken", e[e.ExclamationToken = 54] = "ExclamationToken", e[e.TildeToken = 55] = "TildeToken", e[e.AmpersandAmpersandToken = 56] = "AmpersandAmpersandToken", e[e.BarBarToken = 57] = "BarBarToken", e[e.QuestionToken = 58] = "QuestionToken", e[e.ColonToken = 59] = "ColonToken", e[e.AtToken = 60] = "AtToken", e[e.QuestionQuestionToken = 61] = "QuestionQuestionToken", e[e.BacktickToken = 62] = "BacktickToken", e[e.HashToken = 63] = "HashToken", e[e.EqualsToken = 64] = "EqualsToken", e[e.PlusEqualsToken = 65] = "PlusEqualsToken", e[e.MinusEqualsToken = 66] = "MinusEqualsToken", e[e.AsteriskEqualsToken = 67] = "AsteriskEqualsToken", e[e.AsteriskAsteriskEqualsToken = 68] = "AsteriskAsteriskEqualsToken", e[e.SlashEqualsToken = 69] = "SlashEqualsToken", e[e.PercentEqualsToken = 70] = "PercentEqualsToken", e[e.LessThanLessThanEqualsToken = 71] = "LessThanLessThanEqualsToken", e[e.GreaterThanGreaterThanEqualsToken = 72] = "GreaterThanGreaterThanEqualsToken", e[e.GreaterThanGreaterThanGreaterThanEqualsToken = 73] = "GreaterThanGreaterThanGreaterThanEqualsToken", e[e.AmpersandEqualsToken = 74] = "AmpersandEqualsToken", e[e.BarEqualsToken = 75] = "BarEqualsToken", e[e.BarBarEqualsToken = 76] = "BarBarEqualsToken", e[e.AmpersandAmpersandEqualsToken = 77] = "AmpersandAmpersandEqualsToken", e[e.QuestionQuestionEqualsToken = 78] = "QuestionQuestionEqualsToken", e[e.CaretEqualsToken = 79] = "CaretEqualsToken", e[e.Identifier = 80] = "Identifier", e[e.PrivateIdentifier = 81] = "PrivateIdentifier", e[e.JSDocCommentTextToken = 82] = "JSDocCommentTextToken", e[e.BreakKeyword = 83] = "BreakKeyword", e[e.CaseKeyword = 84] = "CaseKeyword", e[e.CatchKeyword = 85] = "CatchKeyword", e[e.ClassKeyword = 86] = "ClassKeyword", e[e.ConstKeyword = 87] = "ConstKeyword", e[e.ContinueKeyword = 88] = "ContinueKeyword", e[e.DebuggerKeyword = 89] = "DebuggerKeyword", e[e.DefaultKeyword = 90] = "DefaultKeyword", e[e.DeleteKeyword = 91] = "DeleteKeyword", e[e.DoKeyword = 92] = "DoKeyword", e[e.ElseKeyword = 93] = "ElseKeyword", e[e.EnumKeyword = 94] = "EnumKeyword", e[e.ExportKeyword = 95] = "ExportKeyword", e[e.ExtendsKeyword = 96] = "ExtendsKeyword", e[e.FalseKeyword = 97] = "FalseKeyword", e[e.FinallyKeyword = 98] = "FinallyKeyword", e[e.ForKeyword = 99] = "ForKeyword", e[e.FunctionKeyword = 100] = "FunctionKeyword", e[e.IfKeyword = 101] = "IfKeyword", e[e.ImportKeyword = 102] = "ImportKeyword", e[e.InKeyword = 103] = "InKeyword", e[e.InstanceOfKeyword = 104] = "InstanceOfKeyword", e[e.NewKeyword = 105] = "NewKeyword", e[e.NullKeyword = 106] = "NullKeyword", e[e.ReturnKeyword = 107] = "ReturnKeyword", e[e.SuperKeyword = 108] = "SuperKeyword", e[e.SwitchKeyword = 109] = "SwitchKeyword", e[e.ThisKeyword = 110] = "ThisKeyword", e[e.ThrowKeyword = 111] = "ThrowKeyword", e[e.TrueKeyword = 112] = "TrueKeyword", e[e.TryKeyword = 113] = "TryKeyword", e[e.TypeOfKeyword = 114] = "TypeOfKeyword", e[e.VarKeyword = 115] = "VarKeyword", e[e.VoidKeyword = 116] = "VoidKeyword", e[e.WhileKeyword = 117] = "WhileKeyword", e[e.WithKeyword = 118] = "WithKeyword", e[e.ImplementsKeyword = 119] = "ImplementsKeyword", e[e.InterfaceKeyword = 120] = "InterfaceKeyword", e[e.LetKeyword = 121] = "LetKeyword", e[e.PackageKeyword = 122] = "PackageKeyword", e[e.PrivateKeyword = 123] = "PrivateKeyword", e[e.ProtectedKeyword = 124] = "ProtectedKeyword", e[e.PublicKeyword = 125] = "PublicKeyword", e[e.StaticKeyword = 126] = "StaticKeyword", e[e.YieldKeyword = 127] = "YieldKeyword", e[e.AbstractKeyword = 128] = "AbstractKeyword", e[e.AccessorKeyword = 129] = "AccessorKeyword", e[e.AsKeyword = 130] = "AsKeyword", e[e.AssertsKeyword = 131] = "AssertsKeyword", e[e.AssertKeyword = 132] = "AssertKeyword", e[e.AnyKeyword = 133] = "AnyKeyword", e[e.AsyncKeyword = 134] = "AsyncKeyword", e[e.AwaitKeyword = 135] = "AwaitKeyword", e[e.BooleanKeyword = 136] = "BooleanKeyword", e[e.ConstructorKeyword = 137] = "ConstructorKeyword", e[e.DeclareKeyword = 138] = "DeclareKeyword", e[e.GetKeyword = 139] = "GetKeyword", e[e.InferKeyword = 140] = "InferKeyword", e[e.IntrinsicKeyword = 141] = "IntrinsicKeyword", e[e.IsKeyword = 142] = "IsKeyword", e[e.KeyOfKeyword = 143] = "KeyOfKeyword", e[e.ModuleKeyword = 144] = "ModuleKeyword", e[e.NamespaceKeyword = 145] = "NamespaceKeyword", e[e.NeverKeyword = 146] = "NeverKeyword", e[e.OutKeyword = 147] = "OutKeyword", e[e.ReadonlyKeyword = 148] = "ReadonlyKeyword", e[e.RequireKeyword = 149] = "RequireKeyword", e[e.NumberKeyword = 150] = "NumberKeyword", e[e.ObjectKeyword = 151] = "ObjectKeyword", e[e.SatisfiesKeyword = 152] = "SatisfiesKeyword", e[e.SetKeyword = 153] = "SetKeyword", e[e.StringKeyword = 154] = "StringKeyword", e[e.SymbolKeyword = 155] = "SymbolKeyword", e[e.TypeKeyword = 156] = "TypeKeyword", e[e.UndefinedKeyword = 157] = "UndefinedKeyword", e[e.UniqueKeyword = 158] = "UniqueKeyword", e[e.UnknownKeyword = 159] = "UnknownKeyword", e[e.UsingKeyword = 160] = "UsingKeyword", e[e.FromKeyword = 161] = "FromKeyword", e[e.GlobalKeyword = 162] = "GlobalKeyword", e[e.BigIntKeyword = 163] = "BigIntKeyword", e[e.OverrideKeyword = 164] = "OverrideKeyword", e[e.OfKeyword = 165] = "OfKeyword", e[e.QualifiedName = 166] = "QualifiedName", e[e.ComputedPropertyName = 167] = "ComputedPropertyName", e[e.TypeParameter = 168] = "TypeParameter", e[e.Parameter = 169] = "Parameter", e[e.Decorator = 170] = "Decorator", e[e.PropertySignature = 171] = "PropertySignature", e[e.PropertyDeclaration = 172] = "PropertyDeclaration", e[e.MethodSignature = 173] = "MethodSignature", e[e.MethodDeclaration = 174] = "MethodDeclaration", e[e.ClassStaticBlockDeclaration = 175] = "ClassStaticBlockDeclaration", e[e.Constructor = 176] = "Constructor", e[e.GetAccessor = 177] = "GetAccessor", e[e.SetAccessor = 178] = "SetAccessor", e[e.CallSignature = 179] = "CallSignature", e[e.ConstructSignature = 180] = "ConstructSignature", e[e.IndexSignature = 181] = "IndexSignature", e[e.TypePredicate = 182] = "TypePredicate", e[e.TypeReference = 183] = "TypeReference", e[e.FunctionType = 184] = "FunctionType", e[e.ConstructorType = 185] = "ConstructorType", e[e.TypeQuery = 186] = "TypeQuery", e[e.TypeLiteral = 187] = "TypeLiteral", e[e.ArrayType = 188] = "ArrayType", e[e.TupleType = 189] = "TupleType", e[e.OptionalType = 190] = "OptionalType", e[e.RestType = 191] = "RestType", e[e.UnionType = 192] = "UnionType", e[e.IntersectionType = 193] = "IntersectionType", e[e.ConditionalType = 194] = "ConditionalType", e[e.InferType = 195] = "InferType", e[e.ParenthesizedType = 196] = "ParenthesizedType", e[e.ThisType = 197] = "ThisType", e[e.TypeOperator = 198] = "TypeOperator", e[e.IndexedAccessType = 199] = "IndexedAccessType", e[e.MappedType = 200] = "MappedType", e[e.LiteralType = 201] = "LiteralType", e[e.NamedTupleMember = 202] = "NamedTupleMember", e[e.TemplateLiteralType = 203] = "TemplateLiteralType", e[e.TemplateLiteralTypeSpan = 204] = "TemplateLiteralTypeSpan", e[e.ImportType = 205] = "ImportType", e[e.ObjectBindingPattern = 206] = "ObjectBindingPattern", e[e.ArrayBindingPattern = 207] = "ArrayBindingPattern", e[e.BindingElement = 208] = "BindingElement", e[e.ArrayLiteralExpression = 209] = "ArrayLiteralExpression", e[e.ObjectLiteralExpression = 210] = "ObjectLiteralExpression", e[e.PropertyAccessExpression = 211] = "PropertyAccessExpression", e[e.ElementAccessExpression = 212] = "ElementAccessExpression", e[e.CallExpression = 213] = "CallExpression", e[e.NewExpression = 214] = "NewExpression", e[e.TaggedTemplateExpression = 215] = "TaggedTemplateExpression", e[e.TypeAssertionExpression = 216] = "TypeAssertionExpression", e[e.ParenthesizedExpression = 217] = "ParenthesizedExpression", e[e.FunctionExpression = 218] = "FunctionExpression", e[e.ArrowFunction = 219] = "ArrowFunction", e[e.DeleteExpression = 220] = "DeleteExpression", e[e.TypeOfExpression = 221] = "TypeOfExpression", e[e.VoidExpression = 222] = "VoidExpression", e[e.AwaitExpression = 223] = "AwaitExpression", e[e.PrefixUnaryExpression = 224] = "PrefixUnaryExpression", e[e.PostfixUnaryExpression = 225] = "PostfixUnaryExpression", e[e.BinaryExpression = 226] = "BinaryExpression", e[e.ConditionalExpression = 227] = "ConditionalExpression", e[e.TemplateExpression = 228] = "TemplateExpression", e[e.YieldExpression = 229] = "YieldExpression", e[e.SpreadElement = 230] = "SpreadElement", e[e.ClassExpression = 231] = "ClassExpression", e[e.OmittedExpression = 232] = "OmittedExpression", e[e.ExpressionWithTypeArguments = 233] = "ExpressionWithTypeArguments", e[e.AsExpression = 234] = "AsExpression", e[e.NonNullExpression = 235] = "NonNullExpression", e[e.MetaProperty = 236] = "MetaProperty", e[e.SyntheticExpression = 237] = "SyntheticExpression", e[e.SatisfiesExpression = 238] = "SatisfiesExpression", e[e.TemplateSpan = 239] = "TemplateSpan", e[e.SemicolonClassElement = 240] = "SemicolonClassElement", e[e.Block = 241] = "Block", e[e.EmptyStatement = 242] = "EmptyStatement", e[e.VariableStatement = 243] = "VariableStatement", e[e.ExpressionStatement = 244] = "ExpressionStatement", e[e.IfStatement = 245] = "IfStatement", e[e.DoStatement = 246] = "DoStatement", e[e.WhileStatement = 247] = "WhileStatement", e[e.ForStatement = 248] = "ForStatement", e[e.ForInStatement = 249] = "ForInStatement", e[e.ForOfStatement = 250] = "ForOfStatement", e[e.ContinueStatement = 251] = "ContinueStatement", e[e.BreakStatement = 252] = "BreakStatement", e[e.ReturnStatement = 253] = "ReturnStatement", e[e.WithStatement = 254] = "WithStatement", e[e.SwitchStatement = 255] = "SwitchStatement", e[e.LabeledStatement = 256] = "LabeledStatement", e[e.ThrowStatement = 257] = "ThrowStatement", e[e.TryStatement = 258] = "TryStatement", e[e.DebuggerStatement = 259] = "DebuggerStatement", e[e.VariableDeclaration = 260] = "VariableDeclaration", e[e.VariableDeclarationList = 261] = "VariableDeclarationList", e[e.FunctionDeclaration = 262] = "FunctionDeclaration", e[e.ClassDeclaration = 263] = "ClassDeclaration", e[e.InterfaceDeclaration = 264] = "InterfaceDeclaration", e[e.TypeAliasDeclaration = 265] = "TypeAliasDeclaration", e[e.EnumDeclaration = 266] = "EnumDeclaration", e[e.ModuleDeclaration = 267] = "ModuleDeclaration", e[e.ModuleBlock = 268] = "ModuleBlock", e[e.CaseBlock = 269] = "CaseBlock", e[e.NamespaceExportDeclaration = 270] = "NamespaceExportDeclaration", e[e.ImportEqualsDeclaration = 271] = "ImportEqualsDeclaration", e[e.ImportDeclaration = 272] = "ImportDeclaration", e[e.ImportClause = 273] = "ImportClause", e[e.NamespaceImport = 274] = "NamespaceImport", e[e.NamedImports = 275] = "NamedImports", e[e.ImportSpecifier = 276] = "ImportSpecifier", e[e.ExportAssignment = 277] = "ExportAssignment", e[e.ExportDeclaration = 278] = "ExportDeclaration", e[e.NamedExports = 279] = "NamedExports", e[e.NamespaceExport = 280] = "NamespaceExport", e[e.ExportSpecifier = 281] = "ExportSpecifier", e[e.MissingDeclaration = 282] = "MissingDeclaration", e[e.ExternalModuleReference = 283] = "ExternalModuleReference", e[e.JsxElement = 284] = "JsxElement", e[e.JsxSelfClosingElement = 285] = "JsxSelfClosingElement", e[e.JsxOpeningElement = 286] = "JsxOpeningElement", e[e.JsxClosingElement = 287] = "JsxClosingElement", e[e.JsxFragment = 288] = "JsxFragment", e[e.JsxOpeningFragment = 289] = "JsxOpeningFragment", e[e.JsxClosingFragment = 290] = "JsxClosingFragment", e[e.JsxAttribute = 291] = "JsxAttribute", e[e.JsxAttributes = 292] = "JsxAttributes", e[e.JsxSpreadAttribute = 293] = "JsxSpreadAttribute", e[e.JsxExpression = 294] = "JsxExpression", e[e.JsxNamespacedName = 295] = "JsxNamespacedName", e[e.CaseClause = 296] = "CaseClause", e[e.DefaultClause = 297] = "DefaultClause", e[e.HeritageClause = 298] = "HeritageClause", e[e.CatchClause = 299] = "CatchClause", e[e.ImportAttributes = 300] = "ImportAttributes", e[e.ImportAttribute = 301] = "ImportAttribute", e[
- e.AssertClause = 300
- /* ImportAttributes */
- ] = "AssertClause", e[
- e.AssertEntry = 301
- /* ImportAttribute */
- ] = "AssertEntry", e[e.ImportTypeAssertionContainer = 302] = "ImportTypeAssertionContainer", e[e.PropertyAssignment = 303] = "PropertyAssignment", e[e.ShorthandPropertyAssignment = 304] = "ShorthandPropertyAssignment", e[e.SpreadAssignment = 305] = "SpreadAssignment", e[e.EnumMember = 306] = "EnumMember", e[e.SourceFile = 307] = "SourceFile", e[e.Bundle = 308] = "Bundle", e[e.JSDocTypeExpression = 309] = "JSDocTypeExpression", e[e.JSDocNameReference = 310] = "JSDocNameReference", e[e.JSDocMemberName = 311] = "JSDocMemberName", e[e.JSDocAllType = 312] = "JSDocAllType", e[e.JSDocUnknownType = 313] = "JSDocUnknownType", e[e.JSDocNullableType = 314] = "JSDocNullableType", e[e.JSDocNonNullableType = 315] = "JSDocNonNullableType", e[e.JSDocOptionalType = 316] = "JSDocOptionalType", e[e.JSDocFunctionType = 317] = "JSDocFunctionType", e[e.JSDocVariadicType = 318] = "JSDocVariadicType", e[e.JSDocNamepathType = 319] = "JSDocNamepathType", e[e.JSDoc = 320] = "JSDoc", e[
- e.JSDocComment = 320
- /* JSDoc */
- ] = "JSDocComment", e[e.JSDocText = 321] = "JSDocText", e[e.JSDocTypeLiteral = 322] = "JSDocTypeLiteral", e[e.JSDocSignature = 323] = "JSDocSignature", e[e.JSDocLink = 324] = "JSDocLink", e[e.JSDocLinkCode = 325] = "JSDocLinkCode", e[e.JSDocLinkPlain = 326] = "JSDocLinkPlain", e[e.JSDocTag = 327] = "JSDocTag", e[e.JSDocAugmentsTag = 328] = "JSDocAugmentsTag", e[e.JSDocImplementsTag = 329] = "JSDocImplementsTag", e[e.JSDocAuthorTag = 330] = "JSDocAuthorTag", e[e.JSDocDeprecatedTag = 331] = "JSDocDeprecatedTag", e[e.JSDocClassTag = 332] = "JSDocClassTag", e[e.JSDocPublicTag = 333] = "JSDocPublicTag", e[e.JSDocPrivateTag = 334] = "JSDocPrivateTag", e[e.JSDocProtectedTag = 335] = "JSDocProtectedTag", e[e.JSDocReadonlyTag = 336] = "JSDocReadonlyTag", e[e.JSDocOverrideTag = 337] = "JSDocOverrideTag", e[e.JSDocCallbackTag = 338] = "JSDocCallbackTag", e[e.JSDocOverloadTag = 339] = "JSDocOverloadTag", e[e.JSDocEnumTag = 340] = "JSDocEnumTag", e[e.JSDocParameterTag = 341] = "JSDocParameterTag", e[e.JSDocReturnTag = 342] = "JSDocReturnTag", e[e.JSDocThisTag = 343] = "JSDocThisTag", e[e.JSDocTypeTag = 344] = "JSDocTypeTag", e[e.JSDocTemplateTag = 345] = "JSDocTemplateTag", e[e.JSDocTypedefTag = 346] = "JSDocTypedefTag", e[e.JSDocSeeTag = 347] = "JSDocSeeTag", e[e.JSDocPropertyTag = 348] = "JSDocPropertyTag", e[e.JSDocThrowsTag = 349] = "JSDocThrowsTag", e[e.JSDocSatisfiesTag = 350] = "JSDocSatisfiesTag", e[e.JSDocImportTag = 351] = "JSDocImportTag", e[e.SyntaxList = 352] = "SyntaxList", e[e.NotEmittedStatement = 353] = "NotEmittedStatement", e[e.PartiallyEmittedExpression = 354] = "PartiallyEmittedExpression", e[e.CommaListExpression = 355] = "CommaListExpression", e[e.SyntheticReferenceExpression = 356] = "SyntheticReferenceExpression", e[e.Count = 357] = "Count", e[
- e.FirstAssignment = 64
- /* EqualsToken */
- ] = "FirstAssignment", e[
- e.LastAssignment = 79
- /* CaretEqualsToken */
- ] = "LastAssignment", e[
- e.FirstCompoundAssignment = 65
- /* PlusEqualsToken */
- ] = "FirstCompoundAssignment", e[
- e.LastCompoundAssignment = 79
- /* CaretEqualsToken */
- ] = "LastCompoundAssignment", e[
- e.FirstReservedWord = 83
- /* BreakKeyword */
- ] = "FirstReservedWord", e[
- e.LastReservedWord = 118
- /* WithKeyword */
- ] = "LastReservedWord", e[
- e.FirstKeyword = 83
- /* BreakKeyword */
- ] = "FirstKeyword", e[
- e.LastKeyword = 165
- /* OfKeyword */
- ] = "LastKeyword", e[
- e.FirstFutureReservedWord = 119
- /* ImplementsKeyword */
- ] = "FirstFutureReservedWord", e[
- e.LastFutureReservedWord = 127
- /* YieldKeyword */
- ] = "LastFutureReservedWord", e[
- e.FirstTypeNode = 182
- /* TypePredicate */
- ] = "FirstTypeNode", e[
- e.LastTypeNode = 205
- /* ImportType */
- ] = "LastTypeNode", e[
- e.FirstPunctuation = 19
- /* OpenBraceToken */
- ] = "FirstPunctuation", e[
- e.LastPunctuation = 79
- /* CaretEqualsToken */
- ] = "LastPunctuation", e[
- e.FirstToken = 0
- /* Unknown */
- ] = "FirstToken", e[
- e.LastToken = 165
- /* LastKeyword */
- ] = "LastToken", e[
- e.FirstTriviaToken = 2
- /* SingleLineCommentTrivia */
- ] = "FirstTriviaToken", e[
- e.LastTriviaToken = 7
- /* ConflictMarkerTrivia */
- ] = "LastTriviaToken", e[
- e.FirstLiteralToken = 9
- /* NumericLiteral */
- ] = "FirstLiteralToken", e[
- e.LastLiteralToken = 15
- /* NoSubstitutionTemplateLiteral */
- ] = "LastLiteralToken", e[
- e.FirstTemplateToken = 15
- /* NoSubstitutionTemplateLiteral */
- ] = "FirstTemplateToken", e[
- e.LastTemplateToken = 18
- /* TemplateTail */
- ] = "LastTemplateToken", e[
- e.FirstBinaryOperator = 30
- /* LessThanToken */
- ] = "FirstBinaryOperator", e[
- e.LastBinaryOperator = 79
- /* CaretEqualsToken */
- ] = "LastBinaryOperator", e[
- e.FirstStatement = 243
- /* VariableStatement */
- ] = "FirstStatement", e[
- e.LastStatement = 259
- /* DebuggerStatement */
- ] = "LastStatement", e[
- e.FirstNode = 166
- /* QualifiedName */
- ] = "FirstNode", e[
- e.FirstJSDocNode = 309
- /* JSDocTypeExpression */
- ] = "FirstJSDocNode", e[
- e.LastJSDocNode = 351
- /* JSDocImportTag */
- ] = "LastJSDocNode", e[
- e.FirstJSDocTagNode = 327
- /* JSDocTag */
- ] = "FirstJSDocTagNode", e[
- e.LastJSDocTagNode = 351
- /* JSDocImportTag */
- ] = "LastJSDocTagNode", e[
- e.FirstContextualKeyword = 128
- /* AbstractKeyword */
- ] = "FirstContextualKeyword", e[
- e.LastContextualKeyword = 165
- /* OfKeyword */
- ] = "LastContextualKeyword", e))(wR || {}), AR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Let = 1] = "Let", e[e.Const = 2] = "Const", e[e.Using = 4] = "Using", e[e.AwaitUsing = 6] = "AwaitUsing", e[e.NestedNamespace = 8] = "NestedNamespace", e[e.Synthesized = 16] = "Synthesized", e[e.Namespace = 32] = "Namespace", e[e.OptionalChain = 64] = "OptionalChain", e[e.ExportContext = 128] = "ExportContext", e[e.ContainsThis = 256] = "ContainsThis", e[e.HasImplicitReturn = 512] = "HasImplicitReturn", e[e.HasExplicitReturn = 1024] = "HasExplicitReturn", e[e.GlobalAugmentation = 2048] = "GlobalAugmentation", e[e.HasAsyncFunctions = 4096] = "HasAsyncFunctions", e[e.DisallowInContext = 8192] = "DisallowInContext", e[e.YieldContext = 16384] = "YieldContext", e[e.DecoratorContext = 32768] = "DecoratorContext", e[e.AwaitContext = 65536] = "AwaitContext", e[e.DisallowConditionalTypesContext = 131072] = "DisallowConditionalTypesContext", e[e.ThisNodeHasError = 262144] = "ThisNodeHasError", e[e.JavaScriptFile = 524288] = "JavaScriptFile", e[e.ThisNodeOrAnySubNodesHasError = 1048576] = "ThisNodeOrAnySubNodesHasError", e[e.HasAggregatedChildData = 2097152] = "HasAggregatedChildData", e[e.PossiblyContainsDynamicImport = 4194304] = "PossiblyContainsDynamicImport", e[e.PossiblyContainsImportMeta = 8388608] = "PossiblyContainsImportMeta", e[e.JSDoc = 16777216] = "JSDoc", e[e.Ambient = 33554432] = "Ambient", e[e.InWithStatement = 67108864] = "InWithStatement", e[e.JsonFile = 134217728] = "JsonFile", e[e.TypeCached = 268435456] = "TypeCached", e[e.Deprecated = 536870912] = "Deprecated", e[e.BlockScoped = 7] = "BlockScoped", e[e.Constant = 6] = "Constant", e[e.ReachabilityCheckFlags = 1536] = "ReachabilityCheckFlags", e[e.ReachabilityAndEmitFlags = 5632] = "ReachabilityAndEmitFlags", e[e.ContextFlags = 101441536] = "ContextFlags", e[e.TypeExcludesFlags = 81920] = "TypeExcludesFlags", e[e.PermanentlySetIncrementalFlags = 12582912] = "PermanentlySetIncrementalFlags", e[
- e.IdentifierHasExtendedUnicodeEscape = 256
- /* ContainsThis */
- ] = "IdentifierHasExtendedUnicodeEscape", e[
- e.IdentifierIsInJSDocNamespace = 4096
- /* HasAsyncFunctions */
- ] = "IdentifierIsInJSDocNamespace", e))(AR || {}), NR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Public = 1] = "Public", e[e.Private = 2] = "Private", e[e.Protected = 4] = "Protected", e[e.Readonly = 8] = "Readonly", e[e.Override = 16] = "Override", e[e.Export = 32] = "Export", e[e.Abstract = 64] = "Abstract", e[e.Ambient = 128] = "Ambient", e[e.Static = 256] = "Static", e[e.Accessor = 512] = "Accessor", e[e.Async = 1024] = "Async", e[e.Default = 2048] = "Default", e[e.Const = 4096] = "Const", e[e.In = 8192] = "In", e[e.Out = 16384] = "Out", e[e.Decorator = 32768] = "Decorator", e[e.Deprecated = 65536] = "Deprecated", e[e.JSDocPublic = 8388608] = "JSDocPublic", e[e.JSDocPrivate = 16777216] = "JSDocPrivate", e[e.JSDocProtected = 33554432] = "JSDocProtected", e[e.JSDocReadonly = 67108864] = "JSDocReadonly", e[e.JSDocOverride = 134217728] = "JSDocOverride", e[e.SyntacticOrJSDocModifiers = 31] = "SyntacticOrJSDocModifiers", e[e.SyntacticOnlyModifiers = 65504] = "SyntacticOnlyModifiers", e[e.SyntacticModifiers = 65535] = "SyntacticModifiers", e[e.JSDocCacheOnlyModifiers = 260046848] = "JSDocCacheOnlyModifiers", e[
- e.JSDocOnlyModifiers = 65536
- /* Deprecated */
- ] = "JSDocOnlyModifiers", e[e.NonCacheOnlyModifiers = 131071] = "NonCacheOnlyModifiers", e[e.HasComputedJSDocModifiers = 268435456] = "HasComputedJSDocModifiers", e[e.HasComputedFlags = 536870912] = "HasComputedFlags", e[e.AccessibilityModifier = 7] = "AccessibilityModifier", e[e.ParameterPropertyModifier = 31] = "ParameterPropertyModifier", e[e.NonPublicAccessibilityModifier = 6] = "NonPublicAccessibilityModifier", e[e.TypeScriptModifier = 28895] = "TypeScriptModifier", e[e.ExportDefault = 2080] = "ExportDefault", e[e.All = 131071] = "All", e[e.Modifier = 98303] = "Modifier", e))(NR || {}), WX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.IntrinsicNamedElement = 1] = "IntrinsicNamedElement", e[e.IntrinsicIndexedElement = 2] = "IntrinsicIndexedElement", e[e.IntrinsicElement = 3] = "IntrinsicElement", e))(WX || {}), IR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Succeeded = 1] = "Succeeded", e[e.Failed = 2] = "Failed", e[e.ReportsUnmeasurable = 8] = "ReportsUnmeasurable", e[e.ReportsUnreliable = 16] = "ReportsUnreliable", e[e.ReportsMask = 24] = "ReportsMask", e[e.ComplexityOverflow = 32] = "ComplexityOverflow", e[e.StackDepthOverflow = 64] = "StackDepthOverflow", e[e.Overflow = 96] = "Overflow", e))(IR || {}), UX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Always = 1] = "Always", e[e.Never = 2] = "Never", e[e.Sometimes = 3] = "Sometimes", e))(UX || {}), OR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Auto = 1] = "Auto", e[e.Loop = 2] = "Loop", e[e.Unique = 3] = "Unique", e[e.Node = 4] = "Node", e[e.KindMask = 7] = "KindMask", e[e.ReservedInNestedScopes = 8] = "ReservedInNestedScopes", e[e.Optimistic = 16] = "Optimistic", e[e.FileLevel = 32] = "FileLevel", e[e.AllowNameSubstitution = 64] = "AllowNameSubstitution", e))(OR || {}), VX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.HasIndices = 1] = "HasIndices", e[e.Global = 2] = "Global", e[e.IgnoreCase = 4] = "IgnoreCase", e[e.Multiline = 8] = "Multiline", e[e.DotAll = 16] = "DotAll", e[e.Unicode = 32] = "Unicode", e[e.UnicodeSets = 64] = "UnicodeSets", e[e.Sticky = 128] = "Sticky", e[e.AnyUnicodeMode = 96] = "AnyUnicodeMode", e[e.Modifiers = 28] = "Modifiers", e))(VX || {}), qX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.PrecedingLineBreak = 1] = "PrecedingLineBreak", e[e.PrecedingJSDocComment = 2] = "PrecedingJSDocComment", e[e.Unterminated = 4] = "Unterminated", e[e.ExtendedUnicodeEscape = 8] = "ExtendedUnicodeEscape", e[e.Scientific = 16] = "Scientific", e[e.Octal = 32] = "Octal", e[e.HexSpecifier = 64] = "HexSpecifier", e[e.BinarySpecifier = 128] = "BinarySpecifier", e[e.OctalSpecifier = 256] = "OctalSpecifier", e[e.ContainsSeparator = 512] = "ContainsSeparator", e[e.UnicodeEscape = 1024] = "UnicodeEscape", e[e.ContainsInvalidEscape = 2048] = "ContainsInvalidEscape", e[e.HexEscape = 4096] = "HexEscape", e[e.ContainsLeadingZero = 8192] = "ContainsLeadingZero", e[e.ContainsInvalidSeparator = 16384] = "ContainsInvalidSeparator", e[e.PrecedingJSDocLeadingAsterisks = 32768] = "PrecedingJSDocLeadingAsterisks", e[e.BinaryOrOctalSpecifier = 384] = "BinaryOrOctalSpecifier", e[e.WithSpecifier = 448] = "WithSpecifier", e[e.StringLiteralFlags = 7176] = "StringLiteralFlags", e[e.NumericLiteralFlags = 25584] = "NumericLiteralFlags", e[e.TemplateLiteralLikeFlags = 7176] = "TemplateLiteralLikeFlags", e[e.IsInvalid = 26656] = "IsInvalid", e))(qX || {}), bI = /* @__PURE__ */ ((e) => (e[e.Unreachable = 1] = "Unreachable", e[e.Start = 2] = "Start", e[e.BranchLabel = 4] = "BranchLabel", e[e.LoopLabel = 8] = "LoopLabel", e[e.Assignment = 16] = "Assignment", e[e.TrueCondition = 32] = "TrueCondition", e[e.FalseCondition = 64] = "FalseCondition", e[e.SwitchClause = 128] = "SwitchClause", e[e.ArrayMutation = 256] = "ArrayMutation", e[e.Call = 512] = "Call", e[e.ReduceLabel = 1024] = "ReduceLabel", e[e.Referenced = 2048] = "Referenced", e[e.Shared = 4096] = "Shared", e[e.Label = 12] = "Label", e[e.Condition = 96] = "Condition", e))(bI || {}), HX = /* @__PURE__ */ ((e) => (e[e.ExpectError = 0] = "ExpectError", e[e.Ignore = 1] = "Ignore", e))(HX || {}), JE = class {
- }, FR = /* @__PURE__ */ ((e) => (e[e.RootFile = 0] = "RootFile", e[e.SourceFromProjectReference = 1] = "SourceFromProjectReference", e[e.OutputFromProjectReference = 2] = "OutputFromProjectReference", e[e.Import = 3] = "Import", e[e.ReferenceFile = 4] = "ReferenceFile", e[e.TypeReferenceDirective = 5] = "TypeReferenceDirective", e[e.LibFile = 6] = "LibFile", e[e.LibReferenceDirective = 7] = "LibReferenceDirective", e[e.AutomaticTypeDirectiveFile = 8] = "AutomaticTypeDirectiveFile", e))(FR || {}), GX = /* @__PURE__ */ ((e) => (e[e.FilePreprocessingLibReferenceDiagnostic = 0] = "FilePreprocessingLibReferenceDiagnostic", e[e.FilePreprocessingFileExplainingDiagnostic = 1] = "FilePreprocessingFileExplainingDiagnostic", e[e.ResolutionDiagnostics = 2] = "ResolutionDiagnostics", e))(GX || {}), $X = /* @__PURE__ */ ((e) => (e[e.Js = 0] = "Js", e[e.Dts = 1] = "Dts", e[e.BuilderSignature = 2] = "BuilderSignature", e))($X || {}), LR = /* @__PURE__ */ ((e) => (e[e.Not = 0] = "Not", e[e.SafeModules = 1] = "SafeModules", e[e.Completely = 2] = "Completely", e))(LR || {}), XX = /* @__PURE__ */ ((e) => (e[e.Success = 0] = "Success", e[e.DiagnosticsPresent_OutputsSkipped = 1] = "DiagnosticsPresent_OutputsSkipped", e[e.DiagnosticsPresent_OutputsGenerated = 2] = "DiagnosticsPresent_OutputsGenerated", e[e.InvalidProject_OutputsSkipped = 3] = "InvalidProject_OutputsSkipped", e[e.ProjectReferenceCycle_OutputsSkipped = 4] = "ProjectReferenceCycle_OutputsSkipped", e))(XX || {}), QX = /* @__PURE__ */ ((e) => (e[e.Ok = 0] = "Ok", e[e.NeedsOverride = 1] = "NeedsOverride", e[e.HasInvalidOverride = 2] = "HasInvalidOverride", e))(QX || {}), YX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Literal = 1] = "Literal", e[e.Subtype = 2] = "Subtype", e))(YX || {}), ZX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NoSupertypeReduction = 1] = "NoSupertypeReduction", e[e.NoConstraintReduction = 2] = "NoConstraintReduction", e))(ZX || {}), KX = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Signature = 1] = "Signature", e[e.NoConstraints = 2] = "NoConstraints", e[e.Completions = 4] = "Completions", e[e.SkipBindingPatterns = 8] = "SkipBindingPatterns", e))(KX || {}), eQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NoTruncation = 1] = "NoTruncation", e[e.WriteArrayAsGenericType = 2] = "WriteArrayAsGenericType", e[e.GenerateNamesForShadowedTypeParams = 4] = "GenerateNamesForShadowedTypeParams", e[e.UseStructuralFallback = 8] = "UseStructuralFallback", e[e.ForbidIndexedAccessSymbolReferences = 16] = "ForbidIndexedAccessSymbolReferences", e[e.WriteTypeArgumentsOfSignature = 32] = "WriteTypeArgumentsOfSignature", e[e.UseFullyQualifiedType = 64] = "UseFullyQualifiedType", e[e.UseOnlyExternalAliasing = 128] = "UseOnlyExternalAliasing", e[e.SuppressAnyReturnType = 256] = "SuppressAnyReturnType", e[e.WriteTypeParametersInQualifiedName = 512] = "WriteTypeParametersInQualifiedName", e[e.MultilineObjectLiterals = 1024] = "MultilineObjectLiterals", e[e.WriteClassExpressionAsTypeLiteral = 2048] = "WriteClassExpressionAsTypeLiteral", e[e.UseTypeOfFunction = 4096] = "UseTypeOfFunction", e[e.OmitParameterModifiers = 8192] = "OmitParameterModifiers", e[e.UseAliasDefinedOutsideCurrentScope = 16384] = "UseAliasDefinedOutsideCurrentScope", e[e.UseSingleQuotesForStringLiteralType = 268435456] = "UseSingleQuotesForStringLiteralType", e[e.NoTypeReduction = 536870912] = "NoTypeReduction", e[e.OmitThisParameter = 33554432] = "OmitThisParameter", e[e.AllowThisInObjectLiteral = 32768] = "AllowThisInObjectLiteral", e[e.AllowQualifiedNameInPlaceOfIdentifier = 65536] = "AllowQualifiedNameInPlaceOfIdentifier", e[e.AllowAnonymousIdentifier = 131072] = "AllowAnonymousIdentifier", e[e.AllowEmptyUnionOrIntersection = 262144] = "AllowEmptyUnionOrIntersection", e[e.AllowEmptyTuple = 524288] = "AllowEmptyTuple", e[e.AllowUniqueESSymbolType = 1048576] = "AllowUniqueESSymbolType", e[e.AllowEmptyIndexInfoType = 2097152] = "AllowEmptyIndexInfoType", e[e.AllowNodeModulesRelativePaths = 67108864] = "AllowNodeModulesRelativePaths", e[e.IgnoreErrors = 70221824] = "IgnoreErrors", e[e.InObjectTypeLiteral = 4194304] = "InObjectTypeLiteral", e[e.InTypeAlias = 8388608] = "InTypeAlias", e[e.InInitialEntityName = 16777216] = "InInitialEntityName", e))(eQ || {}), tQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.WriteComputedProps = 1] = "WriteComputedProps", e[e.NoSyntacticPrinter = 2] = "NoSyntacticPrinter", e[e.DoNotIncludeSymbolChain = 4] = "DoNotIncludeSymbolChain", e[e.AllowUnresolvedNames = 8] = "AllowUnresolvedNames", e))(tQ || {}), rQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NoTruncation = 1] = "NoTruncation", e[e.WriteArrayAsGenericType = 2] = "WriteArrayAsGenericType", e[e.GenerateNamesForShadowedTypeParams = 4] = "GenerateNamesForShadowedTypeParams", e[e.UseStructuralFallback = 8] = "UseStructuralFallback", e[e.WriteTypeArgumentsOfSignature = 32] = "WriteTypeArgumentsOfSignature", e[e.UseFullyQualifiedType = 64] = "UseFullyQualifiedType", e[e.SuppressAnyReturnType = 256] = "SuppressAnyReturnType", e[e.MultilineObjectLiterals = 1024] = "MultilineObjectLiterals", e[e.WriteClassExpressionAsTypeLiteral = 2048] = "WriteClassExpressionAsTypeLiteral", e[e.UseTypeOfFunction = 4096] = "UseTypeOfFunction", e[e.OmitParameterModifiers = 8192] = "OmitParameterModifiers", e[e.UseAliasDefinedOutsideCurrentScope = 16384] = "UseAliasDefinedOutsideCurrentScope", e[e.UseSingleQuotesForStringLiteralType = 268435456] = "UseSingleQuotesForStringLiteralType", e[e.NoTypeReduction = 536870912] = "NoTypeReduction", e[e.OmitThisParameter = 33554432] = "OmitThisParameter", e[e.AllowUniqueESSymbolType = 1048576] = "AllowUniqueESSymbolType", e[e.AddUndefined = 131072] = "AddUndefined", e[e.WriteArrowStyleSignature = 262144] = "WriteArrowStyleSignature", e[e.InArrayType = 524288] = "InArrayType", e[e.InElementType = 2097152] = "InElementType", e[e.InFirstTypeArgument = 4194304] = "InFirstTypeArgument", e[e.InTypeAlias = 8388608] = "InTypeAlias", e[e.NodeBuilderFlagsMask = 848330095] = "NodeBuilderFlagsMask", e))(rQ || {}), nQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.WriteTypeParametersOrArguments = 1] = "WriteTypeParametersOrArguments", e[e.UseOnlyExternalAliasing = 2] = "UseOnlyExternalAliasing", e[e.AllowAnyNodeKind = 4] = "AllowAnyNodeKind", e[e.UseAliasDefinedOutsideCurrentScope = 8] = "UseAliasDefinedOutsideCurrentScope", e[e.WriteComputedProps = 16] = "WriteComputedProps", e[e.DoNotIncludeSymbolChain = 32] = "DoNotIncludeSymbolChain", e))(nQ || {}), iQ = /* @__PURE__ */ ((e) => (e[e.Accessible = 0] = "Accessible", e[e.NotAccessible = 1] = "NotAccessible", e[e.CannotBeNamed = 2] = "CannotBeNamed", e[e.NotResolved = 3] = "NotResolved", e))(iQ || {}), sQ = /* @__PURE__ */ ((e) => (e[e.This = 0] = "This", e[e.Identifier = 1] = "Identifier", e[e.AssertsThis = 2] = "AssertsThis", e[e.AssertsIdentifier = 3] = "AssertsIdentifier", e))(sQ || {}), aQ = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.TypeWithConstructSignatureAndValue = 1] = "TypeWithConstructSignatureAndValue", e[e.VoidNullableOrNeverType = 2] = "VoidNullableOrNeverType", e[e.NumberLikeType = 3] = "NumberLikeType", e[e.BigIntLikeType = 4] = "BigIntLikeType", e[e.StringLikeType = 5] = "StringLikeType", e[e.BooleanType = 6] = "BooleanType", e[e.ArrayLikeType = 7] = "ArrayLikeType", e[e.ESSymbolType = 8] = "ESSymbolType", e[e.Promise = 9] = "Promise", e[e.TypeWithCallSignature = 10] = "TypeWithCallSignature", e[e.ObjectType = 11] = "ObjectType", e))(aQ || {}), MR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.FunctionScopedVariable = 1] = "FunctionScopedVariable", e[e.BlockScopedVariable = 2] = "BlockScopedVariable", e[e.Property = 4] = "Property", e[e.EnumMember = 8] = "EnumMember", e[e.Function = 16] = "Function", e[e.Class = 32] = "Class", e[e.Interface = 64] = "Interface", e[e.ConstEnum = 128] = "ConstEnum", e[e.RegularEnum = 256] = "RegularEnum", e[e.ValueModule = 512] = "ValueModule", e[e.NamespaceModule = 1024] = "NamespaceModule", e[e.TypeLiteral = 2048] = "TypeLiteral", e[e.ObjectLiteral = 4096] = "ObjectLiteral", e[e.Method = 8192] = "Method", e[e.Constructor = 16384] = "Constructor", e[e.GetAccessor = 32768] = "GetAccessor", e[e.SetAccessor = 65536] = "SetAccessor", e[e.Signature = 131072] = "Signature", e[e.TypeParameter = 262144] = "TypeParameter", e[e.TypeAlias = 524288] = "TypeAlias", e[e.ExportValue = 1048576] = "ExportValue", e[e.Alias = 2097152] = "Alias", e[e.Prototype = 4194304] = "Prototype", e[e.ExportStar = 8388608] = "ExportStar", e[e.Optional = 16777216] = "Optional", e[e.Transient = 33554432] = "Transient", e[e.Assignment = 67108864] = "Assignment", e[e.ModuleExports = 134217728] = "ModuleExports", e[e.All = -1] = "All", e[e.Enum = 384] = "Enum", e[e.Variable = 3] = "Variable", e[e.Value = 111551] = "Value", e[e.Type = 788968] = "Type", e[e.Namespace = 1920] = "Namespace", e[e.Module = 1536] = "Module", e[e.Accessor = 98304] = "Accessor", e[e.FunctionScopedVariableExcludes = 111550] = "FunctionScopedVariableExcludes", e[
- e.BlockScopedVariableExcludes = 111551
- /* Value */
- ] = "BlockScopedVariableExcludes", e[
- e.ParameterExcludes = 111551
- /* Value */
- ] = "ParameterExcludes", e[
- e.PropertyExcludes = 0
- /* None */
- ] = "PropertyExcludes", e[e.EnumMemberExcludes = 900095] = "EnumMemberExcludes", e[e.FunctionExcludes = 110991] = "FunctionExcludes", e[e.ClassExcludes = 899503] = "ClassExcludes", e[e.InterfaceExcludes = 788872] = "InterfaceExcludes", e[e.RegularEnumExcludes = 899327] = "RegularEnumExcludes", e[e.ConstEnumExcludes = 899967] = "ConstEnumExcludes", e[e.ValueModuleExcludes = 110735] = "ValueModuleExcludes", e[e.NamespaceModuleExcludes = 0] = "NamespaceModuleExcludes", e[e.MethodExcludes = 103359] = "MethodExcludes", e[e.GetAccessorExcludes = 46015] = "GetAccessorExcludes", e[e.SetAccessorExcludes = 78783] = "SetAccessorExcludes", e[e.AccessorExcludes = 13247] = "AccessorExcludes", e[e.TypeParameterExcludes = 526824] = "TypeParameterExcludes", e[
- e.TypeAliasExcludes = 788968
- /* Type */
- ] = "TypeAliasExcludes", e[
- e.AliasExcludes = 2097152
- /* Alias */
- ] = "AliasExcludes", e[e.ModuleMember = 2623475] = "ModuleMember", e[e.ExportHasLocal = 944] = "ExportHasLocal", e[e.BlockScoped = 418] = "BlockScoped", e[e.PropertyOrAccessor = 98308] = "PropertyOrAccessor", e[e.ClassMember = 106500] = "ClassMember", e[e.ExportSupportsDefaultModifier = 112] = "ExportSupportsDefaultModifier", e[e.ExportDoesNotSupportDefaultModifier = -113] = "ExportDoesNotSupportDefaultModifier", e[e.Classifiable = 2885600] = "Classifiable", e[e.LateBindingContainer = 6256] = "LateBindingContainer", e))(MR || {}), oQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Instantiated = 1] = "Instantiated", e[e.SyntheticProperty = 2] = "SyntheticProperty", e[e.SyntheticMethod = 4] = "SyntheticMethod", e[e.Readonly = 8] = "Readonly", e[e.ReadPartial = 16] = "ReadPartial", e[e.WritePartial = 32] = "WritePartial", e[e.HasNonUniformType = 64] = "HasNonUniformType", e[e.HasLiteralType = 128] = "HasLiteralType", e[e.ContainsPublic = 256] = "ContainsPublic", e[e.ContainsProtected = 512] = "ContainsProtected", e[e.ContainsPrivate = 1024] = "ContainsPrivate", e[e.ContainsStatic = 2048] = "ContainsStatic", e[e.Late = 4096] = "Late", e[e.ReverseMapped = 8192] = "ReverseMapped", e[e.OptionalParameter = 16384] = "OptionalParameter", e[e.RestParameter = 32768] = "RestParameter", e[e.DeferredType = 65536] = "DeferredType", e[e.HasNeverType = 131072] = "HasNeverType", e[e.Mapped = 262144] = "Mapped", e[e.StripOptional = 524288] = "StripOptional", e[e.Unresolved = 1048576] = "Unresolved", e[e.Synthetic = 6] = "Synthetic", e[e.Discriminant = 192] = "Discriminant", e[e.Partial = 48] = "Partial", e))(oQ || {}), cQ = /* @__PURE__ */ ((e) => (e.Call = "__call", e.Constructor = "__constructor", e.New = "__new", e.Index = "__index", e.ExportStar = "__export", e.Global = "__global", e.Missing = "__missing", e.Type = "__type", e.Object = "__object", e.JSXAttributes = "__jsxAttributes", e.Class = "__class", e.Function = "__function", e.Computed = "__computed", e.Resolving = "__resolving__", e.ExportEquals = "export=", e.Default = "default", e.This = "this", e.InstantiationExpression = "__instantiationExpression", e.ImportAttributes = "__importAttributes", e))(cQ || {}), RR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.TypeChecked = 1] = "TypeChecked", e[e.LexicalThis = 2] = "LexicalThis", e[e.CaptureThis = 4] = "CaptureThis", e[e.CaptureNewTarget = 8] = "CaptureNewTarget", e[e.SuperInstance = 16] = "SuperInstance", e[e.SuperStatic = 32] = "SuperStatic", e[e.ContextChecked = 64] = "ContextChecked", e[e.MethodWithSuperPropertyAccessInAsync = 128] = "MethodWithSuperPropertyAccessInAsync", e[e.MethodWithSuperPropertyAssignmentInAsync = 256] = "MethodWithSuperPropertyAssignmentInAsync", e[e.CaptureArguments = 512] = "CaptureArguments", e[e.EnumValuesComputed = 1024] = "EnumValuesComputed", e[e.LexicalModuleMergesWithClass = 2048] = "LexicalModuleMergesWithClass", e[e.LoopWithCapturedBlockScopedBinding = 4096] = "LoopWithCapturedBlockScopedBinding", e[e.ContainsCapturedBlockScopeBinding = 8192] = "ContainsCapturedBlockScopeBinding", e[e.CapturedBlockScopedBinding = 16384] = "CapturedBlockScopedBinding", e[e.BlockScopedBindingInLoop = 32768] = "BlockScopedBindingInLoop", e[e.NeedsLoopOutParameter = 65536] = "NeedsLoopOutParameter", e[e.AssignmentsMarked = 131072] = "AssignmentsMarked", e[e.ContainsConstructorReference = 262144] = "ContainsConstructorReference", e[e.ConstructorReference = 536870912] = "ConstructorReference", e[e.ContainsClassWithPrivateIdentifiers = 1048576] = "ContainsClassWithPrivateIdentifiers", e[e.ContainsSuperPropertyInStaticInitializer = 2097152] = "ContainsSuperPropertyInStaticInitializer", e[e.InCheckIdentifier = 4194304] = "InCheckIdentifier", e[e.PartiallyTypeChecked = 8388608] = "PartiallyTypeChecked", e[e.LazyFlags = 539358128] = "LazyFlags", e))(RR || {}), jR = /* @__PURE__ */ ((e) => (e[e.Any = 1] = "Any", e[e.Unknown = 2] = "Unknown", e[e.String = 4] = "String", e[e.Number = 8] = "Number", e[e.Boolean = 16] = "Boolean", e[e.Enum = 32] = "Enum", e[e.BigInt = 64] = "BigInt", e[e.StringLiteral = 128] = "StringLiteral", e[e.NumberLiteral = 256] = "NumberLiteral", e[e.BooleanLiteral = 512] = "BooleanLiteral", e[e.EnumLiteral = 1024] = "EnumLiteral", e[e.BigIntLiteral = 2048] = "BigIntLiteral", e[e.ESSymbol = 4096] = "ESSymbol", e[e.UniqueESSymbol = 8192] = "UniqueESSymbol", e[e.Void = 16384] = "Void", e[e.Undefined = 32768] = "Undefined", e[e.Null = 65536] = "Null", e[e.Never = 131072] = "Never", e[e.TypeParameter = 262144] = "TypeParameter", e[e.Object = 524288] = "Object", e[e.Union = 1048576] = "Union", e[e.Intersection = 2097152] = "Intersection", e[e.Index = 4194304] = "Index", e[e.IndexedAccess = 8388608] = "IndexedAccess", e[e.Conditional = 16777216] = "Conditional", e[e.Substitution = 33554432] = "Substitution", e[e.NonPrimitive = 67108864] = "NonPrimitive", e[e.TemplateLiteral = 134217728] = "TemplateLiteral", e[e.StringMapping = 268435456] = "StringMapping", e[e.Reserved1 = 536870912] = "Reserved1", e[e.Reserved2 = 1073741824] = "Reserved2", e[e.AnyOrUnknown = 3] = "AnyOrUnknown", e[e.Nullable = 98304] = "Nullable", e[e.Literal = 2944] = "Literal", e[e.Unit = 109472] = "Unit", e[e.Freshable = 2976] = "Freshable", e[e.StringOrNumberLiteral = 384] = "StringOrNumberLiteral", e[e.StringOrNumberLiteralOrUnique = 8576] = "StringOrNumberLiteralOrUnique", e[e.DefinitelyFalsy = 117632] = "DefinitelyFalsy", e[e.PossiblyFalsy = 117724] = "PossiblyFalsy", e[e.Intrinsic = 67359327] = "Intrinsic", e[e.StringLike = 402653316] = "StringLike", e[e.NumberLike = 296] = "NumberLike", e[e.BigIntLike = 2112] = "BigIntLike", e[e.BooleanLike = 528] = "BooleanLike", e[e.EnumLike = 1056] = "EnumLike", e[e.ESSymbolLike = 12288] = "ESSymbolLike", e[e.VoidLike = 49152] = "VoidLike", e[e.Primitive = 402784252] = "Primitive", e[e.DefinitelyNonNullable = 470302716] = "DefinitelyNonNullable", e[e.DisjointDomains = 469892092] = "DisjointDomains", e[e.UnionOrIntersection = 3145728] = "UnionOrIntersection", e[e.StructuredType = 3670016] = "StructuredType", e[e.TypeVariable = 8650752] = "TypeVariable", e[e.InstantiableNonPrimitive = 58982400] = "InstantiableNonPrimitive", e[e.InstantiablePrimitive = 406847488] = "InstantiablePrimitive", e[e.Instantiable = 465829888] = "Instantiable", e[e.StructuredOrInstantiable = 469499904] = "StructuredOrInstantiable", e[e.ObjectFlagsType = 3899393] = "ObjectFlagsType", e[e.Simplifiable = 25165824] = "Simplifiable", e[e.Singleton = 67358815] = "Singleton", e[e.Narrowable = 536624127] = "Narrowable", e[e.IncludesMask = 473694207] = "IncludesMask", e[
- e.IncludesMissingType = 262144
- /* TypeParameter */
- ] = "IncludesMissingType", e[
- e.IncludesNonWideningType = 4194304
- /* Index */
- ] = "IncludesNonWideningType", e[
- e.IncludesWildcard = 8388608
- /* IndexedAccess */
- ] = "IncludesWildcard", e[
- e.IncludesEmptyObject = 16777216
- /* Conditional */
- ] = "IncludesEmptyObject", e[
- e.IncludesInstantiable = 33554432
- /* Substitution */
- ] = "IncludesInstantiable", e[
- e.IncludesConstrainedTypeVariable = 536870912
- /* Reserved1 */
- ] = "IncludesConstrainedTypeVariable", e[
- e.IncludesError = 1073741824
- /* Reserved2 */
- ] = "IncludesError", e[e.NotPrimitiveUnion = 36323331] = "NotPrimitiveUnion", e))(jR || {}), BR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Class = 1] = "Class", e[e.Interface = 2] = "Interface", e[e.Reference = 4] = "Reference", e[e.Tuple = 8] = "Tuple", e[e.Anonymous = 16] = "Anonymous", e[e.Mapped = 32] = "Mapped", e[e.Instantiated = 64] = "Instantiated", e[e.ObjectLiteral = 128] = "ObjectLiteral", e[e.EvolvingArray = 256] = "EvolvingArray", e[e.ObjectLiteralPatternWithComputedProperties = 512] = "ObjectLiteralPatternWithComputedProperties", e[e.ReverseMapped = 1024] = "ReverseMapped", e[e.JsxAttributes = 2048] = "JsxAttributes", e[e.JSLiteral = 4096] = "JSLiteral", e[e.FreshLiteral = 8192] = "FreshLiteral", e[e.ArrayLiteral = 16384] = "ArrayLiteral", e[e.PrimitiveUnion = 32768] = "PrimitiveUnion", e[e.ContainsWideningType = 65536] = "ContainsWideningType", e[e.ContainsObjectOrArrayLiteral = 131072] = "ContainsObjectOrArrayLiteral", e[e.NonInferrableType = 262144] = "NonInferrableType", e[e.CouldContainTypeVariablesComputed = 524288] = "CouldContainTypeVariablesComputed", e[e.CouldContainTypeVariables = 1048576] = "CouldContainTypeVariables", e[e.ClassOrInterface = 3] = "ClassOrInterface", e[e.RequiresWidening = 196608] = "RequiresWidening", e[e.PropagatingFlags = 458752] = "PropagatingFlags", e[e.InstantiatedMapped = 96] = "InstantiatedMapped", e[e.ObjectTypeKindMask = 1343] = "ObjectTypeKindMask", e[e.ContainsSpread = 2097152] = "ContainsSpread", e[e.ObjectRestType = 4194304] = "ObjectRestType", e[e.InstantiationExpressionType = 8388608] = "InstantiationExpressionType", e[e.SingleSignatureType = 134217728] = "SingleSignatureType", e[e.IsClassInstanceClone = 16777216] = "IsClassInstanceClone", e[e.IdenticalBaseTypeCalculated = 33554432] = "IdenticalBaseTypeCalculated", e[e.IdenticalBaseTypeExists = 67108864] = "IdenticalBaseTypeExists", e[e.IsGenericTypeComputed = 2097152] = "IsGenericTypeComputed", e[e.IsGenericObjectType = 4194304] = "IsGenericObjectType", e[e.IsGenericIndexType = 8388608] = "IsGenericIndexType", e[e.IsGenericType = 12582912] = "IsGenericType", e[e.ContainsIntersections = 16777216] = "ContainsIntersections", e[e.IsUnknownLikeUnionComputed = 33554432] = "IsUnknownLikeUnionComputed", e[e.IsUnknownLikeUnion = 67108864] = "IsUnknownLikeUnion", e[e.IsNeverIntersectionComputed = 16777216] = "IsNeverIntersectionComputed", e[e.IsNeverIntersection = 33554432] = "IsNeverIntersection", e[e.IsConstrainedTypeVariable = 67108864] = "IsConstrainedTypeVariable", e))(BR || {}), lQ = /* @__PURE__ */ ((e) => (e[e.Invariant = 0] = "Invariant", e[e.Covariant = 1] = "Covariant", e[e.Contravariant = 2] = "Contravariant", e[e.Bivariant = 3] = "Bivariant", e[e.Independent = 4] = "Independent", e[e.VarianceMask = 7] = "VarianceMask", e[e.Unmeasurable = 8] = "Unmeasurable", e[e.Unreliable = 16] = "Unreliable", e[e.AllowsStructuralFallback = 24] = "AllowsStructuralFallback", e))(lQ || {}), uQ = /* @__PURE__ */ ((e) => (e[e.Required = 1] = "Required", e[e.Optional = 2] = "Optional", e[e.Rest = 4] = "Rest", e[e.Variadic = 8] = "Variadic", e[e.Fixed = 3] = "Fixed", e[e.Variable = 12] = "Variable", e[e.NonRequired = 14] = "NonRequired", e[e.NonRest = 11] = "NonRest", e))(uQ || {}), _Q = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.IncludeUndefined = 1] = "IncludeUndefined", e[e.NoIndexSignatures = 2] = "NoIndexSignatures", e[e.Writing = 4] = "Writing", e[e.CacheSymbol = 8] = "CacheSymbol", e[e.AllowMissing = 16] = "AllowMissing", e[e.ExpressionPosition = 32] = "ExpressionPosition", e[e.ReportDeprecated = 64] = "ReportDeprecated", e[e.SuppressNoImplicitAnyError = 128] = "SuppressNoImplicitAnyError", e[e.Contextual = 256] = "Contextual", e[
- e.Persistent = 1
- /* IncludeUndefined */
- ] = "Persistent", e))(_Q || {}), fQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.StringsOnly = 1] = "StringsOnly", e[e.NoIndexSignatures = 2] = "NoIndexSignatures", e[e.NoReducibleCheck = 4] = "NoReducibleCheck", e))(fQ || {}), pQ = /* @__PURE__ */ ((e) => (e[e.Component = 0] = "Component", e[e.Function = 1] = "Function", e[e.Mixed = 2] = "Mixed", e))(pQ || {}), dQ = /* @__PURE__ */ ((e) => (e[e.Call = 0] = "Call", e[e.Construct = 1] = "Construct", e))(dQ || {}), JR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.HasRestParameter = 1] = "HasRestParameter", e[e.HasLiteralTypes = 2] = "HasLiteralTypes", e[e.Abstract = 4] = "Abstract", e[e.IsInnerCallChain = 8] = "IsInnerCallChain", e[e.IsOuterCallChain = 16] = "IsOuterCallChain", e[e.IsUntypedSignatureInJSFile = 32] = "IsUntypedSignatureInJSFile", e[e.IsNonInferrable = 64] = "IsNonInferrable", e[e.IsSignatureCandidateForOverloadFailure = 128] = "IsSignatureCandidateForOverloadFailure", e[e.PropagatingFlags = 167] = "PropagatingFlags", e[e.CallChainFlags = 24] = "CallChainFlags", e))(JR || {}), mQ = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Number = 1] = "Number", e))(mQ || {}), gQ = /* @__PURE__ */ ((e) => (e[e.Simple = 0] = "Simple", e[e.Array = 1] = "Array", e[e.Deferred = 2] = "Deferred", e[e.Function = 3] = "Function", e[e.Composite = 4] = "Composite", e[e.Merged = 5] = "Merged", e))(gQ || {}), hQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NakedTypeVariable = 1] = "NakedTypeVariable", e[e.SpeculativeTuple = 2] = "SpeculativeTuple", e[e.SubstituteSource = 4] = "SubstituteSource", e[e.HomomorphicMappedType = 8] = "HomomorphicMappedType", e[e.PartialHomomorphicMappedType = 16] = "PartialHomomorphicMappedType", e[e.MappedTypeConstraint = 32] = "MappedTypeConstraint", e[e.ContravariantConditional = 64] = "ContravariantConditional", e[e.ReturnType = 128] = "ReturnType", e[e.LiteralKeyof = 256] = "LiteralKeyof", e[e.NoConstraints = 512] = "NoConstraints", e[e.AlwaysStrict = 1024] = "AlwaysStrict", e[e.MaxValue = 2048] = "MaxValue", e[e.PriorityImpliesCombination = 416] = "PriorityImpliesCombination", e[e.Circularity = -1] = "Circularity", e))(hQ || {}), yQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NoDefault = 1] = "NoDefault", e[e.AnyDefault = 2] = "AnyDefault", e[e.SkippedGenericFunction = 4] = "SkippedGenericFunction", e))(yQ || {}), vQ = /* @__PURE__ */ ((e) => (e[e.False = 0] = "False", e[e.Unknown = 1] = "Unknown", e[e.Maybe = 3] = "Maybe", e[e.True = -1] = "True", e))(vQ || {}), bQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ExportsProperty = 1] = "ExportsProperty", e[e.ModuleExports = 2] = "ModuleExports", e[e.PrototypeProperty = 3] = "PrototypeProperty", e[e.ThisProperty = 4] = "ThisProperty", e[e.Property = 5] = "Property", e[e.Prototype = 6] = "Prototype", e[e.ObjectDefinePropertyValue = 7] = "ObjectDefinePropertyValue", e[e.ObjectDefinePropertyExports = 8] = "ObjectDefinePropertyExports", e[e.ObjectDefinePrototypeProperty = 9] = "ObjectDefinePrototypeProperty", e))(bQ || {}), SI = /* @__PURE__ */ ((e) => (e[e.Warning = 0] = "Warning", e[e.Error = 1] = "Error", e[e.Suggestion = 2] = "Suggestion", e[e.Message = 3] = "Message", e))(SI || {});
- function U2(e, t = !0) {
- const n = SI[e.category];
- return t ? n.toLowerCase() : n;
- }
- var zE = /* @__PURE__ */ ((e) => (e[e.Classic = 1] = "Classic", e[e.NodeJs = 2] = "NodeJs", e[e.Node10 = 2] = "Node10", e[e.Node16 = 3] = "Node16", e[e.NodeNext = 99] = "NodeNext", e[e.Bundler = 100] = "Bundler", e))(zE || {}), SQ = /* @__PURE__ */ ((e) => (e[e.Legacy = 1] = "Legacy", e[e.Auto = 2] = "Auto", e[e.Force = 3] = "Force", e))(SQ || {}), TQ = /* @__PURE__ */ ((e) => (e[e.FixedPollingInterval = 0] = "FixedPollingInterval", e[e.PriorityPollingInterval = 1] = "PriorityPollingInterval", e[e.DynamicPriorityPolling = 2] = "DynamicPriorityPolling", e[e.FixedChunkSizePolling = 3] = "FixedChunkSizePolling", e[e.UseFsEvents = 4] = "UseFsEvents", e[e.UseFsEventsOnParentDirectory = 5] = "UseFsEventsOnParentDirectory", e))(TQ || {}), xQ = /* @__PURE__ */ ((e) => (e[e.UseFsEvents = 0] = "UseFsEvents", e[e.FixedPollingInterval = 1] = "FixedPollingInterval", e[e.DynamicPriorityPolling = 2] = "DynamicPriorityPolling", e[e.FixedChunkSizePolling = 3] = "FixedChunkSizePolling", e))(xQ || {}), kQ = /* @__PURE__ */ ((e) => (e[e.FixedInterval = 0] = "FixedInterval", e[e.PriorityInterval = 1] = "PriorityInterval", e[e.DynamicPriority = 2] = "DynamicPriority", e[e.FixedChunkSize = 3] = "FixedChunkSize", e))(kQ || {}), lw = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.CommonJS = 1] = "CommonJS", e[e.AMD = 2] = "AMD", e[e.UMD = 3] = "UMD", e[e.System = 4] = "System", e[e.ES2015 = 5] = "ES2015", e[e.ES2020 = 6] = "ES2020", e[e.ES2022 = 7] = "ES2022", e[e.ESNext = 99] = "ESNext", e[e.Node16 = 100] = "Node16", e[e.NodeNext = 199] = "NodeNext", e[e.Preserve = 200] = "Preserve", e))(lw || {}), CQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Preserve = 1] = "Preserve", e[e.React = 2] = "React", e[e.ReactNative = 3] = "ReactNative", e[e.ReactJSX = 4] = "ReactJSX", e[e.ReactJSXDev = 5] = "ReactJSXDev", e))(CQ || {}), EQ = /* @__PURE__ */ ((e) => (e[e.Remove = 0] = "Remove", e[e.Preserve = 1] = "Preserve", e[e.Error = 2] = "Error", e))(EQ || {}), DQ = /* @__PURE__ */ ((e) => (e[e.CarriageReturnLineFeed = 0] = "CarriageReturnLineFeed", e[e.LineFeed = 1] = "LineFeed", e))(DQ || {}), zR = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.JS = 1] = "JS", e[e.JSX = 2] = "JSX", e[e.TS = 3] = "TS", e[e.TSX = 4] = "TSX", e[e.External = 5] = "External", e[e.JSON = 6] = "JSON", e[e.Deferred = 7] = "Deferred", e))(zR || {}), PQ = /* @__PURE__ */ ((e) => (e[e.ES3 = 0] = "ES3", e[e.ES5 = 1] = "ES5", e[e.ES2015 = 2] = "ES2015", e[e.ES2016 = 3] = "ES2016", e[e.ES2017 = 4] = "ES2017", e[e.ES2018 = 5] = "ES2018", e[e.ES2019 = 6] = "ES2019", e[e.ES2020 = 7] = "ES2020", e[e.ES2021 = 8] = "ES2021", e[e.ES2022 = 9] = "ES2022", e[e.ES2023 = 10] = "ES2023", e[e.ESNext = 99] = "ESNext", e[e.JSON = 100] = "JSON", e[
- e.Latest = 99
- /* ESNext */
- ] = "Latest", e))(PQ || {}), wQ = /* @__PURE__ */ ((e) => (e[e.Standard = 0] = "Standard", e[e.JSX = 1] = "JSX", e))(wQ || {}), AQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Recursive = 1] = "Recursive", e))(AQ || {}), NQ = /* @__PURE__ */ ((e) => (e[e.EOF = -1] = "EOF", e[e.nullCharacter = 0] = "nullCharacter", e[e.maxAsciiCharacter = 127] = "maxAsciiCharacter", e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.lineSeparator = 8232] = "lineSeparator", e[e.paragraphSeparator = 8233] = "paragraphSeparator", e[e.nextLine = 133] = "nextLine", e[e.space = 32] = "space", e[e.nonBreakingSpace = 160] = "nonBreakingSpace", e[e.enQuad = 8192] = "enQuad", e[e.emQuad = 8193] = "emQuad", e[e.enSpace = 8194] = "enSpace", e[e.emSpace = 8195] = "emSpace", e[e.threePerEmSpace = 8196] = "threePerEmSpace", e[e.fourPerEmSpace = 8197] = "fourPerEmSpace", e[e.sixPerEmSpace = 8198] = "sixPerEmSpace", e[e.figureSpace = 8199] = "figureSpace", e[e.punctuationSpace = 8200] = "punctuationSpace", e[e.thinSpace = 8201] = "thinSpace", e[e.hairSpace = 8202] = "hairSpace", e[e.zeroWidthSpace = 8203] = "zeroWidthSpace", e[e.narrowNoBreakSpace = 8239] = "narrowNoBreakSpace", e[e.ideographicSpace = 12288] = "ideographicSpace", e[e.mathematicalSpace = 8287] = "mathematicalSpace", e[e.ogham = 5760] = "ogham", e[e.replacementCharacter = 65533] = "replacementCharacter", e[e._ = 95] = "_", e[e.$ = 36] = "$", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.ampersand = 38] = "ampersand", e[e.asterisk = 42] = "asterisk", e[e.at = 64] = "at", e[e.backslash = 92] = "backslash", e[e.backtick = 96] = "backtick", e[e.bar = 124] = "bar", e[e.caret = 94] = "caret", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.closeParen = 41] = "closeParen", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.equals = 61] = "equals", e[e.exclamation = 33] = "exclamation", e[e.greaterThan = 62] = "greaterThan", e[e.hash = 35] = "hash", e[e.lessThan = 60] = "lessThan", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.openParen = 40] = "openParen", e[e.percent = 37] = "percent", e[e.plus = 43] = "plus", e[e.question = 63] = "question", e[e.semicolon = 59] = "semicolon", e[e.singleQuote = 39] = "singleQuote", e[e.slash = 47] = "slash", e[e.tilde = 126] = "tilde", e[e.backspace = 8] = "backspace", e[e.formFeed = 12] = "formFeed", e[e.byteOrderMark = 65279] = "byteOrderMark", e[e.tab = 9] = "tab", e[e.verticalTab = 11] = "verticalTab", e))(NQ || {}), IQ = /* @__PURE__ */ ((e) => (e.Ts = ".ts", e.Tsx = ".tsx", e.Dts = ".d.ts", e.Js = ".js", e.Jsx = ".jsx", e.Json = ".json", e.TsBuildInfo = ".tsbuildinfo", e.Mjs = ".mjs", e.Mts = ".mts", e.Dmts = ".d.mts", e.Cjs = ".cjs", e.Cts = ".cts", e.Dcts = ".d.cts", e))(IQ || {}), WR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ContainsTypeScript = 1] = "ContainsTypeScript", e[e.ContainsJsx = 2] = "ContainsJsx", e[e.ContainsESNext = 4] = "ContainsESNext", e[e.ContainsES2022 = 8] = "ContainsES2022", e[e.ContainsES2021 = 16] = "ContainsES2021", e[e.ContainsES2020 = 32] = "ContainsES2020", e[e.ContainsES2019 = 64] = "ContainsES2019", e[e.ContainsES2018 = 128] = "ContainsES2018", e[e.ContainsES2017 = 256] = "ContainsES2017", e[e.ContainsES2016 = 512] = "ContainsES2016", e[e.ContainsES2015 = 1024] = "ContainsES2015", e[e.ContainsGenerator = 2048] = "ContainsGenerator", e[e.ContainsDestructuringAssignment = 4096] = "ContainsDestructuringAssignment", e[e.ContainsTypeScriptClassSyntax = 8192] = "ContainsTypeScriptClassSyntax", e[e.ContainsLexicalThis = 16384] = "ContainsLexicalThis", e[e.ContainsRestOrSpread = 32768] = "ContainsRestOrSpread", e[e.ContainsObjectRestOrSpread = 65536] = "ContainsObjectRestOrSpread", e[e.ContainsComputedPropertyName = 131072] = "ContainsComputedPropertyName", e[e.ContainsBlockScopedBinding = 262144] = "ContainsBlockScopedBinding", e[e.ContainsBindingPattern = 524288] = "ContainsBindingPattern", e[e.ContainsYield = 1048576] = "ContainsYield", e[e.ContainsAwait = 2097152] = "ContainsAwait", e[e.ContainsHoistedDeclarationOrCompletion = 4194304] = "ContainsHoistedDeclarationOrCompletion", e[e.ContainsDynamicImport = 8388608] = "ContainsDynamicImport", e[e.ContainsClassFields = 16777216] = "ContainsClassFields", e[e.ContainsDecorators = 33554432] = "ContainsDecorators", e[e.ContainsPossibleTopLevelAwait = 67108864] = "ContainsPossibleTopLevelAwait", e[e.ContainsLexicalSuper = 134217728] = "ContainsLexicalSuper", e[e.ContainsUpdateExpressionForIdentifier = 268435456] = "ContainsUpdateExpressionForIdentifier", e[e.ContainsPrivateIdentifierInExpression = 536870912] = "ContainsPrivateIdentifierInExpression", e[e.HasComputedFlags = -2147483648] = "HasComputedFlags", e[
- e.AssertTypeScript = 1
- /* ContainsTypeScript */
- ] = "AssertTypeScript", e[
- e.AssertJsx = 2
- /* ContainsJsx */
- ] = "AssertJsx", e[
- e.AssertESNext = 4
- /* ContainsESNext */
- ] = "AssertESNext", e[
- e.AssertES2022 = 8
- /* ContainsES2022 */
- ] = "AssertES2022", e[
- e.AssertES2021 = 16
- /* ContainsES2021 */
- ] = "AssertES2021", e[
- e.AssertES2020 = 32
- /* ContainsES2020 */
- ] = "AssertES2020", e[
- e.AssertES2019 = 64
- /* ContainsES2019 */
- ] = "AssertES2019", e[
- e.AssertES2018 = 128
- /* ContainsES2018 */
- ] = "AssertES2018", e[
- e.AssertES2017 = 256
- /* ContainsES2017 */
- ] = "AssertES2017", e[
- e.AssertES2016 = 512
- /* ContainsES2016 */
- ] = "AssertES2016", e[
- e.AssertES2015 = 1024
- /* ContainsES2015 */
- ] = "AssertES2015", e[
- e.AssertGenerator = 2048
- /* ContainsGenerator */
- ] = "AssertGenerator", e[
- e.AssertDestructuringAssignment = 4096
- /* ContainsDestructuringAssignment */
- ] = "AssertDestructuringAssignment", e[
- e.OuterExpressionExcludes = -2147483648
- /* HasComputedFlags */
- ] = "OuterExpressionExcludes", e[
- e.PropertyAccessExcludes = -2147483648
- /* OuterExpressionExcludes */
- ] = "PropertyAccessExcludes", e[
- e.NodeExcludes = -2147483648
- /* PropertyAccessExcludes */
- ] = "NodeExcludes", e[e.ArrowFunctionExcludes = -2072174592] = "ArrowFunctionExcludes", e[e.FunctionExcludes = -1937940480] = "FunctionExcludes", e[e.ConstructorExcludes = -1937948672] = "ConstructorExcludes", e[e.MethodOrAccessorExcludes = -2005057536] = "MethodOrAccessorExcludes", e[e.PropertyExcludes = -2013249536] = "PropertyExcludes", e[e.ClassExcludes = -2147344384] = "ClassExcludes", e[e.ModuleExcludes = -1941676032] = "ModuleExcludes", e[e.TypeExcludes = -2] = "TypeExcludes", e[e.ObjectLiteralExcludes = -2147278848] = "ObjectLiteralExcludes", e[e.ArrayLiteralOrCallOrNewExcludes = -2147450880] = "ArrayLiteralOrCallOrNewExcludes", e[e.VariableDeclarationListExcludes = -2146893824] = "VariableDeclarationListExcludes", e[
- e.ParameterExcludes = -2147483648
- /* NodeExcludes */
- ] = "ParameterExcludes", e[e.CatchClauseExcludes = -2147418112] = "CatchClauseExcludes", e[e.BindingPatternExcludes = -2147450880] = "BindingPatternExcludes", e[e.ContainsLexicalThisOrSuper = 134234112] = "ContainsLexicalThisOrSuper", e[e.PropertyNamePropagatingFlags = 134234112] = "PropertyNamePropagatingFlags", e))(WR || {}), UR = /* @__PURE__ */ ((e) => (e[e.TabStop = 0] = "TabStop", e[e.Placeholder = 1] = "Placeholder", e[e.Choice = 2] = "Choice", e[e.Variable = 3] = "Variable", e))(UR || {}), VR = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.SingleLine = 1] = "SingleLine", e[e.MultiLine = 2] = "MultiLine", e[e.AdviseOnEmitNode = 4] = "AdviseOnEmitNode", e[e.NoSubstitution = 8] = "NoSubstitution", e[e.CapturesThis = 16] = "CapturesThis", e[e.NoLeadingSourceMap = 32] = "NoLeadingSourceMap", e[e.NoTrailingSourceMap = 64] = "NoTrailingSourceMap", e[e.NoSourceMap = 96] = "NoSourceMap", e[e.NoNestedSourceMaps = 128] = "NoNestedSourceMaps", e[e.NoTokenLeadingSourceMaps = 256] = "NoTokenLeadingSourceMaps", e[e.NoTokenTrailingSourceMaps = 512] = "NoTokenTrailingSourceMaps", e[e.NoTokenSourceMaps = 768] = "NoTokenSourceMaps", e[e.NoLeadingComments = 1024] = "NoLeadingComments", e[e.NoTrailingComments = 2048] = "NoTrailingComments", e[e.NoComments = 3072] = "NoComments", e[e.NoNestedComments = 4096] = "NoNestedComments", e[e.HelperName = 8192] = "HelperName", e[e.ExportName = 16384] = "ExportName", e[e.LocalName = 32768] = "LocalName", e[e.InternalName = 65536] = "InternalName", e[e.Indented = 131072] = "Indented", e[e.NoIndentation = 262144] = "NoIndentation", e[e.AsyncFunctionBody = 524288] = "AsyncFunctionBody", e[e.ReuseTempVariableScope = 1048576] = "ReuseTempVariableScope", e[e.CustomPrologue = 2097152] = "CustomPrologue", e[e.NoHoisting = 4194304] = "NoHoisting", e[e.Iterator = 8388608] = "Iterator", e[e.NoAsciiEscaping = 16777216] = "NoAsciiEscaping", e))(VR || {}), OQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.TypeScriptClassWrapper = 1] = "TypeScriptClassWrapper", e[e.NeverApplyImportHelper = 2] = "NeverApplyImportHelper", e[e.IgnoreSourceNewlines = 4] = "IgnoreSourceNewlines", e[e.Immutable = 8] = "Immutable", e[e.IndirectCall = 16] = "IndirectCall", e[e.TransformPrivateStaticElements = 32] = "TransformPrivateStaticElements", e))(OQ || {}), FQ = /* @__PURE__ */ ((e) => (e[
- e.Classes = 2
- /* ES2015 */
- ] = "Classes", e[
- e.ForOf = 2
- /* ES2015 */
- ] = "ForOf", e[
- e.Generators = 2
- /* ES2015 */
- ] = "Generators", e[
- e.Iteration = 2
- /* ES2015 */
- ] = "Iteration", e[
- e.SpreadElements = 2
- /* ES2015 */
- ] = "SpreadElements", e[
- e.RestElements = 2
- /* ES2015 */
- ] = "RestElements", e[
- e.TaggedTemplates = 2
- /* ES2015 */
- ] = "TaggedTemplates", e[
- e.DestructuringAssignment = 2
- /* ES2015 */
- ] = "DestructuringAssignment", e[
- e.BindingPatterns = 2
- /* ES2015 */
- ] = "BindingPatterns", e[
- e.ArrowFunctions = 2
- /* ES2015 */
- ] = "ArrowFunctions", e[
- e.BlockScopedVariables = 2
- /* ES2015 */
- ] = "BlockScopedVariables", e[
- e.ObjectAssign = 2
- /* ES2015 */
- ] = "ObjectAssign", e[
- e.RegularExpressionFlagsUnicode = 2
- /* ES2015 */
- ] = "RegularExpressionFlagsUnicode", e[
- e.RegularExpressionFlagsSticky = 2
- /* ES2015 */
- ] = "RegularExpressionFlagsSticky", e[
- e.Exponentiation = 3
- /* ES2016 */
- ] = "Exponentiation", e[
- e.AsyncFunctions = 4
- /* ES2017 */
- ] = "AsyncFunctions", e[
- e.ForAwaitOf = 5
- /* ES2018 */
- ] = "ForAwaitOf", e[
- e.AsyncGenerators = 5
- /* ES2018 */
- ] = "AsyncGenerators", e[
- e.AsyncIteration = 5
- /* ES2018 */
- ] = "AsyncIteration", e[
- e.ObjectSpreadRest = 5
- /* ES2018 */
- ] = "ObjectSpreadRest", e[
- e.RegularExpressionFlagsDotAll = 5
- /* ES2018 */
- ] = "RegularExpressionFlagsDotAll", e[
- e.BindinglessCatch = 6
- /* ES2019 */
- ] = "BindinglessCatch", e[
- e.BigInt = 7
- /* ES2020 */
- ] = "BigInt", e[
- e.NullishCoalesce = 7
- /* ES2020 */
- ] = "NullishCoalesce", e[
- e.OptionalChaining = 7
- /* ES2020 */
- ] = "OptionalChaining", e[
- e.LogicalAssignment = 8
- /* ES2021 */
- ] = "LogicalAssignment", e[
- e.TopLevelAwait = 9
- /* ES2022 */
- ] = "TopLevelAwait", e[
- e.ClassFields = 9
- /* ES2022 */
- ] = "ClassFields", e[
- e.PrivateNamesAndClassStaticBlocks = 9
- /* ES2022 */
- ] = "PrivateNamesAndClassStaticBlocks", e[
- e.RegularExpressionFlagsHasIndices = 9
- /* ES2022 */
- ] = "RegularExpressionFlagsHasIndices", e[
- e.ShebangComments = 99
- /* ESNext */
- ] = "ShebangComments", e[
- e.UsingAndAwaitUsing = 99
- /* ESNext */
- ] = "UsingAndAwaitUsing", e[
- e.ClassAndClassElementDecorators = 99
- /* ESNext */
- ] = "ClassAndClassElementDecorators", e[
- e.RegularExpressionFlagsUnicodeSets = 99
- /* ESNext */
- ] = "RegularExpressionFlagsUnicodeSets", e))(FQ || {}), LQ = /* @__PURE__ */ ((e) => (e[e.Extends = 1] = "Extends", e[e.Assign = 2] = "Assign", e[e.Rest = 4] = "Rest", e[e.Decorate = 8] = "Decorate", e[
- e.ESDecorateAndRunInitializers = 8
- /* Decorate */
- ] = "ESDecorateAndRunInitializers", e[e.Metadata = 16] = "Metadata", e[e.Param = 32] = "Param", e[e.Awaiter = 64] = "Awaiter", e[e.Generator = 128] = "Generator", e[e.Values = 256] = "Values", e[e.Read = 512] = "Read", e[e.SpreadArray = 1024] = "SpreadArray", e[e.Await = 2048] = "Await", e[e.AsyncGenerator = 4096] = "AsyncGenerator", e[e.AsyncDelegator = 8192] = "AsyncDelegator", e[e.AsyncValues = 16384] = "AsyncValues", e[e.ExportStar = 32768] = "ExportStar", e[e.ImportStar = 65536] = "ImportStar", e[e.ImportDefault = 131072] = "ImportDefault", e[e.MakeTemplateObject = 262144] = "MakeTemplateObject", e[e.ClassPrivateFieldGet = 524288] = "ClassPrivateFieldGet", e[e.ClassPrivateFieldSet = 1048576] = "ClassPrivateFieldSet", e[e.ClassPrivateFieldIn = 2097152] = "ClassPrivateFieldIn", e[e.SetFunctionName = 4194304] = "SetFunctionName", e[e.PropKey = 8388608] = "PropKey", e[e.AddDisposableResourceAndDisposeResources = 16777216] = "AddDisposableResourceAndDisposeResources", e[
- e.FirstEmitHelper = 1
- /* Extends */
- ] = "FirstEmitHelper", e[
- e.LastEmitHelper = 16777216
- /* AddDisposableResourceAndDisposeResources */
- ] = "LastEmitHelper", e[
- e.ForOfIncludes = 256
- /* Values */
- ] = "ForOfIncludes", e[
- e.ForAwaitOfIncludes = 16384
- /* AsyncValues */
- ] = "ForAwaitOfIncludes", e[e.AsyncGeneratorIncludes = 6144] = "AsyncGeneratorIncludes", e[e.AsyncDelegatorIncludes = 26624] = "AsyncDelegatorIncludes", e[e.SpreadIncludes = 1536] = "SpreadIncludes", e))(LQ || {}), MQ = /* @__PURE__ */ ((e) => (e[e.SourceFile = 0] = "SourceFile", e[e.Expression = 1] = "Expression", e[e.IdentifierName = 2] = "IdentifierName", e[e.MappedTypeParameter = 3] = "MappedTypeParameter", e[e.Unspecified = 4] = "Unspecified", e[e.EmbeddedStatement = 5] = "EmbeddedStatement", e[e.JsxAttributeValue = 6] = "JsxAttributeValue", e[e.ImportTypeNodeAttributes = 7] = "ImportTypeNodeAttributes", e))(MQ || {}), RQ = /* @__PURE__ */ ((e) => (e[e.Parentheses = 1] = "Parentheses", e[e.TypeAssertions = 2] = "TypeAssertions", e[e.NonNullAssertions = 4] = "NonNullAssertions", e[e.PartiallyEmittedExpressions = 8] = "PartiallyEmittedExpressions", e[e.ExpressionsWithTypeArguments = 16] = "ExpressionsWithTypeArguments", e[e.Assertions = 6] = "Assertions", e[e.All = 31] = "All", e[e.ExcludeJSDocTypeAssertion = -2147483648] = "ExcludeJSDocTypeAssertion", e))(RQ || {}), jQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InParameters = 1] = "InParameters", e[e.VariablesHoistedInParameters = 2] = "VariablesHoistedInParameters", e))(jQ || {}), BQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.SingleLine = 0] = "SingleLine", e[e.MultiLine = 1] = "MultiLine", e[e.PreserveLines = 2] = "PreserveLines", e[e.LinesMask = 3] = "LinesMask", e[e.NotDelimited = 0] = "NotDelimited", e[e.BarDelimited = 4] = "BarDelimited", e[e.AmpersandDelimited = 8] = "AmpersandDelimited", e[e.CommaDelimited = 16] = "CommaDelimited", e[e.AsteriskDelimited = 32] = "AsteriskDelimited", e[e.DelimitersMask = 60] = "DelimitersMask", e[e.AllowTrailingComma = 64] = "AllowTrailingComma", e[e.Indented = 128] = "Indented", e[e.SpaceBetweenBraces = 256] = "SpaceBetweenBraces", e[e.SpaceBetweenSiblings = 512] = "SpaceBetweenSiblings", e[e.Braces = 1024] = "Braces", e[e.Parenthesis = 2048] = "Parenthesis", e[e.AngleBrackets = 4096] = "AngleBrackets", e[e.SquareBrackets = 8192] = "SquareBrackets", e[e.BracketsMask = 15360] = "BracketsMask", e[e.OptionalIfUndefined = 16384] = "OptionalIfUndefined", e[e.OptionalIfEmpty = 32768] = "OptionalIfEmpty", e[e.Optional = 49152] = "Optional", e[e.PreferNewLine = 65536] = "PreferNewLine", e[e.NoTrailingNewLine = 131072] = "NoTrailingNewLine", e[e.NoInterveningComments = 262144] = "NoInterveningComments", e[e.NoSpaceIfEmpty = 524288] = "NoSpaceIfEmpty", e[e.SingleElement = 1048576] = "SingleElement", e[e.SpaceAfterList = 2097152] = "SpaceAfterList", e[e.Modifiers = 2359808] = "Modifiers", e[e.HeritageClauses = 512] = "HeritageClauses", e[e.SingleLineTypeLiteralMembers = 768] = "SingleLineTypeLiteralMembers", e[e.MultiLineTypeLiteralMembers = 32897] = "MultiLineTypeLiteralMembers", e[e.SingleLineTupleTypeElements = 528] = "SingleLineTupleTypeElements", e[e.MultiLineTupleTypeElements = 657] = "MultiLineTupleTypeElements", e[e.UnionTypeConstituents = 516] = "UnionTypeConstituents", e[e.IntersectionTypeConstituents = 520] = "IntersectionTypeConstituents", e[e.ObjectBindingPatternElements = 525136] = "ObjectBindingPatternElements", e[e.ArrayBindingPatternElements = 524880] = "ArrayBindingPatternElements", e[e.ObjectLiteralExpressionProperties = 526226] = "ObjectLiteralExpressionProperties", e[e.ImportAttributes = 526226] = "ImportAttributes", e[
- e.ImportClauseEntries = 526226
- /* ImportAttributes */
- ] = "ImportClauseEntries", e[e.ArrayLiteralExpressionElements = 8914] = "ArrayLiteralExpressionElements", e[e.CommaListElements = 528] = "CommaListElements", e[e.CallExpressionArguments = 2576] = "CallExpressionArguments", e[e.NewExpressionArguments = 18960] = "NewExpressionArguments", e[e.TemplateExpressionSpans = 262144] = "TemplateExpressionSpans", e[e.SingleLineBlockStatements = 768] = "SingleLineBlockStatements", e[e.MultiLineBlockStatements = 129] = "MultiLineBlockStatements", e[e.VariableDeclarationList = 528] = "VariableDeclarationList", e[e.SingleLineFunctionBodyStatements = 768] = "SingleLineFunctionBodyStatements", e[
- e.MultiLineFunctionBodyStatements = 1
- /* MultiLine */
- ] = "MultiLineFunctionBodyStatements", e[
- e.ClassHeritageClauses = 0
- /* SingleLine */
- ] = "ClassHeritageClauses", e[e.ClassMembers = 129] = "ClassMembers", e[e.InterfaceMembers = 129] = "InterfaceMembers", e[e.EnumMembers = 145] = "EnumMembers", e[e.CaseBlockClauses = 129] = "CaseBlockClauses", e[e.NamedImportsOrExportsElements = 525136] = "NamedImportsOrExportsElements", e[e.JsxElementOrFragmentChildren = 262144] = "JsxElementOrFragmentChildren", e[e.JsxElementAttributes = 262656] = "JsxElementAttributes", e[e.CaseOrDefaultClauseStatements = 163969] = "CaseOrDefaultClauseStatements", e[e.HeritageClauseTypes = 528] = "HeritageClauseTypes", e[e.SourceFileStatements = 131073] = "SourceFileStatements", e[e.Decorators = 2146305] = "Decorators", e[e.TypeArguments = 53776] = "TypeArguments", e[e.TypeParameters = 53776] = "TypeParameters", e[e.Parameters = 2576] = "Parameters", e[e.IndexSignatureParameters = 8848] = "IndexSignatureParameters", e[e.JSDocComment = 33] = "JSDocComment", e))(BQ || {}), JQ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.TripleSlashXML = 1] = "TripleSlashXML", e[e.SingleLine = 2] = "SingleLine", e[e.MultiLine = 4] = "MultiLine", e[e.All = 7] = "All", e[
- e.Default = 7
- /* All */
- ] = "Default", e))(JQ || {}), TI = {
- reference: {
- args: [
- { name: "types", optional: !0, captureSpan: !0 },
- { name: "lib", optional: !0, captureSpan: !0 },
- { name: "path", optional: !0, captureSpan: !0 },
- { name: "no-default-lib", optional: !0 },
- { name: "resolution-mode", optional: !0 },
- { name: "preserve", optional: !0 }
- ],
- kind: 1
- /* TripleSlashXML */
- },
- "amd-dependency": {
- args: [{ name: "path" }, { name: "name", optional: !0 }],
- kind: 1
- /* TripleSlashXML */
- },
- "amd-module": {
- args: [{ name: "name" }],
- kind: 1
- /* TripleSlashXML */
- },
- "ts-check": {
- kind: 2
- /* SingleLine */
- },
- "ts-nocheck": {
- kind: 2
- /* SingleLine */
- },
- jsx: {
- args: [{ name: "factory" }],
- kind: 4
- /* MultiLine */
- },
- jsxfrag: {
- args: [{ name: "factory" }],
- kind: 4
- /* MultiLine */
- },
- jsximportsource: {
- args: [{ name: "factory" }],
- kind: 4
- /* MultiLine */
- },
- jsxruntime: {
- args: [{ name: "factory" }],
- kind: 4
- /* MultiLine */
- }
- }, zQ = /* @__PURE__ */ ((e) => (e[e.ParseAll = 0] = "ParseAll", e[e.ParseNone = 1] = "ParseNone", e[e.ParseForTypeErrors = 2] = "ParseForTypeErrors", e[e.ParseForTypeInfo = 3] = "ParseForTypeInfo", e))(zQ || {});
- function WE(e) {
- let t = 5381;
- for (let n = 0; n < e.length; n++)
- t = (t << 5) + t + e.charCodeAt(n);
- return t.toString();
- }
- function Ame() {
- Error.stackTraceLimit < 100 && (Error.stackTraceLimit = 100);
- }
- var WQ = /* @__PURE__ */ ((e) => (e[e.Created = 0] = "Created", e[e.Changed = 1] = "Changed", e[e.Deleted = 2] = "Deleted", e))(WQ || {}), qR = /* @__PURE__ */ ((e) => (e[e.High = 2e3] = "High", e[e.Medium = 500] = "Medium", e[e.Low = 250] = "Low", e))(qR || {}), q_ = /* @__PURE__ */ new Date(0);
- function RT(e, t) {
- return e.getModifiedTime(t) || q_;
- }
- function UQ(e) {
- return {
- 250: e.Low,
- 500: e.Medium,
- 2e3: e.High
- };
- }
- var HR = { Low: 32, Medium: 64, High: 256 }, GR = UQ(HR), xI = UQ(HR);
- function _5e(e) {
- if (!e.getEnvironmentVariable)
- return;
- const t = s("TSC_WATCH_POLLINGINTERVAL", qR);
- GR = o("TSC_WATCH_POLLINGCHUNKSIZE", HR) || GR, xI = o("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", HR) || xI;
- function n(c, _) {
- return e.getEnvironmentVariable(`${c}_${_.toUpperCase()}`);
- }
- function i(c) {
- let _;
- return u("Low"), u("Medium"), u("High"), _;
- function u(d) {
- const g = n(c, d);
- g && ((_ || (_ = {}))[d] = Number(g));
- }
- }
- function s(c, _) {
- const u = i(c);
- if (u)
- return d("Low"), d("Medium"), d("High"), !0;
- return !1;
- function d(g) {
- _[g] = u[g] || _[g];
- }
- }
- function o(c, _) {
- const u = i(c);
- return (t || u) && UQ(u ? { ..._, ...u } : _);
- }
- }
- function Nme(e, t, n, i, s) {
- let o = n;
- for (let _ = t.length; i && _; c(), _--) {
- const u = t[n];
- if (u) {
- if (u.isClosed) {
- t[n] = void 0;
- continue;
- }
- } else continue;
- i--;
- const d = m5e(u, RT(e, u.fileName));
- if (u.isClosed) {
- t[n] = void 0;
- continue;
- }
- s?.(u, n, d), t[n] && (o < n && (t[o] = u, t[n] = void 0), o++);
- }
- return n;
- function c() {
- n++, n === t.length && (o < n && (t.length = o), n = 0, o = 0);
- }
- }
- function f5e(e) {
- const t = [], n = [], i = _(
- 250
- /* Low */
- ), s = _(
- 500
- /* Medium */
- ), o = _(
- 2e3
- /* High */
- );
- return c;
- function c(P, I, F) {
- const O = {
- fileName: P,
- callback: I,
- unchangedPolls: 0,
- mtime: RT(e, P)
- };
- return t.push(O), S(O, F), {
- close: () => {
- O.isClosed = !0, LT(t, O);
- }
- };
- }
- function _(P) {
- const I = [];
- return I.pollingInterval = P, I.pollIndex = 0, I.pollScheduled = !1, I;
- }
- function u(P, I) {
- I.pollIndex = g(I, I.pollingInterval, I.pollIndex, GR[I.pollingInterval]), I.length ? D(I.pollingInterval) : (E.assert(I.pollIndex === 0), I.pollScheduled = !1);
- }
- function d(P, I) {
- g(
- n,
- 250,
- /*pollIndex*/
- 0,
- n.length
- ), u(P, I), !I.pollScheduled && n.length && D(
- 250
- /* Low */
- );
- }
- function g(P, I, F, O) {
- return Nme(
- e,
- P,
- F,
- O,
- B
- );
- function B(z, X, q) {
- q ? (z.unchangedPolls = 0, P !== n && (P[X] = void 0, T(z))) : z.unchangedPolls !== xI[I] ? z.unchangedPolls++ : P === n ? (z.unchangedPolls = 1, P[X] = void 0, S(
- z,
- 250
- /* Low */
- )) : I !== 2e3 && (z.unchangedPolls++, P[X] = void 0, S(
- z,
- I === 250 ? 500 : 2e3
- /* High */
- ));
- }
- }
- function h(P) {
- switch (P) {
- case 250:
- return i;
- case 500:
- return s;
- case 2e3:
- return o;
- }
- }
- function S(P, I) {
- h(I).push(P), C(I);
- }
- function T(P) {
- n.push(P), C(
- 250
- /* Low */
- );
- }
- function C(P) {
- h(P).pollScheduled || D(P);
- }
- function D(P) {
- h(P).pollScheduled = e.setTimeout(P === 250 ? d : u, P, P === 250 ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", h(P));
- }
- }
- function p5e(e, t, n, i) {
- const s = Ip(), o = i ? /* @__PURE__ */ new Map() : void 0, c = /* @__PURE__ */ new Map(), _ = zl(t);
- return u;
- function u(g, h, S, T) {
- const C = _(g);
- s.add(C, h).length === 1 && o && o.set(C, n(g) || q_);
- const D = Xn(C) || ".", P = c.get(D) || d(Xn(g) || ".", D, T);
- return P.referenceCount++, {
- close: () => {
- P.referenceCount === 1 ? (P.close(), c.delete(D)) : P.referenceCount--, s.remove(C, h);
- }
- };
- }
- function d(g, h, S) {
- const T = e(
- g,
- 1,
- (C, D) => {
- if (!_s(D)) return;
- const P = es(D, g), I = _(P), F = P && s.get(I);
- if (F) {
- let O, B = 1;
- if (o) {
- const z = o.get(I);
- if (C === "change" && (O = n(P) || q_, O.getTime() === z.getTime()))
- return;
- O || (O = n(P) || q_), o.set(I, O), z === q_ ? B = 0 : O === q_ && (B = 2);
- }
- for (const z of F)
- z(P, B, O);
- }
- },
- /*recursive*/
- !1,
- 500,
- S
- );
- return T.referenceCount = 0, c.set(h, T), T;
- }
- }
- function d5e(e) {
- const t = [];
- let n = 0, i;
- return s;
- function s(_, u) {
- const d = {
- fileName: _,
- callback: u,
- mtime: RT(e, _)
- };
- return t.push(d), c(), {
- close: () => {
- d.isClosed = !0, LT(t, d);
- }
- };
- }
- function o() {
- i = void 0, n = Nme(e, t, n, GR[
- 250
- /* Low */
- ]), c();
- }
- function c() {
- !t.length || i || (i = e.setTimeout(o, 2e3, "pollQueue"));
- }
- }
- function Ime(e, t, n, i, s) {
- const c = zl(t)(n), _ = e.get(c);
- return _ ? _.callbacks.push(i) : e.set(c, {
- watcher: s(
- // Cant infer types correctly so lets satisfy checker
- (u, d, g) => {
- var h;
- return (h = e.get(c)) == null ? void 0 : h.callbacks.slice().forEach((S) => S(u, d, g));
- }
- ),
- callbacks: [i]
- }), {
- close: () => {
- const u = e.get(c);
- u && (!OE(u.callbacks, i) || u.callbacks.length || (e.delete(c), mp(u)));
- }
- };
- }
- function m5e(e, t) {
- const n = e.mtime.getTime(), i = t.getTime();
- return n !== i ? (e.mtime = t, e.callback(e.fileName, $R(n, i), t), !0) : !1;
- }
- function $R(e, t) {
- return e === 0 ? 0 : t === 0 ? 2 : 1;
- }
- var kI = ["/node_modules/.", "/.git", "/.#"], Ome = ja;
- function uw(e) {
- return Ome(e);
- }
- function VQ(e) {
- Ome = e;
- }
- function g5e({
- watchDirectory: e,
- useCaseSensitiveFileNames: t,
- getCurrentDirectory: n,
- getAccessibleSortedChildDirectories: i,
- fileSystemEntryExists: s,
- realpath: o,
- setTimeout: c,
- clearTimeout: _
- }) {
- const u = /* @__PURE__ */ new Map(), d = Ip(), g = /* @__PURE__ */ new Map();
- let h;
- const S = Kk(!t), T = zl(t);
- return (V, ae, ee, G) => ee ? C(V, G, ae) : e(V, ae, ee, G);
- function C(V, ae, ee, G) {
- const ue = T(V);
- let re = u.get(ue);
- re ? re.refCount++ : (re = {
- watcher: e(
- V,
- (ie) => {
- var Se;
- X(ie, ae) || (ae?.synchronousWatchDirectory ? ((Se = u.get(ue)) != null && Se.targetWatcher || D(V, ue, ie), z(V, ue, ae)) : P(V, ue, ie, ae));
- },
- /*recursive*/
- !1,
- ae
- ),
- refCount: 1,
- childWatches: Ue,
- targetWatcher: void 0,
- links: void 0
- }, u.set(ue, re), z(V, ue, ae)), G && (re.links ?? (re.links = /* @__PURE__ */ new Set())).add(G);
- const ne = ee && { dirName: V, callback: ee };
- return ne && d.add(ue, ne), {
- dirName: V,
- close: () => {
- var ie;
- const Se = E.checkDefined(u.get(ue));
- ne && d.remove(ue, ne), G && ((ie = Se.links) == null || ie.delete(G)), Se.refCount--, !Se.refCount && (u.delete(ue), Se.links = void 0, mp(Se), B(Se), Se.childWatches.forEach(fd));
- }
- };
- }
- function D(V, ae, ee, G) {
- var ue, re;
- let ne, ie;
- _s(ee) ? ne = ee : ie = ee, d.forEach((Se, J) => {
- if (!(ie && ie.get(J) === !0) && (J === ae || Ui(ae, J) && ae[J.length] === Vo))
- if (ie)
- if (G) {
- const oe = ie.get(J);
- oe ? oe.push(...G) : ie.set(J, G.slice());
- } else
- ie.set(J, !0);
- else
- Se.forEach(({ callback: oe }) => oe(ne));
- }), (re = (ue = u.get(ae)) == null ? void 0 : ue.links) == null || re.forEach((Se) => {
- const J = (oe) => Bn(Se, ld(V, oe, T));
- ie ? D(Se, T(Se), ie, G?.map(J)) : D(Se, T(Se), J(ne));
- });
- }
- function P(V, ae, ee, G) {
- const ue = u.get(ae);
- if (ue && s(
- V,
- 1
- /* Directory */
- )) {
- I(V, ae, ee, G);
- return;
- }
- D(V, ae, ee), B(ue), O(ue);
- }
- function I(V, ae, ee, G) {
- const ue = g.get(ae);
- ue ? ue.fileNames.push(ee) : g.set(ae, { dirName: V, options: G, fileNames: [ee] }), h && (_(h), h = void 0), h = c(F, 1e3, "timerToUpdateChildWatches");
- }
- function F() {
- var V;
- h = void 0, uw(`sysLog:: onTimerToUpdateChildWatches:: ${g.size}`);
- const ae = lo(), ee = /* @__PURE__ */ new Map();
- for (; !h && g.size; ) {
- const ue = g.entries().next();
- E.assert(!ue.done);
- const { value: [re, { dirName: ne, options: ie, fileNames: Se }] } = ue;
- g.delete(re);
- const J = z(ne, re, ie);
- (V = u.get(re)) != null && V.targetWatcher || D(ne, re, ee, J ? void 0 : Se);
- }
- uw(`sysLog:: invokingWatchers:: Elapsed:: ${lo() - ae}ms:: ${g.size}`), d.forEach((ue, re) => {
- const ne = ee.get(re);
- ne && ue.forEach(({ callback: ie, dirName: Se }) => {
- us(ne) ? ne.forEach(ie) : ie(Se);
- });
- });
- const G = lo() - ae;
- uw(`sysLog:: Elapsed:: ${G}ms:: onTimerToUpdateChildWatches:: ${g.size} ${h}`);
- }
- function O(V) {
- if (!V) return;
- const ae = V.childWatches;
- V.childWatches = Ue;
- for (const ee of ae)
- ee.close(), O(u.get(T(ee.dirName)));
- }
- function B(V) {
- V?.targetWatcher && (V.targetWatcher.close(), V.targetWatcher = void 0);
- }
- function z(V, ae, ee) {
- const G = u.get(ae);
- if (!G) return !1;
- const ue = Os(o(V));
- let re, ne;
- return S(ue, V) === 0 ? re = yI(
- s(
- V,
- 1
- /* Directory */
- ) ? Ai(i(V), (J) => {
- const oe = es(J, V);
- return !X(oe, ee) && S(oe, Os(o(oe))) === 0 ? oe : void 0;
- }) : Ue,
- G.childWatches,
- (J, oe) => S(J, oe.dirName),
- ie,
- fd,
- Se
- ) : G.targetWatcher && S(ue, G.targetWatcher.dirName) === 0 ? (re = !1, E.assert(G.childWatches === Ue)) : (B(G), G.targetWatcher = C(
- ue,
- ee,
- /*callback*/
- void 0,
- V
- ), G.childWatches.forEach(fd), re = !0), G.childWatches = ne || Ue, re;
- function ie(J) {
- const oe = C(J, ee);
- Se(oe);
- }
- function Se(J) {
- (ne || (ne = [])).push(J);
- }
- }
- function X(V, ae) {
- return ut(kI, (ee) => q(V, ee)) || Fme(V, ae, t, n);
- }
- function q(V, ae) {
- return V.includes(ae) ? !0 : t ? !1 : T(V).includes(ae);
- }
- }
- var qQ = /* @__PURE__ */ ((e) => (e[e.File = 0] = "File", e[e.Directory = 1] = "Directory", e))(qQ || {});
- function h5e(e) {
- return (t, n, i) => e(n === 1 ? "change" : "rename", "", i);
- }
- function y5e(e, t, n) {
- return (i, s, o) => {
- i === "rename" ? (o || (o = n(e) || q_), t(e, o !== q_ ? 0 : 2, o)) : t(e, 1, o);
- };
- }
- function Fme(e, t, n, i) {
- return (t?.excludeDirectories || t?.excludeFiles) && (PO(e, t?.excludeFiles, n, i()) || PO(e, t?.excludeDirectories, n, i()));
- }
- function Lme(e, t, n, i, s) {
- return (o, c) => {
- if (o === "rename") {
- const _ = c ? Os(Bn(e, c)) : e;
- (!c || !Fme(_, n, i, s)) && t(_);
- }
- };
- }
- function HQ({
- pollingWatchFileWorker: e,
- getModifiedTime: t,
- setTimeout: n,
- clearTimeout: i,
- fsWatchWorker: s,
- fileSystemEntryExists: o,
- useCaseSensitiveFileNames: c,
- getCurrentDirectory: _,
- fsSupportsRecursiveFsWatch: u,
- getAccessibleSortedChildDirectories: d,
- realpath: g,
- tscWatchFile: h,
- useNonPollingWatchers: S,
- tscWatchDirectory: T,
- inodeWatching: C,
- fsWatchWithTimestamp: D,
- sysLog: P
- }) {
- const I = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
- let B, z, X, q, V = !1;
- return {
- watchFile: ae,
- watchDirectory: ne
- };
- function ae(le, me, ve, tt) {
- tt = ue(tt, S);
- const Te = E.checkDefined(tt.watchFile);
- switch (Te) {
- case 0:
- return J(
- le,
- me,
- 250,
- /*options*/
- void 0
- );
- case 1:
- return J(
- le,
- me,
- ve,
- /*options*/
- void 0
- );
- case 2:
- return ee()(
- le,
- me,
- ve,
- /*options*/
- void 0
- );
- case 3:
- return G()(
- le,
- me,
- /* pollingInterval */
- void 0,
- /*options*/
- void 0
- );
- case 4:
- return oe(
- le,
- 0,
- y5e(le, me, t),
- /*recursive*/
- !1,
- ve,
- BA(tt)
- );
- case 5:
- return X || (X = p5e(oe, c, t, D)), X(le, me, ve, BA(tt));
- default:
- E.assertNever(Te);
- }
- }
- function ee() {
- return B || (B = f5e({ getModifiedTime: t, setTimeout: n }));
- }
- function G() {
- return z || (z = d5e({ getModifiedTime: t, setTimeout: n }));
- }
- function ue(le, me) {
- if (le && le.watchFile !== void 0) return le;
- switch (h) {
- case "PriorityPollingInterval":
- return {
- watchFile: 1
- /* PriorityPollingInterval */
- };
- case "DynamicPriorityPolling":
- return {
- watchFile: 2
- /* DynamicPriorityPolling */
- };
- case "UseFsEvents":
- return re(4, 1, le);
- case "UseFsEventsWithFallbackDynamicPolling":
- return re(4, 2, le);
- case "UseFsEventsOnParentDirectory":
- me = !0;
- default:
- return me ? (
- // Use notifications from FS to watch with falling back to fs.watchFile
- re(5, 1, le)
- ) : (
- // Default to using fs events
- {
- watchFile: 4
- /* UseFsEvents */
- }
- );
- }
- }
- function re(le, me, ve) {
- const tt = ve?.fallbackPolling;
- return {
- watchFile: le,
- fallbackPolling: tt === void 0 ? me : tt
- };
- }
- function ne(le, me, ve, tt) {
- return u ? oe(
- le,
- 1,
- Lme(le, me, tt, c, _),
- ve,
- 500,
- BA(tt)
- ) : (q || (q = g5e({
- useCaseSensitiveFileNames: c,
- getCurrentDirectory: _,
- fileSystemEntryExists: o,
- getAccessibleSortedChildDirectories: d,
- watchDirectory: ie,
- realpath: g,
- setTimeout: n,
- clearTimeout: i
- })), q(le, me, ve, tt));
- }
- function ie(le, me, ve, tt) {
- E.assert(!ve);
- const Te = Se(tt), we = E.checkDefined(Te.watchDirectory);
- switch (we) {
- case 1:
- return J(
- le,
- () => me(le),
- 500,
- /*options*/
- void 0
- );
- case 2:
- return ee()(
- le,
- () => me(le),
- 500,
- /*options*/
- void 0
- );
- case 3:
- return G()(
- le,
- () => me(le),
- /* pollingInterval */
- void 0,
- /*options*/
- void 0
- );
- case 0:
- return oe(
- le,
- 1,
- Lme(le, me, tt, c, _),
- ve,
- 500,
- BA(Te)
- );
- default:
- E.assertNever(we);
- }
- }
- function Se(le) {
- if (le && le.watchDirectory !== void 0) return le;
- switch (T) {
- case "RecursiveDirectoryUsingFsWatchFile":
- return {
- watchDirectory: 1
- /* FixedPollingInterval */
- };
- case "RecursiveDirectoryUsingDynamicPriorityPolling":
- return {
- watchDirectory: 2
- /* DynamicPriorityPolling */
- };
- default:
- const me = le?.fallbackPolling;
- return {
- watchDirectory: 0,
- fallbackPolling: me !== void 0 ? me : void 0
- };
- }
- }
- function J(le, me, ve, tt) {
- return Ime(
- I,
- c,
- le,
- me,
- (Te) => e(le, Te, ve, tt)
- );
- }
- function oe(le, me, ve, tt, Te, we) {
- return Ime(
- tt ? O : F,
- c,
- le,
- ve,
- (fe) => _e(le, me, fe, tt, Te, we)
- );
- }
- function _e(le, me, ve, tt, Te, we) {
- let fe, Me;
- C && (fe = le.substring(le.lastIndexOf(Vo)), Me = fe.slice(Vo.length));
- let Qe = o(le, me) ? Re() : _r();
- return {
- close: () => {
- Qe && (Qe.close(), Qe = void 0);
- }
- };
- function et(Ir) {
- Qe && (P(`sysLog:: ${le}:: Changing watcher to ${Ir === Re ? "Present" : "Missing"}FileSystemEntryWatcher`), Qe.close(), Qe = Ir());
- }
- function Re() {
- if (V)
- return P(`sysLog:: ${le}:: Defaulting to watchFile`), Wt();
- try {
- const Ir = (me === 1 || !D ? s : he)(
- le,
- tt,
- C ? ft : ve
- );
- return Ir.on("error", () => {
- ve("rename", ""), et(_r);
- }), Ir;
- } catch (Ir) {
- return V || (V = Ir.code === "ENOSPC"), P(`sysLog:: ${le}:: Changing to watchFile`), Wt();
- }
- }
- function ft(Ir, jr) {
- let Nt;
- if (jr && Zo(jr, "~") && (Nt = jr, jr = jr.slice(0, jr.length - 1)), Ir === "rename" && (!jr || jr === Me || Zo(jr, fe))) {
- const Qt = t(le) || q_;
- Nt && ve(Ir, Nt, Qt), ve(Ir, jr, Qt), C ? et(Qt === q_ ? _r : Re) : Qt === q_ && et(_r);
- } else
- Nt && ve(Ir, Nt), ve(Ir, jr);
- }
- function Wt() {
- return ae(
- le,
- h5e(ve),
- Te,
- we
- );
- }
- function _r() {
- return ae(
- le,
- (Ir, jr, Nt) => {
- jr === 0 && (Nt || (Nt = t(le) || q_), Nt !== q_ && (ve("rename", "", Nt), et(Re)));
- },
- Te,
- we
- );
- }
- }
- function he(le, me, ve) {
- let tt = t(le) || q_;
- return s(le, me, (Te, we, fe) => {
- Te === "change" && (fe || (fe = t(le) || q_), fe.getTime() === tt.getTime()) || (tt = fe || t(le) || q_, ve(Te, we, tt));
- });
- }
- }
- function GQ(e) {
- const t = e.writeFile;
- e.writeFile = (n, i, s) => wB(
- n,
- i,
- !!s,
- (o, c, _) => t.call(e, o, c, _),
- (o) => e.createDirectory(o),
- (o) => e.directoryExists(o)
- );
- }
- var ll = (() => {
- const e = "\uFEFF";
- function t() {
- const i = /^native |^\([^)]+\)$|^(?:internal[\\/]|[\w\s]+(?:\.js)?$)/, s = DE, o = DE, c = DE;
- let _;
- try {
- _ = DE;
- } catch {
- _ = void 0;
- }
- let u, d = "./profile.cpuprofile";
- const g = process.platform === "darwin", h = process.platform === "linux" || g, S = c.platform(), T = ae(), C = s.realpathSync.native ? process.platform === "win32" ? le : s.realpathSync.native : s.realpathSync, D = __filename.endsWith("sys.js") ? o.join(o.dirname(__dirname), "__fake__.js") : __filename, P = process.platform === "win32" || g, I = Iu(() => process.cwd()), { watchFile: F, watchDirectory: O } = HQ({
- pollingWatchFileWorker: G,
- getModifiedTime: ve,
- setTimeout,
- clearTimeout,
- fsWatchWorker: ue,
- useCaseSensitiveFileNames: T,
- getCurrentDirectory: I,
- fileSystemEntryExists: J,
- // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
- // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
- fsSupportsRecursiveFsWatch: P,
- getAccessibleSortedChildDirectories: (fe) => ie(fe).directories,
- realpath: me,
- tscWatchFile: process.env.TSC_WATCHFILE,
- useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
- tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
- inodeWatching: h,
- fsWatchWithTimestamp: g,
- sysLog: uw
- }), B = {
- args: process.argv.slice(2),
- newLine: c.EOL,
- useCaseSensitiveFileNames: T,
- write(fe) {
- process.stdout.write(fe);
- },
- getWidthOfTerminal() {
- return process.stdout.columns;
- },
- writeOutputIsTTY() {
- return process.stdout.isTTY;
- },
- readFile: re,
- writeFile: ne,
- watchFile: F,
- watchDirectory: O,
- preferNonRecursiveWatch: !P,
- resolvePath: (fe) => o.resolve(fe),
- fileExists: oe,
- directoryExists: _e,
- getAccessibleFileSystemEntries: ie,
- createDirectory(fe) {
- if (!B.directoryExists(fe))
- try {
- s.mkdirSync(fe);
- } catch (Me) {
- if (Me.code !== "EEXIST")
- throw Me;
- }
- },
- getExecutingFilePath() {
- return D;
- },
- getCurrentDirectory: I,
- getDirectories: he,
- getEnvironmentVariable(fe) {
- return process.env[fe] || "";
- },
- readDirectory: Se,
- getModifiedTime: ve,
- setModifiedTime: tt,
- deleteFile: Te,
- createHash: _ ? we : WE,
- createSHA256Hash: _ ? we : void 0,
- getMemoryUsage() {
- return p7e.gc && p7e.gc(), process.memoryUsage().heapUsed;
- },
- getFileSize(fe) {
- try {
- const Me = z(fe);
- if (Me?.isFile())
- return Me.size;
- } catch {
- }
- return 0;
- },
- exit(fe) {
- V(() => process.exit(fe));
- },
- enableCPUProfiler: X,
- disableCPUProfiler: V,
- cpuProfilingEnabled: () => !!u || ss(process.execArgv, "--cpu-prof") || ss(process.execArgv, "--prof"),
- realpath: me,
- debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || ut(process.execArgv, (fe) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(fe)) || !!process.recordreplay,
- tryEnableSourceMapsForHost() {
- try {
- DE.install();
- } catch {
- }
- },
- setTimeout,
- clearTimeout,
- clearScreen: () => {
- process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
- },
- setBlocking: () => {
- var fe;
- const Me = (fe = process.stdout) == null ? void 0 : fe._handle;
- Me && Me.setBlocking && Me.setBlocking(!0);
- },
- base64decode: (fe) => Buffer.from(fe, "base64").toString("utf8"),
- base64encode: (fe) => Buffer.from(fe).toString("base64"),
- require: (fe, Me) => {
- try {
- const Qe = mre(Me, fe, B);
- return { module: S7e(Qe), modulePath: Qe, error: void 0 };
- } catch (Qe) {
- return { module: void 0, modulePath: void 0, error: Qe };
- }
- }
- };
- return B;
- function z(fe) {
- return s.statSync(fe, { throwIfNoEntry: !1 });
- }
- function X(fe, Me) {
- if (u)
- return Me(), !1;
- const Qe = DE;
- if (!Qe || !Qe.Session)
- return Me(), !1;
- const et = new Qe.Session();
- return et.connect(), et.post("Profiler.enable", () => {
- et.post("Profiler.start", () => {
- u = et, d = fe, Me();
- });
- }), !0;
- }
- function q(fe) {
- let Me = 0;
- const Qe = /* @__PURE__ */ new Map(), et = Wl(o.dirname(D)), Re = `file://${Km(et) === 1 ? "" : "/"}${et}`;
- for (const ft of fe.nodes)
- if (ft.callFrame.url) {
- const Wt = Wl(ft.callFrame.url);
- np(Re, Wt, T) ? ft.callFrame.url = jT(
- Re,
- Wt,
- Re,
- zl(T),
- /*isAbsolutePathAnUrl*/
- !0
- ) : i.test(Wt) || (ft.callFrame.url = (Qe.has(Wt) ? Qe : Qe.set(Wt, `external${Me}.js`)).get(Wt), Me++);
- }
- return fe;
- }
- function V(fe) {
- if (u && u !== "stopping") {
- const Me = u;
- return u.post("Profiler.stop", (Qe, { profile: et }) => {
- var Re;
- if (!Qe) {
- try {
- (Re = z(d)) != null && Re.isDirectory() && (d = o.join(d, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`));
- } catch {
- }
- try {
- s.mkdirSync(o.dirname(d), { recursive: !0 });
- } catch {
- }
- s.writeFileSync(d, JSON.stringify(q(et)));
- }
- u = void 0, Me.disconnect(), fe();
- }), u = "stopping", !0;
- } else
- return fe(), !1;
- }
- function ae() {
- return S === "win32" || S === "win64" ? !1 : !oe(ee(__filename));
- }
- function ee(fe) {
- return fe.replace(/\w/g, (Me) => {
- const Qe = Me.toUpperCase();
- return Me === Qe ? Me.toLowerCase() : Qe;
- });
- }
- function G(fe, Me, Qe) {
- s.watchFile(fe, { persistent: !0, interval: Qe }, Re);
- let et;
- return {
- close: () => s.unwatchFile(fe, Re)
- };
- function Re(ft, Wt) {
- const _r = +Wt.mtime == 0 || et === 2;
- if (+ft.mtime == 0) {
- if (_r)
- return;
- et = 2;
- } else if (_r)
- et = 0;
- else {
- if (+ft.mtime == +Wt.mtime)
- return;
- et = 1;
- }
- Me(fe, et, ft.mtime);
- }
- }
- function ue(fe, Me, Qe) {
- return s.watch(
- fe,
- P ? { persistent: !0, recursive: !!Me } : { persistent: !0 },
- Qe
- );
- }
- function re(fe, Me) {
- let Qe;
- try {
- Qe = s.readFileSync(fe);
- } catch {
- return;
- }
- let et = Qe.length;
- if (et >= 2 && Qe[0] === 254 && Qe[1] === 255) {
- et &= -2;
- for (let Re = 0; Re < et; Re += 2) {
- const ft = Qe[Re];
- Qe[Re] = Qe[Re + 1], Qe[Re + 1] = ft;
- }
- return Qe.toString("utf16le", 2);
- }
- return et >= 2 && Qe[0] === 255 && Qe[1] === 254 ? Qe.toString("utf16le", 2) : et >= 3 && Qe[0] === 239 && Qe[1] === 187 && Qe[2] === 191 ? Qe.toString("utf8", 3) : Qe.toString("utf8");
- }
- function ne(fe, Me, Qe) {
- Qe && (Me = e + Me);
- let et;
- try {
- et = s.openSync(fe, "w"), s.writeSync(
- et,
- Me,
- /*position*/
- void 0,
- "utf8"
- );
- } finally {
- et !== void 0 && s.closeSync(et);
- }
- }
- function ie(fe) {
- try {
- const Me = s.readdirSync(fe || ".", { withFileTypes: !0 }), Qe = [], et = [];
- for (const Re of Me) {
- const ft = typeof Re == "string" ? Re : Re.name;
- if (ft === "." || ft === "..")
- continue;
- let Wt;
- if (typeof Re == "string" || Re.isSymbolicLink()) {
- const _r = Bn(fe, ft);
- try {
- if (Wt = z(_r), !Wt)
- continue;
- } catch {
- continue;
- }
- } else
- Wt = Re;
- Wt.isFile() ? Qe.push(ft) : Wt.isDirectory() && et.push(ft);
- }
- return Qe.sort(), et.sort(), { files: Qe, directories: et };
- } catch {
- return aJ;
- }
- }
- function Se(fe, Me, Qe, et, Re) {
- return nJ(fe, Me, Qe, et, T, process.cwd(), Re, ie, me);
- }
- function J(fe, Me) {
- const Qe = Error.stackTraceLimit;
- Error.stackTraceLimit = 0;
- try {
- const et = z(fe);
- if (!et)
- return !1;
- switch (Me) {
- case 0:
- return et.isFile();
- case 1:
- return et.isDirectory();
- default:
- return !1;
- }
- } catch {
- return !1;
- } finally {
- Error.stackTraceLimit = Qe;
- }
- }
- function oe(fe) {
- return J(
- fe,
- 0
- /* File */
- );
- }
- function _e(fe) {
- return J(
- fe,
- 1
- /* Directory */
- );
- }
- function he(fe) {
- return ie(fe).directories.slice();
- }
- function le(fe) {
- return fe.length < 260 ? s.realpathSync.native(fe) : s.realpathSync(fe);
- }
- function me(fe) {
- try {
- return C(fe);
- } catch {
- return fe;
- }
- }
- function ve(fe) {
- var Me;
- const Qe = Error.stackTraceLimit;
- Error.stackTraceLimit = 0;
- try {
- return (Me = z(fe)) == null ? void 0 : Me.mtime;
- } catch {
- return;
- } finally {
- Error.stackTraceLimit = Qe;
- }
- }
- function tt(fe, Me) {
- try {
- s.utimesSync(fe, Me, Me);
- } catch {
- return;
- }
- }
- function Te(fe) {
- try {
- return s.unlinkSync(fe);
- } catch {
- return;
- }
- }
- function we(fe) {
- const Me = _.createHash("sha256");
- return Me.update(fe), Me.digest("hex");
- }
- }
- let n;
- return CR() && (n = t()), n && GQ(n), n;
- })();
- function Mme(e) {
- ll = e;
- }
- ll && ll.getEnvironmentVariable && (_5e(ll), E.setAssertionLevel(
- /^development$/i.test(ll.getEnvironmentVariable("NODE_ENV")) ? 1 : 0
- /* None */
- )), ll && ll.debugMode && (E.isDebugging = !0);
- var Vo = "/", CI = "\\", Rme = "://", v5e = /\\/g;
- function XR(e) {
- return e === 47 || e === 92;
- }
- function $Q(e) {
- return EI(e) < 0;
- }
- function H_(e) {
- return EI(e) > 0;
- }
- function QR(e) {
- const t = EI(e);
- return t > 0 && t === e.length;
- }
- function UE(e) {
- return EI(e) !== 0;
- }
- function If(e) {
- return /^\.\.?(?:$|[\\/])/.test(e);
- }
- function YR(e) {
- return !UE(e) && !If(e);
- }
- function tC(e) {
- return Hc(e).includes(".");
- }
- function qo(e, t) {
- return e.length > t.length && Zo(e, t);
- }
- function xc(e, t) {
- for (const n of t)
- if (qo(e, n))
- return !0;
- return !1;
- }
- function xy(e) {
- return e.length > 0 && XR(e.charCodeAt(e.length - 1));
- }
- function jme(e) {
- return e >= 97 && e <= 122 || e >= 65 && e <= 90;
- }
- function b5e(e, t) {
- const n = e.charCodeAt(t);
- if (n === 58) return t + 1;
- if (n === 37 && e.charCodeAt(t + 1) === 51) {
- const i = e.charCodeAt(t + 2);
- if (i === 97 || i === 65) return t + 3;
- }
- return -1;
- }
- function EI(e) {
- if (!e) return 0;
- const t = e.charCodeAt(0);
- if (t === 47 || t === 92) {
- if (e.charCodeAt(1) !== t) return 1;
- const i = e.indexOf(t === 47 ? Vo : CI, 2);
- return i < 0 ? e.length : i + 1;
- }
- if (jme(t) && e.charCodeAt(1) === 58) {
- const i = e.charCodeAt(2);
- if (i === 47 || i === 92) return 3;
- if (e.length === 2) return 2;
- }
- const n = e.indexOf(Rme);
- if (n !== -1) {
- const i = n + Rme.length, s = e.indexOf(Vo, i);
- if (s !== -1) {
- const o = e.slice(0, n), c = e.slice(i, s);
- if (o === "file" && (c === "" || c === "localhost") && jme(e.charCodeAt(s + 1))) {
- const _ = b5e(e, s + 2);
- if (_ !== -1) {
- if (e.charCodeAt(_) === 47)
- return ~(_ + 1);
- if (_ === e.length)
- return ~_;
- }
- }
- return ~(s + 1);
- }
- return ~e.length;
- }
- return 0;
- }
- function Km(e) {
- const t = EI(e);
- return t < 0 ? ~t : t;
- }
- function Xn(e) {
- e = Wl(e);
- const t = Km(e);
- return t === e.length ? e : (e = W1(e), e.slice(0, Math.max(t, e.lastIndexOf(Vo))));
- }
- function Hc(e, t, n) {
- if (e = Wl(e), Km(e) === e.length) return "";
- e = W1(e);
- const s = e.slice(Math.max(Km(e), e.lastIndexOf(Vo) + 1)), o = t !== void 0 && n !== void 0 ? rC(s, t, n) : void 0;
- return o ? s.slice(0, s.length - o.length) : s;
- }
- function Bme(e, t, n) {
- if (Ui(t, ".") || (t = "." + t), e.length >= t.length && e.charCodeAt(e.length - t.length) === 46) {
- const i = e.slice(e.length - t.length);
- if (n(i, t))
- return i;
- }
- }
- function S5e(e, t, n) {
- if (typeof t == "string")
- return Bme(e, t, n) || "";
- for (const i of t) {
- const s = Bme(e, i, n);
- if (s) return s;
- }
- return "";
- }
- function rC(e, t, n) {
- if (t)
- return S5e(W1(e), t, n ? Sy : ub);
- const i = Hc(e), s = i.lastIndexOf(".");
- return s >= 0 ? i.substring(s) : "";
- }
- function T5e(e, t) {
- const n = e.substring(0, t), i = e.substring(t).split(Vo);
- return i.length && !Ro(i) && i.pop(), [n, ...i];
- }
- function Cl(e, t = "") {
- return e = Bn(t, e), T5e(e, Km(e));
- }
- function p0(e, t) {
- return e.length === 0 ? "" : (e[0] && ul(e[0])) + e.slice(1, t).join(Vo);
- }
- function Wl(e) {
- return e.includes("\\") ? e.replace(v5e, Vo) : e;
- }
- function V2(e) {
- if (!ut(e)) return [];
- const t = [e[0]];
- for (let n = 1; n < e.length; n++) {
- const i = e[n];
- if (i && i !== ".") {
- if (i === "..") {
- if (t.length > 1) {
- if (t[t.length - 1] !== "..") {
- t.pop();
- continue;
- }
- } else if (t[0]) continue;
- }
- t.push(i);
- }
- }
- return t;
- }
- function Bn(e, ...t) {
- e && (e = Wl(e));
- for (let n of t)
- n && (n = Wl(n), !e || Km(n) !== 0 ? e = n : e = ul(e) + n);
- return e;
- }
- function z1(e, ...t) {
- return Os(ut(t) ? Bn(e, ...t) : Wl(e));
- }
- function _w(e, t) {
- return V2(Cl(e, t));
- }
- function es(e, t) {
- return p0(_w(e, t));
- }
- function Os(e) {
- if (e = Wl(e), !KR.test(e))
- return e;
- const t = e.replace(/\/\.\//g, "/").replace(/^\.\//, "");
- if (t !== e && (e = t, !KR.test(e)))
- return e;
- const n = p0(V2(Cl(e)));
- return n && xy(e) ? ul(n) : n;
- }
- function x5e(e) {
- return e.length === 0 ? "" : e.slice(1).join(Vo);
- }
- function ZR(e, t) {
- return x5e(_w(e, t));
- }
- function uo(e, t, n) {
- const i = H_(e) ? Os(e) : es(e, t);
- return n(i);
- }
- function W1(e) {
- return xy(e) ? e.substr(0, e.length - 1) : e;
- }
- function ul(e) {
- return xy(e) ? e : e + Vo;
- }
- function q2(e) {
- return !UE(e) && !If(e) ? "./" + e : e;
- }
- function fw(e, t, n, i) {
- const s = n !== void 0 && i !== void 0 ? rC(e, n, i) : rC(e);
- return s ? e.slice(0, e.length - s.length) + (Ui(t, ".") ? t : "." + t) : e;
- }
- function DI(e, t) {
- const n = uz(e);
- return n ? e.slice(0, e.length - n.length) + (Ui(t, ".") ? t : "." + t) : fw(e, t);
- }
- var KR = /\/\/|(?:^|\/)\.\.?(?:$|\/)/;
- function XQ(e, t, n) {
- if (e === t) return 0;
- if (e === void 0) return -1;
- if (t === void 0) return 1;
- const i = e.substring(0, Km(e)), s = t.substring(0, Km(t)), o = sw(i, s);
- if (o !== 0)
- return o;
- const c = e.substring(i.length), _ = t.substring(s.length);
- if (!KR.test(c) && !KR.test(_))
- return n(c, _);
- const u = V2(Cl(e)), d = V2(Cl(t)), g = Math.min(u.length, d.length);
- for (let h = 1; h < g; h++) {
- const S = n(u[h], d[h]);
- if (S !== 0)
- return S;
- }
- return ho(u.length, d.length);
- }
- function Jme(e, t) {
- return XQ(e, t, au);
- }
- function zme(e, t) {
- return XQ(e, t, sw);
- }
- function Sh(e, t, n, i) {
- return typeof n == "string" ? (e = Bn(n, e), t = Bn(n, t)) : typeof n == "boolean" && (i = n), XQ(e, t, Kk(i));
- }
- function np(e, t, n, i) {
- if (typeof n == "string" ? (e = Bn(n, e), t = Bn(n, t)) : typeof n == "boolean" && (i = n), e === void 0 || t === void 0) return !1;
- if (e === t) return !0;
- const s = V2(Cl(e)), o = V2(Cl(t));
- if (o.length < s.length)
- return !1;
- const c = i ? Sy : ub;
- for (let _ = 0; _ < s.length; _++)
- if (!(_ === 0 ? Sy : c)(s[_], o[_]))
- return !1;
- return !0;
- }
- function ej(e, t, n) {
- const i = n(e), s = n(t);
- return Ui(i, s + "/") || Ui(i, s + "\\");
- }
- function Wme(e, t, n, i) {
- const s = V2(Cl(e)), o = V2(Cl(t));
- let c;
- for (c = 0; c < s.length && c < o.length; c++) {
- const d = i(s[c]), g = i(o[c]);
- if (!(c === 0 ? Sy : n)(d, g)) break;
- }
- if (c === 0)
- return o;
- const _ = o.slice(c), u = [];
- for (; c < s.length; c++)
- u.push("..");
- return ["", ...u, ..._];
- }
- function ld(e, t, n) {
- E.assert(Km(e) > 0 == Km(t) > 0, "Paths must either both be absolute or both be relative");
- const o = Wme(e, t, (typeof n == "boolean" ? n : !1) ? Sy : ub, typeof n == "function" ? n : go);
- return p0(o);
- }
- function VE(e, t, n) {
- return H_(e) ? jT(
- t,
- e,
- t,
- n,
- /*isAbsolutePathAnUrl*/
- !1
- ) : e;
- }
- function qE(e, t, n) {
- return q2(ld(Xn(e), t, n));
- }
- function jT(e, t, n, i, s) {
- const o = Wme(
- z1(n, e),
- z1(n, t),
- ub,
- i
- ), c = o[0];
- if (s && H_(c)) {
- const _ = c.charAt(0) === Vo ? "file://" : "file:///";
- o[0] = _ + c;
- }
- return p0(o);
- }
- function Fp(e, t) {
- for (; ; ) {
- const n = t(e);
- if (n !== void 0)
- return n;
- const i = Xn(e);
- if (i === e)
- return;
- e = i;
- }
- }
- function PI(e) {
- return Zo(e, "/node_modules");
- }
- function b(e, t, n, i, s, o, c) {
- return { code: e, category: t, key: n, message: i, reportsUnnecessary: s, elidedInCompatabilityPyramid: o, reportsDeprecated: c };
- }
- var p = {
- Unterminated_string_literal: b(1002, 1, "Unterminated_string_literal_1002", "Unterminated string literal."),
- Identifier_expected: b(1003, 1, "Identifier_expected_1003", "Identifier expected."),
- _0_expected: b(1005, 1, "_0_expected_1005", "'{0}' expected."),
- A_file_cannot_have_a_reference_to_itself: b(1006, 1, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
- The_parser_expected_to_find_a_1_to_match_the_0_token_here: b(1007, 1, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
- Trailing_comma_not_allowed: b(1009, 1, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
- Asterisk_Slash_expected: b(1010, 1, "Asterisk_Slash_expected_1010", "'*/' expected."),
- An_element_access_expression_should_take_an_argument: b(1011, 1, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
- Unexpected_token: b(1012, 1, "Unexpected_token_1012", "Unexpected token."),
- A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: b(1013, 1, "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013", "A rest parameter or binding pattern may not have a trailing comma."),
- A_rest_parameter_must_be_last_in_a_parameter_list: b(1014, 1, "A_rest_parameter_must_be_last_in_a_parameter_list_1014", "A rest parameter must be last in a parameter list."),
- Parameter_cannot_have_question_mark_and_initializer: b(1015, 1, "Parameter_cannot_have_question_mark_and_initializer_1015", "Parameter cannot have question mark and initializer."),
- A_required_parameter_cannot_follow_an_optional_parameter: b(1016, 1, "A_required_parameter_cannot_follow_an_optional_parameter_1016", "A required parameter cannot follow an optional parameter."),
- An_index_signature_cannot_have_a_rest_parameter: b(1017, 1, "An_index_signature_cannot_have_a_rest_parameter_1017", "An index signature cannot have a rest parameter."),
- An_index_signature_parameter_cannot_have_an_accessibility_modifier: b(1018, 1, "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018", "An index signature parameter cannot have an accessibility modifier."),
- An_index_signature_parameter_cannot_have_a_question_mark: b(1019, 1, "An_index_signature_parameter_cannot_have_a_question_mark_1019", "An index signature parameter cannot have a question mark."),
- An_index_signature_parameter_cannot_have_an_initializer: b(1020, 1, "An_index_signature_parameter_cannot_have_an_initializer_1020", "An index signature parameter cannot have an initializer."),
- An_index_signature_must_have_a_type_annotation: b(1021, 1, "An_index_signature_must_have_a_type_annotation_1021", "An index signature must have a type annotation."),
- An_index_signature_parameter_must_have_a_type_annotation: b(1022, 1, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."),
- readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: b(1024, 1, "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024", "'readonly' modifier can only appear on a property declaration or index signature."),
- An_index_signature_cannot_have_a_trailing_comma: b(1025, 1, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."),
- Accessibility_modifier_already_seen: b(1028, 1, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."),
- _0_modifier_must_precede_1_modifier: b(1029, 1, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."),
- _0_modifier_already_seen: b(1030, 1, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."),
- _0_modifier_cannot_appear_on_class_elements_of_this_kind: b(1031, 1, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."),
- super_must_be_followed_by_an_argument_list_or_member_access: b(1034, 1, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."),
- Only_ambient_modules_can_use_quoted_names: b(1035, 1, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."),
- Statements_are_not_allowed_in_ambient_contexts: b(1036, 1, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."),
- A_declare_modifier_cannot_be_used_in_an_already_ambient_context: b(1038, 1, "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038", "A 'declare' modifier cannot be used in an already ambient context."),
- Initializers_are_not_allowed_in_ambient_contexts: b(1039, 1, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."),
- _0_modifier_cannot_be_used_in_an_ambient_context: b(1040, 1, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."),
- _0_modifier_cannot_be_used_here: b(1042, 1, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."),
- _0_modifier_cannot_appear_on_a_module_or_namespace_element: b(1044, 1, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."),
- Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: b(1046, 1, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),
- A_rest_parameter_cannot_be_optional: b(1047, 1, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."),
- A_rest_parameter_cannot_have_an_initializer: b(1048, 1, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."),
- A_set_accessor_must_have_exactly_one_parameter: b(1049, 1, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."),
- A_set_accessor_cannot_have_an_optional_parameter: b(1051, 1, "A_set_accessor_cannot_have_an_optional_parameter_1051", "A 'set' accessor cannot have an optional parameter."),
- A_set_accessor_parameter_cannot_have_an_initializer: b(1052, 1, "A_set_accessor_parameter_cannot_have_an_initializer_1052", "A 'set' accessor parameter cannot have an initializer."),
- A_set_accessor_cannot_have_rest_parameter: b(1053, 1, "A_set_accessor_cannot_have_rest_parameter_1053", "A 'set' accessor cannot have rest parameter."),
- A_get_accessor_cannot_have_parameters: b(1054, 1, "A_get_accessor_cannot_have_parameters_1054", "A 'get' accessor cannot have parameters."),
- Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: b(1055, 1, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055", "Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."),
- Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: b(1056, 1, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."),
- The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: b(1058, 1, "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", "The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),
- A_promise_must_have_a_then_method: b(1059, 1, "A_promise_must_have_a_then_method_1059", "A promise must have a 'then' method."),
- The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: b(1060, 1, "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", "The first parameter of the 'then' method of a promise must be a callback."),
- Enum_member_must_have_initializer: b(1061, 1, "Enum_member_must_have_initializer_1061", "Enum member must have initializer."),
- Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: b(1062, 1, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),
- An_export_assignment_cannot_be_used_in_a_namespace: b(1063, 1, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."),
- The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: b(1064, 1, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"),
- The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: b(1065, 1, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065", "The return type of an async function or method must be the global Promise type."),
- In_ambient_enum_declarations_member_initializer_must_be_constant_expression: b(1066, 1, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."),
- Unexpected_token_A_constructor_method_accessor_or_property_was_expected: b(1068, 1, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."),
- Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: b(1069, 1, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."),
- _0_modifier_cannot_appear_on_a_type_member: b(1070, 1, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."),
- _0_modifier_cannot_appear_on_an_index_signature: b(1071, 1, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."),
- A_0_modifier_cannot_be_used_with_an_import_declaration: b(1079, 1, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."),
- Invalid_reference_directive_syntax: b(1084, 1, "Invalid_reference_directive_syntax_1084", "Invalid 'reference' directive syntax."),
- _0_modifier_cannot_appear_on_a_constructor_declaration: b(1089, 1, "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", "'{0}' modifier cannot appear on a constructor declaration."),
- _0_modifier_cannot_appear_on_a_parameter: b(1090, 1, "_0_modifier_cannot_appear_on_a_parameter_1090", "'{0}' modifier cannot appear on a parameter."),
- Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: b(1091, 1, "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091", "Only a single variable declaration is allowed in a 'for...in' statement."),
- Type_parameters_cannot_appear_on_a_constructor_declaration: b(1092, 1, "Type_parameters_cannot_appear_on_a_constructor_declaration_1092", "Type parameters cannot appear on a constructor declaration."),
- Type_annotation_cannot_appear_on_a_constructor_declaration: b(1093, 1, "Type_annotation_cannot_appear_on_a_constructor_declaration_1093", "Type annotation cannot appear on a constructor declaration."),
- An_accessor_cannot_have_type_parameters: b(1094, 1, "An_accessor_cannot_have_type_parameters_1094", "An accessor cannot have type parameters."),
- A_set_accessor_cannot_have_a_return_type_annotation: b(1095, 1, "A_set_accessor_cannot_have_a_return_type_annotation_1095", "A 'set' accessor cannot have a return type annotation."),
- An_index_signature_must_have_exactly_one_parameter: b(1096, 1, "An_index_signature_must_have_exactly_one_parameter_1096", "An index signature must have exactly one parameter."),
- _0_list_cannot_be_empty: b(1097, 1, "_0_list_cannot_be_empty_1097", "'{0}' list cannot be empty."),
- Type_parameter_list_cannot_be_empty: b(1098, 1, "Type_parameter_list_cannot_be_empty_1098", "Type parameter list cannot be empty."),
- Type_argument_list_cannot_be_empty: b(1099, 1, "Type_argument_list_cannot_be_empty_1099", "Type argument list cannot be empty."),
- Invalid_use_of_0_in_strict_mode: b(1100, 1, "Invalid_use_of_0_in_strict_mode_1100", "Invalid use of '{0}' in strict mode."),
- with_statements_are_not_allowed_in_strict_mode: b(1101, 1, "with_statements_are_not_allowed_in_strict_mode_1101", "'with' statements are not allowed in strict mode."),
- delete_cannot_be_called_on_an_identifier_in_strict_mode: b(1102, 1, "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", "'delete' cannot be called on an identifier in strict mode."),
- for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: b(1103, 1, "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103", "'for await' loops are only allowed within async functions and at the top levels of modules."),
- A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: b(1104, 1, "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", "A 'continue' statement can only be used within an enclosing iteration statement."),
- A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: b(1105, 1, "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", "A 'break' statement can only be used within an enclosing iteration or switch statement."),
- The_left_hand_side_of_a_for_of_statement_may_not_be_async: b(1106, 1, "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106", "The left-hand side of a 'for...of' statement may not be 'async'."),
- Jump_target_cannot_cross_function_boundary: b(1107, 1, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."),
- A_return_statement_can_only_be_used_within_a_function_body: b(1108, 1, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."),
- Expression_expected: b(1109, 1, "Expression_expected_1109", "Expression expected."),
- Type_expected: b(1110, 1, "Type_expected_1110", "Type expected."),
- Private_field_0_must_be_declared_in_an_enclosing_class: b(1111, 1, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."),
- A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: b(1113, 1, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."),
- Duplicate_label_0: b(1114, 1, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
- A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: b(1115, 1, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
- A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: b(1116, 1, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
- An_object_literal_cannot_have_multiple_properties_with_the_same_name: b(1117, 1, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
- An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: b(1118, 1, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
- An_object_literal_cannot_have_property_and_accessor_with_the_same_name: b(1119, 1, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
- An_export_assignment_cannot_have_modifiers: b(1120, 1, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
- Octal_literals_are_not_allowed_Use_the_syntax_0: b(1121, 1, "Octal_literals_are_not_allowed_Use_the_syntax_0_1121", "Octal literals are not allowed. Use the syntax '{0}'."),
- Variable_declaration_list_cannot_be_empty: b(1123, 1, "Variable_declaration_list_cannot_be_empty_1123", "Variable declaration list cannot be empty."),
- Digit_expected: b(1124, 1, "Digit_expected_1124", "Digit expected."),
- Hexadecimal_digit_expected: b(1125, 1, "Hexadecimal_digit_expected_1125", "Hexadecimal digit expected."),
- Unexpected_end_of_text: b(1126, 1, "Unexpected_end_of_text_1126", "Unexpected end of text."),
- Invalid_character: b(1127, 1, "Invalid_character_1127", "Invalid character."),
- Declaration_or_statement_expected: b(1128, 1, "Declaration_or_statement_expected_1128", "Declaration or statement expected."),
- Statement_expected: b(1129, 1, "Statement_expected_1129", "Statement expected."),
- case_or_default_expected: b(1130, 1, "case_or_default_expected_1130", "'case' or 'default' expected."),
- Property_or_signature_expected: b(1131, 1, "Property_or_signature_expected_1131", "Property or signature expected."),
- Enum_member_expected: b(1132, 1, "Enum_member_expected_1132", "Enum member expected."),
- Variable_declaration_expected: b(1134, 1, "Variable_declaration_expected_1134", "Variable declaration expected."),
- Argument_expression_expected: b(1135, 1, "Argument_expression_expected_1135", "Argument expression expected."),
- Property_assignment_expected: b(1136, 1, "Property_assignment_expected_1136", "Property assignment expected."),
- Expression_or_comma_expected: b(1137, 1, "Expression_or_comma_expected_1137", "Expression or comma expected."),
- Parameter_declaration_expected: b(1138, 1, "Parameter_declaration_expected_1138", "Parameter declaration expected."),
- Type_parameter_declaration_expected: b(1139, 1, "Type_parameter_declaration_expected_1139", "Type parameter declaration expected."),
- Type_argument_expected: b(1140, 1, "Type_argument_expected_1140", "Type argument expected."),
- String_literal_expected: b(1141, 1, "String_literal_expected_1141", "String literal expected."),
- Line_break_not_permitted_here: b(1142, 1, "Line_break_not_permitted_here_1142", "Line break not permitted here."),
- or_expected: b(1144, 1, "or_expected_1144", "'{' or ';' expected."),
- or_JSX_element_expected: b(1145, 1, "or_JSX_element_expected_1145", "'{' or JSX element expected."),
- Declaration_expected: b(1146, 1, "Declaration_expected_1146", "Declaration expected."),
- Import_declarations_in_a_namespace_cannot_reference_a_module: b(1147, 1, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."),
- Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: b(1148, 1, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."),
- File_name_0_differs_from_already_included_file_name_1_only_in_casing: b(1149, 1, "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", "File name '{0}' differs from already included file name '{1}' only in casing."),
- _0_declarations_must_be_initialized: b(1155, 1, "_0_declarations_must_be_initialized_1155", "'{0}' declarations must be initialized."),
- _0_declarations_can_only_be_declared_inside_a_block: b(1156, 1, "_0_declarations_can_only_be_declared_inside_a_block_1156", "'{0}' declarations can only be declared inside a block."),
- Unterminated_template_literal: b(1160, 1, "Unterminated_template_literal_1160", "Unterminated template literal."),
- Unterminated_regular_expression_literal: b(1161, 1, "Unterminated_regular_expression_literal_1161", "Unterminated regular expression literal."),
- An_object_member_cannot_be_declared_optional: b(1162, 1, "An_object_member_cannot_be_declared_optional_1162", "An object member cannot be declared optional."),
- A_yield_expression_is_only_allowed_in_a_generator_body: b(1163, 1, "A_yield_expression_is_only_allowed_in_a_generator_body_1163", "A 'yield' expression is only allowed in a generator body."),
- Computed_property_names_are_not_allowed_in_enums: b(1164, 1, "Computed_property_names_are_not_allowed_in_enums_1164", "Computed property names are not allowed in enums."),
- A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: b(1165, 1, "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165", "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),
- A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type: b(1166, 1, "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166", "A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),
- A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: b(1168, 1, "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168", "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),
- A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: b(1169, 1, "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169", "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),
- A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: b(1170, 1, "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170", "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),
- A_comma_expression_is_not_allowed_in_a_computed_property_name: b(1171, 1, "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171", "A comma expression is not allowed in a computed property name."),
- extends_clause_already_seen: b(1172, 1, "extends_clause_already_seen_1172", "'extends' clause already seen."),
- extends_clause_must_precede_implements_clause: b(1173, 1, "extends_clause_must_precede_implements_clause_1173", "'extends' clause must precede 'implements' clause."),
- Classes_can_only_extend_a_single_class: b(1174, 1, "Classes_can_only_extend_a_single_class_1174", "Classes can only extend a single class."),
- implements_clause_already_seen: b(1175, 1, "implements_clause_already_seen_1175", "'implements' clause already seen."),
- Interface_declaration_cannot_have_implements_clause: b(1176, 1, "Interface_declaration_cannot_have_implements_clause_1176", "Interface declaration cannot have 'implements' clause."),
- Binary_digit_expected: b(1177, 1, "Binary_digit_expected_1177", "Binary digit expected."),
- Octal_digit_expected: b(1178, 1, "Octal_digit_expected_1178", "Octal digit expected."),
- Unexpected_token_expected: b(1179, 1, "Unexpected_token_expected_1179", "Unexpected token. '{' expected."),
- Property_destructuring_pattern_expected: b(1180, 1, "Property_destructuring_pattern_expected_1180", "Property destructuring pattern expected."),
- Array_element_destructuring_pattern_expected: b(1181, 1, "Array_element_destructuring_pattern_expected_1181", "Array element destructuring pattern expected."),
- A_destructuring_declaration_must_have_an_initializer: b(1182, 1, "A_destructuring_declaration_must_have_an_initializer_1182", "A destructuring declaration must have an initializer."),
- An_implementation_cannot_be_declared_in_ambient_contexts: b(1183, 1, "An_implementation_cannot_be_declared_in_ambient_contexts_1183", "An implementation cannot be declared in ambient contexts."),
- Modifiers_cannot_appear_here: b(1184, 1, "Modifiers_cannot_appear_here_1184", "Modifiers cannot appear here."),
- Merge_conflict_marker_encountered: b(1185, 1, "Merge_conflict_marker_encountered_1185", "Merge conflict marker encountered."),
- A_rest_element_cannot_have_an_initializer: b(1186, 1, "A_rest_element_cannot_have_an_initializer_1186", "A rest element cannot have an initializer."),
- A_parameter_property_may_not_be_declared_using_a_binding_pattern: b(1187, 1, "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187", "A parameter property may not be declared using a binding pattern."),
- Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: b(1188, 1, "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188", "Only a single variable declaration is allowed in a 'for...of' statement."),
- The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: b(1189, 1, "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189", "The variable declaration of a 'for...in' statement cannot have an initializer."),
- The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: b(1190, 1, "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190", "The variable declaration of a 'for...of' statement cannot have an initializer."),
- An_import_declaration_cannot_have_modifiers: b(1191, 1, "An_import_declaration_cannot_have_modifiers_1191", "An import declaration cannot have modifiers."),
- Module_0_has_no_default_export: b(1192, 1, "Module_0_has_no_default_export_1192", "Module '{0}' has no default export."),
- An_export_declaration_cannot_have_modifiers: b(1193, 1, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."),
- Export_declarations_are_not_permitted_in_a_namespace: b(1194, 1, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."),
- export_Asterisk_does_not_re_export_a_default: b(1195, 1, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."),
- Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: b(1196, 1, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."),
- Catch_clause_variable_cannot_have_an_initializer: b(1197, 1, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."),
- An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: b(1198, 1, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),
- Unterminated_Unicode_escape_sequence: b(1199, 1, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."),
- Line_terminator_not_permitted_before_arrow: b(1200, 1, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."),
- Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: b(1202, 1, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
- Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: b(1203, 1, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),
- Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: b(1205, 1, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."),
- Decorators_are_not_valid_here: b(1206, 1, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."),
- Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: b(1207, 1, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."),
- Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: b(1209, 1, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"),
- Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: b(1210, 1, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),
- A_class_declaration_without_the_default_modifier_must_have_a_name: b(1211, 1, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."),
- Identifier_expected_0_is_a_reserved_word_in_strict_mode: b(1212, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."),
- Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: b(1213, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),
- Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: b(1214, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),
- Invalid_use_of_0_Modules_are_automatically_in_strict_mode: b(1215, 1, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."),
- Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: b(1216, 1, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),
- Export_assignment_is_not_supported_when_module_flag_is_system: b(1218, 1, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."),
- Generators_are_not_allowed_in_an_ambient_context: b(1221, 1, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."),
- An_overload_signature_cannot_be_declared_as_a_generator: b(1222, 1, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."),
- _0_tag_already_specified: b(1223, 1, "_0_tag_already_specified_1223", "'{0}' tag already specified."),
- Signature_0_must_be_a_type_predicate: b(1224, 1, "Signature_0_must_be_a_type_predicate_1224", "Signature '{0}' must be a type predicate."),
- Cannot_find_parameter_0: b(1225, 1, "Cannot_find_parameter_0_1225", "Cannot find parameter '{0}'."),
- Type_predicate_0_is_not_assignable_to_1: b(1226, 1, "Type_predicate_0_is_not_assignable_to_1_1226", "Type predicate '{0}' is not assignable to '{1}'."),
- Parameter_0_is_not_in_the_same_position_as_parameter_1: b(1227, 1, "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", "Parameter '{0}' is not in the same position as parameter '{1}'."),
- A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: b(1228, 1, "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", "A type predicate is only allowed in return type position for functions and methods."),
- A_type_predicate_cannot_reference_a_rest_parameter: b(1229, 1, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."),
- A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: b(1230, 1, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."),
- An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: b(1231, 1, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."),
- An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: b(1232, 1, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."),
- An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: b(1233, 1, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."),
- An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: b(1234, 1, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."),
- A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: b(1235, 1, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."),
- The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: b(1236, 1, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."),
- The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: b(1237, 1, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."),
- Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: b(1238, 1, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."),
- Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: b(1239, 1, "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239", "Unable to resolve signature of parameter decorator when called as an expression."),
- Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: b(1240, 1, "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240", "Unable to resolve signature of property decorator when called as an expression."),
- Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: b(1241, 1, "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241", "Unable to resolve signature of method decorator when called as an expression."),
- abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: b(1242, 1, "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242", "'abstract' modifier can only appear on a class, method, or property declaration."),
- _0_modifier_cannot_be_used_with_1_modifier: b(1243, 1, "_0_modifier_cannot_be_used_with_1_modifier_1243", "'{0}' modifier cannot be used with '{1}' modifier."),
- Abstract_methods_can_only_appear_within_an_abstract_class: b(1244, 1, "Abstract_methods_can_only_appear_within_an_abstract_class_1244", "Abstract methods can only appear within an abstract class."),
- Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: b(1245, 1, "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", "Method '{0}' cannot have an implementation because it is marked abstract."),
- An_interface_property_cannot_have_an_initializer: b(1246, 1, "An_interface_property_cannot_have_an_initializer_1246", "An interface property cannot have an initializer."),
- A_type_literal_property_cannot_have_an_initializer: b(1247, 1, "A_type_literal_property_cannot_have_an_initializer_1247", "A type literal property cannot have an initializer."),
- A_class_member_cannot_have_the_0_keyword: b(1248, 1, "A_class_member_cannot_have_the_0_keyword_1248", "A class member cannot have the '{0}' keyword."),
- A_decorator_can_only_decorate_a_method_implementation_not_an_overload: b(1249, 1, "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", "A decorator can only decorate a method implementation, not an overload."),
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5: b(1250, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."),
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode: b(1251, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."),
- Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode: b(1252, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."),
- Abstract_properties_can_only_appear_within_an_abstract_class: b(1253, 1, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."),
- A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: b(1254, 1, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),
- A_definite_assignment_assertion_is_not_permitted_in_this_context: b(1255, 1, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."),
- A_required_element_cannot_follow_an_optional_element: b(1257, 1, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."),
- A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration: b(1258, 1, "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258", "A default export must be at the top level of a file or module declaration."),
- Module_0_can_only_be_default_imported_using_the_1_flag: b(1259, 1, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"),
- Keywords_cannot_contain_escape_characters: b(1260, 1, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
- Already_included_file_name_0_differs_from_file_name_1_only_in_casing: b(1261, 1, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."),
- Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: b(1262, 1, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."),
- Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: b(1263, 1, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."),
- Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: b(1264, 1, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."),
- A_rest_element_cannot_follow_another_rest_element: b(1265, 1, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."),
- An_optional_element_cannot_follow_a_rest_element: b(1266, 1, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."),
- Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: b(1267, 1, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
- An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: b(1268, 1, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
- Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: b(1269, 1, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),
- Decorator_function_return_type_0_is_not_assignable_to_type_1: b(1270, 1, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
- Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: b(1271, 1, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
- A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: b(1272, 1, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),
- _0_modifier_cannot_appear_on_a_type_parameter: b(1273, 1, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"),
- _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: b(1274, 1, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
- accessor_modifier_can_only_appear_on_a_property_declaration: b(1275, 1, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."),
- An_accessor_property_cannot_be_declared_optional: b(1276, 1, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."),
- _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: b(1277, 1, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"),
- The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: b(1278, 1, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),
- The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: b(1279, 1, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),
- Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: b(1280, 1, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."),
- Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: b(1281, 1, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),
- An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: b(1282, 1, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),
- An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: b(1283, 1, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
- An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: b(1284, 1, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),
- An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: b(1285, 1, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: b(1286, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
- A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: b(1287, 1, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
- An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: b(1288, 1, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
- _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: b(1289, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
- _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: b(1290, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
- _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: b(1291, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
- _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: b(1292, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: b(1293, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
- with_statements_are_not_allowed_in_an_async_function_block: b(1300, 1, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
- await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: b(1308, 1, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
- The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: b(1309, 1, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
- Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: b(1312, 1, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
- The_body_of_an_if_statement_cannot_be_the_empty_statement: b(1313, 1, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
- Global_module_exports_may_only_appear_in_module_files: b(1314, 1, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
- Global_module_exports_may_only_appear_in_declaration_files: b(1315, 1, "Global_module_exports_may_only_appear_in_declaration_files_1315", "Global module exports may only appear in declaration files."),
- Global_module_exports_may_only_appear_at_top_level: b(1316, 1, "Global_module_exports_may_only_appear_at_top_level_1316", "Global module exports may only appear at top level."),
- A_parameter_property_cannot_be_declared_using_a_rest_parameter: b(1317, 1, "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", "A parameter property cannot be declared using a rest parameter."),
- An_abstract_accessor_cannot_have_an_implementation: b(1318, 1, "An_abstract_accessor_cannot_have_an_implementation_1318", "An abstract accessor cannot have an implementation."),
- A_default_export_can_only_be_used_in_an_ECMAScript_style_module: b(1319, 1, "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", "A default export can only be used in an ECMAScript-style module."),
- Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: b(1320, 1, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
- Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: b(1321, 1, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
- Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: b(1322, 1, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
- Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: b(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
- Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve: b(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodene_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'."),
- Argument_of_dynamic_import_cannot_be_spread_element: b(1325, 1, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
- This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: b(1326, 1, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
- String_literal_with_double_quotes_expected: b(1327, 1, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
- Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: b(1328, 1, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),
- _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: b(1329, 1, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),
- A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: b(1330, 1, "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330", "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),
- A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: b(1331, 1, "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331", "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),
- A_variable_whose_type_is_a_unique_symbol_type_must_be_const: b(1332, 1, "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332", "A variable whose type is a 'unique symbol' type must be 'const'."),
- unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: b(1333, 1, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."),
- unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: b(1334, 1, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."),
- unique_symbol_types_are_not_allowed_here: b(1335, 1, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."),
- An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: b(1337, 1, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),
- infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: b(1338, 1, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."),
- Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: b(1339, 1, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
- Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: b(1340, 1, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
- Class_constructor_may_not_be_an_accessor: b(1341, 1, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
- The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: b(1343, 1, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
- A_label_is_not_allowed_here: b(1344, 1, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
- An_expression_of_type_void_cannot_be_tested_for_truthiness: b(1345, 1, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
- This_parameter_is_not_allowed_with_use_strict_directive: b(1346, 1, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
- use_strict_directive_cannot_be_used_with_non_simple_parameter_list: b(1347, 1, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."),
- Non_simple_parameter_declared_here: b(1348, 1, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."),
- use_strict_directive_used_here: b(1349, 1, "use_strict_directive_used_here_1349", "'use strict' directive used here."),
- Print_the_final_configuration_instead_of_building: b(1350, 3, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."),
- An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: b(1351, 1, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."),
- A_bigint_literal_cannot_use_exponential_notation: b(1352, 1, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."),
- A_bigint_literal_must_be_an_integer: b(1353, 1, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."),
- readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: b(1354, 1, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."),
- A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: b(1355, 1, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),
- Did_you_mean_to_mark_this_function_as_async: b(1356, 1, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"),
- An_enum_member_name_must_be_followed_by_a_or: b(1357, 1, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."),
- Tagged_template_expressions_are_not_permitted_in_an_optional_chain: b(1358, 1, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."),
- Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: b(1359, 1, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."),
- Type_0_does_not_satisfy_the_expected_type_1: b(1360, 1, "Type_0_does_not_satisfy_the_expected_type_1_1360", "Type '{0}' does not satisfy the expected type '{1}'."),
- _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: b(1361, 1, "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361", "'{0}' cannot be used as a value because it was imported using 'import type'."),
- _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: b(1362, 1, "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362", "'{0}' cannot be used as a value because it was exported using 'export type'."),
- A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: b(1363, 1, "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363", "A type-only import can specify a default import or named bindings, but not both."),
- Convert_to_type_only_export: b(1364, 3, "Convert_to_type_only_export_1364", "Convert to type-only export"),
- Convert_all_re_exported_types_to_type_only_exports: b(1365, 3, "Convert_all_re_exported_types_to_type_only_exports_1365", "Convert all re-exported types to type-only exports"),
- Split_into_two_separate_import_declarations: b(1366, 3, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"),
- Split_all_invalid_type_only_imports: b(1367, 3, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"),
- Class_constructor_may_not_be_a_generator: b(1368, 1, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."),
- Did_you_mean_0: b(1369, 3, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
- await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: b(1375, 1, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
- _0_was_imported_here: b(1376, 3, "_0_was_imported_here_1376", "'{0}' was imported here."),
- _0_was_exported_here: b(1377, 3, "_0_was_exported_here_1377", "'{0}' was exported here."),
- Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: b(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
- An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: b(1379, 1, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
- An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: b(1380, 1, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
- Unexpected_token_Did_you_mean_or_rbrace: b(1381, 1, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
- Unexpected_token_Did_you_mean_or_gt: b(1382, 1, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
- Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: b(1385, 1, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
- Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: b(1386, 1, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
- Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: b(1387, 1, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
- Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: b(1388, 1, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."),
- _0_is_not_allowed_as_a_variable_declaration_name: b(1389, 1, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."),
- _0_is_not_allowed_as_a_parameter_name: b(1390, 1, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."),
- An_import_alias_cannot_use_import_type: b(1392, 1, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"),
- Imported_via_0_from_file_1: b(1393, 3, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"),
- Imported_via_0_from_file_1_with_packageId_2: b(1394, 3, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"),
- Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: b(1395, 3, "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395", "Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),
- Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: b(1396, 3, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),
- Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: b(1397, 3, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),
- Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: b(1398, 3, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),
- File_is_included_via_import_here: b(1399, 3, "File_is_included_via_import_here_1399", "File is included via import here."),
- Referenced_via_0_from_file_1: b(1400, 3, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"),
- File_is_included_via_reference_here: b(1401, 3, "File_is_included_via_reference_here_1401", "File is included via reference here."),
- Type_library_referenced_via_0_from_file_1: b(1402, 3, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"),
- Type_library_referenced_via_0_from_file_1_with_packageId_2: b(1403, 3, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),
- File_is_included_via_type_library_reference_here: b(1404, 3, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."),
- Library_referenced_via_0_from_file_1: b(1405, 3, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"),
- File_is_included_via_library_reference_here: b(1406, 3, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."),
- Matched_by_include_pattern_0_in_1: b(1407, 3, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"),
- File_is_matched_by_include_pattern_specified_here: b(1408, 3, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."),
- Part_of_files_list_in_tsconfig_json: b(1409, 3, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"),
- File_is_matched_by_files_list_specified_here: b(1410, 3, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."),
- Output_from_referenced_project_0_included_because_1_specified: b(1411, 3, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"),
- Output_from_referenced_project_0_included_because_module_is_specified_as_none: b(1412, 3, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"),
- File_is_output_from_referenced_project_specified_here: b(1413, 3, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."),
- Source_from_referenced_project_0_included_because_1_specified: b(1414, 3, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"),
- Source_from_referenced_project_0_included_because_module_is_specified_as_none: b(1415, 3, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"),
- File_is_source_from_referenced_project_specified_here: b(1416, 3, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."),
- Entry_point_of_type_library_0_specified_in_compilerOptions: b(1417, 3, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"),
- Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: b(1418, 3, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),
- File_is_entry_point_of_type_library_specified_here: b(1419, 3, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."),
- Entry_point_for_implicit_type_library_0: b(1420, 3, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"),
- Entry_point_for_implicit_type_library_0_with_packageId_1: b(1421, 3, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"),
- Library_0_specified_in_compilerOptions: b(1422, 3, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"),
- File_is_library_specified_here: b(1423, 3, "File_is_library_specified_here_1423", "File is library specified here."),
- Default_library: b(1424, 3, "Default_library_1424", "Default library"),
- Default_library_for_target_0: b(1425, 3, "Default_library_for_target_0_1425", "Default library for target '{0}'"),
- File_is_default_library_for_target_specified_here: b(1426, 3, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."),
- Root_file_specified_for_compilation: b(1427, 3, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"),
- File_is_output_of_project_reference_source_0: b(1428, 3, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"),
- File_redirects_to_file_0: b(1429, 3, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
- The_file_is_in_the_program_because_Colon: b(1430, 3, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
- for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: b(1431, 1, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
- Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: b(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
- Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: b(1433, 1, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
- Unexpected_keyword_or_identifier: b(1434, 1, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
- Unknown_keyword_or_identifier_Did_you_mean_0: b(1435, 1, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
- Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: b(1436, 1, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."),
- Namespace_must_be_given_a_name: b(1437, 1, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."),
- Interface_must_be_given_a_name: b(1438, 1, "Interface_must_be_given_a_name_1438", "Interface must be given a name."),
- Type_alias_must_be_given_a_name: b(1439, 1, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."),
- Variable_declaration_not_allowed_at_this_location: b(1440, 1, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."),
- Cannot_start_a_function_call_in_a_type_annotation: b(1441, 1, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."),
- Expected_for_property_initializer: b(1442, 1, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."),
- Module_declaration_names_may_only_use_or_quoted_strings: b(1443, 1, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`),
- _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: b(1448, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
- Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: b(1449, 3, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
- Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: b(1450, 3, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
- Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: b(1451, 1, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
- resolution_mode_should_be_either_require_or_import: b(1453, 1, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
- resolution_mode_can_only_be_set_for_type_only_imports: b(1454, 1, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
- resolution_mode_is_the_only_valid_key_for_type_import_assertions: b(1455, 1, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
- Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: b(1456, 1, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),
- Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: b(1457, 3, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"),
- File_is_ECMAScript_module_because_0_has_field_type_with_value_module: b(1458, 3, "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458", `File is ECMAScript module because '{0}' has field "type" with value "module"`),
- File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: b(1459, 3, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
- File_is_CommonJS_module_because_0_does_not_have_field_type: b(1460, 3, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
- File_is_CommonJS_module_because_package_json_was_not_found: b(1461, 3, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
- resolution_mode_is_the_only_valid_key_for_type_import_attributes: b(1463, 1, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "'resolution-mode' is the only valid key for type import attributes."),
- Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: b(1464, 1, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),
- The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: b(1470, 1, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
- Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: b(1471, 1, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),
- catch_or_finally_expected: b(1472, 1, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
- An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: b(1473, 1, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
- An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: b(1474, 1, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
- Control_what_method_is_used_to_detect_module_format_JS_files: b(1475, 3, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
- auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: b(1476, 3, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", '"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),
- An_instantiation_expression_cannot_be_followed_by_a_property_access: b(1477, 1, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."),
- Identifier_or_string_literal_expected: b(1478, 1, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."),
- The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead: b(1479, 1, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", `The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`),
- To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: b(1480, 3, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", 'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),
- To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: b(1481, 3, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`),
- To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: b(1482, 3, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),
- To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: b(1483, 3, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),
- _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: b(1484, 1, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
- _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: b(1485, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
- Decorator_used_before_export_here: b(1486, 1, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."),
- Octal_escape_sequences_are_not_allowed_Use_the_syntax_0: b(1487, 1, "Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487", "Octal escape sequences are not allowed. Use the syntax '{0}'."),
- Escape_sequence_0_is_not_allowed: b(1488, 1, "Escape_sequence_0_is_not_allowed_1488", "Escape sequence '{0}' is not allowed."),
- Decimals_with_leading_zeros_are_not_allowed: b(1489, 1, "Decimals_with_leading_zeros_are_not_allowed_1489", "Decimals with leading zeros are not allowed."),
- File_appears_to_be_binary: b(1490, 1, "File_appears_to_be_binary_1490", "File appears to be binary."),
- _0_modifier_cannot_appear_on_a_using_declaration: b(1491, 1, "_0_modifier_cannot_appear_on_a_using_declaration_1491", "'{0}' modifier cannot appear on a 'using' declaration."),
- _0_declarations_may_not_have_binding_patterns: b(1492, 1, "_0_declarations_may_not_have_binding_patterns_1492", "'{0}' declarations may not have binding patterns."),
- The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: b(1493, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
- The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: b(1494, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
- _0_modifier_cannot_appear_on_an_await_using_declaration: b(1495, 1, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
- Identifier_string_literal_or_number_literal_expected: b(1496, 1, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
- Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator: b(1497, 1, "Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497", "Expression must be enclosed in parentheses to be used as a decorator."),
- Invalid_syntax_in_decorator: b(1498, 1, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
- Unknown_regular_expression_flag: b(1499, 1, "Unknown_regular_expression_flag_1499", "Unknown regular expression flag."),
- Duplicate_regular_expression_flag: b(1500, 1, "Duplicate_regular_expression_flag_1500", "Duplicate regular expression flag."),
- This_regular_expression_flag_is_only_available_when_targeting_0_or_later: b(1501, 1, "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501", "This regular expression flag is only available when targeting '{0}' or later."),
- The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously: b(1502, 1, "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502", "The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),
- Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later: b(1503, 1, "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503", "Named capturing groups are only available when targeting 'ES2018' or later."),
- Subpattern_flags_must_be_present_when_there_is_a_minus_sign: b(1504, 1, "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504", "Subpattern flags must be present when there is a minus sign."),
- Incomplete_quantifier_Digit_expected: b(1505, 1, "Incomplete_quantifier_Digit_expected_1505", "Incomplete quantifier. Digit expected."),
- Numbers_out_of_order_in_quantifier: b(1506, 1, "Numbers_out_of_order_in_quantifier_1506", "Numbers out of order in quantifier."),
- There_is_nothing_available_for_repetition: b(1507, 1, "There_is_nothing_available_for_repetition_1507", "There is nothing available for repetition."),
- Unexpected_0_Did_you_mean_to_escape_it_with_backslash: b(1508, 1, "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508", "Unexpected '{0}'. Did you mean to escape it with backslash?"),
- This_regular_expression_flag_cannot_be_toggled_within_a_subpattern: b(1509, 1, "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509", "This regular expression flag cannot be toggled within a subpattern."),
- k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets: b(1510, 1, "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510", "'\\k' must be followed by a capturing group name enclosed in angle brackets."),
- q_is_only_available_inside_character_class: b(1511, 1, "q_is_only_available_inside_character_class_1511", "'\\q' is only available inside character class."),
- c_must_be_followed_by_an_ASCII_letter: b(1512, 1, "c_must_be_followed_by_an_ASCII_letter_1512", "'\\c' must be followed by an ASCII letter."),
- Undetermined_character_escape: b(1513, 1, "Undetermined_character_escape_1513", "Undetermined character escape."),
- Expected_a_capturing_group_name: b(1514, 1, "Expected_a_capturing_group_name_1514", "Expected a capturing group name."),
- Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other: b(1515, 1, "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515", "Named capturing groups with the same name must be mutually exclusive to each other."),
- A_character_class_range_must_not_be_bounded_by_another_character_class: b(1516, 1, "A_character_class_range_must_not_be_bounded_by_another_character_class_1516", "A character class range must not be bounded by another character class."),
- Range_out_of_order_in_character_class: b(1517, 1, "Range_out_of_order_in_character_class_1517", "Range out of order in character class."),
- Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class: b(1518, 1, "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518", "Anything that would possibly match more than a single character is invalid inside a negated character class."),
- Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead: b(1519, 1, "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519", "Operators must not be mixed within a character class. Wrap it in a nested class instead."),
- Expected_a_class_set_operand: b(1520, 1, "Expected_a_class_set_operand_1520", "Expected a class set operand."),
- q_must_be_followed_by_string_alternatives_enclosed_in_braces: b(1521, 1, "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521", "'\\q' must be followed by string alternatives enclosed in braces."),
- A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash: b(1522, 1, "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522", "A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),
- Expected_a_Unicode_property_name: b(1523, 1, "Expected_a_Unicode_property_name_1523", "Expected a Unicode property name."),
- Unknown_Unicode_property_name: b(1524, 1, "Unknown_Unicode_property_name_1524", "Unknown Unicode property name."),
- Expected_a_Unicode_property_value: b(1525, 1, "Expected_a_Unicode_property_value_1525", "Expected a Unicode property value."),
- Unknown_Unicode_property_value: b(1526, 1, "Unknown_Unicode_property_value_1526", "Unknown Unicode property value."),
- Expected_a_Unicode_property_name_or_value: b(1527, 1, "Expected_a_Unicode_property_name_or_value_1527", "Expected a Unicode property name or value."),
- Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set: b(1528, 1, "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528", "Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),
- Unknown_Unicode_property_name_or_value: b(1529, 1, "Unknown_Unicode_property_name_or_value_1529", "Unknown Unicode property name or value."),
- Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: b(1530, 1, "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530", "Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
- _0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces: b(1531, 1, "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531", "'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),
- There_is_no_capturing_group_named_0_in_this_regular_expression: b(1532, 1, "There_is_no_capturing_group_named_0_in_this_regular_expression_1532", "There is no capturing group named '{0}' in this regular expression."),
- This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression: b(1533, 1, "This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533", "This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."),
- This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression: b(1534, 1, "This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534", "This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."),
- This_character_cannot_be_escaped_in_a_regular_expression: b(1535, 1, "This_character_cannot_be_escaped_in_a_regular_expression_1535", "This character cannot be escaped in a regular expression."),
- Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead: b(1536, 1, "Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536", "Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."),
- Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: b(1537, 1, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
- Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: b(1538, 1, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
- A_bigint_literal_cannot_be_used_as_a_property_name: b(1539, 1, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
- A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: b(
- 1540,
- 2,
- "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
- "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- void 0,
- /*reportsDeprecated*/
- !0
- ),
- The_types_of_0_are_incompatible_between_these_types: b(2200, 1, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
- The_types_returned_by_0_are_incompatible_between_these_types: b(2201, 1, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
- Call_signature_return_types_0_and_1_are_incompatible: b(
- 2202,
- 1,
- "Call_signature_return_types_0_and_1_are_incompatible_2202",
- "Call signature return types '{0}' and '{1}' are incompatible.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- !0
- ),
- Construct_signature_return_types_0_and_1_are_incompatible: b(
- 2203,
- 1,
- "Construct_signature_return_types_0_and_1_are_incompatible_2203",
- "Construct signature return types '{0}' and '{1}' are incompatible.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- !0
- ),
- Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: b(
- 2204,
- 1,
- "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204",
- "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- !0
- ),
- Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: b(
- 2205,
- 1,
- "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205",
- "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- !0
- ),
- The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: b(2206, 1, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
- The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: b(2207, 1, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
- This_type_parameter_might_need_an_extends_0_constraint: b(2208, 1, "This_type_parameter_might_need_an_extends_0_constraint_2208", "This type parameter might need an `extends {0}` constraint."),
- The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: b(2209, 1, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
- The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: b(2210, 1, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
- Add_extends_constraint: b(2211, 3, "Add_extends_constraint_2211", "Add `extends` constraint."),
- Add_extends_constraint_to_all_type_parameters: b(2212, 3, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
- Duplicate_identifier_0: b(2300, 1, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
- Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: b(2301, 1, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
- Static_members_cannot_reference_class_type_parameters: b(2302, 1, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
- Circular_definition_of_import_alias_0: b(2303, 1, "Circular_definition_of_import_alias_0_2303", "Circular definition of import alias '{0}'."),
- Cannot_find_name_0: b(2304, 1, "Cannot_find_name_0_2304", "Cannot find name '{0}'."),
- Module_0_has_no_exported_member_1: b(2305, 1, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."),
- File_0_is_not_a_module: b(2306, 1, "File_0_is_not_a_module_2306", "File '{0}' is not a module."),
- Cannot_find_module_0_or_its_corresponding_type_declarations: b(2307, 1, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."),
- Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: b(2308, 1, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),
- An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: b(2309, 1, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."),
- Type_0_recursively_references_itself_as_a_base_type: b(2310, 1, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."),
- Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: b(2311, 1, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"),
- An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: b(2312, 1, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."),
- Type_parameter_0_has_a_circular_constraint: b(2313, 1, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."),
- Generic_type_0_requires_1_type_argument_s: b(2314, 1, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."),
- Type_0_is_not_generic: b(2315, 1, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."),
- Global_type_0_must_be_a_class_or_interface_type: b(2316, 1, "Global_type_0_must_be_a_class_or_interface_type_2316", "Global type '{0}' must be a class or interface type."),
- Global_type_0_must_have_1_type_parameter_s: b(2317, 1, "Global_type_0_must_have_1_type_parameter_s_2317", "Global type '{0}' must have {1} type parameter(s)."),
- Cannot_find_global_type_0: b(2318, 1, "Cannot_find_global_type_0_2318", "Cannot find global type '{0}'."),
- Named_property_0_of_types_1_and_2_are_not_identical: b(2319, 1, "Named_property_0_of_types_1_and_2_are_not_identical_2319", "Named property '{0}' of types '{1}' and '{2}' are not identical."),
- Interface_0_cannot_simultaneously_extend_types_1_and_2: b(2320, 1, "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),
- Excessive_stack_depth_comparing_types_0_and_1: b(2321, 1, "Excessive_stack_depth_comparing_types_0_and_1_2321", "Excessive stack depth comparing types '{0}' and '{1}'."),
- Type_0_is_not_assignable_to_type_1: b(2322, 1, "Type_0_is_not_assignable_to_type_1_2322", "Type '{0}' is not assignable to type '{1}'."),
- Cannot_redeclare_exported_variable_0: b(2323, 1, "Cannot_redeclare_exported_variable_0_2323", "Cannot redeclare exported variable '{0}'."),
- Property_0_is_missing_in_type_1: b(2324, 1, "Property_0_is_missing_in_type_1_2324", "Property '{0}' is missing in type '{1}'."),
- Property_0_is_private_in_type_1_but_not_in_type_2: b(2325, 1, "Property_0_is_private_in_type_1_but_not_in_type_2_2325", "Property '{0}' is private in type '{1}' but not in type '{2}'."),
- Types_of_property_0_are_incompatible: b(2326, 1, "Types_of_property_0_are_incompatible_2326", "Types of property '{0}' are incompatible."),
- Property_0_is_optional_in_type_1_but_required_in_type_2: b(2327, 1, "Property_0_is_optional_in_type_1_but_required_in_type_2_2327", "Property '{0}' is optional in type '{1}' but required in type '{2}'."),
- Types_of_parameters_0_and_1_are_incompatible: b(2328, 1, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."),
- Index_signature_for_type_0_is_missing_in_type_1: b(2329, 1, "Index_signature_for_type_0_is_missing_in_type_1_2329", "Index signature for type '{0}' is missing in type '{1}'."),
- _0_and_1_index_signatures_are_incompatible: b(2330, 1, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."),
- this_cannot_be_referenced_in_a_module_or_namespace_body: b(2331, 1, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."),
- this_cannot_be_referenced_in_current_location: b(2332, 1, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."),
- this_cannot_be_referenced_in_a_static_property_initializer: b(2334, 1, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."),
- super_can_only_be_referenced_in_a_derived_class: b(2335, 1, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."),
- super_cannot_be_referenced_in_constructor_arguments: b(2336, 1, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."),
- Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: b(2337, 1, "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337", "Super calls are not permitted outside constructors or in nested functions inside constructors."),
- super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: b(2338, 1, "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338", "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),
- Property_0_does_not_exist_on_type_1: b(2339, 1, "Property_0_does_not_exist_on_type_1_2339", "Property '{0}' does not exist on type '{1}'."),
- Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: b(2340, 1, "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", "Only public and protected methods of the base class are accessible via the 'super' keyword."),
- Property_0_is_private_and_only_accessible_within_class_1: b(2341, 1, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."),
- This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: b(2343, 1, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),
- Type_0_does_not_satisfy_the_constraint_1: b(2344, 1, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."),
- Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: b(2345, 1, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."),
- Untyped_function_calls_may_not_accept_type_arguments: b(2347, 1, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."),
- Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: b(2348, 1, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"),
- This_expression_is_not_callable: b(2349, 1, "This_expression_is_not_callable_2349", "This expression is not callable."),
- Only_a_void_function_can_be_called_with_the_new_keyword: b(2350, 1, "Only_a_void_function_can_be_called_with_the_new_keyword_2350", "Only a void function can be called with the 'new' keyword."),
- This_expression_is_not_constructable: b(2351, 1, "This_expression_is_not_constructable_2351", "This expression is not constructable."),
- Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: b(2352, 1, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),
- Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: b(2353, 1, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),
- This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: b(2354, 1, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."),
- A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value: b(2355, 1, "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),
- An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: b(2356, 1, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),
- The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: b(2357, 1, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
- The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: b(2358, 1, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
- The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method: b(2359, 1, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359", "The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),
- The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: b(2362, 1, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
- The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: b(2363, 1, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
- The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: b(2364, 1, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
- Operator_0_cannot_be_applied_to_types_1_and_2: b(2365, 1, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."),
- Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: b(2366, 1, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."),
- This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap: b(2367, 1, "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367", "This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),
- Type_parameter_name_cannot_be_0: b(2368, 1, "Type_parameter_name_cannot_be_0_2368", "Type parameter name cannot be '{0}'."),
- A_parameter_property_is_only_allowed_in_a_constructor_implementation: b(2369, 1, "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", "A parameter property is only allowed in a constructor implementation."),
- A_rest_parameter_must_be_of_an_array_type: b(2370, 1, "A_rest_parameter_must_be_of_an_array_type_2370", "A rest parameter must be of an array type."),
- A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: b(2371, 1, "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", "A parameter initializer is only allowed in a function or constructor implementation."),
- Parameter_0_cannot_reference_itself: b(2372, 1, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."),
- Parameter_0_cannot_reference_identifier_1_declared_after_it: b(2373, 1, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."),
- Duplicate_index_signature_for_type_0: b(2374, 1, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."),
- Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: b(2375, 1, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
- A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: b(2376, 1, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),
- Constructors_for_derived_classes_must_contain_a_super_call: b(2377, 1, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."),
- A_get_accessor_must_return_a_value: b(2378, 1, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."),
- Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: b(2379, 1, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
- Overload_signatures_must_all_be_exported_or_non_exported: b(2383, 1, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."),
- Overload_signatures_must_all_be_ambient_or_non_ambient: b(2384, 1, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."),
- Overload_signatures_must_all_be_public_private_or_protected: b(2385, 1, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."),
- Overload_signatures_must_all_be_optional_or_required: b(2386, 1, "Overload_signatures_must_all_be_optional_or_required_2386", "Overload signatures must all be optional or required."),
- Function_overload_must_be_static: b(2387, 1, "Function_overload_must_be_static_2387", "Function overload must be static."),
- Function_overload_must_not_be_static: b(2388, 1, "Function_overload_must_not_be_static_2388", "Function overload must not be static."),
- Function_implementation_name_must_be_0: b(2389, 1, "Function_implementation_name_must_be_0_2389", "Function implementation name must be '{0}'."),
- Constructor_implementation_is_missing: b(2390, 1, "Constructor_implementation_is_missing_2390", "Constructor implementation is missing."),
- Function_implementation_is_missing_or_not_immediately_following_the_declaration: b(2391, 1, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."),
- Multiple_constructor_implementations_are_not_allowed: b(2392, 1, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."),
- Duplicate_function_implementation: b(2393, 1, "Duplicate_function_implementation_2393", "Duplicate function implementation."),
- This_overload_signature_is_not_compatible_with_its_implementation_signature: b(2394, 1, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."),
- Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: b(2395, 1, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."),
- Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: b(2396, 1, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),
- Declaration_name_conflicts_with_built_in_global_identifier_0: b(2397, 1, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."),
- constructor_cannot_be_used_as_a_parameter_property_name: b(2398, 1, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."),
- Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: b(2399, 1, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),
- Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: b(2400, 1, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),
- A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: b(2401, 1, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),
- Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: b(2402, 1, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."),
- Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: b(2403, 1, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),
- The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: b(2404, 1, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."),
- The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: b(2405, 1, "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405", "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),
- The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: b(2406, 1, "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", "The left-hand side of a 'for...in' statement must be a variable or a property access."),
- The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: b(2407, 1, "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407", "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),
- Setters_cannot_return_a_value: b(2408, 1, "Setters_cannot_return_a_value_2408", "Setters cannot return a value."),
- Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: b(2409, 1, "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", "Return type of constructor signature must be assignable to the instance type of the class."),
- The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: b(2410, 1, "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),
- Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: b(2412, 1, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),
- Property_0_of_type_1_is_not_assignable_to_2_index_type_3: b(2411, 1, "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411", "Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),
- _0_index_type_1_is_not_assignable_to_2_index_type_3: b(2413, 1, "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413", "'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),
- Class_name_cannot_be_0: b(2414, 1, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."),
- Class_0_incorrectly_extends_base_class_1: b(2415, 1, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."),
- Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: b(2416, 1, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),
- Class_static_side_0_incorrectly_extends_base_class_static_side_1: b(2417, 1, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."),
- Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: b(2418, 1, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."),
- Types_of_construct_signatures_are_incompatible: b(2419, 1, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."),
- Class_0_incorrectly_implements_interface_1: b(2420, 1, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."),
- A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: b(2422, 1, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."),
- Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: b(2423, 1, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),
- Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: b(2425, 1, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),
- Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: b(2426, 1, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),
- Interface_name_cannot_be_0: b(2427, 1, "Interface_name_cannot_be_0_2427", "Interface name cannot be '{0}'."),
- All_declarations_of_0_must_have_identical_type_parameters: b(2428, 1, "All_declarations_of_0_must_have_identical_type_parameters_2428", "All declarations of '{0}' must have identical type parameters."),
- Interface_0_incorrectly_extends_interface_1: b(2430, 1, "Interface_0_incorrectly_extends_interface_1_2430", "Interface '{0}' incorrectly extends interface '{1}'."),
- Enum_name_cannot_be_0: b(2431, 1, "Enum_name_cannot_be_0_2431", "Enum name cannot be '{0}'."),
- In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: b(2432, 1, "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),
- A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: b(2433, 1, "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", "A namespace declaration cannot be in a different file from a class or function with which it is merged."),
- A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: b(2434, 1, "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", "A namespace declaration cannot be located prior to a class or function with which it is merged."),
- Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: b(2435, 1, "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", "Ambient modules cannot be nested in other modules or namespaces."),
- Ambient_module_declaration_cannot_specify_relative_module_name: b(2436, 1, "Ambient_module_declaration_cannot_specify_relative_module_name_2436", "Ambient module declaration cannot specify relative module name."),
- Module_0_is_hidden_by_a_local_declaration_with_the_same_name: b(2437, 1, "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", "Module '{0}' is hidden by a local declaration with the same name."),
- Import_name_cannot_be_0: b(2438, 1, "Import_name_cannot_be_0_2438", "Import name cannot be '{0}'."),
- Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: b(2439, 1, "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", "Import or export declaration in an ambient module declaration cannot reference module through relative module name."),
- Import_declaration_conflicts_with_local_declaration_of_0: b(2440, 1, "Import_declaration_conflicts_with_local_declaration_of_0_2440", "Import declaration conflicts with local declaration of '{0}'."),
- Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: b(2441, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),
- Types_have_separate_declarations_of_a_private_property_0: b(2442, 1, "Types_have_separate_declarations_of_a_private_property_0_2442", "Types have separate declarations of a private property '{0}'."),
- Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: b(2443, 1, "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),
- Property_0_is_protected_in_type_1_but_public_in_type_2: b(2444, 1, "Property_0_is_protected_in_type_1_but_public_in_type_2_2444", "Property '{0}' is protected in type '{1}' but public in type '{2}'."),
- Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: b(2445, 1, "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),
- Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: b(2446, 1, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),
- The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: b(2447, 1, "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),
- Block_scoped_variable_0_used_before_its_declaration: b(2448, 1, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."),
- Class_0_used_before_its_declaration: b(2449, 1, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."),
- Enum_0_used_before_its_declaration: b(2450, 1, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."),
- Cannot_redeclare_block_scoped_variable_0: b(2451, 1, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."),
- An_enum_member_cannot_have_a_numeric_name: b(2452, 1, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."),
- Variable_0_is_used_before_being_assigned: b(2454, 1, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."),
- Type_alias_0_circularly_references_itself: b(2456, 1, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."),
- Type_alias_name_cannot_be_0: b(2457, 1, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."),
- An_AMD_module_cannot_have_multiple_name_assignments: b(2458, 1, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."),
- Module_0_declares_1_locally_but_it_is_not_exported: b(2459, 1, "Module_0_declares_1_locally_but_it_is_not_exported_2459", "Module '{0}' declares '{1}' locally, but it is not exported."),
- Module_0_declares_1_locally_but_it_is_exported_as_2: b(2460, 1, "Module_0_declares_1_locally_but_it_is_exported_as_2_2460", "Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),
- Type_0_is_not_an_array_type: b(2461, 1, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."),
- A_rest_element_must_be_last_in_a_destructuring_pattern: b(2462, 1, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."),
- A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: b(2463, 1, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."),
- A_computed_property_name_must_be_of_type_string_number_symbol_or_any: b(2464, 1, "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", "A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),
- this_cannot_be_referenced_in_a_computed_property_name: b(2465, 1, "this_cannot_be_referenced_in_a_computed_property_name_2465", "'this' cannot be referenced in a computed property name."),
- super_cannot_be_referenced_in_a_computed_property_name: b(2466, 1, "super_cannot_be_referenced_in_a_computed_property_name_2466", "'super' cannot be referenced in a computed property name."),
- A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: b(2467, 1, "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467", "A computed property name cannot reference a type parameter from its containing type."),
- Cannot_find_global_value_0: b(2468, 1, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."),
- The_0_operator_cannot_be_applied_to_type_symbol: b(2469, 1, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."),
- Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: b(2472, 1, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),
- Enum_declarations_must_all_be_const_or_non_const: b(2473, 1, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."),
- const_enum_member_initializers_must_be_constant_expressions: b(2474, 1, "const_enum_member_initializers_must_be_constant_expressions_2474", "const enum member initializers must be constant expressions."),
- const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: b(2475, 1, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),
- A_const_enum_member_can_only_be_accessed_using_a_string_literal: b(2476, 1, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."),
- const_enum_member_initializer_was_evaluated_to_a_non_finite_value: b(2477, 1, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."),
- const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: b(2478, 1, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."),
- let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: b(2480, 1, "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", "'let' is not allowed to be used as a name in 'let' or 'const' declarations."),
- Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: b(2481, 1, "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),
- The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: b(2483, 1, "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", "The left-hand side of a 'for...of' statement cannot use a type annotation."),
- Export_declaration_conflicts_with_exported_declaration_of_0: b(2484, 1, "Export_declaration_conflicts_with_exported_declaration_of_0_2484", "Export declaration conflicts with exported declaration of '{0}'."),
- The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: b(2487, 1, "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", "The left-hand side of a 'for...of' statement must be a variable or a property access."),
- Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: b(2488, 1, "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),
- An_iterator_must_have_a_next_method: b(2489, 1, "An_iterator_must_have_a_next_method_2489", "An iterator must have a 'next()' method."),
- The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: b(2490, 1, "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the '{0}()' method of an iterator must have a 'value' property."),
- The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: b(2491, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),
- Cannot_redeclare_identifier_0_in_catch_clause: b(2492, 1, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."),
- Tuple_type_0_of_length_1_has_no_element_at_index_2: b(2493, 1, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."),
- Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: b(2494, 1, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),
- Type_0_is_not_an_array_type_or_a_string_type: b(2495, 1, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."),
- The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression: b(2496, 1, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496", "The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."),
- This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: b(2497, 1, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),
- Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: b(2498, 1, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."),
- An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: b(2499, 1, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."),
- A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: b(2500, 1, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."),
- A_rest_element_cannot_contain_a_binding_pattern: b(2501, 1, "A_rest_element_cannot_contain_a_binding_pattern_2501", "A rest element cannot contain a binding pattern."),
- _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: b(2502, 1, "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", "'{0}' is referenced directly or indirectly in its own type annotation."),
- Cannot_find_namespace_0: b(2503, 1, "Cannot_find_namespace_0_2503", "Cannot find namespace '{0}'."),
- Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: b(2504, 1, "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),
- A_generator_cannot_have_a_void_type_annotation: b(2505, 1, "A_generator_cannot_have_a_void_type_annotation_2505", "A generator cannot have a 'void' type annotation."),
- _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: b(2506, 1, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."),
- Type_0_is_not_a_constructor_function_type: b(2507, 1, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."),
- No_base_constructor_has_the_specified_number_of_type_arguments: b(2508, 1, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."),
- Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: b(2509, 1, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),
- Base_constructors_must_all_have_the_same_return_type: b(2510, 1, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."),
- Cannot_create_an_instance_of_an_abstract_class: b(2511, 1, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."),
- Overload_signatures_must_all_be_abstract_or_non_abstract: b(2512, 1, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."),
- Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: b(2513, 1, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),
- A_tuple_type_cannot_be_indexed_with_a_negative_value: b(2514, 1, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."),
- Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: b(2515, 1, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),
- All_declarations_of_an_abstract_method_must_be_consecutive: b(2516, 1, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."),
- Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: b(2517, 1, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."),
- A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: b(2518, 1, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."),
- An_async_iterator_must_have_a_next_method: b(2519, 1, "An_async_iterator_must_have_a_next_method_2519", "An async iterator must have a 'next()' method."),
- Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: b(2520, 1, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),
- The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method: b(2522, 1, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522", "The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."),
- yield_expressions_cannot_be_used_in_a_parameter_initializer: b(2523, 1, "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523", "'yield' expressions cannot be used in a parameter initializer."),
- await_expressions_cannot_be_used_in_a_parameter_initializer: b(2524, 1, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."),
- A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: b(2526, 1, "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", "A 'this' type is available only in a non-static member of a class or interface."),
- The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: b(2527, 1, "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527", "The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),
- A_module_cannot_have_multiple_default_exports: b(2528, 1, "A_module_cannot_have_multiple_default_exports_2528", "A module cannot have multiple default exports."),
- Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: b(2529, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),
- Property_0_is_incompatible_with_index_signature: b(2530, 1, "Property_0_is_incompatible_with_index_signature_2530", "Property '{0}' is incompatible with index signature."),
- Object_is_possibly_null: b(2531, 1, "Object_is_possibly_null_2531", "Object is possibly 'null'."),
- Object_is_possibly_undefined: b(2532, 1, "Object_is_possibly_undefined_2532", "Object is possibly 'undefined'."),
- Object_is_possibly_null_or_undefined: b(2533, 1, "Object_is_possibly_null_or_undefined_2533", "Object is possibly 'null' or 'undefined'."),
- A_function_returning_never_cannot_have_a_reachable_end_point: b(2534, 1, "A_function_returning_never_cannot_have_a_reachable_end_point_2534", "A function returning 'never' cannot have a reachable end point."),
- Type_0_cannot_be_used_to_index_type_1: b(2536, 1, "Type_0_cannot_be_used_to_index_type_1_2536", "Type '{0}' cannot be used to index type '{1}'."),
- Type_0_has_no_matching_index_signature_for_type_1: b(2537, 1, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."),
- Type_0_cannot_be_used_as_an_index_type: b(2538, 1, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."),
- Cannot_assign_to_0_because_it_is_not_a_variable: b(2539, 1, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."),
- Cannot_assign_to_0_because_it_is_a_read_only_property: b(2540, 1, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."),
- Index_signature_in_type_0_only_permits_reading: b(2542, 1, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."),
- Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: b(2543, 1, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),
- Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: b(2544, 1, "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),
- A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: b(2545, 1, "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", "A mixin class must have a constructor with a single rest parameter of type 'any[]'."),
- The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: b(2547, 1, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),
- Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: b(2548, 1, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),
- Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: b(2549, 1, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),
- Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: b(2550, 1, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),
- Property_0_does_not_exist_on_type_1_Did_you_mean_2: b(2551, 1, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),
- Cannot_find_name_0_Did_you_mean_1: b(2552, 1, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"),
- Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: b(2553, 1, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."),
- Expected_0_arguments_but_got_1: b(2554, 1, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."),
- Expected_at_least_0_arguments_but_got_1: b(2555, 1, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."),
- A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: b(2556, 1, "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556", "A spread argument must either have a tuple type or be passed to a rest parameter."),
- Expected_0_type_arguments_but_got_1: b(2558, 1, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."),
- Type_0_has_no_properties_in_common_with_type_1: b(2559, 1, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."),
- Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: b(2560, 1, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),
- Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: b(2561, 1, "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561", "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),
- Base_class_expressions_cannot_reference_class_type_parameters: b(2562, 1, "Base_class_expressions_cannot_reference_class_type_parameters_2562", "Base class expressions cannot reference class type parameters."),
- The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: b(2563, 1, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."),
- Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: b(2564, 1, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."),
- Property_0_is_used_before_being_assigned: b(2565, 1, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."),
- A_rest_element_cannot_have_a_property_name: b(2566, 1, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."),
- Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: b(2567, 1, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."),
- Property_0_may_not_exist_on_type_1_Did_you_mean_2: b(2568, 1, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),
- Could_not_find_name_0_Did_you_mean_1: b(2570, 1, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"),
- Object_is_of_type_unknown: b(2571, 1, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
- A_rest_element_type_must_be_an_array_type: b(2574, 1, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."),
- No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: b(2575, 1, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),
- Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: b(2576, 1, "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576", "Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),
- Return_type_annotation_circularly_references_itself: b(2577, 1, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."),
- Unused_ts_expect_error_directive: b(2578, 1, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: b(2580, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: b(2581, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: b(2582, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),
- Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: b(2583, 1, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),
- Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: b(2584, 1, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),
- _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: b(2585, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),
- Cannot_assign_to_0_because_it_is_a_constant: b(2588, 1, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."),
- Type_instantiation_is_excessively_deep_and_possibly_infinite: b(2589, 1, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."),
- Expression_produces_a_union_type_that_is_too_complex_to_represent: b(2590, 1, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: b(2591, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: b(2592, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: b(2593, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),
- This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: b(2594, 1, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),
- _0_can_only_be_imported_by_using_a_default_import: b(2595, 1, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."),
- _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: b(2596, 1, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),
- _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: b(2597, 1, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."),
- _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: b(2598, 1, "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598", "'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),
- JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: b(2602, 1, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),
- Property_0_in_type_1_is_not_assignable_to_type_2: b(2603, 1, "Property_0_in_type_1_is_not_assignable_to_type_2_2603", "Property '{0}' in type '{1}' is not assignable to type '{2}'."),
- JSX_element_type_0_does_not_have_any_construct_or_call_signatures: b(2604, 1, "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", "JSX element type '{0}' does not have any construct or call signatures."),
- Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: b(2606, 1, "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", "Property '{0}' of JSX spread attribute is not assignable to target property."),
- JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: b(2607, 1, "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", "JSX element class does not support attributes because it does not have a '{0}' property."),
- The_global_type_JSX_0_may_not_have_more_than_one_property: b(2608, 1, "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", "The global type 'JSX.{0}' may not have more than one property."),
- JSX_spread_child_must_be_an_array_type: b(2609, 1, "JSX_spread_child_must_be_an_array_type_2609", "JSX spread child must be an array type."),
- _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: b(2610, 1, "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610", "'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),
- _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: b(2611, 1, "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611", "'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),
- Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: b(2612, 1, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),
- Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: b(2613, 1, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
- Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: b(2614, 1, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
- Type_of_property_0_circularly_references_itself_in_mapped_type_1: b(2615, 1, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."),
- _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: b(2616, 1, "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616", "'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),
- _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: b(2617, 1, "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617", "'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),
- Source_has_0_element_s_but_target_requires_1: b(2618, 1, "Source_has_0_element_s_but_target_requires_1_2618", "Source has {0} element(s) but target requires {1}."),
- Source_has_0_element_s_but_target_allows_only_1: b(2619, 1, "Source_has_0_element_s_but_target_allows_only_1_2619", "Source has {0} element(s) but target allows only {1}."),
- Target_requires_0_element_s_but_source_may_have_fewer: b(2620, 1, "Target_requires_0_element_s_but_source_may_have_fewer_2620", "Target requires {0} element(s) but source may have fewer."),
- Target_allows_only_0_element_s_but_source_may_have_more: b(2621, 1, "Target_allows_only_0_element_s_but_source_may_have_more_2621", "Target allows only {0} element(s) but source may have more."),
- Source_provides_no_match_for_required_element_at_position_0_in_target: b(2623, 1, "Source_provides_no_match_for_required_element_at_position_0_in_target_2623", "Source provides no match for required element at position {0} in target."),
- Source_provides_no_match_for_variadic_element_at_position_0_in_target: b(2624, 1, "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624", "Source provides no match for variadic element at position {0} in target."),
- Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: b(2625, 1, "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625", "Variadic element at position {0} in source does not match element at position {1} in target."),
- Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: b(2626, 1, "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626", "Type at position {0} in source is not compatible with type at position {1} in target."),
- Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: b(2627, 1, "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627", "Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),
- Cannot_assign_to_0_because_it_is_an_enum: b(2628, 1, "Cannot_assign_to_0_because_it_is_an_enum_2628", "Cannot assign to '{0}' because it is an enum."),
- Cannot_assign_to_0_because_it_is_a_class: b(2629, 1, "Cannot_assign_to_0_because_it_is_a_class_2629", "Cannot assign to '{0}' because it is a class."),
- Cannot_assign_to_0_because_it_is_a_function: b(2630, 1, "Cannot_assign_to_0_because_it_is_a_function_2630", "Cannot assign to '{0}' because it is a function."),
- Cannot_assign_to_0_because_it_is_a_namespace: b(2631, 1, "Cannot_assign_to_0_because_it_is_a_namespace_2631", "Cannot assign to '{0}' because it is a namespace."),
- Cannot_assign_to_0_because_it_is_an_import: b(2632, 1, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."),
- JSX_property_access_expressions_cannot_include_JSX_namespace_names: b(2633, 1, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
- _0_index_signatures_are_incompatible: b(2634, 1, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
- Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: b(2635, 1, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
- Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: b(2636, 1, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),
- Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: b(2637, 1, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),
- Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: b(2638, 1, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),
- React_components_cannot_include_JSX_namespace_names: b(2639, 1, "React_components_cannot_include_JSX_namespace_names_2639", "React components cannot include JSX namespace names"),
- Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: b(2649, 1, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
- Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more: b(2650, 1, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650", "Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),
- A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: b(2651, 1, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
- Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: b(2652, 1, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
- Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: b(2653, 1, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),
- Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2: b(2654, 1, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),
- Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more: b(2655, 1, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),
- Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1: b(2656, 1, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656", "Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),
- JSX_expressions_must_have_one_parent_element: b(2657, 1, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."),
- Type_0_provides_no_match_for_the_signature_1: b(2658, 1, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."),
- super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: b(2659, 1, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),
- super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: b(2660, 1, "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", "'super' can only be referenced in members of derived classes or object literal expressions."),
- Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: b(2661, 1, "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", "Cannot export '{0}'. Only local declarations can be exported from a module."),
- Cannot_find_name_0_Did_you_mean_the_static_member_1_0: b(2662, 1, "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),
- Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: b(2663, 1, "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),
- Invalid_module_name_in_augmentation_module_0_cannot_be_found: b(2664, 1, "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", "Invalid module name in augmentation, module '{0}' cannot be found."),
- Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: b(2665, 1, "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665", "Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),
- Exports_and_export_assignments_are_not_permitted_in_module_augmentations: b(2666, 1, "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", "Exports and export assignments are not permitted in module augmentations."),
- Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: b(2667, 1, "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),
- export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: b(2668, 1, "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),
- Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: b(2669, 1, "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),
- Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: b(2670, 1, "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),
- Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: b(2671, 1, "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671", "Cannot augment module '{0}' because it resolves to a non-module entity."),
- Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: b(2672, 1, "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672", "Cannot assign a '{0}' constructor type to a '{1}' constructor type."),
- Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: b(2673, 1, "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673", "Constructor of class '{0}' is private and only accessible within the class declaration."),
- Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: b(2674, 1, "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674", "Constructor of class '{0}' is protected and only accessible within the class declaration."),
- Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: b(2675, 1, "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675", "Cannot extend a class '{0}'. Class constructor is marked as private."),
- Accessors_must_both_be_abstract_or_non_abstract: b(2676, 1, "Accessors_must_both_be_abstract_or_non_abstract_2676", "Accessors must both be abstract or non-abstract."),
- A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: b(2677, 1, "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677", "A type predicate's type must be assignable to its parameter's type."),
- Type_0_is_not_comparable_to_type_1: b(2678, 1, "Type_0_is_not_comparable_to_type_1_2678", "Type '{0}' is not comparable to type '{1}'."),
- A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: b(2679, 1, "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679", "A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),
- A_0_parameter_must_be_the_first_parameter: b(2680, 1, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."),
- A_constructor_cannot_have_a_this_parameter: b(2681, 1, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."),
- this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: b(2683, 1, "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", "'this' implicitly has type 'any' because it does not have a type annotation."),
- The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: b(2684, 1, "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),
- The_this_types_of_each_signature_are_incompatible: b(2685, 1, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."),
- _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: b(2686, 1, "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686", "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),
- All_declarations_of_0_must_have_identical_modifiers: b(2687, 1, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."),
- Cannot_find_type_definition_file_for_0: b(2688, 1, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."),
- Cannot_extend_an_interface_0_Did_you_mean_implements: b(2689, 1, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"),
- _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: b(2690, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),
- _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: b(2692, 1, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),
- _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: b(2693, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."),
- Namespace_0_has_no_exported_member_1: b(2694, 1, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."),
- Left_side_of_comma_operator_is_unused_and_has_no_side_effects: b(
- 2695,
- 1,
- "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695",
- "Left side of comma operator is unused and has no side effects.",
- /*reportsUnnecessary*/
- !0
- ),
- The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: b(2696, 1, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),
- An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: b(2697, 1, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),
- Spread_types_may_only_be_created_from_object_types: b(2698, 1, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."),
- Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: b(2699, 1, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),
- Rest_types_may_only_be_created_from_object_types: b(2700, 1, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."),
- The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: b(2701, 1, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."),
- _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: b(2702, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."),
- The_operand_of_a_delete_operator_must_be_a_property_reference: b(2703, 1, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."),
- The_operand_of_a_delete_operator_cannot_be_a_read_only_property: b(2704, 1, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."),
- An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: b(2705, 1, "An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705", "An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),
- Required_type_parameters_may_not_follow_optional_type_parameters: b(2706, 1, "Required_type_parameters_may_not_follow_optional_type_parameters_2706", "Required type parameters may not follow optional type parameters."),
- Generic_type_0_requires_between_1_and_2_type_arguments: b(2707, 1, "Generic_type_0_requires_between_1_and_2_type_arguments_2707", "Generic type '{0}' requires between {1} and {2} type arguments."),
- Cannot_use_namespace_0_as_a_value: b(2708, 1, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."),
- Cannot_use_namespace_0_as_a_type: b(2709, 1, "Cannot_use_namespace_0_as_a_type_2709", "Cannot use namespace '{0}' as a type."),
- _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: b(2710, 1, "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", "'{0}' are specified twice. The attribute named '{0}' will be overwritten."),
- A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: b(2711, 1, "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711", "A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),
- A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: b(2712, 1, "A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712", "A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),
- Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: b(2713, 1, "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713", `Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`),
- The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: b(2714, 1, "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714", "The expression of an export assignment must be an identifier or qualified name in an ambient context."),
- Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: b(2715, 1, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),
- Type_parameter_0_has_a_circular_default: b(2716, 1, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."),
- Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: b(2717, 1, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),
- Duplicate_property_0: b(2718, 1, "Duplicate_property_0_2718", "Duplicate property '{0}'."),
- Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: b(2719, 1, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),
- Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: b(2720, 1, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),
- Cannot_invoke_an_object_which_is_possibly_null: b(2721, 1, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."),
- Cannot_invoke_an_object_which_is_possibly_undefined: b(2722, 1, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."),
- Cannot_invoke_an_object_which_is_possibly_null_or_undefined: b(2723, 1, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."),
- _0_has_no_exported_member_named_1_Did_you_mean_2: b(2724, 1, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),
- Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: b(2725, 1, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
- Cannot_find_lib_definition_for_0: b(2726, 1, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
- Cannot_find_lib_definition_for_0_Did_you_mean_1: b(2727, 1, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
- _0_is_declared_here: b(2728, 3, "_0_is_declared_here_2728", "'{0}' is declared here."),
- Property_0_is_used_before_its_initialization: b(2729, 1, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."),
- An_arrow_function_cannot_have_a_this_parameter: b(2730, 1, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."),
- Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: b(2731, 1, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
- Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: b(2732, 1, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),
- Property_0_was_also_declared_here: b(2733, 1, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."),
- Are_you_missing_a_semicolon: b(2734, 1, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
- Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: b(2735, 1, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
- Operator_0_cannot_be_applied_to_type_1: b(2736, 1, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
- BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: b(2737, 1, "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737", "BigInt literals are not available when targeting lower than ES2020."),
- An_outer_value_of_this_is_shadowed_by_this_container: b(2738, 3, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."),
- Type_0_is_missing_the_following_properties_from_type_1_Colon_2: b(2739, 1, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"),
- Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: b(2740, 1, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),
- Property_0_is_missing_in_type_1_but_required_in_type_2: b(2741, 1, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."),
- The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: b(2742, 1, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),
- No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: b(2743, 1, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),
- Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: b(2744, 1, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."),
- This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: b(2745, 1, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),
- This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: b(2746, 1, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),
- _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: b(2747, 1, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),
- Cannot_access_ambient_const_enums_when_0_is_enabled: b(2748, 1, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."),
- _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: b(2749, 1, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),
- The_implementation_signature_is_declared_here: b(2750, 1, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."),
- Circularity_originates_in_type_at_this_location: b(2751, 1, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."),
- The_first_export_default_is_here: b(2752, 1, "The_first_export_default_is_here_2752", "The first export default is here."),
- Another_export_default_is_here: b(2753, 1, "Another_export_default_is_here_2753", "Another export default is here."),
- super_may_not_use_type_arguments: b(2754, 1, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."),
- No_constituent_of_type_0_is_callable: b(2755, 1, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."),
- Not_all_constituents_of_type_0_are_callable: b(2756, 1, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."),
- Type_0_has_no_call_signatures: b(2757, 1, "Type_0_has_no_call_signatures_2757", "Type '{0}' has no call signatures."),
- Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: b(2758, 1, "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758", "Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),
- No_constituent_of_type_0_is_constructable: b(2759, 1, "No_constituent_of_type_0_is_constructable_2759", "No constituent of type '{0}' is constructable."),
- Not_all_constituents_of_type_0_are_constructable: b(2760, 1, "Not_all_constituents_of_type_0_are_constructable_2760", "Not all constituents of type '{0}' are constructable."),
- Type_0_has_no_construct_signatures: b(2761, 1, "Type_0_has_no_construct_signatures_2761", "Type '{0}' has no construct signatures."),
- Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: b(2762, 1, "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762", "Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),
- Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: b(2763, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),
- Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: b(2764, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),
- Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: b(2765, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),
- Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: b(2766, 1, "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766", "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),
- The_0_property_of_an_iterator_must_be_a_method: b(2767, 1, "The_0_property_of_an_iterator_must_be_a_method_2767", "The '{0}' property of an iterator must be a method."),
- The_0_property_of_an_async_iterator_must_be_a_method: b(2768, 1, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."),
- No_overload_matches_this_call: b(2769, 1, "No_overload_matches_this_call_2769", "No overload matches this call."),
- The_last_overload_gave_the_following_error: b(2770, 1, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."),
- The_last_overload_is_declared_here: b(2771, 1, "The_last_overload_is_declared_here_2771", "The last overload is declared here."),
- Overload_0_of_1_2_gave_the_following_error: b(2772, 1, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."),
- Did_you_forget_to_use_await: b(2773, 1, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"),
- This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: b(2774, 1, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"),
- Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: b(2775, 1, "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775", "Assertions require every name in the call target to be declared with an explicit type annotation."),
- Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: b(2776, 1, "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776", "Assertions require the call target to be an identifier or qualified name."),
- The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: b(2777, 1, "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777", "The operand of an increment or decrement operator may not be an optional property access."),
- The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: b(2778, 1, "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778", "The target of an object rest assignment may not be an optional property access."),
- The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: b(2779, 1, "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779", "The left-hand side of an assignment expression may not be an optional property access."),
- The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: b(2780, 1, "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780", "The left-hand side of a 'for...in' statement may not be an optional property access."),
- The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: b(2781, 1, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."),
- _0_needs_an_explicit_type_annotation: b(2782, 3, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."),
- _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: b(2783, 1, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."),
- get_and_set_accessors_cannot_declare_this_parameters: b(2784, 1, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."),
- This_spread_always_overwrites_this_property: b(2785, 1, "This_spread_always_overwrites_this_property_2785", "This spread always overwrites this property."),
- _0_cannot_be_used_as_a_JSX_component: b(2786, 1, "_0_cannot_be_used_as_a_JSX_component_2786", "'{0}' cannot be used as a JSX component."),
- Its_return_type_0_is_not_a_valid_JSX_element: b(2787, 1, "Its_return_type_0_is_not_a_valid_JSX_element_2787", "Its return type '{0}' is not a valid JSX element."),
- Its_instance_type_0_is_not_a_valid_JSX_element: b(2788, 1, "Its_instance_type_0_is_not_a_valid_JSX_element_2788", "Its instance type '{0}' is not a valid JSX element."),
- Its_element_type_0_is_not_a_valid_JSX_element: b(2789, 1, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."),
- The_operand_of_a_delete_operator_must_be_optional: b(2790, 1, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."),
- Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: b(2791, 1, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),
- Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option: b(2792, 1, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),
- The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: b(2793, 1, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),
- Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: b(2794, 1, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),
- The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: b(2795, 1, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),
- It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: b(2796, 1, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),
- A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: b(2797, 1, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),
- The_declaration_was_marked_as_deprecated_here: b(2798, 1, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."),
- Type_produces_a_tuple_type_that_is_too_large_to_represent: b(2799, 1, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."),
- Expression_produces_a_tuple_type_that_is_too_large_to_represent: b(2800, 1, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."),
- This_condition_will_always_return_true_since_this_0_is_always_defined: b(2801, 1, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."),
- Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: b(2802, 1, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),
- Cannot_assign_to_private_method_0_Private_methods_are_not_writable: b(2803, 1, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."),
- Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: b(2804, 1, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),
- Private_accessor_was_defined_without_a_getter: b(2806, 1, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
- This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: b(2807, 1, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
- A_get_accessor_must_be_at_least_as_accessible_as_the_setter: b(2808, 1, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
- Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: b(2809, 1, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),
- Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: b(2810, 1, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
- Initializer_for_property_0: b(2811, 1, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
- Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: b(2812, 1, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
- Class_declaration_cannot_implement_overload_list_for_0: b(2813, 1, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."),
- Function_with_bodies_can_only_merge_with_classes_that_are_ambient: b(2814, 1, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."),
- arguments_cannot_be_referenced_in_property_initializers: b(2815, 1, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."),
- Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: b(2816, 1, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."),
- Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: b(2817, 1, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."),
- Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: b(2818, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
- Namespace_name_cannot_be_0: b(2819, 1, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
- Type_0_is_not_assignable_to_type_1_Did_you_mean_2: b(2820, 1, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
- Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: b(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
- Import_assertions_cannot_be_used_with_type_only_imports_or_exports: b(2822, 1, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
- Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: b(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
- Cannot_find_namespace_0_Did_you_mean_1: b(2833, 1, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
- Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: b(2834, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
- Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: b(2835, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
- Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: b(2836, 1, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),
- Import_assertion_values_must_be_string_literal_expressions: b(2837, 1, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
- All_declarations_of_0_must_have_identical_constraints: b(2838, 1, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
- This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: b(2839, 1, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
- An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types: b(2840, 1, "An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840", "An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),
- _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: b(2842, 1, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
- We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: b(2843, 1, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
- Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: b(2844, 1, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
- This_condition_will_always_return_0: b(2845, 1, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
- A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead: b(2846, 1, "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846", "A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),
- The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression: b(2848, 1, "The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848", "The right-hand side of an 'instanceof' expression must not be an instantiation expression."),
- Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1: b(2849, 1, "Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849", "Target signature provides too few arguments. Expected {0} or more, but got {1}."),
- The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined: b(2850, 1, "The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850", "The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
- The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: b(2851, 1, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
- await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: b(2852, 1, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
- await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: b(2853, 1, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
- Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: b(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
- Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: b(2855, 1, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
- Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: b(2856, 1, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
- Import_attributes_cannot_be_used_with_type_only_imports_or_exports: b(2857, 1, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
- Import_attribute_values_must_be_string_literal_expressions: b(2858, 1, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
- Excessive_complexity_comparing_types_0_and_1: b(2859, 1, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
- The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: b(2860, 1, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),
- An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: b(2861, 1, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),
- Type_0_is_generic_and_can_only_be_indexed_for_reading: b(2862, 1, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
- A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: b(2863, 1, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
- A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: b(2864, 1, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
- Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: b(2865, 1, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
- Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: b(2866, 1, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: b(2867, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: b(2868, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),
- Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish: b(2869, 1, "Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869", "Right operand of ?? is unreachable because the left operand is never nullish."),
- This_binary_expression_is_never_nullish_Are_you_missing_parentheses: b(2870, 1, "This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870", "This binary expression is never nullish. Are you missing parentheses?"),
- This_expression_is_always_nullish: b(2871, 1, "This_expression_is_always_nullish_2871", "This expression is always nullish."),
- This_kind_of_expression_is_always_truthy: b(2872, 1, "This_kind_of_expression_is_always_truthy_2872", "This kind of expression is always truthy."),
- This_kind_of_expression_is_always_falsy: b(2873, 1, "This_kind_of_expression_is_always_falsy_2873", "This kind of expression is always falsy."),
- Import_declaration_0_is_using_private_name_1: b(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
- Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: b(4002, 1, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
- Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: b(4004, 1, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
- Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: b(4006, 1, "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006", "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),
- Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: b(4008, 1, "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008", "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),
- Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: b(4010, 1, "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010", "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),
- Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: b(4012, 1, "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012", "Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),
- Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: b(4014, 1, "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", "Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),
- Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: b(4016, 1, "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", "Type parameter '{0}' of exported function has or is using private name '{1}'."),
- Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: b(4019, 1, "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", "Implements clause of exported class '{0}' has or is using private name '{1}'."),
- extends_clause_of_exported_class_0_has_or_is_using_private_name_1: b(4020, 1, "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", "'extends' clause of exported class '{0}' has or is using private name '{1}'."),
- extends_clause_of_exported_class_has_or_is_using_private_name_0: b(4021, 1, "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021", "'extends' clause of exported class has or is using private name '{0}'."),
- extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: b(4022, 1, "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", "'extends' clause of exported interface '{0}' has or is using private name '{1}'."),
- Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4023, 1, "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),
- Exported_variable_0_has_or_is_using_name_1_from_private_module_2: b(4024, 1, "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", "Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),
- Exported_variable_0_has_or_is_using_private_name_1: b(4025, 1, "Exported_variable_0_has_or_is_using_private_name_1_4025", "Exported variable '{0}' has or is using private name '{1}'."),
- Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4026, 1, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026", "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: b(4027, 1, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027", "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
- Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: b(4028, 1, "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028", "Public static property '{0}' of exported class has or is using private name '{1}'."),
- Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4029, 1, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029", "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: b(4030, 1, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030", "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
- Public_property_0_of_exported_class_has_or_is_using_private_name_1: b(4031, 1, "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031", "Public property '{0}' of exported class has or is using private name '{1}'."),
- Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4032, 1, "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032", "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),
- Property_0_of_exported_interface_has_or_is_using_private_name_1: b(4033, 1, "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033", "Property '{0}' of exported interface has or is using private name '{1}'."),
- Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4034, 1, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034", "Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),
- Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: b(4035, 1, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035", "Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),
- Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4036, 1, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036", "Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),
- Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: b(4037, 1, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037", "Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),
- Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4038, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4039, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),
- Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: b(4040, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040", "Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),
- Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4041, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041", "Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4042, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042", "Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),
- Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: b(4043, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043", "Return type of public getter '{0}' from exported class has or is using private name '{1}'."),
- Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: b(4044, 1, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044", "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),
- Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: b(4045, 1, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045", "Return type of constructor signature from exported interface has or is using private name '{0}'."),
- Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: b(4046, 1, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046", "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),
- Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: b(4047, 1, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047", "Return type of call signature from exported interface has or is using private name '{0}'."),
- Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: b(4048, 1, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048", "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),
- Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: b(4049, 1, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049", "Return type of index signature from exported interface has or is using private name '{0}'."),
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: b(4050, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050", "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: b(4051, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051", "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),
- Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: b(4052, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052", "Return type of public static method from exported class has or is using private name '{0}'."),
- Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: b(4053, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053", "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),
- Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: b(4054, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054", "Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),
- Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: b(4055, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055", "Return type of public method from exported class has or is using private name '{0}'."),
- Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: b(4056, 1, "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056", "Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),
- Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: b(4057, 1, "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057", "Return type of method from exported interface has or is using private name '{0}'."),
- Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: b(4058, 1, "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058", "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),
- Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: b(4059, 1, "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059", "Return type of exported function has or is using name '{0}' from private module '{1}'."),
- Return_type_of_exported_function_has_or_is_using_private_name_0: b(4060, 1, "Return_type_of_exported_function_has_or_is_using_private_name_0_4060", "Return type of exported function has or is using private name '{0}'."),
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4061, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4062, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: b(4063, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063", "Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),
- Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4064, 1, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064", "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: b(4065, 1, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065", "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),
- Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4066, 1, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066", "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: b(4067, 1, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067", "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4068, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4069, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: b(4070, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070", "Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4071, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071", "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: b(4072, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072", "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: b(4073, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073", "Parameter '{0}' of public method from exported class has or is using private name '{1}'."),
- Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4074, 1, "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074", "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: b(4075, 1, "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075", "Parameter '{0}' of method from exported interface has or is using private name '{1}'."),
- Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4076, 1, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076", "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),
- Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: b(4077, 1, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077", "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_exported_function_has_or_is_using_private_name_1: b(4078, 1, "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078", "Parameter '{0}' of exported function has or is using private name '{1}'."),
- Exported_type_alias_0_has_or_is_using_private_name_1: b(4081, 1, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."),
- Default_export_of_the_module_has_or_is_using_private_name_0: b(4082, 1, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
- Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: b(4083, 1, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
- Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: b(4084, 1, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
- Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: b(4085, 1, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
- Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4091, 1, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: b(4092, 1, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
- Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected: b(4094, 1, "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", "Property '{0}' of exported anonymous class type may not be private or protected."),
- Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4095, 1, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: b(4096, 1, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
- Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: b(4097, 1, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."),
- Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4098, 1, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098", "Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
- Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: b(4099, 1, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099", "Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
- Public_method_0_of_exported_class_has_or_is_using_private_name_1: b(4100, 1, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."),
- Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: b(4101, 1, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),
- Method_0_of_exported_interface_has_or_is_using_private_name_1: b(4102, 1, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."),
- Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: b(4103, 1, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."),
- The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: b(4104, 1, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),
- Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: b(4105, 1, "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105", "Private or protected member '{0}' cannot be accessed on a type parameter."),
- Parameter_0_of_accessor_has_or_is_using_private_name_1: b(4106, 1, "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106", "Parameter '{0}' of accessor has or is using private name '{1}'."),
- Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: b(4107, 1, "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107", "Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),
- Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: b(4108, 1, "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108", "Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),
- Type_arguments_for_0_circularly_reference_themselves: b(4109, 1, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."),
- Tuple_type_arguments_circularly_reference_themselves: b(4110, 1, "Tuple_type_arguments_circularly_reference_themselves_4110", "Tuple type arguments circularly reference themselves."),
- Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: b(4111, 1, "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111", "Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),
- This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class: b(4112, 1, "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112", "This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),
- This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0: b(4113, 1, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),
- This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0: b(4114, 1, "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114", "This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),
- This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0: b(4115, 1, "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115", "This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),
- This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: b(4116, 1, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),
- This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: b(4117, 1, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
- The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: b(4118, 1, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."),
- This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: b(4119, 1, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
- This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: b(4120, 1, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
- This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: b(4121, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
- This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: b(4122, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
- This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: b(4123, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
- Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: b(4124, 1, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
- Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: b(4125, 1, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
- One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: b(4126, 1, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
- The_current_host_does_not_support_the_0_option: b(5001, 1, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
- Cannot_find_the_common_subdirectory_path_for_the_input_files: b(5009, 1, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
- File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: b(5010, 1, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
- Cannot_read_file_0_Colon_1: b(5012, 1, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."),
- Unknown_compiler_option_0: b(5023, 1, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."),
- Compiler_option_0_requires_a_value_of_type_1: b(5024, 1, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."),
- Unknown_compiler_option_0_Did_you_mean_1: b(5025, 1, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"),
- Could_not_write_file_0_Colon_1: b(5033, 1, "Could_not_write_file_0_Colon_1_5033", "Could not write file '{0}': {1}."),
- Option_project_cannot_be_mixed_with_source_files_on_a_command_line: b(5042, 1, "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", "Option 'project' cannot be mixed with source files on a command line."),
- Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: b(5047, 1, "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),
- Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: b(5051, 1, "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),
- Option_0_cannot_be_specified_without_specifying_option_1: b(5052, 1, "Option_0_cannot_be_specified_without_specifying_option_1_5052", "Option '{0}' cannot be specified without specifying option '{1}'."),
- Option_0_cannot_be_specified_with_option_1: b(5053, 1, "Option_0_cannot_be_specified_with_option_1_5053", "Option '{0}' cannot be specified with option '{1}'."),
- A_tsconfig_json_file_is_already_defined_at_Colon_0: b(5054, 1, "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", "A 'tsconfig.json' file is already defined at: '{0}'."),
- Cannot_write_file_0_because_it_would_overwrite_input_file: b(5055, 1, "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", "Cannot write file '{0}' because it would overwrite input file."),
- Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: b(5056, 1, "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", "Cannot write file '{0}' because it would be overwritten by multiple input files."),
- Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: b(5057, 1, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."),
- The_specified_path_does_not_exist_Colon_0: b(5058, 1, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."),
- Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: b(5059, 1, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),
- Pattern_0_can_have_at_most_one_Asterisk_character: b(5061, 1, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."),
- Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: b(5062, 1, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."),
- Substitutions_for_pattern_0_should_be_an_array: b(5063, 1, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."),
- Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: b(5064, 1, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),
- File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: b(5065, 1, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),
- Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: b(5066, 1, "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066", "Substitutions for pattern '{0}' shouldn't be an empty array."),
- Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: b(5067, 1, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),
- Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: b(5068, 1, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
- Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: b(5069, 1, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
- Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: b(5070, 1, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
- Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd: b(5071, 1, "Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071", "Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),
- Unknown_build_option_0: b(5072, 1, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
- Build_option_0_requires_a_value_of_type_1: b(5073, 1, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
- Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: b(5074, 1, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),
- _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: b(5075, 1, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),
- _0_and_1_operations_cannot_be_mixed_without_parentheses: b(5076, 1, "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076", "'{0}' and '{1}' operations cannot be mixed without parentheses."),
- Unknown_build_option_0_Did_you_mean_1: b(5077, 1, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"),
- Unknown_watch_option_0: b(5078, 1, "Unknown_watch_option_0_5078", "Unknown watch option '{0}'."),
- Unknown_watch_option_0_Did_you_mean_1: b(5079, 1, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"),
- Watch_option_0_requires_a_value_of_type_1: b(5080, 1, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."),
- Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: b(5081, 1, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."),
- _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: b(5082, 1, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),
- Cannot_read_file_0: b(5083, 1, "Cannot_read_file_0_5083", "Cannot read file '{0}'."),
- A_tuple_member_cannot_be_both_optional_and_rest: b(5085, 1, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."),
- A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: b(5086, 1, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),
- A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: b(5087, 1, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),
- The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: b(5088, 1, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),
- Option_0_cannot_be_specified_when_option_jsx_is_1: b(5089, 1, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."),
- Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: b(5090, 1, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),
- Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: b(5091, 1, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),
- The_root_value_of_a_0_file_must_be_an_object: b(5092, 1, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
- Compiler_option_0_may_only_be_used_with_build: b(5093, 1, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
- Compiler_option_0_may_not_be_used_with_build: b(5094, 1, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
- Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: b(5095, 1, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),
- Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: b(5096, 1, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
- An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: b(5097, 1, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
- Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: b(5098, 1, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
- Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: b(5101, 1, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
- Option_0_has_been_removed_Please_remove_it_from_your_configuration: b(5102, 1, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."),
- Invalid_value_for_ignoreDeprecations: b(5103, 1, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
- Option_0_is_redundant_and_cannot_be_specified_with_option_1: b(5104, 1, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."),
- Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: b(5105, 1, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),
- Use_0_instead: b(5106, 3, "Use_0_instead_5106", "Use '{0}' instead."),
- Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: b(5107, 1, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),
- Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: b(5108, 1, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
- Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: b(5109, 1, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),
- Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: b(5110, 1, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),
- Generates_a_sourcemap_for_each_corresponding_d_ts_file: b(6e3, 3, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
- Concatenate_and_emit_output_to_single_file: b(6001, 3, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
- Generates_corresponding_d_ts_file: b(6002, 3, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
- Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: b(6004, 3, "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004", "Specify the location where debugger should locate TypeScript files instead of source locations."),
- Watch_input_files: b(6005, 3, "Watch_input_files_6005", "Watch input files."),
- Redirect_output_structure_to_the_directory: b(6006, 3, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."),
- Do_not_erase_const_enum_declarations_in_generated_code: b(6007, 3, "Do_not_erase_const_enum_declarations_in_generated_code_6007", "Do not erase const enum declarations in generated code."),
- Do_not_emit_outputs_if_any_errors_were_reported: b(6008, 3, "Do_not_emit_outputs_if_any_errors_were_reported_6008", "Do not emit outputs if any errors were reported."),
- Do_not_emit_comments_to_output: b(6009, 3, "Do_not_emit_comments_to_output_6009", "Do not emit comments to output."),
- Do_not_emit_outputs: b(6010, 3, "Do_not_emit_outputs_6010", "Do not emit outputs."),
- Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: b(6011, 3, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),
- Skip_type_checking_of_declaration_files: b(6012, 3, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."),
- Do_not_resolve_the_real_path_of_symlinks: b(6013, 3, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."),
- Only_emit_d_ts_declaration_files: b(6014, 3, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."),
- Specify_ECMAScript_target_version: b(6015, 3, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."),
- Specify_module_code_generation: b(6016, 3, "Specify_module_code_generation_6016", "Specify module code generation."),
- Print_this_message: b(6017, 3, "Print_this_message_6017", "Print this message."),
- Print_the_compiler_s_version: b(6019, 3, "Print_the_compiler_s_version_6019", "Print the compiler's version."),
- Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: b(6020, 3, "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),
- Syntax_Colon_0: b(6023, 3, "Syntax_Colon_0_6023", "Syntax: {0}"),
- options: b(6024, 3, "options_6024", "options"),
- file: b(6025, 3, "file_6025", "file"),
- Examples_Colon_0: b(6026, 3, "Examples_Colon_0_6026", "Examples: {0}"),
- Options_Colon: b(6027, 3, "Options_Colon_6027", "Options:"),
- Version_0: b(6029, 3, "Version_0_6029", "Version {0}"),
- Insert_command_line_options_and_files_from_a_file: b(6030, 3, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."),
- Starting_compilation_in_watch_mode: b(6031, 3, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."),
- File_change_detected_Starting_incremental_compilation: b(6032, 3, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."),
- KIND: b(6034, 3, "KIND_6034", "KIND"),
- FILE: b(6035, 3, "FILE_6035", "FILE"),
- VERSION: b(6036, 3, "VERSION_6036", "VERSION"),
- LOCATION: b(6037, 3, "LOCATION_6037", "LOCATION"),
- DIRECTORY: b(6038, 3, "DIRECTORY_6038", "DIRECTORY"),
- STRATEGY: b(6039, 3, "STRATEGY_6039", "STRATEGY"),
- FILE_OR_DIRECTORY: b(6040, 3, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
- Errors_Files: b(6041, 3, "Errors_Files_6041", "Errors Files"),
- Generates_corresponding_map_file: b(6043, 3, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
- Compiler_option_0_expects_an_argument: b(6044, 1, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
- Unterminated_quoted_string_in_response_file_0: b(6045, 1, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
- Argument_for_0_option_must_be_Colon_1: b(6046, 1, "Argument_for_0_option_must_be_Colon_1_6046", "Argument for '{0}' option must be: {1}."),
- Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: b(6048, 1, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form or -. For example '{0}' or '{1}'."),
- Unable_to_open_file_0: b(6050, 1, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."),
- Corrupted_locale_file_0: b(6051, 1, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."),
- Raise_error_on_expressions_and_declarations_with_an_implied_any_type: b(6052, 3, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."),
- File_0_not_found: b(6053, 1, "File_0_not_found_6053", "File '{0}' not found."),
- File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: b(6054, 1, "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054", "File '{0}' has an unsupported extension. The only supported extensions are {1}."),
- Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: b(6055, 3, "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055", "Suppress noImplicitAny errors for indexing objects lacking index signatures."),
- Do_not_emit_declarations_for_code_that_has_an_internal_annotation: b(6056, 3, "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056", "Do not emit declarations for code that has an '@internal' annotation."),
- Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: b(6058, 3, "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058", "Specify the root directory of input files. Use to control the output directory structure with --outDir."),
- File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: b(6059, 1, "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059", "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),
- Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: b(6060, 3, "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060", "Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),
- NEWLINE: b(6061, 3, "NEWLINE_6061", "NEWLINE"),
- Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: b(6064, 1, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),
- Enables_experimental_support_for_ES7_decorators: b(6065, 3, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."),
- Enables_experimental_support_for_emitting_type_metadata_for_decorators: b(6066, 3, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."),
- Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: b(6070, 3, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."),
- Successfully_created_a_tsconfig_json_file: b(6071, 3, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."),
- Suppress_excess_property_checks_for_object_literals: b(6072, 3, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."),
- Stylize_errors_and_messages_using_color_and_context_experimental: b(6073, 3, "Stylize_errors_and_messages_using_color_and_context_experimental_6073", "Stylize errors and messages using color and context (experimental)."),
- Do_not_report_errors_on_unused_labels: b(6074, 3, "Do_not_report_errors_on_unused_labels_6074", "Do not report errors on unused labels."),
- Report_error_when_not_all_code_paths_in_function_return_a_value: b(6075, 3, "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", "Report error when not all code paths in function return a value."),
- Report_errors_for_fallthrough_cases_in_switch_statement: b(6076, 3, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."),
- Do_not_report_errors_on_unreachable_code: b(6077, 3, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."),
- Disallow_inconsistently_cased_references_to_the_same_file: b(6078, 3, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
- Specify_library_files_to_be_included_in_the_compilation: b(6079, 3, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
- Specify_JSX_code_generation: b(6080, 3, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
- Only_amd_and_system_modules_are_supported_alongside_0: b(6082, 1, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
- Base_directory_to_resolve_non_absolute_module_names: b(6083, 3, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
- Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: b(6084, 3, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
- Enable_tracing_of_the_name_resolution_process: b(6085, 3, "Enable_tracing_of_the_name_resolution_process_6085", "Enable tracing of the name resolution process."),
- Resolving_module_0_from_1: b(6086, 3, "Resolving_module_0_from_1_6086", "======== Resolving module '{0}' from '{1}'. ========"),
- Explicitly_specified_module_resolution_kind_Colon_0: b(6087, 3, "Explicitly_specified_module_resolution_kind_Colon_0_6087", "Explicitly specified module resolution kind: '{0}'."),
- Module_resolution_kind_is_not_specified_using_0: b(6088, 3, "Module_resolution_kind_is_not_specified_using_0_6088", "Module resolution kind is not specified, using '{0}'."),
- Module_name_0_was_successfully_resolved_to_1: b(6089, 3, "Module_name_0_was_successfully_resolved_to_1_6089", "======== Module name '{0}' was successfully resolved to '{1}'. ========"),
- Module_name_0_was_not_resolved: b(6090, 3, "Module_name_0_was_not_resolved_6090", "======== Module name '{0}' was not resolved. ========"),
- paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: b(6091, 3, "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091", "'paths' option is specified, looking for a pattern to match module name '{0}'."),
- Module_name_0_matched_pattern_1: b(6092, 3, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."),
- Trying_substitution_0_candidate_module_location_Colon_1: b(6093, 3, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."),
- Resolving_module_name_0_relative_to_base_url_1_2: b(6094, 3, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
- Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: b(6095, 3, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
- File_0_does_not_exist: b(6096, 3, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
- File_0_exists_use_it_as_a_name_resolution_result: b(6097, 3, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
- Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: b(6098, 3, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
- Found_package_json_at_0: b(6099, 3, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
- package_json_does_not_have_a_0_field: b(6100, 3, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
- package_json_has_0_field_1_that_references_2: b(6101, 3, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."),
- Allow_javascript_files_to_be_compiled: b(6102, 3, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."),
- Checking_if_0_is_the_longest_matching_prefix_for_1_2: b(6104, 3, "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),
- Expected_type_of_0_field_in_package_json_to_be_1_got_2: b(6105, 3, "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105", "Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),
- baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: b(6106, 3, "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),
- rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: b(6107, 3, "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", "'rootDirs' option is set, using it to resolve relative module name '{0}'."),
- Longest_matching_prefix_for_0_is_1: b(6108, 3, "Longest_matching_prefix_for_0_is_1_6108", "Longest matching prefix for '{0}' is '{1}'."),
- Loading_0_from_the_root_dir_1_candidate_location_2: b(6109, 3, "Loading_0_from_the_root_dir_1_candidate_location_2_6109", "Loading '{0}' from the root dir '{1}', candidate location '{2}'."),
- Trying_other_entries_in_rootDirs: b(6110, 3, "Trying_other_entries_in_rootDirs_6110", "Trying other entries in 'rootDirs'."),
- Module_resolution_using_rootDirs_has_failed: b(6111, 3, "Module_resolution_using_rootDirs_has_failed_6111", "Module resolution using 'rootDirs' has failed."),
- Do_not_emit_use_strict_directives_in_module_output: b(6112, 3, "Do_not_emit_use_strict_directives_in_module_output_6112", "Do not emit 'use strict' directives in module output."),
- Enable_strict_null_checks: b(6113, 3, "Enable_strict_null_checks_6113", "Enable strict null checks."),
- Unknown_option_excludes_Did_you_mean_exclude: b(6114, 1, "Unknown_option_excludes_Did_you_mean_exclude_6114", "Unknown option 'excludes'. Did you mean 'exclude'?"),
- Raise_error_on_this_expressions_with_an_implied_any_type: b(6115, 3, "Raise_error_on_this_expressions_with_an_implied_any_type_6115", "Raise error on 'this' expressions with an implied 'any' type."),
- Resolving_type_reference_directive_0_containing_file_1_root_directory_2: b(6116, 3, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),
- Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: b(6119, 3, "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),
- Type_reference_directive_0_was_not_resolved: b(6120, 3, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"),
- Resolving_with_primary_search_path_0: b(6121, 3, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."),
- Root_directory_cannot_be_determined_skipping_primary_search_paths: b(6122, 3, "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", "Root directory cannot be determined, skipping primary search paths."),
- Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: b(6123, 3, "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),
- Type_declaration_files_to_be_included_in_compilation: b(6124, 3, "Type_declaration_files_to_be_included_in_compilation_6124", "Type declaration files to be included in compilation."),
- Looking_up_in_node_modules_folder_initial_location_0: b(6125, 3, "Looking_up_in_node_modules_folder_initial_location_0_6125", "Looking up in 'node_modules' folder, initial location '{0}'."),
- Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: b(6126, 3, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),
- Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: b(6127, 3, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),
- Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: b(6128, 3, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),
- Resolving_real_path_for_0_result_1: b(6130, 3, "Resolving_real_path_for_0_result_1_6130", "Resolving real path for '{0}', result '{1}'."),
- Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: b(6131, 1, "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),
- File_name_0_has_a_1_extension_stripping_it: b(6132, 3, "File_name_0_has_a_1_extension_stripping_it_6132", "File name '{0}' has a '{1}' extension - stripping it."),
- _0_is_declared_but_its_value_is_never_read: b(
- 6133,
- 1,
- "_0_is_declared_but_its_value_is_never_read_6133",
- "'{0}' is declared but its value is never read.",
- /*reportsUnnecessary*/
- !0
- ),
- Report_errors_on_unused_locals: b(6134, 3, "Report_errors_on_unused_locals_6134", "Report errors on unused locals."),
- Report_errors_on_unused_parameters: b(6135, 3, "Report_errors_on_unused_parameters_6135", "Report errors on unused parameters."),
- The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: b(6136, 3, "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", "The maximum dependency depth to search under node_modules and load JavaScript files."),
- Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: b(6137, 1, "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137", "Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),
- Property_0_is_declared_but_its_value_is_never_read: b(
- 6138,
- 1,
- "Property_0_is_declared_but_its_value_is_never_read_6138",
- "Property '{0}' is declared but its value is never read.",
- /*reportsUnnecessary*/
- !0
- ),
- Import_emit_helpers_from_tslib: b(6139, 3, "Import_emit_helpers_from_tslib_6139", "Import emit helpers from 'tslib'."),
- Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: b(6140, 1, "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),
- Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: b(6141, 3, "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", 'Parse in strict mode and emit "use strict" for each source file.'),
- Module_0_was_resolved_to_1_but_jsx_is_not_set: b(6142, 1, "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", "Module '{0}' was resolved to '{1}', but '--jsx' is not set."),
- Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: b(6144, 3, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."),
- Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: b(6146, 3, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),
- Resolution_for_module_0_was_found_in_cache_from_location_1: b(6147, 3, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."),
- Directory_0_does_not_exist_skipping_all_lookups_in_it: b(6148, 3, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."),
- Show_diagnostic_information: b(6149, 3, "Show_diagnostic_information_6149", "Show diagnostic information."),
- Show_verbose_diagnostic_information: b(6150, 3, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."),
- Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: b(6151, 3, "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", "Emit a single file with source maps instead of having a separate file."),
- Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: b(6152, 3, "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),
- Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: b(6153, 3, "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", "Transpile each file as a separate module (similar to 'ts.transpileModule')."),
- Print_names_of_generated_files_part_of_the_compilation: b(6154, 3, "Print_names_of_generated_files_part_of_the_compilation_6154", "Print names of generated files part of the compilation."),
- Print_names_of_files_part_of_the_compilation: b(6155, 3, "Print_names_of_files_part_of_the_compilation_6155", "Print names of files part of the compilation."),
- The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: b(6156, 3, "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", "The locale used when displaying messages to the user (e.g. 'en-us')"),
- Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: b(6157, 3, "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", "Do not generate custom helper functions like '__extends' in compiled output."),
- Do_not_include_the_default_library_file_lib_d_ts: b(6158, 3, "Do_not_include_the_default_library_file_lib_d_ts_6158", "Do not include the default library file (lib.d.ts)."),
- Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: b(6159, 3, "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", "Do not add triple-slash references or imported modules to the list of compiled files."),
- Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: b(6160, 3, "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),
- List_of_folders_to_include_type_definitions_from: b(6161, 3, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."),
- Disable_size_limitations_on_JavaScript_projects: b(6162, 3, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."),
- The_character_set_of_the_input_files: b(6163, 3, "The_character_set_of_the_input_files_6163", "The character set of the input files."),
- Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1: b(6164, 3, "Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164", "Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),
- Do_not_truncate_error_messages: b(6165, 3, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."),
- Output_directory_for_generated_declaration_files: b(6166, 3, "Output_directory_for_generated_declaration_files_6166", "Output directory for generated declaration files."),
- A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: b(6167, 3, "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),
- List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: b(6168, 3, "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", "List of root folders whose combined content represents the structure of the project at runtime."),
- Show_all_compiler_options: b(6169, 3, "Show_all_compiler_options_6169", "Show all compiler options."),
- Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: b(6170, 3, "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),
- Command_line_Options: b(6171, 3, "Command_line_Options_6171", "Command-line Options"),
- Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5: b(6179, 3, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."),
- Enable_all_strict_type_checking_options: b(6180, 3, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."),
- Scoped_package_detected_looking_in_0: b(6182, 3, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"),
- Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: b(6183, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),
- Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: b(6184, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),
- Enable_strict_checking_of_function_types: b(6186, 3, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."),
- Enable_strict_checking_of_property_initialization_in_classes: b(6187, 3, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."),
- Numeric_separators_are_not_allowed_here: b(6188, 1, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."),
- Multiple_consecutive_numeric_separators_are_not_permitted: b(6189, 1, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."),
- Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: b(6191, 3, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."),
- All_imports_in_import_declaration_are_unused: b(
- 6192,
- 1,
- "All_imports_in_import_declaration_are_unused_6192",
- "All imports in import declaration are unused.",
- /*reportsUnnecessary*/
- !0
- ),
- Found_1_error_Watching_for_file_changes: b(6193, 3, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."),
- Found_0_errors_Watching_for_file_changes: b(6194, 3, "Found_0_errors_Watching_for_file_changes_6194", "Found {0} errors. Watching for file changes."),
- Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: b(6195, 3, "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195", "Resolve 'keyof' to string valued property names only (no numbers or symbols)."),
- _0_is_declared_but_never_used: b(
- 6196,
- 1,
- "_0_is_declared_but_never_used_6196",
- "'{0}' is declared but never used.",
- /*reportsUnnecessary*/
- !0
- ),
- Include_modules_imported_with_json_extension: b(6197, 3, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"),
- All_destructured_elements_are_unused: b(
- 6198,
- 1,
- "All_destructured_elements_are_unused_6198",
- "All destructured elements are unused.",
- /*reportsUnnecessary*/
- !0
- ),
- All_variables_are_unused: b(
- 6199,
- 1,
- "All_variables_are_unused_6199",
- "All variables are unused.",
- /*reportsUnnecessary*/
- !0
- ),
- Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: b(6200, 1, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"),
- Conflicts_are_in_this_file: b(6201, 3, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
- Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: b(6202, 1, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
- _0_was_also_declared_here: b(6203, 3, "_0_was_also_declared_here_6203", "'{0}' was also declared here."),
- and_here: b(6204, 3, "and_here_6204", "and here."),
- All_type_parameters_are_unused: b(6205, 1, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
- package_json_has_a_typesVersions_field_with_version_specific_path_mappings: b(6206, 3, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."),
- package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: b(6207, 3, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),
- package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: b(6208, 3, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),
- package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: b(6209, 3, "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209", "'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),
- An_argument_for_0_was_not_provided: b(6210, 3, "An_argument_for_0_was_not_provided_6210", "An argument for '{0}' was not provided."),
- An_argument_matching_this_binding_pattern_was_not_provided: b(6211, 3, "An_argument_matching_this_binding_pattern_was_not_provided_6211", "An argument matching this binding pattern was not provided."),
- Did_you_mean_to_call_this_expression: b(6212, 3, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"),
- Did_you_mean_to_use_new_with_this_expression: b(6213, 3, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"),
- Enable_strict_bind_call_and_apply_methods_on_functions: b(6214, 3, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."),
- Using_compiler_options_of_project_reference_redirect_0: b(6215, 3, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."),
- Found_1_error: b(6216, 3, "Found_1_error_6216", "Found 1 error."),
- Found_0_errors: b(6217, 3, "Found_0_errors_6217", "Found {0} errors."),
- Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: b(6218, 3, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),
- Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: b(6219, 3, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),
- package_json_had_a_falsy_0_field: b(6220, 3, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."),
- Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: b(6221, 3, "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221", "Disable use of source files instead of declaration files from referenced projects."),
- Emit_class_fields_with_Define_instead_of_Set: b(6222, 3, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."),
- Generates_a_CPU_profile: b(6223, 3, "Generates_a_CPU_profile_6223", "Generates a CPU profile."),
- Disable_solution_searching_for_this_project: b(6224, 3, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."),
- Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: b(6225, 3, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),
- Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling: b(6226, 3, "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226", "Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),
- Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize: b(6227, 3, "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227", "Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),
- Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: b(6229, 1, "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229", "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),
- Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: b(6230, 1, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),
- Could_not_resolve_the_path_0_with_the_extensions_Colon_1: b(6231, 1, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."),
- Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: b(6232, 1, "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232", "Declaration augments declaration in another file. This cannot be serialized."),
- This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: b(6233, 1, "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233", "This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),
- This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: b(6234, 1, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),
- Disable_loading_referenced_projects: b(6235, 3, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."),
- Arguments_for_the_rest_parameter_0_were_not_provided: b(6236, 1, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."),
- Generates_an_event_trace_and_a_list_of_types: b(6237, 3, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."),
- Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: b(6238, 1, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),
- File_0_exists_according_to_earlier_cached_lookups: b(6239, 3, "File_0_exists_according_to_earlier_cached_lookups_6239", "File '{0}' exists according to earlier cached lookups."),
- File_0_does_not_exist_according_to_earlier_cached_lookups: b(6240, 3, "File_0_does_not_exist_according_to_earlier_cached_lookups_6240", "File '{0}' does not exist according to earlier cached lookups."),
- Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1: b(6241, 3, "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241", "Resolution for type reference directive '{0}' was found in cache from location '{1}'."),
- Resolving_type_reference_directive_0_containing_file_1: b(6242, 3, "Resolving_type_reference_directive_0_containing_file_1_6242", "======== Resolving type reference directive '{0}', containing file '{1}'. ========"),
- Interpret_optional_property_types_as_written_rather_than_adding_undefined: b(6243, 3, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."),
- Modules: b(6244, 3, "Modules_6244", "Modules"),
- File_Management: b(6245, 3, "File_Management_6245", "File Management"),
- Emit: b(6246, 3, "Emit_6246", "Emit"),
- JavaScript_Support: b(6247, 3, "JavaScript_Support_6247", "JavaScript Support"),
- Type_Checking: b(6248, 3, "Type_Checking_6248", "Type Checking"),
- Editor_Support: b(6249, 3, "Editor_Support_6249", "Editor Support"),
- Watch_and_Build_Modes: b(6250, 3, "Watch_and_Build_Modes_6250", "Watch and Build Modes"),
- Compiler_Diagnostics: b(6251, 3, "Compiler_Diagnostics_6251", "Compiler Diagnostics"),
- Interop_Constraints: b(6252, 3, "Interop_Constraints_6252", "Interop Constraints"),
- Backwards_Compatibility: b(6253, 3, "Backwards_Compatibility_6253", "Backwards Compatibility"),
- Language_and_Environment: b(6254, 3, "Language_and_Environment_6254", "Language and Environment"),
- Projects: b(6255, 3, "Projects_6255", "Projects"),
- Output_Formatting: b(6256, 3, "Output_Formatting_6256", "Output Formatting"),
- Completeness: b(6257, 3, "Completeness_6257", "Completeness"),
- _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: b(6258, 1, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
- Found_1_error_in_0: b(6259, 3, "Found_1_error_in_0_6259", "Found 1 error in {0}"),
- Found_0_errors_in_the_same_file_starting_at_Colon_1: b(6260, 3, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
- Found_0_errors_in_1_files: b(6261, 3, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
- File_name_0_has_a_1_extension_looking_up_2_instead: b(6262, 3, "File_name_0_has_a_1_extension_looking_up_2_instead_6262", "File name '{0}' has a '{1}' extension - looking up '{2}' instead."),
- Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set: b(6263, 1, "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263", "Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),
- Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present: b(6264, 3, "Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264", "Enable importing files with any extension, provided a declaration file is present."),
- Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder: b(6265, 3, "Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265", "Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),
- Option_0_can_only_be_specified_on_command_line: b(6266, 1, "Option_0_can_only_be_specified_on_command_line_6266", "Option '{0}' can only be specified on command line."),
- Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: b(6270, 3, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
- Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: b(6271, 3, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
- Invalid_import_specifier_0_has_no_possible_resolutions: b(6272, 3, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
- package_json_scope_0_has_no_imports_defined: b(6273, 3, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."),
- package_json_scope_0_explicitly_maps_specifier_1_to_null: b(6274, 3, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."),
- package_json_scope_0_has_invalid_type_for_target_of_specifier_1: b(6275, 3, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"),
- Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: b(6276, 3, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
- Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: b(6277, 3, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
- There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: b(6278, 3, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
- Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: b(6279, 3, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
- There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: b(6280, 3, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
- package_json_has_a_peerDependencies_field: b(6281, 3, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."),
- Found_peerDependency_0_with_1_version: b(6282, 3, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."),
- Failed_to_find_peerDependency_0: b(6283, 3, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."),
- Enable_project_compilation: b(6302, 3, "Enable_project_compilation_6302", "Enable project compilation"),
- Composite_projects_may_not_disable_declaration_emit: b(6304, 1, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
- Output_file_0_has_not_been_built_from_source_file_1: b(6305, 1, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
- Referenced_project_0_must_have_setting_composite_Colon_true: b(6306, 1, "Referenced_project_0_must_have_setting_composite_Colon_true_6306", `Referenced project '{0}' must have setting "composite": true.`),
- File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: b(6307, 1, "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307", "File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),
- Referenced_project_0_may_not_disable_emit: b(6310, 1, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."),
- Project_0_is_out_of_date_because_output_1_is_older_than_input_2: b(6350, 3, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"),
- Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: b(6351, 3, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),
- Project_0_is_out_of_date_because_output_file_1_does_not_exist: b(6352, 3, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"),
- Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: b(6353, 3, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"),
- Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: b(6354, 3, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"),
- Projects_in_this_build_Colon_0: b(6355, 3, "Projects_in_this_build_Colon_0_6355", "Projects in this build: {0}"),
- A_non_dry_build_would_delete_the_following_files_Colon_0: b(6356, 3, "A_non_dry_build_would_delete_the_following_files_Colon_0_6356", "A non-dry build would delete the following files: {0}"),
- A_non_dry_build_would_build_project_0: b(6357, 3, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"),
- Building_project_0: b(6358, 3, "Building_project_0_6358", "Building project '{0}'..."),
- Updating_output_timestamps_of_project_0: b(6359, 3, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."),
- Project_0_is_up_to_date: b(6361, 3, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"),
- Skipping_build_of_project_0_because_its_dependency_1_has_errors: b(6362, 3, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"),
- Project_0_can_t_be_built_because_its_dependency_1_has_errors: b(6363, 3, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"),
- Build_one_or_more_projects_and_their_dependencies_if_out_of_date: b(6364, 3, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"),
- Delete_the_outputs_of_all_projects: b(6365, 3, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
- Show_what_would_be_built_or_deleted_if_specified_with_clean: b(6367, 3, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
- Option_build_must_be_the_first_command_line_argument: b(6369, 1, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."),
- Options_0_and_1_cannot_be_combined: b(6370, 1, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."),
- Updating_unchanged_output_timestamps_of_project_0: b(6371, 3, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."),
- A_non_dry_build_would_update_timestamps_for_output_of_project_0: b(6374, 3, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"),
- Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: b(6377, 1, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),
- Composite_projects_may_not_disable_incremental_compilation: b(6379, 1, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
- Specify_file_to_store_incremental_compilation_information: b(6380, 3, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
- Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: b(6381, 3, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
- Skipping_build_of_project_0_because_its_dependency_1_was_not_built: b(6382, 3, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"),
- Project_0_can_t_be_built_because_its_dependency_1_was_not_built: b(6383, 3, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"),
- Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: b(6384, 3, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),
- _0_is_deprecated: b(
- 6385,
- 2,
- "_0_is_deprecated_6385",
- "'{0}' is deprecated.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- void 0,
- /*reportsDeprecated*/
- !0
- ),
- Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: b(6386, 3, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),
- The_signature_0_of_1_is_deprecated: b(
- 6387,
- 2,
- "The_signature_0_of_1_is_deprecated_6387",
- "The signature '{0}' of '{1}' is deprecated.",
- /*reportsUnnecessary*/
- void 0,
- /*elidedInCompatabilityPyramid*/
- void 0,
- /*reportsDeprecated*/
- !0
- ),
- Project_0_is_being_forcibly_rebuilt: b(6388, 3, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"),
- Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: b(6389, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),
- Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2: b(6390, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),
- Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: b(6391, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),
- Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved: b(6392, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),
- Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: b(6393, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),
- Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: b(6394, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),
- Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: b(6395, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),
- Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: b(6396, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),
- Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: b(6397, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),
- Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: b(6398, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: b(6399, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),
- Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: b(6400, 3, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),
- Project_0_is_out_of_date_because_there_was_error_reading_file_1: b(6401, 3, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"),
- Resolving_in_0_mode_with_conditions_1: b(6402, 3, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."),
- Matched_0_condition_1: b(6403, 3, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."),
- Using_0_subpath_1_with_target_2: b(6404, 3, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."),
- Saw_non_matching_condition_0: b(6405, 3, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."),
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions: b(6406, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406", "Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),
- Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set: b(6407, 3, "Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407", "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),
- Use_the_package_json_exports_field_when_resolving_package_imports: b(6408, 3, "Use_the_package_json_exports_field_when_resolving_package_imports_6408", "Use the package.json 'exports' field when resolving package imports."),
- Use_the_package_json_imports_field_when_resolving_imports: b(6409, 3, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."),
- Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: b(6410, 3, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."),
- true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: b(6411, 3, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: b(6412, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),
- Entering_conditional_exports: b(6413, 3, "Entering_conditional_exports_6413", "Entering conditional exports."),
- Resolved_under_condition_0: b(6414, 3, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."),
- Failed_to_resolve_under_condition_0: b(6415, 3, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."),
- Exiting_conditional_exports: b(6416, 3, "Exiting_conditional_exports_6416", "Exiting conditional exports."),
- Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: b(6417, 3, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."),
- Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: b(6418, 3, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
- Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: b(6419, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
- Project_0_is_out_of_date_because_1: b(6420, 3, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
- The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: b(6500, 3, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
- The_expected_type_comes_from_this_index_signature: b(6501, 3, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
- The_expected_type_comes_from_the_return_type_of_this_signature: b(6502, 3, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
- Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: b(6503, 3, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."),
- File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: b(6504, 1, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),
- Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: b(6505, 3, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."),
- Consider_adding_a_declare_modifier_to_this_class: b(6506, 3, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."),
- Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: b(6600, 3, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),
- Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: b(6601, 3, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."),
- Allow_accessing_UMD_globals_from_modules: b(6602, 3, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
- Disable_error_reporting_for_unreachable_code: b(6603, 3, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
- Disable_error_reporting_for_unused_labels: b(6604, 3, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."),
- Ensure_use_strict_is_always_emitted: b(6605, 3, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."),
- Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: b(6606, 3, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),
- Specify_the_base_directory_to_resolve_non_relative_module_names: b(6607, 3, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."),
- No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: b(6608, 3, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."),
- Enable_error_reporting_in_type_checked_JavaScript_files: b(6609, 3, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."),
- Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references: b(6611, 3, "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611", "Enable constraints that allow a TypeScript project to be used with project references."),
- Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project: b(6612, 3, "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612", "Generate .d.ts files from TypeScript and JavaScript files in your project."),
- Specify_the_output_directory_for_generated_declaration_files: b(6613, 3, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."),
- Create_sourcemaps_for_d_ts_files: b(6614, 3, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."),
- Output_compiler_performance_information_after_building: b(6615, 3, "Output_compiler_performance_information_after_building_6615", "Output compiler performance information after building."),
- Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project: b(6616, 3, "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616", "Disables inference for type acquisition by looking at filenames in a project."),
- Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: b(6617, 3, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."),
- Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: b(6618, 3, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),
- Opt_a_project_out_of_multi_project_reference_checking_when_editing: b(6619, 3, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."),
- Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: b(6620, 3, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."),
- Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: b(6621, 3, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."),
- Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: b(6622, 3, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),
- Only_output_d_ts_files_and_not_JavaScript_files: b(6623, 3, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."),
- Emit_design_type_metadata_for_decorated_declarations_in_source_files: b(6624, 3, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."),
- Disable_the_type_acquisition_for_JavaScript_projects: b(6625, 3, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"),
- Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: b(6626, 3, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),
- Filters_results_from_the_include_option: b(6627, 3, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."),
- Remove_a_list_of_directories_from_the_watch_process: b(6628, 3, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."),
- Remove_a_list_of_files_from_the_watch_mode_s_processing: b(6629, 3, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."),
- Enable_experimental_support_for_legacy_experimental_decorators: b(6630, 3, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."),
- Print_files_read_during_the_compilation_including_why_it_was_included: b(6631, 3, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."),
- Output_more_detailed_compiler_performance_information_after_building: b(6632, 3, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."),
- Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: b(6633, 3, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."),
- Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: b(6634, 3, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."),
- Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: b(6635, 3, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."),
- Build_all_projects_including_those_that_appear_to_be_up_to_date: b(6636, 3, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."),
- Ensure_that_casing_is_correct_in_imports: b(6637, 3, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."),
- Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: b(6638, 3, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."),
- Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: b(6639, 3, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."),
- Skip_building_downstream_projects_on_error_in_upstream_project: b(6640, 3, "Skip_building_downstream_projects_on_error_in_upstream_project_6640", "Skip building downstream projects on error in upstream project."),
- Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: b(6641, 3, "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641", "Specify a list of glob patterns that match files to be included in compilation."),
- Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects: b(6642, 3, "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642", "Save .tsbuildinfo files to allow for incremental compilation of projects."),
- Include_sourcemap_files_inside_the_emitted_JavaScript: b(6643, 3, "Include_sourcemap_files_inside_the_emitted_JavaScript_6643", "Include sourcemap files inside the emitted JavaScript."),
- Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: b(6644, 3, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."),
- Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: b(6645, 3, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."),
- Specify_what_JSX_code_is_generated: b(6646, 3, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."),
- Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: b(6647, 3, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),
- Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: b(6648, 3, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),
- Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: b(6649, 3, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),
- Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: b(6650, 3, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."),
- Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: b(6651, 3, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."),
- Print_the_names_of_emitted_files_after_a_compilation: b(6652, 3, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."),
- Print_all_of_the_files_read_during_the_compilation: b(6653, 3, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."),
- Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: b(6654, 3, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."),
- Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: b(6655, 3, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."),
- Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: b(6656, 3, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),
- Specify_what_module_code_is_generated: b(6657, 3, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."),
- Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: b(6658, 3, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."),
- Set_the_newline_character_for_emitting_files: b(6659, 3, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."),
- Disable_emitting_files_from_a_compilation: b(6660, 3, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."),
- Disable_generating_custom_helper_functions_like_extends_in_compiled_output: b(6661, 3, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."),
- Disable_emitting_files_if_any_type_checking_errors_are_reported: b(6662, 3, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."),
- Disable_truncating_types_in_error_messages: b(6663, 3, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."),
- Enable_error_reporting_for_fallthrough_cases_in_switch_statements: b(6664, 3, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."),
- Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: b(6665, 3, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."),
- Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: b(6666, 3, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."),
- Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: b(6667, 3, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."),
- Enable_error_reporting_when_this_is_given_the_type_any: b(6668, 3, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."),
- Disable_adding_use_strict_directives_in_emitted_JavaScript_files: b(6669, 3, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."),
- Disable_including_any_library_files_including_the_default_lib_d_ts: b(6670, 3, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."),
- Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: b(6671, 3, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."),
- Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: b(6672, 3, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),
- Disable_strict_checking_of_generic_signatures_in_function_types: b(6673, 3, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."),
- Add_undefined_to_a_type_when_accessed_using_an_index: b(6674, 3, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."),
- Enable_error_reporting_when_local_variables_aren_t_read: b(6675, 3, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."),
- Raise_an_error_when_a_function_parameter_isn_t_read: b(6676, 3, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."),
- Deprecated_setting_Use_outFile_instead: b(6677, 3, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."),
- Specify_an_output_folder_for_all_emitted_files: b(6678, 3, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."),
- Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: b(6679, 3, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),
- Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: b(6680, 3, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."),
- Specify_a_list_of_language_service_plugins_to_include: b(6681, 3, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."),
- Disable_erasing_const_enum_declarations_in_generated_code: b(6682, 3, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."),
- Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: b(6683, 3, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."),
- Disable_wiping_the_console_in_watch_mode: b(6684, 3, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."),
- Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: b(6685, 3, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."),
- Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: b(6686, 3, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),
- Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: b(6687, 3, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."),
- Disable_emitting_comments: b(6688, 3, "Disable_emitting_comments_6688", "Disable emitting comments."),
- Enable_importing_json_files: b(6689, 3, "Enable_importing_json_files_6689", "Enable importing .json files."),
- Specify_the_root_folder_within_your_source_files: b(6690, 3, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."),
- Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: b(6691, 3, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."),
- Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: b(6692, 3, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."),
- Skip_type_checking_all_d_ts_files: b(6693, 3, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."),
- Create_source_map_files_for_emitted_JavaScript_files: b(6694, 3, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."),
- Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: b(6695, 3, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."),
- Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: b(6697, 3, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),
- When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: b(6698, 3, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."),
- When_type_checking_take_into_account_null_and_undefined: b(6699, 3, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."),
- Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: b(6700, 3, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."),
- Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: b(6701, 3, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."),
- Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: b(6702, 3, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."),
- Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: b(6703, 3, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),
- Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: b(6704, 3, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),
- Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: b(6705, 3, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),
- Log_paths_used_during_the_moduleResolution_process: b(6706, 3, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."),
- Specify_the_path_to_tsbuildinfo_incremental_compilation_file: b(6707, 3, "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707", "Specify the path to .tsbuildinfo incremental compilation file."),
- Specify_options_for_automatic_acquisition_of_declaration_files: b(6709, 3, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."),
- Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: b(6710, 3, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."),
- Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: b(6711, 3, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."),
- Emit_ECMAScript_standard_compliant_class_fields: b(6712, 3, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."),
- Enable_verbose_logging: b(6713, 3, "Enable_verbose_logging_6713", "Enable verbose logging."),
- Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: b(6714, 3, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."),
- Specify_how_the_TypeScript_watch_mode_works: b(6715, 3, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."),
- Require_undeclared_properties_from_index_signatures_to_use_element_accesses: b(6717, 3, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
- Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: b(6718, 3, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
- Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: b(6719, 3, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
- Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: b(6720, 3, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
- Default_catch_clause_variables_as_unknown_instead_of_any: b(6803, 3, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
- Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: b(6804, 3, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
- Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: b(6805, 3, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
- Check_side_effect_imports: b(6806, 3, "Check_side_effect_imports_6806", "Check side effect imports."),
- This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: b(6807, 1, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
- one_of_Colon: b(6900, 3, "one_of_Colon_6900", "one of:"),
- one_or_more_Colon: b(6901, 3, "one_or_more_Colon_6901", "one or more:"),
- type_Colon: b(6902, 3, "type_Colon_6902", "type:"),
- default_Colon: b(6903, 3, "default_Colon_6903", "default:"),
- module_system_or_esModuleInterop: b(6904, 3, "module_system_or_esModuleInterop_6904", 'module === "system" or esModuleInterop'),
- false_unless_strict_is_set: b(6905, 3, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"),
- false_unless_composite_is_set: b(6906, 3, "false_unless_composite_is_set_6906", "`false`, unless `composite` is set"),
- node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified: b(6907, 3, "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907", '`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),
- if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk: b(6908, 3, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", '`[]` if `files` is specified, otherwise `["**/*"]`'),
- true_if_composite_false_otherwise: b(6909, 3, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"),
- module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: b(69010, 3, "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010", "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),
- Computed_from_the_list_of_input_files: b(6911, 3, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"),
- Platform_specific: b(6912, 3, "Platform_specific_6912", "Platform specific"),
- You_can_learn_about_all_of_the_compiler_options_at_0: b(6913, 3, "You_can_learn_about_all_of_the_compiler_options_at_0_6913", "You can learn about all of the compiler options at {0}"),
- Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon: b(6914, 3, "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914", "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),
- Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0: b(6915, 3, "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915", "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),
- COMMON_COMMANDS: b(6916, 3, "COMMON_COMMANDS_6916", "COMMON COMMANDS"),
- ALL_COMPILER_OPTIONS: b(6917, 3, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"),
- WATCH_OPTIONS: b(6918, 3, "WATCH_OPTIONS_6918", "WATCH OPTIONS"),
- BUILD_OPTIONS: b(6919, 3, "BUILD_OPTIONS_6919", "BUILD OPTIONS"),
- COMMON_COMPILER_OPTIONS: b(6920, 3, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"),
- COMMAND_LINE_FLAGS: b(6921, 3, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"),
- tsc_Colon_The_TypeScript_Compiler: b(6922, 3, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"),
- Compiles_the_current_project_tsconfig_json_in_the_working_directory: b(6923, 3, "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923", "Compiles the current project (tsconfig.json in the working directory.)"),
- Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options: b(6924, 3, "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924", "Ignoring tsconfig.json, compiles the specified files with default compiler options."),
- Build_a_composite_project_in_the_working_directory: b(6925, 3, "Build_a_composite_project_in_the_working_directory_6925", "Build a composite project in the working directory."),
- Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory: b(6926, 3, "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926", "Creates a tsconfig.json with the recommended settings in the working directory."),
- Compiles_the_TypeScript_project_located_at_the_specified_path: b(6927, 3, "Compiles_the_TypeScript_project_located_at_the_specified_path_6927", "Compiles the TypeScript project located at the specified path."),
- An_expanded_version_of_this_information_showing_all_possible_compiler_options: b(6928, 3, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"),
- Compiles_the_current_project_with_additional_settings: b(6929, 3, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
- true_for_ES2022_and_above_including_ESNext: b(6930, 3, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
- List_of_file_name_suffixes_to_search_when_resolving_a_module: b(6931, 1, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."),
- Variable_0_implicitly_has_an_1_type: b(7005, 1, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
- Parameter_0_implicitly_has_an_1_type: b(7006, 1, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
- Member_0_implicitly_has_an_1_type: b(7008, 1, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
- new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: b(7009, 1, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
- _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: b(7010, 1, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
- Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: b(7011, 1, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
- This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: b(7012, 1, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
- Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: b(7013, 1, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
- Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: b(7014, 1, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
- Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: b(7015, 1, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
- Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: b(7016, 1, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),
- Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: b(7017, 1, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."),
- Object_literal_s_property_0_implicitly_has_an_1_type: b(7018, 1, "Object_literal_s_property_0_implicitly_has_an_1_type_7018", "Object literal's property '{0}' implicitly has an '{1}' type."),
- Rest_parameter_0_implicitly_has_an_any_type: b(7019, 1, "Rest_parameter_0_implicitly_has_an_any_type_7019", "Rest parameter '{0}' implicitly has an 'any[]' type."),
- Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: b(7020, 1, "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020", "Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),
- _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: b(7022, 1, "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022", "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),
- _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: b(7023, 1, "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),
- Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: b(7024, 1, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),
- Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation: b(7025, 1, "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025", "Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),
- JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: b(7026, 1, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),
- Unreachable_code_detected: b(
- 7027,
- 1,
- "Unreachable_code_detected_7027",
- "Unreachable code detected.",
- /*reportsUnnecessary*/
- !0
- ),
- Unused_label: b(
- 7028,
- 1,
- "Unused_label_7028",
- "Unused label.",
- /*reportsUnnecessary*/
- !0
- ),
- Fallthrough_case_in_switch: b(7029, 1, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."),
- Not_all_code_paths_return_a_value: b(7030, 1, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."),
- Binding_element_0_implicitly_has_an_1_type: b(7031, 1, "Binding_element_0_implicitly_has_an_1_type_7031", "Binding element '{0}' implicitly has an '{1}' type."),
- Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: b(7032, 1, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),
- Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: b(7033, 1, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),
- Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: b(7034, 1, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),
- Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: b(7035, 1, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),
- Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: b(7036, 1, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."),
- Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: b(7037, 3, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),
- Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: b(7038, 3, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),
- Mapped_object_type_implicitly_has_an_any_template_type: b(7039, 1, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."),
- If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: b(7040, 1, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),
- The_containing_arrow_function_captures_the_global_value_of_this: b(7041, 1, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."),
- Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: b(7042, 1, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),
- Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: b(7043, 2, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
- Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: b(7044, 2, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
- Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: b(7045, 2, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
- Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: b(7046, 2, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),
- Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: b(7047, 2, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),
- Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: b(7048, 2, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),
- Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: b(7049, 2, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),
- _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: b(7050, 2, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),
- Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: b(7051, 1, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"),
- Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: b(7052, 1, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),
- Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: b(7053, 1, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),
- No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: b(7054, 1, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."),
- _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: b(7055, 1, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),
- The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: b(7056, 1, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),
- yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: b(7057, 1, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),
- If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: b(7058, 1, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),
- This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: b(7059, 1, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
- This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: b(7060, 1, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
- A_mapped_type_may_not_declare_properties_or_methods: b(7061, 1, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
- You_cannot_rename_this_element: b(8e3, 1, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
- You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: b(8001, 1, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
- import_can_only_be_used_in_TypeScript_files: b(8002, 1, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
- export_can_only_be_used_in_TypeScript_files: b(8003, 1, "export_can_only_be_used_in_TypeScript_files_8003", "'export =' can only be used in TypeScript files."),
- Type_parameter_declarations_can_only_be_used_in_TypeScript_files: b(8004, 1, "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004", "Type parameter declarations can only be used in TypeScript files."),
- implements_clauses_can_only_be_used_in_TypeScript_files: b(8005, 1, "implements_clauses_can_only_be_used_in_TypeScript_files_8005", "'implements' clauses can only be used in TypeScript files."),
- _0_declarations_can_only_be_used_in_TypeScript_files: b(8006, 1, "_0_declarations_can_only_be_used_in_TypeScript_files_8006", "'{0}' declarations can only be used in TypeScript files."),
- Type_aliases_can_only_be_used_in_TypeScript_files: b(8008, 1, "Type_aliases_can_only_be_used_in_TypeScript_files_8008", "Type aliases can only be used in TypeScript files."),
- The_0_modifier_can_only_be_used_in_TypeScript_files: b(8009, 1, "The_0_modifier_can_only_be_used_in_TypeScript_files_8009", "The '{0}' modifier can only be used in TypeScript files."),
- Type_annotations_can_only_be_used_in_TypeScript_files: b(8010, 1, "Type_annotations_can_only_be_used_in_TypeScript_files_8010", "Type annotations can only be used in TypeScript files."),
- Type_arguments_can_only_be_used_in_TypeScript_files: b(8011, 1, "Type_arguments_can_only_be_used_in_TypeScript_files_8011", "Type arguments can only be used in TypeScript files."),
- Parameter_modifiers_can_only_be_used_in_TypeScript_files: b(8012, 1, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
- Non_null_assertions_can_only_be_used_in_TypeScript_files: b(8013, 1, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
- Type_assertion_expressions_can_only_be_used_in_TypeScript_files: b(8016, 1, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
- Signature_declarations_can_only_be_used_in_TypeScript_files: b(8017, 1, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
- Report_errors_in_js_files: b(8019, 3, "Report_errors_in_js_files_8019", "Report errors in .js files."),
- JSDoc_types_can_only_be_used_inside_documentation_comments: b(8020, 1, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
- JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: b(8021, 1, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
- JSDoc_0_is_not_attached_to_a_class: b(8022, 1, "JSDoc_0_is_not_attached_to_a_class_8022", "JSDoc '@{0}' is not attached to a class."),
- JSDoc_0_1_does_not_match_the_extends_2_clause: b(8023, 1, "JSDoc_0_1_does_not_match_the_extends_2_clause_8023", "JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),
- JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: b(8024, 1, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),
- Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: b(8025, 1, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one '@augments' or '@extends' tag."),
- Expected_0_type_arguments_provide_these_with_an_extends_tag: b(8026, 1, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."),
- Expected_0_1_type_arguments_provide_these_with_an_extends_tag: b(8027, 1, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."),
- JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: b(8028, 1, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."),
- JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: b(8029, 1, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),
- The_type_of_a_function_declaration_must_match_the_function_s_signature: b(8030, 1, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."),
- You_cannot_rename_a_module_via_a_global_import: b(8031, 1, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."),
- Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: b(8032, 1, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),
- A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: b(8033, 1, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."),
- The_tag_was_first_specified_here: b(8034, 1, "The_tag_was_first_specified_here_8034", "The tag was first specified here."),
- You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: b(8035, 1, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
- You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: b(8036, 1, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
- Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: b(8037, 1, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
- Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: b(8038, 1, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
- A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: b(8039, 1, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
- Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: b(9005, 1, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
- Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: b(9006, 1, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
- Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: b(9007, 1, "Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007", "Function must have an explicit return type annotation with --isolatedDeclarations."),
- Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: b(9008, 1, "Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008", "Method must have an explicit return type annotation with --isolatedDeclarations."),
- At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: b(9009, 1, "At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9009", "At least one accessor must have an explicit return type annotation with --isolatedDeclarations."),
- Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations: b(9010, 1, "Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010", "Variable must have an explicit type annotation with --isolatedDeclarations."),
- Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations: b(9011, 1, "Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011", "Parameter must have an explicit type annotation with --isolatedDeclarations."),
- Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations: b(9012, 1, "Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012", "Property must have an explicit type annotation with --isolatedDeclarations."),
- Expression_type_can_t_be_inferred_with_isolatedDeclarations: b(9013, 1, "Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013", "Expression type can't be inferred with --isolatedDeclarations."),
- Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations: b(9014, 1, "Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014", "Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."),
- Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations: b(9015, 1, "Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015", "Objects that contain spread assignments can't be inferred with --isolatedDeclarations."),
- Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations: b(9016, 1, "Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016", "Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."),
- Only_const_arrays_can_be_inferred_with_isolatedDeclarations: b(9017, 1, "Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017", "Only const arrays can be inferred with --isolatedDeclarations."),
- Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations: b(9018, 1, "Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018", "Arrays with spread elements can't inferred with --isolatedDeclarations."),
- Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations: b(9019, 1, "Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019", "Binding elements can't be exported directly with --isolatedDeclarations."),
- Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations: b(9020, 1, "Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020", "Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."),
- Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations: b(9021, 1, "Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021", "Extends clause can't contain an expression with --isolatedDeclarations."),
- Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations: b(9022, 1, "Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022", "Inference from class expressions is not supported with --isolatedDeclarations."),
- Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function: b(9023, 1, "Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023", "Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."),
- Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations: b(9025, 1, "Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_su_9025", "Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations."),
- Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations: b(9026, 1, "Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026", "Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."),
- Add_a_type_annotation_to_the_variable_0: b(9027, 1, "Add_a_type_annotation_to_the_variable_0_9027", "Add a type annotation to the variable {0}."),
- Add_a_type_annotation_to_the_parameter_0: b(9028, 1, "Add_a_type_annotation_to_the_parameter_0_9028", "Add a type annotation to the parameter {0}."),
- Add_a_type_annotation_to_the_property_0: b(9029, 1, "Add_a_type_annotation_to_the_property_0_9029", "Add a type annotation to the property {0}."),
- Add_a_return_type_to_the_function_expression: b(9030, 1, "Add_a_return_type_to_the_function_expression_9030", "Add a return type to the function expression."),
- Add_a_return_type_to_the_function_declaration: b(9031, 1, "Add_a_return_type_to_the_function_declaration_9031", "Add a return type to the function declaration."),
- Add_a_return_type_to_the_get_accessor_declaration: b(9032, 1, "Add_a_return_type_to_the_get_accessor_declaration_9032", "Add a return type to the get accessor declaration."),
- Add_a_type_to_parameter_of_the_set_accessor_declaration: b(9033, 1, "Add_a_type_to_parameter_of_the_set_accessor_declaration_9033", "Add a type to parameter of the set accessor declaration."),
- Add_a_return_type_to_the_method: b(9034, 1, "Add_a_return_type_to_the_method_9034", "Add a return type to the method"),
- Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit: b(9035, 1, "Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035", "Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),
- Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it: b(9036, 1, "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036", "Move the expression in default export to a variable and add a type annotation to it."),
- Default_exports_can_t_be_inferred_with_isolatedDeclarations: b(9037, 1, "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037", "Default exports can't be inferred with --isolatedDeclarations."),
- Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations: b(9038, 1, "Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038", "Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),
- Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations: b(9039, 1, "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039", "Type containing private name '{0}' can't be used with --isolatedDeclarations."),
- JSX_attributes_must_only_be_assigned_a_non_empty_expression: b(17e3, 1, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
- JSX_elements_cannot_have_multiple_attributes_with_the_same_name: b(17001, 1, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."),
- Expected_corresponding_JSX_closing_tag_for_0: b(17002, 1, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."),
- Cannot_use_JSX_unless_the_jsx_flag_is_provided: b(17004, 1, "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", "Cannot use JSX unless the '--jsx' flag is provided."),
- A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: b(17005, 1, "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", "A constructor cannot contain a 'super' call when its class extends 'null'."),
- An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: b(17006, 1, "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),
- A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: b(17007, 1, "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),
- JSX_element_0_has_no_corresponding_closing_tag: b(17008, 1, "JSX_element_0_has_no_corresponding_closing_tag_17008", "JSX element '{0}' has no corresponding closing tag."),
- super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: b(17009, 1, "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", "'super' must be called before accessing 'this' in the constructor of a derived class."),
- Unknown_type_acquisition_option_0: b(17010, 1, "Unknown_type_acquisition_option_0_17010", "Unknown type acquisition option '{0}'."),
- super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: b(17011, 1, "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", "'super' must be called before accessing a property of 'super' in the constructor of a derived class."),
- _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: b(17012, 1, "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),
- Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: b(17013, 1, "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),
- JSX_fragment_has_no_corresponding_closing_tag: b(17014, 1, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."),
- Expected_corresponding_closing_tag_for_JSX_fragment: b(17015, 1, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."),
- The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: b(17016, 1, "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016", "The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),
- An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: b(17017, 1, "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017", "An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),
- Unknown_type_acquisition_option_0_Did_you_mean_1: b(17018, 1, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"),
- _0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: b(17019, 1, "_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019", "'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),
- _0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: b(17020, 1, "_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020", "'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),
- Unicode_escape_sequence_cannot_appear_here: b(17021, 1, "Unicode_escape_sequence_cannot_appear_here_17021", "Unicode escape sequence cannot appear here."),
- Circularity_detected_while_resolving_configuration_Colon_0: b(18e3, 1, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"),
- The_files_list_in_config_file_0_is_empty: b(18002, 1, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."),
- No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: b(18003, 1, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),
- File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: b(80001, 2, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."),
- This_constructor_function_may_be_converted_to_a_class_declaration: b(80002, 2, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."),
- Import_may_be_converted_to_a_default_import: b(80003, 2, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."),
- JSDoc_types_may_be_moved_to_TypeScript_types: b(80004, 2, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."),
- require_call_may_be_converted_to_an_import: b(80005, 2, "require_call_may_be_converted_to_an_import_80005", "'require' call may be converted to an import."),
- This_may_be_converted_to_an_async_function: b(80006, 2, "This_may_be_converted_to_an_async_function_80006", "This may be converted to an async function."),
- await_has_no_effect_on_the_type_of_this_expression: b(80007, 2, "await_has_no_effect_on_the_type_of_this_expression_80007", "'await' has no effect on the type of this expression."),
- Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: b(80008, 2, "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008", "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),
- JSDoc_typedef_may_be_converted_to_TypeScript_type: b(80009, 2, "JSDoc_typedef_may_be_converted_to_TypeScript_type_80009", "JSDoc typedef may be converted to TypeScript type."),
- JSDoc_typedefs_may_be_converted_to_TypeScript_types: b(80010, 2, "JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010", "JSDoc typedefs may be converted to TypeScript types."),
- Add_missing_super_call: b(90001, 3, "Add_missing_super_call_90001", "Add missing 'super()' call"),
- Make_super_call_the_first_statement_in_the_constructor: b(90002, 3, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"),
- Change_extends_to_implements: b(90003, 3, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"),
- Remove_unused_declaration_for_Colon_0: b(90004, 3, "Remove_unused_declaration_for_Colon_0_90004", "Remove unused declaration for: '{0}'"),
- Remove_import_from_0: b(90005, 3, "Remove_import_from_0_90005", "Remove import from '{0}'"),
- Implement_interface_0: b(90006, 3, "Implement_interface_0_90006", "Implement interface '{0}'"),
- Implement_inherited_abstract_class: b(90007, 3, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"),
- Add_0_to_unresolved_variable: b(90008, 3, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"),
- Remove_variable_statement: b(90010, 3, "Remove_variable_statement_90010", "Remove variable statement"),
- Remove_template_tag: b(90011, 3, "Remove_template_tag_90011", "Remove template tag"),
- Remove_type_parameters: b(90012, 3, "Remove_type_parameters_90012", "Remove type parameters"),
- Import_0_from_1: b(90013, 3, "Import_0_from_1_90013", `Import '{0}' from "{1}"`),
- Change_0_to_1: b(90014, 3, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
- Declare_property_0: b(90016, 3, "Declare_property_0_90016", "Declare property '{0}'"),
- Add_index_signature_for_property_0: b(90017, 3, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"),
- Disable_checking_for_this_file: b(90018, 3, "Disable_checking_for_this_file_90018", "Disable checking for this file"),
- Ignore_this_error_message: b(90019, 3, "Ignore_this_error_message_90019", "Ignore this error message"),
- Initialize_property_0_in_the_constructor: b(90020, 3, "Initialize_property_0_in_the_constructor_90020", "Initialize property '{0}' in the constructor"),
- Initialize_static_property_0: b(90021, 3, "Initialize_static_property_0_90021", "Initialize static property '{0}'"),
- Change_spelling_to_0: b(90022, 3, "Change_spelling_to_0_90022", "Change spelling to '{0}'"),
- Declare_method_0: b(90023, 3, "Declare_method_0_90023", "Declare method '{0}'"),
- Declare_static_method_0: b(90024, 3, "Declare_static_method_0_90024", "Declare static method '{0}'"),
- Prefix_0_with_an_underscore: b(90025, 3, "Prefix_0_with_an_underscore_90025", "Prefix '{0}' with an underscore"),
- Rewrite_as_the_indexed_access_type_0: b(90026, 3, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"),
- Declare_static_property_0: b(90027, 3, "Declare_static_property_0_90027", "Declare static property '{0}'"),
- Call_decorator_expression: b(90028, 3, "Call_decorator_expression_90028", "Call decorator expression"),
- Add_async_modifier_to_containing_function: b(90029, 3, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"),
- Replace_infer_0_with_unknown: b(90030, 3, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"),
- Replace_all_unused_infer_with_unknown: b(90031, 3, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"),
- Add_parameter_name: b(90034, 3, "Add_parameter_name_90034", "Add parameter name"),
- Declare_private_property_0: b(90035, 3, "Declare_private_property_0_90035", "Declare private property '{0}'"),
- Replace_0_with_Promise_1: b(90036, 3, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"),
- Fix_all_incorrect_return_type_of_an_async_functions: b(90037, 3, "Fix_all_incorrect_return_type_of_an_async_functions_90037", "Fix all incorrect return type of an async functions"),
- Declare_private_method_0: b(90038, 3, "Declare_private_method_0_90038", "Declare private method '{0}'"),
- Remove_unused_destructuring_declaration: b(90039, 3, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
- Remove_unused_declarations_for_Colon_0: b(90041, 3, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
- Declare_a_private_field_named_0: b(90053, 3, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
- Includes_imports_of_types_referenced_by_0: b(90054, 3, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
- Remove_type_from_import_declaration_from_0: b(90055, 3, "Remove_type_from_import_declaration_from_0_90055", `Remove 'type' from import declaration from "{0}"`),
- Remove_type_from_import_of_0_from_1: b(90056, 3, "Remove_type_from_import_of_0_from_1_90056", `Remove 'type' from import of '{0}' from "{1}"`),
- Add_import_from_0: b(90057, 3, "Add_import_from_0_90057", 'Add import from "{0}"'),
- Update_import_from_0: b(90058, 3, "Update_import_from_0_90058", 'Update import from "{0}"'),
- Export_0_from_module_1: b(90059, 3, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
- Export_all_referenced_locals: b(90060, 3, "Export_all_referenced_locals_90060", "Export all referenced locals"),
- Update_modifiers_of_0: b(90061, 3, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
- Add_annotation_of_type_0: b(90062, 3, "Add_annotation_of_type_0_90062", "Add annotation of type '{0}'"),
- Add_return_type_0: b(90063, 3, "Add_return_type_0_90063", "Add return type '{0}'"),
- Extract_base_class_to_variable: b(90064, 3, "Extract_base_class_to_variable_90064", "Extract base class to variable"),
- Extract_default_export_to_variable: b(90065, 3, "Extract_default_export_to_variable_90065", "Extract default export to variable"),
- Extract_binding_expressions_to_variable: b(90066, 3, "Extract_binding_expressions_to_variable_90066", "Extract binding expressions to variable"),
- Add_all_missing_type_annotations: b(90067, 3, "Add_all_missing_type_annotations_90067", "Add all missing type annotations"),
- Add_satisfies_and_an_inline_type_assertion_with_0: b(90068, 3, "Add_satisfies_and_an_inline_type_assertion_with_0_90068", "Add satisfies and an inline type assertion with '{0}'"),
- Extract_to_variable_and_replace_with_0_as_typeof_0: b(90069, 3, "Extract_to_variable_and_replace_with_0_as_typeof_0_90069", "Extract to variable and replace with '{0} as typeof {0}'"),
- Mark_array_literal_as_const: b(90070, 3, "Mark_array_literal_as_const_90070", "Mark array literal as const"),
- Annotate_types_of_properties_expando_function_in_a_namespace: b(90071, 3, "Annotate_types_of_properties_expando_function_in_a_namespace_90071", "Annotate types of properties expando function in a namespace"),
- Convert_function_to_an_ES2015_class: b(95001, 3, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
- Convert_0_to_1_in_0: b(95003, 3, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
- Extract_to_0_in_1: b(95004, 3, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
- Extract_function: b(95005, 3, "Extract_function_95005", "Extract function"),
- Extract_constant: b(95006, 3, "Extract_constant_95006", "Extract constant"),
- Extract_to_0_in_enclosing_scope: b(95007, 3, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"),
- Extract_to_0_in_1_scope: b(95008, 3, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"),
- Annotate_with_type_from_JSDoc: b(95009, 3, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"),
- Infer_type_of_0_from_usage: b(95011, 3, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"),
- Infer_parameter_types_from_usage: b(95012, 3, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"),
- Convert_to_default_import: b(95013, 3, "Convert_to_default_import_95013", "Convert to default import"),
- Install_0: b(95014, 3, "Install_0_95014", "Install '{0}'"),
- Replace_import_with_0: b(95015, 3, "Replace_import_with_0_95015", "Replace import with '{0}'."),
- Use_synthetic_default_member: b(95016, 3, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."),
- Convert_to_ES_module: b(95017, 3, "Convert_to_ES_module_95017", "Convert to ES module"),
- Add_undefined_type_to_property_0: b(95018, 3, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"),
- Add_initializer_to_property_0: b(95019, 3, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"),
- Add_definite_assignment_assertion_to_property_0: b(95020, 3, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"),
- Convert_all_type_literals_to_mapped_type: b(95021, 3, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"),
- Add_all_missing_members: b(95022, 3, "Add_all_missing_members_95022", "Add all missing members"),
- Infer_all_types_from_usage: b(95023, 3, "Infer_all_types_from_usage_95023", "Infer all types from usage"),
- Delete_all_unused_declarations: b(95024, 3, "Delete_all_unused_declarations_95024", "Delete all unused declarations"),
- Prefix_all_unused_declarations_with_where_possible: b(95025, 3, "Prefix_all_unused_declarations_with_where_possible_95025", "Prefix all unused declarations with '_' where possible"),
- Fix_all_detected_spelling_errors: b(95026, 3, "Fix_all_detected_spelling_errors_95026", "Fix all detected spelling errors"),
- Add_initializers_to_all_uninitialized_properties: b(95027, 3, "Add_initializers_to_all_uninitialized_properties_95027", "Add initializers to all uninitialized properties"),
- Add_definite_assignment_assertions_to_all_uninitialized_properties: b(95028, 3, "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028", "Add definite assignment assertions to all uninitialized properties"),
- Add_undefined_type_to_all_uninitialized_properties: b(95029, 3, "Add_undefined_type_to_all_uninitialized_properties_95029", "Add undefined type to all uninitialized properties"),
- Change_all_jsdoc_style_types_to_TypeScript: b(95030, 3, "Change_all_jsdoc_style_types_to_TypeScript_95030", "Change all jsdoc-style types to TypeScript"),
- Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: b(95031, 3, "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031", "Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),
- Implement_all_unimplemented_interfaces: b(95032, 3, "Implement_all_unimplemented_interfaces_95032", "Implement all unimplemented interfaces"),
- Install_all_missing_types_packages: b(95033, 3, "Install_all_missing_types_packages_95033", "Install all missing types packages"),
- Rewrite_all_as_indexed_access_types: b(95034, 3, "Rewrite_all_as_indexed_access_types_95034", "Rewrite all as indexed access types"),
- Convert_all_to_default_imports: b(95035, 3, "Convert_all_to_default_imports_95035", "Convert all to default imports"),
- Make_all_super_calls_the_first_statement_in_their_constructor: b(95036, 3, "Make_all_super_calls_the_first_statement_in_their_constructor_95036", "Make all 'super()' calls the first statement in their constructor"),
- Add_qualifier_to_all_unresolved_variables_matching_a_member_name: b(95037, 3, "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037", "Add qualifier to all unresolved variables matching a member name"),
- Change_all_extended_interfaces_to_implements: b(95038, 3, "Change_all_extended_interfaces_to_implements_95038", "Change all extended interfaces to 'implements'"),
- Add_all_missing_super_calls: b(95039, 3, "Add_all_missing_super_calls_95039", "Add all missing super calls"),
- Implement_all_inherited_abstract_classes: b(95040, 3, "Implement_all_inherited_abstract_classes_95040", "Implement all inherited abstract classes"),
- Add_all_missing_async_modifiers: b(95041, 3, "Add_all_missing_async_modifiers_95041", "Add all missing 'async' modifiers"),
- Add_ts_ignore_to_all_error_messages: b(95042, 3, "Add_ts_ignore_to_all_error_messages_95042", "Add '@ts-ignore' to all error messages"),
- Annotate_everything_with_types_from_JSDoc: b(95043, 3, "Annotate_everything_with_types_from_JSDoc_95043", "Annotate everything with types from JSDoc"),
- Add_to_all_uncalled_decorators: b(95044, 3, "Add_to_all_uncalled_decorators_95044", "Add '()' to all uncalled decorators"),
- Convert_all_constructor_functions_to_classes: b(95045, 3, "Convert_all_constructor_functions_to_classes_95045", "Convert all constructor functions to classes"),
- Generate_get_and_set_accessors: b(95046, 3, "Generate_get_and_set_accessors_95046", "Generate 'get' and 'set' accessors"),
- Convert_require_to_import: b(95047, 3, "Convert_require_to_import_95047", "Convert 'require' to 'import'"),
- Convert_all_require_to_import: b(95048, 3, "Convert_all_require_to_import_95048", "Convert all 'require' to 'import'"),
- Move_to_a_new_file: b(95049, 3, "Move_to_a_new_file_95049", "Move to a new file"),
- Remove_unreachable_code: b(95050, 3, "Remove_unreachable_code_95050", "Remove unreachable code"),
- Remove_all_unreachable_code: b(95051, 3, "Remove_all_unreachable_code_95051", "Remove all unreachable code"),
- Add_missing_typeof: b(95052, 3, "Add_missing_typeof_95052", "Add missing 'typeof'"),
- Remove_unused_label: b(95053, 3, "Remove_unused_label_95053", "Remove unused label"),
- Remove_all_unused_labels: b(95054, 3, "Remove_all_unused_labels_95054", "Remove all unused labels"),
- Convert_0_to_mapped_object_type: b(95055, 3, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"),
- Convert_namespace_import_to_named_imports: b(95056, 3, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"),
- Convert_named_imports_to_namespace_import: b(95057, 3, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"),
- Add_or_remove_braces_in_an_arrow_function: b(95058, 3, "Add_or_remove_braces_in_an_arrow_function_95058", "Add or remove braces in an arrow function"),
- Add_braces_to_arrow_function: b(95059, 3, "Add_braces_to_arrow_function_95059", "Add braces to arrow function"),
- Remove_braces_from_arrow_function: b(95060, 3, "Remove_braces_from_arrow_function_95060", "Remove braces from arrow function"),
- Convert_default_export_to_named_export: b(95061, 3, "Convert_default_export_to_named_export_95061", "Convert default export to named export"),
- Convert_named_export_to_default_export: b(95062, 3, "Convert_named_export_to_default_export_95062", "Convert named export to default export"),
- Add_missing_enum_member_0: b(95063, 3, "Add_missing_enum_member_0_95063", "Add missing enum member '{0}'"),
- Add_all_missing_imports: b(95064, 3, "Add_all_missing_imports_95064", "Add all missing imports"),
- Convert_to_async_function: b(95065, 3, "Convert_to_async_function_95065", "Convert to async function"),
- Convert_all_to_async_functions: b(95066, 3, "Convert_all_to_async_functions_95066", "Convert all to async functions"),
- Add_missing_call_parentheses: b(95067, 3, "Add_missing_call_parentheses_95067", "Add missing call parentheses"),
- Add_all_missing_call_parentheses: b(95068, 3, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"),
- Add_unknown_conversion_for_non_overlapping_types: b(95069, 3, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"),
- Add_unknown_to_all_conversions_of_non_overlapping_types: b(95070, 3, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"),
- Add_missing_new_operator_to_call: b(95071, 3, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"),
- Add_missing_new_operator_to_all_calls: b(95072, 3, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"),
- Add_names_to_all_parameters_without_names: b(95073, 3, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"),
- Enable_the_experimentalDecorators_option_in_your_configuration_file: b(95074, 3, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"),
- Convert_parameters_to_destructured_object: b(95075, 3, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"),
- Extract_type: b(95077, 3, "Extract_type_95077", "Extract type"),
- Extract_to_type_alias: b(95078, 3, "Extract_to_type_alias_95078", "Extract to type alias"),
- Extract_to_typedef: b(95079, 3, "Extract_to_typedef_95079", "Extract to typedef"),
- Infer_this_type_of_0_from_usage: b(95080, 3, "Infer_this_type_of_0_from_usage_95080", "Infer 'this' type of '{0}' from usage"),
- Add_const_to_unresolved_variable: b(95081, 3, "Add_const_to_unresolved_variable_95081", "Add 'const' to unresolved variable"),
- Add_const_to_all_unresolved_variables: b(95082, 3, "Add_const_to_all_unresolved_variables_95082", "Add 'const' to all unresolved variables"),
- Add_await: b(95083, 3, "Add_await_95083", "Add 'await'"),
- Add_await_to_initializer_for_0: b(95084, 3, "Add_await_to_initializer_for_0_95084", "Add 'await' to initializer for '{0}'"),
- Fix_all_expressions_possibly_missing_await: b(95085, 3, "Fix_all_expressions_possibly_missing_await_95085", "Fix all expressions possibly missing 'await'"),
- Remove_unnecessary_await: b(95086, 3, "Remove_unnecessary_await_95086", "Remove unnecessary 'await'"),
- Remove_all_unnecessary_uses_of_await: b(95087, 3, "Remove_all_unnecessary_uses_of_await_95087", "Remove all unnecessary uses of 'await'"),
- Enable_the_jsx_flag_in_your_configuration_file: b(95088, 3, "Enable_the_jsx_flag_in_your_configuration_file_95088", "Enable the '--jsx' flag in your configuration file"),
- Add_await_to_initializers: b(95089, 3, "Add_await_to_initializers_95089", "Add 'await' to initializers"),
- Extract_to_interface: b(95090, 3, "Extract_to_interface_95090", "Extract to interface"),
- Convert_to_a_bigint_numeric_literal: b(95091, 3, "Convert_to_a_bigint_numeric_literal_95091", "Convert to a bigint numeric literal"),
- Convert_all_to_bigint_numeric_literals: b(95092, 3, "Convert_all_to_bigint_numeric_literals_95092", "Convert all to bigint numeric literals"),
- Convert_const_to_let: b(95093, 3, "Convert_const_to_let_95093", "Convert 'const' to 'let'"),
- Prefix_with_declare: b(95094, 3, "Prefix_with_declare_95094", "Prefix with 'declare'"),
- Prefix_all_incorrect_property_declarations_with_declare: b(95095, 3, "Prefix_all_incorrect_property_declarations_with_declare_95095", "Prefix all incorrect property declarations with 'declare'"),
- Convert_to_template_string: b(95096, 3, "Convert_to_template_string_95096", "Convert to template string"),
- Add_export_to_make_this_file_into_a_module: b(95097, 3, "Add_export_to_make_this_file_into_a_module_95097", "Add 'export {}' to make this file into a module"),
- Set_the_target_option_in_your_configuration_file_to_0: b(95098, 3, "Set_the_target_option_in_your_configuration_file_to_0_95098", "Set the 'target' option in your configuration file to '{0}'"),
- Set_the_module_option_in_your_configuration_file_to_0: b(95099, 3, "Set_the_module_option_in_your_configuration_file_to_0_95099", "Set the 'module' option in your configuration file to '{0}'"),
- Convert_invalid_character_to_its_html_entity_code: b(95100, 3, "Convert_invalid_character_to_its_html_entity_code_95100", "Convert invalid character to its html entity code"),
- Convert_all_invalid_characters_to_HTML_entity_code: b(95101, 3, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"),
- Convert_all_const_to_let: b(95102, 3, "Convert_all_const_to_let_95102", "Convert all 'const' to 'let'"),
- Convert_function_expression_0_to_arrow_function: b(95105, 3, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"),
- Convert_function_declaration_0_to_arrow_function: b(95106, 3, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"),
- Fix_all_implicit_this_errors: b(95107, 3, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"),
- Wrap_invalid_character_in_an_expression_container: b(95108, 3, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"),
- Wrap_all_invalid_characters_in_an_expression_container: b(95109, 3, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"),
- Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: b(95110, 3, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"),
- Add_a_return_statement: b(95111, 3, "Add_a_return_statement_95111", "Add a return statement"),
- Remove_braces_from_arrow_function_body: b(95112, 3, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"),
- Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: b(95113, 3, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"),
- Add_all_missing_return_statement: b(95114, 3, "Add_all_missing_return_statement_95114", "Add all missing return statement"),
- Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: b(95115, 3, "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115", "Remove braces from all arrow function bodies with relevant issues"),
- Wrap_all_object_literal_with_parentheses: b(95116, 3, "Wrap_all_object_literal_with_parentheses_95116", "Wrap all object literal with parentheses"),
- Move_labeled_tuple_element_modifiers_to_labels: b(95117, 3, "Move_labeled_tuple_element_modifiers_to_labels_95117", "Move labeled tuple element modifiers to labels"),
- Convert_overload_list_to_single_signature: b(95118, 3, "Convert_overload_list_to_single_signature_95118", "Convert overload list to single signature"),
- Generate_get_and_set_accessors_for_all_overriding_properties: b(95119, 3, "Generate_get_and_set_accessors_for_all_overriding_properties_95119", "Generate 'get' and 'set' accessors for all overriding properties"),
- Wrap_in_JSX_fragment: b(95120, 3, "Wrap_in_JSX_fragment_95120", "Wrap in JSX fragment"),
- Wrap_all_unparented_JSX_in_JSX_fragment: b(95121, 3, "Wrap_all_unparented_JSX_in_JSX_fragment_95121", "Wrap all unparented JSX in JSX fragment"),
- Convert_arrow_function_or_function_expression: b(95122, 3, "Convert_arrow_function_or_function_expression_95122", "Convert arrow function or function expression"),
- Convert_to_anonymous_function: b(95123, 3, "Convert_to_anonymous_function_95123", "Convert to anonymous function"),
- Convert_to_named_function: b(95124, 3, "Convert_to_named_function_95124", "Convert to named function"),
- Convert_to_arrow_function: b(95125, 3, "Convert_to_arrow_function_95125", "Convert to arrow function"),
- Remove_parentheses: b(95126, 3, "Remove_parentheses_95126", "Remove parentheses"),
- Could_not_find_a_containing_arrow_function: b(95127, 3, "Could_not_find_a_containing_arrow_function_95127", "Could not find a containing arrow function"),
- Containing_function_is_not_an_arrow_function: b(95128, 3, "Containing_function_is_not_an_arrow_function_95128", "Containing function is not an arrow function"),
- Could_not_find_export_statement: b(95129, 3, "Could_not_find_export_statement_95129", "Could not find export statement"),
- This_file_already_has_a_default_export: b(95130, 3, "This_file_already_has_a_default_export_95130", "This file already has a default export"),
- Could_not_find_import_clause: b(95131, 3, "Could_not_find_import_clause_95131", "Could not find import clause"),
- Could_not_find_namespace_import_or_named_imports: b(95132, 3, "Could_not_find_namespace_import_or_named_imports_95132", "Could not find namespace import or named imports"),
- Selection_is_not_a_valid_type_node: b(95133, 3, "Selection_is_not_a_valid_type_node_95133", "Selection is not a valid type node"),
- No_type_could_be_extracted_from_this_type_node: b(95134, 3, "No_type_could_be_extracted_from_this_type_node_95134", "No type could be extracted from this type node"),
- Could_not_find_property_for_which_to_generate_accessor: b(95135, 3, "Could_not_find_property_for_which_to_generate_accessor_95135", "Could not find property for which to generate accessor"),
- Name_is_not_valid: b(95136, 3, "Name_is_not_valid_95136", "Name is not valid"),
- Can_only_convert_property_with_modifier: b(95137, 3, "Can_only_convert_property_with_modifier_95137", "Can only convert property with modifier"),
- Switch_each_misused_0_to_1: b(95138, 3, "Switch_each_misused_0_to_1_95138", "Switch each misused '{0}' to '{1}'"),
- Convert_to_optional_chain_expression: b(95139, 3, "Convert_to_optional_chain_expression_95139", "Convert to optional chain expression"),
- Could_not_find_convertible_access_expression: b(95140, 3, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"),
- Could_not_find_matching_access_expressions: b(95141, 3, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"),
- Can_only_convert_logical_AND_access_chains: b(95142, 3, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"),
- Add_void_to_Promise_resolved_without_a_value: b(95143, 3, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"),
- Add_void_to_all_Promises_resolved_without_a_value: b(95144, 3, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"),
- Use_element_access_for_0: b(95145, 3, "Use_element_access_for_0_95145", "Use element access for '{0}'"),
- Use_element_access_for_all_undeclared_properties: b(95146, 3, "Use_element_access_for_all_undeclared_properties_95146", "Use element access for all undeclared properties."),
- Delete_all_unused_imports: b(95147, 3, "Delete_all_unused_imports_95147", "Delete all unused imports"),
- Infer_function_return_type: b(95148, 3, "Infer_function_return_type_95148", "Infer function return type"),
- Return_type_must_be_inferred_from_a_function: b(95149, 3, "Return_type_must_be_inferred_from_a_function_95149", "Return type must be inferred from a function"),
- Could_not_determine_function_return_type: b(95150, 3, "Could_not_determine_function_return_type_95150", "Could not determine function return type"),
- Could_not_convert_to_arrow_function: b(95151, 3, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
- Could_not_convert_to_named_function: b(95152, 3, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
- Could_not_convert_to_anonymous_function: b(95153, 3, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
- Can_only_convert_string_concatenations_and_string_literals: b(95154, 3, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
- Selection_is_not_a_valid_statement_or_statements: b(95155, 3, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
- Add_missing_function_declaration_0: b(95156, 3, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
- Add_all_missing_function_declarations: b(95157, 3, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
- Method_not_implemented: b(95158, 3, "Method_not_implemented_95158", "Method not implemented."),
- Function_not_implemented: b(95159, 3, "Function_not_implemented_95159", "Function not implemented."),
- Add_override_modifier: b(95160, 3, "Add_override_modifier_95160", "Add 'override' modifier"),
- Remove_override_modifier: b(95161, 3, "Remove_override_modifier_95161", "Remove 'override' modifier"),
- Add_all_missing_override_modifiers: b(95162, 3, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"),
- Remove_all_unnecessary_override_modifiers: b(95163, 3, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"),
- Can_only_convert_named_export: b(95164, 3, "Can_only_convert_named_export_95164", "Can only convert named export"),
- Add_missing_properties: b(95165, 3, "Add_missing_properties_95165", "Add missing properties"),
- Add_all_missing_properties: b(95166, 3, "Add_all_missing_properties_95166", "Add all missing properties"),
- Add_missing_attributes: b(95167, 3, "Add_missing_attributes_95167", "Add missing attributes"),
- Add_all_missing_attributes: b(95168, 3, "Add_all_missing_attributes_95168", "Add all missing attributes"),
- Add_undefined_to_optional_property_type: b(95169, 3, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
- Convert_named_imports_to_default_import: b(95170, 3, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"),
- Delete_unused_param_tag_0: b(95171, 3, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
- Delete_all_unused_param_tags: b(95172, 3, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
- Rename_param_tag_name_0_to_1: b(95173, 3, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
- Use_0: b(95174, 3, "Use_0_95174", "Use `{0}`."),
- Use_Number_isNaN_in_all_conditions: b(95175, 3, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
- Convert_typedef_to_TypeScript_type: b(95176, 3, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
- Convert_all_typedef_to_TypeScript_types: b(95177, 3, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
- Move_to_file: b(95178, 3, "Move_to_file_95178", "Move to file"),
- Cannot_move_to_file_selected_file_is_invalid: b(95179, 3, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
- Use_import_type: b(95180, 3, "Use_import_type_95180", "Use 'import type'"),
- Use_type_0: b(95181, 3, "Use_type_0_95181", "Use 'type {0}'"),
- Fix_all_with_type_only_imports: b(95182, 3, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"),
- Cannot_move_statements_to_the_selected_file: b(95183, 3, "Cannot_move_statements_to_the_selected_file_95183", "Cannot move statements to the selected file"),
- Inline_variable: b(95184, 3, "Inline_variable_95184", "Inline variable"),
- Could_not_find_variable_to_inline: b(95185, 3, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
- Variables_with_multiple_declarations_cannot_be_inlined: b(95186, 3, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
- Add_missing_comma_for_object_member_completion_0: b(95187, 3, "Add_missing_comma_for_object_member_completion_0_95187", "Add missing comma for object member completion '{0}'."),
- Add_missing_parameter_to_0: b(95188, 3, "Add_missing_parameter_to_0_95188", "Add missing parameter to '{0}'"),
- Add_missing_parameters_to_0: b(95189, 3, "Add_missing_parameters_to_0_95189", "Add missing parameters to '{0}'"),
- Add_all_missing_parameters: b(95190, 3, "Add_all_missing_parameters_95190", "Add all missing parameters"),
- Add_optional_parameter_to_0: b(95191, 3, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
- Add_optional_parameters_to_0: b(95192, 3, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
- Add_all_optional_parameters: b(95193, 3, "Add_all_optional_parameters_95193", "Add all optional parameters"),
- Wrap_in_parentheses: b(95194, 3, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
- Wrap_all_invalid_decorator_expressions_in_parentheses: b(95195, 3, "Wrap_all_invalid_decorator_expressions_in_parentheses_95195", "Wrap all invalid decorator expressions in parentheses"),
- No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: b(18004, 1, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
- Classes_may_not_have_a_field_named_constructor: b(18006, 1, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
- JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: b(18007, 1, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
- Private_identifiers_cannot_be_used_as_parameters: b(18009, 1, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."),
- An_accessibility_modifier_cannot_be_used_with_a_private_identifier: b(18010, 1, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."),
- The_operand_of_a_delete_operator_cannot_be_a_private_identifier: b(18011, 1, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."),
- constructor_is_a_reserved_word: b(18012, 1, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."),
- Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: b(18013, 1, "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013", "Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),
- The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: b(18014, 1, "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014", "The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),
- Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: b(18015, 1, "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015", "Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),
- Private_identifiers_are_not_allowed_outside_class_bodies: b(18016, 1, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."),
- The_shadowing_declaration_of_0_is_defined_here: b(18017, 1, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"),
- The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: b(18018, 1, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"),
- _0_modifier_cannot_be_used_with_a_private_identifier: b(18019, 1, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."),
- An_enum_member_cannot_be_named_with_a_private_identifier: b(18024, 1, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."),
- can_only_be_used_at_the_start_of_a_file: b(18026, 1, "can_only_be_used_at_the_start_of_a_file_18026", "'#!' can only be used at the start of a file."),
- Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: b(18027, 1, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."),
- Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: b(18028, 1, "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028", "Private identifiers are only available when targeting ECMAScript 2015 and higher."),
- Private_identifiers_are_not_allowed_in_variable_declarations: b(18029, 1, "Private_identifiers_are_not_allowed_in_variable_declarations_18029", "Private identifiers are not allowed in variable declarations."),
- An_optional_chain_cannot_contain_private_identifiers: b(18030, 1, "An_optional_chain_cannot_contain_private_identifiers_18030", "An optional chain cannot contain private identifiers."),
- The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: b(18031, 1, "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031", "The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),
- The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: b(18032, 1, "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032", "The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),
- Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values: b(18033, 1, "Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033", "Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),
- Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: b(18034, 3, "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034", "Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),
- Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: b(18035, 1, "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035", "Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),
- Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator: b(18036, 1, "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036", "Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),
- await_expression_cannot_be_used_inside_a_class_static_block: b(18037, 1, "await_expression_cannot_be_used_inside_a_class_static_block_18037", "'await' expression cannot be used inside a class static block."),
- for_await_loops_cannot_be_used_inside_a_class_static_block: b(18038, 1, "for_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'for await' loops cannot be used inside a class static block."),
- Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: b(18039, 1, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."),
- A_return_statement_cannot_be_used_inside_a_class_static_block: b(18041, 1, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."),
- _0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: b(18042, 1, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),
- Types_cannot_appear_in_export_declarations_in_JavaScript_files: b(18043, 1, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."),
- _0_is_automatically_exported_here: b(18044, 3, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."),
- Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher: b(18045, 1, "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045", "Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),
- _0_is_of_type_unknown: b(18046, 1, "_0_is_of_type_unknown_18046", "'{0}' is of type 'unknown'."),
- _0_is_possibly_null: b(18047, 1, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."),
- _0_is_possibly_undefined: b(18048, 1, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
- _0_is_possibly_null_or_undefined: b(18049, 1, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
- The_value_0_cannot_be_used_here: b(18050, 1, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
- Compiler_option_0_cannot_be_given_an_empty_string: b(18051, 1, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
- Its_type_0_is_not_a_valid_JSX_element_type: b(18053, 1, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
- await_using_statements_cannot_be_used_inside_a_class_static_block: b(18054, 1, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."),
- _0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: b(18055, 1, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),
- Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: b(18056, 1, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),
- String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: b(18057, 1, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")
- };
- function c_(e) {
- return e >= 80;
- }
- function QQ(e) {
- return e === 32 || c_(e);
- }
- var wI = {
- abstract: 128,
- accessor: 129,
- any: 133,
- as: 130,
- asserts: 131,
- assert: 132,
- bigint: 163,
- boolean: 136,
- break: 83,
- case: 84,
- catch: 85,
- class: 86,
- continue: 88,
- const: 87,
- constructor: 137,
- debugger: 89,
- declare: 138,
- default: 90,
- delete: 91,
- do: 92,
- else: 93,
- enum: 94,
- export: 95,
- extends: 96,
- false: 97,
- finally: 98,
- for: 99,
- from: 161,
- function: 100,
- get: 139,
- if: 101,
- implements: 119,
- import: 102,
- in: 103,
- infer: 140,
- instanceof: 104,
- interface: 120,
- intrinsic: 141,
- is: 142,
- keyof: 143,
- let: 121,
- module: 144,
- namespace: 145,
- never: 146,
- new: 105,
- null: 106,
- number: 150,
- object: 151,
- package: 122,
- private: 123,
- protected: 124,
- public: 125,
- override: 164,
- out: 147,
- readonly: 148,
- require: 149,
- global: 162,
- return: 107,
- satisfies: 152,
- set: 153,
- static: 126,
- string: 154,
- super: 108,
- switch: 109,
- symbol: 155,
- this: 110,
- throw: 111,
- true: 112,
- try: 113,
- type: 156,
- typeof: 114,
- undefined: 157,
- unique: 158,
- unknown: 159,
- using: 160,
- var: 115,
- void: 116,
- while: 117,
- with: 118,
- yield: 127,
- async: 134,
- await: 135,
- of: 165
- /* OfKeyword */
- }, k5e = new Map(Object.entries(wI)), Ume = new Map(Object.entries({
- ...wI,
- "{": 19,
- "}": 20,
- "(": 21,
- ")": 22,
- "[": 23,
- "]": 24,
- ".": 25,
- "...": 26,
- ";": 27,
- ",": 28,
- "<": 30,
- ">": 32,
- "<=": 33,
- ">=": 34,
- "==": 35,
- "!=": 36,
- "===": 37,
- "!==": 38,
- "=>": 39,
- "+": 40,
- "-": 41,
- "**": 43,
- "*": 42,
- "/": 44,
- "%": 45,
- "++": 46,
- "--": 47,
- "<<": 48,
- "": 31,
- ">>": 49,
- ">>>": 50,
- "&": 51,
- "|": 52,
- "^": 53,
- "!": 54,
- "~": 55,
- "&&": 56,
- "||": 57,
- "?": 58,
- "??": 61,
- "?.": 29,
- ":": 59,
- "=": 64,
- "+=": 65,
- "-=": 66,
- "*=": 67,
- "**=": 68,
- "/=": 69,
- "%=": 70,
- "<<=": 71,
- ">>=": 72,
- ">>>=": 73,
- "&=": 74,
- "|=": 75,
- "^=": 79,
- "||=": 76,
- "&&=": 77,
- "??=": 78,
- "@": 60,
- "#": 63,
- "`": 62
- /* BacktickToken */
- })), Vme = /* @__PURE__ */ new Map([
- [
- 100,
- 1
- /* HasIndices */
- ],
- [
- 103,
- 2
- /* Global */
- ],
- [
- 105,
- 4
- /* IgnoreCase */
- ],
- [
- 109,
- 8
- /* Multiline */
- ],
- [
- 115,
- 16
- /* DotAll */
- ],
- [
- 117,
- 32
- /* Unicode */
- ],
- [
- 118,
- 64
- /* UnicodeSets */
- ],
- [
- 121,
- 128
- /* Sticky */
- ]
- ]), C5e = /* @__PURE__ */ new Map([
- [
- 1,
- 9
- /* RegularExpressionFlagsHasIndices */
- ],
- [
- 16,
- 5
- /* RegularExpressionFlagsDotAll */
- ],
- [
- 32,
- 2
- /* RegularExpressionFlagsUnicode */
- ],
- [
- 64,
- 99
- /* RegularExpressionFlagsUnicodeSets */
- ],
- [
- 128,
- 2
- /* RegularExpressionFlagsSticky */
- ]
- ]), E5e = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500], D5e = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500], P5e = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2160, 2183, 2185, 2190, 2208, 2249, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3165, 3165, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3293, 3294, 3296, 3297, 3313, 3314, 3332, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5905, 5919, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6988, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12735, 12784, 12799, 13312, 19903, 19968, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42954, 42960, 42961, 42963, 42963, 42965, 42969, 42994, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43881, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66928, 66938, 66940, 66954, 66956, 66962, 66964, 66965, 66967, 66977, 66979, 66993, 66995, 67001, 67003, 67004, 67072, 67382, 67392, 67413, 67424, 67431, 67456, 67461, 67463, 67504, 67506, 67514, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69248, 69289, 69296, 69297, 69376, 69404, 69415, 69415, 69424, 69445, 69488, 69505, 69552, 69572, 69600, 69622, 69635, 69687, 69745, 69746, 69749, 69749, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69959, 69959, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70207, 70208, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70753, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71488, 71494, 71680, 71723, 71840, 71903, 71935, 71942, 71945, 71945, 71948, 71955, 71957, 71958, 71960, 71983, 71999, 71999, 72001, 72001, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72368, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73474, 73474, 73476, 73488, 73490, 73523, 73648, 73648, 73728, 74649, 74752, 74862, 74880, 75075, 77712, 77808, 77824, 78895, 78913, 78918, 82944, 83526, 92160, 92728, 92736, 92766, 92784, 92862, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101589, 101632, 101640, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 122624, 122654, 122661, 122666, 122928, 122989, 123136, 123180, 123191, 123197, 123214, 123214, 123536, 123565, 123584, 123627, 124112, 124139, 124896, 124902, 124904, 124907, 124909, 124910, 124912, 124926, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173791, 173824, 177977, 177984, 178205, 178208, 183969, 183984, 191456, 191472, 192093, 194560, 195101, 196608, 201546, 201552, 205743], w5e = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2160, 2183, 2185, 2190, 2200, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2901, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3132, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3165, 3165, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3293, 3294, 3296, 3299, 3302, 3311, 3313, 3315, 3328, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3457, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3790, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5909, 5919, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6159, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6847, 6862, 6912, 6988, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12543, 12549, 12591, 12593, 12686, 12704, 12735, 12784, 12799, 13312, 19903, 19968, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42954, 42960, 42961, 42963, 42963, 42965, 42969, 42994, 43047, 43052, 43052, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43881, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66928, 66938, 66940, 66954, 66956, 66962, 66964, 66965, 66967, 66977, 66979, 66993, 66995, 67001, 67003, 67004, 67072, 67382, 67392, 67413, 67424, 67431, 67456, 67461, 67463, 67504, 67506, 67514, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69248, 69289, 69291, 69292, 69296, 69297, 69373, 69404, 69415, 69415, 69424, 69456, 69488, 69509, 69552, 69572, 69600, 69622, 69632, 69702, 69734, 69749, 69759, 69818, 69826, 69826, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69959, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70094, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70209, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70753, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71488, 71494, 71680, 71738, 71840, 71913, 71935, 71942, 71945, 71945, 71948, 71955, 71957, 71958, 71960, 71989, 71991, 71992, 71995, 72003, 72016, 72025, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72368, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73472, 73488, 73490, 73530, 73534, 73538, 73552, 73561, 73648, 73648, 73728, 74649, 74752, 74862, 74880, 75075, 77712, 77808, 77824, 78895, 78912, 78933, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92784, 92862, 92864, 92873, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94180, 94192, 94193, 94208, 100343, 100352, 101589, 101632, 101640, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 118528, 118573, 118576, 118598, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122624, 122654, 122661, 122666, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 122928, 122989, 123023, 123023, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123536, 123566, 123584, 123641, 124112, 124153, 124896, 124902, 124904, 124907, 124909, 124910, 124912, 124926, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 130032, 130041, 131072, 173791, 173824, 177977, 177984, 178205, 178208, 183969, 183984, 191456, 191472, 192093, 194560, 195101, 196608, 201546, 201552, 205743, 917760, 917999], A5e = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/, N5e = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/, I5e = /@(?:see|link)/i;
- function tj(e, t) {
- if (e < t[0])
- return !1;
- let n = 0, i = t.length, s;
- for (; n + 1 < i; ) {
- if (s = n + (i - n) / 2, s -= s % 2, t[s] <= e && e <= t[s + 1])
- return !0;
- e < t[s] ? i = s : n = s + 2;
- }
- return !1;
- }
- function AI(e, t) {
- return t >= 2 ? tj(e, P5e) : tj(e, E5e);
- }
- function O5e(e, t) {
- return t >= 2 ? tj(e, w5e) : tj(e, D5e);
- }
- function qme(e) {
- const t = [];
- return e.forEach((n, i) => {
- t[n] = i;
- }), t;
- }
- var F5e = qme(Ume);
- function qs(e) {
- return F5e[e];
- }
- function H2(e) {
- return Ume.get(e);
- }
- var L5e = qme(Vme);
- function Hme(e) {
- return L5e[e];
- }
- function rj(e) {
- return Vme.get(e);
- }
- function BT(e) {
- const t = [];
- let n = 0, i = 0;
- for (; n < e.length; ) {
- const s = e.charCodeAt(n);
- switch (n++, s) {
- case 13:
- e.charCodeAt(n) === 10 && n++;
- case 10:
- t.push(i), i = n;
- break;
- default:
- s > 127 && gu(s) && (t.push(i), i = n);
- break;
- }
- }
- return t.push(i), t;
- }
- function pw(e, t, n, i) {
- return e.getPositionOfLineAndCharacter ? e.getPositionOfLineAndCharacter(t, n, i) : NI(Ag(e), t, n, e.text, i);
- }
- function NI(e, t, n, i, s) {
- (t < 0 || t >= e.length) && (s ? t = t < 0 ? 0 : t >= e.length ? e.length - 1 : t : E.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${i !== void 0 ? Af(e, BT(i)) : "unknown"}`));
- const o = e[t] + n;
- return s ? o > e[t + 1] ? e[t + 1] : typeof i == "string" && o > i.length ? i.length : o : (t < e.length - 1 ? E.assert(o < e[t + 1]) : i !== void 0 && E.assert(o <= i.length), o);
- }
- function Ag(e) {
- return e.lineMap || (e.lineMap = BT(e.text));
- }
- function nC(e, t) {
- const n = HE(e, t);
- return {
- line: n,
- character: t - e[n]
- };
- }
- function HE(e, t, n) {
- let i = hy(e, t, go, ho, n);
- return i < 0 && (i = ~i - 1, E.assert(i !== -1, "position cannot precede the beginning of the file")), i;
- }
- function GE(e, t, n) {
- if (t === n) return 0;
- const i = Ag(e), s = Math.min(t, n), o = s === n, c = o ? t : n, _ = HE(i, s), u = HE(i, c, _);
- return o ? _ - u : u - _;
- }
- function Qs(e, t) {
- return nC(Ag(e), t);
- }
- function Ng(e) {
- return sm(e) || gu(e);
- }
- function sm(e) {
- return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e === 133 || e === 5760 || e >= 8192 && e <= 8203 || e === 8239 || e === 8287 || e === 12288 || e === 65279;
- }
- function gu(e) {
- return e === 10 || e === 13 || e === 8232 || e === 8233;
- }
- function iC(e) {
- return e >= 48 && e <= 57;
- }
- function YQ(e) {
- return iC(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102;
- }
- function ZQ(e) {
- return e >= 65 && e <= 90 || e >= 97 && e <= 122;
- }
- function Gme(e) {
- return ZQ(e) || iC(e) || e === 95;
- }
- function KQ(e) {
- return e >= 48 && e <= 55;
- }
- function eY(e, t) {
- const n = e.charCodeAt(t);
- switch (n) {
- case 13:
- case 10:
- case 9:
- case 11:
- case 12:
- case 32:
- case 47:
- case 60:
- case 124:
- case 61:
- case 62:
- return !0;
- case 35:
- return t === 0;
- default:
- return n > 127;
- }
- }
- function aa(e, t, n, i, s) {
- if (Pd(t))
- return t;
- let o = !1;
- for (; ; ) {
- const c = e.charCodeAt(t);
- switch (c) {
- case 13:
- e.charCodeAt(t + 1) === 10 && t++;
- case 10:
- if (t++, n)
- return t;
- o = !!s;
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- t++;
- continue;
- case 47:
- if (i)
- break;
- if (e.charCodeAt(t + 1) === 47) {
- for (t += 2; t < e.length && !gu(e.charCodeAt(t)); )
- t++;
- o = !1;
- continue;
- }
- if (e.charCodeAt(t + 1) === 42) {
- for (t += 2; t < e.length; ) {
- if (e.charCodeAt(t) === 42 && e.charCodeAt(t + 1) === 47) {
- t += 2;
- break;
- }
- t++;
- }
- o = !1;
- continue;
- }
- break;
- case 60:
- case 124:
- case 61:
- case 62:
- if ($E(e, t)) {
- t = dw(e, t), o = !1;
- continue;
- }
- break;
- case 35:
- if (t === 0 && $me(e, t)) {
- t = Xme(e, t), o = !1;
- continue;
- }
- break;
- case 42:
- if (o) {
- t++, o = !1;
- continue;
- }
- break;
- default:
- if (c > 127 && Ng(c)) {
- t++;
- continue;
- }
- break;
- }
- return t;
- }
- }
- var nj = 7;
- function $E(e, t) {
- if (E.assert(t >= 0), t === 0 || gu(e.charCodeAt(t - 1))) {
- const n = e.charCodeAt(t);
- if (t + nj < e.length) {
- for (let i = 0; i < nj; i++)
- if (e.charCodeAt(t + i) !== n)
- return !1;
- return n === 61 || e.charCodeAt(t + nj) === 32;
- }
- }
- return !1;
- }
- function dw(e, t, n) {
- n && n(p.Merge_conflict_marker_encountered, t, nj);
- const i = e.charCodeAt(t), s = e.length;
- if (i === 60 || i === 62)
- for (; t < s && !gu(e.charCodeAt(t)); )
- t++;
- else
- for (E.assert(
- i === 124 || i === 61
- /* equals */
- ); t < s; ) {
- const o = e.charCodeAt(t);
- if ((o === 61 || o === 62) && o !== i && $E(e, t))
- break;
- t++;
- }
- return t;
- }
- var tY = /^#!.*/;
- function $me(e, t) {
- return E.assert(t === 0), tY.test(e);
- }
- function Xme(e, t) {
- const n = tY.exec(e)[0];
- return t = t + n.length, t;
- }
- function ij(e, t, n, i, s, o, c) {
- let _, u, d, g, h = !1, S = i, T = c;
- if (n === 0) {
- S = !0;
- const C = II(t);
- C && (n = C.length);
- }
- e:
- for (; n >= 0 && n < t.length; ) {
- const C = t.charCodeAt(n);
- switch (C) {
- case 13:
- t.charCodeAt(n + 1) === 10 && n++;
- case 10:
- if (n++, i)
- break e;
- S = !0, h && (g = !0);
- continue;
- case 9:
- case 11:
- case 12:
- case 32:
- n++;
- continue;
- case 47:
- const D = t.charCodeAt(n + 1);
- let P = !1;
- if (D === 47 || D === 42) {
- const I = D === 47 ? 2 : 3, F = n;
- if (n += 2, D === 47)
- for (; n < t.length; ) {
- if (gu(t.charCodeAt(n))) {
- P = !0;
- break;
- }
- n++;
- }
- else
- for (; n < t.length; ) {
- if (t.charCodeAt(n) === 42 && t.charCodeAt(n + 1) === 47) {
- n += 2;
- break;
- }
- n++;
- }
- if (S) {
- if (h && (T = s(_, u, d, g, o, T), !e && T))
- return T;
- _ = F, u = n, d = I, g = P, h = !0;
- }
- continue;
- }
- break e;
- default:
- if (C > 127 && Ng(C)) {
- h && gu(C) && (g = !0), n++;
- continue;
- }
- break e;
- }
- }
- return h && (T = s(_, u, d, g, o, T)), T;
- }
- function mw(e, t, n, i) {
- return ij(
- /*reduce*/
- !1,
- e,
- t,
- /*trailing*/
- !1,
- n,
- i
- );
- }
- function gw(e, t, n, i) {
- return ij(
- /*reduce*/
- !1,
- e,
- t,
- /*trailing*/
- !0,
- n,
- i
- );
- }
- function rY(e, t, n, i, s) {
- return ij(
- /*reduce*/
- !0,
- e,
- t,
- /*trailing*/
- !1,
- n,
- i,
- s
- );
- }
- function nY(e, t, n, i, s) {
- return ij(
- /*reduce*/
- !0,
- e,
- t,
- /*trailing*/
- !0,
- n,
- i,
- s
- );
- }
- function Qme(e, t, n, i, s, o = []) {
- return o.push({ kind: n, pos: e, end: t, hasTrailingNewLine: i }), o;
- }
- function Ig(e, t) {
- return rY(
- e,
- t,
- Qme,
- /*state*/
- void 0,
- /*initial*/
- void 0
- );
- }
- function ky(e, t) {
- return nY(
- e,
- t,
- Qme,
- /*state*/
- void 0,
- /*initial*/
- void 0
- );
- }
- function II(e) {
- const t = tY.exec(e);
- if (t)
- return t[0];
- }
- function eg(e, t) {
- return ZQ(e) || e === 36 || e === 95 || e > 127 && AI(e, t);
- }
- function Th(e, t, n) {
- return Gme(e) || e === 36 || // "-" and ":" are valid in JSX Identifiers
- (n === 1 ? e === 45 || e === 58 : !1) || e > 127 && O5e(e, t);
- }
- function k_(e, t, n) {
- let i = XE(e, 0);
- if (!eg(i, t))
- return !1;
- for (let s = Td(i); s < e.length; s += Td(i))
- if (!Th(i = XE(e, s), t, n))
- return !1;
- return !0;
- }
- function Og(e, t, n = 0, i, s, o, c) {
- var _ = i, u, d, g, h, S, T, C, D, P = 0, I = 0, F = 0;
- Ws(_, o, c);
- var O = {
- getTokenFullStart: () => g,
- getStartPos: () => g,
- getTokenEnd: () => u,
- getTextPos: () => u,
- getToken: () => S,
- getTokenStart: () => h,
- getTokenPos: () => h,
- getTokenText: () => _.substring(h, u),
- getTokenValue: () => T,
- hasUnicodeEscape: () => (C & 1024) !== 0,
- hasExtendedUnicodeEscape: () => (C & 8) !== 0,
- hasPrecedingLineBreak: () => (C & 1) !== 0,
- hasPrecedingJSDocComment: () => (C & 2) !== 0,
- hasPrecedingJSDocLeadingAsterisks: () => (C & 32768) !== 0,
- isIdentifier: () => S === 80 || S > 118,
- isReservedWord: () => S >= 83 && S <= 118,
- isUnterminated: () => (C & 4) !== 0,
- getCommentDirectives: () => D,
- getNumericLiteralFlags: () => C & 25584,
- getTokenFlags: () => C,
- reScanGreaterToken: et,
- reScanAsteriskEqualsToken: Re,
- reScanSlashToken: ft,
- reScanTemplateToken: Nt,
- reScanTemplateHeadOrNoSubstitutionTemplate: Qt,
- scanJsxIdentifier: ei,
- scanJsxAttributeValue: Ri,
- reScanJsxAttributeValue: Jr,
- reScanJsxToken: Br,
- reScanLessThanToken: xr,
- reScanHashToken: zn,
- reScanQuestionToken: ki,
- reScanInvalidIdentifier: Me,
- scanJsxToken: rs,
- scanJsDocToken: Fe,
- scanJSDocCommentTextToken: ji,
- scan: we,
- getText: qn,
- clearCommentDirectives: Oi,
- setText: Ws,
- setScriptTarget: rr,
- setLanguageVariant: Ea,
- setScriptKind: Xe,
- setJSDocParsingMode: Tt,
- setOnError: Hs,
- resetTokenState: te,
- setTextPos: te,
- setSkipJsDocLeadingAsterisks: ze,
- tryScan: ti,
- lookAhead: mn,
- scanRange: Ar
- };
- return E.isDebugging && Object.defineProperty(O, "__debugShowCurrentPositionInText", {
- get: () => {
- const K = O.getText();
- return K.slice(0, O.getTokenFullStart()) + "║" + K.slice(O.getTokenFullStart());
- }
- }), O;
- function B(K) {
- return XE(_, K);
- }
- function z(K) {
- return K >= 0 && K < d ? B(K) : -1;
- }
- function X(K) {
- return _.charCodeAt(K);
- }
- function q(K) {
- return K >= 0 && K < d ? X(K) : -1;
- }
- function V(K, De = u, Ve, Ke) {
- if (s) {
- const xe = u;
- u = De, s(K, Ve || 0, Ke), u = xe;
- }
- }
- function ae() {
- let K = u, De = !1, Ve = !1, Ke = "";
- for (; ; ) {
- const xe = X(u);
- if (xe === 95) {
- C |= 512, De ? (De = !1, Ve = !0, Ke += _.substring(K, u)) : (C |= 16384, V(Ve ? p.Multiple_consecutive_numeric_separators_are_not_permitted : p.Numeric_separators_are_not_allowed_here, u, 1)), u++, K = u;
- continue;
- }
- if (iC(xe)) {
- De = !0, Ve = !1, u++;
- continue;
- }
- break;
- }
- return X(u - 1) === 95 && (C |= 16384, V(p.Numeric_separators_are_not_allowed_here, u - 1, 1)), Ke + _.substring(K, u);
- }
- function ee() {
- let K = u, De;
- if (X(u) === 48)
- if (u++, X(u) === 95)
- C |= 16896, V(p.Numeric_separators_are_not_allowed_here, u, 1), u--, De = ae();
- else if (!ue())
- C |= 8192, De = "" + +T;
- else if (!T)
- De = "0";
- else {
- T = "" + parseInt(T, 8), C |= 32;
- const $e = S === 41, bt = ($e ? "-" : "") + "0o" + (+T).toString(8);
- return $e && K--, V(p.Octal_literals_are_not_allowed_Use_the_syntax_0, K, u - K, bt), 9;
- }
- else
- De = ae();
- let Ve, Ke;
- X(u) === 46 && (u++, Ve = ae());
- let xe = u;
- if (X(u) === 69 || X(u) === 101) {
- u++, C |= 16, (X(u) === 43 || X(u) === 45) && u++;
- const $e = u, bt = ae();
- bt ? (Ke = _.substring(xe, $e) + bt, xe = u) : V(p.Digit_expected);
- }
- let at;
- if (C & 512 ? (at = De, Ve && (at += "." + Ve), Ke && (at += Ke)) : at = _.substring(K, xe), C & 8192)
- return V(p.Decimals_with_leading_zeros_are_not_allowed, K, xe - K), T = "" + +at, 9;
- if (Ve !== void 0 || C & 16)
- return G(K, Ve === void 0 && !!(C & 16)), T = "" + +at, 9;
- {
- T = at;
- const $e = Te();
- return G(K), $e;
- }
- }
- function G(K, De) {
- if (!eg(B(u), e))
- return;
- const Ve = u, { length: Ke } = me();
- Ke === 1 && _[Ve] === "n" ? V(De ? p.A_bigint_literal_cannot_use_exponential_notation : p.A_bigint_literal_must_be_an_integer, K, Ve - K + 1) : (V(p.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, Ve, Ke), u = Ve);
- }
- function ue() {
- const K = u;
- let De = !0;
- for (; iC(q(u)); )
- KQ(X(u)) || (De = !1), u++;
- return T = _.substring(K, u), De;
- }
- function re(K, De) {
- const Ve = ie(
- /*minCount*/
- K,
- /*scanAsManyAsPossible*/
- !1,
- De
- );
- return Ve ? parseInt(Ve, 16) : -1;
- }
- function ne(K, De) {
- return ie(
- /*minCount*/
- K,
- /*scanAsManyAsPossible*/
- !0,
- De
- );
- }
- function ie(K, De, Ve) {
- let Ke = [], xe = !1, at = !1;
- for (; Ke.length < K || De; ) {
- let $e = X(u);
- if (Ve && $e === 95) {
- C |= 512, xe ? (xe = !1, at = !0) : V(at ? p.Multiple_consecutive_numeric_separators_are_not_permitted : p.Numeric_separators_are_not_allowed_here, u, 1), u++;
- continue;
- }
- if (xe = Ve, $e >= 65 && $e <= 70)
- $e += 32;
- else if (!($e >= 48 && $e <= 57 || $e >= 97 && $e <= 102))
- break;
- Ke.push($e), u++, at = !1;
- }
- return Ke.length < K && (Ke = []), X(u - 1) === 95 && V(p.Numeric_separators_are_not_allowed_here, u - 1, 1), String.fromCharCode(...Ke);
- }
- function Se(K = !1) {
- const De = X(u);
- u++;
- let Ve = "", Ke = u;
- for (; ; ) {
- if (u >= d) {
- Ve += _.substring(Ke, u), C |= 4, V(p.Unterminated_string_literal);
- break;
- }
- const xe = X(u);
- if (xe === De) {
- Ve += _.substring(Ke, u), u++;
- break;
- }
- if (xe === 92 && !K) {
- Ve += _.substring(Ke, u), Ve += oe(
- 3
- /* ReportErrors */
- ), Ke = u;
- continue;
- }
- if ((xe === 10 || xe === 13) && !K) {
- Ve += _.substring(Ke, u), C |= 4, V(p.Unterminated_string_literal);
- break;
- }
- u++;
- }
- return Ve;
- }
- function J(K) {
- const De = X(u) === 96;
- u++;
- let Ve = u, Ke = "", xe;
- for (; ; ) {
- if (u >= d) {
- Ke += _.substring(Ve, u), C |= 4, V(p.Unterminated_template_literal), xe = De ? 15 : 18;
- break;
- }
- const at = X(u);
- if (at === 96) {
- Ke += _.substring(Ve, u), u++, xe = De ? 15 : 18;
- break;
- }
- if (at === 36 && u + 1 < d && X(u + 1) === 123) {
- Ke += _.substring(Ve, u), u += 2, xe = De ? 16 : 17;
- break;
- }
- if (at === 92) {
- Ke += _.substring(Ve, u), Ke += oe(1 | (K ? 2 : 0)), Ve = u;
- continue;
- }
- if (at === 13) {
- Ke += _.substring(Ve, u), u++, u < d && X(u) === 10 && u++, Ke += `
-`, Ve = u;
- continue;
- }
- u++;
- }
- return E.assert(xe !== void 0), T = Ke, xe;
- }
- function oe(K) {
- const De = u;
- if (u++, u >= d)
- return V(p.Unexpected_end_of_text), "";
- const Ve = X(u);
- switch (u++, Ve) {
- case 48:
- if (u >= d || !iC(X(u)))
- return "\0";
- case 49:
- case 50:
- case 51:
- u < d && KQ(X(u)) && u++;
- case 52:
- case 53:
- case 54:
- case 55:
- if (u < d && KQ(X(u)) && u++, C |= 2048, K & 6) {
- const at = parseInt(_.substring(De + 1, u), 8);
- return K & 4 && !(K & 32) && Ve !== 48 ? V(p.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead, De, u - De, "\\x" + at.toString(16).padStart(2, "0")) : V(p.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, De, u - De, "\\x" + at.toString(16).padStart(2, "0")), String.fromCharCode(at);
- }
- return _.substring(De, u);
- case 56:
- case 57:
- return C |= 2048, K & 6 ? (K & 4 && !(K & 32) ? V(p.Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class, De, u - De) : V(p.Escape_sequence_0_is_not_allowed, De, u - De, _.substring(De, u)), String.fromCharCode(Ve)) : _.substring(De, u);
- case 98:
- return "\b";
- case 116:
- return " ";
- case 110:
- return `
-`;
- case 118:
- return "\v";
- case 102:
- return "\f";
- case 114:
- return "\r";
- case 39:
- return "'";
- case 34:
- return '"';
- case 117:
- if (u < d && X(u) === 123) {
- u -= 2;
- const at = _e(!!(K & 6));
- return K & 17 || (C |= 2048, K & 6 && V(p.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, De, u - De)), at;
- }
- for (; u < De + 6; u++)
- if (!(u < d && YQ(X(u))))
- return C |= 2048, K & 6 && V(p.Hexadecimal_digit_expected), _.substring(De, u);
- C |= 1024;
- const Ke = parseInt(_.substring(De + 2, u), 16), xe = String.fromCharCode(Ke);
- if (K & 16 && Ke >= 55296 && Ke <= 56319 && u + 6 < d && _.substring(u, u + 2) === "\\u" && X(u + 2) !== 123) {
- const at = u;
- let $e = u + 2;
- for (; $e < at + 6; $e++)
- if (!YQ(X($e)))
- return xe;
- const bt = parseInt(_.substring(at + 2, $e), 16);
- if (bt >= 56320 && bt <= 57343)
- return u = $e, xe + String.fromCharCode(bt);
- }
- return xe;
- case 120:
- for (; u < De + 4; u++)
- if (!(u < d && YQ(X(u))))
- return C |= 2048, K & 6 && V(p.Hexadecimal_digit_expected), _.substring(De, u);
- return C |= 4096, String.fromCharCode(parseInt(_.substring(De + 2, u), 16));
- case 13:
- u < d && X(u) === 10 && u++;
- case 10:
- case 8232:
- case 8233:
- return "";
- default:
- return (K & 16 || K & 4 && !(K & 8) && Th(Ve, e)) && V(p.This_character_cannot_be_escaped_in_a_regular_expression, u - 2, 2), String.fromCharCode(Ve);
- }
- }
- function _e(K) {
- const De = u;
- u += 3;
- const Ve = u, Ke = ne(
- 1,
- /*canHaveSeparators*/
- !1
- ), xe = Ke ? parseInt(Ke, 16) : -1;
- let at = !1;
- return xe < 0 ? (K && V(p.Hexadecimal_digit_expected), at = !0) : xe > 1114111 && (K && V(p.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, Ve, u - Ve), at = !0), u >= d ? (K && V(p.Unexpected_end_of_text), at = !0) : X(u) === 125 ? u++ : (K && V(p.Unterminated_Unicode_escape_sequence), at = !0), at ? (C |= 2048, _.substring(De, u)) : (C |= 8, QE(xe));
- }
- function he() {
- if (u + 5 < d && X(u + 1) === 117) {
- const K = u;
- u += 2;
- const De = re(
- 4,
- /*canHaveSeparators*/
- !1
- );
- return u = K, De;
- }
- return -1;
- }
- function le() {
- if (B(u + 1) === 117 && B(u + 2) === 123) {
- const K = u;
- u += 3;
- const De = ne(
- 1,
- /*canHaveSeparators*/
- !1
- ), Ve = De ? parseInt(De, 16) : -1;
- return u = K, Ve;
- }
- return -1;
- }
- function me() {
- let K = "", De = u;
- for (; u < d; ) {
- let Ve = B(u);
- if (Th(Ve, e))
- u += Td(Ve);
- else if (Ve === 92) {
- if (Ve = le(), Ve >= 0 && Th(Ve, e)) {
- K += _e(
- /*shouldEmitInvalidEscapeError*/
- !0
- ), De = u;
- continue;
- }
- if (Ve = he(), !(Ve >= 0 && Th(Ve, e)))
- break;
- C |= 1024, K += _.substring(De, u), K += QE(Ve), u += 6, De = u;
- } else
- break;
- }
- return K += _.substring(De, u), K;
- }
- function ve() {
- const K = T.length;
- if (K >= 2 && K <= 12) {
- const De = T.charCodeAt(0);
- if (De >= 97 && De <= 122) {
- const Ve = k5e.get(T);
- if (Ve !== void 0)
- return S = Ve;
- }
- }
- return S = 80;
- }
- function tt(K) {
- let De = "", Ve = !1, Ke = !1;
- for (; ; ) {
- const xe = X(u);
- if (xe === 95) {
- C |= 512, Ve ? (Ve = !1, Ke = !0) : V(Ke ? p.Multiple_consecutive_numeric_separators_are_not_permitted : p.Numeric_separators_are_not_allowed_here, u, 1), u++;
- continue;
- }
- if (Ve = !0, !iC(xe) || xe - 48 >= K)
- break;
- De += _[u], u++, Ke = !1;
- }
- return X(u - 1) === 95 && V(p.Numeric_separators_are_not_allowed_here, u - 1, 1), De;
- }
- function Te() {
- return X(u) === 110 ? (T += "n", C & 384 && (T = V4(T) + "n"), u++, 10) : (T = "" + (C & 128 ? parseInt(T.slice(2), 2) : C & 256 ? parseInt(T.slice(2), 8) : +T), 9);
- }
- function we() {
- for (g = u, C = 0; ; ) {
- if (h = u, u >= d)
- return S = 1;
- const K = B(u);
- if (u === 0 && K === 35 && $me(_, u)) {
- if (u = Xme(_, u), t)
- continue;
- return S = 6;
- }
- switch (K) {
- case 10:
- case 13:
- if (C |= 1, t) {
- u++;
- continue;
- } else
- return K === 13 && u + 1 < d && X(u + 1) === 10 ? u += 2 : u++, S = 4;
- 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 8203:
- case 8239:
- case 8287:
- case 12288:
- case 65279:
- if (t) {
- u++;
- continue;
- } else {
- for (; u < d && sm(X(u)); )
- u++;
- return S = 5;
- }
- case 33:
- return X(u + 1) === 61 ? X(u + 2) === 61 ? (u += 3, S = 38) : (u += 2, S = 36) : (u++, S = 54);
- case 34:
- case 39:
- return T = Se(), S = 11;
- case 96:
- return S = J(
- /*shouldEmitInvalidEscapeError*/
- !1
- );
- case 37:
- return X(u + 1) === 61 ? (u += 2, S = 70) : (u++, S = 45);
- case 38:
- return X(u + 1) === 38 ? X(u + 2) === 61 ? (u += 3, S = 77) : (u += 2, S = 56) : X(u + 1) === 61 ? (u += 2, S = 74) : (u++, S = 51);
- case 40:
- return u++, S = 21;
- case 41:
- return u++, S = 22;
- case 42:
- if (X(u + 1) === 61)
- return u += 2, S = 67;
- if (X(u + 1) === 42)
- return X(u + 2) === 61 ? (u += 3, S = 68) : (u += 2, S = 43);
- if (u++, P && !(C & 32768) && C & 1) {
- C |= 32768;
- continue;
- }
- return S = 42;
- case 43:
- return X(u + 1) === 43 ? (u += 2, S = 46) : X(u + 1) === 61 ? (u += 2, S = 65) : (u++, S = 40);
- case 44:
- return u++, S = 28;
- case 45:
- return X(u + 1) === 45 ? (u += 2, S = 47) : X(u + 1) === 61 ? (u += 2, S = 66) : (u++, S = 41);
- case 46:
- return iC(X(u + 1)) ? (ee(), S = 9) : X(u + 1) === 46 && X(u + 2) === 46 ? (u += 3, S = 26) : (u++, S = 25);
- case 47:
- if (X(u + 1) === 47) {
- for (u += 2; u < d && !gu(X(u)); )
- u++;
- if (D = Ir(
- D,
- _.slice(h, u),
- A5e,
- h
- ), t)
- continue;
- return S = 2;
- }
- if (X(u + 1) === 42) {
- u += 2;
- const $e = X(u) === 42 && X(u + 1) !== 47;
- let bt = !1, He = h;
- for (; u < d; ) {
- const Vt = X(u);
- if (Vt === 42 && X(u + 1) === 47) {
- u += 2, bt = !0;
- break;
- }
- u++, gu(Vt) && (He = u, C |= 1);
- }
- if ($e && fe() && (C |= 2), D = Ir(D, _.slice(He, u), N5e, He), bt || V(p.Asterisk_Slash_expected), t)
- continue;
- return bt || (C |= 4), S = 3;
- }
- return X(u + 1) === 61 ? (u += 2, S = 69) : (u++, S = 44);
- case 48:
- if (u + 2 < d && (X(u + 1) === 88 || X(u + 1) === 120))
- return u += 2, T = ne(
- 1,
- /*canHaveSeparators*/
- !0
- ), T || (V(p.Hexadecimal_digit_expected), T = "0"), T = "0x" + T, C |= 64, S = Te();
- if (u + 2 < d && (X(u + 1) === 66 || X(u + 1) === 98))
- return u += 2, T = tt(
- /* base */
- 2
- ), T || (V(p.Binary_digit_expected), T = "0"), T = "0b" + T, C |= 128, S = Te();
- if (u + 2 < d && (X(u + 1) === 79 || X(u + 1) === 111))
- return u += 2, T = tt(
- /* base */
- 8
- ), T || (V(p.Octal_digit_expected), T = "0"), T = "0o" + T, C |= 256, S = Te();
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- return S = ee();
- case 58:
- return u++, S = 59;
- case 59:
- return u++, S = 27;
- case 60:
- if ($E(_, u)) {
- if (u = dw(_, u, V), t)
- continue;
- return S = 7;
- }
- return X(u + 1) === 60 ? X(u + 2) === 61 ? (u += 3, S = 71) : (u += 2, S = 48) : X(u + 1) === 61 ? (u += 2, S = 33) : n === 1 && X(u + 1) === 47 && X(u + 2) !== 42 ? (u += 2, S = 31) : (u++, S = 30);
- case 61:
- if ($E(_, u)) {
- if (u = dw(_, u, V), t)
- continue;
- return S = 7;
- }
- return X(u + 1) === 61 ? X(u + 2) === 61 ? (u += 3, S = 37) : (u += 2, S = 35) : X(u + 1) === 62 ? (u += 2, S = 39) : (u++, S = 64);
- case 62:
- if ($E(_, u)) {
- if (u = dw(_, u, V), t)
- continue;
- return S = 7;
- }
- return u++, S = 32;
- case 63:
- return X(u + 1) === 46 && !iC(X(u + 2)) ? (u += 2, S = 29) : X(u + 1) === 63 ? X(u + 2) === 61 ? (u += 3, S = 78) : (u += 2, S = 61) : (u++, S = 58);
- case 91:
- return u++, S = 23;
- case 93:
- return u++, S = 24;
- case 94:
- return X(u + 1) === 61 ? (u += 2, S = 79) : (u++, S = 53);
- case 123:
- return u++, S = 19;
- case 124:
- if ($E(_, u)) {
- if (u = dw(_, u, V), t)
- continue;
- return S = 7;
- }
- return X(u + 1) === 124 ? X(u + 2) === 61 ? (u += 3, S = 76) : (u += 2, S = 57) : X(u + 1) === 61 ? (u += 2, S = 75) : (u++, S = 52);
- case 125:
- return u++, S = 20;
- case 126:
- return u++, S = 55;
- case 64:
- return u++, S = 60;
- case 92:
- const De = le();
- if (De >= 0 && eg(De, e))
- return T = _e(
- /*shouldEmitInvalidEscapeError*/
- !0
- ) + me(), S = ve();
- const Ve = he();
- return Ve >= 0 && eg(Ve, e) ? (u += 6, C |= 1024, T = String.fromCharCode(Ve) + me(), S = ve()) : (V(p.Invalid_character), u++, S = 0);
- case 35:
- if (u !== 0 && _[u + 1] === "!")
- return V(p.can_only_be_used_at_the_start_of_a_file, u, 2), u++, S = 0;
- const Ke = B(u + 1);
- if (Ke === 92) {
- u++;
- const $e = le();
- if ($e >= 0 && eg($e, e))
- return T = "#" + _e(
- /*shouldEmitInvalidEscapeError*/
- !0
- ) + me(), S = 81;
- const bt = he();
- if (bt >= 0 && eg(bt, e))
- return u += 6, C |= 1024, T = "#" + String.fromCharCode(bt) + me(), S = 81;
- u--;
- }
- return eg(Ke, e) ? (u++, Qe(Ke, e)) : (T = "#", V(p.Invalid_character, u++, Td(K))), S = 81;
- case 65533:
- return V(p.File_appears_to_be_binary, 0, 0), u = d, S = 8;
- default:
- const xe = Qe(K, e);
- if (xe)
- return S = xe;
- if (sm(K)) {
- u += Td(K);
- continue;
- } else if (gu(K)) {
- C |= 1, u += Td(K);
- continue;
- }
- const at = Td(K);
- return V(p.Invalid_character, u, at), u += at, S = 0;
- }
- }
- }
- function fe() {
- switch (F) {
- case 0:
- return !0;
- case 1:
- return !1;
- }
- return I !== 3 && I !== 4 ? !0 : F === 3 ? !1 : I5e.test(_.slice(g, u));
- }
- function Me() {
- E.assert(S === 0, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."), u = h = g, C = 0;
- const K = B(u), De = Qe(
- K,
- 99
- /* ESNext */
- );
- return De ? S = De : (u += Td(K), S);
- }
- function Qe(K, De) {
- let Ve = K;
- if (eg(Ve, De)) {
- for (u += Td(Ve); u < d && Th(Ve = B(u), De); ) u += Td(Ve);
- return T = _.substring(h, u), Ve === 92 && (T += me()), ve();
- }
- }
- function et() {
- if (S === 32) {
- if (X(u) === 62)
- return X(u + 1) === 62 ? X(u + 2) === 61 ? (u += 3, S = 73) : (u += 2, S = 50) : X(u + 1) === 61 ? (u += 2, S = 72) : (u++, S = 49);
- if (X(u) === 61)
- return u++, S = 34;
- }
- return S;
- }
- function Re() {
- return E.assert(S === 67, "'reScanAsteriskEqualsToken' should only be called on a '*='"), u = h + 1, S = 64;
- }
- function ft(K) {
- if (S === 44 || S === 69) {
- const De = h + 1;
- u = De;
- let Ve = !1, Ke = !1, xe = !1;
- for (; ; ) {
- const $e = q(u);
- if ($e === -1 || gu($e)) {
- C |= 4;
- break;
- }
- if (Ve)
- Ve = !1;
- else {
- if ($e === 47 && !xe)
- break;
- $e === 91 ? xe = !0 : $e === 92 ? Ve = !0 : $e === 93 ? xe = !1 : !xe && $e === 40 && q(u + 1) === 63 && q(u + 2) === 60 && q(u + 3) !== 61 && q(u + 3) !== 33 && (Ke = !0);
- }
- u++;
- }
- const at = u;
- if (C & 4) {
- u = De, Ve = !1;
- let $e = 0, bt = !1, He = 0;
- for (; u < at; ) {
- const Vt = X(u);
- if (Ve)
- Ve = !1;
- else if (Vt === 92)
- Ve = !0;
- else if (Vt === 91)
- $e++;
- else if (Vt === 93 && $e)
- $e--;
- else if (!$e) {
- if (Vt === 123)
- bt = !0;
- else if (Vt === 125 && bt)
- bt = !1;
- else if (!bt) {
- if (Vt === 40)
- He++;
- else if (Vt === 41 && He)
- He--;
- else if (Vt === 41 || Vt === 93 || Vt === 125)
- break;
- }
- }
- u++;
- }
- for (; Ng(q(u - 1)) || q(u - 1) === 59; ) u--;
- V(p.Unterminated_regular_expression_literal, h, u - h);
- } else {
- u++;
- let $e = 0;
- for (; ; ) {
- const bt = z(u);
- if (bt === -1 || !Th(bt, e))
- break;
- const He = Td(bt);
- if (K) {
- const Vt = rj(bt);
- Vt === void 0 ? V(p.Unknown_regular_expression_flag, u, He) : $e & Vt ? V(p.Duplicate_regular_expression_flag, u, He) : (($e | Vt) & 96) === 96 ? V(p.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, u, He) : ($e |= Vt, _r(Vt, He));
- }
- u += He;
- }
- K && Ar(De, at - De, () => {
- Wt(
- $e,
- /*annexB*/
- !0,
- Ke
- );
- });
- }
- T = _.substring(h, u), S = 14;
- }
- return S;
- }
- function Wt(K, De, Ve) {
- var Ke = !!(K & 64), xe = !!(K & 96), at = xe || !De, $e = !1, bt = 0, He, Vt, Zt, vn = [], M;
- function Ae(zt) {
- for (; ; ) {
- if (vn.push(M), M = void 0, dt(zt), M = vn.pop(), q(u) !== 124)
- return;
- u++;
- }
- }
- function dt(zt) {
- let mr = !1;
- for (; ; ) {
- const Kt = u, hr = q(u);
- switch (hr) {
- case -1:
- return;
- case 94:
- case 36:
- u++, mr = !1;
- break;
- case 92:
- switch (u++, q(u)) {
- case 98:
- case 66:
- u++, mr = !1;
- break;
- default:
- be(), mr = !0;
- break;
- }
- break;
- case 40:
- if (u++, q(u) === 63)
- switch (u++, q(u)) {
- case 61:
- case 33:
- u++, mr = !at;
- break;
- case 60:
- const gs = u;
- switch (u++, q(u)) {
- case 61:
- case 33:
- u++, mr = !1;
- break;
- default:
- Le(
- /*isReference*/
- !1
- ), en(
- 62
- /* greaterThan */
- ), e < 5 && V(p.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, gs, u - gs), bt++, mr = !0;
- break;
- }
- break;
- default:
- const Ts = u, Ua = U(
- 0
- /* None */
- );
- q(u) === 45 && (u++, U(Ua), u === Ts + 1 && V(p.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, Ts, u - Ts)), en(
- 58
- /* colon */
- ), mr = !0;
- break;
- }
- else
- bt++, mr = !0;
- Ae(
- /*isInGroup*/
- !0
- ), en(
- 41
- /* closeParen */
- );
- break;
- case 123:
- u++;
- const Ft = u;
- ue();
- const Ss = T;
- if (!at && !Ss) {
- mr = !0;
- break;
- }
- if (q(u) === 44) {
- u++, ue();
- const gs = T;
- if (Ss)
- gs && Number.parseInt(Ss) > Number.parseInt(gs) && (at || q(u) === 125) && V(p.Numbers_out_of_order_in_quantifier, Ft, u - Ft);
- else if (gs || q(u) === 125)
- V(p.Incomplete_quantifier_Digit_expected, Ft, 0);
- else {
- V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, Kt, 1, String.fromCharCode(hr)), mr = !0;
- break;
- }
- } else if (!Ss) {
- at && V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, Kt, 1, String.fromCharCode(hr)), mr = !0;
- break;
- }
- if (q(u) !== 125)
- if (at)
- V(p._0_expected, u, 0, "}"), u--;
- else {
- mr = !0;
- break;
- }
- case 42:
- case 43:
- case 63:
- u++, q(u) === 63 && u++, mr || V(p.There_is_nothing_available_for_repetition, Kt, u - Kt), mr = !1;
- break;
- case 46:
- u++, mr = !0;
- break;
- case 91:
- u++, Ke ? Dr() : At(), en(
- 93
- /* closeBracket */
- ), mr = !0;
- break;
- case 41:
- if (zt)
- return;
- case 93:
- case 125:
- (at || hr === 41) && V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u, 1, String.fromCharCode(hr)), u++, mr = !0;
- break;
- case 47:
- case 124:
- return;
- default:
- Ht(), mr = !0;
- break;
- }
- }
- }
- function U(zt) {
- for (; ; ) {
- const mr = z(u);
- if (mr === -1 || !Th(mr, e))
- break;
- const Kt = Td(mr), hr = rj(mr);
- hr === void 0 ? V(p.Unknown_regular_expression_flag, u, Kt) : zt & hr ? V(p.Duplicate_regular_expression_flag, u, Kt) : hr & 28 ? (zt |= hr, _r(hr, Kt)) : V(p.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, u, Kt), u += Kt;
- }
- return zt;
- }
- function be() {
- switch (E.assertEqual(
- X(u - 1),
- 92
- /* backslash */
- ), q(u)) {
- case 107:
- u++, q(u) === 60 ? (u++, Le(
- /*isReference*/
- !0
- ), en(
- 62
- /* greaterThan */
- )) : (at || Ve) && V(p.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, u - 2, 2);
- break;
- case 113:
- if (Ke) {
- u++, V(p.q_is_only_available_inside_character_class, u - 2, 2);
- break;
- }
- default:
- E.assert(jt() || Z() || ht(
- /*atomEscape*/
- !0
- ));
- break;
- }
- }
- function Z() {
- E.assertEqual(
- X(u - 1),
- 92
- /* backslash */
- );
- const zt = q(u);
- if (zt >= 49 && zt <= 57) {
- const mr = u;
- return ue(), Zt = wr(Zt, { pos: mr, end: u, value: +T }), !0;
- }
- return !1;
- }
- function ht(zt) {
- E.assertEqual(
- X(u - 1),
- 92
- /* backslash */
- );
- let mr = q(u);
- switch (mr) {
- case -1:
- return V(p.Undetermined_character_escape, u - 1, 1), "\\";
- case 99:
- if (u++, mr = q(u), ZQ(mr))
- return u++, String.fromCharCode(mr & 31);
- if (at)
- V(p.c_must_be_followed_by_an_ASCII_letter, u - 2, 2);
- else if (zt)
- return u--, "\\";
- return String.fromCharCode(mr);
- case 94:
- case 36:
- case 47:
- case 92:
- case 46:
- case 42:
- case 43:
- case 63:
- case 40:
- case 41:
- case 91:
- case 93:
- case 123:
- case 125:
- case 124:
- return u++, String.fromCharCode(mr);
- default:
- return u--, oe(
- 12 | (xe ? 16 : 0) | (zt ? 32 : 0)
- );
- }
- }
- function Le(zt) {
- E.assertEqual(
- X(u - 1),
- 60
- /* lessThan */
- ), h = u, Qe(z(u), e), u === h ? V(p.Expected_a_capturing_group_name) : zt ? Vt = wr(Vt, { pos: h, end: u, name: T }) : M?.has(T) || vn.some((mr) => mr?.has(T)) ? V(p.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, h, u - h) : (M ?? (M = /* @__PURE__ */ new Set()), M.add(T), He ?? (He = /* @__PURE__ */ new Set()), He.add(T));
- }
- function Ie(zt) {
- return zt === 93 || zt === -1 || u >= d;
- }
- function At() {
- for (E.assertEqual(
- X(u - 1),
- 91
- /* openBracket */
- ), q(u) === 94 && u++; ; ) {
- const zt = q(u);
- if (Ie(zt))
- return;
- const mr = u, Kt = wt();
- if (q(u) === 45) {
- u++;
- const hr = q(u);
- if (Ie(hr))
- return;
- !Kt && at && V(p.A_character_class_range_must_not_be_bounded_by_another_character_class, mr, u - 1 - mr);
- const Ft = u, Ss = wt();
- if (!Ss && at) {
- V(p.A_character_class_range_must_not_be_bounded_by_another_character_class, Ft, u - Ft);
- continue;
- }
- if (!Kt)
- continue;
- const gs = XE(Kt, 0), Ts = XE(Ss, 0);
- Kt.length === Td(gs) && Ss.length === Td(Ts) && gs > Ts && V(p.Range_out_of_order_in_character_class, mr, u - mr);
- }
- }
- }
- function Dr() {
- E.assertEqual(
- X(u - 1),
- 91
- /* openBracket */
- );
- let zt = !1;
- q(u) === 94 && (u++, zt = !0);
- let mr = !1, Kt = q(u);
- if (Ie(Kt))
- return;
- let hr = u, Ft;
- switch (_.slice(u, u + 2)) {
- case "--":
- case "&&":
- V(p.Expected_a_class_set_operand), $e = !1;
- break;
- default:
- Ft = $r();
- break;
- }
- switch (q(u)) {
- case 45:
- if (q(u + 1) === 45) {
- zt && $e && V(p.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, hr, u - hr), mr = $e, yr(
- 3
- /* ClassSubtraction */
- ), $e = !zt && mr;
- return;
- }
- break;
- case 38:
- if (q(u + 1) === 38) {
- yr(
- 2
- /* ClassIntersection */
- ), zt && $e && V(p.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, hr, u - hr), mr = $e, $e = !zt && mr;
- return;
- } else
- V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u, 1, String.fromCharCode(Kt));
- break;
- default:
- zt && $e && V(p.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, hr, u - hr), mr = $e;
- break;
- }
- for (; Kt = q(u), Kt !== -1; ) {
- switch (Kt) {
- case 45:
- if (u++, Kt = q(u), Ie(Kt)) {
- $e = !zt && mr;
- return;
- }
- if (Kt === 45) {
- u++, V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u - 2, 2), hr = u - 2, Ft = _.slice(hr, u);
- continue;
- } else {
- Ft || V(p.A_character_class_range_must_not_be_bounded_by_another_character_class, hr, u - 1 - hr);
- const Ss = u, gs = $r();
- if (zt && $e && V(p.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, Ss, u - Ss), mr || (mr = $e), !gs) {
- V(p.A_character_class_range_must_not_be_bounded_by_another_character_class, Ss, u - Ss);
- break;
- }
- if (!Ft)
- break;
- const Ts = XE(Ft, 0), Ua = XE(gs, 0);
- Ft.length === Td(Ts) && gs.length === Td(Ua) && Ts > Ua && V(p.Range_out_of_order_in_character_class, hr, u - hr);
- }
- break;
- case 38:
- hr = u, u++, q(u) === 38 ? (u++, V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u - 2, 2), q(u) === 38 && (V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u, 1, String.fromCharCode(Kt)), u++)) : V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u - 1, 1, String.fromCharCode(Kt)), Ft = _.slice(hr, u);
- continue;
- }
- if (Ie(q(u)))
- break;
- switch (hr = u, _.slice(u, u + 2)) {
- case "--":
- case "&&":
- V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u, 2), u += 2, Ft = _.slice(hr, u);
- break;
- default:
- Ft = $r();
- break;
- }
- }
- $e = !zt && mr;
- }
- function yr(zt) {
- let mr = $e;
- for (; ; ) {
- let Kt = q(u);
- if (Ie(Kt))
- break;
- switch (Kt) {
- case 45:
- u++, q(u) === 45 ? (u++, zt !== 3 && V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u - 2, 2)) : V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u - 1, 1);
- break;
- case 38:
- u++, q(u) === 38 ? (u++, zt !== 2 && V(p.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, u - 2, 2), q(u) === 38 && (V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u, 1, String.fromCharCode(Kt)), u++)) : V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u - 1, 1, String.fromCharCode(Kt));
- break;
- default:
- switch (zt) {
- case 3:
- V(p._0_expected, u, 0, "--");
- break;
- case 2:
- V(p._0_expected, u, 0, "&&");
- break;
- }
- break;
- }
- if (Kt = q(u), Ie(Kt)) {
- V(p.Expected_a_class_set_operand);
- break;
- }
- $r(), mr && (mr = $e);
- }
- $e = mr;
- }
- function $r() {
- switch ($e = !1, q(u)) {
- case -1:
- return "";
- case 91:
- return u++, Dr(), en(
- 93
- /* closeBracket */
- ), "";
- case 92:
- if (u++, jt())
- return "";
- if (q(u) === 113)
- return u++, q(u) === 123 ? (u++, nt(), en(
- 125
- /* closeBrace */
- ), "") : (V(p.q_must_be_followed_by_string_alternatives_enclosed_in_braces, u - 2, 2), "q");
- u--;
- default:
- return ot();
- }
- }
- function nt() {
- E.assertEqual(
- X(u - 1),
- 123
- /* openBrace */
- );
- let zt = 0;
- for (; ; )
- switch (q(u)) {
- case -1:
- return;
- case 125:
- zt !== 1 && ($e = !0);
- return;
- case 124:
- zt !== 1 && ($e = !0), u++, o = u, zt = 0;
- break;
- default:
- ot(), zt++;
- break;
- }
- }
- function ot() {
- const zt = q(u);
- if (zt === -1)
- return "";
- if (zt === 92) {
- u++;
- const mr = q(u);
- switch (mr) {
- case 98:
- return u++, "\b";
- case 38:
- case 45:
- case 33:
- case 35:
- case 37:
- case 44:
- case 58:
- case 59:
- case 60:
- case 61:
- case 62:
- case 64:
- case 96:
- case 126:
- return u++, String.fromCharCode(mr);
- default:
- return ht(
- /*atomEscape*/
- !1
- );
- }
- } else if (zt === q(u + 1))
- switch (zt) {
- case 38:
- case 33:
- case 35:
- case 37:
- case 42:
- case 43:
- case 44:
- case 46:
- case 58:
- case 59:
- case 60:
- case 61:
- case 62:
- case 63:
- case 64:
- case 96:
- case 126:
- return V(p.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, u, 2), u += 2, _.substring(u - 2, u);
- }
- switch (zt) {
- case 47:
- case 40:
- case 41:
- case 91:
- case 93:
- case 123:
- case 125:
- case 45:
- case 124:
- return V(p.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, u, 1, String.fromCharCode(zt)), u++, String.fromCharCode(zt);
- }
- return Ht();
- }
- function wt() {
- if (q(u) === 92) {
- u++;
- const zt = q(u);
- switch (zt) {
- case 98:
- return u++, "\b";
- case 45:
- return u++, String.fromCharCode(zt);
- default:
- return jt() ? "" : ht(
- /*atomEscape*/
- !1
- );
- }
- } else
- return Ht();
- }
- function jt() {
- E.assertEqual(
- X(u - 1),
- 92
- /* backslash */
- );
- let zt = !1;
- const mr = u - 1, Kt = q(u);
- switch (Kt) {
- case 100:
- case 68:
- case 115:
- case 83:
- case 119:
- case 87:
- return u++, !0;
- case 80:
- zt = !0;
- case 112:
- if (u++, q(u) === 123) {
- u++;
- const hr = u, Ft = Xt();
- if (q(u) === 61) {
- const Ss = Yme.get(Ft);
- if (u === hr)
- V(p.Expected_a_Unicode_property_name);
- else if (Ss === void 0) {
- V(p.Unknown_Unicode_property_name, hr, u - hr);
- const Ua = _b(Ft, Yme.keys(), go);
- Ua && V(p.Did_you_mean_0, hr, u - hr, Ua);
- }
- u++;
- const gs = u, Ts = Xt();
- if (u === gs)
- V(p.Expected_a_Unicode_property_value);
- else if (Ss !== void 0 && !hw[Ss].has(Ts)) {
- V(p.Unknown_Unicode_property_value, gs, u - gs);
- const Ua = _b(Ts, hw[Ss], go);
- Ua && V(p.Did_you_mean_0, gs, u - gs, Ua);
- }
- } else if (u === hr)
- V(p.Expected_a_Unicode_property_name_or_value);
- else if (Kme.has(Ft))
- Ke ? zt ? V(p.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, hr, u - hr) : $e = !0 : V(p.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, hr, u - hr);
- else if (!hw.General_Category.has(Ft) && !Zme.has(Ft)) {
- V(p.Unknown_Unicode_property_name_or_value, hr, u - hr);
- const Ss = _b(Ft, [...hw.General_Category, ...Zme, ...Kme], go);
- Ss && V(p.Did_you_mean_0, hr, u - hr, Ss);
- }
- en(
- 125
- /* closeBrace */
- ), xe || V(p.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, mr, u - mr);
- } else if (at)
- V(p._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, u - 2, 2, String.fromCharCode(Kt));
- else
- return u--, !1;
- return !0;
- }
- return !1;
- }
- function Xt() {
- let zt = "";
- for (; ; ) {
- const mr = q(u);
- if (mr === -1 || !Gme(mr))
- break;
- zt += String.fromCharCode(mr), u++;
- }
- return zt;
- }
- function Ht() {
- const zt = xe ? Td(z(u)) : 1;
- return u += zt, zt > 0 ? _.substring(u - zt, u) : "";
- }
- function en(zt) {
- q(u) === zt ? u++ : V(p._0_expected, u, 0, String.fromCharCode(zt));
- }
- Ae(
- /*isInGroup*/
- !1
- ), ir(Vt, (zt) => {
- if (!He?.has(zt.name) && (V(p.There_is_no_capturing_group_named_0_in_this_regular_expression, zt.pos, zt.end - zt.pos, zt.name), He)) {
- const mr = _b(zt.name, He, go);
- mr && V(p.Did_you_mean_0, zt.pos, zt.end - zt.pos, mr);
- }
- }), ir(Zt, (zt) => {
- zt.value > bt && (bt ? V(p.This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression, zt.pos, zt.end - zt.pos, bt) : V(p.This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression, zt.pos, zt.end - zt.pos));
- });
- }
- function _r(K, De) {
- const Ve = C5e.get(K);
- Ve && e < Ve && V(p.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, u, De, _5(Ve));
- }
- function Ir(K, De, Ve, Ke) {
- const xe = jr(De.trimStart(), Ve);
- return xe === void 0 ? K : wr(
- K,
- {
- range: { pos: Ke, end: u },
- type: xe
- }
- );
- }
- function jr(K, De) {
- const Ve = De.exec(K);
- if (Ve)
- switch (Ve[1]) {
- case "ts-expect-error":
- return 0;
- case "ts-ignore":
- return 1;
- }
- }
- function Nt(K) {
- return u = h, S = J(!K);
- }
- function Qt() {
- return u = h, S = J(
- /*shouldEmitInvalidEscapeError*/
- !0
- );
- }
- function Br(K = !0) {
- return u = h = g, S = rs(K);
- }
- function xr() {
- return S === 48 ? (u = h + 1, S = 30) : S;
- }
- function zn() {
- return S === 81 ? (u = h + 1, S = 63) : S;
- }
- function ki() {
- return E.assert(S === 61, "'reScanQuestionToken' should only be called on a '??'"), u = h + 1, S = 58;
- }
- function rs(K = !0) {
- if (g = h = u, u >= d)
- return S = 1;
- let De = X(u);
- if (De === 60)
- return X(u + 1) === 47 ? (u += 2, S = 31) : (u++, S = 30);
- if (De === 123)
- return u++, S = 19;
- let Ve = 0;
- for (; u < d && (De = X(u), De !== 123); ) {
- if (De === 60) {
- if ($E(_, u))
- return u = dw(_, u, V), S = 7;
- break;
- }
- if (De === 62 && V(p.Unexpected_token_Did_you_mean_or_gt, u, 1), De === 125 && V(p.Unexpected_token_Did_you_mean_or_rbrace, u, 1), gu(De) && Ve === 0)
- Ve = -1;
- else {
- if (!K && gu(De) && Ve > 0)
- break;
- Ng(De) || (Ve = u);
- }
- u++;
- }
- return T = _.substring(g, u), Ve === -1 ? 13 : 12;
- }
- function ei() {
- if (c_(S)) {
- for (; u < d; ) {
- if (X(u) === 45) {
- T += "-", u++;
- continue;
- }
- const De = u;
- if (T += me(), u === De)
- break;
- }
- return ve();
- }
- return S;
- }
- function Ri() {
- switch (g = u, X(u)) {
- case 34:
- case 39:
- return T = Se(
- /*jsxAttributeString*/
- !0
- ), S = 11;
- default:
- return we();
- }
- }
- function Jr() {
- return u = h = g, Ri();
- }
- function ji(K) {
- if (g = h = u, C = 0, u >= d)
- return S = 1;
- for (let De = X(u); u < d && !gu(De) && De !== 96; De = B(++u))
- if (!K) {
- if (De === 123)
- break;
- if (De === 64 && u - 1 >= 0 && sm(X(u - 1)) && !(u + 1 < d && Ng(X(u + 1))))
- break;
- }
- return u === h ? Fe() : (T = _.substring(h, u), S = 82);
- }
- function Fe() {
- if (g = h = u, C = 0, u >= d)
- return S = 1;
- const K = B(u);
- switch (u += Td(K), K) {
- case 9:
- case 11:
- case 12:
- case 32:
- for (; u < d && sm(X(u)); )
- u++;
- return S = 5;
- case 64:
- return S = 60;
- case 13:
- X(u) === 10 && u++;
- case 10:
- return C |= 1, S = 4;
- case 42:
- return S = 42;
- case 123:
- return S = 19;
- case 125:
- return S = 20;
- case 91:
- return S = 23;
- case 93:
- return S = 24;
- case 40:
- return S = 21;
- case 41:
- return S = 22;
- case 60:
- return S = 30;
- case 62:
- return S = 32;
- case 61:
- return S = 64;
- case 44:
- return S = 28;
- case 46:
- return S = 25;
- case 96:
- return S = 62;
- case 35:
- return S = 63;
- case 92:
- u--;
- const De = le();
- if (De >= 0 && eg(De, e))
- return T = _e(
- /*shouldEmitInvalidEscapeError*/
- !0
- ) + me(), S = ve();
- const Ve = he();
- return Ve >= 0 && eg(Ve, e) ? (u += 6, C |= 1024, T = String.fromCharCode(Ve) + me(), S = ve()) : (u++, S = 0);
- }
- if (eg(K, e)) {
- let De = K;
- for (; u < d && Th(De = B(u), e) || De === 45; ) u += Td(De);
- return T = _.substring(h, u), De === 92 && (T += me()), S = ve();
- } else
- return S = 0;
- }
- function Ot(K, De) {
- const Ve = u, Ke = g, xe = h, at = S, $e = T, bt = C, He = K();
- return (!He || De) && (u = Ve, g = Ke, h = xe, S = at, T = $e, C = bt), He;
- }
- function Ar(K, De, Ve) {
- const Ke = d, xe = u, at = g, $e = h, bt = S, He = T, Vt = C, Zt = D;
- Ws(_, K, De);
- const vn = Ve();
- return d = Ke, u = xe, g = at, h = $e, S = bt, T = He, C = Vt, D = Zt, vn;
- }
- function mn(K) {
- return Ot(
- K,
- /*isLookahead*/
- !0
- );
- }
- function ti(K) {
- return Ot(
- K,
- /*isLookahead*/
- !1
- );
- }
- function qn() {
- return _;
- }
- function Oi() {
- D = void 0;
- }
- function Ws(K, De, Ve) {
- _ = K || "", d = Ve === void 0 ? _.length : De + Ve, te(De || 0);
- }
- function Hs(K) {
- s = K;
- }
- function rr(K) {
- e = K;
- }
- function Ea(K) {
- n = K;
- }
- function Xe(K) {
- I = K;
- }
- function Tt(K) {
- F = K;
- }
- function te(K) {
- E.assert(K >= 0), u = K, g = K, h = K, S = 0, T = void 0, C = 0;
- }
- function ze(K) {
- P += K ? 1 : -1;
- }
- }
- function XE(e, t) {
- return e.codePointAt(t);
- }
- function Td(e) {
- return e >= 65536 ? 2 : e === -1 ? 0 : 1;
- }
- function M5e(e) {
- if (E.assert(0 <= e && e <= 1114111), e <= 65535)
- return String.fromCharCode(e);
- const t = Math.floor((e - 65536) / 1024) + 55296, n = (e - 65536) % 1024 + 56320;
- return String.fromCharCode(t, n);
- }
- var R5e = String.fromCodePoint ? (e) => String.fromCodePoint(e) : M5e;
- function QE(e) {
- return R5e(e);
- }
- var Yme = new Map(Object.entries({
- General_Category: "General_Category",
- gc: "General_Category",
- Script: "Script",
- sc: "Script",
- Script_Extensions: "Script_Extensions",
- scx: "Script_Extensions"
- })), Zme = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", "Case_Ignorable", "CI", "Cased", "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", "Diacritic", "Dia", "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", "Extended_Pictographic", "ExtPict", "Extender", "Ext", "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", "Hex_Digit", "Hex", "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", "ID_Continue", "IDC", "ID_Start", "IDS", "Ideographic", "Ideo", "Join_Control", "Join_C", "Logical_Order_Exception", "LOE", "Lowercase", "Lower", "Math", "Noncharacter_Code_Point", "NChar", "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", "Quotation_Mark", "QMark", "Radical", "Regional_Indicator", "RI", "Sentence_Terminal", "STerm", "Soft_Dotted", "SD", "Terminal_Punctuation", "Term", "Unified_Ideograph", "UIdeo", "Uppercase", "Upper", "Variation_Selector", "VS", "White_Space", "space", "XID_Continue", "XIDC", "XID_Start", "XIDS"]), Kme = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]), hw = {
- General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]),
- Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]),
- Script_Extensions: void 0
- };
- hw.Script_Extensions = hw.Script;
- function Sl(e) {
- return If(e) || H_(e);
- }
- function sC(e) {
- return IE(e, R4, o5);
- }
- function yw(e) {
- switch (pa(e)) {
- case 99:
- return "lib.esnext.full.d.ts";
- case 10:
- return "lib.es2023.full.d.ts";
- case 9:
- return "lib.es2022.full.d.ts";
- case 8:
- return "lib.es2021.full.d.ts";
- case 7:
- return "lib.es2020.full.d.ts";
- case 6:
- return "lib.es2019.full.d.ts";
- case 5:
- return "lib.es2018.full.d.ts";
- case 4:
- return "lib.es2017.full.d.ts";
- case 3:
- return "lib.es2016.full.d.ts";
- case 2:
- return "lib.es6.d.ts";
- default:
- return "lib.d.ts";
- }
- }
- function ec(e) {
- return e.start + e.length;
- }
- function iY(e) {
- return e.length === 0;
- }
- function sj(e, t) {
- return t >= e.start && t < ec(e);
- }
- function vw(e, t) {
- return t >= e.pos && t <= e.end;
- }
- function sY(e, t) {
- return t.start >= e.start && ec(t) <= ec(e);
- }
- function aj(e, t) {
- return t.pos >= e.start && t.end <= ec(e);
- }
- function aY(e, t) {
- return t.start >= e.pos && ec(t) <= e.end;
- }
- function ege(e, t) {
- return oY(e, t) !== void 0;
- }
- function oY(e, t) {
- const n = _Y(e, t);
- return n && n.length === 0 ? void 0 : n;
- }
- function cY(e, t) {
- return Sw(e.start, e.length, t.start, t.length);
- }
- function bw(e, t, n) {
- return Sw(e.start, e.length, t, n);
- }
- function Sw(e, t, n, i) {
- const s = e + t, o = n + i;
- return n <= s && o >= e;
- }
- function lY(e, t) {
- return t <= ec(e) && t >= e.start;
- }
- function uY(e, t) {
- return bw(t, e.pos, e.end - e.pos);
- }
- function _Y(e, t) {
- const n = Math.max(e.start, t.start), i = Math.min(ec(e), ec(t));
- return n <= i ? kc(n, i) : void 0;
- }
- function oj(e) {
- e = e.filter((i) => i.length > 0).sort((i, s) => i.start !== s.start ? i.start - s.start : i.length - s.length);
- const t = [];
- let n = 0;
- for (; n < e.length; ) {
- let i = e[n], s = n + 1;
- for (; s < e.length && cY(i, e[s]); ) {
- const o = Math.min(i.start, e[s].start), c = Math.max(ec(i), ec(e[s]));
- i = kc(o, c), s++;
- }
- n = s, t.push(i);
- }
- return t;
- }
- function Ul(e, t) {
- if (e < 0)
- throw new Error("start < 0");
- if (t < 0)
- throw new Error("length < 0");
- return { start: e, length: t };
- }
- function kc(e, t) {
- return Ul(e, t - e);
- }
- function YE(e) {
- return Ul(e.span.start, e.newLength);
- }
- function fY(e) {
- return iY(e.span) && e.newLength === 0;
- }
- function Tw(e, t) {
- if (t < 0)
- throw new Error("newLength < 0");
- return { span: e, newLength: t };
- }
- var OI = Tw(Ul(0, 0), 0);
- function pY(e) {
- if (e.length === 0)
- return OI;
- if (e.length === 1)
- return e[0];
- const t = e[0];
- let n = t.span.start, i = ec(t.span), s = n + t.newLength;
- for (let o = 1; o < e.length; o++) {
- const c = e[o], _ = n, u = i, d = s, g = c.span.start, h = ec(c.span), S = g + c.newLength;
- n = Math.min(_, g), i = Math.max(u, u + (h - d)), s = Math.max(S, S + (d - h));
- }
- return Tw(
- kc(n, i),
- /*newLength*/
- s - n
- );
- }
- function tge(e) {
- if (e && e.kind === 168) {
- for (let t = e; t; t = t.parent)
- if (ys(t) || Zn(t) || t.kind === 264)
- return t;
- }
- }
- function G_(e, t) {
- return Ii(e) && Gn(
- e,
- 31
- /* ParameterPropertyModifier */
- ) && t.kind === 176;
- }
- function dY(e) {
- return As(e) ? Mi(e.elements, mY) : !1;
- }
- function mY(e) {
- return ml(e) ? !0 : dY(e.name);
- }
- function JT(e) {
- let t = e.parent;
- for (; va(t.parent); )
- t = t.parent.parent;
- return t.parent;
- }
- function gY(e, t) {
- va(e) && (e = JT(e));
- let n = t(e);
- return e.kind === 260 && (e = e.parent), e && e.kind === 261 && (n |= t(e), e = e.parent), e && e.kind === 243 && (n |= t(e)), n;
- }
- function U1(e) {
- return gY(e, Mu);
- }
- function cj(e) {
- return gY(e, mK);
- }
- function xh(e) {
- return gY(e, j5e);
- }
- function j5e(e) {
- return e.flags;
- }
- var hY = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
- function lj(e, t, n) {
- const i = e.toLowerCase(), s = /^([a-z]+)(?:[_-]([a-z]+))?$/.exec(i);
- if (!s) {
- n && n.push(Go(p.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp"));
- return;
- }
- const o = s[1], c = s[2];
- ss(hY, i) && !_(o, c, n) && _(
- o,
- /*territory*/
- void 0,
- n
- ), kX(e);
- function _(u, d, g) {
- const h = Os(t.getExecutingFilePath()), S = Xn(h);
- let T = Bn(S, u);
- if (d && (T = T + "-" + d), T = t.resolvePath(Bn(T, "diagnosticMessages.generated.json")), !t.fileExists(T))
- return !1;
- let C = "";
- try {
- C = t.readFile(T);
- } catch {
- return g && g.push(Go(p.Unable_to_open_file_0, T)), !1;
- }
- try {
- FK(JSON.parse(C));
- } catch {
- return g && g.push(Go(p.Corrupted_locale_file_0, T)), !1;
- }
- return !0;
- }
- }
- function Ho(e, t) {
- if (e)
- for (; e.original !== void 0; )
- e = e.original;
- return !e || !t || t(e) ? e : void 0;
- }
- function or(e, t) {
- for (; e; ) {
- const n = t(e);
- if (n === "quit")
- return;
- if (n)
- return e;
- e = e.parent;
- }
- }
- function ZE(e) {
- return (e.flags & 16) === 0;
- }
- function fs(e, t) {
- if (e === void 0 || ZE(e))
- return e;
- for (e = e.original; e; ) {
- if (ZE(e))
- return !t || t(e) ? e : void 0;
- e = e.original;
- }
- }
- function tc(e) {
- return e.length >= 2 && e.charCodeAt(0) === 95 && e.charCodeAt(1) === 95 ? "_" + e : e;
- }
- function Ei(e) {
- const t = e;
- return t.length >= 3 && t.charCodeAt(0) === 95 && t.charCodeAt(1) === 95 && t.charCodeAt(2) === 95 ? t.substr(1) : t;
- }
- function Nn(e) {
- return Ei(e.escapedText);
- }
- function G2(e) {
- const t = H2(e.escapedText);
- return t ? Wn(t, p_) : void 0;
- }
- function mc(e) {
- return e.valueDeclaration && Ou(e.valueDeclaration) ? Nn(e.valueDeclaration.name) : Ei(e.escapedName);
- }
- function rge(e) {
- const t = e.parent.parent;
- if (t) {
- if (ql(t))
- return uj(t);
- switch (t.kind) {
- case 243:
- if (t.declarationList && t.declarationList.declarations[0])
- return uj(t.declarationList.declarations[0]);
- break;
- case 244:
- let n = t.expression;
- switch (n.kind === 226 && n.operatorToken.kind === 64 && (n = n.left), n.kind) {
- case 211:
- return n.name;
- case 212:
- const i = n.argumentExpression;
- if (Oe(i))
- return i;
- }
- break;
- case 217:
- return uj(t.expression);
- case 256: {
- if (ql(t.statement) || _t(t.statement))
- return uj(t.statement);
- break;
- }
- }
- }
- }
- function uj(e) {
- const t = os(e);
- return t && Oe(t) ? t : void 0;
- }
- function xw(e, t) {
- return !!(Vl(e) && Oe(e.name) && Nn(e.name) === Nn(t) || yc(e) && ut(e.declarationList.declarations, (n) => xw(n, t)));
- }
- function yY(e) {
- return e.name || rge(e);
- }
- function Vl(e) {
- return !!e.name;
- }
- function FI(e) {
- switch (e.kind) {
- case 80:
- return e;
- case 348:
- case 341: {
- const { name: n } = e;
- if (n.kind === 166)
- return n.right;
- break;
- }
- case 213:
- case 226: {
- const n = e;
- switch (Cc(n)) {
- case 1:
- case 4:
- case 5:
- case 3:
- return N7(n.left);
- case 7:
- case 8:
- case 9:
- return n.arguments[1];
- default:
- return;
- }
- }
- case 346:
- return yY(e);
- case 340:
- return rge(e);
- case 277: {
- const { expression: n } = e;
- return Oe(n) ? n : void 0;
- }
- case 212:
- const t = e;
- if (A7(t))
- return t.argumentExpression;
- }
- return e.name;
- }
- function os(e) {
- if (e !== void 0)
- return FI(e) || (vo(e) || Co(e) || $c(e) ? LI(e) : void 0);
- }
- function LI(e) {
- if (e.parent) {
- if (Qc(e.parent) || va(e.parent))
- return e.parent.name;
- if (dn(e.parent) && e === e.parent.right) {
- if (Oe(e.parent.left))
- return e.parent.left;
- if (xo(e.parent.left))
- return N7(e.parent.left);
- } else if (ii(e.parent) && Oe(e.parent.name))
- return e.parent.name;
- } else return;
- }
- function Cy(e) {
- if (Ff(e))
- return Ln(e.modifiers, dl);
- }
- function fb(e) {
- if (Gn(
- e,
- 98303
- /* Modifier */
- ))
- return Ln(e.modifiers, ra);
- }
- function nge(e, t) {
- if (e.name)
- if (Oe(e.name)) {
- const n = e.name.escapedText;
- return RI(e.parent, t).filter((i) => dp(i) && Oe(i.name) && i.name.escapedText === n);
- } else {
- const n = e.parent.parameters.indexOf(e);
- E.assert(n > -1, "Parameters should always be in their parents' parameter list");
- const i = RI(e.parent, t).filter(dp);
- if (n < i.length)
- return [i[n]];
- }
- return Ue;
- }
- function aC(e) {
- return nge(
- e,
- /*noCache*/
- !1
- );
- }
- function vY(e) {
- return nge(
- e,
- /*noCache*/
- !0
- );
- }
- function ige(e, t) {
- const n = e.name.escapedText;
- return RI(e.parent, t).filter((i) => qp(i) && i.typeParameters.some((s) => s.name.escapedText === n));
- }
- function bY(e) {
- return ige(
- e,
- /*noCache*/
- !1
- );
- }
- function SY(e) {
- return ige(
- e,
- /*noCache*/
- !0
- );
- }
- function TY(e) {
- return !!Lp(e, dp);
- }
- function xY(e) {
- return Lp(e, Mx);
- }
- function kY(e) {
- return jI(e, iO);
- }
- function _j(e) {
- return Lp(e, ste);
- }
- function sge(e) {
- return Lp(e, zJ);
- }
- function CY(e) {
- return Lp(
- e,
- zJ,
- /*noCache*/
- !0
- );
- }
- function age(e) {
- return Lp(e, WJ);
- }
- function EY(e) {
- return Lp(
- e,
- WJ,
- /*noCache*/
- !0
- );
- }
- function oge(e) {
- return Lp(e, UJ);
- }
- function DY(e) {
- return Lp(
- e,
- UJ,
- /*noCache*/
- !0
- );
- }
- function cge(e) {
- return Lp(e, VJ);
- }
- function PY(e) {
- return Lp(
- e,
- VJ,
- /*noCache*/
- !0
- );
- }
- function wY(e) {
- return Lp(
- e,
- rO,
- /*noCache*/
- !0
- );
- }
- function fj(e) {
- return Lp(e, qJ);
- }
- function AY(e) {
- return Lp(
- e,
- qJ,
- /*noCache*/
- !0
- );
- }
- function pj(e) {
- return Lp(e, sA);
- }
- function MI(e) {
- return Lp(e, HJ);
- }
- function NY(e) {
- return Lp(e, nO);
- }
- function lge(e) {
- return Lp(e, qp);
- }
- function dj(e) {
- return Lp(e, sO);
- }
- function V1(e) {
- const t = Lp(e, fD);
- if (t && t.typeExpression && t.typeExpression.type)
- return t;
- }
- function q1(e) {
- let t = Lp(e, fD);
- return !t && Ii(e) && (t = On(aC(e), (n) => !!n.typeExpression)), t && t.typeExpression && t.typeExpression.type;
- }
- function kw(e) {
- const t = NY(e);
- if (t && t.typeExpression)
- return t.typeExpression.type;
- const n = V1(e);
- if (n && n.typeExpression) {
- const i = n.typeExpression.type;
- if (Qu(i)) {
- const s = On(i.members, Dx);
- return s && s.type;
- }
- if (lg(i) || YC(i))
- return i.type;
- }
- }
- function RI(e, t) {
- var n;
- if (!p3(e)) return Ue;
- let i = (n = e.jsDoc) == null ? void 0 : n.jsDocCache;
- if (i === void 0 || t) {
- const s = cB(e, t);
- E.assert(s.length < 2 || s[0] !== s[1]), i = ta(s, (o) => Id(o) ? o.tags : o), t || (e.jsDoc ?? (e.jsDoc = []), e.jsDoc.jsDocCache = i);
- }
- return i;
- }
- function H1(e) {
- return RI(
- e,
- /*noCache*/
- !1
- );
- }
- function Lp(e, t, n) {
- return On(RI(e, n), t);
- }
- function jI(e, t) {
- return H1(e).filter(t);
- }
- function uge(e, t) {
- return H1(e).filter((n) => n.kind === t);
- }
- function Cw(e) {
- return typeof e == "string" ? e : e?.map((t) => t.kind === 321 ? t.text : B5e(t)).join("");
- }
- function B5e(e) {
- const t = e.kind === 324 ? "link" : e.kind === 325 ? "linkcode" : "linkplain", n = e.name ? $_(e.name) : "", i = e.name && (e.text === "" || e.text.startsWith("://")) ? "" : " ";
- return `{@${t} ${n}${i}${e.text}}`;
- }
- function Ey(e) {
- if (Lh(e)) {
- if (ZC(e.parent)) {
- const t = EC(e.parent);
- if (t && Nr(t.tags))
- return ta(t.tags, (n) => qp(n) ? n.typeParameters : void 0);
- }
- return Ue;
- }
- if (Bp(e))
- return E.assert(
- e.parent.kind === 320
- /* JSDoc */
- ), ta(e.parent.tags, (t) => qp(t) ? t.typeParameters : void 0);
- if (e.typeParameters || hte(e) && e.typeParameters)
- return e.typeParameters;
- if (cn(e)) {
- const t = G7(e);
- if (t.length)
- return t;
- const n = q1(e);
- if (n && lg(n) && n.typeParameters)
- return n.typeParameters;
- }
- return Ue;
- }
- function oC(e) {
- return e.constraint ? e.constraint : qp(e.parent) && e === e.parent.typeParameters[0] ? e.parent.constraint : void 0;
- }
- function Fg(e) {
- return e.kind === 80 || e.kind === 81;
- }
- function Ew(e) {
- return e.kind === 178 || e.kind === 177;
- }
- function BI(e) {
- return Cn(e) && !!(e.flags & 64);
- }
- function mj(e) {
- return ko(e) && !!(e.flags & 64);
- }
- function $2(e) {
- return Fs(e) && !!(e.flags & 64);
- }
- function hu(e) {
- const t = e.kind;
- return !!(e.flags & 64) && (t === 211 || t === 212 || t === 213 || t === 235);
- }
- function KE(e) {
- return hu(e) && !Ox(e) && !!e.questionDotToken;
- }
- function JI(e) {
- return KE(e.parent) && e.parent.expression === e;
- }
- function e4(e) {
- return !hu(e.parent) || KE(e.parent) || e !== e.parent.expression;
- }
- function gj(e) {
- return e.kind === 226 && e.operatorToken.kind === 61;
- }
- function xd(e) {
- return vf(e) && Oe(e.typeName) && e.typeName.escapedText === "const" && !e.typeArguments;
- }
- function ud(e) {
- return Dc(
- e,
- 8
- /* PartiallyEmittedExpressions */
- );
- }
- function zI(e) {
- return Ox(e) && !!(e.flags & 64);
- }
- function t4(e) {
- return e.kind === 252 || e.kind === 251;
- }
- function hj(e) {
- return e.kind === 280 || e.kind === 279;
- }
- function r4(e) {
- return e.kind === 348 || e.kind === 341;
- }
- function WI(e) {
- return e >= 166;
- }
- function yj(e) {
- return e >= 0 && e <= 165;
- }
- function zT(e) {
- return yj(e.kind);
- }
- function pb(e) {
- return co(e, "pos") && co(e, "end");
- }
- function n4(e) {
- return 9 <= e && e <= 15;
- }
- function X2(e) {
- return n4(e.kind);
- }
- function vj(e) {
- switch (e.kind) {
- case 210:
- case 209:
- case 14:
- case 218:
- case 231:
- return !0;
- }
- return !1;
- }
- function Dy(e) {
- return 15 <= e && e <= 18;
- }
- function IY(e) {
- return Dy(e.kind);
- }
- function UI(e) {
- const t = e.kind;
- return t === 17 || t === 18;
- }
- function G1(e) {
- return Zu(e) || vu(e);
- }
- function i4(e) {
- switch (e.kind) {
- case 276:
- return e.isTypeOnly || e.parent.parent.isTypeOnly;
- case 274:
- return e.parent.isTypeOnly;
- case 273:
- case 271:
- return e.isTypeOnly;
- }
- return !1;
- }
- function OY(e) {
- switch (e.kind) {
- case 281:
- return e.isTypeOnly || e.parent.parent.isTypeOnly;
- case 278:
- return e.isTypeOnly && !!e.moduleSpecifier && !e.exportClause;
- case 280:
- return e.parent.isTypeOnly;
- }
- return !1;
- }
- function Py(e) {
- return i4(e) || OY(e);
- }
- function bj(e) {
- return e.kind === 11 || Dy(e.kind);
- }
- function FY(e) {
- return oa(e) || Oe(e);
- }
- function jo(e) {
- var t;
- return Oe(e) && ((t = e.emitNode) == null ? void 0 : t.autoGenerate) !== void 0;
- }
- function Q2(e) {
- var t;
- return Di(e) && ((t = e.emitNode) == null ? void 0 : t.autoGenerate) !== void 0;
- }
- function Dw(e) {
- const t = e.emitNode.autoGenerate.flags;
- return !!(t & 32) && !!(t & 16) && !!(t & 8);
- }
- function Ou(e) {
- return (cs(e) || UT(e)) && Di(e.name);
- }
- function cC(e) {
- return Cn(e) && Di(e.name);
- }
- function wy(e) {
- switch (e) {
- case 128:
- case 129:
- case 134:
- case 87:
- case 138:
- case 90:
- case 95:
- case 103:
- case 125:
- case 123:
- case 124:
- case 148:
- case 126:
- case 147:
- case 164:
- return !0;
- }
- return !1;
- }
- function s4(e) {
- return !!(cx(e) & 31);
- }
- function Sj(e) {
- return s4(e) || e === 126 || e === 164 || e === 129;
- }
- function ra(e) {
- return wy(e.kind);
- }
- function l_(e) {
- const t = e.kind;
- return t === 166 || t === 80;
- }
- function Bc(e) {
- const t = e.kind;
- return t === 80 || t === 81 || t === 11 || t === 9 || t === 167;
- }
- function Y2(e) {
- const t = e.kind;
- return t === 80 || t === 206 || t === 207;
- }
- function ys(e) {
- return !!e && WT(e.kind);
- }
- function lC(e) {
- return !!e && (WT(e.kind) || oc(e));
- }
- function no(e) {
- return e && _ge(e.kind);
- }
- function a4(e) {
- return e.kind === 112 || e.kind === 97;
- }
- function _ge(e) {
- switch (e) {
- case 262:
- case 174:
- case 176:
- case 177:
- case 178:
- case 218:
- case 219:
- return !0;
- default:
- return !1;
- }
- }
- function WT(e) {
- switch (e) {
- case 173:
- case 179:
- case 323:
- case 180:
- case 181:
- case 184:
- case 317:
- case 185:
- return !0;
- default:
- return _ge(e);
- }
- }
- function Tj(e) {
- return Si(e) || Sm(e) || Cs(e) && ys(e.parent);
- }
- function _l(e) {
- const t = e.kind;
- return t === 176 || t === 172 || t === 174 || t === 177 || t === 178 || t === 181 || t === 175 || t === 240;
- }
- function Zn(e) {
- return e && (e.kind === 263 || e.kind === 231);
- }
- function Ay(e) {
- return e && (e.kind === 177 || e.kind === 178);
- }
- function u_(e) {
- return cs(e) && dm(e);
- }
- function LY(e) {
- return cn(e) && vx(e) ? (!Tb(e) || !Ry(e.expression)) && !aS(
- e,
- /*excludeThisKeyword*/
- !0
- ) : e.parent && Zn(e.parent) && cs(e) && !dm(e);
- }
- function UT(e) {
- switch (e.kind) {
- case 174:
- case 177:
- case 178:
- return !0;
- default:
- return !1;
- }
- }
- function Bo(e) {
- return ra(e) || dl(e);
- }
- function db(e) {
- const t = e.kind;
- return t === 180 || t === 179 || t === 171 || t === 173 || t === 181 || t === 177 || t === 178;
- }
- function VI(e) {
- return db(e) || _l(e);
- }
- function kh(e) {
- const t = e.kind;
- return t === 303 || t === 304 || t === 305 || t === 174 || t === 177 || t === 178;
- }
- function fi(e) {
- return HB(e.kind);
- }
- function MY(e) {
- switch (e.kind) {
- case 184:
- case 185:
- return !0;
- }
- return !1;
- }
- function As(e) {
- if (e) {
- const t = e.kind;
- return t === 207 || t === 206;
- }
- return !1;
- }
- function o4(e) {
- const t = e.kind;
- return t === 209 || t === 210;
- }
- function qI(e) {
- const t = e.kind;
- return t === 208 || t === 232;
- }
- function Pw(e) {
- switch (e.kind) {
- case 260:
- case 169:
- case 208:
- return !0;
- }
- return !1;
- }
- function RY(e) {
- return ii(e) || Ii(e) || Aw(e) || Nw(e);
- }
- function ww(e) {
- return xj(e) || kj(e);
- }
- function xj(e) {
- switch (e.kind) {
- case 206:
- case 210:
- return !0;
- }
- return !1;
- }
- function Aw(e) {
- switch (e.kind) {
- case 208:
- case 303:
- case 304:
- case 305:
- return !0;
- }
- return !1;
- }
- function kj(e) {
- switch (e.kind) {
- case 207:
- case 209:
- return !0;
- }
- return !1;
- }
- function Nw(e) {
- switch (e.kind) {
- case 208:
- case 232:
- case 230:
- case 209:
- case 210:
- case 80:
- case 211:
- case 212:
- return !0;
- }
- return Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- );
- }
- function jY(e) {
- const t = e.kind;
- return t === 211 || t === 166 || t === 205;
- }
- function Iw(e) {
- const t = e.kind;
- return t === 211 || t === 166;
- }
- function Cj(e) {
- return mb(e) || Wy(e);
- }
- function mb(e) {
- switch (e.kind) {
- case 286:
- case 285:
- case 213:
- case 214:
- case 215:
- case 170:
- return !0;
- default:
- return !1;
- }
- }
- function am(e) {
- return e.kind === 213 || e.kind === 214;
- }
- function VT(e) {
- const t = e.kind;
- return t === 228 || t === 15;
- }
- function __(e) {
- return fge(ud(e).kind);
- }
- function fge(e) {
- switch (e) {
- case 211:
- case 212:
- case 214:
- case 213:
- case 284:
- case 285:
- case 288:
- case 215:
- case 209:
- case 217:
- case 210:
- case 231:
- case 218:
- case 80:
- case 81:
- case 14:
- case 9:
- case 10:
- case 11:
- case 15:
- case 228:
- case 97:
- case 106:
- case 110:
- case 112:
- case 108:
- case 235:
- case 233:
- case 236:
- case 102:
- case 282:
- return !0;
- default:
- return !1;
- }
- }
- function Ej(e) {
- return pge(ud(e).kind);
- }
- function pge(e) {
- switch (e) {
- case 224:
- case 225:
- case 220:
- case 221:
- case 222:
- case 223:
- case 216:
- return !0;
- default:
- return fge(e);
- }
- }
- function BY(e) {
- switch (e.kind) {
- case 225:
- return !0;
- case 224:
- return e.operator === 46 || e.operator === 47;
- default:
- return !1;
- }
- }
- function JY(e) {
- switch (e.kind) {
- case 106:
- case 112:
- case 97:
- case 224:
- return !0;
- default:
- return X2(e);
- }
- }
- function _t(e) {
- return J5e(ud(e).kind);
- }
- function J5e(e) {
- switch (e) {
- case 227:
- case 229:
- case 219:
- case 226:
- case 230:
- case 234:
- case 232:
- case 355:
- case 354:
- case 238:
- return !0;
- default:
- return pge(e);
- }
- }
- function $1(e) {
- const t = e.kind;
- return t === 216 || t === 234;
- }
- function Ny(e, t) {
- switch (e.kind) {
- case 248:
- case 249:
- case 250:
- case 246:
- case 247:
- return !0;
- case 256:
- return t && Ny(e.statement, t);
- }
- return !1;
- }
- function z5e(e) {
- return wo(e) || Nc(e);
- }
- function zY(e) {
- return ut(e, z5e);
- }
- function HI(e) {
- return !zw(e) && !wo(e) && !Gn(
- e,
- 32
- /* Export */
- ) && !Fu(e);
- }
- function Ow(e) {
- return zw(e) || wo(e) || Gn(
- e,
- 32
- /* Export */
- );
- }
- function Z2(e) {
- return e.kind === 249 || e.kind === 250;
- }
- function GI(e) {
- return Cs(e) || _t(e);
- }
- function Dj(e) {
- return Cs(e);
- }
- function ip(e) {
- return Fl(e) || _t(e);
- }
- function WY(e) {
- const t = e.kind;
- return t === 268 || t === 267 || t === 80;
- }
- function dge(e) {
- const t = e.kind;
- return t === 268 || t === 267;
- }
- function mge(e) {
- const t = e.kind;
- return t === 80 || t === 267;
- }
- function Pj(e) {
- const t = e.kind;
- return t === 275 || t === 274;
- }
- function Fw(e) {
- return e.kind === 267 || e.kind === 266;
- }
- function kd(e) {
- switch (e.kind) {
- case 219:
- case 226:
- case 208:
- case 213:
- case 179:
- case 263:
- case 231:
- case 175:
- case 176:
- case 185:
- case 180:
- case 212:
- case 266:
- case 306:
- case 277:
- case 278:
- case 281:
- case 262:
- case 218:
- case 184:
- case 177:
- case 80:
- case 273:
- case 271:
- case 276:
- case 181:
- case 264:
- case 338:
- case 340:
- case 317:
- case 341:
- case 348:
- case 323:
- case 346:
- case 322:
- case 291:
- case 292:
- case 293:
- case 200:
- case 174:
- case 173:
- case 267:
- case 202:
- case 280:
- case 270:
- case 274:
- case 214:
- case 15:
- case 9:
- case 210:
- case 169:
- case 211:
- case 303:
- case 172:
- case 171:
- case 178:
- case 304:
- case 307:
- case 305:
- case 11:
- case 265:
- case 187:
- case 168:
- case 260:
- return !0;
- default:
- return !1;
- }
- }
- function tg(e) {
- switch (e.kind) {
- case 219:
- case 241:
- case 179:
- case 269:
- case 299:
- case 175:
- case 194:
- case 176:
- case 185:
- case 180:
- case 248:
- case 249:
- case 250:
- case 262:
- case 218:
- case 184:
- case 177:
- case 181:
- case 338:
- case 340:
- case 317:
- case 323:
- case 346:
- case 200:
- case 174:
- case 173:
- case 267:
- case 178:
- case 307:
- case 265:
- return !0;
- default:
- return !1;
- }
- }
- function W5e(e) {
- return e === 219 || e === 208 || e === 263 || e === 231 || e === 175 || e === 176 || e === 266 || e === 306 || e === 281 || e === 262 || e === 218 || e === 177 || e === 273 || e === 271 || e === 276 || e === 264 || e === 291 || e === 174 || e === 173 || e === 267 || e === 270 || e === 274 || e === 280 || e === 169 || e === 303 || e === 172 || e === 171 || e === 178 || e === 304 || e === 265 || e === 168 || e === 260 || e === 346 || e === 338 || e === 348 || e === 202;
- }
- function UY(e) {
- return e === 262 || e === 282 || e === 263 || e === 264 || e === 265 || e === 266 || e === 267 || e === 272 || e === 271 || e === 278 || e === 277 || e === 270;
- }
- function VY(e) {
- return e === 252 || e === 251 || e === 259 || e === 246 || e === 244 || e === 242 || e === 249 || e === 250 || e === 248 || e === 245 || e === 256 || e === 253 || e === 255 || e === 257 || e === 258 || e === 243 || e === 247 || e === 254 || e === 353;
- }
- function ql(e) {
- return e.kind === 168 ? e.parent && e.parent.kind !== 345 || cn(e) : W5e(e.kind);
- }
- function qY(e) {
- return UY(e.kind);
- }
- function Lw(e) {
- return VY(e.kind);
- }
- function bi(e) {
- const t = e.kind;
- return VY(t) || UY(t) || U5e(e);
- }
- function U5e(e) {
- return e.kind !== 241 || e.parent !== void 0 && (e.parent.kind === 258 || e.parent.kind === 299) ? !1 : !vb(e);
- }
- function HY(e) {
- const t = e.kind;
- return VY(t) || UY(t) || t === 241;
- }
- function GY(e) {
- const t = e.kind;
- return t === 283 || t === 166 || t === 80;
- }
- function c4(e) {
- const t = e.kind;
- return t === 110 || t === 80 || t === 211 || t === 295;
- }
- function Mw(e) {
- const t = e.kind;
- return t === 284 || t === 294 || t === 285 || t === 12 || t === 288;
- }
- function $I(e) {
- const t = e.kind;
- return t === 291 || t === 293;
- }
- function $Y(e) {
- const t = e.kind;
- return t === 11 || t === 294;
- }
- function ou(e) {
- const t = e.kind;
- return t === 286 || t === 285;
- }
- function XI(e) {
- const t = e.kind;
- return t === 296 || t === 297;
- }
- function uC(e) {
- return e.kind >= 309 && e.kind <= 351;
- }
- function QI(e) {
- return e.kind === 320 || e.kind === 319 || e.kind === 321 || qT(e) || _C(e) || bS(e) || Lh(e);
- }
- function _C(e) {
- return e.kind >= 327 && e.kind <= 351;
- }
- function om(e) {
- return e.kind === 178;
- }
- function d0(e) {
- return e.kind === 177;
- }
- function gf(e) {
- if (!p3(e)) return !1;
- const { jsDoc: t } = e;
- return !!t && t.length > 0;
- }
- function YI(e) {
- return !!e.type;
- }
- function m0(e) {
- return !!e.initializer;
- }
- function K2(e) {
- switch (e.kind) {
- case 260:
- case 169:
- case 208:
- case 172:
- case 303:
- case 306:
- return !0;
- default:
- return !1;
- }
- }
- function wj(e) {
- return e.kind === 291 || e.kind === 293 || kh(e);
- }
- function ZI(e) {
- return e.kind === 183 || e.kind === 233;
- }
- var gge = 1073741823;
- function XY(e) {
- let t = gge;
- for (const n of e) {
- if (!n.length)
- continue;
- let i = 0;
- for (; i < n.length && i < t && Ng(n.charCodeAt(i)); i++)
- ;
- if (i < t && (t = i), t === 0)
- return 0;
- }
- return t === gge ? void 0 : t;
- }
- function Xa(e) {
- return e.kind === 11 || e.kind === 15;
- }
- function qT(e) {
- return e.kind === 324 || e.kind === 325 || e.kind === 326;
- }
- function Aj(e) {
- const t = Ro(e.parameters);
- return !!t && rg(t);
- }
- function rg(e) {
- const t = dp(e) ? e.typeExpression && e.typeExpression.type : e.type;
- return e.dotDotDotToken !== void 0 || !!t && t.kind === 318;
- }
- function hge(e, t) {
- return t.text.substring(e.pos, e.end).includes("@internal");
- }
- function QY(e, t) {
- t ?? (t = Tr(e));
- const n = fs(e);
- if (n && n.kind === 169) {
- const s = n.parent.parameters.indexOf(n), o = s > 0 ? n.parent.parameters[s - 1] : void 0, c = t.text, _ = o ? Qi(
- // to handle
- // ... parameters, /** @internal */
- // public param: string
- ky(c, aa(
- c,
- o.end + 1,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- )),
- Ig(c, e.pos)
- ) : ky(c, aa(
- c,
- e.pos,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- ));
- return ut(_) && hge(_a(_), t);
- }
- const i = n && Yj(n, t);
- return !!ir(i, (s) => hge(s, t));
- }
- var Nj = [], X1 = "tslib", l4 = 160, Ij = 1e6;
- function Jo(e, t) {
- const n = e.declarations;
- if (n) {
- for (const i of n)
- if (i.kind === t)
- return i;
- }
- }
- function YY(e, t) {
- return Ln(e.declarations || Ue, (n) => n.kind === t);
- }
- function Js(e) {
- const t = /* @__PURE__ */ new Map();
- if (e)
- for (const n of e)
- t.set(n.escapedName, n);
- return t;
- }
- function Lg(e) {
- return (e.flags & 33554432) !== 0;
- }
- function fC(e) {
- return !!(e.flags & 1536) && e.escapedName.charCodeAt(0) === 34;
- }
- var KI = V5e();
- function V5e() {
- var e = "";
- const t = (n) => e += n;
- return {
- getText: () => e,
- write: t,
- rawWrite: t,
- writeKeyword: t,
- writeOperator: t,
- writePunctuation: t,
- writeSpace: t,
- writeStringLiteral: t,
- writeLiteral: t,
- writeParameter: t,
- writeProperty: t,
- writeSymbol: (n, i) => t(n),
- writeTrailingSemicolon: t,
- writeComment: t,
- getTextPos: () => e.length,
- getLine: () => 0,
- getColumn: () => 0,
- getIndent: () => 0,
- isAtStartOfLine: () => !1,
- hasTrailingComment: () => !1,
- hasTrailingWhitespace: () => !!e.length && Ng(e.charCodeAt(e.length - 1)),
- // Completely ignore indentation for string writers. And map newlines to
- // a single space.
- writeLine: () => e += " ",
- increaseIndent: ja,
- decreaseIndent: ja,
- clear: () => e = ""
- };
- }
- function e7(e, t) {
- return e.configFilePath !== t.configFilePath || q5e(e, t);
- }
- function q5e(e, t) {
- return pC(e, t, mz);
- }
- function ZY(e, t) {
- return pC(e, t, Jte);
- }
- function pC(e, t, n) {
- return e !== t && n.some((i) => !E5(f5(e, i), f5(t, i)));
- }
- function KY(e, t) {
- for (; ; ) {
- const n = t(e);
- if (n === "quit") return;
- if (n !== void 0) return n;
- if (Si(e)) return;
- e = e.parent;
- }
- }
- function El(e, t) {
- const n = e.entries();
- for (const [i, s] of n) {
- const o = t(s, i);
- if (o)
- return o;
- }
- }
- function Ch(e, t) {
- const n = e.keys();
- for (const i of n) {
- const s = t(i);
- if (s)
- return s;
- }
- }
- function t7(e, t) {
- e.forEach((n, i) => {
- t.set(i, n);
- });
- }
- function dC(e) {
- const t = KI.getText();
- try {
- return e(KI), KI.getText();
- } finally {
- KI.clear(), KI.writeKeyword(t);
- }
- }
- function Rw(e) {
- return e.end - e.pos;
- }
- function Oj(e, t) {
- return e.path === t.path && !e.prepend == !t.prepend && !e.circular == !t.circular;
- }
- function eZ(e, t) {
- return e === t || e.resolvedModule === t.resolvedModule || !!e.resolvedModule && !!t.resolvedModule && e.resolvedModule.isExternalLibraryImport === t.resolvedModule.isExternalLibraryImport && e.resolvedModule.extension === t.resolvedModule.extension && e.resolvedModule.resolvedFileName === t.resolvedModule.resolvedFileName && e.resolvedModule.originalPath === t.resolvedModule.originalPath && H5e(e.resolvedModule.packageId, t.resolvedModule.packageId) && e.alternateResult === t.alternateResult;
- }
- function HT(e) {
- return e.resolvedModule;
- }
- function r7(e) {
- return e.resolvedTypeReferenceDirective;
- }
- function n7(e, t, n, i, s) {
- var o;
- const c = (o = t.getResolvedModule(e, n, i)) == null ? void 0 : o.alternateResult, _ = c && (yu(t.getCompilerOptions()) === 2 ? [p.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler, [c]] : [
- p.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
- [c, c.includes(Xg + "@types/") ? `@types/${l6(s)}` : s]
- ]), u = _ ? vs(
- /*details*/
- void 0,
- _[0],
- ..._[1]
- ) : t.typesPackageExists(s) ? vs(
- /*details*/
- void 0,
- p.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
- s,
- l6(s)
- ) : t.packageBundlesTypes(s) ? vs(
- /*details*/
- void 0,
- p.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
- s,
- n
- ) : vs(
- /*details*/
- void 0,
- p.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
- n,
- l6(s)
- );
- return u && (u.repopulateInfo = () => ({ moduleReference: n, mode: i, packageName: s === n ? void 0 : s })), u;
- }
- function Fj(e) {
- const t = Vg(e.fileName), n = e.packageJsonScope, i = t === ".ts" ? ".mts" : t === ".js" ? ".mjs" : void 0, s = n && !n.contents.packageJsonContent.type ? i ? vs(
- /*details*/
- void 0,
- p.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1,
- i,
- Bn(n.packageDirectory, "package.json")
- ) : vs(
- /*details*/
- void 0,
- p.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0,
- Bn(n.packageDirectory, "package.json")
- ) : i ? vs(
- /*details*/
- void 0,
- p.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module,
- i
- ) : vs(
- /*details*/
- void 0,
- p.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module
- );
- return s.repopulateInfo = () => !0, s;
- }
- function H5e(e, t) {
- return e === t || !!e && !!t && e.name === t.name && e.subModuleName === t.subModuleName && e.version === t.version && e.peerDependencies === t.peerDependencies;
- }
- function i7({ name: e, subModuleName: t }) {
- return t ? `${e}/${t}` : e;
- }
- function Q1(e) {
- return `${i7(e)}@${e.version}${e.peerDependencies ?? ""}`;
- }
- function tZ(e, t) {
- return e === t || e.resolvedTypeReferenceDirective === t.resolvedTypeReferenceDirective || !!e.resolvedTypeReferenceDirective && !!t.resolvedTypeReferenceDirective && e.resolvedTypeReferenceDirective.resolvedFileName === t.resolvedTypeReferenceDirective.resolvedFileName && !!e.resolvedTypeReferenceDirective.primary == !!t.resolvedTypeReferenceDirective.primary && e.resolvedTypeReferenceDirective.originalPath === t.resolvedTypeReferenceDirective.originalPath;
- }
- function Lj(e, t, n, i) {
- E.assert(e.length === t.length);
- for (let s = 0; s < e.length; s++) {
- const o = t[s], c = e[s], _ = n(c);
- if (_ ? !o || !i(_, o) : o)
- return !0;
- }
- return !1;
- }
- function GT(e) {
- return G5e(e), (e.flags & 1048576) !== 0;
- }
- function G5e(e) {
- e.flags & 2097152 || ((e.flags & 262144 || bs(e, GT)) && (e.flags |= 1048576), e.flags |= 2097152);
- }
- function Tr(e) {
- for (; e && e.kind !== 307; )
- e = e.parent;
- return e;
- }
- function s7(e) {
- return Tr(e.valueDeclaration || Vj(e));
- }
- function u4(e, t) {
- return !!e && (e.scriptKind === 1 || e.scriptKind === 2) && !e.checkJsDirective && t === void 0;
- }
- function rZ(e) {
- switch (e.kind) {
- case 241:
- case 269:
- case 248:
- case 249:
- case 250:
- return !0;
- }
- return !1;
- }
- function Iy(e, t) {
- return E.assert(e >= 0), Ag(t)[e];
- }
- function yge(e) {
- const t = Tr(e), n = Qs(t, e.pos);
- return `${t.fileName}(${n.line + 1},${n.character + 1})`;
- }
- function jw(e, t) {
- E.assert(e >= 0);
- const n = Ag(t), i = e, s = t.text;
- if (i + 1 === n.length)
- return s.length - 1;
- {
- const o = n[i];
- let c = n[i + 1] - 1;
- for (E.assert(gu(s.charCodeAt(c))); o <= c && gu(s.charCodeAt(c)); )
- c--;
- return c;
- }
- }
- function a7(e, t, n) {
- return !(n && n(t)) && !e.identifiers.has(t);
- }
- function rc(e) {
- return e === void 0 ? !0 : e.pos === e.end && e.pos >= 0 && e.kind !== 1;
- }
- function Mp(e) {
- return !rc(e);
- }
- function nZ(e, t) {
- return zo(e) ? t === e.expression : oc(e) ? t === e.modifiers : m_(e) ? t === e.initializer : cs(e) ? t === e.questionToken && u_(e) : Qc(e) ? t === e.modifiers || t === e.questionToken || t === e.exclamationToken || Bw(e.modifiers, t, Bo) : uu(e) ? t === e.equalsToken || t === e.modifiers || t === e.questionToken || t === e.exclamationToken || Bw(e.modifiers, t, Bo) : hc(e) ? t === e.exclamationToken : Qo(e) ? t === e.typeParameters || t === e.type || Bw(e.typeParameters, t, zo) : Lf(e) ? t === e.typeParameters || Bw(e.typeParameters, t, zo) : K_(e) ? t === e.typeParameters || t === e.type || Bw(e.typeParameters, t, zo) : iA(e) ? t === e.modifiers || Bw(e.modifiers, t, Bo) : !1;
- }
- function Bw(e, t, n) {
- return !e || us(t) || !n(t) ? !1 : ss(e, t);
- }
- function vge(e, t, n) {
- if (t === void 0 || t.length === 0) return e;
- let i = 0;
- for (; i < e.length && n(e[i]); ++i)
- ;
- return e.splice(i, 0, ...t), e;
- }
- function bge(e, t, n) {
- if (t === void 0) return e;
- let i = 0;
- for (; i < e.length && n(e[i]); ++i)
- ;
- return e.splice(i, 0, t), e;
- }
- function Sge(e) {
- return lm(e) || !!(ya(e) & 2097152);
- }
- function Mg(e, t) {
- return vge(e, t, lm);
- }
- function Mj(e, t) {
- return vge(e, t, Sge);
- }
- function Tge(e, t) {
- return bge(e, t, lm);
- }
- function eS(e, t) {
- return bge(e, t, Sge);
- }
- function Rj(e, t, n) {
- if (e.charCodeAt(t + 1) === 47 && t + 2 < n && e.charCodeAt(t + 2) === 47) {
- const i = e.substring(t, n);
- return !!(rOe.test(i) || sOe.test(i) || aOe.test(i) || nOe.test(i) || iOe.test(i) || oOe.test(i));
- }
- return !1;
- }
- function o7(e, t) {
- return e.charCodeAt(t + 1) === 42 && e.charCodeAt(t + 2) === 33;
- }
- function iZ(e, t) {
- const n = new Map(
- t.map((c) => [
- `${Qs(e, c.range.end).line}`,
- c
- ])
- ), i = /* @__PURE__ */ new Map();
- return { getUnusedExpectations: s, markUsed: o };
- function s() {
- return as(n.entries()).filter(([c, _]) => _.type === 0 && !i.get(c)).map(([c, _]) => _);
- }
- function o(c) {
- return n.has(`${c}`) ? (i.set(`${c}`, !0), !0) : !1;
- }
- }
- function Oy(e, t, n) {
- if (rc(e))
- return e.pos;
- if (uC(e) || e.kind === 12)
- return aa(
- (t ?? Tr(e)).text,
- e.pos,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- );
- if (n && gf(e))
- return Oy(e.jsDoc[0], t);
- if (e.kind === 352) {
- t ?? (t = Tr(e));
- const i = el(GJ(e, t));
- if (i)
- return Oy(i, t, n);
- }
- return aa(
- (t ?? Tr(e)).text,
- e.pos,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !1,
- e3(e)
- );
- }
- function jj(e, t) {
- const n = !rc(e) && Hp(e) ? ob(e.modifiers, dl) : void 0;
- return n ? aa((t || Tr(e)).text, n.end) : Oy(e, t);
- }
- function sZ(e, t) {
- const n = !rc(e) && Hp(e) && e.modifiers ? _a(e.modifiers) : void 0;
- return n ? aa((t || Tr(e)).text, n.end) : Oy(e, t);
- }
- function gb(e, t, n = !1) {
- return _4(e.text, t, n);
- }
- function $5e(e) {
- return !!or(e, pv);
- }
- function c7(e) {
- return !!(Nc(e) && e.exportClause && ug(e.exportClause) && ng(e.exportClause.name));
- }
- function Fy(e) {
- return e.kind === 11 ? e.text : Ei(e.escapedText);
- }
- function hb(e) {
- return e.kind === 11 ? tc(e.text) : e.escapedText;
- }
- function ng(e) {
- return (e.kind === 11 ? e.text : e.escapedText) === "default";
- }
- function _4(e, t, n = !1) {
- if (rc(t))
- return "";
- let i = e.substring(n ? t.pos : aa(e, t.pos), t.end);
- return $5e(t) && (i = i.split(/\r\n|\n|\r/).map((s) => s.replace(/^\s*\*/, "").trimStart()).join(`
-`)), i;
- }
- function nc(e, t = !1) {
- return gb(Tr(e), e, t);
- }
- function X5e(e) {
- return e.pos;
- }
- function mC(e, t) {
- return hy(e, t, X5e, ho);
- }
- function ya(e) {
- const t = e.emitNode;
- return t && t.flags || 0;
- }
- function _d(e) {
- const t = e.emitNode;
- return t && t.internalFlags || 0;
- }
- var Bj = /* @__PURE__ */ Iu(
- () => new Map(Object.entries({
- Array: new Map(Object.entries({
- es2015: [
- "find",
- "findIndex",
- "fill",
- "copyWithin",
- "entries",
- "keys",
- "values"
- ],
- es2016: [
- "includes"
- ],
- es2019: [
- "flat",
- "flatMap"
- ],
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Iterator: new Map(Object.entries({
- es2015: Ue
- })),
- AsyncIterator: new Map(Object.entries({
- es2015: Ue
- })),
- Atomics: new Map(Object.entries({
- es2017: Ue
- })),
- SharedArrayBuffer: new Map(Object.entries({
- es2017: Ue
- })),
- AsyncIterable: new Map(Object.entries({
- es2018: Ue
- })),
- AsyncIterableIterator: new Map(Object.entries({
- es2018: Ue
- })),
- AsyncGenerator: new Map(Object.entries({
- es2018: Ue
- })),
- AsyncGeneratorFunction: new Map(Object.entries({
- es2018: Ue
- })),
- RegExp: new Map(Object.entries({
- es2015: [
- "flags",
- "sticky",
- "unicode"
- ],
- es2018: [
- "dotAll"
- ]
- })),
- Reflect: new Map(Object.entries({
- es2015: [
- "apply",
- "construct",
- "defineProperty",
- "deleteProperty",
- "get",
- "getOwnPropertyDescriptor",
- "getPrototypeOf",
- "has",
- "isExtensible",
- "ownKeys",
- "preventExtensions",
- "set",
- "setPrototypeOf"
- ]
- })),
- ArrayConstructor: new Map(Object.entries({
- es2015: [
- "from",
- "of"
- ],
- esnext: [
- "fromAsync"
- ]
- })),
- ObjectConstructor: new Map(Object.entries({
- es2015: [
- "assign",
- "getOwnPropertySymbols",
- "keys",
- "is",
- "setPrototypeOf"
- ],
- es2017: [
- "values",
- "entries",
- "getOwnPropertyDescriptors"
- ],
- es2019: [
- "fromEntries"
- ],
- es2022: [
- "hasOwn"
- ]
- })),
- NumberConstructor: new Map(Object.entries({
- es2015: [
- "isFinite",
- "isInteger",
- "isNaN",
- "isSafeInteger",
- "parseFloat",
- "parseInt"
- ]
- })),
- Math: new Map(Object.entries({
- es2015: [
- "clz32",
- "imul",
- "sign",
- "log10",
- "log2",
- "log1p",
- "expm1",
- "cosh",
- "sinh",
- "tanh",
- "acosh",
- "asinh",
- "atanh",
- "hypot",
- "trunc",
- "fround",
- "cbrt"
- ]
- })),
- Map: new Map(Object.entries({
- es2015: [
- "entries",
- "keys",
- "values"
- ]
- })),
- Set: new Map(Object.entries({
- es2015: [
- "entries",
- "keys",
- "values"
- ]
- })),
- PromiseConstructor: new Map(Object.entries({
- es2015: [
- "all",
- "race",
- "reject",
- "resolve"
- ],
- es2020: [
- "allSettled"
- ],
- es2021: [
- "any"
- ]
- })),
- Symbol: new Map(Object.entries({
- es2015: [
- "for",
- "keyFor"
- ],
- es2019: [
- "description"
- ]
- })),
- WeakMap: new Map(Object.entries({
- es2015: [
- "entries",
- "keys",
- "values"
- ]
- })),
- WeakSet: new Map(Object.entries({
- es2015: [
- "entries",
- "keys",
- "values"
- ]
- })),
- String: new Map(Object.entries({
- es2015: [
- "codePointAt",
- "includes",
- "endsWith",
- "normalize",
- "repeat",
- "startsWith",
- "anchor",
- "big",
- "blink",
- "bold",
- "fixed",
- "fontcolor",
- "fontsize",
- "italics",
- "link",
- "small",
- "strike",
- "sub",
- "sup"
- ],
- es2017: [
- "padStart",
- "padEnd"
- ],
- es2019: [
- "trimStart",
- "trimEnd",
- "trimLeft",
- "trimRight"
- ],
- es2020: [
- "matchAll"
- ],
- es2021: [
- "replaceAll"
- ],
- es2022: [
- "at"
- ],
- esnext: [
- "isWellFormed",
- "toWellFormed"
- ]
- })),
- StringConstructor: new Map(Object.entries({
- es2015: [
- "fromCodePoint",
- "raw"
- ]
- })),
- DateTimeFormat: new Map(Object.entries({
- es2017: [
- "formatToParts"
- ]
- })),
- Promise: new Map(Object.entries({
- es2015: Ue,
- es2018: [
- "finally"
- ]
- })),
- RegExpMatchArray: new Map(Object.entries({
- es2018: [
- "groups"
- ]
- })),
- RegExpExecArray: new Map(Object.entries({
- es2018: [
- "groups"
- ]
- })),
- Intl: new Map(Object.entries({
- es2018: [
- "PluralRules"
- ]
- })),
- NumberFormat: new Map(Object.entries({
- es2018: [
- "formatToParts"
- ]
- })),
- SymbolConstructor: new Map(Object.entries({
- es2020: [
- "matchAll"
- ]
- })),
- DataView: new Map(Object.entries({
- es2020: [
- "setBigInt64",
- "setBigUint64",
- "getBigInt64",
- "getBigUint64"
- ]
- })),
- BigInt: new Map(Object.entries({
- es2020: Ue
- })),
- RelativeTimeFormat: new Map(Object.entries({
- es2020: [
- "format",
- "formatToParts",
- "resolvedOptions"
- ]
- })),
- Int8Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Uint8Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Uint8ClampedArray: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Int16Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Uint16Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Int32Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Uint32Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Float32Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Float64Array: new Map(Object.entries({
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- BigInt64Array: new Map(Object.entries({
- es2020: Ue,
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- BigUint64Array: new Map(Object.entries({
- es2020: Ue,
- es2022: [
- "at"
- ],
- es2023: [
- "findLastIndex",
- "findLast",
- "toReversed",
- "toSorted",
- "toSpliced",
- "with"
- ]
- })),
- Error: new Map(Object.entries({
- es2022: [
- "cause"
- ]
- }))
- }))
- ), aZ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NeverAsciiEscape = 1] = "NeverAsciiEscape", e[e.JsxAttributeEscape = 2] = "JsxAttributeEscape", e[e.TerminateUnterminatedLiterals = 4] = "TerminateUnterminatedLiterals", e[e.AllowNumericSeparator = 8] = "AllowNumericSeparator", e))(aZ || {});
- function oZ(e, t, n) {
- if (t && Q5e(e, n))
- return gb(t, e);
- switch (e.kind) {
- case 11: {
- const i = n & 2 ? CB : n & 1 || ya(e) & 16777216 ? cg : B7;
- return e.singleQuote ? "'" + i(
- e.text,
- 39
- /* singleQuote */
- ) + "'" : '"' + i(
- e.text,
- 34
- /* doubleQuote */
- ) + '"';
- }
- case 15:
- case 16:
- case 17:
- case 18: {
- const i = n & 1 || ya(e) & 16777216 ? cg : B7, s = e.rawText ?? xB(i(
- e.text,
- 96
- /* backtick */
- ));
- switch (e.kind) {
- case 15:
- return "`" + s + "`";
- case 16:
- return "`" + s + "${";
- case 17:
- return "}" + s + "${";
- case 18:
- return "}" + s + "`";
- }
- break;
- }
- case 9:
- case 10:
- return e.text;
- case 14:
- return n & 4 && e.isUnterminated ? e.text + (e.text.charCodeAt(e.text.length - 1) === 92 ? " /" : "/") : e.text;
- }
- return E.fail(`Literal kind '${e.kind}' not accounted for.`);
- }
- function Q5e(e, t) {
- if (fo(e) || !e.parent || t & 4 && e.isUnterminated)
- return !1;
- if (d_(e)) {
- if (e.numericLiteralFlags & 26656)
- return !1;
- if (e.numericLiteralFlags & 512)
- return !!(t & 8);
- }
- return !eD(e);
- }
- function cZ(e) {
- return _s(e) ? `"${cg(e)}"` : "" + e;
- }
- function lZ(e) {
- return Hc(e).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
- }
- function Jj(e) {
- return (xh(e) & 7) !== 0 || zj(e);
- }
- function zj(e) {
- const t = pm(e);
- return t.kind === 260 && t.parent.kind === 299;
- }
- function Fu(e) {
- return zc(e) && (e.name.kind === 11 || ig(e));
- }
- function l7(e) {
- return zc(e) && e.name.kind === 11;
- }
- function Wj(e) {
- return zc(e) && oa(e.name);
- }
- function Y5e(e) {
- return zc(e) || Oe(e);
- }
- function Jw(e) {
- return Z5e(e.valueDeclaration);
- }
- function Z5e(e) {
- return !!e && e.kind === 267 && !e.body;
- }
- function uZ(e) {
- return e.kind === 307 || e.kind === 267 || lC(e);
- }
- function ig(e) {
- return !!(e.flags & 2048);
- }
- function yb(e) {
- return Fu(e) && Uj(e);
- }
- function Uj(e) {
- switch (e.parent.kind) {
- case 307:
- return il(e.parent);
- case 268:
- return Fu(e.parent.parent) && Si(e.parent.parent.parent) && !il(e.parent.parent.parent);
- }
- return !1;
- }
- function Vj(e) {
- var t;
- return (t = e.declarations) == null ? void 0 : t.find((n) => !yb(n) && !(zc(n) && ig(n)));
- }
- function K5e(e) {
- return e === 1 || e === 100 || e === 199;
- }
- function $T(e, t) {
- return il(e) || K5e(Ru(t)) && !!e.commonJsModuleIndicator;
- }
- function qj(e, t) {
- switch (e.scriptKind) {
- case 1:
- case 3:
- case 2:
- case 4:
- break;
- default:
- return !1;
- }
- return e.isDeclarationFile ? !1 : !!(cu(t, "alwaysStrict") || dte(e.statements) || il(e) || Wp(t));
- }
- function Hj(e) {
- return !!(e.flags & 33554432) || Gn(
- e,
- 128
- /* Ambient */
- );
- }
- function Gj(e, t) {
- switch (e.kind) {
- case 307:
- case 269:
- case 299:
- case 267:
- case 248:
- case 249:
- case 250:
- case 176:
- case 174:
- case 177:
- case 178:
- case 262:
- case 218:
- case 219:
- case 172:
- case 175:
- return !0;
- case 241:
- return !lC(t);
- }
- return !1;
- }
- function $j(e) {
- switch (E.type(e), e.kind) {
- case 338:
- case 346:
- case 323:
- return !0;
- default:
- return Xj(e);
- }
- }
- function Xj(e) {
- switch (E.type(e), e.kind) {
- case 179:
- case 180:
- case 173:
- case 181:
- case 184:
- case 185:
- case 317:
- case 263:
- case 231:
- case 264:
- case 265:
- case 345:
- case 262:
- case 174:
- case 176:
- case 177:
- case 178:
- case 218:
- case 219:
- return !0;
- default:
- return !1;
- }
- }
- function XT(e) {
- switch (e.kind) {
- case 272:
- case 271:
- return !0;
- default:
- return !1;
- }
- }
- function _Z(e) {
- return XT(e) || Sb(e);
- }
- function fZ(e) {
- return XT(e) || r3(e);
- }
- function u7(e) {
- switch (e.kind) {
- case 272:
- case 271:
- case 243:
- case 263:
- case 262:
- case 267:
- case 265:
- case 264:
- case 266:
- return !0;
- default:
- return !1;
- }
- }
- function pZ(e) {
- return zw(e) || zc(e) || bm(e) || hf(e);
- }
- function zw(e) {
- return XT(e) || Nc(e);
- }
- function _7(e) {
- return or(e.parent, (t) => !!(Uz(t) & 1));
- }
- function Cd(e) {
- return or(e.parent, (t) => Gj(t, t.parent));
- }
- function dZ(e, t) {
- let n = Cd(e);
- for (; n; )
- t(n), n = Cd(n);
- }
- function _o(e) {
- return !e || Rw(e) === 0 ? "(Missing)" : nc(e);
- }
- function mZ(e) {
- return e.declaration ? _o(e.declaration.parameters[0].name) : void 0;
- }
- function Ww(e) {
- return e.kind === 167 && !Of(e.expression);
- }
- function f4(e) {
- var t;
- switch (e.kind) {
- case 80:
- case 81:
- return (t = e.emitNode) != null && t.autoGenerate ? void 0 : e.escapedText;
- case 11:
- case 9:
- case 10:
- case 15:
- return tc(e.text);
- case 167:
- return Of(e.expression) ? tc(e.expression.text) : void 0;
- case 295:
- return yx(e);
- default:
- return E.assertNever(e);
- }
- }
- function QT(e) {
- return E.checkDefined(f4(e));
- }
- function $_(e) {
- switch (e.kind) {
- case 110:
- return "this";
- case 81:
- case 80:
- return Rw(e) === 0 ? Nn(e) : nc(e);
- case 166:
- return $_(e.left) + "." + $_(e.right);
- case 211:
- return Oe(e.name) || Di(e.name) ? $_(e.expression) + "." + $_(e.name) : E.assertNever(e.name);
- case 311:
- return $_(e.left) + "#" + $_(e.right);
- case 295:
- return $_(e.namespace) + ":" + $_(e.name);
- default:
- return E.assertNever(e);
- }
- }
- function Kr(e, t, ...n) {
- const i = Tr(e);
- return sp(i, e, t, ...n);
- }
- function gC(e, t, n, ...i) {
- const s = aa(e.text, t.pos);
- return fl(e, s, t.end - s, n, ...i);
- }
- function sp(e, t, n, ...i) {
- const s = tS(e, t);
- return fl(e, s.start, s.length, n, ...i);
- }
- function Rg(e, t, n, i) {
- const s = tS(e, t);
- return f7(e, s.start, s.length, n, i);
- }
- function Uw(e, t, n, i) {
- const s = aa(e.text, t.pos);
- return f7(e, s, t.end - s, n, i);
- }
- function gZ(e, t, n) {
- E.assertGreaterThanOrEqual(t, 0), E.assertGreaterThanOrEqual(n, 0), E.assertLessThanOrEqual(t, e.length), E.assertLessThanOrEqual(t + n, e.length);
- }
- function f7(e, t, n, i, s) {
- return gZ(e.text, t, n), {
- file: e,
- start: t,
- length: n,
- code: i.code,
- category: i.category,
- messageText: i.next ? i : i.messageText,
- relatedInformation: s,
- canonicalHead: i.canonicalHead
- };
- }
- function Qj(e, t, n) {
- return {
- file: e,
- start: 0,
- length: 0,
- code: t.code,
- category: t.category,
- messageText: t.next ? t : t.messageText,
- relatedInformation: n
- };
- }
- function hZ(e) {
- return typeof e.messageText == "string" ? {
- code: e.code,
- category: e.category,
- messageText: e.messageText,
- next: e.next
- } : e.messageText;
- }
- function yZ(e, t, n) {
- return {
- file: e,
- start: t.pos,
- length: t.end - t.pos,
- code: n.code,
- category: n.category,
- messageText: n.message
- };
- }
- function vZ(e, ...t) {
- return {
- code: e.code,
- messageText: dx(e, ...t)
- };
- }
- function cm(e, t) {
- const n = Og(
- e.languageVersion,
- /*skipTrivia*/
- !0,
- e.languageVariant,
- e.text,
- /*onError*/
- void 0,
- t
- );
- n.scan();
- const i = n.getTokenStart();
- return kc(i, n.getTokenEnd());
- }
- function bZ(e, t) {
- const n = Og(
- e.languageVersion,
- /*skipTrivia*/
- !0,
- e.languageVariant,
- e.text,
- /*onError*/
- void 0,
- t
- );
- return n.scan(), n.getToken();
- }
- function eOe(e, t) {
- const n = aa(e.text, t.pos);
- if (t.body && t.body.kind === 241) {
- const { line: i } = Qs(e, t.body.pos), { line: s } = Qs(e, t.body.end);
- if (i < s)
- return Ul(n, jw(i, e) - n + 1);
- }
- return kc(n, t.end);
- }
- function tS(e, t) {
- let n = t;
- switch (t.kind) {
- case 307: {
- const o = aa(
- e.text,
- 0,
- /*stopAfterLineBreak*/
- !1
- );
- return o === e.text.length ? Ul(0, 0) : cm(e, o);
- }
- case 260:
- case 208:
- case 263:
- case 231:
- case 264:
- case 267:
- case 266:
- case 306:
- case 262:
- case 218:
- case 174:
- case 177:
- case 178:
- case 265:
- case 172:
- case 171:
- case 274:
- n = t.name;
- break;
- case 219:
- return eOe(e, t);
- case 296:
- case 297: {
- const o = aa(e.text, t.pos), c = t.statements.length > 0 ? t.statements[0].pos : t.end;
- return kc(o, c);
- }
- case 253:
- case 229: {
- const o = aa(e.text, t.pos);
- return cm(e, o);
- }
- case 238: {
- const o = aa(e.text, t.expression.end);
- return cm(e, o);
- }
- case 350: {
- const o = aa(e.text, t.tagName.pos);
- return cm(e, o);
- }
- case 176: {
- const o = t, c = aa(e.text, o.pos), _ = Og(
- e.languageVersion,
- /*skipTrivia*/
- !0,
- e.languageVariant,
- e.text,
- /*onError*/
- void 0,
- c
- );
- let u = _.scan();
- for (; u !== 137 && u !== 1; )
- u = _.scan();
- const d = _.getTokenEnd();
- return kc(c, d);
- }
- }
- if (n === void 0)
- return cm(e, t.pos);
- E.assert(!Id(n));
- const i = rc(n), s = i || xx(t) ? n.pos : aa(e.text, n.pos);
- return i ? (E.assert(s === n.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"), E.assert(s === n.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")) : (E.assert(s >= n.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"), E.assert(s <= n.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")), kc(s, n.end);
- }
- function g0(e) {
- return e.kind === 307 && !X_(e);
- }
- function X_(e) {
- return (e.externalModuleIndicator || e.commonJsModuleIndicator) !== void 0;
- }
- function Rp(e) {
- return e.scriptKind === 6;
- }
- function Y1(e) {
- return !!(U1(e) & 4096);
- }
- function Vw(e) {
- return !!(U1(e) & 8 && !G_(e, e.parent));
- }
- function qw(e) {
- return (xh(e) & 7) === 6;
- }
- function Hw(e) {
- return (xh(e) & 7) === 4;
- }
- function hC(e) {
- return (xh(e) & 7) === 2;
- }
- function SZ(e) {
- const t = xh(e) & 7;
- return t === 2 || t === 4 || t === 6;
- }
- function p7(e) {
- return (xh(e) & 7) === 1;
- }
- function rS(e) {
- return e.kind === 213 && e.expression.kind === 108;
- }
- function hf(e) {
- return e.kind === 213 && e.expression.kind === 102;
- }
- function yC(e) {
- return sD(e) && e.keywordToken === 102 && e.name.escapedText === "meta";
- }
- function h0(e) {
- return bm(e) && P0(e.argument) && oa(e.argument.literal);
- }
- function lm(e) {
- return e.kind === 244 && e.expression.kind === 11;
- }
- function Gw(e) {
- return !!(ya(e) & 2097152);
- }
- function d7(e) {
- return Gw(e) && Ec(e);
- }
- function tOe(e) {
- return Oe(e.name) && !e.initializer;
- }
- function m7(e) {
- return Gw(e) && yc(e) && Mi(e.declarationList.declarations, tOe);
- }
- function Yj(e, t) {
- return e.kind !== 12 ? Ig(t.text, e.pos) : void 0;
- }
- function Zj(e, t) {
- const n = e.kind === 169 || e.kind === 168 || e.kind === 218 || e.kind === 219 || e.kind === 217 || e.kind === 260 || e.kind === 281 ? Qi(ky(t, e.pos), Ig(t, e.pos)) : Ig(t, e.pos);
- return Ln(
- n,
- (i) => i.end <= e.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range
- t.charCodeAt(i.pos + 1) === 42 && t.charCodeAt(i.pos + 2) === 42 && t.charCodeAt(i.pos + 3) !== 47
- /* slash */
- );
- }
- var rOe = /^\/\/\/\s*/, nOe = /^\/\/\/\s*/, iOe = /^\/\/\/\s*/, sOe = /^\/\/\/\s*/, aOe = /^\/\/\/\s*/, oOe = /^\/\/\/\s*/;
- function um(e) {
- if (182 <= e.kind && e.kind <= 205)
- return !0;
- switch (e.kind) {
- case 133:
- case 159:
- case 150:
- case 163:
- case 154:
- case 136:
- case 155:
- case 151:
- case 157:
- case 106:
- case 146:
- return !0;
- case 116:
- return e.parent.kind !== 222;
- case 233:
- return xge(e);
- case 168:
- return e.parent.kind === 200 || e.parent.kind === 195;
- case 80:
- (e.parent.kind === 166 && e.parent.right === e || e.parent.kind === 211 && e.parent.name === e) && (e = e.parent), E.assert(e.kind === 80 || e.kind === 166 || e.kind === 211, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 166:
- case 211:
- case 110: {
- const { parent: t } = e;
- if (t.kind === 186)
- return !1;
- if (t.kind === 205)
- return !t.isTypeOf;
- if (182 <= t.kind && t.kind <= 205)
- return !0;
- switch (t.kind) {
- case 233:
- return xge(t);
- case 168:
- return e === t.constraint;
- case 345:
- return e === t.constraint;
- case 172:
- case 171:
- case 169:
- case 260:
- return e === t.type;
- case 262:
- case 218:
- case 219:
- case 176:
- case 174:
- case 173:
- case 177:
- case 178:
- return e === t.type;
- case 179:
- case 180:
- case 181:
- return e === t.type;
- case 216:
- return e === t.type;
- case 213:
- case 214:
- case 215:
- return ss(t.typeArguments, e);
- }
- }
- }
- return !1;
- }
- function xge(e) {
- return iO(e.parent) || Mx(e.parent) || ef(e.parent) && !Q7(e);
- }
- function y0(e, t) {
- return n(e);
- function n(i) {
- switch (i.kind) {
- case 253:
- return t(i);
- case 269:
- case 241:
- case 245:
- case 246:
- case 247:
- case 248:
- case 249:
- case 250:
- case 254:
- case 255:
- case 296:
- case 297:
- case 256:
- case 258:
- case 299:
- return bs(i, n);
- }
- }
- }
- function TZ(e, t) {
- return n(e);
- function n(i) {
- switch (i.kind) {
- case 229:
- t(i);
- const s = i.expression;
- s && n(s);
- return;
- case 266:
- case 264:
- case 267:
- case 265:
- return;
- default:
- if (ys(i)) {
- if (i.name && i.name.kind === 167) {
- n(i.name.expression);
- return;
- }
- } else um(i) || bs(i, n);
- }
- }
- }
- function Kj(e) {
- return e && e.kind === 188 ? e.elementType : e && e.kind === 183 ? Qm(e.typeArguments) : void 0;
- }
- function xZ(e) {
- switch (e.kind) {
- case 264:
- case 263:
- case 231:
- case 187:
- return e.members;
- case 210:
- return e.properties;
- }
- }
- function YT(e) {
- if (e)
- switch (e.kind) {
- case 208:
- case 306:
- case 169:
- case 303:
- case 172:
- case 171:
- case 304:
- case 260:
- return !0;
- }
- return !1;
- }
- function kZ(e) {
- return YT(e) || Ay(e);
- }
- function p4(e) {
- return e.parent.kind === 261 && e.parent.parent.kind === 243;
- }
- function CZ(e) {
- return cn(e) ? Ks(e.parent) && dn(e.parent.parent) && Cc(e.parent.parent) === 2 || g7(e.parent) : !1;
- }
- function g7(e) {
- return cn(e) ? dn(e) && Cc(e) === 1 : !1;
- }
- function EZ(e) {
- return (ii(e) ? hC(e) && Oe(e.name) && p4(e) : cs(e) ? P4(e) && tl(e) : m_(e) && P4(e)) || g7(e);
- }
- function DZ(e) {
- switch (e.kind) {
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- case 262:
- case 218:
- return !0;
- }
- return !1;
- }
- function eB(e, t) {
- for (; ; ) {
- if (t && t(e), e.statement.kind !== 256)
- return e.statement;
- e = e.statement;
- }
- }
- function vb(e) {
- return e && e.kind === 241 && ys(e.parent);
- }
- function jp(e) {
- return e && e.kind === 174 && e.parent.kind === 210;
- }
- function h7(e) {
- return (e.kind === 174 || e.kind === 177 || e.kind === 178) && (e.parent.kind === 210 || e.parent.kind === 231);
- }
- function PZ(e) {
- return e && e.kind === 1;
- }
- function wZ(e) {
- return e && e.kind === 0;
- }
- function vC(e, t, n, i) {
- return ir(e?.properties, (s) => {
- if (!Qc(s)) return;
- const o = f4(s.name);
- return t === o || i && i === o ? n(s) : void 0;
- });
- }
- function AZ(e, t, n) {
- return vC(e, t, (i) => $l(i.initializer) ? On(i.initializer.elements, (s) => oa(s) && s.text === n) : void 0);
- }
- function d4(e) {
- if (e && e.statements.length) {
- const t = e.statements[0].expression;
- return Wn(t, Ks);
- }
- }
- function y7(e, t, n) {
- return $w(e, t, (i) => $l(i.initializer) ? On(i.initializer.elements, (s) => oa(s) && s.text === n) : void 0);
- }
- function $w(e, t, n) {
- return vC(d4(e), t, n);
- }
- function yf(e) {
- return or(e.parent, ys);
- }
- function NZ(e) {
- return or(e.parent, no);
- }
- function Ol(e) {
- return or(e.parent, Zn);
- }
- function IZ(e) {
- return or(e.parent, (t) => Zn(t) || ys(t) ? "quit" : oc(t));
- }
- function v7(e) {
- return or(e.parent, lC);
- }
- function b7(e) {
- const t = or(e.parent, (n) => Zn(n) ? "quit" : dl(n));
- return t && Zn(t.parent) ? Ol(t.parent) : Ol(t ?? e);
- }
- function Lu(e, t, n) {
- for (E.assert(
- e.kind !== 307
- /* SourceFile */
- ); ; ) {
- if (e = e.parent, !e)
- return E.fail();
- switch (e.kind) {
- case 167:
- if (n && Zn(e.parent.parent))
- return e;
- e = e.parent.parent;
- break;
- case 170:
- e.parent.kind === 169 && _l(e.parent.parent) ? e = e.parent.parent : _l(e.parent) && (e = e.parent);
- break;
- case 219:
- if (!t)
- continue;
- case 262:
- case 218:
- case 267:
- case 175:
- case 172:
- case 171:
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- case 179:
- case 180:
- case 181:
- case 266:
- case 307:
- return e;
- }
- }
- }
- function OZ(e) {
- switch (e.kind) {
- case 219:
- case 262:
- case 218:
- case 172:
- return !0;
- case 241:
- switch (e.parent.kind) {
- case 176:
- case 174:
- case 177:
- case 178:
- return !0;
- default:
- return !1;
- }
- default:
- return !1;
- }
- }
- function S7(e) {
- Oe(e) && (Xc(e.parent) || Ec(e.parent)) && e.parent.name === e && (e = e.parent);
- const t = Lu(
- e,
- /*includeArrowFunctions*/
- !0,
- /*includeClassComputedPropertyName*/
- !1
- );
- return Si(t);
- }
- function FZ(e) {
- const t = Lu(
- e,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (t)
- switch (t.kind) {
- case 176:
- case 262:
- case 218:
- return t;
- }
- }
- function Xw(e, t) {
- for (; ; ) {
- if (e = e.parent, !e)
- return;
- switch (e.kind) {
- case 167:
- e = e.parent;
- break;
- case 262:
- case 218:
- case 219:
- if (!t)
- continue;
- case 172:
- case 171:
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- case 175:
- return e;
- case 170:
- e.parent.kind === 169 && _l(e.parent.parent) ? e = e.parent.parent : _l(e.parent) && (e = e.parent);
- break;
- }
- }
- }
- function bb(e) {
- if (e.kind === 218 || e.kind === 219) {
- let t = e, n = e.parent;
- for (; n.kind === 217; )
- t = n, n = n.parent;
- if (n.kind === 213 && n.expression === t)
- return n;
- }
- }
- function C_(e) {
- const t = e.kind;
- return (t === 211 || t === 212) && e.expression.kind === 108;
- }
- function Qw(e) {
- const t = e.kind;
- return (t === 211 || t === 212) && e.expression.kind === 110;
- }
- function T7(e) {
- var t;
- return !!e && ii(e) && ((t = e.initializer) == null ? void 0 : t.kind) === 110;
- }
- function LZ(e) {
- return !!e && (uu(e) || Qc(e)) && dn(e.parent.parent) && e.parent.parent.operatorToken.kind === 64 && e.parent.parent.right.kind === 110;
- }
- function Yw(e) {
- switch (e.kind) {
- case 183:
- return e.typeName;
- case 233:
- return yo(e.expression) ? e.expression : void 0;
- case 80:
- case 166:
- return e;
- }
- }
- function x7(e) {
- switch (e.kind) {
- case 215:
- return e.tag;
- case 286:
- case 285:
- return e.tagName;
- case 226:
- return e.right;
- default:
- return e.expression;
- }
- }
- function Zw(e, t, n, i) {
- if (e && Vl(t) && Di(t.name))
- return !1;
- switch (t.kind) {
- case 263:
- return !0;
- case 231:
- return !e;
- case 172:
- return n !== void 0 && (e ? Xc(n) : Zn(n) && !wb(t) && !IB(t));
- case 177:
- case 178:
- case 174:
- return t.body !== void 0 && n !== void 0 && (e ? Xc(n) : Zn(n));
- case 169:
- return e ? n !== void 0 && n.body !== void 0 && (n.kind === 176 || n.kind === 174 || n.kind === 178) && Eb(n) !== t && i !== void 0 && i.kind === 263 : !1;
- }
- return !1;
- }
- function bC(e, t, n, i) {
- return Ff(t) && Zw(e, t, n, i);
- }
- function Kw(e, t, n, i) {
- return bC(e, t, n, i) || m4(e, t, n);
- }
- function m4(e, t, n) {
- switch (t.kind) {
- case 263:
- return ut(t.members, (i) => Kw(e, i, t, n));
- case 231:
- return !e && ut(t.members, (i) => Kw(e, i, t, n));
- case 174:
- case 178:
- case 176:
- return ut(t.parameters, (i) => bC(e, i, t, n));
- default:
- return !1;
- }
- }
- function v0(e, t) {
- if (bC(e, t)) return !0;
- const n = Bg(t);
- return !!n && m4(e, n, t);
- }
- function tB(e, t, n) {
- let i;
- if (Ay(t)) {
- const { firstAccessor: s, secondAccessor: o, setAccessor: c } = My(n.members, t), _ = Ff(s) ? s : o && Ff(o) ? o : void 0;
- if (!_ || t !== _)
- return !1;
- i = c?.parameters;
- } else hc(t) && (i = t.parameters);
- if (bC(e, t, n))
- return !0;
- if (i) {
- for (const s of i)
- if (!Db(s) && bC(e, s, t, n))
- return !0;
- }
- return !1;
- }
- function rB(e) {
- if (e.textSourceNode) {
- switch (e.textSourceNode.kind) {
- case 11:
- return rB(e.textSourceNode);
- case 15:
- return e.text === "";
- }
- return !1;
- }
- return e.text === "";
- }
- function SC(e) {
- const { parent: t } = e;
- return t.kind === 286 || t.kind === 285 || t.kind === 287 ? t.tagName === e : !1;
- }
- function Ed(e) {
- switch (e.kind) {
- case 108:
- case 106:
- case 112:
- case 97:
- case 14:
- case 209:
- case 210:
- case 211:
- case 212:
- case 213:
- case 214:
- case 215:
- case 234:
- case 216:
- case 238:
- case 235:
- case 217:
- case 218:
- case 231:
- case 219:
- case 222:
- case 220:
- case 221:
- case 224:
- case 225:
- case 226:
- case 227:
- case 230:
- case 228:
- case 232:
- case 284:
- case 285:
- case 288:
- case 229:
- case 223:
- case 236:
- return !0;
- case 233:
- return !ef(e.parent) && !Mx(e.parent);
- case 166:
- for (; e.parent.kind === 166; )
- e = e.parent;
- return e.parent.kind === 186 || qT(e.parent) || _D(e.parent) || dv(e.parent) || SC(e);
- case 311:
- for (; dv(e.parent); )
- e = e.parent;
- return e.parent.kind === 186 || qT(e.parent) || _D(e.parent) || dv(e.parent) || SC(e);
- case 81:
- return dn(e.parent) && e.parent.left === e && e.parent.operatorToken.kind === 103;
- case 80:
- if (e.parent.kind === 186 || qT(e.parent) || _D(e.parent) || dv(e.parent) || SC(e))
- return !0;
- case 9:
- case 10:
- case 11:
- case 15:
- case 110:
- return k7(e);
- default:
- return !1;
- }
- }
- function k7(e) {
- const { parent: t } = e;
- switch (t.kind) {
- case 260:
- case 169:
- case 172:
- case 171:
- case 306:
- case 303:
- case 208:
- return t.initializer === e;
- case 244:
- case 245:
- case 246:
- case 247:
- case 253:
- case 254:
- case 255:
- case 296:
- case 257:
- return t.expression === e;
- case 248:
- const n = t;
- return n.initializer === e && n.initializer.kind !== 261 || n.condition === e || n.incrementor === e;
- case 249:
- case 250:
- const i = t;
- return i.initializer === e && i.initializer.kind !== 261 || i.expression === e;
- case 216:
- case 234:
- return e === t.expression;
- case 239:
- return e === t.expression;
- case 167:
- return e === t.expression;
- case 170:
- case 294:
- case 293:
- case 305:
- return !0;
- case 233:
- return t.expression === e && !um(t);
- case 304:
- return t.objectAssignmentInitializer === e;
- case 238:
- return e === t.expression;
- default:
- return Ed(t);
- }
- }
- function C7(e) {
- for (; e.kind === 166 || e.kind === 80; )
- e = e.parent;
- return e.kind === 186;
- }
- function MZ(e) {
- return ug(e) && !!e.parent.moduleSpecifier;
- }
- function Z1(e) {
- return e.kind === 271 && e.moduleReference.kind === 283;
- }
- function g4(e) {
- return E.assert(Z1(e)), e.moduleReference.expression;
- }
- function nB(e) {
- return Sb(e) && LC(e.initializer).arguments[0];
- }
- function nS(e) {
- return e.kind === 271 && e.moduleReference.kind !== 283;
- }
- function sg(e) {
- return e?.kind === 307;
- }
- function Gu(e) {
- return cn(e);
- }
- function cn(e) {
- return !!e && !!(e.flags & 524288);
- }
- function E7(e) {
- return !!e && !!(e.flags & 134217728);
- }
- function D7(e) {
- return !Rp(e);
- }
- function e3(e) {
- return !!e && !!(e.flags & 16777216);
- }
- function P7(e) {
- return vf(e) && Oe(e.typeName) && e.typeName.escapedText === "Object" && e.typeArguments && e.typeArguments.length === 2 && (e.typeArguments[0].kind === 154 || e.typeArguments[0].kind === 150);
- }
- function f_(e, t) {
- if (e.kind !== 213)
- return !1;
- const { expression: n, arguments: i } = e;
- if (n.kind !== 80 || n.escapedText !== "require" || i.length !== 1)
- return !1;
- const s = i[0];
- return !t || Xa(s);
- }
- function t3(e) {
- return kge(
- e,
- /*allowAccessedRequire*/
- !1
- );
- }
- function Sb(e) {
- return kge(
- e,
- /*allowAccessedRequire*/
- !0
- );
- }
- function RZ(e) {
- return va(e) && Sb(e.parent.parent);
- }
- function kge(e, t) {
- return ii(e) && !!e.initializer && f_(
- t ? LC(e.initializer) : e.initializer,
- /*requireStringLiteralLikeArgument*/
- !0
- );
- }
- function r3(e) {
- return yc(e) && e.declarationList.declarations.length > 0 && Mi(e.declarationList.declarations, (t) => t3(t));
- }
- function n3(e) {
- return e === 39 || e === 34;
- }
- function w7(e, t) {
- return gb(t, e).charCodeAt(0) === 34;
- }
- function h4(e) {
- return dn(e) || xo(e) || Oe(e) || Fs(e);
- }
- function i3(e) {
- return cn(e) && e.initializer && dn(e.initializer) && (e.initializer.operatorToken.kind === 57 || e.initializer.operatorToken.kind === 61) && e.name && yo(e.name) && TC(e.name, e.initializer.left) ? e.initializer.right : e.initializer;
- }
- function y4(e) {
- const t = i3(e);
- return t && K1(t, Ry(e.name));
- }
- function cOe(e, t) {
- return ir(e.properties, (n) => Qc(n) && Oe(n.name) && n.name.escapedText === "value" && n.initializer && K1(n.initializer, t));
- }
- function ZT(e) {
- if (e && e.parent && dn(e.parent) && e.parent.operatorToken.kind === 64) {
- const t = Ry(e.parent.left);
- return K1(e.parent.right, t) || lOe(e.parent.left, e.parent.right, t);
- }
- if (e && Fs(e) && sS(e)) {
- const t = cOe(e.arguments[2], e.arguments[1].text === "prototype");
- if (t)
- return t;
- }
- }
- function K1(e, t) {
- if (Fs(e)) {
- const n = Ba(e.expression);
- return n.kind === 218 || n.kind === 219 ? e : void 0;
- }
- if (e.kind === 218 || e.kind === 231 || e.kind === 219 || Ks(e) && (e.properties.length === 0 || t))
- return e;
- }
- function lOe(e, t, n) {
- const i = dn(t) && (t.operatorToken.kind === 57 || t.operatorToken.kind === 61) && K1(t.right, n);
- if (i && TC(e, t.left))
- return i;
- }
- function jZ(e) {
- const t = ii(e.parent) ? e.parent.name : dn(e.parent) && e.parent.operatorToken.kind === 64 ? e.parent.left : void 0;
- return t && K1(e.right, Ry(t)) && yo(t) && TC(t, e.left);
- }
- function iB(e) {
- if (dn(e.parent)) {
- const t = (e.parent.operatorToken.kind === 57 || e.parent.operatorToken.kind === 61) && dn(e.parent.parent) ? e.parent.parent : e.parent;
- if (t.operatorToken.kind === 64 && Oe(t.left))
- return t.left;
- } else if (ii(e.parent))
- return e.parent.name;
- }
- function TC(e, t) {
- return fm(e) && fm(t) ? Jp(e) === Jp(t) : Fg(e) && BZ(t) && (t.expression.kind === 110 || Oe(t.expression) && (t.expression.escapedText === "window" || t.expression.escapedText === "self" || t.expression.escapedText === "global")) ? TC(e, a3(t)) : BZ(e) && BZ(t) ? Eh(e) === Eh(t) && TC(e.expression, t.expression) : !1;
- }
- function s3(e) {
- for (; Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- ); )
- e = e.right;
- return e;
- }
- function iS(e) {
- return Oe(e) && e.escapedText === "exports";
- }
- function sB(e) {
- return Oe(e) && e.escapedText === "module";
- }
- function jg(e) {
- return (Cn(e) || aB(e)) && sB(e.expression) && Eh(e) === "exports";
- }
- function Cc(e) {
- const t = uOe(e);
- return t === 5 || cn(e) ? t : 0;
- }
- function sS(e) {
- return Nr(e.arguments) === 3 && Cn(e.expression) && Oe(e.expression.expression) && Nn(e.expression.expression) === "Object" && Nn(e.expression.name) === "defineProperty" && Of(e.arguments[1]) && aS(
- e.arguments[0],
- /*excludeThisKeyword*/
- !0
- );
- }
- function BZ(e) {
- return Cn(e) || aB(e);
- }
- function aB(e) {
- return ko(e) && Of(e.argumentExpression);
- }
- function Tb(e, t) {
- return Cn(e) && (!t && e.expression.kind === 110 || Oe(e.name) && aS(
- e.expression,
- /*excludeThisKeyword*/
- !0
- )) || A7(e, t);
- }
- function A7(e, t) {
- return aB(e) && (!t && e.expression.kind === 110 || yo(e.expression) || Tb(
- e.expression,
- /*excludeThisKeyword*/
- !0
- ));
- }
- function aS(e, t) {
- return yo(e) || Tb(e, t);
- }
- function a3(e) {
- return Cn(e) ? e.name : e.argumentExpression;
- }
- function uOe(e) {
- if (Fs(e)) {
- if (!sS(e))
- return 0;
- const t = e.arguments[0];
- return iS(t) || jg(t) ? 8 : Tb(t) && Eh(t) === "prototype" ? 9 : 7;
- }
- return e.operatorToken.kind !== 64 || !xo(e.left) || _Oe(s3(e)) ? 0 : aS(
- e.left.expression,
- /*excludeThisKeyword*/
- !0
- ) && Eh(e.left) === "prototype" && Ks(oB(e)) ? 6 : o3(e.left);
- }
- function _Oe(e) {
- return Nx(e) && d_(e.expression) && e.expression.text === "0";
- }
- function N7(e) {
- if (Cn(e))
- return e.name;
- const t = Ba(e.argumentExpression);
- return d_(t) || Xa(t) ? t : e;
- }
- function Eh(e) {
- const t = N7(e);
- if (t) {
- if (Oe(t))
- return t.escapedText;
- if (Xa(t) || d_(t))
- return tc(t.text);
- }
- }
- function o3(e) {
- if (e.expression.kind === 110)
- return 4;
- if (jg(e))
- return 2;
- if (aS(
- e.expression,
- /*excludeThisKeyword*/
- !0
- )) {
- if (Ry(e.expression))
- return 3;
- let t = e;
- for (; !Oe(t.expression); )
- t = t.expression;
- const n = t.expression;
- if ((n.escapedText === "exports" || n.escapedText === "module" && Eh(t) === "exports") && // ExportsProperty does not support binding with computed names
- Tb(e))
- return 1;
- if (aS(
- e,
- /*excludeThisKeyword*/
- !0
- ) || ko(e) && R7(e))
- return 5;
- }
- return 0;
- }
- function oB(e) {
- for (; dn(e.right); )
- e = e.right;
- return e.right;
- }
- function c3(e) {
- return dn(e) && Cc(e) === 3;
- }
- function JZ(e) {
- return cn(e) && e.parent && e.parent.kind === 244 && (!ko(e) || aB(e)) && !!V1(e.parent);
- }
- function l3(e, t) {
- const { valueDeclaration: n } = e;
- (!n || !(t.flags & 33554432 && !cn(t) && !(n.flags & 33554432)) && h4(n) && !h4(t) || n.kind !== t.kind && Y5e(n)) && (e.valueDeclaration = t);
- }
- function zZ(e) {
- if (!e || !e.valueDeclaration)
- return !1;
- const t = e.valueDeclaration;
- return t.kind === 262 || ii(t) && t.initializer && ys(t.initializer);
- }
- function WZ(e) {
- switch (e?.kind) {
- case 260:
- case 208:
- case 272:
- case 278:
- case 271:
- case 273:
- case 280:
- case 274:
- case 281:
- case 276:
- case 205:
- return !0;
- }
- return !1;
- }
- function xC(e) {
- var t, n;
- switch (e.kind) {
- case 260:
- case 208:
- return (t = or(e.initializer, (i) => f_(
- i,
- /*requireStringLiteralLikeArgument*/
- !0
- ))) == null ? void 0 : t.arguments[0];
- case 272:
- case 278:
- case 351:
- return Wn(e.moduleSpecifier, Xa);
- case 271:
- return Wn((n = Wn(e.moduleReference, Fh)) == null ? void 0 : n.expression, Xa);
- case 273:
- case 280:
- return Wn(e.parent.moduleSpecifier, Xa);
- case 274:
- case 281:
- return Wn(e.parent.parent.moduleSpecifier, Xa);
- case 276:
- return Wn(e.parent.parent.parent.moduleSpecifier, Xa);
- case 205:
- return h0(e) ? e.argument.literal : void 0;
- default:
- E.assertNever(e);
- }
- }
- function v4(e) {
- return u3(e) || E.failBadSyntaxKind(e.parent);
- }
- function u3(e) {
- switch (e.parent.kind) {
- case 272:
- case 278:
- case 351:
- return e.parent;
- case 283:
- return e.parent.parent;
- case 213:
- return hf(e.parent) || f_(
- e.parent,
- /*requireStringLiteralLikeArgument*/
- !1
- ) ? e.parent : void 0;
- case 201:
- return E.assert(oa(e)), Wn(e.parent.parent, bm);
- default:
- return;
- }
- }
- function KT(e) {
- switch (e.kind) {
- case 272:
- case 278:
- case 351:
- return e.moduleSpecifier;
- case 271:
- return e.moduleReference.kind === 283 ? e.moduleReference.expression : void 0;
- case 205:
- return h0(e) ? e.argument.literal : void 0;
- case 213:
- return e.arguments[0];
- case 267:
- return e.name.kind === 11 ? e.name : void 0;
- default:
- return E.assertNever(e);
- }
- }
- function kC(e) {
- switch (e.kind) {
- case 272:
- return e.importClause && Wn(e.importClause.namedBindings, Hg);
- case 271:
- return e;
- case 278:
- return e.exportClause && Wn(e.exportClause, ug);
- default:
- return E.assertNever(e);
- }
- }
- function ex(e) {
- return (e.kind === 272 || e.kind === 351) && !!e.importClause && !!e.importClause.name;
- }
- function UZ(e, t) {
- if (e.name) {
- const n = t(e);
- if (n) return n;
- }
- if (e.namedBindings) {
- const n = Hg(e.namedBindings) ? t(e.namedBindings) : ir(e.namedBindings.elements, t);
- if (n) return n;
- }
- }
- function tx(e) {
- if (e)
- switch (e.kind) {
- case 169:
- case 174:
- case 173:
- case 304:
- case 303:
- case 172:
- case 171:
- return e.questionToken !== void 0;
- }
- return !1;
- }
- function CC(e) {
- const t = YC(e) ? el(e.parameters) : void 0, n = Wn(t && t.name, Oe);
- return !!n && n.escapedText === "new";
- }
- function Bp(e) {
- return e.kind === 346 || e.kind === 338 || e.kind === 340;
- }
- function _3(e) {
- return Bp(e) || Vp(e);
- }
- function fOe(e) {
- return Pl(e) && dn(e.expression) && e.expression.operatorToken.kind === 64 ? s3(e.expression) : void 0;
- }
- function Cge(e) {
- return Pl(e) && dn(e.expression) && Cc(e.expression) !== 0 && dn(e.expression.right) && (e.expression.right.operatorToken.kind === 57 || e.expression.right.operatorToken.kind === 61) ? e.expression.right.right : void 0;
- }
- function Ege(e) {
- switch (e.kind) {
- case 243:
- const t = rx(e);
- return t && t.initializer;
- case 172:
- return e.initializer;
- case 303:
- return e.initializer;
- }
- }
- function rx(e) {
- return yc(e) ? el(e.declarationList.declarations) : void 0;
- }
- function Dge(e) {
- return zc(e) && e.body && e.body.kind === 267 ? e.body : void 0;
- }
- function f3(e) {
- if (e.kind >= 243 && e.kind <= 259)
- return !0;
- switch (e.kind) {
- case 80:
- case 110:
- case 108:
- case 166:
- case 236:
- case 212:
- case 211:
- case 208:
- case 218:
- case 219:
- case 174:
- case 177:
- case 178:
- return !0;
- default:
- return !1;
- }
- }
- function p3(e) {
- switch (e.kind) {
- case 219:
- case 226:
- case 241:
- case 252:
- case 179:
- case 296:
- case 263:
- case 231:
- case 175:
- case 176:
- case 185:
- case 180:
- case 251:
- case 259:
- case 246:
- case 212:
- case 242:
- case 1:
- case 266:
- case 306:
- case 277:
- case 278:
- case 281:
- case 244:
- case 249:
- case 250:
- case 248:
- case 262:
- case 218:
- case 184:
- case 177:
- case 80:
- case 245:
- case 272:
- case 271:
- case 181:
- case 264:
- case 317:
- case 323:
- case 256:
- case 174:
- case 173:
- case 267:
- case 202:
- case 270:
- case 210:
- case 169:
- case 217:
- case 211:
- case 303:
- case 172:
- case 171:
- case 253:
- case 240:
- case 178:
- case 304:
- case 305:
- case 255:
- case 257:
- case 258:
- case 265:
- case 168:
- case 260:
- case 243:
- case 247:
- case 254:
- return !0;
- default:
- return !1;
- }
- }
- function cB(e, t) {
- let n;
- YT(e) && m0(e) && gf(e.initializer) && (n = Fn(n, Pge(e, e.initializer.jsDoc)));
- let i = e;
- for (; i && i.parent; ) {
- if (gf(i) && (n = Fn(n, Pge(e, i.jsDoc))), i.kind === 169) {
- n = Fn(n, (t ? vY : aC)(i));
- break;
- }
- if (i.kind === 168) {
- n = Fn(n, (t ? SY : bY)(i));
- break;
- }
- i = lB(i);
- }
- return n || Ue;
- }
- function Pge(e, t) {
- const n = _a(t);
- return ta(t, (i) => {
- if (i === n) {
- const s = Ln(i.tags, (o) => pOe(e, o));
- return i.tags === s ? [i] : s;
- } else
- return Ln(i.tags, ZC);
- });
- }
- function pOe(e, t) {
- return !(fD(t) || sO(t)) || !t.parent || !Id(t.parent) || !Yu(t.parent.parent) || t.parent.parent === e;
- }
- function lB(e) {
- const t = e.parent;
- if (t.kind === 303 || t.kind === 277 || t.kind === 172 || t.kind === 244 && e.kind === 211 || t.kind === 253 || Dge(t) || Dl(e))
- return t;
- if (t.parent && (rx(t.parent) === e || Dl(t)))
- return t.parent;
- if (t.parent && t.parent.parent && (rx(t.parent.parent) || Ege(t.parent.parent) === e || Cge(t.parent.parent)))
- return t.parent.parent;
- }
- function d3(e) {
- if (e.symbol)
- return e.symbol;
- if (!Oe(e.name))
- return;
- const t = e.name.escapedText, n = ev(e);
- if (!n)
- return;
- const i = On(n.parameters, (s) => s.name.kind === 80 && s.name.escapedText === t);
- return i && i.symbol;
- }
- function I7(e) {
- if (Id(e.parent) && e.parent.tags) {
- const t = On(e.parent.tags, Bp);
- if (t)
- return t;
- }
- return ev(e);
- }
- function uB(e) {
- return jI(e, ZC);
- }
- function ev(e) {
- const t = tv(e);
- if (t)
- return m_(t) && t.type && ys(t.type) ? t.type : ys(t) ? t : void 0;
- }
- function tv(e) {
- const t = xb(e);
- if (t)
- return Cge(t) || fOe(t) || Ege(t) || rx(t) || Dge(t) || t;
- }
- function xb(e) {
- const t = EC(e);
- if (!t)
- return;
- const n = t.parent;
- if (n && n.jsDoc && t === Ro(n.jsDoc))
- return n;
- }
- function EC(e) {
- return or(e.parent, Id);
- }
- function VZ(e) {
- const t = e.name.escapedText, { typeParameters: n } = e.parent.parent.parent;
- return n && On(n, (i) => i.name.escapedText === t);
- }
- function wge(e) {
- return !!e.typeArguments;
- }
- var qZ = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Definite = 1] = "Definite", e[e.Compound = 2] = "Compound", e))(qZ || {});
- function HZ(e) {
- let t = e.parent;
- for (; ; ) {
- switch (t.kind) {
- case 226:
- const n = t, i = n.operatorToken.kind;
- return Ph(i) && n.left === e ? n : void 0;
- case 224:
- case 225:
- const s = t, o = s.operator;
- return o === 46 || o === 47 ? s : void 0;
- case 249:
- case 250:
- const c = t;
- return c.initializer === e ? c : void 0;
- case 217:
- case 209:
- case 230:
- case 235:
- e = t;
- break;
- case 305:
- e = t.parent;
- break;
- case 304:
- if (t.name !== e)
- return;
- e = t.parent;
- break;
- case 303:
- if (t.name === e)
- return;
- e = t.parent;
- break;
- default:
- return;
- }
- t = e.parent;
- }
- }
- function rv(e) {
- const t = HZ(e);
- if (!t)
- return 0;
- switch (t.kind) {
- case 226:
- const n = t.operatorToken.kind;
- return n === 64 || w4(n) ? 1 : 2;
- case 224:
- case 225:
- return 2;
- case 249:
- case 250:
- return 1;
- }
- }
- function b0(e) {
- return !!HZ(e);
- }
- function dOe(e) {
- const t = Ba(e.right);
- return t.kind === 226 && iz(t.operatorToken.kind);
- }
- function _B(e) {
- const t = HZ(e);
- return !!t && Dl(
- t,
- /*excludeCompoundAssignment*/
- !0
- ) && dOe(t);
- }
- function GZ(e) {
- switch (e.kind) {
- case 241:
- case 243:
- case 254:
- case 245:
- case 255:
- case 269:
- case 296:
- case 297:
- case 256:
- case 248:
- case 249:
- case 250:
- case 246:
- case 247:
- case 258:
- case 299:
- return !0;
- }
- return !1;
- }
- function nx(e) {
- return vo(e) || Co(e) || UT(e) || Ec(e) || Qo(e);
- }
- function Age(e, t) {
- for (; e && e.kind === t; )
- e = e.parent;
- return e;
- }
- function m3(e) {
- return Age(
- e,
- 196
- /* ParenthesizedType */
- );
- }
- function ag(e) {
- return Age(
- e,
- 217
- /* ParenthesizedExpression */
- );
- }
- function $Z(e) {
- let t;
- for (; e && e.kind === 196; )
- t = e, e = e.parent;
- return [t, e];
- }
- function b4(e) {
- for (; dS(e); ) e = e.type;
- return e;
- }
- function Ba(e, t) {
- return Dc(e, t ? -2147483647 : 1);
- }
- function fB(e) {
- return e.kind !== 211 && e.kind !== 212 ? !1 : (e = ag(e.parent), e && e.kind === 220);
- }
- function kb(e, t) {
- for (; e; ) {
- if (e === t) return !0;
- e = e.parent;
- }
- return !1;
- }
- function og(e) {
- return !Si(e) && !As(e) && ql(e.parent) && e.parent.name === e;
- }
- function S4(e) {
- const t = e.parent;
- switch (e.kind) {
- case 11:
- case 15:
- case 9:
- if (ma(t)) return t.parent;
- case 80:
- if (ql(t))
- return t.name === e ? t : void 0;
- if (Xu(t)) {
- const n = t.parent;
- return dp(n) && n.name === t ? n : void 0;
- } else {
- const n = t.parent;
- return dn(n) && Cc(n) !== 0 && (n.left.symbol || n.symbol) && os(n) === e ? n : void 0;
- }
- case 81:
- return ql(t) && t.name === e ? t : void 0;
- default:
- return;
- }
- }
- function g3(e) {
- return Of(e) && e.parent.kind === 167 && ql(e.parent.parent);
- }
- function XZ(e) {
- const t = e.parent;
- switch (t.kind) {
- case 172:
- case 171:
- case 174:
- case 173:
- case 177:
- case 178:
- case 306:
- case 303:
- case 211:
- return t.name === e;
- case 166:
- return t.right === e;
- case 208:
- case 276:
- return t.propertyName === e;
- case 281:
- case 291:
- case 285:
- case 286:
- case 287:
- return !0;
- }
- return !1;
- }
- function pB(e) {
- switch (e.parent.kind) {
- case 273:
- case 276:
- case 274:
- case 281:
- case 277:
- case 271:
- case 280:
- return e.parent;
- case 166:
- do
- e = e.parent;
- while (e.parent.kind === 166);
- return pB(e);
- }
- }
- function O7(e) {
- return yo(e) || $c(e);
- }
- function h3(e) {
- const t = dB(e);
- return O7(t);
- }
- function dB(e) {
- return wo(e) ? e.expression : e.right;
- }
- function QZ(e) {
- return e.kind === 304 ? e.name : e.kind === 303 ? e.initializer : e.parent.right;
- }
- function _m(e) {
- const t = Cb(e);
- if (t && cn(e)) {
- const n = xY(e);
- if (n)
- return n.class;
- }
- return t;
- }
- function Cb(e) {
- const t = y3(
- e.heritageClauses,
- 96
- /* ExtendsKeyword */
- );
- return t && t.types.length > 0 ? t.types[0] : void 0;
- }
- function DC(e) {
- if (cn(e))
- return kY(e).map((t) => t.class);
- {
- const t = y3(
- e.heritageClauses,
- 119
- /* ImplementsKeyword */
- );
- return t?.types;
- }
- }
- function T4(e) {
- return Xl(e) ? x4(e) || Ue : Zn(e) && Qi(MT(_m(e)), DC(e)) || Ue;
- }
- function x4(e) {
- const t = y3(
- e.heritageClauses,
- 96
- /* ExtendsKeyword */
- );
- return t ? t.types : void 0;
- }
- function y3(e, t) {
- if (e) {
- for (const n of e)
- if (n.token === t)
- return n;
- }
- }
- function nv(e, t) {
- for (; e; ) {
- if (e.kind === t)
- return e;
- e = e.parent;
- }
- }
- function p_(e) {
- return 83 <= e && e <= 165;
- }
- function mB(e) {
- return 19 <= e && e <= 79;
- }
- function F7(e) {
- return p_(e) || mB(e);
- }
- function L7(e) {
- return 128 <= e && e <= 165;
- }
- function gB(e) {
- return p_(e) && !L7(e);
- }
- function ix(e) {
- const t = H2(e);
- return t !== void 0 && gB(t);
- }
- function hB(e) {
- const t = G2(e);
- return !!t && !L7(t);
- }
- function PC(e) {
- return 2 <= e && e <= 7;
- }
- var YZ = /* @__PURE__ */ ((e) => (e[e.Normal = 0] = "Normal", e[e.Generator = 1] = "Generator", e[e.Async = 2] = "Async", e[e.Invalid = 4] = "Invalid", e[e.AsyncGenerator = 3] = "AsyncGenerator", e))(YZ || {});
- function Jc(e) {
- if (!e)
- return 4;
- let t = 0;
- switch (e.kind) {
- case 262:
- case 218:
- case 174:
- e.asteriskToken && (t |= 1);
- case 219:
- Gn(
- e,
- 1024
- /* Async */
- ) && (t |= 2);
- break;
- }
- return e.body || (t |= 4), t;
- }
- function k4(e) {
- switch (e.kind) {
- case 262:
- case 218:
- case 219:
- case 174:
- return e.body !== void 0 && e.asteriskToken === void 0 && Gn(
- e,
- 1024
- /* Async */
- );
- }
- return !1;
- }
- function Of(e) {
- return Xa(e) || d_(e);
- }
- function M7(e) {
- return uv(e) && (e.operator === 40 || e.operator === 41) && d_(e.operand);
- }
- function Dh(e) {
- const t = os(e);
- return !!t && R7(t);
- }
- function R7(e) {
- if (!(e.kind === 167 || e.kind === 212))
- return !1;
- const t = ko(e) ? Ba(e.argumentExpression) : e.expression;
- return !Of(t) && !M7(t);
- }
- function oS(e) {
- switch (e.kind) {
- case 80:
- case 81:
- return e.escapedText;
- case 11:
- case 15:
- case 9:
- case 10:
- return tc(e.text);
- case 167:
- const t = e.expression;
- return Of(t) ? tc(t.text) : M7(t) ? t.operator === 41 ? qs(t.operator) + t.operand.text : t.operand.text : void 0;
- case 295:
- return yx(e);
- default:
- return E.assertNever(e);
- }
- }
- function fm(e) {
- switch (e.kind) {
- case 80:
- case 11:
- case 15:
- case 9:
- return !0;
- default:
- return !1;
- }
- }
- function Jp(e) {
- return Fg(e) ? Nn(e) : Nd(e) ? Q4(e) : e.text;
- }
- function C4(e) {
- return Fg(e) ? e.escapedText : Nd(e) ? yx(e) : tc(e.text);
- }
- function v3(e, t) {
- return `__#${na(e)}@${t}`;
- }
- function b3(e) {
- return Ui(e.escapedName, "__@");
- }
- function ZZ(e) {
- return Ui(e.escapedName, "__#");
- }
- function mOe(e) {
- return Oe(e) ? Nn(e) === "__proto__" : oa(e) && e.text === "__proto__";
- }
- function j7(e, t) {
- switch (e = Dc(e), e.kind) {
- case 231:
- if (_W(e))
- return !1;
- break;
- case 218:
- if (e.name)
- return !1;
- break;
- case 219:
- break;
- default:
- return !1;
- }
- return typeof t == "function" ? t(e) : !0;
- }
- function yB(e) {
- switch (e.kind) {
- case 303:
- return !mOe(e.name);
- case 304:
- return !!e.objectAssignmentInitializer;
- case 260:
- return Oe(e.name) && !!e.initializer;
- case 169:
- return Oe(e.name) && !!e.initializer && !e.dotDotDotToken;
- case 208:
- return Oe(e.name) && !!e.initializer && !e.dotDotDotToken;
- case 172:
- return !!e.initializer;
- case 226:
- switch (e.operatorToken.kind) {
- case 64:
- case 77:
- case 76:
- case 78:
- return Oe(e.left);
- }
- break;
- case 277:
- return !0;
- }
- return !1;
- }
- function Q_(e, t) {
- if (!yB(e)) return !1;
- switch (e.kind) {
- case 303:
- return j7(e.initializer, t);
- case 304:
- return j7(e.objectAssignmentInitializer, t);
- case 260:
- case 169:
- case 208:
- case 172:
- return j7(e.initializer, t);
- case 226:
- return j7(e.right, t);
- case 277:
- return j7(e.expression, t);
- }
- }
- function vB(e) {
- return e.escapedText === "push" || e.escapedText === "unshift";
- }
- function iv(e) {
- return pm(e).kind === 169;
- }
- function pm(e) {
- for (; e.kind === 208; )
- e = e.parent.parent;
- return e;
- }
- function bB(e) {
- const t = e.kind;
- return t === 176 || t === 218 || t === 262 || t === 219 || t === 174 || t === 177 || t === 178 || t === 267 || t === 307;
- }
- function fo(e) {
- return Pd(e.pos) || Pd(e.end);
- }
- var KZ = /* @__PURE__ */ ((e) => (e[e.Left = 0] = "Left", e[e.Right = 1] = "Right", e))(KZ || {});
- function SB(e) {
- const t = Nge(e), n = e.kind === 214 && e.arguments !== void 0;
- return TB(e.kind, t, n);
- }
- function TB(e, t, n) {
- switch (e) {
- case 214:
- return n ? 0 : 1;
- case 224:
- case 221:
- case 222:
- case 220:
- case 223:
- case 227:
- case 229:
- return 1;
- case 226:
- switch (t) {
- case 43:
- case 64:
- case 65:
- case 66:
- case 68:
- case 67:
- case 69:
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- case 79:
- case 75:
- case 76:
- case 77:
- case 78:
- return 1;
- }
- }
- return 0;
- }
- function E4(e) {
- const t = Nge(e), n = e.kind === 214 && e.arguments !== void 0;
- return S3(e.kind, t, n);
- }
- function Nge(e) {
- return e.kind === 226 ? e.operatorToken.kind : e.kind === 224 || e.kind === 225 ? e.operator : e.kind;
- }
- var eK = /* @__PURE__ */ ((e) => (e[e.Comma = 0] = "Comma", e[e.Spread = 1] = "Spread", e[e.Yield = 2] = "Yield", e[e.Assignment = 3] = "Assignment", e[e.Conditional = 4] = "Conditional", e[
- e.Coalesce = 4
- /* Conditional */
- ] = "Coalesce", e[e.LogicalOR = 5] = "LogicalOR", e[e.LogicalAND = 6] = "LogicalAND", e[e.BitwiseOR = 7] = "BitwiseOR", e[e.BitwiseXOR = 8] = "BitwiseXOR", e[e.BitwiseAND = 9] = "BitwiseAND", e[e.Equality = 10] = "Equality", e[e.Relational = 11] = "Relational", e[e.Shift = 12] = "Shift", e[e.Additive = 13] = "Additive", e[e.Multiplicative = 14] = "Multiplicative", e[e.Exponentiation = 15] = "Exponentiation", e[e.Unary = 16] = "Unary", e[e.Update = 17] = "Update", e[e.LeftHandSide = 18] = "LeftHandSide", e[e.Member = 19] = "Member", e[e.Primary = 20] = "Primary", e[
- e.Highest = 20
- /* Primary */
- ] = "Highest", e[
- e.Lowest = 0
- /* Comma */
- ] = "Lowest", e[e.Invalid = -1] = "Invalid", e))(eK || {});
- function S3(e, t, n) {
- switch (e) {
- case 355:
- return 0;
- case 230:
- return 1;
- case 229:
- return 2;
- case 227:
- return 4;
- case 226:
- switch (t) {
- case 28:
- return 0;
- case 64:
- case 65:
- case 66:
- case 68:
- case 67:
- case 69:
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- case 79:
- case 75:
- case 76:
- case 77:
- case 78:
- return 3;
- default:
- return T3(t);
- }
- case 216:
- case 235:
- case 224:
- case 221:
- case 222:
- case 220:
- case 223:
- return 16;
- case 225:
- return 17;
- case 213:
- return 18;
- case 214:
- return n ? 19 : 18;
- case 215:
- case 211:
- case 212:
- case 236:
- return 19;
- case 234:
- case 238:
- return 11;
- case 110:
- case 108:
- case 80:
- case 81:
- case 106:
- case 112:
- case 97:
- case 9:
- case 10:
- case 11:
- case 209:
- case 210:
- case 218:
- case 219:
- case 231:
- case 14:
- case 15:
- case 228:
- case 217:
- case 232:
- case 284:
- case 285:
- case 288:
- return 20;
- default:
- return -1;
- }
- }
- function T3(e) {
- switch (e) {
- case 61:
- return 4;
- case 57:
- return 5;
- case 56:
- return 6;
- case 52:
- return 7;
- case 53:
- return 8;
- case 51:
- return 9;
- case 35:
- case 36:
- case 37:
- case 38:
- return 10;
- case 30:
- case 32:
- case 33:
- case 34:
- case 104:
- case 103:
- case 130:
- case 152:
- return 11;
- case 48:
- case 49:
- case 50:
- return 12;
- case 40:
- case 41:
- return 13;
- case 42:
- case 44:
- case 45:
- return 14;
- case 43:
- return 15;
- }
- return -1;
- }
- function wC(e) {
- return Ln(e, (t) => {
- switch (t.kind) {
- case 294:
- return !!t.expression;
- case 12:
- return !t.containsOnlyTriviaWhiteSpaces;
- default:
- return !0;
- }
- });
- }
- function x3() {
- let e = [];
- const t = [], n = /* @__PURE__ */ new Map();
- let i = !1;
- return {
- add: o,
- lookup: s,
- getGlobalDiagnostics: c,
- getDiagnostics: _
- };
- function s(u) {
- let d;
- if (u.file ? d = n.get(u.file.fileName) : d = e, !d)
- return;
- const g = hy(d, u, go, RK);
- if (g >= 0)
- return d[g];
- if (~g > 0 && o5(u, d[~g - 1]))
- return d[~g - 1];
- }
- function o(u) {
- let d;
- u.file ? (d = n.get(u.file.fileName), d || (d = [], n.set(u.file.fileName, d), my(t, u.file.fileName, au))) : (i && (i = !1, e = e.slice()), d = e), my(d, u, RK, o5);
- }
- function c() {
- return i = !0, e;
- }
- function _(u) {
- if (u)
- return n.get(u) || [];
- const d = AE(t, (g) => n.get(g));
- return e.length && d.unshift(...e), d;
- }
- }
- var gOe = /\$\{/g;
- function xB(e) {
- return e.replace(gOe, "\\${");
- }
- function tK(e) {
- return !!((e.templateFlags || 0) & 2048);
- }
- function kB(e) {
- return e && !!(fS(e) ? tK(e) : tK(e.head) || ut(e.templateSpans, (t) => tK(t.literal)));
- }
- var hOe = /[\\"\u0000-\u001f\u2028\u2029\u0085]/g, yOe = /[\\'\u0000-\u001f\u2028\u2029\u0085]/g, vOe = /\r\n|[\\`\u0000-\u001f\u2028\u2029\u0085]/g, bOe = new Map(Object.entries({
- " ": "\\t",
- "\v": "\\v",
- "\f": "\\f",
- "\b": "\\b",
- "\r": "\\r",
- "\n": "\\n",
- "\\": "\\\\",
- '"': '\\"',
- "'": "\\'",
- "`": "\\`",
- "\u2028": "\\u2028",
- // lineSeparator
- "\u2029": "\\u2029",
- // paragraphSeparator
- " ": "\\u0085",
- // nextLine
- "\r\n": "\\r\\n"
- // special case for CRLFs in backticks
- }));
- function Ige(e) {
- return "\\u" + ("0000" + e.toString(16).toUpperCase()).slice(-4);
- }
- function SOe(e, t, n) {
- if (e.charCodeAt(0) === 0) {
- const i = n.charCodeAt(t + e.length);
- return i >= 48 && i <= 57 ? "\\x00" : "\\0";
- }
- return bOe.get(e) || Ige(e.charCodeAt(0));
- }
- function cg(e, t) {
- const n = t === 96 ? vOe : t === 39 ? yOe : hOe;
- return e.replace(n, SOe);
- }
- var Oge = /[^\u0000-\u007F]/g;
- function B7(e, t) {
- return e = cg(e, t), Oge.test(e) ? e.replace(Oge, (n) => Ige(n.charCodeAt(0))) : e;
- }
- var TOe = /["\u0000-\u001f\u2028\u2029\u0085]/g, xOe = /['\u0000-\u001f\u2028\u2029\u0085]/g, kOe = new Map(Object.entries({
- '"': """,
- "'": "'"
- }));
- function COe(e) {
- return "" + e.toString(16).toUpperCase() + ";";
- }
- function EOe(e) {
- return e.charCodeAt(0) === 0 ? "" : kOe.get(e) || COe(e.charCodeAt(0));
- }
- function CB(e, t) {
- const n = t === 39 ? xOe : TOe;
- return e.replace(n, EOe);
- }
- function ap(e) {
- const t = e.length;
- return t >= 2 && e.charCodeAt(0) === e.charCodeAt(t - 1) && DOe(e.charCodeAt(0)) ? e.substring(1, t - 1) : e;
- }
- function DOe(e) {
- return e === 39 || e === 34 || e === 96;
- }
- function AC(e) {
- const t = e.charCodeAt(0);
- return t >= 97 && t <= 122 || e.includes("-");
- }
- var k3 = ["", " "];
- function J7(e) {
- const t = k3[1];
- for (let n = k3.length; n <= e; n++)
- k3.push(k3[n - 1] + t);
- return k3[e];
- }
- function C3() {
- return k3[1].length;
- }
- function E3(e) {
- var t, n, i, s, o, c = !1;
- function _(D) {
- const P = BT(D);
- P.length > 1 ? (s = s + P.length - 1, o = t.length - D.length + _a(P), i = o - t.length === 0) : i = !1;
- }
- function u(D) {
- D && D.length && (i && (D = J7(n) + D, i = !1), t += D, _(D));
- }
- function d(D) {
- D && (c = !1), u(D);
- }
- function g(D) {
- D && (c = !0), u(D);
- }
- function h() {
- t = "", n = 0, i = !0, s = 0, o = 0, c = !1;
- }
- function S(D) {
- D !== void 0 && (t += D, _(D), c = !1);
- }
- function T(D) {
- D && D.length && d(D);
- }
- function C(D) {
- (!i || D) && (t += e, s++, o = t.length, i = !0, c = !1);
- }
- return h(), {
- write: d,
- rawWrite: S,
- writeLiteral: T,
- writeLine: C,
- increaseIndent: () => {
- n++;
- },
- decreaseIndent: () => {
- n--;
- },
- getIndent: () => n,
- getTextPos: () => t.length,
- getLine: () => s,
- getColumn: () => i ? n * C3() : t.length - o,
- getText: () => t,
- isAtStartOfLine: () => i,
- hasTrailingComment: () => c,
- hasTrailingWhitespace: () => !!t.length && Ng(t.charCodeAt(t.length - 1)),
- clear: h,
- writeKeyword: d,
- writeOperator: d,
- writeParameter: d,
- writeProperty: d,
- writePunctuation: d,
- writeSpace: d,
- writeStringLiteral: d,
- writeSymbol: (D, P) => d(D),
- writeTrailingSemicolon: d,
- writeComment: g
- };
- }
- function EB(e) {
- let t = !1;
- function n() {
- t && (e.writeTrailingSemicolon(";"), t = !1);
- }
- return {
- ...e,
- writeTrailingSemicolon() {
- t = !0;
- },
- writeLiteral(i) {
- n(), e.writeLiteral(i);
- },
- writeStringLiteral(i) {
- n(), e.writeStringLiteral(i);
- },
- writeSymbol(i, s) {
- n(), e.writeSymbol(i, s);
- },
- writePunctuation(i) {
- n(), e.writePunctuation(i);
- },
- writeKeyword(i) {
- n(), e.writeKeyword(i);
- },
- writeOperator(i) {
- n(), e.writeOperator(i);
- },
- writeParameter(i) {
- n(), e.writeParameter(i);
- },
- writeSpace(i) {
- n(), e.writeSpace(i);
- },
- writeProperty(i) {
- n(), e.writeProperty(i);
- },
- writeComment(i) {
- n(), e.writeComment(i);
- },
- writeLine() {
- n(), e.writeLine();
- },
- increaseIndent() {
- n(), e.increaseIndent();
- },
- decreaseIndent() {
- n(), e.decreaseIndent();
- }
- };
- }
- function sx(e) {
- return e.useCaseSensitiveFileNames ? e.useCaseSensitiveFileNames() : !1;
- }
- function S0(e) {
- return zl(sx(e));
- }
- function DB(e, t, n) {
- return t.moduleName || PB(e, t.fileName, n && n.fileName);
- }
- function Fge(e, t) {
- return e.getCanonicalFileName(es(t, e.getCurrentDirectory()));
- }
- function rK(e, t, n) {
- const i = t.getExternalModuleFileFromDeclaration(n);
- if (!i || i.isDeclarationFile)
- return;
- const s = KT(n);
- if (!(s && Xa(s) && !If(s.text) && !Fge(e, i.path).includes(Fge(e, ul(e.getCommonSourceDirectory())))))
- return DB(e, i);
- }
- function PB(e, t, n) {
- const i = (u) => e.getCanonicalFileName(u), s = uo(n ? Xn(n) : e.getCommonSourceDirectory(), e.getCurrentDirectory(), i), o = es(t, e.getCurrentDirectory()), c = jT(
- s,
- o,
- s,
- i,
- /*isAbsolutePathAnUrl*/
- !1
- ), _ = $u(c);
- return n ? q2(_) : _;
- }
- function nK(e, t, n) {
- const i = t.getCompilerOptions();
- let s;
- return i.outDir ? s = $u(q7(e, t, i.outDir)) : s = $u(e), s + n;
- }
- function iK(e, t) {
- return z7(e, t.getCompilerOptions(), t);
- }
- function z7(e, t, n) {
- const i = t.declarationDir || t.outDir, s = i ? aK(e, i, n.getCurrentDirectory(), n.getCommonSourceDirectory(), (c) => n.getCanonicalFileName(c)) : e, o = W7(s);
- return $u(s) + o;
- }
- function W7(e) {
- return xc(e, [
- ".mjs",
- ".mts"
- /* Mts */
- ]) ? ".d.mts" : xc(e, [
- ".cjs",
- ".cts"
- /* Cts */
- ]) ? ".d.cts" : xc(e, [
- ".json"
- /* Json */
- ]) ? ".d.json.ts" : (
- // Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well
- ".d.ts"
- );
- }
- function sK(e) {
- return xc(e, [
- ".d.mts",
- ".mjs",
- ".mts"
- /* Mts */
- ]) ? [
- ".mts",
- ".mjs"
- /* Mjs */
- ] : xc(e, [
- ".d.cts",
- ".cjs",
- ".cts"
- /* Cts */
- ]) ? [
- ".cts",
- ".cjs"
- /* Cjs */
- ] : xc(e, [".d.json.ts"]) ? [
- ".json"
- /* Json */
- ] : [
- ".tsx",
- ".ts",
- ".jsx",
- ".js"
- /* Js */
- ];
- }
- function U7(e, t) {
- var n;
- if (e.paths)
- return e.baseUrl ?? E.checkDefined(e.pathsBasePath || ((n = t.getCurrentDirectory) == null ? void 0 : n.call(t)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.");
- }
- function V7(e, t, n) {
- const i = e.getCompilerOptions();
- if (i.outFile) {
- const s = Ru(i), o = i.emitDeclarationOnly || s === 2 || s === 4;
- return Ln(
- e.getSourceFiles(),
- (c) => (o || !il(c)) && cS(c, e, n)
- );
- } else {
- const s = t === void 0 ? e.getSourceFiles() : [t];
- return Ln(
- s,
- (o) => cS(o, e, n)
- );
- }
- }
- function cS(e, t, n) {
- const i = t.getCompilerOptions();
- if (i.noEmitForJsFiles && Gu(e) || e.isDeclarationFile || t.isSourceFileFromExternalLibrary(e)) return !1;
- if (n) return !0;
- if (t.isSourceOfProjectReferenceRedirect(e.fileName)) return !1;
- if (!Rp(e)) return !0;
- if (t.getResolvedProjectReferenceToRedirect(e.fileName)) return !1;
- if (i.outFile) return !0;
- if (!i.outDir) return !1;
- if (i.rootDir || i.composite && i.configFilePath) {
- const s = es(LD(i, () => [], t.getCurrentDirectory(), t.getCanonicalFileName), t.getCurrentDirectory()), o = aK(e.fileName, i.outDir, t.getCurrentDirectory(), s, t.getCanonicalFileName);
- if (Sh(e.fileName, o, t.getCurrentDirectory(), !t.useCaseSensitiveFileNames()) === 0) return !1;
- }
- return !0;
- }
- function q7(e, t, n) {
- return aK(e, n, t.getCurrentDirectory(), t.getCommonSourceDirectory(), (i) => t.getCanonicalFileName(i));
- }
- function aK(e, t, n, i, s) {
- let o = es(e, n);
- return o = s(o).indexOf(s(i)) === 0 ? o.substring(i.length) : o, Bn(t, o);
- }
- function H7(e, t, n, i, s, o, c) {
- e.writeFile(
- n,
- i,
- s,
- (_) => {
- t.add(Go(p.Could_not_write_file_0_Colon_1, n, _));
- },
- o,
- c
- );
- }
- function Lge(e, t, n) {
- if (e.length > Km(e) && !n(e)) {
- const i = Xn(e);
- Lge(i, t, n), t(e);
- }
- }
- function wB(e, t, n, i, s, o) {
- try {
- i(e, t, n);
- } catch {
- Lge(Xn(Os(e)), s, o), i(e, t, n);
- }
- }
- function D4(e, t) {
- const n = Ag(e);
- return HE(n, t);
- }
- function NC(e, t) {
- return HE(e, t);
- }
- function Bg(e) {
- return On(e.members, (t) => Qo(t) && Mp(t.body));
- }
- function IC(e) {
- if (e && e.parameters.length > 0) {
- const t = e.parameters.length === 2 && Db(e.parameters[0]);
- return e.parameters[t ? 1 : 0];
- }
- }
- function oK(e) {
- const t = IC(e);
- return t && t.type;
- }
- function Eb(e) {
- if (e.parameters.length && !Lh(e)) {
- const t = e.parameters[0];
- if (Db(t))
- return t;
- }
- }
- function Db(e) {
- return Ly(e.name);
- }
- function Ly(e) {
- return !!e && e.kind === 80 && AB(e);
- }
- function ax(e) {
- return !!or(
- e,
- (t) => t.kind === 186 ? !0 : t.kind === 80 || t.kind === 166 ? !1 : "quit"
- );
- }
- function Pb(e) {
- if (!Ly(e))
- return !1;
- for (; Xu(e.parent) && e.parent.left === e; )
- e = e.parent;
- return e.parent.kind === 186;
- }
- function AB(e) {
- return e.escapedText === "this";
- }
- function My(e, t) {
- let n, i, s, o;
- return Dh(t) ? (n = t, t.kind === 177 ? s = t : t.kind === 178 ? o = t : E.fail("Accessor has wrong kind")) : ir(e, (c) => {
- if (Ay(c) && zs(c) === zs(t)) {
- const _ = oS(c.name), u = oS(t.name);
- _ === u && (n ? i || (i = c) : n = c, c.kind === 177 && !s && (s = c), c.kind === 178 && !o && (o = c));
- }
- }), {
- firstAccessor: n,
- secondAccessor: i,
- getAccessor: s,
- setAccessor: o
- };
- }
- function Gc(e) {
- if (!cn(e) && Ec(e) || Vp(e)) return;
- const t = e.type;
- return t || !cn(e) ? t : r4(e) ? e.typeExpression && e.typeExpression.type : q1(e);
- }
- function cK(e) {
- return e.type;
- }
- function Y_(e) {
- return Lh(e) ? e.type && e.type.typeExpression && e.type.typeExpression.type : e.type || (cn(e) ? kw(e) : void 0);
- }
- function G7(e) {
- return ta(H1(e), (t) => POe(t) ? t.typeParameters : void 0);
- }
- function POe(e) {
- return qp(e) && !(e.parent.kind === 320 && (e.parent.tags.some(Bp) || e.parent.tags.some(ZC)));
- }
- function lK(e) {
- const t = IC(e);
- return t && Gc(t);
- }
- function wOe(e, t, n, i) {
- AOe(e, t, n.pos, i);
- }
- function AOe(e, t, n, i) {
- i && i.length && n !== i[0].pos && NC(e, n) !== NC(e, i[0].pos) && t.writeLine();
- }
- function uK(e, t, n, i) {
- n !== i && NC(e, n) !== NC(e, i) && t.writeLine();
- }
- function NOe(e, t, n, i, s, o, c, _) {
- if (i && i.length > 0) {
- let u = !1;
- for (const d of i)
- u && (n.writeSpace(" "), u = !1), _(e, t, n, d.pos, d.end, c), d.hasTrailingNewLine ? n.writeLine() : u = !0;
- u && o && n.writeSpace(" ");
- }
- }
- function _K(e, t, n, i, s, o, c) {
- let _, u;
- if (c ? s.pos === 0 && (_ = Ln(Ig(e, s.pos), d)) : _ = Ig(e, s.pos), _) {
- const g = [];
- let h;
- for (const S of _) {
- if (h) {
- const T = NC(t, h.end);
- if (NC(t, S.pos) >= T + 2)
- break;
- }
- g.push(S), h = S;
- }
- if (g.length) {
- const S = NC(t, _a(g).end);
- NC(t, aa(e, s.pos)) >= S + 2 && (wOe(t, n, s, _), NOe(
- e,
- t,
- n,
- g,
- /*leadingSeparator*/
- !1,
- /*trailingSeparator*/
- !0,
- o,
- i
- ), u = { nodePos: s.pos, detachedCommentEndPos: _a(g).end });
- }
- }
- return u;
- function d(g) {
- return o7(e, g.pos);
- }
- }
- function OC(e, t, n, i, s, o) {
- if (e.charCodeAt(i + 1) === 42) {
- const c = nC(t, i), _ = t.length;
- let u;
- for (let d = i, g = c.line; d < s; g++) {
- const h = g + 1 === _ ? e.length + 1 : t[g + 1];
- if (d !== i) {
- u === void 0 && (u = Mge(e, t[c.line], i));
- const T = n.getIndent() * C3() - u + Mge(e, d, h);
- if (T > 0) {
- let C = T % C3();
- const D = J7((T - C) / C3());
- for (n.rawWrite(D); C; )
- n.rawWrite(" "), C--;
- } else
- n.rawWrite("");
- }
- IOe(e, s, n, o, d, h), d = h;
- }
- } else
- n.writeComment(e.substring(i, s));
- }
- function IOe(e, t, n, i, s, o) {
- const c = Math.min(t, o - 1), _ = e.substring(s, c).trim();
- _ ? (n.writeComment(_), c !== t && n.writeLine()) : n.rawWrite(i);
- }
- function Mge(e, t, n) {
- let i = 0;
- for (; t < n && sm(e.charCodeAt(t)); t++)
- e.charCodeAt(t) === 9 ? i += C3() - i % C3() : i++;
- return i;
- }
- function NB(e) {
- return Mu(e) !== 0;
- }
- function fK(e) {
- return T0(e) !== 0;
- }
- function Z_(e, t) {
- return !!ox(e, t);
- }
- function Gn(e, t) {
- return !!pK(e, t);
- }
- function zs(e) {
- return _l(e) && tl(e) || oc(e);
- }
- function tl(e) {
- return Gn(
- e,
- 256
- /* Static */
- );
- }
- function $7(e) {
- return Z_(
- e,
- 16
- /* Override */
- );
- }
- function wb(e) {
- return Gn(
- e,
- 64
- /* Abstract */
- );
- }
- function IB(e) {
- return Gn(
- e,
- 128
- /* Ambient */
- );
- }
- function dm(e) {
- return Gn(
- e,
- 512
- /* Accessor */
- );
- }
- function P4(e) {
- return Z_(
- e,
- 8
- /* Readonly */
- );
- }
- function Ff(e) {
- return Gn(
- e,
- 32768
- /* Decorator */
- );
- }
- function ox(e, t) {
- return Mu(e) & t;
- }
- function pK(e, t) {
- return T0(e) & t;
- }
- function dK(e, t, n) {
- return e.kind >= 0 && e.kind <= 165 ? 0 : (e.modifierFlagsCache & 536870912 || (e.modifierFlagsCache = OB(e) | 536870912), n || t && cn(e) ? (!(e.modifierFlagsCache & 268435456) && e.parent && (e.modifierFlagsCache |= Rge(e) | 268435456), jge(e.modifierFlagsCache)) : OOe(e.modifierFlagsCache));
- }
- function Mu(e) {
- return dK(
- e,
- /*includeJSDoc*/
- !0
- );
- }
- function mK(e) {
- return dK(
- e,
- /*includeJSDoc*/
- !0,
- /*alwaysIncludeJSDoc*/
- !0
- );
- }
- function T0(e) {
- return dK(
- e,
- /*includeJSDoc*/
- !1
- );
- }
- function Rge(e) {
- let t = 0;
- return e.parent && !Ii(e) && (cn(e) && (CY(e) && (t |= 8388608), EY(e) && (t |= 16777216), DY(e) && (t |= 33554432), PY(e) && (t |= 67108864), wY(e) && (t |= 134217728)), AY(e) && (t |= 65536)), t;
- }
- function OOe(e) {
- return e & 65535;
- }
- function jge(e) {
- return e & 131071 | (e & 260046848) >>> 23;
- }
- function FOe(e) {
- return jge(Rge(e));
- }
- function gK(e) {
- return OB(e) | FOe(e);
- }
- function OB(e) {
- let t = Hp(e) ? mm(e.modifiers) : 0;
- return (e.flags & 8 || e.kind === 80 && e.flags & 4096) && (t |= 32), t;
- }
- function mm(e) {
- let t = 0;
- if (e)
- for (const n of e)
- t |= cx(n.kind);
- return t;
- }
- function cx(e) {
- switch (e) {
- case 126:
- return 256;
- case 125:
- return 1;
- case 124:
- return 4;
- case 123:
- return 2;
- case 128:
- return 64;
- case 129:
- return 512;
- case 95:
- return 32;
- case 138:
- return 128;
- case 87:
- return 4096;
- case 90:
- return 2048;
- case 134:
- return 1024;
- case 148:
- return 8;
- case 164:
- return 16;
- case 103:
- return 8192;
- case 147:
- return 16384;
- case 170:
- return 32768;
- }
- return 0;
- }
- function D3(e) {
- return e === 57 || e === 56;
- }
- function hK(e) {
- return D3(e) || e === 54;
- }
- function w4(e) {
- return e === 76 || e === 77 || e === 78;
- }
- function FB(e) {
- return dn(e) && w4(e.operatorToken.kind);
- }
- function X7(e) {
- return D3(e) || e === 61;
- }
- function P3(e) {
- return dn(e) && X7(e.operatorToken.kind);
- }
- function Ph(e) {
- return e >= 64 && e <= 79;
- }
- function LB(e) {
- const t = MB(e);
- return t && !t.isImplements ? t.class : void 0;
- }
- function MB(e) {
- if (Oh(e)) {
- if (ef(e.parent) && Zn(e.parent.parent))
- return {
- class: e.parent.parent,
- isImplements: e.parent.token === 119
- /* ImplementsKeyword */
- };
- if (Mx(e.parent)) {
- const t = tv(e.parent);
- if (t && Zn(t))
- return { class: t, isImplements: !1 };
- }
- }
- }
- function Dl(e, t) {
- return dn(e) && (t ? e.operatorToken.kind === 64 : Ph(e.operatorToken.kind)) && __(e.left);
- }
- function x0(e) {
- if (Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- )) {
- const t = e.left.kind;
- return t === 210 || t === 209;
- }
- return !1;
- }
- function Q7(e) {
- return LB(e) !== void 0;
- }
- function yo(e) {
- return e.kind === 80 || A3(e);
- }
- function E_(e) {
- switch (e.kind) {
- case 80:
- return e;
- case 166:
- do
- e = e.left;
- while (e.kind !== 80);
- return e;
- case 211:
- do
- e = e.expression;
- while (e.kind !== 80);
- return e;
- }
- }
- function w3(e) {
- return e.kind === 80 || e.kind === 110 || e.kind === 108 || e.kind === 236 || e.kind === 211 && w3(e.expression) || e.kind === 217 && w3(e.expression);
- }
- function A3(e) {
- return Cn(e) && Oe(e.name) && yo(e.expression);
- }
- function N3(e) {
- if (Cn(e)) {
- const t = N3(e.expression);
- if (t !== void 0)
- return t + "." + $_(e.name);
- } else if (ko(e)) {
- const t = N3(e.expression);
- if (t !== void 0 && Bc(e.argumentExpression))
- return t + "." + oS(e.argumentExpression);
- } else {
- if (Oe(e))
- return Ei(e.escapedText);
- if (Nd(e))
- return Q4(e);
- }
- }
- function Ry(e) {
- return Tb(e) && Eh(e) === "prototype";
- }
- function A4(e) {
- return e.parent.kind === 166 && e.parent.right === e || e.parent.kind === 211 && e.parent.name === e || e.parent.kind === 236 && e.parent.name === e;
- }
- function RB(e) {
- return !!e.parent && (Cn(e.parent) && e.parent.name === e || ko(e.parent) && e.parent.argumentExpression === e);
- }
- function yK(e) {
- return Xu(e.parent) && e.parent.right === e || Cn(e.parent) && e.parent.name === e || dv(e.parent) && e.parent.right === e;
- }
- function Y7(e) {
- return dn(e) && e.operatorToken.kind === 104;
- }
- function vK(e) {
- return Y7(e.parent) && e === e.parent.right;
- }
- function jB(e) {
- return e.kind === 210 && e.properties.length === 0;
- }
- function bK(e) {
- return e.kind === 209 && e.elements.length === 0;
- }
- function N4(e) {
- if (!(!LOe(e) || !e.declarations)) {
- for (const t of e.declarations)
- if (t.localSymbol) return t.localSymbol;
- }
- }
- function LOe(e) {
- return e && Nr(e.declarations) > 0 && Gn(
- e.declarations[0],
- 2048
- /* Default */
- );
- }
- function Z7(e) {
- return On(lFe, (t) => qo(e, t));
- }
- function MOe(e) {
- const t = [], n = e.length;
- for (let i = 0; i < n; i++) {
- const s = e.charCodeAt(i);
- s < 128 ? t.push(s) : s < 2048 ? (t.push(s >> 6 | 192), t.push(s & 63 | 128)) : s < 65536 ? (t.push(s >> 12 | 224), t.push(s >> 6 & 63 | 128), t.push(s & 63 | 128)) : s < 131072 ? (t.push(s >> 18 | 240), t.push(s >> 12 & 63 | 128), t.push(s >> 6 & 63 | 128), t.push(s & 63 | 128)) : E.assert(!1, "Unexpected code point");
- }
- return t;
- }
- var lx = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- function SK(e) {
- let t = "";
- const n = MOe(e);
- let i = 0;
- const s = n.length;
- let o, c, _, u;
- for (; i < s; )
- o = n[i] >> 2, c = (n[i] & 3) << 4 | n[i + 1] >> 4, _ = (n[i + 1] & 15) << 2 | n[i + 2] >> 6, u = n[i + 2] & 63, i + 1 >= s ? _ = u = 64 : i + 2 >= s && (u = 64), t += lx.charAt(o) + lx.charAt(c) + lx.charAt(_) + lx.charAt(u), i += 3;
- return t;
- }
- function ROe(e) {
- let t = "", n = 0;
- const i = e.length;
- for (; n < i; ) {
- const s = e[n];
- if (s < 128)
- t += String.fromCharCode(s), n++;
- else if ((s & 192) === 192) {
- let o = s & 63;
- n++;
- let c = e[n];
- for (; (c & 192) === 128; )
- o = o << 6 | c & 63, n++, c = e[n];
- t += String.fromCharCode(o);
- } else
- t += String.fromCharCode(s), n++;
- }
- return t;
- }
- function TK(e, t) {
- return e && e.base64encode ? e.base64encode(t) : SK(t);
- }
- function xK(e, t) {
- if (e && e.base64decode)
- return e.base64decode(t);
- const n = t.length, i = [];
- let s = 0;
- for (; s < n && t.charCodeAt(s) !== lx.charCodeAt(64); ) {
- const o = lx.indexOf(t[s]), c = lx.indexOf(t[s + 1]), _ = lx.indexOf(t[s + 2]), u = lx.indexOf(t[s + 3]), d = (o & 63) << 2 | c >> 4 & 3, g = (c & 15) << 4 | _ >> 2 & 15, h = (_ & 3) << 6 | u & 63;
- g === 0 && _ !== 0 ? i.push(d) : h === 0 && u !== 0 ? i.push(d, g) : i.push(d, g, h), s += 4;
- }
- return ROe(i);
- }
- function BB(e, t) {
- const n = _s(t) ? t : t.readFile(e);
- if (!n) return;
- const i = Sz(e, n);
- return i.error ? void 0 : i.config;
- }
- function I4(e, t) {
- return BB(e, t) || {};
- }
- function K7(e) {
- try {
- return JSON.parse(e);
- } catch {
- return;
- }
- }
- function Dd(e, t) {
- return !t.directoryExists || t.directoryExists(e);
- }
- var jOe = `\r
-`, BOe = `
-`;
- function k0(e) {
- switch (e.newLine) {
- case 0:
- return jOe;
- case 1:
- case void 0:
- return BOe;
- }
- }
- function op(e, t = e) {
- return E.assert(t >= e || t === -1), { pos: e, end: t };
- }
- function e5(e, t) {
- return op(e.pos, t);
- }
- function sv(e, t) {
- return op(t, e.end);
- }
- function wh(e) {
- const t = Hp(e) ? ob(e.modifiers, dl) : void 0;
- return t && !Pd(t.end) ? sv(e, t.end) : e;
- }
- function gm(e) {
- if (cs(e) || hc(e))
- return sv(e, e.name.pos);
- const t = Hp(e) ? Ro(e.modifiers) : void 0;
- return t && !Pd(t.end) ? sv(e, t.end) : wh(e);
- }
- function JB(e, t) {
- return op(e, e + qs(t).length);
- }
- function lS(e, t) {
- return CK(e, e, t);
- }
- function t5(e, t, n) {
- return cp(
- O4(
- e,
- n,
- /*includeComments*/
- !1
- ),
- O4(
- t,
- n,
- /*includeComments*/
- !1
- ),
- n
- );
- }
- function kK(e, t, n) {
- return cp(e.end, t.end, n);
- }
- function CK(e, t, n) {
- return cp(O4(
- e,
- n,
- /*includeComments*/
- !1
- ), t.end, n);
- }
- function I3(e, t, n) {
- return cp(e.end, O4(
- t,
- n,
- /*includeComments*/
- !1
- ), n);
- }
- function zB(e, t, n, i) {
- const s = O4(t, n, i);
- return GE(n, e.end, s);
- }
- function Bge(e, t, n) {
- return GE(n, e.end, t.end);
- }
- function EK(e, t) {
- return !cp(e.pos, e.end, t);
- }
- function cp(e, t, n) {
- return GE(n, e, t) === 0;
- }
- function O4(e, t, n) {
- return Pd(e.pos) ? -1 : aa(
- t.text,
- e.pos,
- /*stopAfterLineBreak*/
- !1,
- n
- );
- }
- function DK(e, t, n, i) {
- const s = aa(
- n.text,
- e,
- /*stopAfterLineBreak*/
- !1,
- i
- ), o = JOe(s, t, n);
- return GE(n, o ?? t, s);
- }
- function PK(e, t, n, i) {
- const s = aa(
- n.text,
- e,
- /*stopAfterLineBreak*/
- !1,
- i
- );
- return GE(n, e, Math.min(t, s));
- }
- function JOe(e, t = 0, n) {
- for (; e-- > t; )
- if (!Ng(n.text.charCodeAt(e)))
- return e;
- }
- function WB(e) {
- const t = fs(e);
- if (t)
- switch (t.parent.kind) {
- case 266:
- case 267:
- return t === t.parent.name;
- }
- return !1;
- }
- function F4(e) {
- return Ln(e.declarations, O3);
- }
- function O3(e) {
- return ii(e) && e.initializer !== void 0;
- }
- function UB(e) {
- return e.watch && co(e, "watch");
- }
- function fd(e) {
- e.close();
- }
- function gc(e) {
- return e.flags & 33554432 ? e.links.checkFlags : 0;
- }
- function lp(e, t = !1) {
- if (e.valueDeclaration) {
- const n = t && e.declarations && On(e.declarations, K_) || e.flags & 32768 && On(e.declarations, Lf) || e.valueDeclaration, i = U1(n);
- return e.parent && e.parent.flags & 32 ? i : i & -8;
- }
- if (gc(e) & 6) {
- const n = e.links.checkFlags, i = n & 1024 ? 2 : n & 256 ? 1 : 4, s = n & 2048 ? 256 : 0;
- return i | s;
- }
- return e.flags & 4194304 ? 257 : 0;
- }
- function Hl(e, t) {
- return e.flags & 2097152 ? t.getAliasedSymbol(e) : e;
- }
- function FC(e) {
- return e.exportSymbol ? e.exportSymbol.flags | e.flags : e.flags;
- }
- function r5(e) {
- return L4(e) === 1;
- }
- function ux(e) {
- return L4(e) !== 0;
- }
- function L4(e) {
- const { parent: t } = e;
- switch (t?.kind) {
- case 217:
- return L4(t);
- case 225:
- case 224:
- const { operator: n } = t;
- return n === 46 || n === 47 ? 2 : 0;
- case 226:
- const { left: i, operatorToken: s } = t;
- return i === e && Ph(s.kind) ? s.kind === 64 ? 1 : 2 : 0;
- case 211:
- return t.name !== e ? 0 : L4(t);
- case 303: {
- const o = L4(t.parent);
- return e === t.name ? zOe(o) : o;
- }
- case 304:
- return e === t.objectAssignmentInitializer ? 0 : L4(t.parent);
- case 209:
- return L4(t);
- default:
- return 0;
- }
- }
- function zOe(e) {
- switch (e) {
- case 0:
- return 1;
- case 1:
- return 0;
- case 2:
- return 2;
- default:
- return E.assertNever(e);
- }
- }
- function VB(e, t) {
- if (!e || !t || Object.keys(e).length !== Object.keys(t).length)
- return !1;
- for (const n in e)
- if (typeof e[n] == "object") {
- if (!VB(e[n], t[n]))
- return !1;
- } else if (typeof e[n] != "function" && e[n] !== t[n])
- return !1;
- return !0;
- }
- function D_(e, t) {
- e.forEach(t), e.clear();
- }
- function Jg(e, t, n) {
- const { onDeleteValue: i, onExistingValue: s } = n;
- e.forEach((o, c) => {
- var _;
- t?.has(c) ? s && s(o, (_ = t.get) == null ? void 0 : _.call(t, c), c) : (e.delete(c), i(o, c));
- });
- }
- function M4(e, t, n) {
- Jg(e, t, n);
- const { createNewValue: i } = n;
- t?.forEach((s, o) => {
- e.has(o) || e.set(o, i(o, s));
- });
- }
- function wK(e) {
- if (e.flags & 32) {
- const t = Ah(e);
- return !!t && Gn(
- t,
- 64
- /* Abstract */
- );
- }
- return !1;
- }
- function Ah(e) {
- var t;
- return (t = e.declarations) == null ? void 0 : t.find(Zn);
- }
- function wn(e) {
- return e.flags & 3899393 ? e.objectFlags : 0;
- }
- function n5(e) {
- return !!e && !!e.declarations && !!e.declarations[0] && iA(e.declarations[0]);
- }
- function AK({ moduleSpecifier: e }) {
- return oa(e) ? e.text : nc(e);
- }
- function qB(e) {
- let t;
- return bs(e, (n) => {
- Mp(n) && (t = n);
- }, (n) => {
- for (let i = n.length - 1; i >= 0; i--)
- if (Mp(n[i])) {
- t = n[i];
- break;
- }
- }), t;
- }
- function zp(e, t, n = !0) {
- return e.has(t) ? !1 : (e.set(t, n), !0);
- }
- function _x(e) {
- return Zn(e) || Xl(e) || Qu(e);
- }
- function HB(e) {
- return e >= 182 && e <= 205 || e === 133 || e === 159 || e === 150 || e === 163 || e === 151 || e === 136 || e === 154 || e === 155 || e === 116 || e === 157 || e === 146 || e === 141 || e === 233 || e === 312 || e === 313 || e === 314 || e === 315 || e === 316 || e === 317 || e === 318;
- }
- function xo(e) {
- return e.kind === 211 || e.kind === 212;
- }
- function GB(e) {
- return e.kind === 211 ? e.name : (E.assert(
- e.kind === 212
- /* ElementAccessExpression */
- ), e.argumentExpression);
- }
- function i5(e) {
- return e.kind === 275 || e.kind === 279;
- }
- function LC(e) {
- for (; xo(e); )
- e = e.expression;
- return e;
- }
- function NK(e, t) {
- if (xo(e.parent) && RB(e))
- return n(e.parent);
- function n(i) {
- if (i.kind === 211) {
- const s = t(i.name);
- if (s !== void 0)
- return s;
- } else if (i.kind === 212)
- if (Oe(i.argumentExpression) || Xa(i.argumentExpression)) {
- const s = t(i.argumentExpression);
- if (s !== void 0)
- return s;
- } else
- return;
- if (xo(i.expression))
- return n(i.expression);
- if (Oe(i.expression))
- return t(i.expression);
- }
- }
- function MC(e, t) {
- for (; ; ) {
- switch (e.kind) {
- case 225:
- e = e.operand;
- continue;
- case 226:
- e = e.left;
- continue;
- case 227:
- e = e.condition;
- continue;
- case 215:
- e = e.tag;
- continue;
- case 213:
- if (t)
- return e;
- case 234:
- case 212:
- case 211:
- case 235:
- case 354:
- case 238:
- e = e.expression;
- continue;
- }
- return e;
- }
- }
- function WOe(e, t) {
- this.flags = e, this.escapedName = t, this.declarations = void 0, this.valueDeclaration = void 0, this.id = 0, this.mergeId = 0, this.parent = void 0, this.members = void 0, this.exports = void 0, this.exportSymbol = void 0, this.constEnumOnlyModule = void 0, this.isReferenced = void 0, this.lastAssignmentPos = void 0, this.links = void 0;
- }
- function UOe(e, t) {
- this.flags = t, (E.isDebugging || rn) && (this.checker = e);
- }
- function VOe(e, t) {
- this.flags = t, E.isDebugging && (this.checker = e);
- }
- function IK(e, t, n) {
- this.pos = t, this.end = n, this.kind = e, this.id = 0, this.flags = 0, this.modifierFlagsCache = 0, this.transformFlags = 0, this.parent = void 0, this.original = void 0, this.emitNode = void 0;
- }
- function qOe(e, t, n) {
- this.pos = t, this.end = n, this.kind = e, this.id = 0, this.flags = 0, this.transformFlags = 0, this.parent = void 0, this.emitNode = void 0;
- }
- function HOe(e, t, n) {
- this.pos = t, this.end = n, this.kind = e, this.id = 0, this.flags = 0, this.transformFlags = 0, this.parent = void 0, this.original = void 0, this.emitNode = void 0;
- }
- function GOe(e, t, n) {
- this.fileName = e, this.text = t, this.skipTrivia = n || ((i) => i);
- }
- var Gl = {
- getNodeConstructor: () => IK,
- getTokenConstructor: () => qOe,
- getIdentifierConstructor: () => HOe,
- getPrivateIdentifierConstructor: () => IK,
- getSourceFileConstructor: () => IK,
- getSymbolConstructor: () => WOe,
- getTypeConstructor: () => UOe,
- getSignatureConstructor: () => VOe,
- getSourceMapSourceConstructor: () => GOe
- }, Jge = [];
- function zge(e) {
- Jge.push(e), e(Gl);
- }
- function OK(e) {
- Object.assign(Gl, e), ir(Jge, (t) => t(Gl));
- }
- function zg(e, t) {
- return e.replace(/\{(\d+)\}/g, (n, i) => "" + E.checkDefined(t[+i]));
- }
- var s5;
- function FK(e) {
- s5 = e;
- }
- function LK(e) {
- !s5 && e && (s5 = e());
- }
- function ms(e) {
- return s5 && s5[e.key] || e.message;
- }
- function fx(e, t, n, i, s, ...o) {
- n + i > t.length && (i = t.length - n), gZ(t, n, i);
- let c = ms(s);
- return ut(o) && (c = zg(c, o)), {
- file: void 0,
- start: n,
- length: i,
- messageText: c,
- category: s.category,
- code: s.code,
- reportsUnnecessary: s.reportsUnnecessary,
- fileName: e
- };
- }
- function $Oe(e) {
- return e.file === void 0 && e.start !== void 0 && e.length !== void 0 && typeof e.fileName == "string";
- }
- function Wge(e, t) {
- const n = t.fileName || "", i = t.text.length;
- E.assertEqual(e.fileName, n), E.assertLessThanOrEqual(e.start, i), E.assertLessThanOrEqual(e.start + e.length, i);
- const s = {
- file: t,
- start: e.start,
- length: e.length,
- messageText: e.messageText,
- category: e.category,
- code: e.code,
- reportsUnnecessary: e.reportsUnnecessary
- };
- if (e.relatedInformation) {
- s.relatedInformation = [];
- for (const o of e.relatedInformation)
- $Oe(o) && o.fileName === n ? (E.assertLessThanOrEqual(o.start, i), E.assertLessThanOrEqual(o.start + o.length, i), s.relatedInformation.push(Wge(o, t))) : s.relatedInformation.push(o);
- }
- return s;
- }
- function px(e, t) {
- const n = [];
- for (const i of e)
- n.push(Wge(i, t));
- return n;
- }
- function fl(e, t, n, i, ...s) {
- gZ(e.text, t, n);
- let o = ms(i);
- return ut(s) && (o = zg(o, s)), {
- file: e,
- start: t,
- length: n,
- messageText: o,
- category: i.category,
- code: i.code,
- reportsUnnecessary: i.reportsUnnecessary,
- reportsDeprecated: i.reportsDeprecated
- };
- }
- function dx(e, ...t) {
- let n = ms(e);
- return ut(t) && (n = zg(n, t)), n;
- }
- function Go(e, ...t) {
- let n = ms(e);
- return ut(t) && (n = zg(n, t)), {
- file: void 0,
- start: void 0,
- length: void 0,
- messageText: n,
- category: e.category,
- code: e.code,
- reportsUnnecessary: e.reportsUnnecessary,
- reportsDeprecated: e.reportsDeprecated
- };
- }
- function a5(e, t) {
- return {
- file: void 0,
- start: void 0,
- length: void 0,
- code: e.code,
- category: e.category,
- messageText: e.next ? e : e.messageText,
- relatedInformation: t
- };
- }
- function vs(e, t, ...n) {
- let i = ms(t);
- return ut(n) && (i = zg(i, n)), {
- messageText: i,
- category: t.category,
- code: t.code,
- next: e === void 0 || Array.isArray(e) ? e : [e]
- };
- }
- function MK(e, t) {
- let n = e;
- for (; n.next; )
- n = n.next[0];
- n.next = [t];
- }
- function $B(e) {
- return e.file ? e.file.path : void 0;
- }
- function R4(e, t) {
- return RK(e, t) || XOe(e, t) || 0;
- }
- function RK(e, t) {
- const n = XB(e), i = XB(t);
- return au($B(e), $B(t)) || ho(e.start, t.start) || ho(e.length, t.length) || ho(n, i) || QOe(e, t) || 0;
- }
- function XOe(e, t) {
- return !e.relatedInformation && !t.relatedInformation ? 0 : e.relatedInformation && t.relatedInformation ? ho(t.relatedInformation.length, e.relatedInformation.length) || ir(e.relatedInformation, (n, i) => {
- const s = t.relatedInformation[i];
- return R4(n, s);
- }) || 0 : e.relatedInformation ? -1 : 1;
- }
- function QOe(e, t) {
- let n = QB(e), i = QB(t);
- typeof n != "string" && (n = n.messageText), typeof i != "string" && (i = i.messageText);
- const s = typeof e.messageText != "string" ? e.messageText.next : void 0, o = typeof t.messageText != "string" ? t.messageText.next : void 0;
- let c = au(n, i);
- return c || (c = YOe(s, o), c) ? c : e.canonicalHead && !t.canonicalHead ? -1 : t.canonicalHead && !e.canonicalHead ? 1 : 0;
- }
- function YOe(e, t) {
- return e === void 0 && t === void 0 ? 0 : e === void 0 ? 1 : t === void 0 ? -1 : Uge(e, t) || Vge(e, t);
- }
- function Uge(e, t) {
- if (e === void 0 && t === void 0)
- return 0;
- if (e === void 0)
- return 1;
- if (t === void 0)
- return -1;
- let n = ho(t.length, e.length);
- if (n)
- return n;
- for (let i = 0; i < t.length; i++)
- if (n = Uge(e[i].next, t[i].next), n)
- return n;
- return 0;
- }
- function Vge(e, t) {
- let n;
- for (let i = 0; i < t.length; i++) {
- if (n = au(e[i].messageText, t[i].messageText), n)
- return n;
- if (e[i].next !== void 0 && (n = Vge(e[i].next, t[i].next), n))
- return n;
- }
- return 0;
- }
- function o5(e, t) {
- const n = XB(e), i = XB(t), s = QB(e), o = QB(t);
- return au($B(e), $B(t)) === 0 && ho(e.start, t.start) === 0 && ho(e.length, t.length) === 0 && ho(n, i) === 0 && ZOe(s, o);
- }
- function XB(e) {
- var t;
- return ((t = e.canonicalHead) == null ? void 0 : t.code) || e.code;
- }
- function QB(e) {
- var t;
- return ((t = e.canonicalHead) == null ? void 0 : t.messageText) || e.messageText;
- }
- function ZOe(e, t) {
- const n = typeof e == "string" ? e : e.messageText, i = typeof t == "string" ? t : t.messageText;
- return au(n, i) === 0;
- }
- function F3(e) {
- return e === 4 || e === 2 || e === 1 || e === 6 ? 1 : 0;
- }
- function qge(e) {
- if (e.transformFlags & 2)
- return ou(e) || zb(e) ? e : bs(e, qge);
- }
- function KOe(e) {
- return e.isDeclarationFile ? void 0 : qge(e);
- }
- function eFe(e, t) {
- return (PS(e, t) === 99 || xc(e.fileName, [
- ".cjs",
- ".cts",
- ".mjs",
- ".mts"
- /* Mts */
- ])) && !e.isDeclarationFile ? !0 : void 0;
- }
- function L3(e) {
- switch (jK(e)) {
- case 3:
- return (s) => {
- s.externalModuleIndicator = dA(s) || !s.isDeclarationFile || void 0;
- };
- case 1:
- return (s) => {
- s.externalModuleIndicator = dA(s);
- };
- case 2:
- const t = [dA];
- (e.jsx === 4 || e.jsx === 5) && t.push(KOe), t.push(eFe);
- const n = Nf(...t);
- return (s) => void (s.externalModuleIndicator = n(s, e));
- }
- }
- function YB(e) {
- const t = yu(e);
- return 3 <= t && t <= 99 || M3(e) || c5(e);
- }
- function Y_t(e) {
- return e;
- }
- var rl = {
- target: {
- dependencies: ["module"],
- computeValue: (e) => (e.target === 0 ? void 0 : e.target) ?? (e.module === 100 && 9 || e.module === 199 && 99 || 1)
- },
- module: {
- dependencies: ["target"],
- computeValue: (e) => typeof e.module == "number" ? e.module : rl.target.computeValue(e) >= 2 ? 5 : 1
- },
- moduleResolution: {
- dependencies: ["module", "target"],
- computeValue: (e) => {
- let t = e.moduleResolution;
- if (t === void 0)
- switch (rl.module.computeValue(e)) {
- case 1:
- t = 2;
- break;
- case 100:
- t = 3;
- break;
- case 199:
- t = 99;
- break;
- case 200:
- t = 100;
- break;
- default:
- t = 1;
- break;
- }
- return t;
- }
- },
- moduleDetection: {
- dependencies: ["module", "target"],
- computeValue: (e) => e.moduleDetection || (rl.module.computeValue(e) === 100 || rl.module.computeValue(e) === 199 ? 3 : 2)
- },
- isolatedModules: {
- dependencies: ["verbatimModuleSyntax"],
- computeValue: (e) => !!(e.isolatedModules || e.verbatimModuleSyntax)
- },
- esModuleInterop: {
- dependencies: ["module", "target"],
- computeValue: (e) => {
- if (e.esModuleInterop !== void 0)
- return e.esModuleInterop;
- switch (rl.module.computeValue(e)) {
- case 100:
- case 199:
- case 200:
- return !0;
- }
- return !1;
- }
- },
- allowSyntheticDefaultImports: {
- dependencies: ["module", "target", "moduleResolution"],
- computeValue: (e) => e.allowSyntheticDefaultImports !== void 0 ? e.allowSyntheticDefaultImports : rl.esModuleInterop.computeValue(e) || rl.module.computeValue(e) === 4 || rl.moduleResolution.computeValue(e) === 100
- },
- resolvePackageJsonExports: {
- dependencies: ["moduleResolution"],
- computeValue: (e) => {
- const t = rl.moduleResolution.computeValue(e);
- if (!RC(t))
- return !1;
- if (e.resolvePackageJsonExports !== void 0)
- return e.resolvePackageJsonExports;
- switch (t) {
- case 3:
- case 99:
- case 100:
- return !0;
- }
- return !1;
- }
- },
- resolvePackageJsonImports: {
- dependencies: ["moduleResolution", "resolvePackageJsonExports"],
- computeValue: (e) => {
- const t = rl.moduleResolution.computeValue(e);
- if (!RC(t))
- return !1;
- if (e.resolvePackageJsonExports !== void 0)
- return e.resolvePackageJsonExports;
- switch (t) {
- case 3:
- case 99:
- case 100:
- return !0;
- }
- return !1;
- }
- },
- resolveJsonModule: {
- dependencies: ["moduleResolution", "module", "target"],
- computeValue: (e) => e.resolveJsonModule !== void 0 ? e.resolveJsonModule : rl.moduleResolution.computeValue(e) === 100
- },
- declaration: {
- dependencies: ["composite"],
- computeValue: (e) => !!(e.declaration || e.composite)
- },
- preserveConstEnums: {
- dependencies: ["isolatedModules", "verbatimModuleSyntax"],
- computeValue: (e) => !!(e.preserveConstEnums || rl.isolatedModules.computeValue(e))
- },
- incremental: {
- dependencies: ["composite"],
- computeValue: (e) => !!(e.incremental || e.composite)
- },
- declarationMap: {
- dependencies: ["declaration", "composite"],
- computeValue: (e) => !!(e.declarationMap && rl.declaration.computeValue(e))
- },
- allowJs: {
- dependencies: ["checkJs"],
- computeValue: (e) => e.allowJs === void 0 ? !!e.checkJs : e.allowJs
- },
- useDefineForClassFields: {
- dependencies: ["target", "module"],
- computeValue: (e) => e.useDefineForClassFields === void 0 ? rl.target.computeValue(e) >= 9 : e.useDefineForClassFields
- },
- noImplicitAny: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "noImplicitAny")
- },
- noImplicitThis: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "noImplicitThis")
- },
- strictNullChecks: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "strictNullChecks")
- },
- strictFunctionTypes: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "strictFunctionTypes")
- },
- strictBindCallApply: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "strictBindCallApply")
- },
- strictPropertyInitialization: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "strictPropertyInitialization")
- },
- strictBuiltinIteratorReturn: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "strictBuiltinIteratorReturn")
- },
- alwaysStrict: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "alwaysStrict")
- },
- useUnknownInCatchVariables: {
- dependencies: ["strict"],
- computeValue: (e) => cu(e, "useUnknownInCatchVariables")
- }
- }, pa = rl.target.computeValue, Ru = rl.module.computeValue, yu = rl.moduleResolution.computeValue, jK = rl.moduleDetection.computeValue, Wp = rl.isolatedModules.computeValue, Wg = rl.esModuleInterop.computeValue, mx = rl.allowSyntheticDefaultImports.computeValue, M3 = rl.resolvePackageJsonExports.computeValue, c5 = rl.resolvePackageJsonImports.computeValue, Ab = rl.resolveJsonModule.computeValue, P_ = rl.declaration.computeValue, jy = rl.preserveConstEnums.computeValue, Nb = rl.incremental.computeValue, l5 = rl.declarationMap.computeValue, By = rl.allowJs.computeValue, R3 = rl.useDefineForClassFields.computeValue;
- function j3(e) {
- return e >= 5 && e <= 99;
- }
- function u5(e) {
- switch (Ru(e)) {
- case 0:
- case 4:
- case 3:
- return !1;
- }
- return !0;
- }
- function BK(e) {
- return e.allowUnreachableCode === !1;
- }
- function JK(e) {
- return e.allowUnusedLabels === !1;
- }
- function RC(e) {
- return e >= 3 && e <= 99 || e === 100;
- }
- function cu(e, t) {
- return e[t] === void 0 ? !!e.strict : !!e[t];
- }
- function _5(e) {
- return El(dz.type, (t, n) => t === e ? n : void 0);
- }
- function ZB(e) {
- return e.useDefineForClassFields !== !1 && pa(e) >= 9;
- }
- function zK(e, t) {
- return pC(t, e, Rte);
- }
- function WK(e, t) {
- return pC(t, e, jte);
- }
- function UK(e, t) {
- return pC(t, e, Bte);
- }
- function f5(e, t) {
- return t.strictFlag ? cu(e, t.name) : t.allowJsFlag ? By(e) : e[t.name];
- }
- function p5(e) {
- const t = e.jsx;
- return t === 2 || t === 4 || t === 5;
- }
- function d5(e, t) {
- const n = t?.pragmas.get("jsximportsource"), i = us(n) ? n[n.length - 1] : n, s = t?.pragmas.get("jsxruntime"), o = us(s) ? s[s.length - 1] : s;
- if (o?.arguments.factory !== "classic")
- return e.jsx === 4 || e.jsx === 5 || e.jsxImportSource || i || o?.arguments.factory === "automatic" ? i?.arguments.factory || e.jsxImportSource || "react" : void 0;
- }
- function m5(e, t) {
- return e ? `${e}/${t.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime"}` : void 0;
- }
- function KB(e) {
- let t = !1;
- for (let n = 0; n < e.length; n++)
- if (e.charCodeAt(n) === 42)
- if (!t)
- t = !0;
- else
- return !1;
- return !0;
- }
- function eJ(e, t) {
- let n, i, s, o = !1;
- return {
- getSymlinkedFiles: () => s,
- getSymlinkedDirectories: () => n,
- getSymlinkedDirectoriesByRealpath: () => i,
- setSymlinkedFile: (u, d) => (s || (s = /* @__PURE__ */ new Map())).set(u, d),
- setSymlinkedDirectory: (u, d) => {
- let g = uo(u, e, t);
- H4(g) || (g = ul(g), d !== !1 && !n?.has(g) && (i || (i = Ip())).add(d.realPath, u), (n || (n = /* @__PURE__ */ new Map())).set(g, d));
- },
- setSymlinksFromResolutions(u, d, g) {
- E.assert(!o), o = !0, u((h) => _(this, h.resolvedModule)), d((h) => _(this, h.resolvedTypeReferenceDirective)), g.forEach((h) => _(this, h.resolvedTypeReferenceDirective));
- },
- hasProcessedResolutions: () => o,
- setSymlinksFromResolution(u) {
- _(this, u);
- },
- hasAnySymlinks: c
- };
- function c() {
- return !!s?.size || !!n && !!El(n, (u) => !!u);
- }
- function _(u, d) {
- if (!d || !d.originalPath || !d.resolvedFileName) return;
- const { resolvedFileName: g, originalPath: h } = d;
- u.setSymlinkedFile(uo(h, e, t), g);
- const [S, T] = tFe(g, h, e, t) || Ue;
- S && T && u.setSymlinkedDirectory(
- T,
- {
- real: ul(S),
- realPath: ul(uo(S, e, t))
- }
- );
- }
- }
- function tFe(e, t, n, i) {
- const s = Cl(es(e, n)), o = Cl(es(t, n));
- let c = !1;
- for (; s.length >= 2 && o.length >= 2 && !Hge(s[s.length - 2], i) && !Hge(o[o.length - 2], i) && i(s[s.length - 1]) === i(o[o.length - 1]); )
- s.pop(), o.pop(), c = !0;
- return c ? [p0(s), p0(o)] : void 0;
- }
- function Hge(e, t) {
- return e !== void 0 && (t(e) === "node_modules" || Ui(e, "@"));
- }
- function rFe(e) {
- return XR(e.charCodeAt(0)) ? e.slice(1) : void 0;
- }
- function tJ(e, t, n) {
- const i = xR(e, t, n);
- return i === void 0 ? void 0 : rFe(i);
- }
- var VK = /[^\w\s/]/g;
- function Gge(e) {
- return e.replace(VK, nFe);
- }
- function nFe(e) {
- return "\\" + e;
- }
- var iFe = [
- 42,
- 63
- /* question */
- ], sFe = ["node_modules", "bower_components", "jspm_packages"], qK = `(?!(${sFe.join("|")})(/|$))`, $ge = {
- /**
- * Matches any single directory segment unless it is the last segment and a .min.js file
- * Breakdown:
- * [^./] # matches everything up to the first . character (excluding directory separators)
- * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
- */
- singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
- /**
- * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
- * files or directories, does not match subdirectories that start with a . character
- */
- doubleAsteriskRegexFragment: `(/${qK}[^/.][^/]*)*?`,
- replaceWildcardCharacter: (e) => $K(e, $ge.singleAsteriskRegexFragment)
- }, Xge = {
- singleAsteriskRegexFragment: "[^/]*",
- /**
- * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
- * files or directories, does not match subdirectories that start with a . character
- */
- doubleAsteriskRegexFragment: `(/${qK}[^/.][^/]*)*?`,
- replaceWildcardCharacter: (e) => $K(e, Xge.singleAsteriskRegexFragment)
- }, Qge = {
- singleAsteriskRegexFragment: "[^/]*",
- doubleAsteriskRegexFragment: "(/.+?)?",
- replaceWildcardCharacter: (e) => $K(e, Qge.singleAsteriskRegexFragment)
- }, HK = {
- files: $ge,
- directories: Xge,
- exclude: Qge
- };
- function j4(e, t, n) {
- const i = g5(e, t, n);
- return !i || !i.length ? void 0 : `^(${i.map((c) => `(${c})`).join("|")})${n === "exclude" ? "($|/)" : "$"}`;
- }
- function g5(e, t, n) {
- if (!(e === void 0 || e.length === 0))
- return ta(e, (i) => i && h5(i, t, n, HK[n]));
- }
- function rJ(e) {
- return !/[.*?]/.test(e);
- }
- function GK(e, t, n) {
- const i = e && h5(e, t, n, HK[n]);
- return i && `^(${i})${n === "exclude" ? "($|/)" : "$"}`;
- }
- function h5(e, t, n, { singleAsteriskRegexFragment: i, doubleAsteriskRegexFragment: s, replaceWildcardCharacter: o } = HK[n]) {
- let c = "", _ = !1;
- const u = _w(e, t), d = _a(u);
- if (n !== "exclude" && d === "**")
- return;
- u[0] = W1(u[0]), rJ(d) && u.push("**", "*");
- let g = 0;
- for (let h of u) {
- if (h === "**")
- c += s;
- else if (n === "directories" && (c += "(", g++), _ && (c += Vo), n !== "exclude") {
- let S = "";
- h.charCodeAt(0) === 42 ? (S += "([^./]" + i + ")?", h = h.substr(1)) : h.charCodeAt(0) === 63 && (S += "[^./]", h = h.substr(1)), S += h.replace(VK, o), S !== h && (c += qK), c += S;
- } else
- c += h.replace(VK, o);
- _ = !0;
- }
- for (; g > 0; )
- c += ")?", g--;
- return c;
- }
- function $K(e, t) {
- return e === "*" ? t : e === "?" ? "[^/]" : "\\" + e;
- }
- function y5(e, t, n, i, s) {
- e = Os(e), s = Os(s);
- const o = Bn(s, e);
- return {
- includeFilePatterns: lr(g5(n, o, "files"), (c) => `^${c}$`),
- includeFilePattern: j4(n, o, "files"),
- includeDirectoryPattern: j4(n, o, "directories"),
- excludePattern: j4(t, o, "exclude"),
- basePaths: aFe(e, n, i)
- };
- }
- function Jy(e, t) {
- return new RegExp(e, t ? "" : "i");
- }
- function nJ(e, t, n, i, s, o, c, _, u) {
- e = Os(e), o = Os(o);
- const d = y5(e, n, i, s, o), g = d.includeFilePatterns && d.includeFilePatterns.map((I) => Jy(I, s)), h = d.includeDirectoryPattern && Jy(d.includeDirectoryPattern, s), S = d.excludePattern && Jy(d.excludePattern, s), T = g ? g.map(() => []) : [[]], C = /* @__PURE__ */ new Map(), D = zl(s);
- for (const I of d.basePaths)
- P(I, Bn(o, I), c);
- return Np(T);
- function P(I, F, O) {
- const B = D(u(F));
- if (C.has(B)) return;
- C.set(B, !0);
- const { files: z, directories: X } = _(I);
- for (const q of V_(z, au)) {
- const V = Bn(I, q), ae = Bn(F, q);
- if (!(t && !xc(V, t)) && !(S && S.test(ae)))
- if (!g)
- T[0].push(V);
- else {
- const ee = ac(g, (G) => G.test(ae));
- ee !== -1 && T[ee].push(V);
- }
- }
- if (!(O !== void 0 && (O--, O === 0)))
- for (const q of V_(X, au)) {
- const V = Bn(I, q), ae = Bn(F, q);
- (!h || h.test(ae)) && (!S || !S.test(ae)) && P(V, ae, O);
- }
- }
- }
- function aFe(e, t, n) {
- const i = [e];
- if (t) {
- const s = [];
- for (const o of t) {
- const c = H_(o) ? o : Os(Bn(e, o));
- s.push(oFe(c));
- }
- s.sort(Kk(!n));
- for (const o of s)
- Mi(i, (c) => !np(c, o, e, !n)) && i.push(o);
- }
- return i;
- }
- function oFe(e) {
- const t = _X(e, iFe);
- return t < 0 ? tC(e) ? W1(Xn(e)) : e : e.substring(0, e.lastIndexOf(Vo, t));
- }
- function v5(e, t) {
- return t || b5(e) || 3;
- }
- function b5(e) {
- switch (e.substr(e.lastIndexOf(".")).toLowerCase()) {
- case ".js":
- case ".cjs":
- case ".mjs":
- return 1;
- case ".jsx":
- return 2;
- case ".ts":
- case ".cts":
- case ".mts":
- return 3;
- case ".tsx":
- return 4;
- case ".json":
- return 6;
- default:
- return 0;
- }
- }
- var S5 = [[
- ".ts",
- ".tsx",
- ".d.ts"
- /* Dts */
- ], [
- ".cts",
- ".d.cts"
- /* Dcts */
- ], [
- ".mts",
- ".d.mts"
- /* Dmts */
- ]], iJ = Np(S5), cFe = [...S5, [
- ".json"
- /* Json */
- ]], lFe = [
- ".d.ts",
- ".d.cts",
- ".d.mts",
- ".cts",
- ".mts",
- ".ts",
- ".tsx"
- /* Tsx */
- ], uFe = [[
- ".js",
- ".jsx"
- /* Jsx */
- ], [
- ".mjs"
- /* Mjs */
- ], [
- ".cjs"
- /* Cjs */
- ]], jC = Np(uFe), sJ = [[
- ".ts",
- ".tsx",
- ".d.ts",
- ".js",
- ".jsx"
- /* Jsx */
- ], [
- ".cts",
- ".d.cts",
- ".cjs"
- /* Cjs */
- ], [
- ".mts",
- ".d.mts",
- ".mjs"
- /* Mjs */
- ]], _Fe = [...sJ, [
- ".json"
- /* Json */
- ]], T5 = [
- ".d.ts",
- ".d.cts",
- ".d.mts"
- /* Dmts */
- ], B3 = [
- ".ts",
- ".cts",
- ".mts",
- ".tsx"
- /* Tsx */
- ], x5 = [
- ".mts",
- ".d.mts",
- ".mjs",
- ".cts",
- ".d.cts",
- ".cjs"
- /* Cjs */
- ];
- function B4(e, t) {
- const n = e && By(e);
- if (!t || t.length === 0)
- return n ? sJ : S5;
- const i = n ? sJ : S5, s = Np(i);
- return [
- ...i,
- ...Ai(t, (c) => c.scriptKind === 7 || n && fFe(c.scriptKind) && !s.includes(c.extension) ? [c.extension] : void 0)
- ];
- }
- function J3(e, t) {
- return !e || !Ab(e) ? t : t === sJ ? _Fe : t === S5 ? cFe : [...t, [
- ".json"
- /* Json */
- ]];
- }
- function fFe(e) {
- return e === 1 || e === 2;
- }
- function Ug(e) {
- return ut(jC, (t) => qo(e, t));
- }
- function gx(e) {
- return ut(iJ, (t) => qo(e, t));
- }
- function XK(e) {
- return ut(B3, (t) => qo(e, t)) && !wl(e);
- }
- var QK = /* @__PURE__ */ ((e) => (e[e.Minimal = 0] = "Minimal", e[e.Index = 1] = "Index", e[e.JsExtension = 2] = "JsExtension", e[e.TsExtension = 3] = "TsExtension", e))(QK || {});
- function pFe({ imports: e }, t = Nf(Ug, gx)) {
- return Tc(e, ({ text: n }) => If(n) && !xc(n, x5) ? t(n) : void 0) || !1;
- }
- function YK(e, t, n, i) {
- const s = yu(n), o = 3 <= s && s <= 99;
- if (e === "js" || t === 99 && o)
- return u6(n) && c() !== 2 ? 3 : 2;
- if (e === "minimal")
- return 0;
- if (e === "index")
- return 1;
- if (!u6(n))
- return i && pFe(i) ? 2 : 0;
- return c();
- function c() {
- let _ = !1;
- const u = i?.imports.length ? i.imports : i && Gu(i) ? dFe(i).map((d) => d.arguments[0]) : Ue;
- for (const d of u)
- if (If(d.text)) {
- if (o && t === 1 && LW(i, d, n) === 99 || xc(d.text, x5))
- continue;
- if (gx(d.text))
- return 3;
- Ug(d.text) && (_ = !0);
- }
- return _ ? 2 : 0;
- }
- }
- function dFe(e) {
- let t = 0, n;
- for (const i of e.statements) {
- if (t > 3)
- break;
- r3(i) ? n = Qi(n, i.declarationList.declarations.map((s) => s.initializer)) : Pl(i) && f_(
- i.expression,
- /*requireStringLiteralLikeArgument*/
- !0
- ) ? n = wr(n, i.expression) : t++;
- }
- return n || Ue;
- }
- function ZK(e, t, n) {
- if (!e) return !1;
- const i = B4(t, n);
- for (const s of Np(J3(t, i)))
- if (qo(e, s))
- return !0;
- return !1;
- }
- function Yge(e) {
- const t = e.match(/\//g);
- return t ? t.length : 0;
- }
- function z3(e, t) {
- return ho(
- Yge(e),
- Yge(t)
- );
- }
- var KK = [
- ".d.ts",
- ".d.mts",
- ".d.cts",
- ".mjs",
- ".mts",
- ".cjs",
- ".cts",
- ".ts",
- ".js",
- ".tsx",
- ".jsx",
- ".json"
- /* Json */
- ];
- function $u(e) {
- for (const t of KK) {
- const n = eee(e, t);
- if (n !== void 0)
- return n;
- }
- return e;
- }
- function eee(e, t) {
- return qo(e, t) ? W3(e, t) : void 0;
- }
- function W3(e, t) {
- return e.substring(0, e.length - t.length);
- }
- function zy(e, t) {
- return fw(
- e,
- t,
- KK,
- /*ignoreCase*/
- !1
- );
- }
- function BC(e) {
- const t = e.indexOf("*");
- return t === -1 ? e : e.indexOf("*", t + 1) !== -1 ? void 0 : {
- prefix: e.substr(0, t),
- suffix: e.substr(t + 1)
- };
- }
- function k5(e) {
- return Ai(rm(e), (t) => BC(t));
- }
- function Pd(e) {
- return !(e >= 0);
- }
- function C5(e) {
- return e === ".ts" || e === ".tsx" || e === ".d.ts" || e === ".cts" || e === ".mts" || e === ".d.mts" || e === ".d.cts" || Ui(e, ".d.") && Zo(e, ".ts");
- }
- function J4(e) {
- return C5(e) || e === ".json";
- }
- function z4(e) {
- const t = Vg(e);
- return t !== void 0 ? t : E.fail(`File ${e} has unknown extension.`);
- }
- function Zge(e) {
- return Vg(e) !== void 0;
- }
- function Vg(e) {
- return On(KK, (t) => qo(e, t));
- }
- function W4(e, t) {
- return e.checkJsDirective ? e.checkJsDirective.enabled : t.checkJs;
- }
- var aJ = {
- files: Ue,
- directories: Ue
- };
- function oJ(e, t) {
- const n = [];
- for (const i of e) {
- if (i === t)
- return t;
- _s(i) || n.push(i);
- }
- return TR(n, (i) => i, t);
- }
- function cJ(e, t) {
- const n = e.indexOf(t);
- return E.assert(n !== -1), e.slice(n);
- }
- function Rs(e, ...t) {
- return t.length && (e.relatedInformation || (e.relatedInformation = []), E.assert(e.relatedInformation !== Ue, "Diagnostic had empty array singleton for related info, but is still being constructed!"), e.relatedInformation.push(...t)), e;
- }
- function tee(e, t) {
- E.assert(e.length !== 0);
- let n = t(e[0]), i = n;
- for (let s = 1; s < e.length; s++) {
- const o = t(e[s]);
- o < n ? n = o : o > i && (i = o);
- }
- return { min: n, max: i };
- }
- function lJ(e) {
- return { pos: Oy(e), end: e.end };
- }
- function uJ(e, t) {
- const n = t.pos - 1, i = Math.min(e.text.length, aa(e.text, t.end) + 1);
- return { pos: n, end: i };
- }
- function JC(e, t, n) {
- return Kge(
- e,
- t,
- n,
- /*ignoreNoCheck*/
- !1
- );
- }
- function ree(e, t, n) {
- return Kge(
- e,
- t,
- n,
- /*ignoreNoCheck*/
- !0
- );
- }
- function Kge(e, t, n, i) {
- return t.skipLibCheck && e.isDeclarationFile || t.skipDefaultLibCheck && e.hasNoDefaultLib || !i && t.noCheck || n.isSourceOfProjectReferenceRedirect(e.fileName) || !U4(e, t);
- }
- function U4(e, t) {
- if (e.checkJsDirective && e.checkJsDirective.enabled === !1) return !1;
- if (e.scriptKind === 3 || e.scriptKind === 4 || e.scriptKind === 5) return !0;
- const i = (e.scriptKind === 1 || e.scriptKind === 2) && W4(e, t);
- return u4(e, t.checkJs) || i || e.scriptKind === 7;
- }
- function E5(e, t) {
- return e === t || typeof e == "object" && e !== null && typeof t == "object" && t !== null && yX(e, t, E5);
- }
- function V4(e) {
- let t;
- switch (e.charCodeAt(1)) {
- case 98:
- case 66:
- t = 1;
- break;
- case 111:
- case 79:
- t = 3;
- break;
- case 120:
- case 88:
- t = 4;
- break;
- default:
- const d = e.length - 1;
- let g = 0;
- for (; e.charCodeAt(g) === 48; )
- g++;
- return e.slice(g, d) || "0";
- }
- const n = 2, i = e.length - 1, s = (i - n) * t, o = new Uint16Array((s >>> 4) + (s & 15 ? 1 : 0));
- for (let d = i - 1, g = 0; d >= n; d--, g += t) {
- const h = g >>> 4, S = e.charCodeAt(d), C = (S <= 57 ? S - 48 : 10 + S - (S <= 70 ? 65 : 97)) << (g & 15);
- o[h] |= C;
- const D = C >>> 16;
- D && (o[h + 1] |= D);
- }
- let c = "", _ = o.length - 1, u = !0;
- for (; u; ) {
- let d = 0;
- u = !1;
- for (let g = _; g >= 0; g--) {
- const h = d << 16 | o[g], S = h / 10 | 0;
- o[g] = S, d = h - S * 10, S && !u && (_ = g, u = !0);
- }
- c = d + c;
- }
- return c;
- }
- function Ib({ negative: e, base10Value: t }) {
- return (e && t !== "0" ? "-" : "") + t;
- }
- function nee(e) {
- if (D5(
- e,
- /*roundTripOnly*/
- !1
- ))
- return _J(e);
- }
- function _J(e) {
- const t = e.startsWith("-"), n = V4(`${t ? e.slice(1) : e}n`);
- return { negative: t, base10Value: n };
- }
- function D5(e, t) {
- if (e === "") return !1;
- const n = Og(
- 99,
- /*skipTrivia*/
- !1
- );
- let i = !0;
- n.setOnError(() => i = !1), n.setText(e + "n");
- let s = n.scan();
- const o = s === 41;
- o && (s = n.scan());
- const c = n.getTokenFlags();
- return i && s === 10 && n.getTokenEnd() === e.length + 1 && !(c & 512) && (!t || e === Ib({ negative: o, base10Value: V4(n.getTokenValue()) }));
- }
- function av(e) {
- return !!(e.flags & 33554432) || C7(e) || hFe(e) || gFe(e) || !(Ed(e) || mFe(e));
- }
- function mFe(e) {
- return Oe(e) && uu(e.parent) && e.parent.name === e;
- }
- function gFe(e) {
- for (; e.kind === 80 || e.kind === 211; )
- e = e.parent;
- if (e.kind !== 167)
- return !1;
- if (Gn(
- e.parent,
- 64
- /* Abstract */
- ))
- return !0;
- const t = e.parent.parent.kind;
- return t === 264 || t === 187;
- }
- function hFe(e) {
- if (e.kind !== 80) return !1;
- const t = or(e.parent, (n) => {
- switch (n.kind) {
- case 298:
- return !0;
- case 211:
- case 233:
- return !1;
- default:
- return "quit";
- }
- });
- return t?.token === 119 || t?.parent.kind === 264;
- }
- function iee(e) {
- return vf(e) && Oe(e.typeName);
- }
- function see(e, t = by) {
- if (e.length < 2) return !0;
- const n = e[0];
- for (let i = 1, s = e.length; i < s; i++) {
- const o = e[i];
- if (!t(n, o)) return !1;
- }
- return !0;
- }
- function q4(e, t) {
- return e.pos = t, e;
- }
- function zC(e, t) {
- return e.end = t, e;
- }
- function wd(e, t, n) {
- return zC(q4(e, t), n);
- }
- function fJ(e, t, n) {
- return wd(e, t, t + n);
- }
- function aee(e, t) {
- return e && (e.flags = t), e;
- }
- function Aa(e, t) {
- return e && t && (e.parent = t), e;
- }
- function Nh(e, t) {
- if (!e) return e;
- return jx(e, uC(e) ? n : s), e;
- function n(o, c) {
- if (t && o.parent === c)
- return "skip";
- Aa(o, c);
- }
- function i(o) {
- if (gf(o))
- for (const c of o.jsDoc)
- n(c, o), jx(c, n);
- }
- function s(o, c) {
- return n(o, c) || i(o);
- }
- }
- function yFe(e) {
- return !ml(e);
- }
- function pJ(e) {
- return $l(e) && Mi(e.elements, yFe);
- }
- function oee(e) {
- for (E.assertIsDefined(e.parent); ; ) {
- const t = e.parent;
- if (Yu(t)) {
- e = t;
- continue;
- }
- if (Pl(t) || Nx(t) || fv(t) && (t.initializer === e || t.incrementor === e))
- return !0;
- if (aD(t)) {
- if (e !== _a(t.elements)) return !0;
- e = t;
- continue;
- }
- if (dn(t) && t.operatorToken.kind === 28) {
- if (e === t.left) return !0;
- e = t;
- continue;
- }
- return !1;
- }
- }
- function H4(e) {
- return ut(kI, (t) => e.includes(t));
- }
- function cee(e) {
- if (!e.parent) return;
- switch (e.kind) {
- case 168:
- const { parent: n } = e;
- return n.kind === 195 ? void 0 : n.typeParameters;
- case 169:
- return e.parent.parameters;
- case 204:
- return e.parent.templateSpans;
- case 239:
- return e.parent.templateSpans;
- case 170: {
- const { parent: i } = e;
- return Vb(i) ? i.modifiers : void 0;
- }
- case 298:
- return e.parent.heritageClauses;
- }
- const { parent: t } = e;
- if (_C(e))
- return bS(e.parent) ? void 0 : e.parent.tags;
- switch (t.kind) {
- case 187:
- case 264:
- return db(e) ? t.members : void 0;
- case 192:
- case 193:
- return t.types;
- case 189:
- case 209:
- case 355:
- case 275:
- case 279:
- return t.elements;
- case 210:
- case 292:
- return t.properties;
- case 213:
- case 214:
- return fi(e) ? t.typeArguments : t.expression === e ? void 0 : t.arguments;
- case 284:
- case 288:
- return Mw(e) ? t.children : void 0;
- case 286:
- case 285:
- return fi(e) ? t.typeArguments : void 0;
- case 241:
- case 296:
- case 297:
- case 268:
- return t.statements;
- case 269:
- return t.clauses;
- case 263:
- case 231:
- return _l(e) ? t.members : void 0;
- case 266:
- return A0(e) ? t.members : void 0;
- case 307:
- return t.statements;
- }
- }
- function P5(e) {
- if (!e.typeParameters) {
- if (ut(e.parameters, (t) => !Gc(t)))
- return !0;
- if (e.kind !== 219) {
- const t = el(e.parameters);
- if (!(t && Db(t)))
- return !0;
- }
- }
- return !1;
- }
- function G4(e) {
- return e === "Infinity" || e === "-Infinity" || e === "NaN";
- }
- function lee(e) {
- return e.kind === 260 && e.parent.kind === 299;
- }
- function Wy(e) {
- return e.kind === 218 || e.kind === 219;
- }
- function Ob(e) {
- return e.replace(/\$/g, () => "\\$");
- }
- function qg(e) {
- return (+e).toString() === e;
- }
- function w5(e, t, n, i, s) {
- const o = s && e === "new";
- return !o && k_(e, t) ? A.createIdentifier(e) : !i && !o && qg(e) && +e >= 0 ? A.createNumericLiteral(+e) : A.createStringLiteral(e, !!n);
- }
- function $4(e) {
- return !!(e.flags & 262144 && e.isThisType);
- }
- function A5(e) {
- let t = 0, n = 0, i = 0, s = 0, o;
- ((d) => {
- d[d.BeforeNodeModules = 0] = "BeforeNodeModules", d[d.NodeModules = 1] = "NodeModules", d[d.Scope = 2] = "Scope", d[d.PackageContent = 3] = "PackageContent";
- })(o || (o = {}));
- let c = 0, _ = 0, u = 0;
- for (; _ >= 0; )
- switch (c = _, _ = e.indexOf("/", c + 1), u) {
- case 0:
- e.indexOf(Xg, c) === c && (t = c, n = _, u = 1);
- break;
- case 1:
- case 2:
- u === 1 && e.charAt(c + 1) === "@" ? u = 2 : (i = _, u = 3);
- break;
- case 3:
- e.indexOf(Xg, c) === c ? u = 1 : u = 3;
- break;
- }
- return s = c, u > 1 ? { topLevelNodeModulesIndex: t, topLevelPackageNameIndex: n, packageRootIndex: i, fileNameIndex: s } : void 0;
- }
- function hx(e) {
- switch (e.kind) {
- case 168:
- case 263:
- case 264:
- case 265:
- case 266:
- case 346:
- case 338:
- case 340:
- return !0;
- case 273:
- return e.isTypeOnly;
- case 276:
- case 281:
- return e.parent.parent.isTypeOnly;
- default:
- return !1;
- }
- }
- function U3(e) {
- return Bb(e) || yc(e) || Ec(e) || Xc(e) || Xl(e) || hx(e) || zc(e) && !yb(e) && !ig(e);
- }
- function V3(e) {
- if (!r4(e))
- return !1;
- const { isBracketed: t, typeExpression: n } = e;
- return t || !!n && n.type.kind === 316;
- }
- function dJ(e, t) {
- if (e.length === 0)
- return !1;
- const n = e.charCodeAt(0);
- return n === 35 ? e.length > 1 && eg(e.charCodeAt(1), t) : eg(n, t);
- }
- function uee(e) {
- var t;
- return ((t = kJ(e)) == null ? void 0 : t.kind) === 0;
- }
- function N5(e) {
- return cn(e) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
- (e.type && e.type.kind === 316 || aC(e).some(V3));
- }
- function WC(e) {
- switch (e.kind) {
- case 172:
- case 171:
- return !!e.questionToken;
- case 169:
- return !!e.questionToken || N5(e);
- case 348:
- case 341:
- return V3(e);
- default:
- return !1;
- }
- }
- function _ee(e) {
- const t = e.kind;
- return (t === 211 || t === 212) && Ox(e.expression);
- }
- function mJ(e) {
- return cn(e) && Yu(e) && gf(e) && !!dj(e);
- }
- function gJ(e) {
- return E.checkDefined(I5(e));
- }
- function I5(e) {
- const t = dj(e);
- return t && t.typeExpression && t.typeExpression.type;
- }
- function X4(e) {
- return Oe(e) ? e.escapedText : yx(e);
- }
- function q3(e) {
- return Oe(e) ? Nn(e) : Q4(e);
- }
- function fee(e) {
- const t = e.kind;
- return t === 80 || t === 295;
- }
- function yx(e) {
- return `${e.namespace.escapedText}:${Nn(e.name)}`;
- }
- function Q4(e) {
- return `${Nn(e.namespace)}:${Nn(e.name)}`;
- }
- function hJ(e) {
- return Oe(e) ? Nn(e) : Q4(e);
- }
- function up(e) {
- return !!(e.flags & 8576);
- }
- function _p(e) {
- return e.flags & 8192 ? e.escapedName : e.flags & 384 ? tc("" + e.value) : E.fail();
- }
- function vx(e) {
- return !!e && (Cn(e) || ko(e) || dn(e));
- }
- function pee(e) {
- return e === void 0 ? !1 : !!d6(e.attributes);
- }
- var vFe = String.prototype.replace;
- function uS(e, t) {
- return vFe.call(e, "*", t);
- }
- function O5(e) {
- return Oe(e.name) ? e.name.escapedText : tc(e.name.text);
- }
- function dee(e) {
- switch (e.kind) {
- case 168:
- case 169:
- case 172:
- case 171:
- case 185:
- case 184:
- case 179:
- case 180:
- case 181:
- case 174:
- case 173:
- case 175:
- case 176:
- case 177:
- case 178:
- case 183:
- case 182:
- case 186:
- case 187:
- case 188:
- case 189:
- case 192:
- case 193:
- case 196:
- case 190:
- case 191:
- case 197:
- case 198:
- case 194:
- case 195:
- case 203:
- case 205:
- case 202:
- case 328:
- case 329:
- case 346:
- case 338:
- case 340:
- case 345:
- case 344:
- case 324:
- case 325:
- case 326:
- case 341:
- case 348:
- case 317:
- case 315:
- case 314:
- case 312:
- case 313:
- case 322:
- case 318:
- case 309:
- case 333:
- case 335:
- case 334:
- case 350:
- case 343:
- case 199:
- case 200:
- case 262:
- case 241:
- case 268:
- case 243:
- case 244:
- case 245:
- case 246:
- case 247:
- case 248:
- case 249:
- case 250:
- case 251:
- case 252:
- case 253:
- case 254:
- case 255:
- case 256:
- case 257:
- case 258:
- case 260:
- case 208:
- case 263:
- case 264:
- case 265:
- case 266:
- case 267:
- case 272:
- case 271:
- case 278:
- case 277:
- case 242:
- case 259:
- case 282:
- return !0;
- }
- return !1;
- }
- function pl(e, t = !1, n = !1, i = !1) {
- return { value: e, isSyntacticallyString: t, resolvedOtherFiles: n, hasExternalReferences: i };
- }
- function mee({ evaluateElementAccessExpression: e, evaluateEntityNameExpression: t }) {
- function n(s, o) {
- let c = !1, _ = !1, u = !1;
- switch (s = Ba(s), s.kind) {
- case 224:
- const d = n(s.operand, o);
- if (_ = d.resolvedOtherFiles, u = d.hasExternalReferences, typeof d.value == "number")
- switch (s.operator) {
- case 40:
- return pl(d.value, c, _, u);
- case 41:
- return pl(-d.value, c, _, u);
- case 55:
- return pl(~d.value, c, _, u);
- }
- break;
- case 226: {
- const g = n(s.left, o), h = n(s.right, o);
- if (c = (g.isSyntacticallyString || h.isSyntacticallyString) && s.operatorToken.kind === 40, _ = g.resolvedOtherFiles || h.resolvedOtherFiles, u = g.hasExternalReferences || h.hasExternalReferences, typeof g.value == "number" && typeof h.value == "number")
- switch (s.operatorToken.kind) {
- case 52:
- return pl(g.value | h.value, c, _, u);
- case 51:
- return pl(g.value & h.value, c, _, u);
- case 49:
- return pl(g.value >> h.value, c, _, u);
- case 50:
- return pl(g.value >>> h.value, c, _, u);
- case 48:
- return pl(g.value << h.value, c, _, u);
- case 53:
- return pl(g.value ^ h.value, c, _, u);
- case 42:
- return pl(g.value * h.value, c, _, u);
- case 44:
- return pl(g.value / h.value, c, _, u);
- case 40:
- return pl(g.value + h.value, c, _, u);
- case 41:
- return pl(g.value - h.value, c, _, u);
- case 45:
- return pl(g.value % h.value, c, _, u);
- case 43:
- return pl(g.value ** h.value, c, _, u);
- }
- else if ((typeof g.value == "string" || typeof g.value == "number") && (typeof h.value == "string" || typeof h.value == "number") && s.operatorToken.kind === 40)
- return pl(
- "" + g.value + h.value,
- c,
- _,
- u
- );
- break;
- }
- case 11:
- case 15:
- return pl(
- s.text,
- /*isSyntacticallyString*/
- !0
- );
- case 228:
- return i(s, o);
- case 9:
- return pl(+s.text);
- case 80:
- return t(s, o);
- case 211:
- if (yo(s))
- return t(s, o);
- break;
- case 212:
- return e(s, o);
- }
- return pl(
- /*value*/
- void 0,
- c,
- _,
- u
- );
- }
- function i(s, o) {
- let c = s.head.text, _ = !1, u = !1;
- for (const d of s.templateSpans) {
- const g = n(d.expression, o);
- if (g.value === void 0)
- return pl(
- /*value*/
- void 0,
- /*isSyntacticallyString*/
- !0
- );
- c += g.value, c += d.literal.text, _ || (_ = g.resolvedOtherFiles), u || (u = g.hasExternalReferences);
- }
- return pl(
- c,
- /*isSyntacticallyString*/
- !0,
- _,
- u
- );
- }
- return n;
- }
- function yJ(e) {
- return $1(e) && xd(e.type) || fD(e) && xd(e.typeExpression);
- }
- function H3(e) {
- const t = e.members;
- for (const n of t)
- if (n.kind === 176 && Mp(n.body))
- return n;
- }
- function vJ({
- compilerOptions: e,
- requireSymbol: t,
- argumentsSymbol: n,
- error: i,
- getSymbolOfDeclaration: s,
- globals: o,
- lookup: c,
- setRequiresScopeChangeCache: _ = lb,
- getRequiresScopeChangeCache: u = lb,
- onPropertyWithInvalidInitializer: d = nm,
- onFailedToResolveSymbol: g = lb,
- onSuccessfullyResolvedSymbol: h = lb
- }) {
- var S = e.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", T = ZB(e), C = Js();
- return D;
- function D(B, z, X, q, V, ae) {
- var ee, G, ue;
- const re = B;
- let ne, ie, Se, J, oe, _e = !1, he;
- const le = _s(z) ? z : z.escapedText;
- e:
- for (; B; ) {
- if (le === "const" && yJ(B))
- return;
- if (Fw(B) && ie && B.name === ie && (ie = B, B = B.parent), tg(B) && B.locals && !g0(B) && (ne = c(B.locals, le, X))) {
- let me = !0;
- if (ys(B) && ie && ie !== B.body ? (X & ne.flags & 788968 && ie.kind !== 320 && (me = ne.flags & 262144 ? !!(ie.flags & 16) || // Synthetic fake scopes are added for signatures so type parameters are accessible from them
- ie === B.type || ie.kind === 169 || ie.kind === 341 || ie.kind === 342 || ie.kind === 168 : !1), X & ne.flags & 3 && (P(ne, B, ie) ? me = !1 : ne.flags & 1 && (me = ie.kind === 169 || !!(ie.flags & 16) || // Synthetic fake scopes are added for signatures so parameters are accessible from them
- ie === B.type && !!or(ne.valueDeclaration, Ii)))) : B.kind === 194 && (me = ie === B.trueType), me)
- break e;
- ne = void 0;
- }
- switch (_e = _e || I(B, ie), B.kind) {
- case 307:
- if (!X_(B)) break;
- case 267:
- const me = ((ee = s(B)) == null ? void 0 : ee.exports) || C;
- if (B.kind === 307 || zc(B) && B.flags & 33554432 && !ig(B)) {
- if (ne = me.get(
- "default"
- /* Default */
- )) {
- const Te = N4(ne);
- if (Te && ne.flags & X && Te.escapedName === le)
- break e;
- ne = void 0;
- }
- const tt = me.get(le);
- if (tt && tt.flags === 2097152 && (Jo(
- tt,
- 281
- /* ExportSpecifier */
- ) || Jo(
- tt,
- 280
- /* NamespaceExport */
- )))
- break;
- }
- if (le !== "default" && (ne = c(
- me,
- le,
- X & 2623475
- /* ModuleMember */
- )))
- if (Si(B) && B.commonJsModuleIndicator && !((G = ne.declarations) != null && G.some(Bp)))
- ne = void 0;
- else
- break e;
- break;
- case 266:
- if (ne = c(
- ((ue = s(B)) == null ? void 0 : ue.exports) || C,
- le,
- X & 8
- /* EnumMember */
- )) {
- q && Wp(e) && !(B.flags & 33554432) && Tr(B) !== Tr(ne.valueDeclaration) && i(
- re,
- p.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead,
- Ei(le),
- S,
- `${Ei(s(B).escapedName)}.${Ei(le)}`
- );
- break e;
- }
- break;
- case 172:
- if (!zs(B)) {
- const tt = H3(B.parent);
- tt && tt.locals && c(
- tt.locals,
- le,
- X & 111551
- /* Value */
- ) && (E.assertNode(B, cs), J = B);
- }
- break;
- case 263:
- case 231:
- case 264:
- if (ne = c(
- s(B).members || C,
- le,
- X & 788968
- /* Type */
- )) {
- if (!O(ne, B)) {
- ne = void 0;
- break;
- }
- if (ie && zs(ie)) {
- q && i(re, p.Static_members_cannot_reference_class_type_parameters);
- return;
- }
- break e;
- }
- if ($c(B) && X & 32) {
- const tt = B.name;
- if (tt && le === tt.escapedText) {
- ne = B.symbol;
- break e;
- }
- }
- break;
- case 233:
- if (ie === B.expression && B.parent.token === 96) {
- const tt = B.parent.parent;
- if (Zn(tt) && (ne = c(
- s(tt).members,
- le,
- X & 788968
- /* Type */
- ))) {
- q && i(re, p.Base_class_expressions_cannot_reference_class_type_parameters);
- return;
- }
- }
- break;
- case 167:
- if (he = B.parent.parent, (Zn(he) || he.kind === 264) && (ne = c(
- s(he).members,
- le,
- X & 788968
- /* Type */
- ))) {
- q && i(re, p.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
- return;
- }
- break;
- case 219:
- if (pa(e) >= 2)
- break;
- case 174:
- case 176:
- case 177:
- case 178:
- case 262:
- if (X & 3 && le === "arguments") {
- ne = n;
- break e;
- }
- break;
- case 218:
- if (X & 3 && le === "arguments") {
- ne = n;
- break e;
- }
- if (X & 16) {
- const tt = B.name;
- if (tt && le === tt.escapedText) {
- ne = B.symbol;
- break e;
- }
- }
- break;
- case 170:
- B.parent && B.parent.kind === 169 && (B = B.parent), B.parent && (_l(B.parent) || B.parent.kind === 263) && (B = B.parent);
- break;
- case 346:
- case 338:
- case 340:
- case 351:
- const ve = EC(B);
- ve && (B = ve.parent);
- break;
- case 169:
- ie && (ie === B.initializer || ie === B.name && As(ie)) && (oe || (oe = B));
- break;
- case 208:
- ie && (ie === B.initializer || ie === B.name && As(ie)) && iv(B) && !oe && (oe = B);
- break;
- case 195:
- if (X & 262144) {
- const tt = B.typeParameter.name;
- if (tt && le === tt.escapedText) {
- ne = B.typeParameter.symbol;
- break e;
- }
- }
- break;
- case 281:
- ie && ie === B.propertyName && B.parent.parent.moduleSpecifier && (B = B.parent.parent.parent);
- break;
- }
- F(B, ie) && (Se = B), ie = B, B = qp(B) ? I7(B) || B.parent : (dp(B) || nO(B)) && ev(B) || B.parent;
- }
- if (V && ne && (!Se || ne !== Se.symbol) && (ne.isReferenced |= X), !ne) {
- if (ie && (E.assertNode(ie, Si), ie.commonJsModuleIndicator && le === "exports" && X & ie.symbol.flags))
- return ie.symbol;
- ae || (ne = c(o, le, X));
- }
- if (!ne && re && cn(re) && re.parent && f_(
- re.parent,
- /*requireStringLiteralLikeArgument*/
- !1
- ))
- return t;
- if (q) {
- if (J && d(re, le, J, ne))
- return;
- ne ? h(re, ne, X, ie, oe, _e) : g(re, z, X, q);
- }
- return ne;
- }
- function P(B, z, X) {
- const q = pa(e), V = z;
- if (Ii(X) && V.body && B.valueDeclaration && B.valueDeclaration.pos >= V.body.pos && B.valueDeclaration.end <= V.body.end && q >= 2) {
- let G = u(V);
- return G === void 0 && (G = ir(V.parameters, ae) || !1, _(V, G)), !G;
- }
- return !1;
- function ae(G) {
- return ee(G.name) || !!G.initializer && ee(G.initializer);
- }
- function ee(G) {
- switch (G.kind) {
- case 219:
- case 218:
- case 262:
- case 176:
- return !1;
- case 174:
- case 177:
- case 178:
- case 303:
- return ee(G.name);
- case 172:
- return tl(G) ? !T : ee(G.name);
- default:
- return gj(G) || hu(G) ? q < 7 : va(G) && G.dotDotDotToken && Mf(G.parent) ? q < 4 : fi(G) ? !1 : bs(G, ee) || !1;
- }
- }
- }
- function I(B, z) {
- return B.kind !== 219 && B.kind !== 218 ? Lb(B) || (no(B) || B.kind === 172 && !zs(B)) && (!z || z !== B.name) : z && z === B.name ? !1 : B.asteriskToken || Gn(
- B,
- 1024
- /* Async */
- ) ? !0 : !bb(B);
- }
- function F(B, z) {
- switch (B.kind) {
- case 169:
- return !!z && z === B.name;
- case 262:
- case 263:
- case 264:
- case 266:
- case 265:
- case 267:
- return !0;
- default:
- return !1;
- }
- }
- function O(B, z) {
- if (B.declarations) {
- for (const X of B.declarations)
- if (X.kind === 168 && (qp(X.parent) ? xb(X.parent) : X.parent) === z)
- return !(qp(X.parent) && On(X.parent.parent.tags, Bp));
- }
- return !1;
- }
- }
- function F5(e, t = !0) {
- switch (E.type(e), e.kind) {
- case 112:
- case 97:
- case 9:
- case 11:
- case 15:
- return !0;
- case 10:
- return t;
- case 224:
- return e.operator === 41 ? d_(e.operand) || t && eD(e.operand) : e.operator === 40 ? d_(e.operand) : !1;
- default:
- return !1;
- }
- }
- function gee(e) {
- for (; e.kind === 217; )
- e = e.expression;
- return e;
- }
- function hee(e) {
- switch (E.type(e), e.kind) {
- case 169:
- case 171:
- case 172:
- case 208:
- case 211:
- case 212:
- case 226:
- case 260:
- case 277:
- case 303:
- return !0;
- default:
- return !1;
- }
- }
- function bJ(e) {
- const t = or(e, ic);
- return !!t && !t.importClause;
- }
- function yee() {
- let e, t, n, i, s;
- return {
- createBaseSourceFileNode: o,
- createBaseIdentifierNode: c,
- createBasePrivateIdentifierNode: _,
- createBaseTokenNode: u,
- createBaseNode: d
- };
- function o(g) {
- return new (s || (s = Gl.getSourceFileConstructor()))(
- g,
- /*pos*/
- -1,
- /*end*/
- -1
- );
- }
- function c(g) {
- return new (n || (n = Gl.getIdentifierConstructor()))(
- g,
- /*pos*/
- -1,
- /*end*/
- -1
- );
- }
- function _(g) {
- return new (i || (i = Gl.getPrivateIdentifierConstructor()))(
- g,
- /*pos*/
- -1,
- /*end*/
- -1
- );
- }
- function u(g) {
- return new (t || (t = Gl.getTokenConstructor()))(
- g,
- /*pos*/
- -1,
- /*end*/
- -1
- );
- }
- function d(g) {
- return new (e || (e = Gl.getNodeConstructor()))(
- g,
- /*pos*/
- -1,
- /*end*/
- -1
- );
- }
- }
- function vee(e) {
- let t, n;
- return {
- getParenthesizeLeftSideOfBinaryForOperator: i,
- getParenthesizeRightSideOfBinaryForOperator: s,
- parenthesizeLeftSideOfBinary: d,
- parenthesizeRightSideOfBinary: g,
- parenthesizeExpressionOfComputedPropertyName: h,
- parenthesizeConditionOfConditionalExpression: S,
- parenthesizeBranchOfConditionalExpression: T,
- parenthesizeExpressionOfExportDefault: C,
- parenthesizeExpressionOfNew: D,
- parenthesizeLeftSideOfAccess: P,
- parenthesizeOperandOfPostfixUnary: I,
- parenthesizeOperandOfPrefixUnary: F,
- parenthesizeExpressionsOfCommaDelimitedList: O,
- parenthesizeExpressionForDisallowedComma: B,
- parenthesizeExpressionOfExpressionStatement: z,
- parenthesizeConciseBodyOfArrowFunction: X,
- parenthesizeCheckTypeOfConditionalType: q,
- parenthesizeExtendsTypeOfConditionalType: V,
- parenthesizeConstituentTypesOfUnionType: ee,
- parenthesizeConstituentTypeOfUnionType: ae,
- parenthesizeConstituentTypesOfIntersectionType: ue,
- parenthesizeConstituentTypeOfIntersectionType: G,
- parenthesizeOperandOfTypeOperator: re,
- parenthesizeOperandOfReadonlyTypeOperator: ne,
- parenthesizeNonArrayTypeOfPostfixType: ie,
- parenthesizeElementTypesOfTupleType: Se,
- parenthesizeElementTypeOfTupleType: J,
- parenthesizeTypeOfOptionalType: _e,
- parenthesizeTypeArguments: me,
- parenthesizeLeadingTypeArgument: he
- };
- function i(ve) {
- t || (t = /* @__PURE__ */ new Map());
- let tt = t.get(ve);
- return tt || (tt = (Te) => d(ve, Te), t.set(ve, tt)), tt;
- }
- function s(ve) {
- n || (n = /* @__PURE__ */ new Map());
- let tt = n.get(ve);
- return tt || (tt = (Te) => g(
- ve,
- /*leftSide*/
- void 0,
- Te
- ), n.set(ve, tt)), tt;
- }
- function o(ve, tt, Te, we) {
- const fe = S3(226, ve), Me = TB(226, ve), Qe = ud(tt);
- if (!Te && tt.kind === 219 && fe > 3)
- return !0;
- const et = E4(Qe);
- switch (ho(et, fe)) {
- case -1:
- return !(!Te && Me === 1 && tt.kind === 229);
- case 1:
- return !1;
- case 0:
- if (Te)
- return Me === 1;
- if (dn(Qe) && Qe.operatorToken.kind === ve) {
- if (c(ve))
- return !1;
- if (ve === 40) {
- const ft = we ? _(we) : 0;
- if (n4(ft) && ft === _(Qe))
- return !1;
- }
- }
- return SB(Qe) === 0;
- }
- }
- function c(ve) {
- return ve === 42 || ve === 52 || ve === 51 || ve === 53 || ve === 28;
- }
- function _(ve) {
- if (ve = ud(ve), n4(ve.kind))
- return ve.kind;
- if (ve.kind === 226 && ve.operatorToken.kind === 40) {
- if (ve.cachedLiteralKind !== void 0)
- return ve.cachedLiteralKind;
- const tt = _(ve.left), Te = n4(tt) && tt === _(ve.right) ? tt : 0;
- return ve.cachedLiteralKind = Te, Te;
- }
- return 0;
- }
- function u(ve, tt, Te, we) {
- return ud(tt).kind === 217 ? tt : o(ve, tt, Te, we) ? e.createParenthesizedExpression(tt) : tt;
- }
- function d(ve, tt) {
- return u(
- ve,
- tt,
- /*isLeftSideOfBinary*/
- !0
- );
- }
- function g(ve, tt, Te) {
- return u(
- ve,
- Te,
- /*isLeftSideOfBinary*/
- !1,
- tt
- );
- }
- function h(ve) {
- return dD(ve) ? e.createParenthesizedExpression(ve) : ve;
- }
- function S(ve) {
- const tt = S3(
- 227,
- 58
- /* QuestionToken */
- ), Te = ud(ve), we = E4(Te);
- return ho(we, tt) !== 1 ? e.createParenthesizedExpression(ve) : ve;
- }
- function T(ve) {
- const tt = ud(ve);
- return dD(tt) ? e.createParenthesizedExpression(ve) : ve;
- }
- function C(ve) {
- const tt = ud(ve);
- let Te = dD(tt);
- if (!Te)
- switch (MC(
- tt,
- /*stopAtCallExpressions*/
- !1
- ).kind) {
- case 231:
- case 218:
- Te = !0;
- }
- return Te ? e.createParenthesizedExpression(ve) : ve;
- }
- function D(ve) {
- const tt = MC(
- ve,
- /*stopAtCallExpressions*/
- !0
- );
- switch (tt.kind) {
- case 213:
- return e.createParenthesizedExpression(ve);
- case 214:
- return tt.arguments ? ve : e.createParenthesizedExpression(ve);
- }
- return P(ve);
- }
- function P(ve, tt) {
- const Te = ud(ve);
- return __(Te) && (Te.kind !== 214 || Te.arguments) && (tt || !hu(Te)) ? ve : lt(e.createParenthesizedExpression(ve), ve);
- }
- function I(ve) {
- return __(ve) ? ve : lt(e.createParenthesizedExpression(ve), ve);
- }
- function F(ve) {
- return Ej(ve) ? ve : lt(e.createParenthesizedExpression(ve), ve);
- }
- function O(ve) {
- const tt = qc(ve, B);
- return lt(e.createNodeArray(tt, ve.hasTrailingComma), ve);
- }
- function B(ve) {
- const tt = ud(ve), Te = E4(tt), we = S3(
- 226,
- 28
- /* CommaToken */
- );
- return Te > we ? ve : lt(e.createParenthesizedExpression(ve), ve);
- }
- function z(ve) {
- const tt = ud(ve);
- if (Fs(tt)) {
- const we = tt.expression, fe = ud(we).kind;
- if (fe === 218 || fe === 219) {
- const Me = e.updateCallExpression(
- tt,
- lt(e.createParenthesizedExpression(we), we),
- tt.typeArguments,
- tt.arguments
- );
- return e.restoreOuterExpressions(
- ve,
- Me,
- 8
- /* PartiallyEmittedExpressions */
- );
- }
- }
- const Te = MC(
- tt,
- /*stopAtCallExpressions*/
- !1
- ).kind;
- return Te === 210 || Te === 218 ? lt(e.createParenthesizedExpression(ve), ve) : ve;
- }
- function X(ve) {
- return !Cs(ve) && (dD(ve) || MC(
- ve,
- /*stopAtCallExpressions*/
- !1
- ).kind === 210) ? lt(e.createParenthesizedExpression(ve), ve) : ve;
- }
- function q(ve) {
- switch (ve.kind) {
- case 184:
- case 185:
- case 194:
- return e.createParenthesizedType(ve);
- }
- return ve;
- }
- function V(ve) {
- switch (ve.kind) {
- case 194:
- return e.createParenthesizedType(ve);
- }
- return ve;
- }
- function ae(ve) {
- switch (ve.kind) {
- case 192:
- case 193:
- return e.createParenthesizedType(ve);
- }
- return q(ve);
- }
- function ee(ve) {
- return e.createNodeArray(qc(ve, ae));
- }
- function G(ve) {
- switch (ve.kind) {
- case 192:
- case 193:
- return e.createParenthesizedType(ve);
- }
- return ae(ve);
- }
- function ue(ve) {
- return e.createNodeArray(qc(ve, G));
- }
- function re(ve) {
- switch (ve.kind) {
- case 193:
- return e.createParenthesizedType(ve);
- }
- return G(ve);
- }
- function ne(ve) {
- switch (ve.kind) {
- case 198:
- return e.createParenthesizedType(ve);
- }
- return re(ve);
- }
- function ie(ve) {
- switch (ve.kind) {
- case 195:
- case 198:
- case 186:
- return e.createParenthesizedType(ve);
- }
- return re(ve);
- }
- function Se(ve) {
- return e.createNodeArray(qc(ve, J));
- }
- function J(ve) {
- return oe(ve) ? e.createParenthesizedType(ve) : ve;
- }
- function oe(ve) {
- return QC(ve) ? ve.postfix : qC(ve) || lg(ve) || VC(ve) || cv(ve) ? oe(ve.type) : Mb(ve) ? oe(ve.falseType) : qy(ve) || Ax(ve) ? oe(_a(ve.types)) : pS(ve) ? !!ve.typeParameter.constraint && oe(ve.typeParameter.constraint) : !1;
- }
- function _e(ve) {
- return oe(ve) ? e.createParenthesizedType(ve) : ie(ve);
- }
- function he(ve) {
- return MY(ve) && ve.typeParameters ? e.createParenthesizedType(ve) : ve;
- }
- function le(ve, tt) {
- return tt === 0 ? he(ve) : ve;
- }
- function me(ve) {
- if (ut(ve))
- return e.createNodeArray(qc(ve, le));
- }
- }
- var bee = {
- getParenthesizeLeftSideOfBinaryForOperator: (e) => go,
- getParenthesizeRightSideOfBinaryForOperator: (e) => go,
- parenthesizeLeftSideOfBinary: (e, t) => t,
- parenthesizeRightSideOfBinary: (e, t, n) => n,
- parenthesizeExpressionOfComputedPropertyName: go,
- parenthesizeConditionOfConditionalExpression: go,
- parenthesizeBranchOfConditionalExpression: go,
- parenthesizeExpressionOfExportDefault: go,
- parenthesizeExpressionOfNew: (e) => Bs(e, __),
- parenthesizeLeftSideOfAccess: (e) => Bs(e, __),
- parenthesizeOperandOfPostfixUnary: (e) => Bs(e, __),
- parenthesizeOperandOfPrefixUnary: (e) => Bs(e, Ej),
- parenthesizeExpressionsOfCommaDelimitedList: (e) => Bs(e, pb),
- parenthesizeExpressionForDisallowedComma: go,
- parenthesizeExpressionOfExpressionStatement: go,
- parenthesizeConciseBodyOfArrowFunction: go,
- parenthesizeCheckTypeOfConditionalType: go,
- parenthesizeExtendsTypeOfConditionalType: go,
- parenthesizeConstituentTypesOfUnionType: (e) => Bs(e, pb),
- parenthesizeConstituentTypeOfUnionType: go,
- parenthesizeConstituentTypesOfIntersectionType: (e) => Bs(e, pb),
- parenthesizeConstituentTypeOfIntersectionType: go,
- parenthesizeOperandOfTypeOperator: go,
- parenthesizeOperandOfReadonlyTypeOperator: go,
- parenthesizeNonArrayTypeOfPostfixType: go,
- parenthesizeElementTypesOfTupleType: (e) => Bs(e, pb),
- parenthesizeElementTypeOfTupleType: go,
- parenthesizeTypeOfOptionalType: go,
- parenthesizeTypeArguments: (e) => e && Bs(e, pb),
- parenthesizeLeadingTypeArgument: go
- };
- function See(e) {
- return {
- convertToFunctionBlock: t,
- convertToFunctionExpression: n,
- convertToClassExpression: i,
- convertToArrayAssignmentElement: s,
- convertToObjectAssignmentElement: o,
- convertToAssignmentPattern: c,
- convertToObjectAssignmentPattern: _,
- convertToArrayAssignmentPattern: u,
- convertToAssignmentElementTarget: d
- };
- function t(g, h) {
- if (Cs(g)) return g;
- const S = e.createReturnStatement(g);
- lt(S, g);
- const T = e.createBlock([S], h);
- return lt(T, g), T;
- }
- function n(g) {
- var h;
- if (!g.body) return E.fail("Cannot convert a FunctionDeclaration without a body");
- const S = e.createFunctionExpression(
- (h = fb(g)) == null ? void 0 : h.filter((T) => !Cx(T) && !H5(T)),
- g.asteriskToken,
- g.name,
- g.typeParameters,
- g.parameters,
- g.type,
- g.body
- );
- return kn(S, g), lt(S, g), Y4(g) && R5(
- S,
- /*newLine*/
- !0
- ), S;
- }
- function i(g) {
- var h;
- const S = e.createClassExpression(
- (h = g.modifiers) == null ? void 0 : h.filter((T) => !Cx(T) && !H5(T)),
- g.name,
- g.typeParameters,
- g.heritageClauses,
- g.members
- );
- return kn(S, g), lt(S, g), Y4(g) && R5(
- S,
- /*newLine*/
- !0
- ), S;
- }
- function s(g) {
- if (va(g)) {
- if (g.dotDotDotToken)
- return E.assertNode(g.name, Oe), kn(lt(e.createSpreadElement(g.name), g), g);
- const h = d(g.name);
- return g.initializer ? kn(
- lt(
- e.createAssignment(h, g.initializer),
- g
- ),
- g
- ) : h;
- }
- return Bs(g, _t);
- }
- function o(g) {
- if (va(g)) {
- if (g.dotDotDotToken)
- return E.assertNode(g.name, Oe), kn(lt(e.createSpreadAssignment(g.name), g), g);
- if (g.propertyName) {
- const h = d(g.name);
- return kn(lt(e.createPropertyAssignment(g.propertyName, g.initializer ? e.createAssignment(h, g.initializer) : h), g), g);
- }
- return E.assertNode(g.name, Oe), kn(lt(e.createShorthandPropertyAssignment(g.name, g.initializer), g), g);
- }
- return Bs(g, kh);
- }
- function c(g) {
- switch (g.kind) {
- case 207:
- case 209:
- return u(g);
- case 206:
- case 210:
- return _(g);
- }
- }
- function _(g) {
- return Mf(g) ? kn(
- lt(
- e.createObjectLiteralExpression(lr(g.elements, o)),
- g
- ),
- g
- ) : Bs(g, Ks);
- }
- function u(g) {
- return w0(g) ? kn(
- lt(
- e.createArrayLiteralExpression(lr(g.elements, s)),
- g
- ),
- g
- ) : Bs(g, $l);
- }
- function d(g) {
- return As(g) ? c(g) : Bs(g, _t);
- }
- }
- var Tee = {
- convertToFunctionBlock: Vs,
- convertToFunctionExpression: Vs,
- convertToClassExpression: Vs,
- convertToArrayAssignmentElement: Vs,
- convertToObjectAssignmentElement: Vs,
- convertToAssignmentPattern: Vs,
- convertToObjectAssignmentPattern: Vs,
- convertToArrayAssignmentPattern: Vs,
- convertToAssignmentElementTarget: Vs
- }, SJ = 0, xee = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.NoParenthesizerRules = 1] = "NoParenthesizerRules", e[e.NoNodeConverters = 2] = "NoNodeConverters", e[e.NoIndentationOnFreshPropertyAccess = 4] = "NoIndentationOnFreshPropertyAccess", e[e.NoOriginalNode = 8] = "NoOriginalNode", e))(xee || {}), ehe = [];
- function the(e) {
- ehe.push(e);
- }
- function G3(e, t) {
- const n = e & 8 ? go : kn, i = Iu(() => e & 1 ? bee : vee(I)), s = Iu(() => e & 2 ? Tee : See(I)), o = im((v) => (w, R) => Vr(w, v, R)), c = im((v) => (w) => st(v, w)), _ = im((v) => (w) => Mt(w, v)), u = im((v) => () => hs(v)), d = im((v) => (w) => hk(v, w)), g = im((v) => (w, R) => ln(v, w, R)), h = im((v) => (w, R) => X0(v, w, R)), S = im((v) => (w, R) => Bv(v, w, R)), T = im((v) => (w, R) => Pu(v, w, R)), C = im((v) => (w, R, se) => L_(v, w, R, se)), D = im((v) => (w, R, se) => yk(v, w, R, se)), P = im((v) => (w, R, se, Be) => Fm(v, w, R, se, Be)), I = {
- get parenthesizer() {
- return i();
- },
- get converters() {
- return s();
- },
- baseFactory: t,
- flags: e,
- createNodeArray: F,
- createNumericLiteral: X,
- createBigIntLiteral: q,
- createStringLiteral: ae,
- createStringLiteralFromNode: ee,
- createRegularExpressionLiteral: G,
- createLiteralLikeNode: ue,
- createIdentifier: ie,
- createTempVariable: Se,
- createLoopVariable: J,
- createUniqueName: oe,
- getGeneratedNameForNode: _e,
- createPrivateIdentifier: le,
- createUniquePrivateName: ve,
- getGeneratedPrivateNameForNode: tt,
- createToken: we,
- createSuper: fe,
- createThis: Me,
- createNull: Qe,
- createTrue: et,
- createFalse: Re,
- createModifier: ft,
- createModifiersFromModifierFlags: Wt,
- createQualifiedName: _r,
- updateQualifiedName: Ir,
- createComputedPropertyName: jr,
- updateComputedPropertyName: Nt,
- createTypeParameterDeclaration: Qt,
- updateTypeParameterDeclaration: Br,
- createParameterDeclaration: xr,
- updateParameterDeclaration: zn,
- createDecorator: ki,
- updateDecorator: rs,
- createPropertySignature: ei,
- updatePropertySignature: Ri,
- createPropertyDeclaration: ji,
- updatePropertyDeclaration: Fe,
- createMethodSignature: Ot,
- updateMethodSignature: Ar,
- createMethodDeclaration: mn,
- updateMethodDeclaration: ti,
- createConstructorDeclaration: rr,
- updateConstructorDeclaration: Ea,
- createGetAccessorDeclaration: Tt,
- updateGetAccessorDeclaration: te,
- createSetAccessorDeclaration: K,
- updateSetAccessorDeclaration: De,
- createCallSignature: Ke,
- updateCallSignature: xe,
- createConstructSignature: at,
- updateConstructSignature: $e,
- createIndexSignature: bt,
- updateIndexSignature: He,
- createClassStaticBlockDeclaration: Oi,
- updateClassStaticBlockDeclaration: Ws,
- createTemplateLiteralTypeSpan: Vt,
- updateTemplateLiteralTypeSpan: Zt,
- createKeywordTypeNode: vn,
- createTypePredicateNode: M,
- updateTypePredicateNode: Ae,
- createTypeReferenceNode: dt,
- updateTypeReferenceNode: U,
- createFunctionTypeNode: be,
- updateFunctionTypeNode: Z,
- createConstructorTypeNode: Le,
- updateConstructorTypeNode: Dr,
- createTypeQueryNode: nt,
- updateTypeQueryNode: ot,
- createTypeLiteralNode: wt,
- updateTypeLiteralNode: jt,
- createArrayTypeNode: Xt,
- updateArrayTypeNode: Ht,
- createTupleTypeNode: en,
- updateTupleTypeNode: zt,
- createNamedTupleMember: mr,
- updateNamedTupleMember: Kt,
- createOptionalTypeNode: hr,
- updateOptionalTypeNode: Ft,
- createRestTypeNode: Ss,
- updateRestTypeNode: gs,
- createUnionTypeNode: lc,
- updateUnionTypeNode: Ic,
- createIntersectionTypeNode: io,
- updateIntersectionTypeNode: vi,
- createConditionalTypeNode: ca,
- updateConditionalTypeNode: Ll,
- createInferTypeNode: xs,
- updateInferTypeNode: Cu,
- createImportTypeNode: Na,
- updateImportTypeNode: Ia,
- createParenthesizedType: Vi,
- updateParenthesizedType: ba,
- createThisTypeNode: Bt,
- createTypeOperatorNode: to,
- updateTypeOperatorNode: _u,
- createIndexedAccessTypeNode: Wc,
- updateIndexedAccessTypeNode: of,
- createMappedTypeNode: Ao,
- updateMappedTypeNode: ge,
- createLiteralTypeNode: $,
- updateLiteralTypeNode: rt,
- createTemplateLiteralType: Zc,
- updateTemplateLiteralType: Yi,
- createObjectBindingPattern: Ct,
- updateObjectBindingPattern: $t,
- createArrayBindingPattern: zr,
- updateArrayBindingPattern: $n,
- createBindingElement: ar,
- updateBindingElement: An,
- createArrayLiteralExpression: ri,
- updateArrayLiteralExpression: Fi,
- createObjectLiteralExpression: za,
- updateObjectLiteralExpression: Uo,
- createPropertyAccessExpression: e & 4 ? (v, w) => an(
- Oc(v, w),
- 262144
- /* NoIndentation */
- ) : Oc,
- updatePropertyAccessExpression: Fc,
- createPropertyAccessChain: e & 4 ? (v, w, R) => an(
- Lo(v, w, R),
- 262144
- /* NoIndentation */
- ) : Lo,
- updatePropertyAccessChain: _c,
- createElementAccessExpression: Lc,
- updateElementAccessExpression: al,
- createElementAccessChain: hp,
- updateElementAccessChain: Pe,
- createCallExpression: Lr,
- updateCallExpression: $i,
- createCallChain: Sa,
- updateCallChain: ka,
- createNewExpression: Pc,
- updateNewExpression: yl,
- createTaggedTemplateExpression: so,
- updateTaggedTemplateExpression: Va,
- createTypeAssertion: Uc,
- updateTypeAssertion: cf,
- createParenthesizedExpression: Xp,
- updateParenthesizedExpression: A_,
- createFunctionExpression: Sf,
- updateFunctionExpression: Uf,
- createArrowFunction: yp,
- updateArrowFunction: Yg,
- createDeleteExpression: Qp,
- updateDeleteExpression: y_,
- createTypeOfExpression: vl,
- updateTypeOfExpression: Uh,
- createVoidExpression: r_,
- updateVoidExpression: Zg,
- createAwaitExpression: Vf,
- updateAwaitExpression: Y,
- createPrefixUnaryExpression: st,
- updatePrefixUnaryExpression: It,
- createPostfixUnaryExpression: Mt,
- updatePostfixUnaryExpression: Sr,
- createBinaryExpression: Vr,
- updateBinaryExpression: si,
- createConditionalExpression: L,
- updateConditionalExpression: Ce,
- createTemplateExpression: yt,
- updateTemplateExpression: Mr,
- createTemplateHead: ga,
- createTemplateMiddle: $o,
- createTemplateTail: vp,
- createNoSubstitutionTemplateLiteral: dd,
- createTemplateLiteralLikeNode: Pa,
- createYieldExpression: jd,
- updateYieldExpression: Kg,
- createSpreadElement: J0,
- updateSpreadElement: eh,
- createClassExpression: bp,
- updateClassExpression: Sp,
- createOmittedExpression: Mo,
- createExpressionWithTypeArguments: Tf,
- updateExpressionWithTypeArguments: N_,
- createAsExpression: Bd,
- updateAsExpression: th,
- createNonNullExpression: Yp,
- updateNonNullExpression: dg,
- createSatisfiesExpression: Vh,
- updateSatisfiesExpression: z0,
- createNonNullChain: Zp,
- updateNonNullChain: Nv,
- createMetaProperty: qf,
- updateMetaProperty: Kp,
- createTemplateSpan: qh,
- updateTemplateSpan: Iv,
- createSemicolonClassElement: mg,
- createBlock: rh,
- updateBlock: Ov,
- createVariableStatement: n1,
- updateVariableStatement: Ne,
- createEmptyStatement: qe,
- createExpressionStatement: vt,
- updateExpressionStatement: qt,
- createIfStatement: fr,
- updateIfStatement: qr,
- createDoStatement: kr,
- updateDoStatement: Dn,
- createWhileStatement: di,
- updateWhileStatement: _n,
- createForStatement: yi,
- updateForStatement: fn,
- createForInStatement: ks,
- updateForInStatement: po,
- createForOfStatement: Bu,
- updateForOfStatement: ed,
- createContinueStatement: Ju,
- updateContinueStatement: td,
- createBreakStatement: zu,
- updateBreakStatement: o2,
- createReturnStatement: i1,
- updateReturnStatement: nh,
- createWithStatement: Hh,
- updateWithStatement: W0,
- createSwitchStatement: md,
- updateSwitchStatement: U0,
- createLabeledStatement: s1,
- updateLabeledStatement: a1,
- createThrowStatement: o1,
- updateThrowStatement: jS,
- createTryStatement: Fv,
- updateTryStatement: Da,
- createDebuggerStatement: c2,
- createVariableDeclaration: BS,
- updateVariableDeclaration: Lv,
- createVariableDeclarationList: ih,
- updateVariableDeclarationList: sh,
- createFunctionDeclaration: Hf,
- updateFunctionDeclaration: lf,
- createClassDeclaration: I_,
- updateClassDeclaration: c1,
- createInterfaceDeclaration: V6,
- updateInterfaceDeclaration: xl,
- createTypeAliasDeclaration: Jd,
- updateTypeAliasDeclaration: V0,
- createEnumDeclaration: gg,
- updateEnumDeclaration: fk,
- createModuleDeclaration: fu,
- updateModuleDeclaration: Gh,
- createModuleBlock: O_,
- updateModuleBlock: Mv,
- createCaseBlock: Nm,
- updateCaseBlock: je,
- createNamespaceExportDeclaration: zd,
- updateNamespaceExportDeclaration: Im,
- createImportEqualsDeclaration: pk,
- updateImportEqualsDeclaration: $h,
- createImportDeclaration: q0,
- updateImportDeclaration: Xh,
- createImportClause: dk,
- updateImportClause: fa,
- createAssertClause: gd,
- updateAssertClause: H0,
- createAssertEntry: jv,
- updateAssertEntry: xf,
- createImportTypeAssertionContainer: ah,
- updateImportTypeAssertionContainer: Wd,
- createImportAttributes: hg,
- updateImportAttributes: mk,
- createImportAttribute: l1,
- updateImportAttribute: rd,
- createNamespaceImport: gk,
- updateNamespaceImport: G0,
- createNamespaceExport: Bi,
- updateNamespaceExport: bn,
- createNamedImports: Al,
- updateNamedImports: Qh,
- createImportSpecifier: $0,
- updateImportSpecifier: JS,
- createExportAssignment: u1,
- updateExportAssignment: zS,
- createExportDeclaration: Do,
- updateExportDeclaration: Yh,
- createNamedExports: Tp,
- updateNamedExports: u2,
- createExportSpecifier: WS,
- updateExportSpecifier: q6,
- createMissingDeclaration: H6,
- createExternalModuleReference: Sn,
- updateExternalModuleReference: pu,
- // lazily load factory members for JSDoc types with similar structure
- get createJSDocAllType() {
- return u(
- 312
- /* JSDocAllType */
- );
- },
- get createJSDocUnknownType() {
- return u(
- 313
- /* JSDocUnknownType */
- );
- },
- get createJSDocNonNullableType() {
- return h(
- 315
- /* JSDocNonNullableType */
- );
- },
- get updateJSDocNonNullableType() {
- return S(
- 315
- /* JSDocNonNullableType */
- );
- },
- get createJSDocNullableType() {
- return h(
- 314
- /* JSDocNullableType */
- );
- },
- get updateJSDocNullableType() {
- return S(
- 314
- /* JSDocNullableType */
- );
- },
- get createJSDocOptionalType() {
- return d(
- 316
- /* JSDocOptionalType */
- );
- },
- get updateJSDocOptionalType() {
- return g(
- 316
- /* JSDocOptionalType */
- );
- },
- get createJSDocVariadicType() {
- return d(
- 318
- /* JSDocVariadicType */
- );
- },
- get updateJSDocVariadicType() {
- return g(
- 318
- /* JSDocVariadicType */
- );
- },
- get createJSDocNamepathType() {
- return d(
- 319
- /* JSDocNamepathType */
- );
- },
- get updateJSDocNamepathType() {
- return g(
- 319
- /* JSDocNamepathType */
- );
- },
- createJSDocFunctionType: G6,
- updateJSDocFunctionType: US,
- createJSDocTypeLiteral: Eu,
- updateJSDocTypeLiteral: Du,
- createJSDocTypeExpression: kf,
- updateJSDocTypeExpression: Jv,
- createJSDocSignature: VS,
- updateJSDocSignature: oh,
- createJSDocTemplateTag: Q0,
- updateJSDocTemplateTag: Y0,
- createJSDocTypedefTag: _2,
- updateJSDocTypedefTag: qS,
- createJSDocParameterTag: _1,
- updateJSDocParameterTag: HS,
- createJSDocPropertyTag: GS,
- updateJSDocPropertyTag: $S,
- createJSDocCallbackTag: Ud,
- updateJSDocCallbackTag: $6,
- createJSDocOverloadTag: zv,
- updateJSDocOverloadTag: f1,
- createJSDocAugmentsTag: ch,
- updateJSDocAugmentsTag: Zh,
- createJSDocImplementsTag: hd,
- updateJSDocImplementsTag: X6,
- createJSDocSeeTag: Z0,
- updateJSDocSeeTag: XS,
- createJSDocImportTag: Yo,
- updateJSDocImportTag: Q6,
- createJSDocNameReference: kl,
- updateJSDocNameReference: QS,
- createJSDocMemberName: yg,
- updateJSDocMemberName: YS,
- createJSDocLink: Wv,
- updateJSDocLink: Kh,
- createJSDocLinkCode: p1,
- updateJSDocLinkCode: f2,
- createJSDocLinkPlain: Mc,
- updateJSDocLinkPlain: Zl,
- // lazily load factory members for JSDoc tags with similar structure
- get createJSDocTypeTag() {
- return D(
- 344
- /* JSDocTypeTag */
- );
- },
- get updateJSDocTypeTag() {
- return P(
- 344
- /* JSDocTypeTag */
- );
- },
- get createJSDocReturnTag() {
- return D(
- 342
- /* JSDocReturnTag */
- );
- },
- get updateJSDocReturnTag() {
- return P(
- 342
- /* JSDocReturnTag */
- );
- },
- get createJSDocThisTag() {
- return D(
- 343
- /* JSDocThisTag */
- );
- },
- get updateJSDocThisTag() {
- return P(
- 343
- /* JSDocThisTag */
- );
- },
- get createJSDocAuthorTag() {
- return T(
- 330
- /* JSDocAuthorTag */
- );
- },
- get updateJSDocAuthorTag() {
- return C(
- 330
- /* JSDocAuthorTag */
- );
- },
- get createJSDocClassTag() {
- return T(
- 332
- /* JSDocClassTag */
- );
- },
- get updateJSDocClassTag() {
- return C(
- 332
- /* JSDocClassTag */
- );
- },
- get createJSDocPublicTag() {
- return T(
- 333
- /* JSDocPublicTag */
- );
- },
- get updateJSDocPublicTag() {
- return C(
- 333
- /* JSDocPublicTag */
- );
- },
- get createJSDocPrivateTag() {
- return T(
- 334
- /* JSDocPrivateTag */
- );
- },
- get updateJSDocPrivateTag() {
- return C(
- 334
- /* JSDocPrivateTag */
- );
- },
- get createJSDocProtectedTag() {
- return T(
- 335
- /* JSDocProtectedTag */
- );
- },
- get updateJSDocProtectedTag() {
- return C(
- 335
- /* JSDocProtectedTag */
- );
- },
- get createJSDocReadonlyTag() {
- return T(
- 336
- /* JSDocReadonlyTag */
- );
- },
- get updateJSDocReadonlyTag() {
- return C(
- 336
- /* JSDocReadonlyTag */
- );
- },
- get createJSDocOverrideTag() {
- return T(
- 337
- /* JSDocOverrideTag */
- );
- },
- get updateJSDocOverrideTag() {
- return C(
- 337
- /* JSDocOverrideTag */
- );
- },
- get createJSDocDeprecatedTag() {
- return T(
- 331
- /* JSDocDeprecatedTag */
- );
- },
- get updateJSDocDeprecatedTag() {
- return C(
- 331
- /* JSDocDeprecatedTag */
- );
- },
- get createJSDocThrowsTag() {
- return D(
- 349
- /* JSDocThrowsTag */
- );
- },
- get updateJSDocThrowsTag() {
- return P(
- 349
- /* JSDocThrowsTag */
- );
- },
- get createJSDocSatisfiesTag() {
- return D(
- 350
- /* JSDocSatisfiesTag */
- );
- },
- get updateJSDocSatisfiesTag() {
- return P(
- 350
- /* JSDocSatisfiesTag */
- );
- },
- createJSDocEnumTag: ZS,
- updateJSDocEnumTag: gP,
- createJSDocUnknownTag: vk,
- updateJSDocUnknownTag: K0,
- createJSDocText: bk,
- updateJSDocText: d1,
- createJSDocComment: KS,
- updateJSDocComment: v_,
- createJsxElement: p2,
- updateJsxElement: Sk,
- createJsxSelfClosingElement: d2,
- updateJsxSelfClosingElement: M_,
- createJsxOpeningElement: Tk,
- updateJsxOpeningElement: m1,
- createJsxClosingElement: $f,
- updateJsxClosingElement: eT,
- createJsxFragment: g1,
- createJsxText: m2,
- updateJsxText: tT,
- createJsxOpeningFragment: xk,
- createJsxJsxClosingFragment: ey,
- updateJsxFragment: hP,
- createJsxAttribute: n_,
- updateJsxAttribute: lh,
- createJsxAttributes: uh,
- updateJsxAttributes: Y6,
- createJsxSpreadAttribute: Ra,
- updateJsxSpreadAttribute: Tn,
- createJsxExpression: i_,
- updateJsxExpression: Cf,
- createJsxNamespacedName: g2,
- updateJsxNamespacedName: Z6,
- createCaseClause: kk,
- updateCaseClause: Uv,
- createDefaultClause: h2,
- updateDefaultClause: y2,
- createHeritageClause: nd,
- updateHeritageClause: _f,
- createCatchClause: ff,
- updateCatchClause: Vd,
- createPropertyAssignment: id,
- updatePropertyAssignment: rT,
- createShorthandPropertyAssignment: Ck,
- updateShorthandPropertyAssignment: k,
- createSpreadAssignment: pt,
- updateSpreadAssignment: Yt,
- createEnumMember: ai,
- updateEnumMember: qi,
- createSourceFile: Ki,
- updateSourceFile: ty,
- createRedirectedSourceFile: Hi,
- createBundle: pf,
- updateBundle: v2,
- createSyntheticExpression: Vv,
- createSyntaxList: b2,
- createNotEmittedStatement: Ek,
- createPartiallyEmittedExpression: nT,
- updatePartiallyEmittedExpression: Hd,
- createCommaListExpression: ry,
- updateCommaListExpression: Dk,
- createSyntheticReferenceExpression: h1,
- updateSyntheticReferenceExpression: yP,
- cloneNode: Hr,
- // Lazily load factory methods for common operator factories and utilities
- get createComma() {
- return o(
- 28
- /* CommaToken */
- );
- },
- get createAssignment() {
- return o(
- 64
- /* EqualsToken */
- );
- },
- get createLogicalOr() {
- return o(
- 57
- /* BarBarToken */
- );
- },
- get createLogicalAnd() {
- return o(
- 56
- /* AmpersandAmpersandToken */
- );
- },
- get createBitwiseOr() {
- return o(
- 52
- /* BarToken */
- );
- },
- get createBitwiseXor() {
- return o(
- 53
- /* CaretToken */
- );
- },
- get createBitwiseAnd() {
- return o(
- 51
- /* AmpersandToken */
- );
- },
- get createStrictEquality() {
- return o(
- 37
- /* EqualsEqualsEqualsToken */
- );
- },
- get createStrictInequality() {
- return o(
- 38
- /* ExclamationEqualsEqualsToken */
- );
- },
- get createEquality() {
- return o(
- 35
- /* EqualsEqualsToken */
- );
- },
- get createInequality() {
- return o(
- 36
- /* ExclamationEqualsToken */
- );
- },
- get createLessThan() {
- return o(
- 30
- /* LessThanToken */
- );
- },
- get createLessThanEquals() {
- return o(
- 33
- /* LessThanEqualsToken */
- );
- },
- get createGreaterThan() {
- return o(
- 32
- /* GreaterThanToken */
- );
- },
- get createGreaterThanEquals() {
- return o(
- 34
- /* GreaterThanEqualsToken */
- );
- },
- get createLeftShift() {
- return o(
- 48
- /* LessThanLessThanToken */
- );
- },
- get createRightShift() {
- return o(
- 49
- /* GreaterThanGreaterThanToken */
- );
- },
- get createUnsignedRightShift() {
- return o(
- 50
- /* GreaterThanGreaterThanGreaterThanToken */
- );
- },
- get createAdd() {
- return o(
- 40
- /* PlusToken */
- );
- },
- get createSubtract() {
- return o(
- 41
- /* MinusToken */
- );
- },
- get createMultiply() {
- return o(
- 42
- /* AsteriskToken */
- );
- },
- get createDivide() {
- return o(
- 44
- /* SlashToken */
- );
- },
- get createModulo() {
- return o(
- 45
- /* PercentToken */
- );
- },
- get createExponent() {
- return o(
- 43
- /* AsteriskAsteriskToken */
- );
- },
- get createPrefixPlus() {
- return c(
- 40
- /* PlusToken */
- );
- },
- get createPrefixMinus() {
- return c(
- 41
- /* MinusToken */
- );
- },
- get createPrefixIncrement() {
- return c(
- 46
- /* PlusPlusToken */
- );
- },
- get createPrefixDecrement() {
- return c(
- 47
- /* MinusMinusToken */
- );
- },
- get createBitwiseNot() {
- return c(
- 55
- /* TildeToken */
- );
- },
- get createLogicalNot() {
- return c(
- 54
- /* ExclamationToken */
- );
- },
- get createPostfixIncrement() {
- return _(
- 46
- /* PlusPlusToken */
- );
- },
- get createPostfixDecrement() {
- return _(
- 47
- /* MinusMinusToken */
- );
- },
- // Compound nodes
- createImmediatelyInvokedFunctionExpression: vP,
- createImmediatelyInvokedArrowFunction: K6,
- createVoidZero: y1,
- createExportDefault: eE,
- createExternalModuleExport: cN,
- createTypeCheck: bP,
- createIsNotTypeCheck: SL,
- createMethodCall: Lm,
- createGlobalMethodCall: iT,
- createFunctionBindCall: TL,
- createFunctionCallCall: SP,
- createFunctionApplyCall: xL,
- createArraySliceCall: sT,
- createArrayConcatCall: lN,
- createObjectDefinePropertyCall: v1,
- createObjectGetOwnPropertyDescriptorCall: yd,
- createReflectGetCall: tE,
- createReflectSetCall: vg,
- createPropertyDescriptor: uN,
- createCallBinding: Wa,
- createAssignmentTargetWrapper: H,
- // Utilities
- inlineExpressions: ke,
- getInternalName: gt,
- getLocalName: Rt,
- getExportName: gr,
- getDeclarationName: jn,
- getNamespaceMemberName: Pi,
- getExternalModuleOrNamespaceExportName: ui,
- restoreOuterExpressions: _N,
- restoreEnclosingLabel: Rc,
- createUseStrictPrologue: Ka,
- copyPrologue: _i,
- copyStandardPrologue: eo,
- copyCustomPrologue: wa,
- ensureUseStrict: xp,
- liftToBlock: cl,
- mergeLexicalEnvironment: e0,
- replaceModifiers: fh,
- replaceDecoratorsAndModifiers: S1,
- replacePropertyName: kL
- };
- return ir(ehe, (v) => v(I)), I;
- function F(v, w) {
- if (v === void 0 || v === Ue)
- v = [];
- else if (pb(v)) {
- if (w === void 0 || v.hasTrailingComma === w)
- return v.transformFlags === void 0 && nhe(v), E.attachNodeArrayDebugInfo(v), v;
- const Be = v.slice();
- return Be.pos = v.pos, Be.end = v.end, Be.hasTrailingComma = w, Be.transformFlags = v.transformFlags, E.attachNodeArrayDebugInfo(Be), Be;
- }
- const R = v.length, se = R >= 1 && R <= 4 ? v.slice() : v;
- return se.pos = -1, se.end = -1, se.hasTrailingComma = !!w, se.transformFlags = 0, nhe(se), E.attachNodeArrayDebugInfo(se), se;
- }
- function O(v) {
- return t.createBaseNode(v);
- }
- function B(v) {
- const w = O(v);
- return w.symbol = void 0, w.localSymbol = void 0, w;
- }
- function z(v, w) {
- return v !== w && (v.typeArguments = w.typeArguments), on(v, w);
- }
- function X(v, w = 0) {
- const R = typeof v == "number" ? v + "" : v;
- E.assert(R.charCodeAt(0) !== 45, "Negative numbers should be created in combination with createPrefixUnaryExpression");
- const se = B(
- 9
- /* NumericLiteral */
- );
- return se.text = R, se.numericLiteralFlags = w, w & 384 && (se.transformFlags |= 1024), se;
- }
- function q(v) {
- const w = Te(
- 10
- /* BigIntLiteral */
- );
- return w.text = typeof v == "string" ? v : Ib(v) + "n", w.transformFlags |= 32, w;
- }
- function V(v, w) {
- const R = B(
- 11
- /* StringLiteral */
- );
- return R.text = v, R.singleQuote = w, R;
- }
- function ae(v, w, R) {
- const se = V(v, w);
- return se.hasExtendedUnicodeEscape = R, R && (se.transformFlags |= 1024), se;
- }
- function ee(v) {
- const w = V(
- Jp(v),
- /*isSingleQuote*/
- void 0
- );
- return w.textSourceNode = v, w;
- }
- function G(v) {
- const w = Te(
- 14
- /* RegularExpressionLiteral */
- );
- return w.text = v, w;
- }
- function ue(v, w) {
- switch (v) {
- case 9:
- return X(
- w,
- /*numericLiteralFlags*/
- 0
- );
- case 10:
- return q(w);
- case 11:
- return ae(
- w,
- /*isSingleQuote*/
- void 0
- );
- case 12:
- return m2(
- w,
- /*containsOnlyTriviaWhiteSpaces*/
- !1
- );
- case 13:
- return m2(
- w,
- /*containsOnlyTriviaWhiteSpaces*/
- !0
- );
- case 14:
- return G(w);
- case 15:
- return Pa(
- v,
- w,
- /*rawText*/
- void 0,
- /*templateFlags*/
- 0
- );
- }
- }
- function re(v) {
- const w = t.createBaseIdentifierNode(
- 80
- /* Identifier */
- );
- return w.escapedText = v, w.jsDoc = void 0, w.flowNode = void 0, w.symbol = void 0, w;
- }
- function ne(v, w, R, se) {
- const Be = re(tc(v));
- return Z3(Be, {
- flags: w,
- id: SJ,
- prefix: R,
- suffix: se
- }), SJ++, Be;
- }
- function ie(v, w, R) {
- w === void 0 && v && (w = H2(v)), w === 80 && (w = void 0);
- const se = re(tc(v));
- return R && (se.flags |= 256), se.escapedText === "await" && (se.transformFlags |= 67108864), se.flags & 256 && (se.transformFlags |= 1024), se;
- }
- function Se(v, w, R, se) {
- let Be = 1;
- w && (Be |= 8);
- const Lt = ne("", Be, R, se);
- return v && v(Lt), Lt;
- }
- function J(v) {
- let w = 2;
- return v && (w |= 8), ne(
- "",
- w,
- /*prefix*/
- void 0,
- /*suffix*/
- void 0
- );
- }
- function oe(v, w = 0, R, se) {
- return E.assert(!(w & 7), "Argument out of range: flags"), E.assert((w & 48) !== 32, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"), ne(v, 3 | w, R, se);
- }
- function _e(v, w = 0, R, se) {
- E.assert(!(w & 7), "Argument out of range: flags");
- const Be = v ? Fg(v) ? mv(
- /*privateName*/
- !1,
- R,
- v,
- se,
- Nn
- ) : `generated@${Ma(v)}` : "";
- (R || se) && (w |= 16);
- const Lt = ne(Be, 4 | w, R, se);
- return Lt.original = v, Lt;
- }
- function he(v) {
- const w = t.createBasePrivateIdentifierNode(
- 81
- /* PrivateIdentifier */
- );
- return w.escapedText = v, w.transformFlags |= 16777216, w;
- }
- function le(v) {
- return Ui(v, "#") || E.fail("First character of private identifier must be #: " + v), he(tc(v));
- }
- function me(v, w, R, se) {
- const Be = he(tc(v));
- return Z3(Be, {
- flags: w,
- id: SJ,
- prefix: R,
- suffix: se
- }), SJ++, Be;
- }
- function ve(v, w, R) {
- v && !Ui(v, "#") && E.fail("First character of private identifier must be #: " + v);
- const se = 8 | (v ? 3 : 1);
- return me(v ?? "", se, w, R);
- }
- function tt(v, w, R) {
- const se = Fg(v) ? mv(
- /*privateName*/
- !0,
- w,
- v,
- R,
- Nn
- ) : `#generated@${Ma(v)}`, Lt = me(se, 4 | (w || R ? 16 : 0), w, R);
- return Lt.original = v, Lt;
- }
- function Te(v) {
- return t.createBaseTokenNode(v);
- }
- function we(v) {
- E.assert(v >= 0 && v <= 165, "Invalid token"), E.assert(v <= 15 || v >= 18, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."), E.assert(v <= 9 || v >= 15, "Invalid token. Use 'createLiteralLikeNode' to create literals."), E.assert(v !== 80, "Invalid token. Use 'createIdentifier' to create identifiers");
- const w = Te(v);
- let R = 0;
- switch (v) {
- case 134:
- R = 384;
- break;
- case 160:
- R = 4;
- break;
- case 125:
- case 123:
- case 124:
- case 148:
- case 128:
- case 138:
- case 87:
- case 133:
- case 150:
- case 163:
- case 146:
- case 151:
- case 103:
- case 147:
- case 164:
- case 154:
- case 136:
- case 155:
- case 116:
- case 159:
- case 157:
- R = 1;
- break;
- case 108:
- R = 134218752, w.flowNode = void 0;
- break;
- case 126:
- R = 1024;
- break;
- case 129:
- R = 16777216;
- break;
- case 110:
- R = 16384, w.flowNode = void 0;
- break;
- }
- return R && (w.transformFlags |= R), w;
- }
- function fe() {
- return we(
- 108
- /* SuperKeyword */
- );
- }
- function Me() {
- return we(
- 110
- /* ThisKeyword */
- );
- }
- function Qe() {
- return we(
- 106
- /* NullKeyword */
- );
- }
- function et() {
- return we(
- 112
- /* TrueKeyword */
- );
- }
- function Re() {
- return we(
- 97
- /* FalseKeyword */
- );
- }
- function ft(v) {
- return we(v);
- }
- function Wt(v) {
- const w = [];
- return v & 32 && w.push(ft(
- 95
- /* ExportKeyword */
- )), v & 128 && w.push(ft(
- 138
- /* DeclareKeyword */
- )), v & 2048 && w.push(ft(
- 90
- /* DefaultKeyword */
- )), v & 4096 && w.push(ft(
- 87
- /* ConstKeyword */
- )), v & 1 && w.push(ft(
- 125
- /* PublicKeyword */
- )), v & 2 && w.push(ft(
- 123
- /* PrivateKeyword */
- )), v & 4 && w.push(ft(
- 124
- /* ProtectedKeyword */
- )), v & 64 && w.push(ft(
- 128
- /* AbstractKeyword */
- )), v & 256 && w.push(ft(
- 126
- /* StaticKeyword */
- )), v & 16 && w.push(ft(
- 164
- /* OverrideKeyword */
- )), v & 8 && w.push(ft(
- 148
- /* ReadonlyKeyword */
- )), v & 512 && w.push(ft(
- 129
- /* AccessorKeyword */
- )), v & 1024 && w.push(ft(
- 134
- /* AsyncKeyword */
- )), v & 8192 && w.push(ft(
- 103
- /* InKeyword */
- )), v & 16384 && w.push(ft(
- 147
- /* OutKeyword */
- )), w.length ? w : void 0;
- }
- function _r(v, w) {
- const R = O(
- 166
- /* QualifiedName */
- );
- return R.left = v, R.right = Kc(w), R.transformFlags |= yn(R.left) | $3(R.right), R.flowNode = void 0, R;
- }
- function Ir(v, w, R) {
- return v.left !== w || v.right !== R ? on(_r(w, R), v) : v;
- }
- function jr(v) {
- const w = O(
- 167
- /* ComputedPropertyName */
- );
- return w.expression = i().parenthesizeExpressionOfComputedPropertyName(v), w.transformFlags |= yn(w.expression) | 1024 | 131072, w;
- }
- function Nt(v, w) {
- return v.expression !== w ? on(jr(w), v) : v;
- }
- function Qt(v, w, R, se) {
- const Be = B(
- 168
- /* TypeParameter */
- );
- return Be.modifiers = Oa(v), Be.name = Kc(w), Be.constraint = R, Be.default = se, Be.transformFlags = 1, Be.expression = void 0, Be.jsDoc = void 0, Be;
- }
- function Br(v, w, R, se, Be) {
- return v.modifiers !== w || v.name !== R || v.constraint !== se || v.default !== Be ? on(Qt(w, R, se, Be), v) : v;
- }
- function xr(v, w, R, se, Be, Lt) {
- const pn = B(
- 169
- /* Parameter */
- );
- return pn.modifiers = Oa(v), pn.dotDotDotToken = w, pn.name = Kc(R), pn.questionToken = se, pn.type = Be, pn.initializer = S2(Lt), Ly(pn.name) ? pn.transformFlags = 1 : pn.transformFlags = Ca(pn.modifiers) | yn(pn.dotDotDotToken) | Uy(pn.name) | yn(pn.questionToken) | yn(pn.initializer) | (pn.questionToken ?? pn.type ? 1 : 0) | (pn.dotDotDotToken ?? pn.initializer ? 1024 : 0) | (mm(pn.modifiers) & 31 ? 8192 : 0), pn.jsDoc = void 0, pn;
- }
- function zn(v, w, R, se, Be, Lt, pn) {
- return v.modifiers !== w || v.dotDotDotToken !== R || v.name !== se || v.questionToken !== Be || v.type !== Lt || v.initializer !== pn ? on(xr(w, R, se, Be, Lt, pn), v) : v;
- }
- function ki(v) {
- const w = O(
- 170
- /* Decorator */
- );
- return w.expression = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ), w.transformFlags |= yn(w.expression) | 1 | 8192 | 33554432, w;
- }
- function rs(v, w) {
- return v.expression !== w ? on(ki(w), v) : v;
- }
- function ei(v, w, R, se) {
- const Be = B(
- 171
- /* PropertySignature */
- );
- return Be.modifiers = Oa(v), Be.name = Kc(w), Be.type = se, Be.questionToken = R, Be.transformFlags = 1, Be.initializer = void 0, Be.jsDoc = void 0, Be;
- }
- function Ri(v, w, R, se, Be) {
- return v.modifiers !== w || v.name !== R || v.questionToken !== se || v.type !== Be ? Jr(ei(w, R, se, Be), v) : v;
- }
- function Jr(v, w) {
- return v !== w && (v.initializer = w.initializer), on(v, w);
- }
- function ji(v, w, R, se, Be) {
- const Lt = B(
- 172
- /* PropertyDeclaration */
- );
- Lt.modifiers = Oa(v), Lt.name = Kc(w), Lt.questionToken = R && Vy(R) ? R : void 0, Lt.exclamationToken = R && eA(R) ? R : void 0, Lt.type = se, Lt.initializer = S2(Be);
- const pn = Lt.flags & 33554432 || mm(Lt.modifiers) & 128;
- return Lt.transformFlags = Ca(Lt.modifiers) | Uy(Lt.name) | yn(Lt.initializer) | (pn || Lt.questionToken || Lt.exclamationToken || Lt.type ? 1 : 0) | (ma(Lt.name) || mm(Lt.modifiers) & 256 && Lt.initializer ? 8192 : 0) | 16777216, Lt.jsDoc = void 0, Lt;
- }
- function Fe(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.name !== R || v.questionToken !== (se !== void 0 && Vy(se) ? se : void 0) || v.exclamationToken !== (se !== void 0 && eA(se) ? se : void 0) || v.type !== Be || v.initializer !== Lt ? on(ji(w, R, se, Be, Lt), v) : v;
- }
- function Ot(v, w, R, se, Be, Lt) {
- const pn = B(
- 173
- /* MethodSignature */
- );
- return pn.modifiers = Oa(v), pn.name = Kc(w), pn.questionToken = R, pn.typeParameters = Oa(se), pn.parameters = Oa(Be), pn.type = Lt, pn.transformFlags = 1, pn.jsDoc = void 0, pn.locals = void 0, pn.nextContainer = void 0, pn.typeArguments = void 0, pn;
- }
- function Ar(v, w, R, se, Be, Lt, pn) {
- return v.modifiers !== w || v.name !== R || v.questionToken !== se || v.typeParameters !== Be || v.parameters !== Lt || v.type !== pn ? z(Ot(w, R, se, Be, Lt, pn), v) : v;
- }
- function mn(v, w, R, se, Be, Lt, pn, ts) {
- const ao = B(
- 174
- /* MethodDeclaration */
- );
- if (ao.modifiers = Oa(v), ao.asteriskToken = w, ao.name = Kc(R), ao.questionToken = se, ao.exclamationToken = void 0, ao.typeParameters = Oa(Be), ao.parameters = F(Lt), ao.type = pn, ao.body = ts, !ao.body)
- ao.transformFlags = 1;
- else {
- const kp = mm(ao.modifiers) & 1024, Sg = !!ao.asteriskToken, Qf = kp && Sg;
- ao.transformFlags = Ca(ao.modifiers) | yn(ao.asteriskToken) | Uy(ao.name) | yn(ao.questionToken) | Ca(ao.typeParameters) | Ca(ao.parameters) | yn(ao.type) | yn(ao.body) & -67108865 | (Qf ? 128 : kp ? 256 : Sg ? 2048 : 0) | (ao.questionToken || ao.typeParameters || ao.type ? 1 : 0) | 1024;
- }
- return ao.typeArguments = void 0, ao.jsDoc = void 0, ao.locals = void 0, ao.nextContainer = void 0, ao.flowNode = void 0, ao.endFlowNode = void 0, ao.returnFlowNode = void 0, ao;
- }
- function ti(v, w, R, se, Be, Lt, pn, ts, ao) {
- return v.modifiers !== w || v.asteriskToken !== R || v.name !== se || v.questionToken !== Be || v.typeParameters !== Lt || v.parameters !== pn || v.type !== ts || v.body !== ao ? qn(mn(w, R, se, Be, Lt, pn, ts, ao), v) : v;
- }
- function qn(v, w) {
- return v !== w && (v.exclamationToken = w.exclamationToken), on(v, w);
- }
- function Oi(v) {
- const w = B(
- 175
- /* ClassStaticBlockDeclaration */
- );
- return w.body = v, w.transformFlags = yn(v) | 16777216, w.modifiers = void 0, w.jsDoc = void 0, w.locals = void 0, w.nextContainer = void 0, w.endFlowNode = void 0, w.returnFlowNode = void 0, w;
- }
- function Ws(v, w) {
- return v.body !== w ? Hs(Oi(w), v) : v;
- }
- function Hs(v, w) {
- return v !== w && (v.modifiers = w.modifiers), on(v, w);
- }
- function rr(v, w, R) {
- const se = B(
- 176
- /* Constructor */
- );
- return se.modifiers = Oa(v), se.parameters = F(w), se.body = R, se.body ? se.transformFlags = Ca(se.modifiers) | Ca(se.parameters) | yn(se.body) & -67108865 | 1024 : se.transformFlags = 1, se.typeParameters = void 0, se.type = void 0, se.typeArguments = void 0, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.endFlowNode = void 0, se.returnFlowNode = void 0, se;
- }
- function Ea(v, w, R, se) {
- return v.modifiers !== w || v.parameters !== R || v.body !== se ? Xe(rr(w, R, se), v) : v;
- }
- function Xe(v, w) {
- return v !== w && (v.typeParameters = w.typeParameters, v.type = w.type), z(v, w);
- }
- function Tt(v, w, R, se, Be) {
- const Lt = B(
- 177
- /* GetAccessor */
- );
- return Lt.modifiers = Oa(v), Lt.name = Kc(w), Lt.parameters = F(R), Lt.type = se, Lt.body = Be, Lt.body ? Lt.transformFlags = Ca(Lt.modifiers) | Uy(Lt.name) | Ca(Lt.parameters) | yn(Lt.type) | yn(Lt.body) & -67108865 | (Lt.type ? 1 : 0) : Lt.transformFlags = 1, Lt.typeArguments = void 0, Lt.typeParameters = void 0, Lt.jsDoc = void 0, Lt.locals = void 0, Lt.nextContainer = void 0, Lt.flowNode = void 0, Lt.endFlowNode = void 0, Lt.returnFlowNode = void 0, Lt;
- }
- function te(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.name !== R || v.parameters !== se || v.type !== Be || v.body !== Lt ? ze(Tt(w, R, se, Be, Lt), v) : v;
- }
- function ze(v, w) {
- return v !== w && (v.typeParameters = w.typeParameters), z(v, w);
- }
- function K(v, w, R, se) {
- const Be = B(
- 178
- /* SetAccessor */
- );
- return Be.modifiers = Oa(v), Be.name = Kc(w), Be.parameters = F(R), Be.body = se, Be.body ? Be.transformFlags = Ca(Be.modifiers) | Uy(Be.name) | Ca(Be.parameters) | yn(Be.body) & -67108865 | (Be.type ? 1 : 0) : Be.transformFlags = 1, Be.typeArguments = void 0, Be.typeParameters = void 0, Be.type = void 0, Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be.flowNode = void 0, Be.endFlowNode = void 0, Be.returnFlowNode = void 0, Be;
- }
- function De(v, w, R, se, Be) {
- return v.modifiers !== w || v.name !== R || v.parameters !== se || v.body !== Be ? Ve(K(w, R, se, Be), v) : v;
- }
- function Ve(v, w) {
- return v !== w && (v.typeParameters = w.typeParameters, v.type = w.type), z(v, w);
- }
- function Ke(v, w, R) {
- const se = B(
- 179
- /* CallSignature */
- );
- return se.typeParameters = Oa(v), se.parameters = Oa(w), se.type = R, se.transformFlags = 1, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.typeArguments = void 0, se;
- }
- function xe(v, w, R, se) {
- return v.typeParameters !== w || v.parameters !== R || v.type !== se ? z(Ke(w, R, se), v) : v;
- }
- function at(v, w, R) {
- const se = B(
- 180
- /* ConstructSignature */
- );
- return se.typeParameters = Oa(v), se.parameters = Oa(w), se.type = R, se.transformFlags = 1, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.typeArguments = void 0, se;
- }
- function $e(v, w, R, se) {
- return v.typeParameters !== w || v.parameters !== R || v.type !== se ? z(at(w, R, se), v) : v;
- }
- function bt(v, w, R) {
- const se = B(
- 181
- /* IndexSignature */
- );
- return se.modifiers = Oa(v), se.parameters = Oa(w), se.type = R, se.transformFlags = 1, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.typeArguments = void 0, se;
- }
- function He(v, w, R, se) {
- return v.parameters !== R || v.type !== se || v.modifiers !== w ? z(bt(w, R, se), v) : v;
- }
- function Vt(v, w) {
- const R = O(
- 204
- /* TemplateLiteralTypeSpan */
- );
- return R.type = v, R.literal = w, R.transformFlags = 1, R;
- }
- function Zt(v, w, R) {
- return v.type !== w || v.literal !== R ? on(Vt(w, R), v) : v;
- }
- function vn(v) {
- return we(v);
- }
- function M(v, w, R) {
- const se = O(
- 182
- /* TypePredicate */
- );
- return se.assertsModifier = v, se.parameterName = Kc(w), se.type = R, se.transformFlags = 1, se;
- }
- function Ae(v, w, R, se) {
- return v.assertsModifier !== w || v.parameterName !== R || v.type !== se ? on(M(w, R, se), v) : v;
- }
- function dt(v, w) {
- const R = O(
- 183
- /* TypeReference */
- );
- return R.typeName = Kc(v), R.typeArguments = w && i().parenthesizeTypeArguments(F(w)), R.transformFlags = 1, R;
- }
- function U(v, w, R) {
- return v.typeName !== w || v.typeArguments !== R ? on(dt(w, R), v) : v;
- }
- function be(v, w, R) {
- const se = B(
- 184
- /* FunctionType */
- );
- return se.typeParameters = Oa(v), se.parameters = Oa(w), se.type = R, se.transformFlags = 1, se.modifiers = void 0, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.typeArguments = void 0, se;
- }
- function Z(v, w, R, se) {
- return v.typeParameters !== w || v.parameters !== R || v.type !== se ? ht(be(w, R, se), v) : v;
- }
- function ht(v, w) {
- return v !== w && (v.modifiers = w.modifiers), z(v, w);
- }
- function Le(...v) {
- return v.length === 4 ? Ie(...v) : v.length === 3 ? At(...v) : E.fail("Incorrect number of arguments specified.");
- }
- function Ie(v, w, R, se) {
- const Be = B(
- 185
- /* ConstructorType */
- );
- return Be.modifiers = Oa(v), Be.typeParameters = Oa(w), Be.parameters = Oa(R), Be.type = se, Be.transformFlags = 1, Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be.typeArguments = void 0, Be;
- }
- function At(v, w, R) {
- return Ie(
- /*modifiers*/
- void 0,
- v,
- w,
- R
- );
- }
- function Dr(...v) {
- return v.length === 5 ? yr(...v) : v.length === 4 ? $r(...v) : E.fail("Incorrect number of arguments specified.");
- }
- function yr(v, w, R, se, Be) {
- return v.modifiers !== w || v.typeParameters !== R || v.parameters !== se || v.type !== Be ? z(Le(w, R, se, Be), v) : v;
- }
- function $r(v, w, R, se) {
- return yr(v, v.modifiers, w, R, se);
- }
- function nt(v, w) {
- const R = O(
- 186
- /* TypeQuery */
- );
- return R.exprName = v, R.typeArguments = w && i().parenthesizeTypeArguments(w), R.transformFlags = 1, R;
- }
- function ot(v, w, R) {
- return v.exprName !== w || v.typeArguments !== R ? on(nt(w, R), v) : v;
- }
- function wt(v) {
- const w = B(
- 187
- /* TypeLiteral */
- );
- return w.members = F(v), w.transformFlags = 1, w;
- }
- function jt(v, w) {
- return v.members !== w ? on(wt(w), v) : v;
- }
- function Xt(v) {
- const w = O(
- 188
- /* ArrayType */
- );
- return w.elementType = i().parenthesizeNonArrayTypeOfPostfixType(v), w.transformFlags = 1, w;
- }
- function Ht(v, w) {
- return v.elementType !== w ? on(Xt(w), v) : v;
- }
- function en(v) {
- const w = O(
- 189
- /* TupleType */
- );
- return w.elements = F(i().parenthesizeElementTypesOfTupleType(v)), w.transformFlags = 1, w;
- }
- function zt(v, w) {
- return v.elements !== w ? on(en(w), v) : v;
- }
- function mr(v, w, R, se) {
- const Be = B(
- 202
- /* NamedTupleMember */
- );
- return Be.dotDotDotToken = v, Be.name = w, Be.questionToken = R, Be.type = se, Be.transformFlags = 1, Be.jsDoc = void 0, Be;
- }
- function Kt(v, w, R, se, Be) {
- return v.dotDotDotToken !== w || v.name !== R || v.questionToken !== se || v.type !== Be ? on(mr(w, R, se, Be), v) : v;
- }
- function hr(v) {
- const w = O(
- 190
- /* OptionalType */
- );
- return w.type = i().parenthesizeTypeOfOptionalType(v), w.transformFlags = 1, w;
- }
- function Ft(v, w) {
- return v.type !== w ? on(hr(w), v) : v;
- }
- function Ss(v) {
- const w = O(
- 191
- /* RestType */
- );
- return w.type = v, w.transformFlags = 1, w;
- }
- function gs(v, w) {
- return v.type !== w ? on(Ss(w), v) : v;
- }
- function Ts(v, w, R) {
- const se = O(v);
- return se.types = I.createNodeArray(R(w)), se.transformFlags = 1, se;
- }
- function Ua(v, w, R) {
- return v.types !== w ? on(Ts(v.kind, w, R), v) : v;
- }
- function lc(v) {
- return Ts(192, v, i().parenthesizeConstituentTypesOfUnionType);
- }
- function Ic(v, w) {
- return Ua(v, w, i().parenthesizeConstituentTypesOfUnionType);
- }
- function io(v) {
- return Ts(193, v, i().parenthesizeConstituentTypesOfIntersectionType);
- }
- function vi(v, w) {
- return Ua(v, w, i().parenthesizeConstituentTypesOfIntersectionType);
- }
- function ca(v, w, R, se) {
- const Be = O(
- 194
- /* ConditionalType */
- );
- return Be.checkType = i().parenthesizeCheckTypeOfConditionalType(v), Be.extendsType = i().parenthesizeExtendsTypeOfConditionalType(w), Be.trueType = R, Be.falseType = se, Be.transformFlags = 1, Be.locals = void 0, Be.nextContainer = void 0, Be;
- }
- function Ll(v, w, R, se, Be) {
- return v.checkType !== w || v.extendsType !== R || v.trueType !== se || v.falseType !== Be ? on(ca(w, R, se, Be), v) : v;
- }
- function xs(v) {
- const w = O(
- 195
- /* InferType */
- );
- return w.typeParameter = v, w.transformFlags = 1, w;
- }
- function Cu(v, w) {
- return v.typeParameter !== w ? on(xs(w), v) : v;
- }
- function Zc(v, w) {
- const R = O(
- 203
- /* TemplateLiteralType */
- );
- return R.head = v, R.templateSpans = F(w), R.transformFlags = 1, R;
- }
- function Yi(v, w, R) {
- return v.head !== w || v.templateSpans !== R ? on(Zc(w, R), v) : v;
- }
- function Na(v, w, R, se, Be = !1) {
- const Lt = O(
- 205
- /* ImportType */
- );
- return Lt.argument = v, Lt.attributes = w, Lt.assertions && Lt.assertions.assertClause && Lt.attributes && (Lt.assertions.assertClause = Lt.attributes), Lt.qualifier = R, Lt.typeArguments = se && i().parenthesizeTypeArguments(se), Lt.isTypeOf = Be, Lt.transformFlags = 1, Lt;
- }
- function Ia(v, w, R, se, Be, Lt = v.isTypeOf) {
- return v.argument !== w || v.attributes !== R || v.qualifier !== se || v.typeArguments !== Be || v.isTypeOf !== Lt ? on(Na(w, R, se, Be, Lt), v) : v;
- }
- function Vi(v) {
- const w = O(
- 196
- /* ParenthesizedType */
- );
- return w.type = v, w.transformFlags = 1, w;
- }
- function ba(v, w) {
- return v.type !== w ? on(Vi(w), v) : v;
- }
- function Bt() {
- const v = O(
- 197
- /* ThisType */
- );
- return v.transformFlags = 1, v;
- }
- function to(v, w) {
- const R = O(
- 198
- /* TypeOperator */
- );
- return R.operator = v, R.type = v === 148 ? i().parenthesizeOperandOfReadonlyTypeOperator(w) : i().parenthesizeOperandOfTypeOperator(w), R.transformFlags = 1, R;
- }
- function _u(v, w) {
- return v.type !== w ? on(to(v.operator, w), v) : v;
- }
- function Wc(v, w) {
- const R = O(
- 199
- /* IndexedAccessType */
- );
- return R.objectType = i().parenthesizeNonArrayTypeOfPostfixType(v), R.indexType = w, R.transformFlags = 1, R;
- }
- function of(v, w, R) {
- return v.objectType !== w || v.indexType !== R ? on(Wc(w, R), v) : v;
- }
- function Ao(v, w, R, se, Be, Lt) {
- const pn = B(
- 200
- /* MappedType */
- );
- return pn.readonlyToken = v, pn.typeParameter = w, pn.nameType = R, pn.questionToken = se, pn.type = Be, pn.members = Lt && F(Lt), pn.transformFlags = 1, pn.locals = void 0, pn.nextContainer = void 0, pn;
- }
- function ge(v, w, R, se, Be, Lt, pn) {
- return v.readonlyToken !== w || v.typeParameter !== R || v.nameType !== se || v.questionToken !== Be || v.type !== Lt || v.members !== pn ? on(Ao(w, R, se, Be, Lt, pn), v) : v;
- }
- function $(v) {
- const w = O(
- 201
- /* LiteralType */
- );
- return w.literal = v, w.transformFlags = 1, w;
- }
- function rt(v, w) {
- return v.literal !== w ? on($(w), v) : v;
- }
- function Ct(v) {
- const w = O(
- 206
- /* ObjectBindingPattern */
- );
- return w.elements = F(v), w.transformFlags |= Ca(w.elements) | 1024 | 524288, w.transformFlags & 32768 && (w.transformFlags |= 65664), w;
- }
- function $t(v, w) {
- return v.elements !== w ? on(Ct(w), v) : v;
- }
- function zr(v) {
- const w = O(
- 207
- /* ArrayBindingPattern */
- );
- return w.elements = F(v), w.transformFlags |= Ca(w.elements) | 1024 | 524288, w;
- }
- function $n(v, w) {
- return v.elements !== w ? on(zr(w), v) : v;
- }
- function ar(v, w, R, se) {
- const Be = B(
- 208
- /* BindingElement */
- );
- return Be.dotDotDotToken = v, Be.propertyName = Kc(w), Be.name = Kc(R), Be.initializer = S2(se), Be.transformFlags |= yn(Be.dotDotDotToken) | Uy(Be.propertyName) | Uy(Be.name) | yn(Be.initializer) | (Be.dotDotDotToken ? 32768 : 0) | 1024, Be.flowNode = void 0, Be;
- }
- function An(v, w, R, se, Be) {
- return v.propertyName !== R || v.dotDotDotToken !== w || v.name !== se || v.initializer !== Be ? on(ar(w, R, se, Be), v) : v;
- }
- function ri(v, w) {
- const R = O(
- 209
- /* ArrayLiteralExpression */
- ), se = v && Ro(v), Be = F(v, se && ml(se) ? !0 : void 0);
- return R.elements = i().parenthesizeExpressionsOfCommaDelimitedList(Be), R.multiLine = w, R.transformFlags |= Ca(R.elements), R;
- }
- function Fi(v, w) {
- return v.elements !== w ? on(ri(w, v.multiLine), v) : v;
- }
- function za(v, w) {
- const R = B(
- 210
- /* ObjectLiteralExpression */
- );
- return R.properties = F(v), R.multiLine = w, R.transformFlags |= Ca(R.properties), R.jsDoc = void 0, R;
- }
- function Uo(v, w) {
- return v.properties !== w ? on(za(w, v.multiLine), v) : v;
- }
- function vc(v, w, R) {
- const se = B(
- 211
- /* PropertyAccessExpression */
- );
- return se.expression = v, se.questionDotToken = w, se.name = R, se.transformFlags = yn(se.expression) | yn(se.questionDotToken) | (Oe(se.name) ? $3(se.name) : yn(se.name) | 536870912), se.jsDoc = void 0, se.flowNode = void 0, se;
- }
- function Oc(v, w) {
- const R = vc(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ),
- /*questionDotToken*/
- void 0,
- Kc(w)
- );
- return rD(v) && (R.transformFlags |= 384), R;
- }
- function Fc(v, w, R) {
- return BI(v) ? _c(v, w, v.questionDotToken, Bs(R, Oe)) : v.expression !== w || v.name !== R ? on(Oc(w, R), v) : v;
- }
- function Lo(v, w, R) {
- const se = vc(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !0
- ),
- w,
- Kc(R)
- );
- return se.flags |= 64, se.transformFlags |= 32, se;
- }
- function _c(v, w, R, se) {
- return E.assert(!!(v.flags & 64), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."), v.expression !== w || v.questionDotToken !== R || v.name !== se ? on(Lo(w, R, se), v) : v;
- }
- function Wf(v, w, R) {
- const se = B(
- 212
- /* ElementAccessExpression */
- );
- return se.expression = v, se.questionDotToken = w, se.argumentExpression = R, se.transformFlags |= yn(se.expression) | yn(se.questionDotToken) | yn(se.argumentExpression), se.jsDoc = void 0, se.flowNode = void 0, se;
- }
- function Lc(v, w) {
- const R = Wf(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ),
- /*questionDotToken*/
- void 0,
- t0(w)
- );
- return rD(v) && (R.transformFlags |= 384), R;
- }
- function al(v, w, R) {
- return mj(v) ? Pe(v, w, v.questionDotToken, R) : v.expression !== w || v.argumentExpression !== R ? on(Lc(w, R), v) : v;
- }
- function hp(v, w, R) {
- const se = Wf(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !0
- ),
- w,
- t0(R)
- );
- return se.flags |= 64, se.transformFlags |= 32, se;
- }
- function Pe(v, w, R, se) {
- return E.assert(!!(v.flags & 64), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."), v.expression !== w || v.questionDotToken !== R || v.argumentExpression !== se ? on(hp(w, R, se), v) : v;
- }
- function Et(v, w, R, se) {
- const Be = B(
- 213
- /* CallExpression */
- );
- return Be.expression = v, Be.questionDotToken = w, Be.typeArguments = R, Be.arguments = se, Be.transformFlags |= yn(Be.expression) | yn(Be.questionDotToken) | Ca(Be.typeArguments) | Ca(Be.arguments), Be.typeArguments && (Be.transformFlags |= 1), C_(Be.expression) && (Be.transformFlags |= 16384), Be;
- }
- function Lr(v, w, R) {
- const se = Et(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ),
- /*questionDotToken*/
- void 0,
- Oa(w),
- i().parenthesizeExpressionsOfCommaDelimitedList(F(R))
- );
- return nD(se.expression) && (se.transformFlags |= 8388608), se;
- }
- function $i(v, w, R, se) {
- return $2(v) ? ka(v, w, v.questionDotToken, R, se) : v.expression !== w || v.typeArguments !== R || v.arguments !== se ? on(Lr(w, R, se), v) : v;
- }
- function Sa(v, w, R, se) {
- const Be = Et(
- i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !0
- ),
- w,
- Oa(R),
- i().parenthesizeExpressionsOfCommaDelimitedList(F(se))
- );
- return Be.flags |= 64, Be.transformFlags |= 32, Be;
- }
- function ka(v, w, R, se, Be) {
- return E.assert(!!(v.flags & 64), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."), v.expression !== w || v.questionDotToken !== R || v.typeArguments !== se || v.arguments !== Be ? on(Sa(w, R, se, Be), v) : v;
- }
- function Pc(v, w, R) {
- const se = B(
- 214
- /* NewExpression */
- );
- return se.expression = i().parenthesizeExpressionOfNew(v), se.typeArguments = Oa(w), se.arguments = R ? i().parenthesizeExpressionsOfCommaDelimitedList(R) : void 0, se.transformFlags |= yn(se.expression) | Ca(se.typeArguments) | Ca(se.arguments) | 32, se.typeArguments && (se.transformFlags |= 1), se;
- }
- function yl(v, w, R, se) {
- return v.expression !== w || v.typeArguments !== R || v.arguments !== se ? on(Pc(w, R, se), v) : v;
- }
- function so(v, w, R) {
- const se = O(
- 215
- /* TaggedTemplateExpression */
- );
- return se.tag = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ), se.typeArguments = Oa(w), se.template = R, se.transformFlags |= yn(se.tag) | Ca(se.typeArguments) | yn(se.template) | 1024, se.typeArguments && (se.transformFlags |= 1), kB(se.template) && (se.transformFlags |= 128), se;
- }
- function Va(v, w, R, se) {
- return v.tag !== w || v.typeArguments !== R || v.template !== se ? on(so(w, R, se), v) : v;
- }
- function Uc(v, w) {
- const R = O(
- 216
- /* TypeAssertionExpression */
- );
- return R.expression = i().parenthesizeOperandOfPrefixUnary(w), R.type = v, R.transformFlags |= yn(R.expression) | yn(R.type) | 1, R;
- }
- function cf(v, w, R) {
- return v.type !== w || v.expression !== R ? on(Uc(w, R), v) : v;
- }
- function Xp(v) {
- const w = O(
- 217
- /* ParenthesizedExpression */
- );
- return w.expression = v, w.transformFlags = yn(w.expression), w.jsDoc = void 0, w;
- }
- function A_(v, w) {
- return v.expression !== w ? on(Xp(w), v) : v;
- }
- function Sf(v, w, R, se, Be, Lt, pn) {
- const ts = B(
- 218
- /* FunctionExpression */
- );
- ts.modifiers = Oa(v), ts.asteriskToken = w, ts.name = Kc(R), ts.typeParameters = Oa(se), ts.parameters = F(Be), ts.type = Lt, ts.body = pn;
- const ao = mm(ts.modifiers) & 1024, kp = !!ts.asteriskToken, Sg = ao && kp;
- return ts.transformFlags = Ca(ts.modifiers) | yn(ts.asteriskToken) | Uy(ts.name) | Ca(ts.typeParameters) | Ca(ts.parameters) | yn(ts.type) | yn(ts.body) & -67108865 | (Sg ? 128 : ao ? 256 : kp ? 2048 : 0) | (ts.typeParameters || ts.type ? 1 : 0) | 4194304, ts.typeArguments = void 0, ts.jsDoc = void 0, ts.locals = void 0, ts.nextContainer = void 0, ts.flowNode = void 0, ts.endFlowNode = void 0, ts.returnFlowNode = void 0, ts;
- }
- function Uf(v, w, R, se, Be, Lt, pn, ts) {
- return v.name !== se || v.modifiers !== w || v.asteriskToken !== R || v.typeParameters !== Be || v.parameters !== Lt || v.type !== pn || v.body !== ts ? z(Sf(w, R, se, Be, Lt, pn, ts), v) : v;
- }
- function yp(v, w, R, se, Be, Lt) {
- const pn = B(
- 219
- /* ArrowFunction */
- );
- pn.modifiers = Oa(v), pn.typeParameters = Oa(w), pn.parameters = F(R), pn.type = se, pn.equalsGreaterThanToken = Be ?? we(
- 39
- /* EqualsGreaterThanToken */
- ), pn.body = i().parenthesizeConciseBodyOfArrowFunction(Lt);
- const ts = mm(pn.modifiers) & 1024;
- return pn.transformFlags = Ca(pn.modifiers) | Ca(pn.typeParameters) | Ca(pn.parameters) | yn(pn.type) | yn(pn.equalsGreaterThanToken) | yn(pn.body) & -67108865 | (pn.typeParameters || pn.type ? 1 : 0) | (ts ? 16640 : 0) | 1024, pn.typeArguments = void 0, pn.jsDoc = void 0, pn.locals = void 0, pn.nextContainer = void 0, pn.flowNode = void 0, pn.endFlowNode = void 0, pn.returnFlowNode = void 0, pn;
- }
- function Yg(v, w, R, se, Be, Lt, pn) {
- return v.modifiers !== w || v.typeParameters !== R || v.parameters !== se || v.type !== Be || v.equalsGreaterThanToken !== Lt || v.body !== pn ? z(yp(w, R, se, Be, Lt, pn), v) : v;
- }
- function Qp(v) {
- const w = O(
- 220
- /* DeleteExpression */
- );
- return w.expression = i().parenthesizeOperandOfPrefixUnary(v), w.transformFlags |= yn(w.expression), w;
- }
- function y_(v, w) {
- return v.expression !== w ? on(Qp(w), v) : v;
- }
- function vl(v) {
- const w = O(
- 221
- /* TypeOfExpression */
- );
- return w.expression = i().parenthesizeOperandOfPrefixUnary(v), w.transformFlags |= yn(w.expression), w;
- }
- function Uh(v, w) {
- return v.expression !== w ? on(vl(w), v) : v;
- }
- function r_(v) {
- const w = O(
- 222
- /* VoidExpression */
- );
- return w.expression = i().parenthesizeOperandOfPrefixUnary(v), w.transformFlags |= yn(w.expression), w;
- }
- function Zg(v, w) {
- return v.expression !== w ? on(r_(w), v) : v;
- }
- function Vf(v) {
- const w = O(
- 223
- /* AwaitExpression */
- );
- return w.expression = i().parenthesizeOperandOfPrefixUnary(v), w.transformFlags |= yn(w.expression) | 256 | 128 | 2097152, w;
- }
- function Y(v, w) {
- return v.expression !== w ? on(Vf(w), v) : v;
- }
- function st(v, w) {
- const R = O(
- 224
- /* PrefixUnaryExpression */
- );
- return R.operator = v, R.operand = i().parenthesizeOperandOfPrefixUnary(w), R.transformFlags |= yn(R.operand), (v === 46 || v === 47) && Oe(R.operand) && !jo(R.operand) && !Mh(R.operand) && (R.transformFlags |= 268435456), R;
- }
- function It(v, w) {
- return v.operand !== w ? on(st(v.operator, w), v) : v;
- }
- function Mt(v, w) {
- const R = O(
- 225
- /* PostfixUnaryExpression */
- );
- return R.operator = w, R.operand = i().parenthesizeOperandOfPostfixUnary(v), R.transformFlags |= yn(R.operand), Oe(R.operand) && !jo(R.operand) && !Mh(R.operand) && (R.transformFlags |= 268435456), R;
- }
- function Sr(v, w) {
- return v.operand !== w ? on(Mt(w, v.operator), v) : v;
- }
- function Vr(v, w, R) {
- const se = B(
- 226
- /* BinaryExpression */
- ), Be = TP(w), Lt = Be.kind;
- return se.left = i().parenthesizeLeftSideOfBinary(Lt, v), se.operatorToken = Be, se.right = i().parenthesizeRightSideOfBinary(Lt, se.left, R), se.transformFlags |= yn(se.left) | yn(se.operatorToken) | yn(se.right), Lt === 61 ? se.transformFlags |= 32 : Lt === 64 ? Ks(se.left) ? se.transformFlags |= 5248 | En(se.left) : $l(se.left) && (se.transformFlags |= 5120 | En(se.left)) : Lt === 43 || Lt === 68 ? se.transformFlags |= 512 : w4(Lt) && (se.transformFlags |= 16), Lt === 103 && Di(se.left) && (se.transformFlags |= 536870912), se.jsDoc = void 0, se;
- }
- function En(v) {
- return pA(v) ? 65536 : 0;
- }
- function si(v, w, R, se) {
- return v.left !== w || v.operatorToken !== R || v.right !== se ? on(Vr(w, R, se), v) : v;
- }
- function L(v, w, R, se, Be) {
- const Lt = O(
- 227
- /* ConditionalExpression */
- );
- return Lt.condition = i().parenthesizeConditionOfConditionalExpression(v), Lt.questionToken = w ?? we(
- 58
- /* QuestionToken */
- ), Lt.whenTrue = i().parenthesizeBranchOfConditionalExpression(R), Lt.colonToken = se ?? we(
- 59
- /* ColonToken */
- ), Lt.whenFalse = i().parenthesizeBranchOfConditionalExpression(Be), Lt.transformFlags |= yn(Lt.condition) | yn(Lt.questionToken) | yn(Lt.whenTrue) | yn(Lt.colonToken) | yn(Lt.whenFalse), Lt;
- }
- function Ce(v, w, R, se, Be, Lt) {
- return v.condition !== w || v.questionToken !== R || v.whenTrue !== se || v.colonToken !== Be || v.whenFalse !== Lt ? on(L(w, R, se, Be, Lt), v) : v;
- }
- function yt(v, w) {
- const R = O(
- 228
- /* TemplateExpression */
- );
- return R.head = v, R.templateSpans = F(w), R.transformFlags |= yn(R.head) | Ca(R.templateSpans) | 1024, R;
- }
- function Mr(v, w, R) {
- return v.head !== w || v.templateSpans !== R ? on(yt(w, R), v) : v;
- }
- function hi(v, w, R, se = 0) {
- E.assert(!(se & -7177), "Unsupported template flags.");
- let Be;
- if (R !== void 0 && R !== w && (Be = bFe(v, R), typeof Be == "object"))
- return E.fail("Invalid raw text");
- if (w === void 0) {
- if (Be === void 0)
- return E.fail("Arguments 'text' and 'rawText' may not both be undefined.");
- w = Be;
- } else Be !== void 0 && E.assert(w === Be, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");
- return w;
- }
- function Es(v) {
- let w = 1024;
- return v && (w |= 128), w;
- }
- function ns(v, w, R, se) {
- const Be = Te(v);
- return Be.text = w, Be.rawText = R, Be.templateFlags = se & 7176, Be.transformFlags = Es(Be.templateFlags), Be;
- }
- function Ds(v, w, R, se) {
- const Be = B(v);
- return Be.text = w, Be.rawText = R, Be.templateFlags = se & 7176, Be.transformFlags = Es(Be.templateFlags), Be;
- }
- function Pa(v, w, R, se) {
- return v === 15 ? Ds(v, w, R, se) : ns(v, w, R, se);
- }
- function ga(v, w, R) {
- return v = hi(16, v, w, R), Pa(16, v, w, R);
- }
- function $o(v, w, R) {
- return v = hi(16, v, w, R), Pa(17, v, w, R);
- }
- function vp(v, w, R) {
- return v = hi(16, v, w, R), Pa(18, v, w, R);
- }
- function dd(v, w, R) {
- return v = hi(16, v, w, R), Ds(15, v, w, R);
- }
- function jd(v, w) {
- E.assert(!v || !!w, "A `YieldExpression` with an asteriskToken must have an expression.");
- const R = O(
- 229
- /* YieldExpression */
- );
- return R.expression = w && i().parenthesizeExpressionForDisallowedComma(w), R.asteriskToken = v, R.transformFlags |= yn(R.expression) | yn(R.asteriskToken) | 1024 | 128 | 1048576, R;
- }
- function Kg(v, w, R) {
- return v.expression !== R || v.asteriskToken !== w ? on(jd(w, R), v) : v;
- }
- function J0(v) {
- const w = O(
- 230
- /* SpreadElement */
- );
- return w.expression = i().parenthesizeExpressionForDisallowedComma(v), w.transformFlags |= yn(w.expression) | 1024 | 32768, w;
- }
- function eh(v, w) {
- return v.expression !== w ? on(J0(w), v) : v;
- }
- function bp(v, w, R, se, Be) {
- const Lt = B(
- 231
- /* ClassExpression */
- );
- return Lt.modifiers = Oa(v), Lt.name = Kc(w), Lt.typeParameters = Oa(R), Lt.heritageClauses = Oa(se), Lt.members = F(Be), Lt.transformFlags |= Ca(Lt.modifiers) | Uy(Lt.name) | Ca(Lt.typeParameters) | Ca(Lt.heritageClauses) | Ca(Lt.members) | (Lt.typeParameters ? 1 : 0) | 1024, Lt.jsDoc = void 0, Lt;
- }
- function Sp(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.name !== R || v.typeParameters !== se || v.heritageClauses !== Be || v.members !== Lt ? on(bp(w, R, se, Be, Lt), v) : v;
- }
- function Mo() {
- return O(
- 232
- /* OmittedExpression */
- );
- }
- function Tf(v, w) {
- const R = O(
- 233
- /* ExpressionWithTypeArguments */
- );
- return R.expression = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ), R.typeArguments = w && i().parenthesizeTypeArguments(w), R.transformFlags |= yn(R.expression) | Ca(R.typeArguments) | 1024, R;
- }
- function N_(v, w, R) {
- return v.expression !== w || v.typeArguments !== R ? on(Tf(w, R), v) : v;
- }
- function Bd(v, w) {
- const R = O(
- 234
- /* AsExpression */
- );
- return R.expression = v, R.type = w, R.transformFlags |= yn(R.expression) | yn(R.type) | 1, R;
- }
- function th(v, w, R) {
- return v.expression !== w || v.type !== R ? on(Bd(w, R), v) : v;
- }
- function Yp(v) {
- const w = O(
- 235
- /* NonNullExpression */
- );
- return w.expression = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- ), w.transformFlags |= yn(w.expression) | 1, w;
- }
- function dg(v, w) {
- return zI(v) ? Nv(v, w) : v.expression !== w ? on(Yp(w), v) : v;
- }
- function Vh(v, w) {
- const R = O(
- 238
- /* SatisfiesExpression */
- );
- return R.expression = v, R.type = w, R.transformFlags |= yn(R.expression) | yn(R.type) | 1, R;
- }
- function z0(v, w, R) {
- return v.expression !== w || v.type !== R ? on(Vh(w, R), v) : v;
- }
- function Zp(v) {
- const w = O(
- 235
- /* NonNullExpression */
- );
- return w.flags |= 64, w.expression = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !0
- ), w.transformFlags |= yn(w.expression) | 1, w;
- }
- function Nv(v, w) {
- return E.assert(!!(v.flags & 64), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."), v.expression !== w ? on(Zp(w), v) : v;
- }
- function qf(v, w) {
- const R = O(
- 236
- /* MetaProperty */
- );
- switch (R.keywordToken = v, R.name = w, R.transformFlags |= yn(R.name), v) {
- case 105:
- R.transformFlags |= 1024;
- break;
- case 102:
- R.transformFlags |= 32;
- break;
- default:
- return E.assertNever(v);
- }
- return R.flowNode = void 0, R;
- }
- function Kp(v, w) {
- return v.name !== w ? on(qf(v.keywordToken, w), v) : v;
- }
- function qh(v, w) {
- const R = O(
- 239
- /* TemplateSpan */
- );
- return R.expression = v, R.literal = w, R.transformFlags |= yn(R.expression) | yn(R.literal) | 1024, R;
- }
- function Iv(v, w, R) {
- return v.expression !== w || v.literal !== R ? on(qh(w, R), v) : v;
- }
- function mg() {
- const v = O(
- 240
- /* SemicolonClassElement */
- );
- return v.transformFlags |= 1024, v;
- }
- function rh(v, w) {
- const R = O(
- 241
- /* Block */
- );
- return R.statements = F(v), R.multiLine = w, R.transformFlags |= Ca(R.statements), R.jsDoc = void 0, R.locals = void 0, R.nextContainer = void 0, R;
- }
- function Ov(v, w) {
- return v.statements !== w ? on(rh(w, v.multiLine), v) : v;
- }
- function n1(v, w) {
- const R = O(
- 243
- /* VariableStatement */
- );
- return R.modifiers = Oa(v), R.declarationList = us(w) ? ih(w) : w, R.transformFlags |= Ca(R.modifiers) | yn(R.declarationList), mm(R.modifiers) & 128 && (R.transformFlags = 1), R.jsDoc = void 0, R.flowNode = void 0, R;
- }
- function Ne(v, w, R) {
- return v.modifiers !== w || v.declarationList !== R ? on(n1(w, R), v) : v;
- }
- function qe() {
- const v = O(
- 242
- /* EmptyStatement */
- );
- return v.jsDoc = void 0, v;
- }
- function vt(v) {
- const w = O(
- 244
- /* ExpressionStatement */
- );
- return w.expression = i().parenthesizeExpressionOfExpressionStatement(v), w.transformFlags |= yn(w.expression), w.jsDoc = void 0, w.flowNode = void 0, w;
- }
- function qt(v, w) {
- return v.expression !== w ? on(vt(w), v) : v;
- }
- function fr(v, w, R) {
- const se = O(
- 245
- /* IfStatement */
- );
- return se.expression = v, se.thenStatement = Ef(w), se.elseStatement = Ef(R), se.transformFlags |= yn(se.expression) | yn(se.thenStatement) | yn(se.elseStatement), se.jsDoc = void 0, se.flowNode = void 0, se;
- }
- function qr(v, w, R, se) {
- return v.expression !== w || v.thenStatement !== R || v.elseStatement !== se ? on(fr(w, R, se), v) : v;
- }
- function kr(v, w) {
- const R = O(
- 246
- /* DoStatement */
- );
- return R.statement = Ef(v), R.expression = w, R.transformFlags |= yn(R.statement) | yn(R.expression), R.jsDoc = void 0, R.flowNode = void 0, R;
- }
- function Dn(v, w, R) {
- return v.statement !== w || v.expression !== R ? on(kr(w, R), v) : v;
- }
- function di(v, w) {
- const R = O(
- 247
- /* WhileStatement */
- );
- return R.expression = v, R.statement = Ef(w), R.transformFlags |= yn(R.expression) | yn(R.statement), R.jsDoc = void 0, R.flowNode = void 0, R;
- }
- function _n(v, w, R) {
- return v.expression !== w || v.statement !== R ? on(di(w, R), v) : v;
- }
- function yi(v, w, R, se) {
- const Be = O(
- 248
- /* ForStatement */
- );
- return Be.initializer = v, Be.condition = w, Be.incrementor = R, Be.statement = Ef(se), Be.transformFlags |= yn(Be.initializer) | yn(Be.condition) | yn(Be.incrementor) | yn(Be.statement), Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be.flowNode = void 0, Be;
- }
- function fn(v, w, R, se, Be) {
- return v.initializer !== w || v.condition !== R || v.incrementor !== se || v.statement !== Be ? on(yi(w, R, se, Be), v) : v;
- }
- function ks(v, w, R) {
- const se = O(
- 249
- /* ForInStatement */
- );
- return se.initializer = v, se.expression = w, se.statement = Ef(R), se.transformFlags |= yn(se.initializer) | yn(se.expression) | yn(se.statement), se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se.flowNode = void 0, se;
- }
- function po(v, w, R, se) {
- return v.initializer !== w || v.expression !== R || v.statement !== se ? on(ks(w, R, se), v) : v;
- }
- function Bu(v, w, R, se) {
- const Be = O(
- 250
- /* ForOfStatement */
- );
- return Be.awaitModifier = v, Be.initializer = w, Be.expression = i().parenthesizeExpressionForDisallowedComma(R), Be.statement = Ef(se), Be.transformFlags |= yn(Be.awaitModifier) | yn(Be.initializer) | yn(Be.expression) | yn(Be.statement) | 1024, v && (Be.transformFlags |= 128), Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be.flowNode = void 0, Be;
- }
- function ed(v, w, R, se, Be) {
- return v.awaitModifier !== w || v.initializer !== R || v.expression !== se || v.statement !== Be ? on(Bu(w, R, se, Be), v) : v;
- }
- function Ju(v) {
- const w = O(
- 251
- /* ContinueStatement */
- );
- return w.label = Kc(v), w.transformFlags |= yn(w.label) | 4194304, w.jsDoc = void 0, w.flowNode = void 0, w;
- }
- function td(v, w) {
- return v.label !== w ? on(Ju(w), v) : v;
- }
- function zu(v) {
- const w = O(
- 252
- /* BreakStatement */
- );
- return w.label = Kc(v), w.transformFlags |= yn(w.label) | 4194304, w.jsDoc = void 0, w.flowNode = void 0, w;
- }
- function o2(v, w) {
- return v.label !== w ? on(zu(w), v) : v;
- }
- function i1(v) {
- const w = O(
- 253
- /* ReturnStatement */
- );
- return w.expression = v, w.transformFlags |= yn(w.expression) | 128 | 4194304, w.jsDoc = void 0, w.flowNode = void 0, w;
- }
- function nh(v, w) {
- return v.expression !== w ? on(i1(w), v) : v;
- }
- function Hh(v, w) {
- const R = O(
- 254
- /* WithStatement */
- );
- return R.expression = v, R.statement = Ef(w), R.transformFlags |= yn(R.expression) | yn(R.statement), R.jsDoc = void 0, R.flowNode = void 0, R;
- }
- function W0(v, w, R) {
- return v.expression !== w || v.statement !== R ? on(Hh(w, R), v) : v;
- }
- function md(v, w) {
- const R = O(
- 255
- /* SwitchStatement */
- );
- return R.expression = i().parenthesizeExpressionForDisallowedComma(v), R.caseBlock = w, R.transformFlags |= yn(R.expression) | yn(R.caseBlock), R.jsDoc = void 0, R.flowNode = void 0, R.possiblyExhaustive = !1, R;
- }
- function U0(v, w, R) {
- return v.expression !== w || v.caseBlock !== R ? on(md(w, R), v) : v;
- }
- function s1(v, w) {
- const R = O(
- 256
- /* LabeledStatement */
- );
- return R.label = Kc(v), R.statement = Ef(w), R.transformFlags |= yn(R.label) | yn(R.statement), R.jsDoc = void 0, R.flowNode = void 0, R;
- }
- function a1(v, w, R) {
- return v.label !== w || v.statement !== R ? on(s1(w, R), v) : v;
- }
- function o1(v) {
- const w = O(
- 257
- /* ThrowStatement */
- );
- return w.expression = v, w.transformFlags |= yn(w.expression), w.jsDoc = void 0, w.flowNode = void 0, w;
- }
- function jS(v, w) {
- return v.expression !== w ? on(o1(w), v) : v;
- }
- function Fv(v, w, R) {
- const se = O(
- 258
- /* TryStatement */
- );
- return se.tryBlock = v, se.catchClause = w, se.finallyBlock = R, se.transformFlags |= yn(se.tryBlock) | yn(se.catchClause) | yn(se.finallyBlock), se.jsDoc = void 0, se.flowNode = void 0, se;
- }
- function Da(v, w, R, se) {
- return v.tryBlock !== w || v.catchClause !== R || v.finallyBlock !== se ? on(Fv(w, R, se), v) : v;
- }
- function c2() {
- const v = O(
- 259
- /* DebuggerStatement */
- );
- return v.jsDoc = void 0, v.flowNode = void 0, v;
- }
- function BS(v, w, R, se) {
- const Be = B(
- 260
- /* VariableDeclaration */
- );
- return Be.name = Kc(v), Be.exclamationToken = w, Be.type = R, Be.initializer = S2(se), Be.transformFlags |= Uy(Be.name) | yn(Be.initializer) | (Be.exclamationToken ?? Be.type ? 1 : 0), Be.jsDoc = void 0, Be;
- }
- function Lv(v, w, R, se, Be) {
- return v.name !== w || v.type !== se || v.exclamationToken !== R || v.initializer !== Be ? on(BS(w, R, se, Be), v) : v;
- }
- function ih(v, w = 0) {
- const R = O(
- 261
- /* VariableDeclarationList */
- );
- return R.flags |= w & 7, R.declarations = F(v), R.transformFlags |= Ca(R.declarations) | 4194304, w & 7 && (R.transformFlags |= 263168), w & 4 && (R.transformFlags |= 4), R;
- }
- function sh(v, w) {
- return v.declarations !== w ? on(ih(w, v.flags), v) : v;
- }
- function Hf(v, w, R, se, Be, Lt, pn) {
- const ts = B(
- 262
- /* FunctionDeclaration */
- );
- if (ts.modifiers = Oa(v), ts.asteriskToken = w, ts.name = Kc(R), ts.typeParameters = Oa(se), ts.parameters = F(Be), ts.type = Lt, ts.body = pn, !ts.body || mm(ts.modifiers) & 128)
- ts.transformFlags = 1;
- else {
- const ao = mm(ts.modifiers) & 1024, kp = !!ts.asteriskToken, Sg = ao && kp;
- ts.transformFlags = Ca(ts.modifiers) | yn(ts.asteriskToken) | Uy(ts.name) | Ca(ts.typeParameters) | Ca(ts.parameters) | yn(ts.type) | yn(ts.body) & -67108865 | (Sg ? 128 : ao ? 256 : kp ? 2048 : 0) | (ts.typeParameters || ts.type ? 1 : 0) | 4194304;
- }
- return ts.typeArguments = void 0, ts.jsDoc = void 0, ts.locals = void 0, ts.nextContainer = void 0, ts.endFlowNode = void 0, ts.returnFlowNode = void 0, ts;
- }
- function lf(v, w, R, se, Be, Lt, pn, ts) {
- return v.modifiers !== w || v.asteriskToken !== R || v.name !== se || v.typeParameters !== Be || v.parameters !== Lt || v.type !== pn || v.body !== ts ? uf(Hf(w, R, se, Be, Lt, pn, ts), v) : v;
- }
- function uf(v, w) {
- return v !== w && v.modifiers === w.modifiers && (v.modifiers = w.modifiers), z(v, w);
- }
- function I_(v, w, R, se, Be) {
- const Lt = B(
- 263
- /* ClassDeclaration */
- );
- return Lt.modifiers = Oa(v), Lt.name = Kc(w), Lt.typeParameters = Oa(R), Lt.heritageClauses = Oa(se), Lt.members = F(Be), mm(Lt.modifiers) & 128 ? Lt.transformFlags = 1 : (Lt.transformFlags |= Ca(Lt.modifiers) | Uy(Lt.name) | Ca(Lt.typeParameters) | Ca(Lt.heritageClauses) | Ca(Lt.members) | (Lt.typeParameters ? 1 : 0) | 1024, Lt.transformFlags & 8192 && (Lt.transformFlags |= 1)), Lt.jsDoc = void 0, Lt;
- }
- function c1(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.name !== R || v.typeParameters !== se || v.heritageClauses !== Be || v.members !== Lt ? on(I_(w, R, se, Be, Lt), v) : v;
- }
- function V6(v, w, R, se, Be) {
- const Lt = B(
- 264
- /* InterfaceDeclaration */
- );
- return Lt.modifiers = Oa(v), Lt.name = Kc(w), Lt.typeParameters = Oa(R), Lt.heritageClauses = Oa(se), Lt.members = F(Be), Lt.transformFlags = 1, Lt.jsDoc = void 0, Lt;
- }
- function xl(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.name !== R || v.typeParameters !== se || v.heritageClauses !== Be || v.members !== Lt ? on(V6(w, R, se, Be, Lt), v) : v;
- }
- function Jd(v, w, R, se) {
- const Be = B(
- 265
- /* TypeAliasDeclaration */
- );
- return Be.modifiers = Oa(v), Be.name = Kc(w), Be.typeParameters = Oa(R), Be.type = se, Be.transformFlags = 1, Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be;
- }
- function V0(v, w, R, se, Be) {
- return v.modifiers !== w || v.name !== R || v.typeParameters !== se || v.type !== Be ? on(Jd(w, R, se, Be), v) : v;
- }
- function gg(v, w, R) {
- const se = B(
- 266
- /* EnumDeclaration */
- );
- return se.modifiers = Oa(v), se.name = Kc(w), se.members = F(R), se.transformFlags |= Ca(se.modifiers) | yn(se.name) | Ca(se.members) | 1, se.transformFlags &= -67108865, se.jsDoc = void 0, se;
- }
- function fk(v, w, R, se) {
- return v.modifiers !== w || v.name !== R || v.members !== se ? on(gg(w, R, se), v) : v;
- }
- function fu(v, w, R, se = 0) {
- const Be = B(
- 267
- /* ModuleDeclaration */
- );
- return Be.modifiers = Oa(v), Be.flags |= se & 2088, Be.name = w, Be.body = R, mm(Be.modifiers) & 128 ? Be.transformFlags = 1 : Be.transformFlags |= Ca(Be.modifiers) | yn(Be.name) | yn(Be.body) | 1, Be.transformFlags &= -67108865, Be.jsDoc = void 0, Be.locals = void 0, Be.nextContainer = void 0, Be;
- }
- function Gh(v, w, R, se) {
- return v.modifiers !== w || v.name !== R || v.body !== se ? on(fu(w, R, se, v.flags), v) : v;
- }
- function O_(v) {
- const w = O(
- 268
- /* ModuleBlock */
- );
- return w.statements = F(v), w.transformFlags |= Ca(w.statements), w.jsDoc = void 0, w;
- }
- function Mv(v, w) {
- return v.statements !== w ? on(O_(w), v) : v;
- }
- function Nm(v) {
- const w = O(
- 269
- /* CaseBlock */
- );
- return w.clauses = F(v), w.transformFlags |= Ca(w.clauses), w.locals = void 0, w.nextContainer = void 0, w;
- }
- function je(v, w) {
- return v.clauses !== w ? on(Nm(w), v) : v;
- }
- function zd(v) {
- const w = B(
- 270
- /* NamespaceExportDeclaration */
- );
- return w.name = Kc(v), w.transformFlags |= $3(w.name) | 1, w.modifiers = void 0, w.jsDoc = void 0, w;
- }
- function Im(v, w) {
- return v.name !== w ? Rv(zd(w), v) : v;
- }
- function Rv(v, w) {
- return v !== w && (v.modifiers = w.modifiers), on(v, w);
- }
- function pk(v, w, R, se) {
- const Be = B(
- 271
- /* ImportEqualsDeclaration */
- );
- return Be.modifiers = Oa(v), Be.name = Kc(R), Be.isTypeOnly = w, Be.moduleReference = se, Be.transformFlags |= Ca(Be.modifiers) | $3(Be.name) | yn(Be.moduleReference), Fh(Be.moduleReference) || (Be.transformFlags |= 1), Be.transformFlags &= -67108865, Be.jsDoc = void 0, Be;
- }
- function $h(v, w, R, se, Be) {
- return v.modifiers !== w || v.isTypeOnly !== R || v.name !== se || v.moduleReference !== Be ? on(pk(w, R, se, Be), v) : v;
- }
- function q0(v, w, R, se) {
- const Be = O(
- 272
- /* ImportDeclaration */
- );
- return Be.modifiers = Oa(v), Be.importClause = w, Be.moduleSpecifier = R, Be.attributes = Be.assertClause = se, Be.transformFlags |= yn(Be.importClause) | yn(Be.moduleSpecifier), Be.transformFlags &= -67108865, Be.jsDoc = void 0, Be;
- }
- function Xh(v, w, R, se, Be) {
- return v.modifiers !== w || v.importClause !== R || v.moduleSpecifier !== se || v.attributes !== Be ? on(q0(w, R, se, Be), v) : v;
- }
- function dk(v, w, R) {
- const se = B(
- 273
- /* ImportClause */
- );
- return se.isTypeOnly = v, se.name = w, se.namedBindings = R, se.transformFlags |= yn(se.name) | yn(se.namedBindings), v && (se.transformFlags |= 1), se.transformFlags &= -67108865, se;
- }
- function fa(v, w, R, se) {
- return v.isTypeOnly !== w || v.name !== R || v.namedBindings !== se ? on(dk(w, R, se), v) : v;
- }
- function gd(v, w) {
- const R = O(
- 300
- /* AssertClause */
- );
- return R.elements = F(v), R.multiLine = w, R.token = 132, R.transformFlags |= 4, R;
- }
- function H0(v, w, R) {
- return v.elements !== w || v.multiLine !== R ? on(gd(w, R), v) : v;
- }
- function jv(v, w) {
- const R = O(
- 301
- /* AssertEntry */
- );
- return R.name = v, R.value = w, R.transformFlags |= 4, R;
- }
- function xf(v, w, R) {
- return v.name !== w || v.value !== R ? on(jv(w, R), v) : v;
- }
- function ah(v, w) {
- const R = O(
- 302
- /* ImportTypeAssertionContainer */
- );
- return R.assertClause = v, R.multiLine = w, R;
- }
- function Wd(v, w, R) {
- return v.assertClause !== w || v.multiLine !== R ? on(ah(w, R), v) : v;
- }
- function hg(v, w, R) {
- const se = O(
- 300
- /* ImportAttributes */
- );
- return se.token = R ?? 118, se.elements = F(v), se.multiLine = w, se.transformFlags |= 4, se;
- }
- function mk(v, w, R) {
- return v.elements !== w || v.multiLine !== R ? on(hg(w, R, v.token), v) : v;
- }
- function l1(v, w) {
- const R = O(
- 301
- /* ImportAttribute */
- );
- return R.name = v, R.value = w, R.transformFlags |= 4, R;
- }
- function rd(v, w, R) {
- return v.name !== w || v.value !== R ? on(l1(w, R), v) : v;
- }
- function gk(v) {
- const w = B(
- 274
- /* NamespaceImport */
- );
- return w.name = v, w.transformFlags |= yn(w.name), w.transformFlags &= -67108865, w;
- }
- function G0(v, w) {
- return v.name !== w ? on(gk(w), v) : v;
- }
- function Bi(v) {
- const w = B(
- 280
- /* NamespaceExport */
- );
- return w.name = v, w.transformFlags |= yn(w.name) | 32, w.transformFlags &= -67108865, w;
- }
- function bn(v, w) {
- return v.name !== w ? on(Bi(w), v) : v;
- }
- function Al(v) {
- const w = O(
- 275
- /* NamedImports */
- );
- return w.elements = F(v), w.transformFlags |= Ca(w.elements), w.transformFlags &= -67108865, w;
- }
- function Qh(v, w) {
- return v.elements !== w ? on(Al(w), v) : v;
- }
- function $0(v, w, R) {
- const se = B(
- 276
- /* ImportSpecifier */
- );
- return se.isTypeOnly = v, se.propertyName = w, se.name = R, se.transformFlags |= yn(se.propertyName) | yn(se.name), se.transformFlags &= -67108865, se;
- }
- function JS(v, w, R, se) {
- return v.isTypeOnly !== w || v.propertyName !== R || v.name !== se ? on($0(w, R, se), v) : v;
- }
- function u1(v, w, R) {
- const se = B(
- 277
- /* ExportAssignment */
- );
- return se.modifiers = Oa(v), se.isExportEquals = w, se.expression = w ? i().parenthesizeRightSideOfBinary(
- 64,
- /*leftSide*/
- void 0,
- R
- ) : i().parenthesizeExpressionOfExportDefault(R), se.transformFlags |= Ca(se.modifiers) | yn(se.expression), se.transformFlags &= -67108865, se.jsDoc = void 0, se;
- }
- function zS(v, w, R) {
- return v.modifiers !== w || v.expression !== R ? on(u1(w, v.isExportEquals, R), v) : v;
- }
- function Do(v, w, R, se, Be) {
- const Lt = B(
- 278
- /* ExportDeclaration */
- );
- return Lt.modifiers = Oa(v), Lt.isTypeOnly = w, Lt.exportClause = R, Lt.moduleSpecifier = se, Lt.attributes = Lt.assertClause = Be, Lt.transformFlags |= Ca(Lt.modifiers) | yn(Lt.exportClause) | yn(Lt.moduleSpecifier), Lt.transformFlags &= -67108865, Lt.jsDoc = void 0, Lt;
- }
- function Yh(v, w, R, se, Be, Lt) {
- return v.modifiers !== w || v.isTypeOnly !== R || v.exportClause !== se || v.moduleSpecifier !== Be || v.attributes !== Lt ? l2(Do(w, R, se, Be, Lt), v) : v;
- }
- function l2(v, w) {
- return v !== w && v.modifiers === w.modifiers && (v.modifiers = w.modifiers), on(v, w);
- }
- function Tp(v) {
- const w = O(
- 279
- /* NamedExports */
- );
- return w.elements = F(v), w.transformFlags |= Ca(w.elements), w.transformFlags &= -67108865, w;
- }
- function u2(v, w) {
- return v.elements !== w ? on(Tp(w), v) : v;
- }
- function WS(v, w, R) {
- const se = O(
- 281
- /* ExportSpecifier */
- );
- return se.isTypeOnly = v, se.propertyName = Kc(w), se.name = Kc(R), se.transformFlags |= yn(se.propertyName) | yn(se.name), se.transformFlags &= -67108865, se.jsDoc = void 0, se;
- }
- function q6(v, w, R, se) {
- return v.isTypeOnly !== w || v.propertyName !== R || v.name !== se ? on(WS(w, R, se), v) : v;
- }
- function H6() {
- const v = B(
- 282
- /* MissingDeclaration */
- );
- return v.jsDoc = void 0, v;
- }
- function Sn(v) {
- const w = O(
- 283
- /* ExternalModuleReference */
- );
- return w.expression = v, w.transformFlags |= yn(w.expression), w.transformFlags &= -67108865, w;
- }
- function pu(v, w) {
- return v.expression !== w ? on(Sn(w), v) : v;
- }
- function hs(v) {
- return O(v);
- }
- function X0(v, w, R = !1) {
- const se = hk(
- v,
- R ? w && i().parenthesizeNonArrayTypeOfPostfixType(w) : w
- );
- return se.postfix = R, se;
- }
- function hk(v, w) {
- const R = O(v);
- return R.type = w, R;
- }
- function Bv(v, w, R) {
- return w.type !== R ? on(X0(v, R, w.postfix), w) : w;
- }
- function ln(v, w, R) {
- return w.type !== R ? on(hk(v, R), w) : w;
- }
- function G6(v, w) {
- const R = B(
- 317
- /* JSDocFunctionType */
- );
- return R.parameters = Oa(v), R.type = w, R.transformFlags = Ca(R.parameters) | (R.type ? 1 : 0), R.jsDoc = void 0, R.locals = void 0, R.nextContainer = void 0, R.typeArguments = void 0, R;
- }
- function US(v, w, R) {
- return v.parameters !== w || v.type !== R ? on(G6(w, R), v) : v;
- }
- function Eu(v, w = !1) {
- const R = B(
- 322
- /* JSDocTypeLiteral */
- );
- return R.jsDocPropertyTags = Oa(v), R.isArrayType = w, R;
- }
- function Du(v, w, R) {
- return v.jsDocPropertyTags !== w || v.isArrayType !== R ? on(Eu(w, R), v) : v;
- }
- function kf(v) {
- const w = O(
- 309
- /* JSDocTypeExpression */
- );
- return w.type = v, w;
- }
- function Jv(v, w) {
- return v.type !== w ? on(kf(w), v) : v;
- }
- function VS(v, w, R) {
- const se = B(
- 323
- /* JSDocSignature */
- );
- return se.typeParameters = Oa(v), se.parameters = F(w), se.type = R, se.jsDoc = void 0, se.locals = void 0, se.nextContainer = void 0, se;
- }
- function oh(v, w, R, se) {
- return v.typeParameters !== w || v.parameters !== R || v.type !== se ? on(VS(w, R, se), v) : v;
- }
- function F_(v) {
- const w = TJ(v.kind);
- return v.tagName.escapedText === tc(w) ? v.tagName : ie(w);
- }
- function Om(v, w, R) {
- const se = O(v);
- return se.tagName = w, se.comment = R, se;
- }
- function Gf(v, w, R) {
- const se = B(v);
- return se.tagName = w, se.comment = R, se;
- }
- function Q0(v, w, R, se) {
- const Be = Om(345, v ?? ie("template"), se);
- return Be.constraint = w, Be.typeParameters = F(R), Be;
- }
- function Y0(v, w = F_(v), R, se, Be) {
- return v.tagName !== w || v.constraint !== R || v.typeParameters !== se || v.comment !== Be ? on(Q0(w, R, se, Be), v) : v;
- }
- function _2(v, w, R, se) {
- const Be = Gf(346, v ?? ie("typedef"), se);
- return Be.typeExpression = w, Be.fullName = R, Be.name = rz(R), Be.locals = void 0, Be.nextContainer = void 0, Be;
- }
- function qS(v, w = F_(v), R, se, Be) {
- return v.tagName !== w || v.typeExpression !== R || v.fullName !== se || v.comment !== Be ? on(_2(w, R, se, Be), v) : v;
- }
- function _1(v, w, R, se, Be, Lt) {
- const pn = Gf(341, v ?? ie("param"), Lt);
- return pn.typeExpression = se, pn.name = w, pn.isNameFirst = !!Be, pn.isBracketed = R, pn;
- }
- function HS(v, w = F_(v), R, se, Be, Lt, pn) {
- return v.tagName !== w || v.name !== R || v.isBracketed !== se || v.typeExpression !== Be || v.isNameFirst !== Lt || v.comment !== pn ? on(_1(w, R, se, Be, Lt, pn), v) : v;
- }
- function GS(v, w, R, se, Be, Lt) {
- const pn = Gf(348, v ?? ie("prop"), Lt);
- return pn.typeExpression = se, pn.name = w, pn.isNameFirst = !!Be, pn.isBracketed = R, pn;
- }
- function $S(v, w = F_(v), R, se, Be, Lt, pn) {
- return v.tagName !== w || v.name !== R || v.isBracketed !== se || v.typeExpression !== Be || v.isNameFirst !== Lt || v.comment !== pn ? on(GS(w, R, se, Be, Lt, pn), v) : v;
- }
- function Ud(v, w, R, se) {
- const Be = Gf(338, v ?? ie("callback"), se);
- return Be.typeExpression = w, Be.fullName = R, Be.name = rz(R), Be.locals = void 0, Be.nextContainer = void 0, Be;
- }
- function $6(v, w = F_(v), R, se, Be) {
- return v.tagName !== w || v.typeExpression !== R || v.fullName !== se || v.comment !== Be ? on(Ud(w, R, se, Be), v) : v;
- }
- function zv(v, w, R) {
- const se = Om(339, v ?? ie("overload"), R);
- return se.typeExpression = w, se;
- }
- function f1(v, w = F_(v), R, se) {
- return v.tagName !== w || v.typeExpression !== R || v.comment !== se ? on(zv(w, R, se), v) : v;
- }
- function ch(v, w, R) {
- const se = Om(328, v ?? ie("augments"), R);
- return se.class = w, se;
- }
- function Zh(v, w = F_(v), R, se) {
- return v.tagName !== w || v.class !== R || v.comment !== se ? on(ch(w, R, se), v) : v;
- }
- function hd(v, w, R) {
- const se = Om(329, v ?? ie("implements"), R);
- return se.class = w, se;
- }
- function Z0(v, w, R) {
- const se = Om(347, v ?? ie("see"), R);
- return se.name = w, se;
- }
- function XS(v, w, R, se) {
- return v.tagName !== w || v.name !== R || v.comment !== se ? on(Z0(w, R, se), v) : v;
- }
- function kl(v) {
- const w = O(
- 310
- /* JSDocNameReference */
- );
- return w.name = v, w;
- }
- function QS(v, w) {
- return v.name !== w ? on(kl(w), v) : v;
- }
- function yg(v, w) {
- const R = O(
- 311
- /* JSDocMemberName */
- );
- return R.left = v, R.right = w, R.transformFlags |= yn(R.left) | yn(R.right), R;
- }
- function YS(v, w, R) {
- return v.left !== w || v.right !== R ? on(yg(w, R), v) : v;
- }
- function Wv(v, w) {
- const R = O(
- 324
- /* JSDocLink */
- );
- return R.name = v, R.text = w, R;
- }
- function Kh(v, w, R) {
- return v.name !== w ? on(Wv(w, R), v) : v;
- }
- function p1(v, w) {
- const R = O(
- 325
- /* JSDocLinkCode */
- );
- return R.name = v, R.text = w, R;
- }
- function f2(v, w, R) {
- return v.name !== w ? on(p1(w, R), v) : v;
- }
- function Mc(v, w) {
- const R = O(
- 326
- /* JSDocLinkPlain */
- );
- return R.name = v, R.text = w, R;
- }
- function Zl(v, w, R) {
- return v.name !== w ? on(Mc(w, R), v) : v;
- }
- function X6(v, w = F_(v), R, se) {
- return v.tagName !== w || v.class !== R || v.comment !== se ? on(hd(w, R, se), v) : v;
- }
- function Pu(v, w, R) {
- return Om(v, w ?? ie(TJ(v)), R);
- }
- function L_(v, w, R = F_(w), se) {
- return w.tagName !== R || w.comment !== se ? on(Pu(v, R, se), w) : w;
- }
- function yk(v, w, R, se) {
- const Be = Om(v, w ?? ie(TJ(v)), se);
- return Be.typeExpression = R, Be;
- }
- function Fm(v, w, R = F_(w), se, Be) {
- return w.tagName !== R || w.typeExpression !== se || w.comment !== Be ? on(yk(v, R, se, Be), w) : w;
- }
- function vk(v, w) {
- return Om(327, v, w);
- }
- function K0(v, w, R) {
- return v.tagName !== w || v.comment !== R ? on(vk(w, R), v) : v;
- }
- function ZS(v, w, R) {
- const se = Gf(340, v ?? ie(TJ(
- 340
- /* JSDocEnumTag */
- )), R);
- return se.typeExpression = w, se.locals = void 0, se.nextContainer = void 0, se;
- }
- function gP(v, w = F_(v), R, se) {
- return v.tagName !== w || v.typeExpression !== R || v.comment !== se ? on(ZS(w, R, se), v) : v;
- }
- function Yo(v, w, R, se, Be) {
- const Lt = Om(351, v ?? ie("import"), Be);
- return Lt.importClause = w, Lt.moduleSpecifier = R, Lt.attributes = se, Lt.comment = Be, Lt;
- }
- function Q6(v, w, R, se, Be, Lt) {
- return v.tagName !== w || v.comment !== Lt || v.importClause !== R || v.moduleSpecifier !== se || v.attributes !== Be ? on(Yo(w, R, se, Be, Lt), v) : v;
- }
- function bk(v) {
- const w = O(
- 321
- /* JSDocText */
- );
- return w.text = v, w;
- }
- function d1(v, w) {
- return v.text !== w ? on(bk(w), v) : v;
- }
- function KS(v, w) {
- const R = O(
- 320
- /* JSDoc */
- );
- return R.comment = v, R.tags = Oa(w), R;
- }
- function v_(v, w, R) {
- return v.comment !== w || v.tags !== R ? on(KS(w, R), v) : v;
- }
- function p2(v, w, R) {
- const se = O(
- 284
- /* JsxElement */
- );
- return se.openingElement = v, se.children = F(w), se.closingElement = R, se.transformFlags |= yn(se.openingElement) | Ca(se.children) | yn(se.closingElement) | 2, se;
- }
- function Sk(v, w, R, se) {
- return v.openingElement !== w || v.children !== R || v.closingElement !== se ? on(p2(w, R, se), v) : v;
- }
- function d2(v, w, R) {
- const se = O(
- 285
- /* JsxSelfClosingElement */
- );
- return se.tagName = v, se.typeArguments = Oa(w), se.attributes = R, se.transformFlags |= yn(se.tagName) | Ca(se.typeArguments) | yn(se.attributes) | 2, se.typeArguments && (se.transformFlags |= 1), se;
- }
- function M_(v, w, R, se) {
- return v.tagName !== w || v.typeArguments !== R || v.attributes !== se ? on(d2(w, R, se), v) : v;
- }
- function Tk(v, w, R) {
- const se = O(
- 286
- /* JsxOpeningElement */
- );
- return se.tagName = v, se.typeArguments = Oa(w), se.attributes = R, se.transformFlags |= yn(se.tagName) | Ca(se.typeArguments) | yn(se.attributes) | 2, w && (se.transformFlags |= 1), se;
- }
- function m1(v, w, R, se) {
- return v.tagName !== w || v.typeArguments !== R || v.attributes !== se ? on(Tk(w, R, se), v) : v;
- }
- function $f(v) {
- const w = O(
- 287
- /* JsxClosingElement */
- );
- return w.tagName = v, w.transformFlags |= yn(w.tagName) | 2, w;
- }
- function eT(v, w) {
- return v.tagName !== w ? on($f(w), v) : v;
- }
- function g1(v, w, R) {
- const se = O(
- 288
- /* JsxFragment */
- );
- return se.openingFragment = v, se.children = F(w), se.closingFragment = R, se.transformFlags |= yn(se.openingFragment) | Ca(se.children) | yn(se.closingFragment) | 2, se;
- }
- function hP(v, w, R, se) {
- return v.openingFragment !== w || v.children !== R || v.closingFragment !== se ? on(g1(w, R, se), v) : v;
- }
- function m2(v, w) {
- const R = O(
- 12
- /* JsxText */
- );
- return R.text = v, R.containsOnlyTriviaWhiteSpaces = !!w, R.transformFlags |= 2, R;
- }
- function tT(v, w, R) {
- return v.text !== w || v.containsOnlyTriviaWhiteSpaces !== R ? on(m2(w, R), v) : v;
- }
- function xk() {
- const v = O(
- 289
- /* JsxOpeningFragment */
- );
- return v.transformFlags |= 2, v;
- }
- function ey() {
- const v = O(
- 290
- /* JsxClosingFragment */
- );
- return v.transformFlags |= 2, v;
- }
- function n_(v, w) {
- const R = B(
- 291
- /* JsxAttribute */
- );
- return R.name = v, R.initializer = w, R.transformFlags |= yn(R.name) | yn(R.initializer) | 2, R;
- }
- function lh(v, w, R) {
- return v.name !== w || v.initializer !== R ? on(n_(w, R), v) : v;
- }
- function uh(v) {
- const w = B(
- 292
- /* JsxAttributes */
- );
- return w.properties = F(v), w.transformFlags |= Ca(w.properties) | 2, w;
- }
- function Y6(v, w) {
- return v.properties !== w ? on(uh(w), v) : v;
- }
- function Ra(v) {
- const w = O(
- 293
- /* JsxSpreadAttribute */
- );
- return w.expression = v, w.transformFlags |= yn(w.expression) | 2, w;
- }
- function Tn(v, w) {
- return v.expression !== w ? on(Ra(w), v) : v;
- }
- function i_(v, w) {
- const R = O(
- 294
- /* JsxExpression */
- );
- return R.dotDotDotToken = v, R.expression = w, R.transformFlags |= yn(R.dotDotDotToken) | yn(R.expression) | 2, R;
- }
- function Cf(v, w) {
- return v.expression !== w ? on(i_(v.dotDotDotToken, w), v) : v;
- }
- function g2(v, w) {
- const R = O(
- 295
- /* JsxNamespacedName */
- );
- return R.namespace = v, R.name = w, R.transformFlags |= yn(R.namespace) | yn(R.name) | 2, R;
- }
- function Z6(v, w, R) {
- return v.namespace !== w || v.name !== R ? on(g2(w, R), v) : v;
- }
- function kk(v, w) {
- const R = O(
- 296
- /* CaseClause */
- );
- return R.expression = i().parenthesizeExpressionForDisallowedComma(v), R.statements = F(w), R.transformFlags |= yn(R.expression) | Ca(R.statements), R.jsDoc = void 0, R;
- }
- function Uv(v, w, R) {
- return v.expression !== w || v.statements !== R ? on(kk(w, R), v) : v;
- }
- function h2(v) {
- const w = O(
- 297
- /* DefaultClause */
- );
- return w.statements = F(v), w.transformFlags = Ca(w.statements), w;
- }
- function y2(v, w) {
- return v.statements !== w ? on(h2(w), v) : v;
- }
- function nd(v, w) {
- const R = O(
- 298
- /* HeritageClause */
- );
- switch (R.token = v, R.types = F(w), R.transformFlags |= Ca(R.types), v) {
- case 96:
- R.transformFlags |= 1024;
- break;
- case 119:
- R.transformFlags |= 1;
- break;
- default:
- return E.assertNever(v);
- }
- return R;
- }
- function _f(v, w) {
- return v.types !== w ? on(nd(v.token, w), v) : v;
- }
- function ff(v, w) {
- const R = O(
- 299
- /* CatchClause */
- );
- return R.variableDeclaration = Hv(v), R.block = w, R.transformFlags |= yn(R.variableDeclaration) | yn(R.block) | (v ? 0 : 64), R.locals = void 0, R.nextContainer = void 0, R;
- }
- function Vd(v, w, R) {
- return v.variableDeclaration !== w || v.block !== R ? on(ff(w, R), v) : v;
- }
- function id(v, w) {
- const R = B(
- 303
- /* PropertyAssignment */
- );
- return R.name = Kc(v), R.initializer = i().parenthesizeExpressionForDisallowedComma(w), R.transformFlags |= Uy(R.name) | yn(R.initializer), R.modifiers = void 0, R.questionToken = void 0, R.exclamationToken = void 0, R.jsDoc = void 0, R;
- }
- function rT(v, w, R) {
- return v.name !== w || v.initializer !== R ? ol(id(w, R), v) : v;
- }
- function ol(v, w) {
- return v !== w && (v.modifiers = w.modifiers, v.questionToken = w.questionToken, v.exclamationToken = w.exclamationToken), on(v, w);
- }
- function Ck(v, w) {
- const R = B(
- 304
- /* ShorthandPropertyAssignment */
- );
- return R.name = Kc(v), R.objectAssignmentInitializer = w && i().parenthesizeExpressionForDisallowedComma(w), R.transformFlags |= $3(R.name) | yn(R.objectAssignmentInitializer) | 1024, R.equalsToken = void 0, R.modifiers = void 0, R.questionToken = void 0, R.exclamationToken = void 0, R.jsDoc = void 0, R;
- }
- function k(v, w, R) {
- return v.name !== w || v.objectAssignmentInitializer !== R ? ce(Ck(w, R), v) : v;
- }
- function ce(v, w) {
- return v !== w && (v.modifiers = w.modifiers, v.questionToken = w.questionToken, v.exclamationToken = w.exclamationToken, v.equalsToken = w.equalsToken), on(v, w);
- }
- function pt(v) {
- const w = B(
- 305
- /* SpreadAssignment */
- );
- return w.expression = i().parenthesizeExpressionForDisallowedComma(v), w.transformFlags |= yn(w.expression) | 128 | 65536, w.jsDoc = void 0, w;
- }
- function Yt(v, w) {
- return v.expression !== w ? on(pt(w), v) : v;
- }
- function ai(v, w) {
- const R = B(
- 306
- /* EnumMember */
- );
- return R.name = Kc(v), R.initializer = w && i().parenthesizeExpressionForDisallowedComma(w), R.transformFlags |= yn(R.name) | yn(R.initializer) | 1, R.jsDoc = void 0, R;
- }
- function qi(v, w, R) {
- return v.name !== w || v.initializer !== R ? on(ai(w, R), v) : v;
- }
- function Ki(v, w, R) {
- const se = t.createBaseSourceFileNode(
- 307
- /* SourceFile */
- );
- return se.statements = F(v), se.endOfFileToken = w, se.flags |= R, se.text = "", se.fileName = "", se.path = "", se.resolvedPath = "", se.originalFileName = "", se.languageVersion = 1, se.languageVariant = 0, se.scriptKind = 0, se.isDeclarationFile = !1, se.hasNoDefaultLib = !1, se.transformFlags |= Ca(se.statements) | yn(se.endOfFileToken), se.locals = void 0, se.nextContainer = void 0, se.endFlowNode = void 0, se.nodeCount = 0, se.identifierCount = 0, se.symbolCount = 0, se.parseDiagnostics = void 0, se.bindDiagnostics = void 0, se.bindSuggestionDiagnostics = void 0, se.lineMap = void 0, se.externalModuleIndicator = void 0, se.setExternalModuleIndicator = void 0, se.pragmas = void 0, se.checkJsDirective = void 0, se.referencedFiles = void 0, se.typeReferenceDirectives = void 0, se.libReferenceDirectives = void 0, se.amdDependencies = void 0, se.commentDirectives = void 0, se.identifiers = void 0, se.packageJsonLocations = void 0, se.packageJsonScope = void 0, se.imports = void 0, se.moduleAugmentations = void 0, se.ambientModuleNames = void 0, se.classifiableNames = void 0, se.impliedNodeFormat = void 0, se;
- }
- function Hi(v) {
- const w = Object.create(v.redirectTarget);
- return Object.defineProperties(w, {
- id: {
- get() {
- return this.redirectInfo.redirectTarget.id;
- },
- set(R) {
- this.redirectInfo.redirectTarget.id = R;
- }
- },
- symbol: {
- get() {
- return this.redirectInfo.redirectTarget.symbol;
- },
- set(R) {
- this.redirectInfo.redirectTarget.symbol = R;
- }
- }
- }), w.redirectInfo = v, w;
- }
- function Li(v) {
- const w = Hi(v.redirectInfo);
- return w.flags |= v.flags & -17, w.fileName = v.fileName, w.path = v.path, w.resolvedPath = v.resolvedPath, w.originalFileName = v.originalFileName, w.packageJsonLocations = v.packageJsonLocations, w.packageJsonScope = v.packageJsonScope, w.emitNode = void 0, w;
- }
- function Wu(v) {
- const w = t.createBaseSourceFileNode(
- 307
- /* SourceFile */
- );
- w.flags |= v.flags & -17;
- for (const R in v)
- if (!(co(w, R) || !co(v, R))) {
- if (R === "emitNode") {
- w.emitNode = void 0;
- continue;
- }
- w[R] = v[R];
- }
- return w;
- }
- function Ml(v) {
- const w = v.redirectInfo ? Li(v) : Wu(v);
- return n(w, v), w;
- }
- function qd(v, w, R, se, Be, Lt, pn) {
- const ts = Ml(v);
- return ts.statements = F(w), ts.isDeclarationFile = R, ts.referencedFiles = se, ts.typeReferenceDirectives = Be, ts.hasNoDefaultLib = Lt, ts.libReferenceDirectives = pn, ts.transformFlags = Ca(ts.statements) | yn(ts.endOfFileToken), ts;
- }
- function ty(v, w, R = v.isDeclarationFile, se = v.referencedFiles, Be = v.typeReferenceDirectives, Lt = v.hasNoDefaultLib, pn = v.libReferenceDirectives) {
- return v.statements !== w || v.isDeclarationFile !== R || v.referencedFiles !== se || v.typeReferenceDirectives !== Be || v.hasNoDefaultLib !== Lt || v.libReferenceDirectives !== pn ? on(qd(v, w, R, se, Be, Lt, pn), v) : v;
- }
- function pf(v) {
- const w = O(
- 308
- /* Bundle */
- );
- return w.sourceFiles = v, w.syntheticFileReferences = void 0, w.syntheticTypeReferences = void 0, w.syntheticLibReferences = void 0, w.hasNoDefaultLib = void 0, w;
- }
- function v2(v, w) {
- return v.sourceFiles !== w ? on(pf(w), v) : v;
- }
- function Vv(v, w = !1, R) {
- const se = O(
- 237
- /* SyntheticExpression */
- );
- return se.type = v, se.isSpread = w, se.tupleNameSource = R, se;
- }
- function b2(v) {
- const w = O(
- 352
- /* SyntaxList */
- );
- return w._children = v, w;
- }
- function Ek(v) {
- const w = O(
- 353
- /* NotEmittedStatement */
- );
- return w.original = v, lt(w, v), w;
- }
- function nT(v, w) {
- const R = O(
- 354
- /* PartiallyEmittedExpression */
- );
- return R.expression = v, R.original = w, R.transformFlags |= yn(R.expression) | 1, lt(R, w), R;
- }
- function Hd(v, w) {
- return v.expression !== w ? on(nT(w, v.original), v) : v;
- }
- function _h(v) {
- if (fo(v) && !ZE(v) && !v.original && !v.emitNode && !v.id) {
- if (aD(v))
- return v.elements;
- if (dn(v) && Ree(v.operatorToken))
- return [v.left, v.right];
- }
- return v;
- }
- function ry(v) {
- const w = O(
- 355
- /* CommaListExpression */
- );
- return w.elements = F(fX(v, _h)), w.transformFlags |= Ca(w.elements), w;
- }
- function Dk(v, w) {
- return v.elements !== w ? on(ry(w), v) : v;
- }
- function h1(v, w) {
- const R = O(
- 356
- /* SyntheticReferenceExpression */
- );
- return R.expression = v, R.thisArg = w, R.transformFlags |= yn(R.expression) | yn(R.thisArg), R;
- }
- function yP(v, w, R) {
- return v.expression !== w || v.thisArg !== R ? on(h1(w, R), v) : v;
- }
- function aN(v) {
- const w = re(v.escapedText);
- return w.flags |= v.flags & -17, w.transformFlags = v.transformFlags, n(w, v), Z3(w, { ...v.emitNode.autoGenerate }), w;
- }
- function oN(v) {
- const w = re(v.escapedText);
- w.flags |= v.flags & -17, w.jsDoc = v.jsDoc, w.flowNode = v.flowNode, w.symbol = v.symbol, w.transformFlags = v.transformFlags, n(w, v);
- const R = _S(v);
- return R && D0(w, R), w;
- }
- function Ji(v) {
- const w = he(v.escapedText);
- return w.flags |= v.flags & -17, w.transformFlags = v.transformFlags, n(w, v), Z3(w, { ...v.emitNode.autoGenerate }), w;
- }
- function qv(v) {
- const w = he(v.escapedText);
- return w.flags |= v.flags & -17, w.transformFlags = v.transformFlags, n(w, v), w;
- }
- function Hr(v) {
- if (v === void 0)
- return v;
- if (Si(v))
- return Ml(v);
- if (jo(v))
- return aN(v);
- if (Oe(v))
- return oN(v);
- if (Q2(v))
- return Ji(v);
- if (Di(v))
- return qv(v);
- const w = WI(v.kind) ? t.createBaseNode(v.kind) : t.createBaseTokenNode(v.kind);
- w.flags |= v.flags & -17, w.transformFlags = v.transformFlags, n(w, v);
- for (const R in v)
- co(w, R) || !co(v, R) || (w[R] = v[R]);
- return w;
- }
- function vP(v, w, R) {
- return Lr(
- Sf(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- w ? [w] : [],
- /*type*/
- void 0,
- rh(
- v,
- /*multiLine*/
- !0
- )
- ),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- R ? [R] : []
- );
- }
- function K6(v, w, R) {
- return Lr(
- yp(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- w ? [w] : [],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- rh(
- v,
- /*multiLine*/
- !0
- )
- ),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- R ? [R] : []
- );
- }
- function y1() {
- return r_(X("0"));
- }
- function eE(v) {
- return u1(
- /*modifiers*/
- void 0,
- /*isExportEquals*/
- !1,
- v
- );
- }
- function cN(v) {
- return Do(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- Tp([
- WS(
- /*isTypeOnly*/
- !1,
- /*propertyName*/
- void 0,
- v
- )
- ])
- );
- }
- function bP(v, w) {
- return w === "null" ? I.createStrictEquality(v, Qe()) : w === "undefined" ? I.createStrictEquality(v, y1()) : I.createStrictEquality(vl(v), ae(w));
- }
- function SL(v, w) {
- return w === "null" ? I.createStrictInequality(v, Qe()) : w === "undefined" ? I.createStrictInequality(v, y1()) : I.createStrictInequality(vl(v), ae(w));
- }
- function Lm(v, w, R) {
- return $2(v) ? Sa(
- Lo(
- v,
- /*questionDotToken*/
- void 0,
- w
- ),
- /*questionDotToken*/
- void 0,
- /*typeArguments*/
- void 0,
- R
- ) : Lr(
- Oc(v, w),
- /*typeArguments*/
- void 0,
- R
- );
- }
- function TL(v, w, R) {
- return Lm(v, "bind", [w, ...R]);
- }
- function SP(v, w, R) {
- return Lm(v, "call", [w, ...R]);
- }
- function xL(v, w, R) {
- return Lm(v, "apply", [w, R]);
- }
- function iT(v, w, R) {
- return Lm(ie(v), w, R);
- }
- function sT(v, w) {
- return Lm(v, "slice", w === void 0 ? [] : [t0(w)]);
- }
- function lN(v, w) {
- return Lm(v, "concat", w);
- }
- function v1(v, w, R) {
- return iT("Object", "defineProperty", [v, t0(w), R]);
- }
- function yd(v, w) {
- return iT("Object", "getOwnPropertyDescriptor", [v, t0(w)]);
- }
- function tE(v, w, R) {
- return iT("Reflect", "get", R ? [v, w, R] : [v, w]);
- }
- function vg(v, w, R, se) {
- return iT("Reflect", "set", se ? [v, w, R, se] : [v, w, R]);
- }
- function b1(v, w, R) {
- return R ? (v.push(id(w, R)), !0) : !1;
- }
- function uN(v, w) {
- const R = [];
- b1(R, "enumerable", t0(v.enumerable)), b1(R, "configurable", t0(v.configurable));
- let se = b1(R, "writable", t0(v.writable));
- se = b1(R, "value", v.value) || se;
- let Be = b1(R, "get", v.get);
- return Be = b1(R, "set", v.set) || Be, E.assert(!(se && Be), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."), za(R, !w);
- }
- function bg(v, w) {
- switch (v.kind) {
- case 217:
- return A_(v, w);
- case 216:
- return cf(v, v.type, w);
- case 234:
- return th(v, w, v.type);
- case 238:
- return z0(v, w, v.type);
- case 235:
- return dg(v, w);
- case 233:
- return N_(v, w, v.typeArguments);
- case 354:
- return Hd(v, w);
- }
- }
- function aT(v) {
- return Yu(v) && fo(v) && fo(E0(v)) && fo(ym(v)) && !ut(UC(v)) && !ut(Y3(v));
- }
- function _N(v, w, R = 31) {
- return v && cO(v, R) && !aT(v) ? bg(
- v,
- _N(v.expression, w)
- ) : w;
- }
- function Rc(v, w, R) {
- if (!w)
- return v;
- const se = a1(
- w,
- w.label,
- Gy(w.statement) ? Rc(v, w.statement) : v
- );
- return R && R(w), se;
- }
- function Pk(v, w) {
- const R = Ba(v);
- switch (R.kind) {
- case 80:
- return w;
- case 110:
- case 9:
- case 10:
- case 11:
- return !1;
- case 209:
- return R.elements.length !== 0;
- case 210:
- return R.properties.length > 0;
- default:
- return !0;
- }
- }
- function Wa(v, w, R, se = !1) {
- const Be = Dc(
- v,
- 31
- /* All */
- );
- let Lt, pn;
- return C_(Be) ? (Lt = Me(), pn = Be) : rD(Be) ? (Lt = Me(), pn = R !== void 0 && R < 2 ? lt(ie("_super"), Be) : Be) : ya(Be) & 8192 ? (Lt = y1(), pn = i().parenthesizeLeftSideOfAccess(
- Be,
- /*optionalChain*/
- !1
- )) : Cn(Be) ? Pk(Be.expression, se) ? (Lt = Se(w), pn = Oc(
- lt(
- I.createAssignment(
- Lt,
- Be.expression
- ),
- Be.expression
- ),
- Be.name
- ), lt(pn, Be)) : (Lt = Be.expression, pn = Be) : ko(Be) ? Pk(Be.expression, se) ? (Lt = Se(w), pn = Lc(
- lt(
- I.createAssignment(
- Lt,
- Be.expression
- ),
- Be.expression
- ),
- Be.argumentExpression
- ), lt(pn, Be)) : (Lt = Be.expression, pn = Be) : (Lt = y1(), pn = i().parenthesizeLeftSideOfAccess(
- v,
- /*optionalChain*/
- !1
- )), { target: pn, thisArg: Lt };
- }
- function H(v, w) {
- return Oc(
- // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560)
- Xp(
- za([
- K(
- /*modifiers*/
- void 0,
- "value",
- [xr(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- v,
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- )],
- rh([
- vt(w)
- ])
- )
- ])
- ),
- "value"
- );
- }
- function ke(v) {
- return v.length > 10 ? ry(v) : Hu(v, I.createComma);
- }
- function We(v, w, R, se = 0, Be) {
- const Lt = Be ? v && FI(v) : os(v);
- if (Lt && Oe(Lt) && !jo(Lt)) {
- const pn = Aa(lt(Hr(Lt), Lt), Lt.parent);
- return se |= ya(Lt), R || (se |= 96), w || (se |= 3072), se && an(pn, se), pn;
- }
- return _e(v);
- }
- function gt(v, w, R) {
- return We(
- v,
- w,
- R,
- 98304
- /* InternalName */
- );
- }
- function Rt(v, w, R, se) {
- return We(v, w, R, 32768, se);
- }
- function gr(v, w, R) {
- return We(
- v,
- w,
- R,
- 16384
- /* ExportName */
- );
- }
- function jn(v, w, R) {
- return We(v, w, R);
- }
- function Pi(v, w, R, se) {
- const Be = Oc(v, fo(w) ? w : Hr(w));
- lt(Be, w);
- let Lt = 0;
- return se || (Lt |= 96), R || (Lt |= 3072), Lt && an(Be, Lt), Be;
- }
- function ui(v, w, R, se) {
- return v && Gn(
- w,
- 32
- /* Export */
- ) ? Pi(v, We(w), R, se) : gr(w, R, se);
- }
- function _i(v, w, R, se) {
- const Be = eo(v, w, 0, R);
- return wa(v, w, Be, se);
- }
- function Wi(v) {
- return oa(v.expression) && v.expression.text === "use strict";
- }
- function Ka() {
- return bu(vt(ae("use strict")));
- }
- function eo(v, w, R = 0, se) {
- E.assert(w.length === 0, "Prologue directives should be at the first statement in the target statements array");
- let Be = !1;
- const Lt = v.length;
- for (; R < Lt; ) {
- const pn = v[R];
- if (lm(pn))
- Wi(pn) && (Be = !0), w.push(pn);
- else
- break;
- R++;
- }
- return se && !Be && w.push(Ka()), R;
- }
- function wa(v, w, R, se, Be = B1) {
- const Lt = v.length;
- for (; R !== void 0 && R < Lt; ) {
- const pn = v[R];
- if (ya(pn) & 2097152 && Be(pn))
- wr(w, se ? Ge(pn, se, bi) : pn);
- else
- break;
- R++;
- }
- return R;
- }
- function xp(v) {
- return KJ(v) ? v : lt(F([Ka(), ...v]), v);
- }
- function cl(v) {
- return E.assert(Mi(v, HY), "Cannot lift nodes to a Block."), Qm(v) || rh(v);
- }
- function Xf(v, w, R) {
- let se = R;
- for (; se < v.length && w(v[se]); )
- se++;
- return se;
- }
- function e0(v, w) {
- if (!ut(w))
- return v;
- const R = Xf(v, lm, 0), se = Xf(v, d7, R), Be = Xf(v, m7, se), Lt = Xf(w, lm, 0), pn = Xf(w, d7, Lt), ts = Xf(w, m7, pn), ao = Xf(w, Gw, ts);
- E.assert(ao === w.length, "Expected declarations to be valid standard or custom prologues");
- const kp = pb(v) ? v.slice() : v;
- if (ao > ts && kp.splice(Be, 0, ...w.slice(ts, ao)), ts > pn && kp.splice(se, 0, ...w.slice(pn, ts)), pn > Lt && kp.splice(R, 0, ...w.slice(Lt, pn)), Lt > 0)
- if (R === 0)
- kp.splice(0, 0, ...w.slice(0, Lt));
- else {
- const Sg = /* @__PURE__ */ new Map();
- for (let Qf = 0; Qf < R; Qf++) {
- const rE = v[Qf];
- Sg.set(rE.expression.text, !0);
- }
- for (let Qf = Lt - 1; Qf >= 0; Qf--) {
- const rE = w[Qf];
- Sg.has(rE.expression.text) || kp.unshift(rE);
- }
- }
- return pb(v) ? lt(F(kp, v.hasTrailingComma), v) : v;
- }
- function fh(v, w) {
- let R;
- return typeof w == "number" ? R = Wt(w) : R = w, zo(v) ? Br(v, R, v.name, v.constraint, v.default) : Ii(v) ? zn(v, R, v.dotDotDotToken, v.name, v.questionToken, v.type, v.initializer) : VC(v) ? yr(v, R, v.typeParameters, v.parameters, v.type) : m_(v) ? Ri(v, R, v.name, v.questionToken, v.type) : cs(v) ? Fe(v, R, v.name, v.questionToken ?? v.exclamationToken, v.type, v.initializer) : vm(v) ? Ar(v, R, v.name, v.questionToken, v.typeParameters, v.parameters, v.type) : hc(v) ? ti(v, R, v.asteriskToken, v.name, v.questionToken, v.typeParameters, v.parameters, v.type, v.body) : Qo(v) ? Ea(v, R, v.parameters, v.body) : Lf(v) ? te(v, R, v.name, v.parameters, v.type, v.body) : K_(v) ? De(v, R, v.name, v.parameters, v.body) : Fb(v) ? He(v, R, v.parameters, v.type) : vo(v) ? Uf(v, R, v.asteriskToken, v.name, v.typeParameters, v.parameters, v.type, v.body) : Co(v) ? Yg(v, R, v.typeParameters, v.parameters, v.type, v.equalsGreaterThanToken, v.body) : $c(v) ? Sp(v, R, v.name, v.typeParameters, v.heritageClauses, v.members) : yc(v) ? Ne(v, R, v.declarationList) : Ec(v) ? lf(v, R, v.asteriskToken, v.name, v.typeParameters, v.parameters, v.type, v.body) : Xc(v) ? c1(v, R, v.name, v.typeParameters, v.heritageClauses, v.members) : Xl(v) ? xl(v, R, v.name, v.typeParameters, v.heritageClauses, v.members) : Vp(v) ? V0(v, R, v.name, v.typeParameters, v.type) : Bb(v) ? fk(v, R, v.name, v.members) : zc(v) ? Gh(v, R, v.name, v.body) : gl(v) ? $h(v, R, v.isTypeOnly, v.name, v.moduleReference) : ic(v) ? Xh(v, R, v.importClause, v.moduleSpecifier, v.attributes) : wo(v) ? zS(v, R, v.expression) : Nc(v) ? Yh(v, R, v.isTypeOnly, v.exportClause, v.moduleSpecifier, v.attributes) : E.assertNever(v);
- }
- function S1(v, w) {
- return Ii(v) ? zn(v, w, v.dotDotDotToken, v.name, v.questionToken, v.type, v.initializer) : cs(v) ? Fe(v, w, v.name, v.questionToken ?? v.exclamationToken, v.type, v.initializer) : hc(v) ? ti(v, w, v.asteriskToken, v.name, v.questionToken, v.typeParameters, v.parameters, v.type, v.body) : Lf(v) ? te(v, w, v.name, v.parameters, v.type, v.body) : K_(v) ? De(v, w, v.name, v.parameters, v.body) : $c(v) ? Sp(v, w, v.name, v.typeParameters, v.heritageClauses, v.members) : Xc(v) ? c1(v, w, v.name, v.typeParameters, v.heritageClauses, v.members) : E.assertNever(v);
- }
- function kL(v, w) {
- switch (v.kind) {
- case 177:
- return te(v, v.modifiers, w, v.parameters, v.type, v.body);
- case 178:
- return De(v, v.modifiers, w, v.parameters, v.body);
- case 174:
- return ti(v, v.modifiers, v.asteriskToken, w, v.questionToken, v.typeParameters, v.parameters, v.type, v.body);
- case 173:
- return Ar(v, v.modifiers, w, v.questionToken, v.typeParameters, v.parameters, v.type);
- case 172:
- return Fe(v, v.modifiers, w, v.questionToken ?? v.exclamationToken, v.type, v.initializer);
- case 171:
- return Ri(v, v.modifiers, w, v.questionToken, v.type);
- case 303:
- return rT(v, w, v.initializer);
- }
- }
- function Oa(v) {
- return v ? F(v) : void 0;
- }
- function Kc(v) {
- return typeof v == "string" ? ie(v) : v;
- }
- function t0(v) {
- return typeof v == "string" ? ae(v) : typeof v == "number" ? X(v) : typeof v == "boolean" ? v ? et() : Re() : v;
- }
- function S2(v) {
- return v && i().parenthesizeExpressionForDisallowedComma(v);
- }
- function TP(v) {
- return typeof v == "number" ? we(v) : v;
- }
- function Ef(v) {
- return v && Zee(v) ? lt(n(qe(), v), v) : v;
- }
- function Hv(v) {
- return typeof v == "string" || v && !ii(v) ? BS(
- v,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ) : v;
- }
- function on(v, w) {
- return v !== w && (n(v, w), lt(v, w)), v;
- }
- }
- function TJ(e) {
- switch (e) {
- case 344:
- return "type";
- case 342:
- return "returns";
- case 343:
- return "this";
- case 340:
- return "enum";
- case 330:
- return "author";
- case 332:
- return "class";
- case 333:
- return "public";
- case 334:
- return "private";
- case 335:
- return "protected";
- case 336:
- return "readonly";
- case 337:
- return "override";
- case 345:
- return "template";
- case 346:
- return "typedef";
- case 341:
- return "param";
- case 348:
- return "prop";
- case 338:
- return "callback";
- case 339:
- return "overload";
- case 328:
- return "augments";
- case 329:
- return "implements";
- case 351:
- return "import";
- default:
- return E.fail(`Unsupported kind: ${E.formatSyntaxKind(e)}`);
- }
- }
- var C0, rhe = {};
- function bFe(e, t) {
- switch (C0 || (C0 = Og(
- 99,
- /*skipTrivia*/
- !1,
- 0
- /* Standard */
- )), e) {
- case 15:
- C0.setText("`" + t + "`");
- break;
- case 16:
- C0.setText("`" + t + "${");
- break;
- case 17:
- C0.setText("}" + t + "${");
- break;
- case 18:
- C0.setText("}" + t + "`");
- break;
- }
- let n = C0.scan();
- if (n === 20 && (n = C0.reScanTemplateToken(
- /*isTaggedTemplate*/
- !1
- )), C0.isUnterminated())
- return C0.setText(void 0), rhe;
- let i;
- switch (n) {
- case 15:
- case 16:
- case 17:
- case 18:
- i = C0.getTokenValue();
- break;
- }
- return i === void 0 || C0.scan() !== 1 ? (C0.setText(void 0), rhe) : (C0.setText(void 0), i);
- }
- function Uy(e) {
- return e && Oe(e) ? $3(e) : yn(e);
- }
- function $3(e) {
- return yn(e) & -67108865;
- }
- function SFe(e, t) {
- return t | e.transformFlags & 134234112;
- }
- function yn(e) {
- if (!e) return 0;
- const t = e.transformFlags & ~TFe(e.kind);
- return Vl(e) && Bc(e.name) ? SFe(e.name, t) : t;
- }
- function Ca(e) {
- return e ? e.transformFlags : 0;
- }
- function nhe(e) {
- let t = 0;
- for (const n of e)
- t |= yn(n);
- e.transformFlags = t;
- }
- function TFe(e) {
- if (e >= 182 && e <= 205)
- return -2;
- switch (e) {
- case 213:
- case 214:
- case 209:
- return -2147450880;
- case 267:
- return -1941676032;
- case 169:
- return -2147483648;
- case 219:
- return -2072174592;
- case 218:
- case 262:
- return -1937940480;
- case 261:
- return -2146893824;
- case 263:
- case 231:
- return -2147344384;
- case 176:
- return -1937948672;
- case 172:
- return -2013249536;
- case 174:
- case 177:
- case 178:
- return -2005057536;
- case 133:
- case 150:
- case 163:
- case 146:
- case 154:
- case 151:
- case 136:
- case 155:
- case 116:
- case 168:
- case 171:
- case 173:
- case 179:
- case 180:
- case 181:
- case 264:
- case 265:
- return -2;
- case 210:
- return -2147278848;
- case 299:
- return -2147418112;
- case 206:
- case 207:
- return -2147450880;
- case 216:
- case 238:
- case 234:
- case 354:
- case 217:
- case 108:
- return -2147483648;
- case 211:
- case 212:
- return -2147483648;
- default:
- return -2147483648;
- }
- }
- var L5 = yee();
- function M5(e) {
- return e.flags |= 16, e;
- }
- var xFe = {
- createBaseSourceFileNode: (e) => M5(L5.createBaseSourceFileNode(e)),
- createBaseIdentifierNode: (e) => M5(L5.createBaseIdentifierNode(e)),
- createBasePrivateIdentifierNode: (e) => M5(L5.createBasePrivateIdentifierNode(e)),
- createBaseTokenNode: (e) => M5(L5.createBaseTokenNode(e)),
- createBaseNode: (e) => M5(L5.createBaseNode(e))
- }, A = G3(4, xFe), ihe;
- function she(e, t, n) {
- return new (ihe || (ihe = Gl.getSourceMapSourceConstructor()))(e, t, n);
- }
- function kn(e, t) {
- if (e.original !== t && (e.original = t, t)) {
- const n = t.emitNode;
- n && (e.emitNode = kFe(n, e.emitNode));
- }
- return e;
- }
- function kFe(e, t) {
- const {
- flags: n,
- internalFlags: i,
- leadingComments: s,
- trailingComments: o,
- commentRange: c,
- sourceMapRange: _,
- tokenSourceMapRanges: u,
- constantValue: d,
- helpers: g,
- startsOnNewLine: h,
- snippetElement: S,
- classThis: T,
- assignedName: C
- } = e;
- if (t || (t = {}), n && (t.flags = n), i && (t.internalFlags = i & -9), s && (t.leadingComments = Fn(s.slice(), t.leadingComments)), o && (t.trailingComments = Fn(o.slice(), t.trailingComments)), c && (t.commentRange = c), _ && (t.sourceMapRange = _), u && (t.tokenSourceMapRanges = CFe(u, t.tokenSourceMapRanges)), d !== void 0 && (t.constantValue = d), g)
- for (const D of g)
- t.helpers = bh(t.helpers, D);
- return h !== void 0 && (t.startsOnNewLine = h), S !== void 0 && (t.snippetElement = S), T && (t.classThis = T), C && (t.assignedName = C), t;
- }
- function CFe(e, t) {
- t || (t = []);
- for (const n in e)
- t[n] = e[n];
- return t;
- }
- function lu(e) {
- if (e.emitNode)
- E.assert(!(e.emitNode.internalFlags & 8), "Invalid attempt to mutate an immutable node.");
- else {
- if (ZE(e)) {
- if (e.kind === 307)
- return e.emitNode = { annotatedNodes: [e] };
- const t = Tr(fs(Tr(e))) ?? E.fail("Could not determine parsed source file.");
- lu(t).annotatedNodes.push(e);
- }
- e.emitNode = {};
- }
- return e.emitNode;
- }
- function xJ(e) {
- var t, n;
- const i = (n = (t = Tr(fs(e))) == null ? void 0 : t.emitNode) == null ? void 0 : n.annotatedNodes;
- if (i)
- for (const s of i)
- s.emitNode = void 0;
- }
- function X3(e) {
- const t = lu(e);
- return t.flags |= 3072, t.leadingComments = void 0, t.trailingComments = void 0, e;
- }
- function an(e, t) {
- return lu(e).flags = t, e;
- }
- function hm(e, t) {
- const n = lu(e);
- return n.flags = n.flags | t, e;
- }
- function Q3(e, t) {
- return lu(e).internalFlags = t, e;
- }
- function bx(e, t) {
- const n = lu(e);
- return n.internalFlags = n.internalFlags | t, e;
- }
- function E0(e) {
- var t;
- return ((t = e.emitNode) == null ? void 0 : t.sourceMapRange) ?? e;
- }
- function da(e, t) {
- return lu(e).sourceMapRange = t, e;
- }
- function ahe(e, t) {
- var n, i;
- return (i = (n = e.emitNode) == null ? void 0 : n.tokenSourceMapRanges) == null ? void 0 : i[t];
- }
- function kee(e, t, n) {
- const i = lu(e), s = i.tokenSourceMapRanges ?? (i.tokenSourceMapRanges = []);
- return s[t] = n, e;
- }
- function Y4(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.startsOnNewLine;
- }
- function R5(e, t) {
- return lu(e).startsOnNewLine = t, e;
- }
- function ym(e) {
- var t;
- return ((t = e.emitNode) == null ? void 0 : t.commentRange) ?? e;
- }
- function nl(e, t) {
- return lu(e).commentRange = t, e;
- }
- function UC(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.leadingComments;
- }
- function ov(e, t) {
- return lu(e).leadingComments = t, e;
- }
- function Z4(e, t, n, i) {
- return ov(e, wr(UC(e), { kind: t, pos: -1, end: -1, hasTrailingNewLine: i, text: n }));
- }
- function Y3(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.trailingComments;
- }
- function Sx(e, t) {
- return lu(e).trailingComments = t, e;
- }
- function j5(e, t, n, i) {
- return Sx(e, wr(Y3(e), { kind: t, pos: -1, end: -1, hasTrailingNewLine: i, text: n }));
- }
- function Cee(e, t) {
- ov(e, UC(t)), Sx(e, Y3(t));
- const n = lu(t);
- return n.leadingComments = void 0, n.trailingComments = void 0, e;
- }
- function Eee(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.constantValue;
- }
- function Dee(e, t) {
- const n = lu(e);
- return n.constantValue = t, e;
- }
- function Tx(e, t) {
- const n = lu(e);
- return n.helpers = wr(n.helpers, t), e;
- }
- function Ih(e, t) {
- if (ut(t)) {
- const n = lu(e);
- for (const i of t)
- n.helpers = bh(n.helpers, i);
- }
- return e;
- }
- function ohe(e, t) {
- var n;
- const i = (n = e.emitNode) == null ? void 0 : n.helpers;
- return i ? OE(i, t) : !1;
- }
- function B5(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.helpers;
- }
- function Pee(e, t, n) {
- const i = e.emitNode, s = i && i.helpers;
- if (!ut(s)) return;
- const o = lu(t);
- let c = 0;
- for (let _ = 0; _ < s.length; _++) {
- const u = s[_];
- n(u) ? (c++, o.helpers = bh(o.helpers, u)) : c > 0 && (s[_ - c] = u);
- }
- c > 0 && (s.length -= c);
- }
- function kJ(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.snippetElement;
- }
- function CJ(e, t) {
- const n = lu(e);
- return n.snippetElement = t, e;
- }
- function EJ(e) {
- return lu(e).internalFlags |= 4, e;
- }
- function wee(e, t) {
- const n = lu(e);
- return n.typeNode = t, e;
- }
- function Aee(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.typeNode;
- }
- function D0(e, t) {
- return lu(e).identifierTypeArguments = t, e;
- }
- function _S(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.identifierTypeArguments;
- }
- function Z3(e, t) {
- return lu(e).autoGenerate = t, e;
- }
- function che(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.autoGenerate;
- }
- function Nee(e, t) {
- return lu(e).generatedImportReference = t, e;
- }
- function Iee(e) {
- var t;
- return (t = e.emitNode) == null ? void 0 : t.generatedImportReference;
- }
- var Oee = /* @__PURE__ */ ((e) => (e.Field = "f", e.Method = "m", e.Accessor = "a", e))(Oee || {});
- function Fee(e) {
- const t = e.factory, n = Iu(() => Q3(
- t.createTrue(),
- 8
- /* Immutable */
- )), i = Iu(() => Q3(
- t.createFalse(),
- 8
- /* Immutable */
- ));
- return {
- getUnscopedHelperName: s,
- // TypeScript Helpers
- createDecorateHelper: o,
- createMetadataHelper: c,
- createParamHelper: _,
- // ES Decorators Helpers
- createESDecorateHelper: D,
- createRunInitializersHelper: P,
- // ES2018 Helpers
- createAssignHelper: I,
- createAwaitHelper: F,
- createAsyncGeneratorHelper: O,
- createAsyncDelegatorHelper: B,
- createAsyncValuesHelper: z,
- // ES2018 Destructuring Helpers
- createRestHelper: X,
- // ES2017 Helpers
- createAwaiterHelper: q,
- // ES2015 Helpers
- createExtendsHelper: V,
- createTemplateObjectHelper: ae,
- createSpreadArrayHelper: ee,
- createPropKeyHelper: G,
- createSetFunctionNameHelper: ue,
- // ES2015 Destructuring Helpers
- createValuesHelper: re,
- createReadHelper: ne,
- // ES2015 Generator Helpers
- createGeneratorHelper: ie,
- // ES Module Helpers
- createImportStarHelper: Se,
- createImportStarCallbackHelper: J,
- createImportDefaultHelper: oe,
- createExportStarHelper: _e,
- // Class Fields Helpers
- createClassPrivateFieldGetHelper: he,
- createClassPrivateFieldSetHelper: le,
- createClassPrivateFieldInHelper: me,
- // 'using' helpers
- createAddDisposableResourceHelper: ve,
- createDisposeResourcesHelper: tt
- };
- function s(Te) {
- return an(
- t.createIdentifier(Te),
- 8196
- /* AdviseOnEmitNode */
- );
- }
- function o(Te, we, fe, Me) {
- e.requestEmitHelper(EFe);
- const Qe = [];
- return Qe.push(t.createArrayLiteralExpression(
- Te,
- /*multiLine*/
- !0
- )), Qe.push(we), fe && (Qe.push(fe), Me && Qe.push(Me)), t.createCallExpression(
- s("__decorate"),
- /*typeArguments*/
- void 0,
- Qe
- );
- }
- function c(Te, we) {
- return e.requestEmitHelper(DFe), t.createCallExpression(
- s("__metadata"),
- /*typeArguments*/
- void 0,
- [
- t.createStringLiteral(Te),
- we
- ]
- );
- }
- function _(Te, we, fe) {
- return e.requestEmitHelper(PFe), lt(
- t.createCallExpression(
- s("__param"),
- /*typeArguments*/
- void 0,
- [
- t.createNumericLiteral(we + ""),
- Te
- ]
- ),
- fe
- );
- }
- function u(Te) {
- const we = [
- t.createPropertyAssignment(t.createIdentifier("kind"), t.createStringLiteral("class")),
- t.createPropertyAssignment(t.createIdentifier("name"), Te.name),
- t.createPropertyAssignment(t.createIdentifier("metadata"), Te.metadata)
- ];
- return t.createObjectLiteralExpression(we);
- }
- function d(Te) {
- const we = Te.computed ? t.createElementAccessExpression(t.createIdentifier("obj"), Te.name) : t.createPropertyAccessExpression(t.createIdentifier("obj"), Te.name);
- return t.createPropertyAssignment(
- "get",
- t.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.createIdentifier("obj")
- )],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- we
- )
- );
- }
- function g(Te) {
- const we = Te.computed ? t.createElementAccessExpression(t.createIdentifier("obj"), Te.name) : t.createPropertyAccessExpression(t.createIdentifier("obj"), Te.name);
- return t.createPropertyAssignment(
- "set",
- t.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- [
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.createIdentifier("obj")
- ),
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.createIdentifier("value")
- )
- ],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- t.createBlock([
- t.createExpressionStatement(
- t.createAssignment(
- we,
- t.createIdentifier("value")
- )
- )
- ])
- )
- );
- }
- function h(Te) {
- const we = Te.computed ? Te.name : Oe(Te.name) ? t.createStringLiteralFromNode(Te.name) : Te.name;
- return t.createPropertyAssignment(
- "has",
- t.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.createIdentifier("obj")
- )],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- t.createBinaryExpression(
- we,
- 103,
- t.createIdentifier("obj")
- )
- )
- );
- }
- function S(Te, we) {
- const fe = [];
- return fe.push(h(Te)), we.get && fe.push(d(Te)), we.set && fe.push(g(Te)), t.createObjectLiteralExpression(fe);
- }
- function T(Te) {
- const we = [
- t.createPropertyAssignment(t.createIdentifier("kind"), t.createStringLiteral(Te.kind)),
- t.createPropertyAssignment(t.createIdentifier("name"), Te.name.computed ? Te.name.name : t.createStringLiteralFromNode(Te.name.name)),
- t.createPropertyAssignment(t.createIdentifier("static"), Te.static ? t.createTrue() : t.createFalse()),
- t.createPropertyAssignment(t.createIdentifier("private"), Te.private ? t.createTrue() : t.createFalse()),
- t.createPropertyAssignment(t.createIdentifier("access"), S(Te.name, Te.access)),
- t.createPropertyAssignment(t.createIdentifier("metadata"), Te.metadata)
- ];
- return t.createObjectLiteralExpression(we);
- }
- function C(Te) {
- return Te.kind === "class" ? u(Te) : T(Te);
- }
- function D(Te, we, fe, Me, Qe, et) {
- return e.requestEmitHelper(wFe), t.createCallExpression(
- s("__esDecorate"),
- /*typeArguments*/
- void 0,
- [
- Te ?? t.createNull(),
- we ?? t.createNull(),
- fe,
- C(Me),
- Qe,
- et
- ]
- );
- }
- function P(Te, we, fe) {
- return e.requestEmitHelper(AFe), t.createCallExpression(
- s("__runInitializers"),
- /*typeArguments*/
- void 0,
- fe ? [Te, we, fe] : [Te, we]
- );
- }
- function I(Te) {
- return pa(e.getCompilerOptions()) >= 2 ? t.createCallExpression(
- t.createPropertyAccessExpression(t.createIdentifier("Object"), "assign"),
- /*typeArguments*/
- void 0,
- Te
- ) : (e.requestEmitHelper(NFe), t.createCallExpression(
- s("__assign"),
- /*typeArguments*/
- void 0,
- Te
- ));
- }
- function F(Te) {
- return e.requestEmitHelper(J5), t.createCallExpression(
- s("__await"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function O(Te, we) {
- return e.requestEmitHelper(J5), e.requestEmitHelper(IFe), (Te.emitNode || (Te.emitNode = {})).flags |= 1572864, t.createCallExpression(
- s("__asyncGenerator"),
- /*typeArguments*/
- void 0,
- [
- we ? t.createThis() : t.createVoidZero(),
- t.createIdentifier("arguments"),
- Te
- ]
- );
- }
- function B(Te) {
- return e.requestEmitHelper(J5), e.requestEmitHelper(OFe), t.createCallExpression(
- s("__asyncDelegator"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function z(Te) {
- return e.requestEmitHelper(FFe), t.createCallExpression(
- s("__asyncValues"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function X(Te, we, fe, Me) {
- e.requestEmitHelper(LFe);
- const Qe = [];
- let et = 0;
- for (let Re = 0; Re < we.length - 1; Re++) {
- const ft = tz(we[Re]);
- if (ft)
- if (ma(ft)) {
- E.assertIsDefined(fe, "Encountered computed property name but 'computedTempVariables' argument was not provided.");
- const Wt = fe[et];
- et++, Qe.push(
- t.createConditionalExpression(
- t.createTypeCheck(Wt, "symbol"),
- /*questionToken*/
- void 0,
- Wt,
- /*colonToken*/
- void 0,
- t.createAdd(Wt, t.createStringLiteral(""))
- )
- );
- } else
- Qe.push(t.createStringLiteralFromNode(ft));
- }
- return t.createCallExpression(
- s("__rest"),
- /*typeArguments*/
- void 0,
- [
- Te,
- lt(
- t.createArrayLiteralExpression(Qe),
- Me
- )
- ]
- );
- }
- function q(Te, we, fe, Me, Qe) {
- e.requestEmitHelper(MFe);
- const et = t.createFunctionExpression(
- /*modifiers*/
- void 0,
- t.createToken(
- 42
- /* AsteriskToken */
- ),
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- Me ?? [],
- /*type*/
- void 0,
- Qe
- );
- return (et.emitNode || (et.emitNode = {})).flags |= 1572864, t.createCallExpression(
- s("__awaiter"),
- /*typeArguments*/
- void 0,
- [
- Te ? t.createThis() : t.createVoidZero(),
- we ?? t.createVoidZero(),
- fe ? oA(t, fe) : t.createVoidZero(),
- et
- ]
- );
- }
- function V(Te) {
- return e.requestEmitHelper(RFe), t.createCallExpression(
- s("__extends"),
- /*typeArguments*/
- void 0,
- [Te, t.createUniqueName(
- "_super",
- 48
- /* FileLevel */
- )]
- );
- }
- function ae(Te, we) {
- return e.requestEmitHelper(jFe), t.createCallExpression(
- s("__makeTemplateObject"),
- /*typeArguments*/
- void 0,
- [Te, we]
- );
- }
- function ee(Te, we, fe) {
- return e.requestEmitHelper(JFe), t.createCallExpression(
- s("__spreadArray"),
- /*typeArguments*/
- void 0,
- [Te, we, fe ? n() : i()]
- );
- }
- function G(Te) {
- return e.requestEmitHelper(zFe), t.createCallExpression(
- s("__propKey"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function ue(Te, we, fe) {
- return e.requestEmitHelper(WFe), e.factory.createCallExpression(
- s("__setFunctionName"),
- /*typeArguments*/
- void 0,
- fe ? [Te, we, e.factory.createStringLiteral(fe)] : [Te, we]
- );
- }
- function re(Te) {
- return e.requestEmitHelper(UFe), t.createCallExpression(
- s("__values"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function ne(Te, we) {
- return e.requestEmitHelper(BFe), t.createCallExpression(
- s("__read"),
- /*typeArguments*/
- void 0,
- we !== void 0 ? [Te, t.createNumericLiteral(we + "")] : [Te]
- );
- }
- function ie(Te) {
- return e.requestEmitHelper(VFe), t.createCallExpression(
- s("__generator"),
- /*typeArguments*/
- void 0,
- [t.createThis(), Te]
- );
- }
- function Se(Te) {
- return e.requestEmitHelper(uhe), t.createCallExpression(
- s("__importStar"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function J() {
- return e.requestEmitHelper(uhe), s("__importStar");
- }
- function oe(Te) {
- return e.requestEmitHelper(HFe), t.createCallExpression(
- s("__importDefault"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- function _e(Te, we = t.createIdentifier("exports")) {
- return e.requestEmitHelper(GFe), e.requestEmitHelper(Mee), t.createCallExpression(
- s("__exportStar"),
- /*typeArguments*/
- void 0,
- [Te, we]
- );
- }
- function he(Te, we, fe, Me) {
- e.requestEmitHelper($Fe);
- let Qe;
- return Me ? Qe = [Te, we, t.createStringLiteral(fe), Me] : Qe = [Te, we, t.createStringLiteral(fe)], t.createCallExpression(
- s("__classPrivateFieldGet"),
- /*typeArguments*/
- void 0,
- Qe
- );
- }
- function le(Te, we, fe, Me, Qe) {
- e.requestEmitHelper(XFe);
- let et;
- return Qe ? et = [Te, we, fe, t.createStringLiteral(Me), Qe] : et = [Te, we, fe, t.createStringLiteral(Me)], t.createCallExpression(
- s("__classPrivateFieldSet"),
- /*typeArguments*/
- void 0,
- et
- );
- }
- function me(Te, we) {
- return e.requestEmitHelper(QFe), t.createCallExpression(
- s("__classPrivateFieldIn"),
- /*typeArguments*/
- void 0,
- [Te, we]
- );
- }
- function ve(Te, we, fe) {
- return e.requestEmitHelper(YFe), t.createCallExpression(
- s("__addDisposableResource"),
- /*typeArguments*/
- void 0,
- [Te, we, fe ? t.createTrue() : t.createFalse()]
- );
- }
- function tt(Te) {
- return e.requestEmitHelper(ZFe), t.createCallExpression(
- s("__disposeResources"),
- /*typeArguments*/
- void 0,
- [Te]
- );
- }
- }
- function Lee(e, t) {
- return e === t || e.priority === t.priority ? 0 : e.priority === void 0 ? 1 : t.priority === void 0 ? -1 : ho(e.priority, t.priority);
- }
- function lhe(e, ...t) {
- return (n) => {
- let i = "";
- for (let s = 0; s < t.length; s++)
- i += e[s], i += n(t[s]);
- return i += e[e.length - 1], i;
- };
- }
- var EFe = {
- name: "typescript:decorate",
- importName: "__decorate",
- scoped: !1,
- priority: 2,
- text: `
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };`
- }, DFe = {
- name: "typescript:metadata",
- importName: "__metadata",
- scoped: !1,
- priority: 3,
- text: `
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };`
- }, PFe = {
- name: "typescript:param",
- importName: "__param",
- scoped: !1,
- priority: 4,
- text: `
- var __param = (this && this.__param) || function (paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
- };`
- }, wFe = {
- name: "typescript:esDecorate",
- importName: "__esDecorate",
- scoped: !1,
- priority: 2,
- text: `
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
- var _, done = false;
- for (var i = decorators.length - 1; i >= 0; i--) {
- var context = {};
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
- if (kind === "accessor") {
- if (result === void 0) continue;
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
- if (_ = accept(result.get)) descriptor.get = _;
- if (_ = accept(result.set)) descriptor.set = _;
- if (_ = accept(result.init)) initializers.unshift(_);
- }
- else if (_ = accept(result)) {
- if (kind === "field") initializers.unshift(_);
- else descriptor[key] = _;
- }
- }
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
- done = true;
- };`
- }, AFe = {
- name: "typescript:runInitializers",
- importName: "__runInitializers",
- scoped: !1,
- priority: 2,
- text: `
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
- var useValue = arguments.length > 2;
- for (var i = 0; i < initializers.length; i++) {
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
- }
- return useValue ? value : void 0;
- };`
- }, NFe = {
- name: "typescript:assign",
- importName: "__assign",
- scoped: !1,
- priority: 1,
- text: `
- var __assign = (this && this.__assign) || function () {
- __assign = Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };`
- }, J5 = {
- name: "typescript:await",
- importName: "__await",
- scoped: !1,
- text: `
- var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }`
- }, IFe = {
- name: "typescript:asyncGenerator",
- importName: "__asyncGenerator",
- scoped: !1,
- dependencies: [J5],
- text: `
- var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
- function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
- function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
- };`
- }, OFe = {
- name: "typescript:asyncDelegator",
- importName: "__asyncDelegator",
- scoped: !1,
- dependencies: [J5],
- text: `
- var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
- };`
- }, FFe = {
- name: "typescript:asyncValues",
- importName: "__asyncValues",
- scoped: !1,
- text: `
- var __asyncValues = (this && this.__asyncValues) || function (o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
- };`
- }, LFe = {
- name: "typescript:rest",
- importName: "__rest",
- scoped: !1,
- text: `
- var __rest = (this && this.__rest) || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
- };`
- }, MFe = {
- name: "typescript:awaiter",
- importName: "__awaiter",
- scoped: !1,
- priority: 5,
- text: `
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };`
- }, RFe = {
- name: "typescript:extends",
- importName: "__extends",
- scoped: !1,
- priority: 0,
- text: `
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
-
- return function (d, b) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();`
- }, jFe = {
- name: "typescript:makeTemplateObject",
- importName: "__makeTemplateObject",
- scoped: !1,
- priority: 0,
- text: `
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
- };`
- }, BFe = {
- name: "typescript:read",
- importName: "__read",
- scoped: !1,
- text: `
- var __read = (this && this.__read) || function (o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
- };`
- }, JFe = {
- name: "typescript:spreadArray",
- importName: "__spreadArray",
- scoped: !1,
- text: `
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
- if (ar || !(i in from)) {
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
- ar[i] = from[i];
- }
- }
- return to.concat(ar || Array.prototype.slice.call(from));
- };`
- }, zFe = {
- name: "typescript:propKey",
- importName: "__propKey",
- scoped: !1,
- text: `
- var __propKey = (this && this.__propKey) || function (x) {
- return typeof x === "symbol" ? x : "".concat(x);
- };`
- }, WFe = {
- name: "typescript:setFunctionName",
- importName: "__setFunctionName",
- scoped: !1,
- text: `
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
- };`
- }, UFe = {
- name: "typescript:values",
- importName: "__values",
- scoped: !1,
- text: `
- var __values = (this && this.__values) || function(o) {
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
- };`
- }, VFe = {
- name: "typescript:generator",
- importName: "__generator",
- scoped: !1,
- priority: 6,
- text: `
- var __generator = (this && this.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
- };`
- }, Mee = {
- name: "typescript:commonjscreatebinding",
- importName: "__createBinding",
- scoped: !1,
- priority: 1,
- text: `
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
- }) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
- }));`
- }, qFe = {
- name: "typescript:commonjscreatevalue",
- importName: "__setModuleDefault",
- scoped: !1,
- priority: 1,
- text: `
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
- }) : function(o, v) {
- o["default"] = v;
- });`
- }, uhe = {
- name: "typescript:commonjsimportstar",
- importName: "__importStar",
- scoped: !1,
- dependencies: [Mee, qFe],
- priority: 2,
- text: `
- var __importStar = (this && this.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
- };`
- }, HFe = {
- name: "typescript:commonjsimportdefault",
- importName: "__importDefault",
- scoped: !1,
- text: `
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };`
- }, GFe = {
- name: "typescript:export-star",
- importName: "__exportStar",
- scoped: !1,
- dependencies: [Mee],
- priority: 2,
- text: `
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
- };`
- }, $Fe = {
- name: "typescript:classPrivateFieldGet",
- importName: "__classPrivateFieldGet",
- scoped: !1,
- text: `
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
- };`
- }, XFe = {
- name: "typescript:classPrivateFieldSet",
- importName: "__classPrivateFieldSet",
- scoped: !1,
- text: `
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
- if (kind === "m") throw new TypeError("Private method is not writable");
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
- };`
- }, QFe = {
- name: "typescript:classPrivateFieldIn",
- importName: "__classPrivateFieldIn",
- scoped: !1,
- text: `
- var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
- return typeof state === "function" ? receiver === state : state.has(receiver);
- };`
- }, YFe = {
- name: "typescript:addDisposableResource",
- importName: "__addDisposableResource",
- scoped: !1,
- text: `
- var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
- if (value !== null && value !== void 0) {
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
- var dispose, inner;
- if (async) {
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
- dispose = value[Symbol.asyncDispose];
- }
- if (dispose === void 0) {
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
- dispose = value[Symbol.dispose];
- if (async) inner = dispose;
- }
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
- if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
- env.stack.push({ value: value, dispose: dispose, async: async });
- }
- else if (async) {
- env.stack.push({ async: true });
- }
- return value;
- };`
- }, ZFe = {
- name: "typescript:disposeResources",
- importName: "__disposeResources",
- scoped: !1,
- text: `
- var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
- return function (env) {
- function fail(e) {
- env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
- env.hasError = true;
- }
- var r, s = 0;
- function next() {
- while (r = env.stack.pop()) {
- try {
- if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
- if (r.dispose) {
- var result = r.dispose.call(r.value);
- if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
- }
- else s |= 1;
- }
- catch (e) {
- fail(e);
- }
- }
- if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
- if (env.hasError) throw env.error;
- }
- return next();
- };
- })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
- var e = new Error(message);
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
- });`
- }, z5 = {
- name: "typescript:async-super",
- scoped: !0,
- text: lhe`
- const ${"_superIndex"} = name => super[name];`
- }, W5 = {
- name: "typescript:advanced-async-super",
- scoped: !0,
- text: lhe`
- const ${"_superIndex"} = (function (geti, seti) {
- const cache = Object.create(null);
- return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });
- })(name => super[name], (name, value) => super[name] = value);`
- };
- function K4(e, t) {
- return Fs(e) && Oe(e.expression) && (ya(e.expression) & 8192) !== 0 && e.expression.escapedText === t;
- }
- function d_(e) {
- return e.kind === 9;
- }
- function eD(e) {
- return e.kind === 10;
- }
- function oa(e) {
- return e.kind === 11;
- }
- function xx(e) {
- return e.kind === 12;
- }
- function DJ(e) {
- return e.kind === 14;
- }
- function fS(e) {
- return e.kind === 15;
- }
- function kx(e) {
- return e.kind === 16;
- }
- function PJ(e) {
- return e.kind === 17;
- }
- function U5(e) {
- return e.kind === 18;
- }
- function V5(e) {
- return e.kind === 26;
- }
- function Ree(e) {
- return e.kind === 28;
- }
- function wJ(e) {
- return e.kind === 40;
- }
- function AJ(e) {
- return e.kind === 41;
- }
- function K3(e) {
- return e.kind === 42;
- }
- function eA(e) {
- return e.kind === 54;
- }
- function Vy(e) {
- return e.kind === 58;
- }
- function jee(e) {
- return e.kind === 59;
- }
- function q5(e) {
- return e.kind === 29;
- }
- function Bee(e) {
- return e.kind === 39;
- }
- function Oe(e) {
- return e.kind === 80;
- }
- function Di(e) {
- return e.kind === 81;
- }
- function Cx(e) {
- return e.kind === 95;
- }
- function H5(e) {
- return e.kind === 90;
- }
- function tD(e) {
- return e.kind === 134;
- }
- function Jee(e) {
- return e.kind === 131;
- }
- function NJ(e) {
- return e.kind === 135;
- }
- function zee(e) {
- return e.kind === 148;
- }
- function Ex(e) {
- return e.kind === 126;
- }
- function Wee(e) {
- return e.kind === 128;
- }
- function Uee(e) {
- return e.kind === 164;
- }
- function Vee(e) {
- return e.kind === 129;
- }
- function rD(e) {
- return e.kind === 108;
- }
- function nD(e) {
- return e.kind === 102;
- }
- function qee(e) {
- return e.kind === 84;
- }
- function Xu(e) {
- return e.kind === 166;
- }
- function ma(e) {
- return e.kind === 167;
- }
- function zo(e) {
- return e.kind === 168;
- }
- function Ii(e) {
- return e.kind === 169;
- }
- function dl(e) {
- return e.kind === 170;
- }
- function m_(e) {
- return e.kind === 171;
- }
- function cs(e) {
- return e.kind === 172;
- }
- function vm(e) {
- return e.kind === 173;
- }
- function hc(e) {
- return e.kind === 174;
- }
- function oc(e) {
- return e.kind === 175;
- }
- function Qo(e) {
- return e.kind === 176;
- }
- function Lf(e) {
- return e.kind === 177;
- }
- function K_(e) {
- return e.kind === 178;
- }
- function Dx(e) {
- return e.kind === 179;
- }
- function tA(e) {
- return e.kind === 180;
- }
- function Fb(e) {
- return e.kind === 181;
- }
- function Px(e) {
- return e.kind === 182;
- }
- function vf(e) {
- return e.kind === 183;
- }
- function lg(e) {
- return e.kind === 184;
- }
- function VC(e) {
- return e.kind === 185;
- }
- function Lb(e) {
- return e.kind === 186;
- }
- function Qu(e) {
- return e.kind === 187;
- }
- function rA(e) {
- return e.kind === 188;
- }
- function wx(e) {
- return e.kind === 189;
- }
- function qC(e) {
- return e.kind === 202;
- }
- function G5(e) {
- return e.kind === 190;
- }
- function $5(e) {
- return e.kind === 191;
- }
- function qy(e) {
- return e.kind === 192;
- }
- function Ax(e) {
- return e.kind === 193;
- }
- function Mb(e) {
- return e.kind === 194;
- }
- function pS(e) {
- return e.kind === 195;
- }
- function dS(e) {
- return e.kind === 196;
- }
- function HC(e) {
- return e.kind === 197;
- }
- function cv(e) {
- return e.kind === 198;
- }
- function Rb(e) {
- return e.kind === 199;
- }
- function mS(e) {
- return e.kind === 200;
- }
- function P0(e) {
- return e.kind === 201;
- }
- function bm(e) {
- return e.kind === 205;
- }
- function IJ(e) {
- return e.kind === 204;
- }
- function Hee(e) {
- return e.kind === 203;
- }
- function Mf(e) {
- return e.kind === 206;
- }
- function w0(e) {
- return e.kind === 207;
- }
- function va(e) {
- return e.kind === 208;
- }
- function $l(e) {
- return e.kind === 209;
- }
- function Ks(e) {
- return e.kind === 210;
- }
- function Cn(e) {
- return e.kind === 211;
- }
- function ko(e) {
- return e.kind === 212;
- }
- function Fs(e) {
- return e.kind === 213;
- }
- function jb(e) {
- return e.kind === 214;
- }
- function lv(e) {
- return e.kind === 215;
- }
- function OJ(e) {
- return e.kind === 216;
- }
- function Yu(e) {
- return e.kind === 217;
- }
- function vo(e) {
- return e.kind === 218;
- }
- function Co(e) {
- return e.kind === 219;
- }
- function Gee(e) {
- return e.kind === 220;
- }
- function GC(e) {
- return e.kind === 221;
- }
- function Nx(e) {
- return e.kind === 222;
- }
- function Hy(e) {
- return e.kind === 223;
- }
- function uv(e) {
- return e.kind === 224;
- }
- function FJ(e) {
- return e.kind === 225;
- }
- function dn(e) {
- return e.kind === 226;
- }
- function Ix(e) {
- return e.kind === 227;
- }
- function X5(e) {
- return e.kind === 228;
- }
- function Q5(e) {
- return e.kind === 229;
- }
- function fp(e) {
- return e.kind === 230;
- }
- function $c(e) {
- return e.kind === 231;
- }
- function ml(e) {
- return e.kind === 232;
- }
- function Oh(e) {
- return e.kind === 233;
- }
- function iD(e) {
- return e.kind === 234;
- }
- function Y5(e) {
- return e.kind === 238;
- }
- function Ox(e) {
- return e.kind === 235;
- }
- function sD(e) {
- return e.kind === 236;
- }
- function _he(e) {
- return e.kind === 237;
- }
- function LJ(e) {
- return e.kind === 354;
- }
- function aD(e) {
- return e.kind === 355;
- }
- function $C(e) {
- return e.kind === 239;
- }
- function $ee(e) {
- return e.kind === 240;
- }
- function Cs(e) {
- return e.kind === 241;
- }
- function yc(e) {
- return e.kind === 243;
- }
- function MJ(e) {
- return e.kind === 242;
- }
- function Pl(e) {
- return e.kind === 244;
- }
- function _v(e) {
- return e.kind === 245;
- }
- function fhe(e) {
- return e.kind === 246;
- }
- function RJ(e) {
- return e.kind === 247;
- }
- function fv(e) {
- return e.kind === 248;
- }
- function Z5(e) {
- return e.kind === 249;
- }
- function nA(e) {
- return e.kind === 250;
- }
- function phe(e) {
- return e.kind === 251;
- }
- function dhe(e) {
- return e.kind === 252;
- }
- function Up(e) {
- return e.kind === 253;
- }
- function Xee(e) {
- return e.kind === 254;
- }
- function oD(e) {
- return e.kind === 255;
- }
- function Gy(e) {
- return e.kind === 256;
- }
- function jJ(e) {
- return e.kind === 257;
- }
- function gS(e) {
- return e.kind === 258;
- }
- function mhe(e) {
- return e.kind === 259;
- }
- function ii(e) {
- return e.kind === 260;
- }
- function Fl(e) {
- return e.kind === 261;
- }
- function Ec(e) {
- return e.kind === 262;
- }
- function Xc(e) {
- return e.kind === 263;
- }
- function Xl(e) {
- return e.kind === 264;
- }
- function Vp(e) {
- return e.kind === 265;
- }
- function Bb(e) {
- return e.kind === 266;
- }
- function zc(e) {
- return e.kind === 267;
- }
- function Sm(e) {
- return e.kind === 268;
- }
- function cD(e) {
- return e.kind === 269;
- }
- function iA(e) {
- return e.kind === 270;
- }
- function gl(e) {
- return e.kind === 271;
- }
- function ic(e) {
- return e.kind === 272;
- }
- function Ad(e) {
- return e.kind === 273;
- }
- function ghe(e) {
- return e.kind === 302;
- }
- function Qee(e) {
- return e.kind === 300;
- }
- function hhe(e) {
- return e.kind === 301;
- }
- function hS(e) {
- return e.kind === 300;
- }
- function Yee(e) {
- return e.kind === 301;
- }
- function Hg(e) {
- return e.kind === 274;
- }
- function ug(e) {
- return e.kind === 280;
- }
- function Tm(e) {
- return e.kind === 275;
- }
- function Zu(e) {
- return e.kind === 276;
- }
- function wo(e) {
- return e.kind === 277;
- }
- function Nc(e) {
- return e.kind === 278;
- }
- function pp(e) {
- return e.kind === 279;
- }
- function vu(e) {
- return e.kind === 281;
- }
- function K5(e) {
- return e.kind === 80 || e.kind === 11;
- }
- function yhe(e) {
- return e.kind === 282;
- }
- function Zee(e) {
- return e.kind === 353;
- }
- function Fx(e) {
- return e.kind === 356;
- }
- function Fh(e) {
- return e.kind === 283;
- }
- function Gg(e) {
- return e.kind === 284;
- }
- function yS(e) {
- return e.kind === 285;
- }
- function xm(e) {
- return e.kind === 286;
- }
- function Jb(e) {
- return e.kind === 287;
- }
- function zb(e) {
- return e.kind === 288;
- }
- function vS(e) {
- return e.kind === 289;
- }
- function Kee(e) {
- return e.kind === 290;
- }
- function km(e) {
- return e.kind === 291;
- }
- function Wb(e) {
- return e.kind === 292;
- }
- function Lx(e) {
- return e.kind === 293;
- }
- function lD(e) {
- return e.kind === 294;
- }
- function Nd(e) {
- return e.kind === 295;
- }
- function XC(e) {
- return e.kind === 296;
- }
- function uD(e) {
- return e.kind === 297;
- }
- function ef(e) {
- return e.kind === 298;
- }
- function Ub(e) {
- return e.kind === 299;
- }
- function Qc(e) {
- return e.kind === 303;
- }
- function uu(e) {
- return e.kind === 304;
- }
- function $g(e) {
- return e.kind === 305;
- }
- function A0(e) {
- return e.kind === 306;
- }
- function Si(e) {
- return e.kind === 307;
- }
- function ete(e) {
- return e.kind === 308;
- }
- function pv(e) {
- return e.kind === 309;
- }
- function _D(e) {
- return e.kind === 310;
- }
- function dv(e) {
- return e.kind === 311;
- }
- function tte(e) {
- return e.kind === 324;
- }
- function rte(e) {
- return e.kind === 325;
- }
- function vhe(e) {
- return e.kind === 326;
- }
- function nte(e) {
- return e.kind === 312;
- }
- function ite(e) {
- return e.kind === 313;
- }
- function QC(e) {
- return e.kind === 314;
- }
- function eO(e) {
- return e.kind === 315;
- }
- function BJ(e) {
- return e.kind === 316;
- }
- function YC(e) {
- return e.kind === 317;
- }
- function tO(e) {
- return e.kind === 318;
- }
- function bhe(e) {
- return e.kind === 319;
- }
- function Id(e) {
- return e.kind === 320;
- }
- function bS(e) {
- return e.kind === 322;
- }
- function Lh(e) {
- return e.kind === 323;
- }
- function Mx(e) {
- return e.kind === 328;
- }
- function She(e) {
- return e.kind === 330;
- }
- function ste(e) {
- return e.kind === 332;
- }
- function JJ(e) {
- return e.kind === 338;
- }
- function zJ(e) {
- return e.kind === 333;
- }
- function WJ(e) {
- return e.kind === 334;
- }
- function UJ(e) {
- return e.kind === 335;
- }
- function VJ(e) {
- return e.kind === 336;
- }
- function rO(e) {
- return e.kind === 337;
- }
- function ZC(e) {
- return e.kind === 339;
- }
- function qJ(e) {
- return e.kind === 331;
- }
- function The(e) {
- return e.kind === 347;
- }
- function sA(e) {
- return e.kind === 340;
- }
- function dp(e) {
- return e.kind === 341;
- }
- function nO(e) {
- return e.kind === 342;
- }
- function HJ(e) {
- return e.kind === 343;
- }
- function fD(e) {
- return e.kind === 344;
- }
- function qp(e) {
- return e.kind === 345;
- }
- function SS(e) {
- return e.kind === 346;
- }
- function xhe(e) {
- return e.kind === 327;
- }
- function ate(e) {
- return e.kind === 348;
- }
- function iO(e) {
- return e.kind === 329;
- }
- function sO(e) {
- return e.kind === 350;
- }
- function khe(e) {
- return e.kind === 349;
- }
- function Cm(e) {
- return e.kind === 351;
- }
- function KC(e) {
- return e.kind === 352;
- }
- var pD = /* @__PURE__ */ new WeakMap();
- function GJ(e, t) {
- var n;
- const i = e.kind;
- return WI(i) ? i === 352 ? e._children : (n = pD.get(t)) == null ? void 0 : n.get(e) : Ue;
- }
- function ote(e, t, n) {
- e.kind === 352 && E.fail("Should not need to re-set the children of a SyntaxList.");
- let i = pD.get(t);
- return i === void 0 && (i = /* @__PURE__ */ new WeakMap(), pD.set(t, i)), i.set(e, n), n;
- }
- function $J(e, t) {
- var n;
- e.kind === 352 && E.fail("Did not expect to unset the children of a SyntaxList."), (n = pD.get(t)) == null || n.delete(e);
- }
- function cte(e, t) {
- const n = pD.get(e);
- n !== void 0 && (pD.delete(e), pD.set(t, n));
- }
- function aA(e) {
- return e.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- e.createNamedExports([]),
- /*moduleSpecifier*/
- void 0
- );
- }
- function TS(e, t, n, i) {
- if (ma(n))
- return lt(e.createElementAccessExpression(t, n.expression), i);
- {
- const s = lt(
- Fg(n) ? e.createPropertyAccessExpression(t, n) : e.createElementAccessExpression(t, n),
- n
- );
- return hm(
- s,
- 128
- /* NoNestedSourceMaps */
- ), s;
- }
- }
- function lte(e, t) {
- const n = gv.createIdentifier(e || "React");
- return Aa(n, fs(t)), n;
- }
- function ute(e, t, n) {
- if (Xu(t)) {
- const i = ute(e, t.left, n), s = e.createIdentifier(Nn(t.right));
- return s.escapedText = t.right.escapedText, e.createPropertyAccessExpression(i, s);
- } else
- return lte(Nn(t), n);
- }
- function XJ(e, t, n, i) {
- return t ? ute(e, t, i) : e.createPropertyAccessExpression(
- lte(n, i),
- "createElement"
- );
- }
- function KFe(e, t, n, i) {
- return t ? ute(e, t, i) : e.createPropertyAccessExpression(
- lte(n, i),
- "Fragment"
- );
- }
- function _te(e, t, n, i, s, o) {
- const c = [n];
- if (i && c.push(i), s && s.length > 0)
- if (i || c.push(e.createNull()), s.length > 1)
- for (const _ of s)
- bu(_), c.push(_);
- else
- c.push(s[0]);
- return lt(
- e.createCallExpression(
- t,
- /*typeArguments*/
- void 0,
- c
- ),
- o
- );
- }
- function fte(e, t, n, i, s, o, c) {
- const u = [KFe(e, n, i, o), e.createNull()];
- if (s && s.length > 0)
- if (s.length > 1)
- for (const d of s)
- bu(d), u.push(d);
- else
- u.push(s[0]);
- return lt(
- e.createCallExpression(
- XJ(e, t, i, o),
- /*typeArguments*/
- void 0,
- u
- ),
- c
- );
- }
- function QJ(e, t, n) {
- if (Fl(t)) {
- const i = xa(t.declarations), s = e.updateVariableDeclaration(
- i,
- i.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n
- );
- return lt(
- e.createVariableStatement(
- /*modifiers*/
- void 0,
- e.updateVariableDeclarationList(t, [s])
- ),
- /*location*/
- t
- );
- } else {
- const i = lt(
- e.createAssignment(t, n),
- /*location*/
- t
- );
- return lt(
- e.createExpressionStatement(i),
- /*location*/
- t
- );
- }
- }
- function oA(e, t) {
- if (Xu(t)) {
- const n = oA(e, t.left), i = Aa(lt(e.cloneNode(t.right), t.right), t.right.parent);
- return lt(e.createPropertyAccessExpression(n, i), t);
- } else
- return Aa(lt(e.cloneNode(t), t), t.parent);
- }
- function YJ(e, t) {
- return Oe(t) ? e.createStringLiteralFromNode(t) : ma(t) ? Aa(lt(e.cloneNode(t.expression), t.expression), t.expression.parent) : Aa(lt(e.cloneNode(t), t), t.parent);
- }
- function e9e(e, t, n, i, s) {
- const { firstAccessor: o, getAccessor: c, setAccessor: _ } = My(t, n);
- if (n === o)
- return lt(
- e.createObjectDefinePropertyCall(
- i,
- YJ(e, n.name),
- e.createPropertyDescriptor({
- enumerable: e.createFalse(),
- configurable: !0,
- get: c && lt(
- kn(
- e.createFunctionExpression(
- fb(c),
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- c.parameters,
- /*type*/
- void 0,
- c.body
- // TODO: GH#18217
- ),
- c
- ),
- c
- ),
- set: _ && lt(
- kn(
- e.createFunctionExpression(
- fb(_),
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- _.parameters,
- /*type*/
- void 0,
- _.body
- // TODO: GH#18217
- ),
- _
- ),
- _
- )
- }, !s)
- ),
- o
- );
- }
- function t9e(e, t, n) {
- return kn(
- lt(
- e.createAssignment(
- TS(
- e,
- n,
- t.name,
- /*location*/
- t.name
- ),
- t.initializer
- ),
- t
- ),
- t
- );
- }
- function r9e(e, t, n) {
- return kn(
- lt(
- e.createAssignment(
- TS(
- e,
- n,
- t.name,
- /*location*/
- t.name
- ),
- e.cloneNode(t.name)
- ),
- /*location*/
- t
- ),
- /*original*/
- t
- );
- }
- function n9e(e, t, n) {
- return kn(
- lt(
- e.createAssignment(
- TS(
- e,
- n,
- t.name,
- /*location*/
- t.name
- ),
- kn(
- lt(
- e.createFunctionExpression(
- fb(t),
- t.asteriskToken,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- t.parameters,
- /*type*/
- void 0,
- t.body
- // TODO: GH#18217
- ),
- /*location*/
- t
- ),
- /*original*/
- t
- )
- ),
- /*location*/
- t
- ),
- /*original*/
- t
- );
- }
- function pte(e, t, n, i) {
- switch (n.name && Di(n.name) && E.failBadSyntaxKind(n.name, "Private identifiers are not allowed in object literals."), n.kind) {
- case 177:
- case 178:
- return e9e(e, t.properties, n, i, !!t.multiLine);
- case 303:
- return t9e(e, n, i);
- case 304:
- return r9e(e, n, i);
- case 174:
- return n9e(e, n, i);
- }
- }
- function aO(e, t, n, i, s) {
- const o = t.operator;
- E.assert(o === 46 || o === 47, "Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");
- const c = e.createTempVariable(i);
- n = e.createAssignment(c, n), lt(n, t.operand);
- let _ = uv(t) ? e.createPrefixUnaryExpression(o, c) : e.createPostfixUnaryExpression(c, o);
- return lt(_, t), s && (_ = e.createAssignment(s, _), lt(_, t)), n = e.createComma(n, _), lt(n, t), FJ(t) && (n = e.createComma(n, c), lt(n, t)), n;
- }
- function ZJ(e) {
- return (ya(e) & 65536) !== 0;
- }
- function Mh(e) {
- return (ya(e) & 32768) !== 0;
- }
- function oO(e) {
- return (ya(e) & 16384) !== 0;
- }
- function Che(e) {
- return oa(e.expression) && e.expression.text === "use strict";
- }
- function KJ(e) {
- for (const t of e)
- if (lm(t)) {
- if (Che(t))
- return t;
- } else
- break;
- }
- function dte(e) {
- const t = el(e);
- return t !== void 0 && lm(t) && Che(t);
- }
- function cA(e) {
- return e.kind === 226 && e.operatorToken.kind === 28;
- }
- function dD(e) {
- return cA(e) || aD(e);
- }
- function xS(e) {
- return Yu(e) && cn(e) && !!V1(e);
- }
- function mD(e) {
- const t = q1(e);
- return E.assertIsDefined(t), t;
- }
- function cO(e, t = 31) {
- switch (e.kind) {
- case 217:
- return t & -2147483648 && xS(e) ? !1 : (t & 1) !== 0;
- case 216:
- case 234:
- case 238:
- return (t & 2) !== 0;
- case 233:
- return (t & 16) !== 0;
- case 235:
- return (t & 4) !== 0;
- case 354:
- return (t & 8) !== 0;
- }
- return !1;
- }
- function Dc(e, t = 31) {
- for (; cO(e, t); )
- e = e.expression;
- return e;
- }
- function mte(e, t = 31) {
- let n = e.parent;
- for (; cO(n, t); )
- n = n.parent, E.assert(n);
- return n;
- }
- function bu(e) {
- return R5(
- e,
- /*newLine*/
- !0
- );
- }
- function lO(e) {
- const t = Ho(e, Si), n = t && t.emitNode;
- return n && n.externalHelpersModuleName;
- }
- function gte(e) {
- const t = Ho(e, Si), n = t && t.emitNode;
- return !!n && (!!n.externalHelpersModuleName || !!n.externalHelpers);
- }
- function ez(e, t, n, i, s, o, c) {
- if (i.importHelpers && $T(n, i)) {
- let _;
- const u = Ru(i);
- if (u >= 5 && u <= 99 || PS(n, i) === 99) {
- const d = B5(n);
- if (d) {
- const g = [];
- for (const h of d)
- if (!h.scoped) {
- const S = h.importName;
- S && tp(g, S);
- }
- if (ut(g)) {
- g.sort(au), _ = e.createNamedImports(
- lr(g, (T) => a7(n, T) ? e.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- /*propertyName*/
- void 0,
- e.createIdentifier(T)
- ) : e.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- e.createIdentifier(T),
- t.getUnscopedHelperName(T)
- ))
- );
- const h = Ho(n, Si), S = lu(h);
- S.externalHelpers = !0;
- }
- }
- } else {
- const d = i9e(e, n, i, s, o || c);
- d && (_ = e.createNamespaceImport(d));
- }
- if (_) {
- const d = e.createImportDeclaration(
- /*modifiers*/
- void 0,
- e.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- _
- ),
- e.createStringLiteral(X1),
- /*attributes*/
- void 0
- );
- return bx(
- d,
- 2
- /* NeverApplyImportHelper */
- ), d;
- }
- }
- }
- function i9e(e, t, n, i, s) {
- if (n.importHelpers && $T(t, n)) {
- const o = lO(t);
- if (o)
- return o;
- let c = (i || Wg(n) && s) && BD(t, n) < 4;
- if (!c) {
- const _ = B5(t);
- if (_) {
- for (const u of _)
- if (!u.scoped) {
- c = !0;
- break;
- }
- }
- }
- if (c) {
- const _ = Ho(t, Si), u = lu(_);
- return u.externalHelpersModuleName || (u.externalHelpersModuleName = e.createUniqueName(X1));
- }
- }
- }
- function e6(e, t, n) {
- const i = kC(t);
- if (i && !ex(t) && !c7(t)) {
- const s = i.name;
- return s.kind === 11 ? e.getGeneratedNameForNode(t) : jo(s) ? s : e.createIdentifier(gb(n, s) || Nn(s));
- }
- if (t.kind === 272 && t.importClause || t.kind === 278 && t.moduleSpecifier)
- return e.getGeneratedNameForNode(t);
- }
- function Rx(e, t, n, i, s, o) {
- const c = KT(t);
- if (c && oa(c))
- return a9e(t, i, e, s, o) || s9e(e, c, n) || e.cloneNode(c);
- }
- function s9e(e, t, n) {
- const i = n.renamedDependencies && n.renamedDependencies.get(t.text);
- return i ? e.createStringLiteral(i) : void 0;
- }
- function lA(e, t, n, i) {
- if (t) {
- if (t.moduleName)
- return e.createStringLiteral(t.moduleName);
- if (!t.isDeclarationFile && i.outFile)
- return e.createStringLiteral(PB(n, t.fileName));
- }
- }
- function a9e(e, t, n, i, s) {
- return lA(n, i.getExternalModuleFileFromDeclaration(e), t, s);
- }
- function uA(e) {
- if (Pw(e))
- return e.initializer;
- if (Qc(e)) {
- const t = e.initializer;
- return Dl(
- t,
- /*excludeCompoundAssignment*/
- !0
- ) ? t.right : void 0;
- }
- if (uu(e))
- return e.objectAssignmentInitializer;
- if (Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- ))
- return e.right;
- if (fp(e))
- return uA(e.expression);
- }
- function $y(e) {
- if (Pw(e))
- return e.name;
- if (kh(e)) {
- switch (e.kind) {
- case 303:
- return $y(e.initializer);
- case 304:
- return e.name;
- case 305:
- return $y(e.expression);
- }
- return;
- }
- return Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- ) ? $y(e.left) : fp(e) ? $y(e.expression) : e;
- }
- function uO(e) {
- switch (e.kind) {
- case 169:
- case 208:
- return e.dotDotDotToken;
- case 230:
- case 305:
- return e;
- }
- }
- function tz(e) {
- const t = _O(e);
- return E.assert(!!t || $g(e), "Invalid property name for binding element."), t;
- }
- function _O(e) {
- switch (e.kind) {
- case 208:
- if (e.propertyName) {
- const n = e.propertyName;
- return Di(n) ? E.failBadSyntaxKind(n) : ma(n) && Ehe(n.expression) ? n.expression : n;
- }
- break;
- case 303:
- if (e.name) {
- const n = e.name;
- return Di(n) ? E.failBadSyntaxKind(n) : ma(n) && Ehe(n.expression) ? n.expression : n;
- }
- break;
- case 305:
- return e.name && Di(e.name) ? E.failBadSyntaxKind(e.name) : e.name;
- }
- const t = $y(e);
- if (t && Bc(t))
- return t;
- }
- function Ehe(e) {
- const t = e.kind;
- return t === 11 || t === 9;
- }
- function t6(e) {
- switch (e.kind) {
- case 206:
- case 207:
- case 209:
- return e.elements;
- case 210:
- return e.properties;
- }
- }
- function rz(e) {
- if (e) {
- let t = e;
- for (; ; ) {
- if (Oe(t) || !t.body)
- return Oe(t) ? t : t.name;
- t = t.body;
- }
- }
- }
- function Dhe(e) {
- const t = e.kind;
- return t === 176 || t === 178;
- }
- function hte(e) {
- const t = e.kind;
- return t === 176 || t === 177 || t === 178;
- }
- function nz(e) {
- const t = e.kind;
- return t === 303 || t === 304 || t === 262 || t === 176 || t === 181 || t === 175 || t === 282 || t === 243 || t === 264 || t === 265 || t === 266 || t === 267 || t === 271 || t === 272 || t === 270 || t === 278 || t === 277;
- }
- function yte(e) {
- const t = e.kind;
- return t === 175 || t === 303 || t === 304 || t === 282 || t === 270;
- }
- function vte(e) {
- return Vy(e) || eA(e);
- }
- function bte(e) {
- return Oe(e) || HC(e);
- }
- function Ste(e) {
- return zee(e) || wJ(e) || AJ(e);
- }
- function Tte(e) {
- return Vy(e) || wJ(e) || AJ(e);
- }
- function xte(e) {
- return Oe(e) || oa(e);
- }
- function o9e(e) {
- return e === 43;
- }
- function c9e(e) {
- return e === 42 || e === 44 || e === 45;
- }
- function l9e(e) {
- return o9e(e) || c9e(e);
- }
- function u9e(e) {
- return e === 40 || e === 41;
- }
- function _9e(e) {
- return u9e(e) || l9e(e);
- }
- function f9e(e) {
- return e === 48 || e === 49 || e === 50;
- }
- function iz(e) {
- return f9e(e) || _9e(e);
- }
- function p9e(e) {
- return e === 30 || e === 33 || e === 32 || e === 34 || e === 104 || e === 103;
- }
- function d9e(e) {
- return p9e(e) || iz(e);
- }
- function m9e(e) {
- return e === 35 || e === 37 || e === 36 || e === 38;
- }
- function g9e(e) {
- return m9e(e) || d9e(e);
- }
- function h9e(e) {
- return e === 51 || e === 52 || e === 53;
- }
- function y9e(e) {
- return h9e(e) || g9e(e);
- }
- function v9e(e) {
- return e === 56 || e === 57;
- }
- function b9e(e) {
- return v9e(e) || y9e(e);
- }
- function S9e(e) {
- return e === 61 || b9e(e) || Ph(e);
- }
- function T9e(e) {
- return S9e(e) || e === 28;
- }
- function kte(e) {
- return T9e(e.kind);
- }
- var sz;
- ((e) => {
- function t(g, h, S, T, C, D, P) {
- const I = h > 0 ? C[h - 1] : void 0;
- return E.assertEqual(S[h], t), C[h] = g.onEnter(T[h], I, P), S[h] = _(g, t), h;
- }
- e.enter = t;
- function n(g, h, S, T, C, D, P) {
- E.assertEqual(S[h], n), E.assertIsDefined(g.onLeft), S[h] = _(g, n);
- const I = g.onLeft(T[h].left, C[h], T[h]);
- return I ? (d(h, T, I), u(h, S, T, C, I)) : h;
- }
- e.left = n;
- function i(g, h, S, T, C, D, P) {
- return E.assertEqual(S[h], i), E.assertIsDefined(g.onOperator), S[h] = _(g, i), g.onOperator(T[h].operatorToken, C[h], T[h]), h;
- }
- e.operator = i;
- function s(g, h, S, T, C, D, P) {
- E.assertEqual(S[h], s), E.assertIsDefined(g.onRight), S[h] = _(g, s);
- const I = g.onRight(T[h].right, C[h], T[h]);
- return I ? (d(h, T, I), u(h, S, T, C, I)) : h;
- }
- e.right = s;
- function o(g, h, S, T, C, D, P) {
- E.assertEqual(S[h], o), S[h] = _(g, o);
- const I = g.onExit(T[h], C[h]);
- if (h > 0) {
- if (h--, g.foldState) {
- const F = S[h] === o ? "right" : "left";
- C[h] = g.foldState(C[h], I, F);
- }
- } else
- D.value = I;
- return h;
- }
- e.exit = o;
- function c(g, h, S, T, C, D, P) {
- return E.assertEqual(S[h], c), h;
- }
- e.done = c;
- function _(g, h) {
- switch (h) {
- case t:
- if (g.onLeft) return n;
- case n:
- if (g.onOperator) return i;
- case i:
- if (g.onRight) return s;
- case s:
- return o;
- case o:
- return c;
- case c:
- return c;
- default:
- E.fail("Invalid state");
- }
- }
- e.nextState = _;
- function u(g, h, S, T, C) {
- return g++, h[g] = t, S[g] = C, T[g] = void 0, g;
- }
- function d(g, h, S) {
- if (E.shouldAssert(
- 2
- /* Aggressive */
- ))
- for (; g >= 0; )
- E.assert(h[g] !== S, "Circular traversal detected."), g--;
- }
- })(sz || (sz = {}));
- var x9e = class {
- constructor(e, t, n, i, s, o) {
- this.onEnter = e, this.onLeft = t, this.onOperator = n, this.onRight = i, this.onExit = s, this.foldState = o;
- }
- };
- function fO(e, t, n, i, s, o) {
- const c = new x9e(e, t, n, i, s, o);
- return _;
- function _(u, d) {
- const g = { value: void 0 }, h = [sz.enter], S = [u], T = [void 0];
- let C = 0;
- for (; h[C] !== sz.done; )
- C = h[C](c, C, h, S, T, g, d);
- return E.assertEqual(C, 0), g.value;
- }
- }
- function k9e(e) {
- return e === 95 || e === 90;
- }
- function _A(e) {
- const t = e.kind;
- return k9e(t);
- }
- function Cte(e, t) {
- if (t !== void 0)
- return t.length === 0 ? t : lt(e.createNodeArray([], t.hasTrailingComma), t);
- }
- function fA(e) {
- var t;
- const n = e.emitNode.autoGenerate;
- if (n.flags & 4) {
- const i = n.id;
- let s = e, o = s.original;
- for (; o; ) {
- s = o;
- const c = (t = s.emitNode) == null ? void 0 : t.autoGenerate;
- if (Fg(s) && (c === void 0 || c.flags & 4 && c.id !== i))
- break;
- o = s.original;
- }
- return s;
- }
- return e;
- }
- function r6(e, t) {
- return typeof e == "object" ? mv(
- /*privateName*/
- !1,
- e.prefix,
- e.node,
- e.suffix,
- t
- ) : typeof e == "string" ? e.length > 0 && e.charCodeAt(0) === 35 ? e.slice(1) : e : "";
- }
- function C9e(e, t) {
- return typeof e == "string" ? e : E9e(e, E.checkDefined(t));
- }
- function E9e(e, t) {
- return Q2(e) ? t(e).slice(1) : jo(e) ? t(e) : Di(e) ? e.escapedText.slice(1) : Nn(e);
- }
- function mv(e, t, n, i, s) {
- return t = r6(t, s), i = r6(i, s), n = C9e(n, s), `${e ? "#" : ""}${t}${n}${i}`;
- }
- function az(e, t, n, i) {
- return e.updatePropertyDeclaration(
- t,
- n,
- e.getGeneratedPrivateNameForNode(
- t.name,
- /*prefix*/
- void 0,
- "_accessor_storage"
- ),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- i
- );
- }
- function Ete(e, t, n, i, s = e.createThis()) {
- return e.createGetAccessorDeclaration(
- n,
- i,
- [],
- /*type*/
- void 0,
- e.createBlock([
- e.createReturnStatement(
- e.createPropertyAccessExpression(
- s,
- e.getGeneratedPrivateNameForNode(
- t.name,
- /*prefix*/
- void 0,
- "_accessor_storage"
- )
- )
- )
- ])
- );
- }
- function Dte(e, t, n, i, s = e.createThis()) {
- return e.createSetAccessorDeclaration(
- n,
- i,
- [e.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "value"
- )],
- e.createBlock([
- e.createExpressionStatement(
- e.createAssignment(
- e.createPropertyAccessExpression(
- s,
- e.getGeneratedPrivateNameForNode(
- t.name,
- /*prefix*/
- void 0,
- "_accessor_storage"
- )
- ),
- e.createIdentifier("value")
- )
- )
- ])
- );
- }
- function pO(e) {
- let t = e.expression;
- for (; ; ) {
- if (t = Dc(t), aD(t)) {
- t = _a(t.elements);
- continue;
- }
- if (cA(t)) {
- t = t.right;
- continue;
- }
- if (Dl(
- t,
- /*excludeCompoundAssignment*/
- !0
- ) && jo(t.left))
- return t;
- break;
- }
- }
- function D9e(e) {
- return Yu(e) && fo(e) && !e.emitNode;
- }
- function dO(e, t) {
- if (D9e(e))
- dO(e.expression, t);
- else if (cA(e))
- dO(e.left, t), dO(e.right, t);
- else if (aD(e))
- for (const n of e.elements)
- dO(n, t);
- else
- t.push(e);
- }
- function Pte(e) {
- const t = [];
- return dO(e, t), t;
- }
- function pA(e) {
- if (e.transformFlags & 65536) return !0;
- if (e.transformFlags & 128)
- for (const t of t6(e)) {
- const n = $y(t);
- if (n && o4(n) && (n.transformFlags & 65536 || n.transformFlags & 128 && pA(n)))
- return !0;
- }
- return !1;
- }
- function lt(e, t) {
- return t ? wd(e, t.pos, t.end) : e;
- }
- function Hp(e) {
- const t = e.kind;
- return t === 168 || t === 169 || t === 171 || t === 172 || t === 173 || t === 174 || t === 176 || t === 177 || t === 178 || t === 181 || t === 185 || t === 218 || t === 219 || t === 231 || t === 243 || t === 262 || t === 263 || t === 264 || t === 265 || t === 266 || t === 267 || t === 271 || t === 272 || t === 277 || t === 278;
- }
- function Vb(e) {
- const t = e.kind;
- return t === 169 || t === 172 || t === 174 || t === 177 || t === 178 || t === 231 || t === 263;
- }
- var Phe, whe, Ahe, Nhe, Ihe, wte = {
- createBaseSourceFileNode: (e) => new (Ihe || (Ihe = Gl.getSourceFileConstructor()))(e, -1, -1),
- createBaseIdentifierNode: (e) => new (Ahe || (Ahe = Gl.getIdentifierConstructor()))(e, -1, -1),
- createBasePrivateIdentifierNode: (e) => new (Nhe || (Nhe = Gl.getPrivateIdentifierConstructor()))(e, -1, -1),
- createBaseTokenNode: (e) => new (whe || (whe = Gl.getTokenConstructor()))(e, -1, -1),
- createBaseNode: (e) => new (Phe || (Phe = Gl.getNodeConstructor()))(e, -1, -1)
- }, gv = G3(1, wte);
- function Jt(e, t) {
- return t && e(t);
- }
- function Ti(e, t, n) {
- if (n) {
- if (t)
- return t(n);
- for (const i of n) {
- const s = e(i);
- if (s)
- return s;
- }
- }
- }
- function oz(e, t) {
- return e.charCodeAt(t + 1) === 42 && e.charCodeAt(t + 2) === 42 && e.charCodeAt(t + 3) !== 47;
- }
- function dA(e) {
- return ir(e.statements, P9e) || w9e(e);
- }
- function P9e(e) {
- return Hp(e) && A9e(
- e,
- 95
- /* ExportKeyword */
- ) || gl(e) && Fh(e.moduleReference) || ic(e) || wo(e) || Nc(e) ? e : void 0;
- }
- function w9e(e) {
- return e.flags & 8388608 ? Ohe(e) : void 0;
- }
- function Ohe(e) {
- return N9e(e) ? e : bs(e, Ohe);
- }
- function A9e(e, t) {
- return ut(e.modifiers, (n) => n.kind === t);
- }
- function N9e(e) {
- return sD(e) && e.keywordToken === 102 && e.name.escapedText === "meta";
- }
- var I9e = {
- 166: function(t, n, i) {
- return Jt(n, t.left) || Jt(n, t.right);
- },
- 168: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.constraint) || Jt(n, t.default) || Jt(n, t.expression);
- },
- 304: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.exclamationToken) || Jt(n, t.equalsToken) || Jt(n, t.objectAssignmentInitializer);
- },
- 305: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 169: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.dotDotDotToken) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.type) || Jt(n, t.initializer);
- },
- 172: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.exclamationToken) || Jt(n, t.type) || Jt(n, t.initializer);
- },
- 171: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.type) || Jt(n, t.initializer);
- },
- 303: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.exclamationToken) || Jt(n, t.initializer);
- },
- 260: function(t, n, i) {
- return Jt(n, t.name) || Jt(n, t.exclamationToken) || Jt(n, t.type) || Jt(n, t.initializer);
- },
- 208: function(t, n, i) {
- return Jt(n, t.dotDotDotToken) || Jt(n, t.propertyName) || Jt(n, t.name) || Jt(n, t.initializer);
- },
- 181: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type);
- },
- 185: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type);
- },
- 184: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type);
- },
- 179: Fhe,
- 180: Fhe,
- 174: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.asteriskToken) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.exclamationToken) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 173: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.questionToken) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type);
- },
- 176: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 177: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 178: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 262: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.asteriskToken) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 218: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.asteriskToken) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.body);
- },
- 219: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Ti(n, i, t.typeParameters) || Ti(n, i, t.parameters) || Jt(n, t.type) || Jt(n, t.equalsGreaterThanToken) || Jt(n, t.body);
- },
- 175: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.body);
- },
- 183: function(t, n, i) {
- return Jt(n, t.typeName) || Ti(n, i, t.typeArguments);
- },
- 182: function(t, n, i) {
- return Jt(n, t.assertsModifier) || Jt(n, t.parameterName) || Jt(n, t.type);
- },
- 186: function(t, n, i) {
- return Jt(n, t.exprName) || Ti(n, i, t.typeArguments);
- },
- 187: function(t, n, i) {
- return Ti(n, i, t.members);
- },
- 188: function(t, n, i) {
- return Jt(n, t.elementType);
- },
- 189: function(t, n, i) {
- return Ti(n, i, t.elements);
- },
- 192: Lhe,
- 193: Lhe,
- 194: function(t, n, i) {
- return Jt(n, t.checkType) || Jt(n, t.extendsType) || Jt(n, t.trueType) || Jt(n, t.falseType);
- },
- 195: function(t, n, i) {
- return Jt(n, t.typeParameter);
- },
- 205: function(t, n, i) {
- return Jt(n, t.argument) || Jt(n, t.attributes) || Jt(n, t.qualifier) || Ti(n, i, t.typeArguments);
- },
- 302: function(t, n, i) {
- return Jt(n, t.assertClause);
- },
- 196: Mhe,
- 198: Mhe,
- 199: function(t, n, i) {
- return Jt(n, t.objectType) || Jt(n, t.indexType);
- },
- 200: function(t, n, i) {
- return Jt(n, t.readonlyToken) || Jt(n, t.typeParameter) || Jt(n, t.nameType) || Jt(n, t.questionToken) || Jt(n, t.type) || Ti(n, i, t.members);
- },
- 201: function(t, n, i) {
- return Jt(n, t.literal);
- },
- 202: function(t, n, i) {
- return Jt(n, t.dotDotDotToken) || Jt(n, t.name) || Jt(n, t.questionToken) || Jt(n, t.type);
- },
- 206: Rhe,
- 207: Rhe,
- 209: function(t, n, i) {
- return Ti(n, i, t.elements);
- },
- 210: function(t, n, i) {
- return Ti(n, i, t.properties);
- },
- 211: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.questionDotToken) || Jt(n, t.name);
- },
- 212: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.questionDotToken) || Jt(n, t.argumentExpression);
- },
- 213: jhe,
- 214: jhe,
- 215: function(t, n, i) {
- return Jt(n, t.tag) || Jt(n, t.questionDotToken) || Ti(n, i, t.typeArguments) || Jt(n, t.template);
- },
- 216: function(t, n, i) {
- return Jt(n, t.type) || Jt(n, t.expression);
- },
- 217: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 220: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 221: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 222: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 224: function(t, n, i) {
- return Jt(n, t.operand);
- },
- 229: function(t, n, i) {
- return Jt(n, t.asteriskToken) || Jt(n, t.expression);
- },
- 223: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 225: function(t, n, i) {
- return Jt(n, t.operand);
- },
- 226: function(t, n, i) {
- return Jt(n, t.left) || Jt(n, t.operatorToken) || Jt(n, t.right);
- },
- 234: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.type);
- },
- 235: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 238: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.type);
- },
- 236: function(t, n, i) {
- return Jt(n, t.name);
- },
- 227: function(t, n, i) {
- return Jt(n, t.condition) || Jt(n, t.questionToken) || Jt(n, t.whenTrue) || Jt(n, t.colonToken) || Jt(n, t.whenFalse);
- },
- 230: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 241: Bhe,
- 268: Bhe,
- 307: function(t, n, i) {
- return Ti(n, i, t.statements) || Jt(n, t.endOfFileToken);
- },
- 243: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.declarationList);
- },
- 261: function(t, n, i) {
- return Ti(n, i, t.declarations);
- },
- 244: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 245: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.thenStatement) || Jt(n, t.elseStatement);
- },
- 246: function(t, n, i) {
- return Jt(n, t.statement) || Jt(n, t.expression);
- },
- 247: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.statement);
- },
- 248: function(t, n, i) {
- return Jt(n, t.initializer) || Jt(n, t.condition) || Jt(n, t.incrementor) || Jt(n, t.statement);
- },
- 249: function(t, n, i) {
- return Jt(n, t.initializer) || Jt(n, t.expression) || Jt(n, t.statement);
- },
- 250: function(t, n, i) {
- return Jt(n, t.awaitModifier) || Jt(n, t.initializer) || Jt(n, t.expression) || Jt(n, t.statement);
- },
- 251: Jhe,
- 252: Jhe,
- 253: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 254: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.statement);
- },
- 255: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.caseBlock);
- },
- 269: function(t, n, i) {
- return Ti(n, i, t.clauses);
- },
- 296: function(t, n, i) {
- return Jt(n, t.expression) || Ti(n, i, t.statements);
- },
- 297: function(t, n, i) {
- return Ti(n, i, t.statements);
- },
- 256: function(t, n, i) {
- return Jt(n, t.label) || Jt(n, t.statement);
- },
- 257: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 258: function(t, n, i) {
- return Jt(n, t.tryBlock) || Jt(n, t.catchClause) || Jt(n, t.finallyBlock);
- },
- 299: function(t, n, i) {
- return Jt(n, t.variableDeclaration) || Jt(n, t.block);
- },
- 170: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 263: zhe,
- 231: zhe,
- 264: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Ti(n, i, t.heritageClauses) || Ti(n, i, t.members);
- },
- 265: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.typeParameters) || Jt(n, t.type);
- },
- 266: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Ti(n, i, t.members);
- },
- 306: function(t, n, i) {
- return Jt(n, t.name) || Jt(n, t.initializer);
- },
- 267: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.body);
- },
- 271: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name) || Jt(n, t.moduleReference);
- },
- 272: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.importClause) || Jt(n, t.moduleSpecifier) || Jt(n, t.attributes);
- },
- 273: function(t, n, i) {
- return Jt(n, t.name) || Jt(n, t.namedBindings);
- },
- 300: function(t, n, i) {
- return Ti(n, i, t.elements);
- },
- 301: function(t, n, i) {
- return Jt(n, t.name) || Jt(n, t.value);
- },
- 270: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.name);
- },
- 274: function(t, n, i) {
- return Jt(n, t.name);
- },
- 280: function(t, n, i) {
- return Jt(n, t.name);
- },
- 275: Whe,
- 279: Whe,
- 278: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.exportClause) || Jt(n, t.moduleSpecifier) || Jt(n, t.attributes);
- },
- 276: Uhe,
- 281: Uhe,
- 277: function(t, n, i) {
- return Ti(n, i, t.modifiers) || Jt(n, t.expression);
- },
- 228: function(t, n, i) {
- return Jt(n, t.head) || Ti(n, i, t.templateSpans);
- },
- 239: function(t, n, i) {
- return Jt(n, t.expression) || Jt(n, t.literal);
- },
- 203: function(t, n, i) {
- return Jt(n, t.head) || Ti(n, i, t.templateSpans);
- },
- 204: function(t, n, i) {
- return Jt(n, t.type) || Jt(n, t.literal);
- },
- 167: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 298: function(t, n, i) {
- return Ti(n, i, t.types);
- },
- 233: function(t, n, i) {
- return Jt(n, t.expression) || Ti(n, i, t.typeArguments);
- },
- 283: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 282: function(t, n, i) {
- return Ti(n, i, t.modifiers);
- },
- 355: function(t, n, i) {
- return Ti(n, i, t.elements);
- },
- 284: function(t, n, i) {
- return Jt(n, t.openingElement) || Ti(n, i, t.children) || Jt(n, t.closingElement);
- },
- 288: function(t, n, i) {
- return Jt(n, t.openingFragment) || Ti(n, i, t.children) || Jt(n, t.closingFragment);
- },
- 285: Vhe,
- 286: Vhe,
- 292: function(t, n, i) {
- return Ti(n, i, t.properties);
- },
- 291: function(t, n, i) {
- return Jt(n, t.name) || Jt(n, t.initializer);
- },
- 293: function(t, n, i) {
- return Jt(n, t.expression);
- },
- 294: function(t, n, i) {
- return Jt(n, t.dotDotDotToken) || Jt(n, t.expression);
- },
- 287: function(t, n, i) {
- return Jt(n, t.tagName);
- },
- 295: function(t, n, i) {
- return Jt(n, t.namespace) || Jt(n, t.name);
- },
- 190: gD,
- 191: gD,
- 309: gD,
- 315: gD,
- 314: gD,
- 316: gD,
- 318: gD,
- 317: function(t, n, i) {
- return Ti(n, i, t.parameters) || Jt(n, t.type);
- },
- 320: function(t, n, i) {
- return (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment)) || Ti(n, i, t.tags);
- },
- 347: function(t, n, i) {
- return Jt(n, t.tagName) || Jt(n, t.name) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 310: function(t, n, i) {
- return Jt(n, t.name);
- },
- 311: function(t, n, i) {
- return Jt(n, t.left) || Jt(n, t.right);
- },
- 341: qhe,
- 348: qhe,
- 330: function(t, n, i) {
- return Jt(n, t.tagName) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 329: function(t, n, i) {
- return Jt(n, t.tagName) || Jt(n, t.class) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 328: function(t, n, i) {
- return Jt(n, t.tagName) || Jt(n, t.class) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 345: function(t, n, i) {
- return Jt(n, t.tagName) || Jt(n, t.constraint) || Ti(n, i, t.typeParameters) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 346: function(t, n, i) {
- return Jt(n, t.tagName) || (t.typeExpression && t.typeExpression.kind === 309 ? Jt(n, t.typeExpression) || Jt(n, t.fullName) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment)) : Jt(n, t.fullName) || Jt(n, t.typeExpression) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment)));
- },
- 338: function(t, n, i) {
- return Jt(n, t.tagName) || Jt(n, t.fullName) || Jt(n, t.typeExpression) || (typeof t.comment == "string" ? void 0 : Ti(n, i, t.comment));
- },
- 342: hD,
- 344: hD,
- 343: hD,
- 340: hD,
- 350: hD,
- 349: hD,
- 339: hD,
- 323: function(t, n, i) {
- return ir(t.typeParameters, n) || ir(t.parameters, n) || Jt(n, t.type);
- },
- 324: Ate,
- 325: Ate,
- 326: Ate,
- 322: function(t, n, i) {
- return ir(t.jsDocPropertyTags, n);
- },
- 327: n6,
- 332: n6,
- 333: n6,
- 334: n6,
- 335: n6,
- 336: n6,
- 331: n6,
- 337: n6,
- 351: O9e,
- 354: F9e
- };
- function Fhe(e, t, n) {
- return Ti(t, n, e.typeParameters) || Ti(t, n, e.parameters) || Jt(t, e.type);
- }
- function Lhe(e, t, n) {
- return Ti(t, n, e.types);
- }
- function Mhe(e, t, n) {
- return Jt(t, e.type);
- }
- function Rhe(e, t, n) {
- return Ti(t, n, e.elements);
- }
- function jhe(e, t, n) {
- return Jt(t, e.expression) || // TODO: should we separate these branches out?
- Jt(t, e.questionDotToken) || Ti(t, n, e.typeArguments) || Ti(t, n, e.arguments);
- }
- function Bhe(e, t, n) {
- return Ti(t, n, e.statements);
- }
- function Jhe(e, t, n) {
- return Jt(t, e.label);
- }
- function zhe(e, t, n) {
- return Ti(t, n, e.modifiers) || Jt(t, e.name) || Ti(t, n, e.typeParameters) || Ti(t, n, e.heritageClauses) || Ti(t, n, e.members);
- }
- function Whe(e, t, n) {
- return Ti(t, n, e.elements);
- }
- function Uhe(e, t, n) {
- return Jt(t, e.propertyName) || Jt(t, e.name);
- }
- function Vhe(e, t, n) {
- return Jt(t, e.tagName) || Ti(t, n, e.typeArguments) || Jt(t, e.attributes);
- }
- function gD(e, t, n) {
- return Jt(t, e.type);
- }
- function qhe(e, t, n) {
- return Jt(t, e.tagName) || (e.isNameFirst ? Jt(t, e.name) || Jt(t, e.typeExpression) : Jt(t, e.typeExpression) || Jt(t, e.name)) || (typeof e.comment == "string" ? void 0 : Ti(t, n, e.comment));
- }
- function hD(e, t, n) {
- return Jt(t, e.tagName) || Jt(t, e.typeExpression) || (typeof e.comment == "string" ? void 0 : Ti(t, n, e.comment));
- }
- function Ate(e, t, n) {
- return Jt(t, e.name);
- }
- function n6(e, t, n) {
- return Jt(t, e.tagName) || (typeof e.comment == "string" ? void 0 : Ti(t, n, e.comment));
- }
- function O9e(e, t, n) {
- return Jt(t, e.tagName) || Jt(t, e.importClause) || Jt(t, e.moduleSpecifier) || Jt(t, e.attributes) || (typeof e.comment == "string" ? void 0 : Ti(t, n, e.comment));
- }
- function F9e(e, t, n) {
- return Jt(t, e.expression);
- }
- function bs(e, t, n) {
- if (e === void 0 || e.kind <= 165)
- return;
- const i = I9e[e.kind];
- return i === void 0 ? void 0 : i(e, t, n);
- }
- function jx(e, t, n) {
- const i = Hhe(e), s = [];
- for (; s.length < i.length; )
- s.push(e);
- for (; i.length !== 0; ) {
- const o = i.pop(), c = s.pop();
- if (us(o)) {
- if (n) {
- const _ = n(o, c);
- if (_) {
- if (_ === "skip") continue;
- return _;
- }
- }
- for (let _ = o.length - 1; _ >= 0; --_)
- i.push(o[_]), s.push(c);
- } else {
- const _ = t(o, c);
- if (_) {
- if (_ === "skip") continue;
- return _;
- }
- if (o.kind >= 166)
- for (const u of Hhe(o))
- i.push(u), s.push(o);
- }
- }
- }
- function Hhe(e) {
- const t = [];
- return bs(e, n, n), t;
- function n(i) {
- t.unshift(i);
- }
- }
- function Ghe(e) {
- e.externalModuleIndicator = dA(e);
- }
- function Bx(e, t, n, i = !1, s) {
- var o, c;
- (o = rn) == null || o.push(
- rn.Phase.Parse,
- "createSourceFile",
- { path: e },
- /*separateBeginAndEnd*/
- !0
- ), Ko("beforeParse");
- let _;
- const {
- languageVersion: u,
- setExternalModuleIndicator: d,
- impliedNodeFormat: g,
- jsDocParsingMode: h
- } = typeof n == "object" ? n : { languageVersion: n };
- if (u === 100)
- _ = hv.parseSourceFile(
- e,
- t,
- u,
- /*syntaxCursor*/
- void 0,
- i,
- 6,
- ja,
- h
- );
- else {
- const S = g === void 0 ? d : (T) => (T.impliedNodeFormat = g, (d || Ghe)(T));
- _ = hv.parseSourceFile(
- e,
- t,
- u,
- /*syntaxCursor*/
- void 0,
- i,
- s,
- S,
- h
- );
- }
- return Ko("afterParse"), rp("Parse", "beforeParse", "afterParse"), (c = rn) == null || c.pop(), _;
- }
- function Jx(e, t) {
- return hv.parseIsolatedEntityName(e, t);
- }
- function mA(e, t) {
- return hv.parseJsonText(e, t);
- }
- function il(e) {
- return e.externalModuleIndicator !== void 0;
- }
- function cz(e, t, n, i = !1) {
- const s = lz.updateSourceFile(e, t, n, i);
- return s.flags |= e.flags & 12582912, s;
- }
- function Nte(e, t, n) {
- const i = hv.JSDocParser.parseIsolatedJSDocComment(e, t, n);
- return i && i.jsDoc && hv.fixupParentReferences(i.jsDoc), i;
- }
- function $he(e, t, n) {
- return hv.JSDocParser.parseJSDocTypeExpressionForTests(e, t, n);
- }
- var hv;
- ((e) => {
- var t = Og(
- 99,
- /*skipTrivia*/
- !0
- ), n = 40960, i, s, o, c, _;
- function u(H) {
- return Re++, H;
- }
- var d = {
- createBaseSourceFileNode: (H) => u(new _(
- H,
- /*pos*/
- 0,
- /*end*/
- 0
- )),
- createBaseIdentifierNode: (H) => u(new o(
- H,
- /*pos*/
- 0,
- /*end*/
- 0
- )),
- createBasePrivateIdentifierNode: (H) => u(new c(
- H,
- /*pos*/
- 0,
- /*end*/
- 0
- )),
- createBaseTokenNode: (H) => u(new s(
- H,
- /*pos*/
- 0,
- /*end*/
- 0
- )),
- createBaseNode: (H) => u(new i(
- H,
- /*pos*/
- 0,
- /*end*/
- 0
- ))
- }, g = G3(11, d), {
- createNodeArray: h,
- createNumericLiteral: S,
- createStringLiteral: T,
- createLiteralLikeNode: C,
- createIdentifier: D,
- createPrivateIdentifier: P,
- createToken: I,
- createArrayLiteralExpression: F,
- createObjectLiteralExpression: O,
- createPropertyAccessExpression: B,
- createPropertyAccessChain: z,
- createElementAccessExpression: X,
- createElementAccessChain: q,
- createCallExpression: V,
- createCallChain: ae,
- createNewExpression: ee,
- createParenthesizedExpression: G,
- createBlock: ue,
- createVariableStatement: re,
- createExpressionStatement: ne,
- createIfStatement: ie,
- createWhileStatement: Se,
- createForStatement: J,
- createForOfStatement: oe,
- createVariableDeclaration: _e,
- createVariableDeclarationList: he
- } = g, le, me, ve, tt, Te, we, fe, Me, Qe, et, Re, ft, Wt, _r, Ir, jr, Nt = !0, Qt = !1;
- function Br(H, ke, We, gt, Rt = !1, gr, jn, Pi = 0) {
- var ui;
- if (gr = v5(H, gr), gr === 6) {
- const Wi = zn(H, ke, We, gt, Rt);
- return bA(
- Wi,
- (ui = Wi.statements[0]) == null ? void 0 : ui.expression,
- Wi.parseDiagnostics,
- /*returnValue*/
- !1,
- /*jsonConversionNotifier*/
- void 0
- ), Wi.referencedFiles = Ue, Wi.typeReferenceDirectives = Ue, Wi.libReferenceDirectives = Ue, Wi.amdDependencies = Ue, Wi.hasNoDefaultLib = !1, Wi.pragmas = eR, Wi;
- }
- ki(H, ke, We, gt, gr, Pi);
- const _i = ei(We, Rt, gr, jn || Ghe, Pi);
- return rs(), _i;
- }
- e.parseSourceFile = Br;
- function xr(H, ke) {
- ki(
- "",
- H,
- ke,
- /*syntaxCursor*/
- void 0,
- 1,
- 0
- /* ParseAll */
- ), Ie();
- const We = Y(
- /*allowReservedWords*/
- !0
- ), gt = Z() === 1 && !fe.length;
- return rs(), gt ? We : void 0;
- }
- e.parseIsolatedEntityName = xr;
- function zn(H, ke, We = 2, gt, Rt = !1) {
- ki(
- H,
- ke,
- We,
- gt,
- 6,
- 0
- /* ParseAll */
- ), me = jr, Ie();
- const gr = U();
- let jn, Pi;
- if (Z() === 1)
- jn = ba([], gr, gr), Pi = Zc();
- else {
- let Wi;
- for (; Z() !== 1; ) {
- let wa;
- switch (Z()) {
- case 23:
- wa = Ud();
- break;
- case 112:
- case 97:
- case 106:
- wa = Zc();
- break;
- case 41:
- zt(
- () => Ie() === 9 && Ie() !== 59
- /* ColonToken */
- ) ? wa = l1() : wa = zv();
- break;
- case 9:
- case 11:
- if (zt(
- () => Ie() !== 59
- /* ColonToken */
- )) {
- wa = yt();
- break;
- }
- default:
- wa = zv();
- break;
- }
- Wi && us(Wi) ? Wi.push(wa) : Wi ? Wi = [Wi, wa] : (Wi = wa, Z() !== 1 && Zt(p.Unexpected_token));
- }
- const Ka = us(Wi) ? Bt(F(Wi), gr) : E.checkDefined(Wi), eo = ne(Ka);
- Bt(eo, gr), jn = ba([eo], gr), Pi = xs(1, p.Unexpected_token);
- }
- const ui = Ot(
- H,
- 2,
- 6,
- /*isDeclarationFile*/
- !1,
- jn,
- Pi,
- me,
- ja
- );
- Rt && Fe(ui), ui.nodeCount = Re, ui.identifierCount = Wt, ui.identifiers = ft, ui.parseDiagnostics = px(fe, ui), Me && (ui.jsDocDiagnostics = px(Me, ui));
- const _i = ui;
- return rs(), _i;
- }
- e.parseJsonText = zn;
- function ki(H, ke, We, gt, Rt, gr) {
- switch (i = Gl.getNodeConstructor(), s = Gl.getTokenConstructor(), o = Gl.getIdentifierConstructor(), c = Gl.getPrivateIdentifierConstructor(), _ = Gl.getSourceFileConstructor(), le = Os(H), ve = ke, tt = We, Qe = gt, Te = Rt, we = F3(Rt), fe = [], _r = 0, ft = /* @__PURE__ */ new Map(), Wt = 0, Re = 0, me = 0, Nt = !0, Te) {
- case 1:
- case 2:
- jr = 524288;
- break;
- case 6:
- jr = 134742016;
- break;
- default:
- jr = 0;
- break;
- }
- Qt = !1, t.setText(ve), t.setOnError(dt), t.setScriptTarget(tt), t.setLanguageVariant(we), t.setScriptKind(Te), t.setJSDocParsingMode(gr);
- }
- function rs() {
- t.clearCommentDirectives(), t.setText(""), t.setOnError(void 0), t.setScriptKind(
- 0
- /* Unknown */
- ), t.setJSDocParsingMode(
- 0
- /* ParseAll */
- ), ve = void 0, tt = void 0, Qe = void 0, Te = void 0, we = void 0, me = 0, fe = void 0, Me = void 0, _r = 0, ft = void 0, Ir = void 0, Nt = !0;
- }
- function ei(H, ke, We, gt, Rt) {
- const gr = wl(le);
- gr && (jr |= 33554432), me = jr, Ie();
- const jn = ka(0, $f);
- E.assert(
- Z() === 1
- /* EndOfFileToken */
- );
- const Pi = be(), ui = Jr(Zc(), Pi), _i = Ot(le, H, We, gr, jn, ui, me, gt);
- return _z(_i, ve), fz(_i, Wi), _i.commentDirectives = t.getCommentDirectives(), _i.nodeCount = Re, _i.identifierCount = Wt, _i.identifiers = ft, _i.parseDiagnostics = px(fe, _i), _i.jsDocParsingMode = Rt, Me && (_i.jsDocDiagnostics = px(Me, _i)), ke && Fe(_i), _i;
- function Wi(Ka, eo, wa) {
- fe.push(fx(le, ve, Ka, eo, wa));
- }
- }
- let Ri = !1;
- function Jr(H, ke) {
- if (!ke)
- return H;
- E.assert(!H.jsDoc);
- const We = Ai(Zj(H, ve), (gt) => Wa.parseJSDocComment(H, gt.pos, gt.end - gt.pos));
- return We.length && (H.jsDoc = We), Ri && (Ri = !1, H.flags |= 536870912), H;
- }
- function ji(H) {
- const ke = Qe, We = lz.createSyntaxCursor(H);
- Qe = { currentNode: Wi };
- const gt = [], Rt = fe;
- fe = [];
- let gr = 0, jn = ui(H.statements, 0);
- for (; jn !== -1; ) {
- const Ka = H.statements[gr], eo = H.statements[jn];
- Fn(gt, H.statements, gr, jn), gr = _i(H.statements, jn);
- const wa = ac(Rt, (cl) => cl.start >= Ka.pos), xp = wa >= 0 ? ac(Rt, (cl) => cl.start >= eo.pos, wa) : -1;
- wa >= 0 && Fn(fe, Rt, wa, xp >= 0 ? xp : void 0), en(
- () => {
- const cl = jr;
- for (jr |= 65536, t.resetTokenState(eo.pos), Ie(); Z() !== 1; ) {
- const Xf = t.getTokenFullStart(), e0 = Pc(0, $f);
- if (gt.push(e0), Xf === t.getTokenFullStart() && Ie(), gr >= 0) {
- const fh = H.statements[gr];
- if (e0.end === fh.pos)
- break;
- e0.end > fh.pos && (gr = _i(H.statements, gr + 1));
- }
- }
- jr = cl;
- },
- 2
- /* Reparse */
- ), jn = gr >= 0 ? ui(H.statements, gr) : -1;
- }
- if (gr >= 0) {
- const Ka = H.statements[gr];
- Fn(gt, H.statements, gr);
- const eo = ac(Rt, (wa) => wa.start >= Ka.pos);
- eo >= 0 && Fn(fe, Rt, eo);
- }
- return Qe = ke, g.updateSourceFile(H, lt(h(gt), H.statements));
- function Pi(Ka) {
- return !(Ka.flags & 65536) && !!(Ka.transformFlags & 67108864);
- }
- function ui(Ka, eo) {
- for (let wa = eo; wa < Ka.length; wa++)
- if (Pi(Ka[wa]))
- return wa;
- return -1;
- }
- function _i(Ka, eo) {
- for (let wa = eo; wa < Ka.length; wa++)
- if (!Pi(Ka[wa]))
- return wa;
- return -1;
- }
- function Wi(Ka) {
- const eo = We.currentNode(Ka);
- return Nt && eo && Pi(eo) && Ite(eo), eo;
- }
- }
- function Fe(H) {
- Nh(
- H,
- /*incremental*/
- !0
- );
- }
- e.fixupParentReferences = Fe;
- function Ot(H, ke, We, gt, Rt, gr, jn, Pi) {
- let ui = g.createSourceFile(Rt, gr, jn);
- if (fJ(ui, 0, ve.length), _i(ui), !gt && il(ui) && ui.transformFlags & 67108864) {
- const Wi = ui;
- ui = ji(ui), Wi !== ui && _i(ui);
- }
- return ui;
- function _i(Wi) {
- Wi.text = ve, Wi.bindDiagnostics = [], Wi.bindSuggestionDiagnostics = void 0, Wi.languageVersion = ke, Wi.fileName = H, Wi.languageVariant = F3(We), Wi.isDeclarationFile = gt, Wi.scriptKind = We, Pi(Wi), Wi.setExternalModuleIndicator = Pi;
- }
- }
- function Ar(H, ke) {
- H ? jr |= ke : jr &= ~ke;
- }
- function mn(H) {
- Ar(
- H,
- 8192
- /* DisallowInContext */
- );
- }
- function ti(H) {
- Ar(
- H,
- 16384
- /* YieldContext */
- );
- }
- function qn(H) {
- Ar(
- H,
- 32768
- /* DecoratorContext */
- );
- }
- function Oi(H) {
- Ar(
- H,
- 65536
- /* AwaitContext */
- );
- }
- function Ws(H, ke) {
- const We = H & jr;
- if (We) {
- Ar(
- /*val*/
- !1,
- We
- );
- const gt = ke();
- return Ar(
- /*val*/
- !0,
- We
- ), gt;
- }
- return ke();
- }
- function Hs(H, ke) {
- const We = H & ~jr;
- if (We) {
- Ar(
- /*val*/
- !0,
- We
- );
- const gt = ke();
- return Ar(
- /*val*/
- !1,
- We
- ), gt;
- }
- return ke();
- }
- function rr(H) {
- return Ws(8192, H);
- }
- function Ea(H) {
- return Hs(8192, H);
- }
- function Xe(H) {
- return Ws(131072, H);
- }
- function Tt(H) {
- return Hs(131072, H);
- }
- function te(H) {
- return Hs(16384, H);
- }
- function ze(H) {
- return Hs(32768, H);
- }
- function K(H) {
- return Hs(65536, H);
- }
- function De(H) {
- return Ws(65536, H);
- }
- function Ve(H) {
- return Hs(81920, H);
- }
- function Ke(H) {
- return Ws(81920, H);
- }
- function xe(H) {
- return (jr & H) !== 0;
- }
- function at() {
- return xe(
- 16384
- /* YieldContext */
- );
- }
- function $e() {
- return xe(
- 8192
- /* DisallowInContext */
- );
- }
- function bt() {
- return xe(
- 131072
- /* DisallowConditionalTypesContext */
- );
- }
- function He() {
- return xe(
- 32768
- /* DecoratorContext */
- );
- }
- function Vt() {
- return xe(
- 65536
- /* AwaitContext */
- );
- }
- function Zt(H, ...ke) {
- return M(t.getTokenStart(), t.getTokenEnd(), H, ...ke);
- }
- function vn(H, ke, We, ...gt) {
- const Rt = Ro(fe);
- let gr;
- return (!Rt || H !== Rt.start) && (gr = fx(le, ve, H, ke, We, ...gt), fe.push(gr)), Qt = !0, gr;
- }
- function M(H, ke, We, ...gt) {
- return vn(H, ke - H, We, ...gt);
- }
- function Ae(H, ke, ...We) {
- M(H.pos, H.end, ke, ...We);
- }
- function dt(H, ke, We) {
- vn(t.getTokenEnd(), ke, H, We);
- }
- function U() {
- return t.getTokenFullStart();
- }
- function be() {
- return t.hasPrecedingJSDocComment();
- }
- function Z() {
- return et;
- }
- function ht() {
- return et = t.scan();
- }
- function Le(H) {
- return Ie(), H();
- }
- function Ie() {
- return p_(et) && (t.hasUnicodeEscape() || t.hasExtendedUnicodeEscape()) && M(t.getTokenStart(), t.getTokenEnd(), p.Keywords_cannot_contain_escape_characters), ht();
- }
- function At() {
- return et = t.scanJsDocToken();
- }
- function Dr(H) {
- return et = t.scanJSDocCommentTextToken(H);
- }
- function yr() {
- return et = t.reScanGreaterToken();
- }
- function $r() {
- return et = t.reScanSlashToken();
- }
- function nt(H) {
- return et = t.reScanTemplateToken(H);
- }
- function ot() {
- return et = t.reScanLessThanToken();
- }
- function wt() {
- return et = t.reScanHashToken();
- }
- function jt() {
- return et = t.scanJsxIdentifier();
- }
- function Xt() {
- return et = t.scanJsxToken();
- }
- function Ht() {
- return et = t.scanJsxAttributeValue();
- }
- function en(H, ke) {
- const We = et, gt = fe.length, Rt = Qt, gr = jr, jn = ke !== 0 ? t.lookAhead(H) : t.tryScan(H);
- return E.assert(gr === jr), (!jn || ke !== 0) && (et = We, ke !== 2 && (fe.length = gt), Qt = Rt), jn;
- }
- function zt(H) {
- return en(
- H,
- 1
- /* Lookahead */
- );
- }
- function mr(H) {
- return en(
- H,
- 0
- /* TryParse */
- );
- }
- function Kt() {
- return Z() === 80 ? !0 : Z() > 118;
- }
- function hr() {
- return Z() === 80 ? !0 : Z() === 127 && at() || Z() === 135 && Vt() ? !1 : Z() > 118;
- }
- function Ft(H, ke, We = !0) {
- return Z() === H ? (We && Ie(), !0) : (ke ? Zt(ke) : Zt(p._0_expected, qs(H)), !1);
- }
- const Ss = Object.keys(wI).filter((H) => H.length > 2);
- function gs(H) {
- if (lv(H)) {
- M(aa(ve, H.template.pos), H.template.end, p.Module_declaration_names_may_only_use_or_quoted_strings);
- return;
- }
- const ke = Oe(H) ? Nn(H) : void 0;
- if (!ke || !k_(ke, tt)) {
- Zt(p._0_expected, qs(
- 27
- /* SemicolonToken */
- ));
- return;
- }
- const We = aa(ve, H.pos);
- switch (ke) {
- case "const":
- case "let":
- case "var":
- M(We, H.end, p.Variable_declaration_not_allowed_at_this_location);
- return;
- case "declare":
- return;
- case "interface":
- Ts(
- p.Interface_name_cannot_be_0,
- p.Interface_must_be_given_a_name,
- 19
- /* OpenBraceToken */
- );
- return;
- case "is":
- M(We, t.getTokenStart(), p.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
- return;
- case "module":
- case "namespace":
- Ts(
- p.Namespace_name_cannot_be_0,
- p.Namespace_must_be_given_a_name,
- 19
- /* OpenBraceToken */
- );
- return;
- case "type":
- Ts(
- p.Type_alias_name_cannot_be_0,
- p.Type_alias_must_be_given_a_name,
- 64
- /* EqualsToken */
- );
- return;
- }
- const gt = _b(ke, Ss, go) ?? Ua(ke);
- if (gt) {
- M(We, H.end, p.Unknown_keyword_or_identifier_Did_you_mean_0, gt);
- return;
- }
- Z() !== 0 && M(We, H.end, p.Unexpected_keyword_or_identifier);
- }
- function Ts(H, ke, We) {
- Z() === We ? Zt(ke) : Zt(H, t.getTokenValue());
- }
- function Ua(H) {
- for (const ke of Ss)
- if (H.length > ke.length + 2 && Ui(H, ke))
- return `${ke} ${H.slice(ke.length)}`;
- }
- function lc(H, ke, We) {
- if (Z() === 60 && !t.hasPrecedingLineBreak()) {
- Zt(p.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);
- return;
- }
- if (Z() === 21) {
- Zt(p.Cannot_start_a_function_call_in_a_type_annotation), Ie();
- return;
- }
- if (ke && !Na()) {
- We ? Zt(p._0_expected, qs(
- 27
- /* SemicolonToken */
- )) : Zt(p.Expected_for_property_initializer);
- return;
- }
- if (!Ia()) {
- if (We) {
- Zt(p._0_expected, qs(
- 27
- /* SemicolonToken */
- ));
- return;
- }
- gs(H);
- }
- }
- function Ic(H) {
- return Z() === H ? (At(), !0) : (E.assert(F7(H)), Zt(p._0_expected, qs(H)), !1);
- }
- function io(H, ke, We, gt) {
- if (Z() === ke) {
- Ie();
- return;
- }
- const Rt = Zt(p._0_expected, qs(ke));
- We && Rt && Rs(
- Rt,
- fx(le, ve, gt, 1, p.The_parser_expected_to_find_a_1_to_match_the_0_token_here, qs(H), qs(ke))
- );
- }
- function vi(H) {
- return Z() === H ? (Ie(), !0) : !1;
- }
- function ca(H) {
- if (Z() === H)
- return Zc();
- }
- function Ll(H) {
- if (Z() === H)
- return Yi();
- }
- function xs(H, ke, We) {
- return ca(H) || to(
- H,
- /*reportAtCurrentPosition*/
- !1,
- ke || p._0_expected,
- We || qs(H)
- );
- }
- function Cu(H) {
- const ke = Ll(H);
- return ke || (E.assert(F7(H)), to(
- H,
- /*reportAtCurrentPosition*/
- !1,
- p._0_expected,
- qs(H)
- ));
- }
- function Zc() {
- const H = U(), ke = Z();
- return Ie(), Bt(I(ke), H);
- }
- function Yi() {
- const H = U(), ke = Z();
- return At(), Bt(I(ke), H);
- }
- function Na() {
- return Z() === 27 ? !0 : Z() === 20 || Z() === 1 || t.hasPrecedingLineBreak();
- }
- function Ia() {
- return Na() ? (Z() === 27 && Ie(), !0) : !1;
- }
- function Vi() {
- return Ia() || Ft(
- 27
- /* SemicolonToken */
- );
- }
- function ba(H, ke, We, gt) {
- const Rt = h(H, gt);
- return wd(Rt, ke, We ?? t.getTokenFullStart()), Rt;
- }
- function Bt(H, ke, We) {
- return wd(H, ke, We ?? t.getTokenFullStart()), jr && (H.flags |= jr), Qt && (Qt = !1, H.flags |= 262144), H;
- }
- function to(H, ke, We, ...gt) {
- ke ? vn(t.getTokenFullStart(), 0, We, ...gt) : We && Zt(We, ...gt);
- const Rt = U(), gr = H === 80 ? D(
- "",
- /*originalKeywordKind*/
- void 0
- ) : Dy(H) ? g.createTemplateLiteralLikeNode(
- H,
- "",
- "",
- /*templateFlags*/
- void 0
- ) : H === 9 ? S(
- "",
- /*numericLiteralFlags*/
- void 0
- ) : H === 11 ? T(
- "",
- /*isSingleQuote*/
- void 0
- ) : H === 282 ? g.createMissingDeclaration() : I(H);
- return Bt(gr, Rt);
- }
- function _u(H) {
- let ke = ft.get(H);
- return ke === void 0 && ft.set(H, ke = H), ke;
- }
- function Wc(H, ke, We) {
- if (H) {
- Wt++;
- const Pi = t.hasPrecedingJSDocLeadingAsterisks() ? t.getTokenStart() : U(), ui = Z(), _i = _u(t.getTokenValue()), Wi = t.hasExtendedUnicodeEscape();
- return ht(), Bt(D(_i, ui, Wi), Pi);
- }
- if (Z() === 81)
- return Zt(We || p.Private_identifiers_are_not_allowed_outside_class_bodies), Wc(
- /*isIdentifier*/
- !0
- );
- if (Z() === 0 && t.tryScan(
- () => t.reScanInvalidIdentifier() === 80
- /* Identifier */
- ))
- return Wc(
- /*isIdentifier*/
- !0
- );
- Wt++;
- const gt = Z() === 1, Rt = t.isReservedWord(), gr = t.getTokenText(), jn = Rt ? p.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here : p.Identifier_expected;
- return to(80, gt, ke || jn, gr);
- }
- function of(H) {
- return Wc(
- Kt(),
- /*diagnosticMessage*/
- void 0,
- H
- );
- }
- function Ao(H, ke) {
- return Wc(hr(), H, ke);
- }
- function ge(H) {
- return Wc(c_(Z()), H);
- }
- function $() {
- return (t.hasUnicodeEscape() || t.hasExtendedUnicodeEscape()) && Zt(p.Unicode_escape_sequence_cannot_appear_here), Wc(c_(Z()));
- }
- function rt() {
- return c_(Z()) || Z() === 11 || Z() === 9 || Z() === 10;
- }
- function Ct() {
- return c_(Z()) || Z() === 11;
- }
- function $t(H) {
- if (Z() === 11 || Z() === 9 || Z() === 10) {
- const ke = yt();
- return ke.text = _u(ke.text), ke;
- }
- return Z() === 23 ? $n() : Z() === 81 ? ar() : ge();
- }
- function zr() {
- return $t();
- }
- function $n() {
- const H = U();
- Ft(
- 23
- /* OpenBracketToken */
- );
- const ke = rr(fu);
- return Ft(
- 24
- /* CloseBracketToken */
- ), Bt(g.createComputedPropertyName(ke), H);
- }
- function ar() {
- const H = U(), ke = P(_u(t.getTokenValue()));
- return Ie(), Bt(ke, H);
- }
- function An(H) {
- return Z() === H && mr(Fi);
- }
- function ri() {
- return Ie(), t.hasPrecedingLineBreak() ? !1 : Oc();
- }
- function Fi() {
- switch (Z()) {
- case 87:
- return Ie() === 94;
- case 95:
- return Ie(), Z() === 90 ? zt(Fc) : Z() === 156 ? zt(Uo) : za();
- case 90:
- return Fc();
- case 126:
- case 139:
- case 153:
- return Ie(), Oc();
- default:
- return ri();
- }
- }
- function za() {
- return Z() === 60 || Z() !== 42 && Z() !== 130 && Z() !== 19 && Oc();
- }
- function Uo() {
- return Ie(), za();
- }
- function vc() {
- return wy(Z()) && mr(Fi);
- }
- function Oc() {
- return Z() === 23 || Z() === 19 || Z() === 42 || Z() === 26 || rt();
- }
- function Fc() {
- return Ie(), Z() === 86 || Z() === 100 || Z() === 120 || Z() === 60 || Z() === 128 && zt(gP) || Z() === 134 && zt(Yo);
- }
- function Lo(H, ke) {
- if (yl(H))
- return !0;
- switch (H) {
- case 0:
- case 1:
- case 3:
- return !(Z() === 27 && ke) && KS();
- case 2:
- return Z() === 84 || Z() === 90;
- case 4:
- return zt(Ne);
- case 5:
- return zt(rT) || Z() === 27 && !ke;
- case 6:
- return Z() === 23 || rt();
- case 12:
- switch (Z()) {
- case 23:
- case 42:
- case 26:
- case 25:
- return !0;
- default:
- return rt();
- }
- case 18:
- return rt();
- case 9:
- return Z() === 23 || Z() === 26 || rt();
- case 24:
- return Ct();
- case 7:
- return Z() === 19 ? zt(_c) : ke ? hr() && !hp() : V0() && !hp();
- case 8:
- return Tn();
- case 10:
- return Z() === 28 || Z() === 26 || Tn();
- case 19:
- return Z() === 103 || Z() === 87 || hr();
- case 15:
- switch (Z()) {
- case 28:
- case 25:
- return !0;
- }
- case 11:
- return Z() === 26 || gg();
- case 16:
- return Bd(
- /*isJSDocParameter*/
- !1
- );
- case 17:
- return Bd(
- /*isJSDocParameter*/
- !0
- );
- case 20:
- case 21:
- return Z() === 28 || md();
- case 22:
- return b2();
- case 23:
- return Z() === 161 && zt(tT) ? !1 : Z() === 11 ? !0 : c_(Z());
- case 13:
- return c_(Z()) || Z() === 19;
- case 14:
- return !0;
- case 25:
- return !0;
- case 26:
- return E.fail("ParsingContext.Count used as a context");
- default:
- E.assertNever(H, "Non-exhaustive case in 'isListElement'.");
- }
- }
- function _c() {
- if (E.assert(
- Z() === 19
- /* OpenBraceToken */
- ), Ie() === 20) {
- const H = Ie();
- return H === 28 || H === 19 || H === 96 || H === 119;
- }
- return !0;
- }
- function Wf() {
- return Ie(), hr();
- }
- function Lc() {
- return Ie(), c_(Z());
- }
- function al() {
- return Ie(), QQ(Z());
- }
- function hp() {
- return Z() === 119 || Z() === 96 ? zt(Pe) : !1;
- }
- function Pe() {
- return Ie(), gg();
- }
- function Et() {
- return Ie(), md();
- }
- function Lr(H) {
- if (Z() === 1)
- return !0;
- switch (H) {
- case 1:
- case 2:
- case 4:
- case 5:
- case 6:
- case 12:
- case 9:
- case 23:
- case 24:
- return Z() === 20;
- case 3:
- return Z() === 20 || Z() === 84 || Z() === 90;
- case 7:
- return Z() === 19 || Z() === 96 || Z() === 119;
- case 8:
- return $i();
- case 19:
- return Z() === 32 || Z() === 21 || Z() === 19 || Z() === 96 || Z() === 119;
- case 11:
- return Z() === 22 || Z() === 27;
- case 15:
- case 21:
- case 10:
- return Z() === 24;
- case 17:
- case 16:
- case 18:
- return Z() === 22 || Z() === 24;
- case 20:
- return Z() !== 28;
- case 22:
- return Z() === 19 || Z() === 20;
- case 13:
- return Z() === 32 || Z() === 44;
- case 14:
- return Z() === 30 && zt(Hr);
- default:
- return !1;
- }
- }
- function $i() {
- return !!(Na() || jv(Z()) || Z() === 39);
- }
- function Sa() {
- E.assert(_r, "Missing parsing context");
- for (let H = 0; H < 26; H++)
- if (_r & 1 << H && (Lo(
- H,
- /*inErrorRecovery*/
- !0
- ) || Lr(H)))
- return !0;
- return !1;
- }
- function ka(H, ke) {
- const We = _r;
- _r |= 1 << H;
- const gt = [], Rt = U();
- for (; !Lr(H); ) {
- if (Lo(
- H,
- /*inErrorRecovery*/
- !1
- )) {
- gt.push(Pc(H, ke));
- continue;
- }
- if (Qp(H))
- break;
- }
- return _r = We, ba(gt, Rt);
- }
- function Pc(H, ke) {
- const We = yl(H);
- return We ? so(We) : ke();
- }
- function yl(H, ke) {
- var We;
- if (!Qe || !Va(H) || Qt)
- return;
- const gt = Qe.currentNode(ke ?? t.getTokenFullStart());
- if (!(rc(gt) || M9e(gt) || GT(gt) || (gt.flags & 101441536) !== jr) && Uc(gt, H))
- return p3(gt) && ((We = gt.jsDoc) != null && We.jsDocCache) && (gt.jsDoc.jsDocCache = void 0), gt;
- }
- function so(H) {
- return t.resetTokenState(H.end), Ie(), H;
- }
- function Va(H) {
- switch (H) {
- case 5:
- case 2:
- case 0:
- case 1:
- case 3:
- case 6:
- case 4:
- case 8:
- case 17:
- case 16:
- return !0;
- }
- return !1;
- }
- function Uc(H, ke) {
- switch (ke) {
- case 5:
- return cf(H);
- case 2:
- return Xp(H);
- case 0:
- case 1:
- case 3:
- return A_(H);
- case 6:
- return Sf(H);
- case 4:
- return Uf(H);
- case 8:
- return yp(H);
- case 17:
- case 16:
- return Yg(H);
- }
- return !1;
- }
- function cf(H) {
- if (H)
- switch (H.kind) {
- case 176:
- case 181:
- case 177:
- case 178:
- case 172:
- case 240:
- return !0;
- case 174:
- const ke = H;
- return !(ke.name.kind === 80 && ke.name.escapedText === "constructor");
- }
- return !1;
- }
- function Xp(H) {
- if (H)
- switch (H.kind) {
- case 296:
- case 297:
- return !0;
- }
- return !1;
- }
- function A_(H) {
- if (H)
- switch (H.kind) {
- case 262:
- case 243:
- case 241:
- case 245:
- case 244:
- case 257:
- case 253:
- case 255:
- case 252:
- case 251:
- case 249:
- case 250:
- case 248:
- case 247:
- case 254:
- case 242:
- case 258:
- case 256:
- case 246:
- case 259:
- case 272:
- case 271:
- case 278:
- case 277:
- case 267:
- case 263:
- case 264:
- case 266:
- case 265:
- return !0;
- }
- return !1;
- }
- function Sf(H) {
- return H.kind === 306;
- }
- function Uf(H) {
- if (H)
- switch (H.kind) {
- case 180:
- case 173:
- case 181:
- case 171:
- case 179:
- return !0;
- }
- return !1;
- }
- function yp(H) {
- return H.kind !== 260 ? !1 : H.initializer === void 0;
- }
- function Yg(H) {
- return H.kind !== 169 ? !1 : H.initializer === void 0;
- }
- function Qp(H) {
- return y_(H), Sa() ? !0 : (Ie(), !1);
- }
- function y_(H) {
- switch (H) {
- case 0:
- return Z() === 90 ? Zt(p._0_expected, qs(
- 95
- /* ExportKeyword */
- )) : Zt(p.Declaration_or_statement_expected);
- case 1:
- return Zt(p.Declaration_or_statement_expected);
- case 2:
- return Zt(p.case_or_default_expected);
- case 3:
- return Zt(p.Statement_expected);
- case 18:
- case 4:
- return Zt(p.Property_or_signature_expected);
- case 5:
- return Zt(p.Unexpected_token_A_constructor_method_accessor_or_property_was_expected);
- case 6:
- return Zt(p.Enum_member_expected);
- case 7:
- return Zt(p.Expression_expected);
- case 8:
- return p_(Z()) ? Zt(p._0_is_not_allowed_as_a_variable_declaration_name, qs(Z())) : Zt(p.Variable_declaration_expected);
- case 9:
- return Zt(p.Property_destructuring_pattern_expected);
- case 10:
- return Zt(p.Array_element_destructuring_pattern_expected);
- case 11:
- return Zt(p.Argument_expression_expected);
- case 12:
- return Zt(p.Property_assignment_expected);
- case 15:
- return Zt(p.Expression_or_comma_expected);
- case 17:
- return Zt(p.Parameter_declaration_expected);
- case 16:
- return p_(Z()) ? Zt(p._0_is_not_allowed_as_a_parameter_name, qs(Z())) : Zt(p.Parameter_declaration_expected);
- case 19:
- return Zt(p.Type_parameter_declaration_expected);
- case 20:
- return Zt(p.Type_argument_expected);
- case 21:
- return Zt(p.Type_expected);
- case 22:
- return Zt(p.Unexpected_token_expected);
- case 23:
- return Z() === 161 ? Zt(p._0_expected, "}") : Zt(p.Identifier_expected);
- case 13:
- return Zt(p.Identifier_expected);
- case 14:
- return Zt(p.Identifier_expected);
- case 24:
- return Zt(p.Identifier_or_string_literal_expected);
- case 25:
- return Zt(p.Identifier_expected);
- case 26:
- return E.fail("ParsingContext.Count used as a context");
- default:
- E.assertNever(H);
- }
- }
- function vl(H, ke, We) {
- const gt = _r;
- _r |= 1 << H;
- const Rt = [], gr = U();
- let jn = -1;
- for (; ; ) {
- if (Lo(
- H,
- /*inErrorRecovery*/
- !1
- )) {
- const Pi = t.getTokenFullStart(), ui = Pc(H, ke);
- if (!ui) {
- _r = gt;
- return;
- }
- if (Rt.push(ui), jn = t.getTokenStart(), vi(
- 28
- /* CommaToken */
- ))
- continue;
- if (jn = -1, Lr(H))
- break;
- Ft(28, Uh(H)), We && Z() === 27 && !t.hasPrecedingLineBreak() && Ie(), Pi === t.getTokenFullStart() && Ie();
- continue;
- }
- if (Lr(H) || Qp(H))
- break;
- }
- return _r = gt, ba(
- Rt,
- gr,
- /*end*/
- void 0,
- jn >= 0
- );
- }
- function Uh(H) {
- return H === 6 ? p.An_enum_member_name_must_be_followed_by_a_or : void 0;
- }
- function r_() {
- const H = ba([], U());
- return H.isMissingList = !0, H;
- }
- function Zg(H) {
- return !!H.isMissingList;
- }
- function Vf(H, ke, We, gt) {
- if (Ft(We)) {
- const Rt = vl(H, ke);
- return Ft(gt), Rt;
- }
- return r_();
- }
- function Y(H, ke) {
- const We = U();
- let gt = H ? ge(ke) : Ao(ke);
- for (; vi(
- 25
- /* DotToken */
- ) && Z() !== 30; )
- gt = Bt(
- g.createQualifiedName(
- gt,
- It(
- H,
- /*allowPrivateIdentifiers*/
- !1,
- /*allowUnicodeEscapeSequenceInIdentifierName*/
- !0
- )
- ),
- We
- );
- return gt;
- }
- function st(H, ke) {
- return Bt(g.createQualifiedName(H, ke), H.pos);
- }
- function It(H, ke, We) {
- if (t.hasPrecedingLineBreak() && c_(Z()) && zt(ZS))
- return to(
- 80,
- /*reportAtCurrentPosition*/
- !0,
- p.Identifier_expected
- );
- if (Z() === 81) {
- const gt = ar();
- return ke ? gt : to(
- 80,
- /*reportAtCurrentPosition*/
- !0,
- p.Identifier_expected
- );
- }
- return H ? We ? ge() : $() : Ao();
- }
- function Mt(H) {
- const ke = U(), We = [];
- let gt;
- do
- gt = Ce(H), We.push(gt);
- while (gt.literal.kind === 17);
- return ba(We, ke);
- }
- function Sr(H) {
- const ke = U();
- return Bt(
- g.createTemplateExpression(
- Mr(H),
- Mt(H)
- ),
- ke
- );
- }
- function Vr() {
- const H = U();
- return Bt(
- g.createTemplateLiteralType(
- Mr(
- /*isTaggedTemplate*/
- !1
- ),
- En()
- ),
- H
- );
- }
- function En() {
- const H = U(), ke = [];
- let We;
- do
- We = si(), ke.push(We);
- while (We.literal.kind === 17);
- return ba(ke, H);
- }
- function si() {
- const H = U();
- return Bt(
- g.createTemplateLiteralTypeSpan(
- xl(),
- L(
- /*isTaggedTemplate*/
- !1
- )
- ),
- H
- );
- }
- function L(H) {
- return Z() === 20 ? (nt(H), hi()) : xs(18, p._0_expected, qs(
- 20
- /* CloseBraceToken */
- ));
- }
- function Ce(H) {
- const ke = U();
- return Bt(
- g.createTemplateSpan(
- rr(fu),
- L(H)
- ),
- ke
- );
- }
- function yt() {
- return ns(Z());
- }
- function Mr(H) {
- !H && t.getTokenFlags() & 26656 && nt(
- /*isTaggedTemplate*/
- !1
- );
- const ke = ns(Z());
- return E.assert(ke.kind === 16, "Template head has wrong token kind"), ke;
- }
- function hi() {
- const H = ns(Z());
- return E.assert(H.kind === 17 || H.kind === 18, "Template fragment has wrong token kind"), H;
- }
- function Es(H) {
- const ke = H === 15 || H === 18, We = t.getTokenText();
- return We.substring(1, We.length - (t.isUnterminated() ? 0 : ke ? 1 : 2));
- }
- function ns(H) {
- const ke = U(), We = Dy(H) ? g.createTemplateLiteralLikeNode(
- H,
- t.getTokenValue(),
- Es(H),
- t.getTokenFlags() & 7176
- /* TemplateLiteralLikeFlags */
- ) : (
- // Note that theoretically the following condition would hold true literals like 009,
- // which is not octal. But because of how the scanner separates the tokens, we would
- // never get a token like this. Instead, we would get 00 and 9 as two separate tokens.
- // We also do not need to check for negatives because any prefix operator would be part of a
- // parent unary expression.
- H === 9 ? S(t.getTokenValue(), t.getNumericLiteralFlags()) : H === 11 ? T(
- t.getTokenValue(),
- /*isSingleQuote*/
- void 0,
- t.hasExtendedUnicodeEscape()
- ) : n4(H) ? C(H, t.getTokenValue()) : E.fail()
- );
- return t.hasExtendedUnicodeEscape() && (We.hasExtendedUnicodeEscape = !0), t.isUnterminated() && (We.isUnterminated = !0), Ie(), Bt(We, ke);
- }
- function Ds() {
- return Y(
- /*allowReservedWords*/
- !0,
- p.Type_expected
- );
- }
- function Pa() {
- if (!t.hasPrecedingLineBreak() && ot() === 30)
- return Vf(
- 20,
- xl,
- 30,
- 32
- /* GreaterThanToken */
- );
- }
- function ga() {
- const H = U();
- return Bt(
- g.createTypeReferenceNode(
- Ds(),
- Pa()
- ),
- H
- );
- }
- function $o(H) {
- switch (H.kind) {
- case 183:
- return rc(H.typeName);
- case 184:
- case 185: {
- const { parameters: ke, type: We } = H;
- return Zg(ke) || $o(We);
- }
- case 196:
- return $o(H.type);
- default:
- return !1;
- }
- }
- function vp(H) {
- return Ie(), Bt(g.createTypePredicateNode(
- /*assertsModifier*/
- void 0,
- H,
- xl()
- ), H.pos);
- }
- function dd() {
- const H = U();
- return Ie(), Bt(g.createThisTypeNode(), H);
- }
- function jd() {
- const H = U();
- return Ie(), Bt(g.createJSDocAllType(), H);
- }
- function Kg() {
- const H = U();
- return Ie(), Bt(g.createJSDocNonNullableType(
- W0(),
- /*postfix*/
- !1
- ), H);
- }
- function J0() {
- const H = U();
- return Ie(), Z() === 28 || Z() === 20 || Z() === 22 || Z() === 32 || Z() === 64 || Z() === 52 ? Bt(g.createJSDocUnknownType(), H) : Bt(g.createJSDocNullableType(
- xl(),
- /*postfix*/
- !1
- ), H);
- }
- function eh() {
- const H = U(), ke = be();
- if (mr(Ji)) {
- const We = Kp(
- 36
- /* JSDoc */
- ), gt = Zp(
- 59,
- /*isType*/
- !1
- );
- return Jr(Bt(g.createJSDocFunctionType(We, gt), H), ke);
- }
- return Bt(g.createTypeReferenceNode(
- ge(),
- /*typeArguments*/
- void 0
- ), H);
- }
- function bp() {
- const H = U();
- let ke;
- return (Z() === 110 || Z() === 105) && (ke = ge(), Ft(
- 59
- /* ColonToken */
- )), Bt(
- g.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- // TODO(rbuckton): JSDoc parameters don't have names (except `this`/`new`), should we manufacture an empty identifier?
- ke,
- /*questionToken*/
- void 0,
- Sp(),
- /*initializer*/
- void 0
- ),
- H
- );
- }
- function Sp() {
- t.setSkipJsDocLeadingAsterisks(!0);
- const H = U();
- if (vi(
- 144
- /* ModuleKeyword */
- )) {
- const gt = g.createJSDocNamepathType(
- /*type*/
- void 0
- );
- e:
- for (; ; )
- switch (Z()) {
- case 20:
- case 1:
- case 28:
- case 5:
- break e;
- default:
- At();
- }
- return t.setSkipJsDocLeadingAsterisks(!1), Bt(gt, H);
- }
- const ke = vi(
- 26
- /* DotDotDotToken */
- );
- let We = I_();
- return t.setSkipJsDocLeadingAsterisks(!1), ke && (We = Bt(g.createJSDocVariadicType(We), H)), Z() === 64 ? (Ie(), Bt(g.createJSDocOptionalType(We), H)) : We;
- }
- function Mo() {
- const H = U();
- Ft(
- 114
- /* TypeOfKeyword */
- );
- const ke = Y(
- /*allowReservedWords*/
- !0
- ), We = t.hasPrecedingLineBreak() ? void 0 : Vv();
- return Bt(g.createTypeQueryNode(ke, We), H);
- }
- function Tf() {
- const H = U(), ke = Yt(
- /*allowDecorators*/
- !1,
- /*permitConstAsModifier*/
- !0
- ), We = Ao();
- let gt, Rt;
- vi(
- 96
- /* ExtendsKeyword */
- ) && (md() || !gg() ? gt = xl() : Rt = Al());
- const gr = vi(
- 64
- /* EqualsToken */
- ) ? xl() : void 0, jn = g.createTypeParameterDeclaration(ke, We, gt, gr);
- return jn.expression = Rt, Bt(jn, H);
- }
- function N_() {
- if (Z() === 30)
- return Vf(
- 19,
- Tf,
- 30,
- 32
- /* GreaterThanToken */
- );
- }
- function Bd(H) {
- return Z() === 26 || Tn() || wy(Z()) || Z() === 60 || md(
- /*inStartOfParameter*/
- !H
- );
- }
- function th(H) {
- const ke = i_(p.Private_identifiers_cannot_be_used_as_parameters);
- return Rw(ke) === 0 && !ut(H) && wy(Z()) && Ie(), ke;
- }
- function Yp() {
- return Kt() || Z() === 23 || Z() === 19;
- }
- function dg(H) {
- return z0(H);
- }
- function Vh(H) {
- return z0(
- H,
- /*allowAmbiguity*/
- !1
- );
- }
- function z0(H, ke = !0) {
- const We = U(), gt = be(), Rt = H ? K(() => Yt(
- /*allowDecorators*/
- !0
- )) : De(() => Yt(
- /*allowDecorators*/
- !0
- ));
- if (Z() === 110) {
- const ui = g.createParameterDeclaration(
- Rt,
- /*dotDotDotToken*/
- void 0,
- Wc(
- /*isIdentifier*/
- !0
- ),
- /*questionToken*/
- void 0,
- Jd(),
- /*initializer*/
- void 0
- ), _i = el(Rt);
- return _i && Ae(_i, p.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters), Jr(Bt(ui, We), gt);
- }
- const gr = Nt;
- Nt = !1;
- const jn = ca(
- 26
- /* DotDotDotToken */
- );
- if (!ke && !Yp())
- return;
- const Pi = Jr(
- Bt(
- g.createParameterDeclaration(
- Rt,
- jn,
- th(Rt),
- ca(
- 58
- /* QuestionToken */
- ),
- Jd(),
- Gh()
- ),
- We
- ),
- gt
- );
- return Nt = gr, Pi;
- }
- function Zp(H, ke) {
- if (Nv(H, ke))
- return Xe(I_);
- }
- function Nv(H, ke) {
- return H === 39 ? (Ft(H), !0) : vi(
- 59
- /* ColonToken */
- ) ? !0 : ke && Z() === 39 ? (Zt(p._0_expected, qs(
- 59
- /* ColonToken */
- )), Ie(), !0) : !1;
- }
- function qf(H, ke) {
- const We = at(), gt = Vt();
- ti(!!(H & 1)), Oi(!!(H & 2));
- const Rt = H & 32 ? vl(17, bp) : vl(16, () => ke ? dg(gt) : Vh(gt));
- return ti(We), Oi(gt), Rt;
- }
- function Kp(H) {
- if (!Ft(
- 21
- /* OpenParenToken */
- ))
- return r_();
- const ke = qf(
- H,
- /*allowAmbiguity*/
- !0
- );
- return Ft(
- 22
- /* CloseParenToken */
- ), ke;
- }
- function qh() {
- vi(
- 28
- /* CommaToken */
- ) || Vi();
- }
- function Iv(H) {
- const ke = U(), We = be();
- H === 180 && Ft(
- 105
- /* NewKeyword */
- );
- const gt = N_(), Rt = Kp(
- 4
- /* Type */
- ), gr = Zp(
- 59,
- /*isType*/
- !0
- );
- qh();
- const jn = H === 179 ? g.createCallSignature(gt, Rt, gr) : g.createConstructSignature(gt, Rt, gr);
- return Jr(Bt(jn, ke), We);
- }
- function mg() {
- return Z() === 23 && zt(rh);
- }
- function rh() {
- if (Ie(), Z() === 26 || Z() === 24)
- return !0;
- if (wy(Z())) {
- if (Ie(), hr())
- return !0;
- } else if (hr())
- Ie();
- else
- return !1;
- return Z() === 59 || Z() === 28 ? !0 : Z() !== 58 ? !1 : (Ie(), Z() === 59 || Z() === 28 || Z() === 24);
- }
- function Ov(H, ke, We) {
- const gt = Vf(
- 16,
- () => dg(
- /*inOuterAwaitContext*/
- !1
- ),
- 23,
- 24
- /* CloseBracketToken */
- ), Rt = Jd();
- qh();
- const gr = g.createIndexSignature(We, gt, Rt);
- return Jr(Bt(gr, H), ke);
- }
- function n1(H, ke, We) {
- const gt = zr(), Rt = ca(
- 58
- /* QuestionToken */
- );
- let gr;
- if (Z() === 21 || Z() === 30) {
- const jn = N_(), Pi = Kp(
- 4
- /* Type */
- ), ui = Zp(
- 59,
- /*isType*/
- !0
- );
- gr = g.createMethodSignature(We, gt, Rt, jn, Pi, ui);
- } else {
- const jn = Jd();
- gr = g.createPropertySignature(We, gt, Rt, jn), Z() === 64 && (gr.initializer = Gh());
- }
- return qh(), Jr(Bt(gr, H), ke);
- }
- function Ne() {
- if (Z() === 21 || Z() === 30 || Z() === 139 || Z() === 153)
- return !0;
- let H = !1;
- for (; wy(Z()); )
- H = !0, Ie();
- return Z() === 23 ? !0 : (rt() && (H = !0, Ie()), H ? Z() === 21 || Z() === 30 || Z() === 58 || Z() === 59 || Z() === 28 || Na() : !1);
- }
- function qe() {
- if (Z() === 21 || Z() === 30)
- return Iv(
- 179
- /* CallSignature */
- );
- if (Z() === 105 && zt(vt))
- return Iv(
- 180
- /* ConstructSignature */
- );
- const H = U(), ke = be(), We = Yt(
- /*allowDecorators*/
- !1
- );
- return An(
- 139
- /* GetKeyword */
- ) ? id(
- H,
- ke,
- We,
- 177,
- 4
- /* Type */
- ) : An(
- 153
- /* SetKeyword */
- ) ? id(
- H,
- ke,
- We,
- 178,
- 4
- /* Type */
- ) : mg() ? Ov(H, ke, We) : n1(H, ke, We);
- }
- function vt() {
- return Ie(), Z() === 21 || Z() === 30;
- }
- function qt() {
- return Ie() === 25;
- }
- function fr() {
- switch (Ie()) {
- case 21:
- case 30:
- case 25:
- return !0;
- }
- return !1;
- }
- function qr() {
- const H = U();
- return Bt(g.createTypeLiteralNode(kr()), H);
- }
- function kr() {
- let H;
- return Ft(
- 19
- /* OpenBraceToken */
- ) ? (H = ka(4, qe), Ft(
- 20
- /* CloseBraceToken */
- )) : H = r_(), H;
- }
- function Dn() {
- return Ie(), Z() === 40 || Z() === 41 ? Ie() === 148 : (Z() === 148 && Ie(), Z() === 23 && Wf() && Ie() === 103);
- }
- function di() {
- const H = U(), ke = ge();
- Ft(
- 103
- /* InKeyword */
- );
- const We = xl();
- return Bt(g.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- ke,
- We,
- /*defaultType*/
- void 0
- ), H);
- }
- function _n() {
- const H = U();
- Ft(
- 19
- /* OpenBraceToken */
- );
- let ke;
- (Z() === 148 || Z() === 40 || Z() === 41) && (ke = Zc(), ke.kind !== 148 && Ft(
- 148
- /* ReadonlyKeyword */
- )), Ft(
- 23
- /* OpenBracketToken */
- );
- const We = di(), gt = vi(
- 130
- /* AsKeyword */
- ) ? xl() : void 0;
- Ft(
- 24
- /* CloseBracketToken */
- );
- let Rt;
- (Z() === 58 || Z() === 40 || Z() === 41) && (Rt = Zc(), Rt.kind !== 58 && Ft(
- 58
- /* QuestionToken */
- ));
- const gr = Jd();
- Vi();
- const jn = ka(4, qe);
- return Ft(
- 20
- /* CloseBraceToken */
- ), Bt(g.createMappedTypeNode(ke, We, gt, Rt, gr, jn), H);
- }
- function yi() {
- const H = U();
- if (vi(
- 26
- /* DotDotDotToken */
- ))
- return Bt(g.createRestTypeNode(xl()), H);
- const ke = xl();
- if (QC(ke) && ke.pos === ke.type.pos) {
- const We = g.createOptionalTypeNode(ke.type);
- return lt(We, ke), We.flags = ke.flags, We;
- }
- return ke;
- }
- function fn() {
- return Ie() === 59 || Z() === 58 && Ie() === 59;
- }
- function ks() {
- return Z() === 26 ? c_(Ie()) && fn() : c_(Z()) && fn();
- }
- function po() {
- if (zt(ks)) {
- const H = U(), ke = be(), We = ca(
- 26
- /* DotDotDotToken */
- ), gt = ge(), Rt = ca(
- 58
- /* QuestionToken */
- );
- Ft(
- 59
- /* ColonToken */
- );
- const gr = yi(), jn = g.createNamedTupleMember(We, gt, Rt, gr);
- return Jr(Bt(jn, H), ke);
- }
- return yi();
- }
- function Bu() {
- const H = U();
- return Bt(
- g.createTupleTypeNode(
- Vf(
- 21,
- po,
- 23,
- 24
- /* CloseBracketToken */
- )
- ),
- H
- );
- }
- function ed() {
- const H = U();
- Ft(
- 21
- /* OpenParenToken */
- );
- const ke = xl();
- return Ft(
- 22
- /* CloseParenToken */
- ), Bt(g.createParenthesizedType(ke), H);
- }
- function Ju() {
- let H;
- if (Z() === 128) {
- const ke = U();
- Ie();
- const We = Bt(I(
- 128
- /* AbstractKeyword */
- ), ke);
- H = ba([We], ke);
- }
- return H;
- }
- function td() {
- const H = U(), ke = be(), We = Ju(), gt = vi(
- 105
- /* NewKeyword */
- );
- E.assert(!We || gt, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
- const Rt = N_(), gr = Kp(
- 4
- /* Type */
- ), jn = Zp(
- 39,
- /*isType*/
- !1
- ), Pi = gt ? g.createConstructorTypeNode(We, Rt, gr, jn) : g.createFunctionTypeNode(Rt, gr, jn);
- return Jr(Bt(Pi, H), ke);
- }
- function zu() {
- const H = Zc();
- return Z() === 25 ? void 0 : H;
- }
- function o2(H) {
- const ke = U();
- H && Ie();
- let We = Z() === 112 || Z() === 97 || Z() === 106 ? Zc() : ns(Z());
- return H && (We = Bt(g.createPrefixUnaryExpression(41, We), ke)), Bt(g.createLiteralTypeNode(We), ke);
- }
- function i1() {
- return Ie(), Z() === 102;
- }
- function nh() {
- me |= 4194304;
- const H = U(), ke = vi(
- 114
- /* TypeOfKeyword */
- );
- Ft(
- 102
- /* ImportKeyword */
- ), Ft(
- 21
- /* OpenParenToken */
- );
- const We = xl();
- let gt;
- if (vi(
- 28
- /* CommaToken */
- )) {
- const jn = t.getTokenStart();
- Ft(
- 19
- /* OpenBraceToken */
- );
- const Pi = Z();
- if (Pi === 118 || Pi === 132 ? Ie() : Zt(p._0_expected, qs(
- 118
- /* WithKeyword */
- )), Ft(
- 59
- /* ColonToken */
- ), gt = bP(
- Pi,
- /*skipKeyword*/
- !0
- ), !Ft(
- 20
- /* CloseBraceToken */
- )) {
- const ui = Ro(fe);
- ui && ui.code === p._0_expected.code && Rs(
- ui,
- fx(le, ve, jn, 1, p.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
- );
- }
- }
- Ft(
- 22
- /* CloseParenToken */
- );
- const Rt = vi(
- 25
- /* DotToken */
- ) ? Ds() : void 0, gr = Pa();
- return Bt(g.createImportTypeNode(We, gt, Rt, gr, ke), H);
- }
- function Hh() {
- return Ie(), Z() === 9 || Z() === 10;
- }
- function W0() {
- switch (Z()) {
- case 133:
- case 159:
- case 154:
- case 150:
- case 163:
- case 155:
- case 136:
- case 157:
- case 146:
- case 151:
- return mr(zu) || ga();
- case 67:
- t.reScanAsteriskEqualsToken();
- case 42:
- return jd();
- case 61:
- t.reScanQuestionToken();
- case 58:
- return J0();
- case 100:
- return eh();
- case 54:
- return Kg();
- case 15:
- case 11:
- case 9:
- case 10:
- case 112:
- case 97:
- case 106:
- return o2();
- case 41:
- return zt(Hh) ? o2(
- /*negative*/
- !0
- ) : ga();
- case 116:
- return Zc();
- case 110: {
- const H = dd();
- return Z() === 142 && !t.hasPrecedingLineBreak() ? vp(H) : H;
- }
- case 114:
- return zt(i1) ? nh() : Mo();
- case 19:
- return zt(Dn) ? _n() : qr();
- case 23:
- return Bu();
- case 21:
- return ed();
- case 102:
- return nh();
- case 131:
- return zt(ZS) ? V6() : ga();
- case 16:
- return Vr();
- default:
- return ga();
- }
- }
- function md(H) {
- switch (Z()) {
- case 133:
- case 159:
- case 154:
- case 150:
- case 163:
- case 136:
- case 148:
- case 155:
- case 158:
- case 116:
- case 157:
- case 106:
- case 110:
- case 114:
- case 146:
- case 19:
- case 23:
- case 30:
- case 52:
- case 51:
- case 105:
- case 11:
- case 9:
- case 10:
- case 112:
- case 97:
- case 151:
- case 42:
- case 58:
- case 54:
- case 26:
- case 140:
- case 102:
- case 131:
- case 15:
- case 16:
- return !0;
- case 100:
- return !H;
- case 41:
- return !H && zt(Hh);
- case 21:
- return !H && zt(U0);
- default:
- return hr();
- }
- }
- function U0() {
- return Ie(), Z() === 22 || Bd(
- /*isJSDocParameter*/
- !1
- ) || md();
- }
- function s1() {
- const H = U();
- let ke = W0();
- for (; !t.hasPrecedingLineBreak(); )
- switch (Z()) {
- case 54:
- Ie(), ke = Bt(g.createJSDocNonNullableType(
- ke,
- /*postfix*/
- !0
- ), H);
- break;
- case 58:
- if (zt(Et))
- return ke;
- Ie(), ke = Bt(g.createJSDocNullableType(
- ke,
- /*postfix*/
- !0
- ), H);
- break;
- case 23:
- if (Ft(
- 23
- /* OpenBracketToken */
- ), md()) {
- const We = xl();
- Ft(
- 24
- /* CloseBracketToken */
- ), ke = Bt(g.createIndexedAccessTypeNode(ke, We), H);
- } else
- Ft(
- 24
- /* CloseBracketToken */
- ), ke = Bt(g.createArrayTypeNode(ke), H);
- break;
- default:
- return ke;
- }
- return ke;
- }
- function a1(H) {
- const ke = U();
- return Ft(H), Bt(g.createTypeOperatorNode(H, Da()), ke);
- }
- function o1() {
- if (vi(
- 96
- /* ExtendsKeyword */
- )) {
- const H = Tt(xl);
- if (bt() || Z() !== 58)
- return H;
- }
- }
- function jS() {
- const H = U(), ke = Ao(), We = mr(o1), gt = g.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- ke,
- We
- );
- return Bt(gt, H);
- }
- function Fv() {
- const H = U();
- return Ft(
- 140
- /* InferKeyword */
- ), Bt(g.createInferTypeNode(jS()), H);
- }
- function Da() {
- const H = Z();
- switch (H) {
- case 143:
- case 158:
- case 148:
- return a1(H);
- case 140:
- return Fv();
- }
- return Xe(s1);
- }
- function c2(H) {
- if (Hf()) {
- const ke = td();
- let We;
- return lg(ke) ? We = H ? p.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type : p.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type : We = H ? p.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type : p.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type, Ae(ke, We), ke;
- }
- }
- function BS(H, ke, We) {
- const gt = U(), Rt = H === 52, gr = vi(H);
- let jn = gr && c2(Rt) || ke();
- if (Z() === H || gr) {
- const Pi = [jn];
- for (; vi(H); )
- Pi.push(c2(Rt) || ke());
- jn = Bt(We(ba(Pi, gt)), gt);
- }
- return jn;
- }
- function Lv() {
- return BS(51, Da, g.createIntersectionTypeNode);
- }
- function ih() {
- return BS(52, Lv, g.createUnionTypeNode);
- }
- function sh() {
- return Ie(), Z() === 105;
- }
- function Hf() {
- return Z() === 30 || Z() === 21 && zt(uf) ? !0 : Z() === 105 || Z() === 128 && zt(sh);
- }
- function lf() {
- if (wy(Z()) && Yt(
- /*allowDecorators*/
- !1
- ), hr() || Z() === 110)
- return Ie(), !0;
- if (Z() === 23 || Z() === 19) {
- const H = fe.length;
- return i_(), H === fe.length;
- }
- return !1;
- }
- function uf() {
- return Ie(), !!(Z() === 22 || Z() === 26 || lf() && (Z() === 59 || Z() === 28 || Z() === 58 || Z() === 64 || Z() === 22 && (Ie(), Z() === 39)));
- }
- function I_() {
- const H = U(), ke = hr() && mr(c1), We = xl();
- return ke ? Bt(g.createTypePredicateNode(
- /*assertsModifier*/
- void 0,
- ke,
- We
- ), H) : We;
- }
- function c1() {
- const H = Ao();
- if (Z() === 142 && !t.hasPrecedingLineBreak())
- return Ie(), H;
- }
- function V6() {
- const H = U(), ke = xs(
- 131
- /* AssertsKeyword */
- ), We = Z() === 110 ? dd() : Ao(), gt = vi(
- 142
- /* IsKeyword */
- ) ? xl() : void 0;
- return Bt(g.createTypePredicateNode(ke, We, gt), H);
- }
- function xl() {
- if (jr & 81920)
- return Ws(81920, xl);
- if (Hf())
- return td();
- const H = U(), ke = ih();
- if (!bt() && !t.hasPrecedingLineBreak() && vi(
- 96
- /* ExtendsKeyword */
- )) {
- const We = Tt(xl);
- Ft(
- 58
- /* QuestionToken */
- );
- const gt = Xe(xl);
- Ft(
- 59
- /* ColonToken */
- );
- const Rt = Xe(xl);
- return Bt(g.createConditionalTypeNode(ke, We, gt, Rt), H);
- }
- return ke;
- }
- function Jd() {
- return vi(
- 59
- /* ColonToken */
- ) ? xl() : void 0;
- }
- function V0() {
- switch (Z()) {
- case 110:
- case 108:
- case 106:
- case 112:
- case 97:
- case 9:
- case 10:
- case 11:
- case 15:
- case 16:
- case 21:
- case 23:
- case 19:
- case 100:
- case 86:
- case 105:
- case 44:
- case 69:
- case 80:
- return !0;
- case 102:
- return zt(fr);
- default:
- return hr();
- }
- }
- function gg() {
- if (V0())
- return !0;
- switch (Z()) {
- case 40:
- case 41:
- case 55:
- case 54:
- case 91:
- case 114:
- case 116:
- case 46:
- case 47:
- case 30:
- case 135:
- case 127:
- case 81:
- case 60:
- return !0;
- default:
- return ah() ? !0 : hr();
- }
- }
- function fk() {
- return Z() !== 19 && Z() !== 100 && Z() !== 86 && Z() !== 60 && gg();
- }
- function fu() {
- const H = He();
- H && qn(
- /*val*/
- !1
- );
- const ke = U();
- let We = O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- ), gt;
- for (; gt = ca(
- 28
- /* CommaToken */
- ); )
- We = hg(We, gt, O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- ), ke);
- return H && qn(
- /*val*/
- !0
- ), We;
- }
- function Gh() {
- return vi(
- 64
- /* EqualsToken */
- ) ? O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- ) : void 0;
- }
- function O_(H) {
- if (Mv())
- return je();
- const ke = Im(H) || q0(H);
- if (ke)
- return ke;
- const We = U(), gt = be(), Rt = H0(
- 0
- /* Lowest */
- );
- return Rt.kind === 80 && Z() === 39 ? zd(
- We,
- Rt,
- H,
- gt,
- /*asyncModifier*/
- void 0
- ) : __(Rt) && Ph(yr()) ? hg(Rt, Zc(), O_(H), We) : gd(Rt, We, H);
- }
- function Mv() {
- return Z() === 127 ? at() ? !0 : zt(Q6) : !1;
- }
- function Nm() {
- return Ie(), !t.hasPrecedingLineBreak() && hr();
- }
- function je() {
- const H = U();
- return Ie(), !t.hasPrecedingLineBreak() && (Z() === 42 || gg()) ? Bt(
- g.createYieldExpression(
- ca(
- 42
- /* AsteriskToken */
- ),
- O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- )
- ),
- H
- ) : Bt(g.createYieldExpression(
- /*asteriskToken*/
- void 0,
- /*expression*/
- void 0
- ), H);
- }
- function zd(H, ke, We, gt, Rt) {
- E.assert(Z() === 39, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
- const gr = g.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- ke,
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- );
- Bt(gr, ke.pos);
- const jn = ba([gr], gr.pos, gr.end), Pi = xs(
- 39
- /* EqualsGreaterThanToken */
- ), ui = fa(
- /*isAsync*/
- !!Rt,
- We
- ), _i = g.createArrowFunction(
- Rt,
- /*typeParameters*/
- void 0,
- jn,
- /*type*/
- void 0,
- Pi,
- ui
- );
- return Jr(Bt(_i, H), gt);
- }
- function Im(H) {
- const ke = Rv();
- if (ke !== 0)
- return ke === 1 ? dk(
- /*allowAmbiguity*/
- !0,
- /*allowReturnTypeInArrowFunction*/
- !0
- ) : mr(() => $h(H));
- }
- function Rv() {
- return Z() === 21 || Z() === 30 || Z() === 134 ? zt(pk) : Z() === 39 ? 1 : 0;
- }
- function pk() {
- if (Z() === 134 && (Ie(), t.hasPrecedingLineBreak() || Z() !== 21 && Z() !== 30))
- return 0;
- const H = Z(), ke = Ie();
- if (H === 21) {
- if (ke === 22)
- switch (Ie()) {
- case 39:
- case 59:
- case 19:
- return 1;
- default:
- return 0;
- }
- if (ke === 23 || ke === 19)
- return 2;
- if (ke === 26)
- return 1;
- if (wy(ke) && ke !== 134 && zt(Wf))
- return Ie() === 130 ? 0 : 1;
- if (!hr() && ke !== 110)
- return 0;
- switch (Ie()) {
- case 59:
- return 1;
- case 58:
- return Ie(), Z() === 59 || Z() === 28 || Z() === 64 || Z() === 22 ? 1 : 0;
- case 28:
- case 64:
- case 22:
- return 2;
- }
- return 0;
- } else
- return E.assert(
- H === 30
- /* LessThanToken */
- ), !hr() && Z() !== 87 ? 0 : we === 1 ? zt(() => {
- vi(
- 87
- /* ConstKeyword */
- );
- const gt = Ie();
- if (gt === 96)
- switch (Ie()) {
- case 64:
- case 32:
- case 44:
- return !1;
- default:
- return !0;
- }
- else if (gt === 28 || gt === 64)
- return !0;
- return !1;
- }) ? 1 : 0 : 2;
- }
- function $h(H) {
- const ke = t.getTokenStart();
- if (Ir?.has(ke))
- return;
- const We = dk(
- /*allowAmbiguity*/
- !1,
- H
- );
- return We || (Ir || (Ir = /* @__PURE__ */ new Set())).add(ke), We;
- }
- function q0(H) {
- if (Z() === 134 && zt(Xh) === 1) {
- const ke = U(), We = be(), gt = ai(), Rt = H0(
- 0
- /* Lowest */
- );
- return zd(ke, Rt, H, We, gt);
- }
- }
- function Xh() {
- if (Z() === 134) {
- if (Ie(), t.hasPrecedingLineBreak() || Z() === 39)
- return 0;
- const H = H0(
- 0
- /* Lowest */
- );
- if (!t.hasPrecedingLineBreak() && H.kind === 80 && Z() === 39)
- return 1;
- }
- return 0;
- }
- function dk(H, ke) {
- const We = U(), gt = be(), Rt = ai(), gr = ut(Rt, tD) ? 2 : 0, jn = N_();
- let Pi;
- if (Ft(
- 21
- /* OpenParenToken */
- )) {
- if (H)
- Pi = qf(gr, H);
- else {
- const Xf = qf(gr, H);
- if (!Xf)
- return;
- Pi = Xf;
- }
- if (!Ft(
- 22
- /* CloseParenToken */
- ) && !H)
- return;
- } else {
- if (!H)
- return;
- Pi = r_();
- }
- const ui = Z() === 59, _i = Zp(
- 59,
- /*isType*/
- !1
- );
- if (_i && !H && $o(_i))
- return;
- let Wi = _i;
- for (; Wi?.kind === 196; )
- Wi = Wi.type;
- const Ka = Wi && YC(Wi);
- if (!H && Z() !== 39 && (Ka || Z() !== 19))
- return;
- const eo = Z(), wa = xs(
- 39
- /* EqualsGreaterThanToken */
- ), xp = eo === 39 || eo === 19 ? fa(ut(Rt, tD), ke) : Ao();
- if (!ke && ui && Z() !== 59)
- return;
- const cl = g.createArrowFunction(Rt, jn, Pi, _i, wa, xp);
- return Jr(Bt(cl, We), gt);
- }
- function fa(H, ke) {
- if (Z() === 19)
- return Z0(
- H ? 2 : 0
- /* None */
- );
- if (Z() !== 27 && Z() !== 100 && Z() !== 86 && KS() && !fk())
- return Z0(16 | (H ? 2 : 0));
- const We = Nt;
- Nt = !1;
- const gt = H ? K(() => O_(ke)) : De(() => O_(ke));
- return Nt = We, gt;
- }
- function gd(H, ke, We) {
- const gt = ca(
- 58
- /* QuestionToken */
- );
- if (!gt)
- return H;
- let Rt;
- return Bt(
- g.createConditionalExpression(
- H,
- gt,
- Ws(n, () => O_(
- /*allowReturnTypeInArrowFunction*/
- !1
- )),
- Rt = xs(
- 59
- /* ColonToken */
- ),
- Mp(Rt) ? O_(We) : to(
- 80,
- /*reportAtCurrentPosition*/
- !1,
- p._0_expected,
- qs(
- 59
- /* ColonToken */
- )
- )
- ),
- ke
- );
- }
- function H0(H) {
- const ke = U(), We = Al();
- return xf(H, We, ke);
- }
- function jv(H) {
- return H === 103 || H === 165;
- }
- function xf(H, ke, We) {
- for (; ; ) {
- yr();
- const gt = T3(Z());
- if (!(Z() === 43 ? gt >= H : gt > H) || Z() === 103 && $e())
- break;
- if (Z() === 130 || Z() === 152) {
- if (t.hasPrecedingLineBreak())
- break;
- {
- const gr = Z();
- Ie(), ke = gr === 152 ? Wd(ke, xl()) : mk(ke, xl());
- }
- } else
- ke = hg(ke, Zc(), H0(gt), We);
- }
- return ke;
- }
- function ah() {
- return $e() && Z() === 103 ? !1 : T3(Z()) > 0;
- }
- function Wd(H, ke) {
- return Bt(g.createSatisfiesExpression(H, ke), H.pos);
- }
- function hg(H, ke, We, gt) {
- return Bt(g.createBinaryExpression(H, ke, We), gt);
- }
- function mk(H, ke) {
- return Bt(g.createAsExpression(H, ke), H.pos);
- }
- function l1() {
- const H = U();
- return Bt(g.createPrefixUnaryExpression(Z(), Le(Qh)), H);
- }
- function rd() {
- const H = U();
- return Bt(g.createDeleteExpression(Le(Qh)), H);
- }
- function gk() {
- const H = U();
- return Bt(g.createTypeOfExpression(Le(Qh)), H);
- }
- function G0() {
- const H = U();
- return Bt(g.createVoidExpression(Le(Qh)), H);
- }
- function Bi() {
- return Z() === 135 ? Vt() ? !0 : zt(Q6) : !1;
- }
- function bn() {
- const H = U();
- return Bt(g.createAwaitExpression(Le(Qh)), H);
- }
- function Al() {
- if ($0()) {
- const We = U(), gt = JS();
- return Z() === 43 ? xf(T3(Z()), gt, We) : gt;
- }
- const H = Z(), ke = Qh();
- if (Z() === 43) {
- const We = aa(ve, ke.pos), { end: gt } = ke;
- ke.kind === 216 ? M(We, gt, p.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses) : (E.assert(F7(H)), M(We, gt, p.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, qs(H)));
- }
- return ke;
- }
- function Qh() {
- switch (Z()) {
- case 40:
- case 41:
- case 55:
- case 54:
- return l1();
- case 91:
- return rd();
- case 114:
- return gk();
- case 116:
- return G0();
- case 30:
- return we === 1 ? Yh(
- /*inExpressionContext*/
- !0,
- /*topInvalidNodePosition*/
- void 0,
- /*openingTag*/
- void 0,
- /*mustBeUnary*/
- !0
- ) : US();
- case 135:
- if (Bi())
- return bn();
- default:
- return JS();
- }
- }
- function $0() {
- switch (Z()) {
- case 40:
- case 41:
- case 55:
- case 54:
- case 91:
- case 114:
- case 116:
- case 135:
- return !1;
- case 30:
- if (we !== 1)
- return !1;
- default:
- return !0;
- }
- }
- function JS() {
- if (Z() === 46 || Z() === 47) {
- const ke = U();
- return Bt(g.createPrefixUnaryExpression(Z(), Le(u1)), ke);
- } else if (we === 1 && Z() === 30 && zt(al))
- return Yh(
- /*inExpressionContext*/
- !0
- );
- const H = u1();
- if (E.assert(__(H)), (Z() === 46 || Z() === 47) && !t.hasPrecedingLineBreak()) {
- const ke = Z();
- return Ie(), Bt(g.createPostfixUnaryExpression(H, ke), H.pos);
- }
- return H;
- }
- function u1() {
- const H = U();
- let ke;
- return Z() === 102 ? zt(vt) ? (me |= 4194304, ke = Zc()) : zt(qt) ? (Ie(), Ie(), ke = Bt(g.createMetaProperty(102, ge()), H), me |= 8388608) : ke = zS() : ke = Z() === 108 ? Do() : zS(), Gf(H, ke);
- }
- function zS() {
- const H = U(), ke = qS();
- return oh(
- H,
- ke,
- /*allowOptionalChain*/
- !0
- );
- }
- function Do() {
- const H = U();
- let ke = Zc();
- if (Z() === 30) {
- const We = U(), gt = mr(Y0);
- gt !== void 0 && (M(We, U(), p.super_may_not_use_type_arguments), F_() || (ke = g.createExpressionWithTypeArguments(ke, gt)));
- }
- return Z() === 21 || Z() === 25 || Z() === 23 ? ke : (xs(25, p.super_must_be_followed_by_an_argument_list_or_member_access), Bt(B(ke, It(
- /*allowIdentifierNames*/
- !0,
- /*allowPrivateIdentifiers*/
- !0,
- /*allowUnicodeEscapeSequenceInIdentifierName*/
- !0
- )), H));
- }
- function Yh(H, ke, We, gt = !1) {
- const Rt = U(), gr = q6(H);
- let jn;
- if (gr.kind === 286) {
- let Pi = u2(gr), ui;
- const _i = Pi[Pi.length - 1];
- if (_i?.kind === 284 && !yv(_i.openingElement.tagName, _i.closingElement.tagName) && yv(gr.tagName, _i.closingElement.tagName)) {
- const Wi = _i.children.end, Ka = Bt(
- g.createJsxElement(
- _i.openingElement,
- _i.children,
- Bt(g.createJsxClosingElement(Bt(D(""), Wi, Wi)), Wi, Wi)
- ),
- _i.openingElement.pos,
- Wi
- );
- Pi = ba([...Pi.slice(0, Pi.length - 1), Ka], Pi.pos, Wi), ui = _i.closingElement;
- } else
- ui = ln(gr, H), yv(gr.tagName, ui.tagName) || (We && xm(We) && yv(ui.tagName, We.tagName) ? Ae(gr.tagName, p.JSX_element_0_has_no_corresponding_closing_tag, _4(ve, gr.tagName)) : Ae(ui.tagName, p.Expected_corresponding_JSX_closing_tag_for_0, _4(ve, gr.tagName)));
- jn = Bt(g.createJsxElement(gr, Pi, ui), Rt);
- } else gr.kind === 289 ? jn = Bt(g.createJsxFragment(gr, u2(gr), G6(H)), Rt) : (E.assert(
- gr.kind === 285
- /* JsxSelfClosingElement */
- ), jn = gr);
- if (!gt && H && Z() === 30) {
- const Pi = typeof ke > "u" ? jn.pos : ke, ui = mr(() => Yh(
- /*inExpressionContext*/
- !0,
- Pi
- ));
- if (ui) {
- const _i = to(
- 28,
- /*reportAtCurrentPosition*/
- !1
- );
- return fJ(_i, ui.pos, 0), M(aa(ve, Pi), ui.end, p.JSX_expressions_must_have_one_parent_element), Bt(g.createBinaryExpression(jn, _i, ui), Rt);
- }
- }
- return jn;
- }
- function l2() {
- const H = U(), ke = g.createJsxText(
- t.getTokenValue(),
- et === 13
- /* JsxTextAllWhiteSpaces */
- );
- return et = t.scanJsxToken(), Bt(ke, H);
- }
- function Tp(H, ke) {
- switch (ke) {
- case 1:
- if (vS(H))
- Ae(H, p.JSX_fragment_has_no_corresponding_closing_tag);
- else {
- const We = H.tagName, gt = Math.min(aa(ve, We.pos), We.end);
- M(gt, We.end, p.JSX_element_0_has_no_corresponding_closing_tag, _4(ve, H.tagName));
- }
- return;
- case 31:
- case 7:
- return;
- case 12:
- case 13:
- return l2();
- case 19:
- return pu(
- /*inExpressionContext*/
- !1
- );
- case 30:
- return Yh(
- /*inExpressionContext*/
- !1,
- /*topInvalidNodePosition*/
- void 0,
- H
- );
- default:
- return E.assertNever(ke);
- }
- }
- function u2(H) {
- const ke = [], We = U(), gt = _r;
- for (_r |= 16384; ; ) {
- const Rt = Tp(H, et = t.reScanJsxToken());
- if (!Rt || (ke.push(Rt), xm(H) && Rt?.kind === 284 && !yv(Rt.openingElement.tagName, Rt.closingElement.tagName) && yv(H.tagName, Rt.closingElement.tagName)))
- break;
- }
- return _r = gt, ba(ke, We);
- }
- function WS() {
- const H = U();
- return Bt(g.createJsxAttributes(ka(13, hs)), H);
- }
- function q6(H) {
- const ke = U();
- if (Ft(
- 30
- /* LessThanToken */
- ), Z() === 32)
- return Xt(), Bt(g.createJsxOpeningFragment(), ke);
- const We = H6(), gt = jr & 524288 ? void 0 : Vv(), Rt = WS();
- let gr;
- return Z() === 32 ? (Xt(), gr = g.createJsxOpeningElement(We, gt, Rt)) : (Ft(
- 44
- /* SlashToken */
- ), Ft(
- 32,
- /*diagnosticMessage*/
- void 0,
- /*shouldAdvance*/
- !1
- ) && (H ? Ie() : Xt()), gr = g.createJsxSelfClosingElement(We, gt, Rt)), Bt(gr, ke);
- }
- function H6() {
- const H = U(), ke = Sn();
- if (Nd(ke))
- return ke;
- let We = ke;
- for (; vi(
- 25
- /* DotToken */
- ); )
- We = Bt(B(We, It(
- /*allowIdentifierNames*/
- !0,
- /*allowPrivateIdentifiers*/
- !1,
- /*allowUnicodeEscapeSequenceInIdentifierName*/
- !1
- )), H);
- return We;
- }
- function Sn() {
- const H = U();
- jt();
- const ke = Z() === 110, We = $();
- return vi(
- 59
- /* ColonToken */
- ) ? (jt(), Bt(g.createJsxNamespacedName(We, $()), H)) : ke ? Bt(g.createToken(
- 110
- /* ThisKeyword */
- ), H) : We;
- }
- function pu(H) {
- const ke = U();
- if (!Ft(
- 19
- /* OpenBraceToken */
- ))
- return;
- let We, gt;
- return Z() !== 20 && (H || (We = ca(
- 26
- /* DotDotDotToken */
- )), gt = fu()), H ? Ft(
- 20
- /* CloseBraceToken */
- ) : Ft(
- 20,
- /*diagnosticMessage*/
- void 0,
- /*shouldAdvance*/
- !1
- ) && Xt(), Bt(g.createJsxExpression(We, gt), ke);
- }
- function hs() {
- if (Z() === 19)
- return Bv();
- const H = U();
- return Bt(g.createJsxAttribute(hk(), X0()), H);
- }
- function X0() {
- if (Z() === 64) {
- if (Ht() === 11)
- return yt();
- if (Z() === 19)
- return pu(
- /*inExpressionContext*/
- !0
- );
- if (Z() === 30)
- return Yh(
- /*inExpressionContext*/
- !0
- );
- Zt(p.or_JSX_element_expected);
- }
- }
- function hk() {
- const H = U();
- jt();
- const ke = $();
- return vi(
- 59
- /* ColonToken */
- ) ? (jt(), Bt(g.createJsxNamespacedName(ke, $()), H)) : ke;
- }
- function Bv() {
- const H = U();
- Ft(
- 19
- /* OpenBraceToken */
- ), Ft(
- 26
- /* DotDotDotToken */
- );
- const ke = fu();
- return Ft(
- 20
- /* CloseBraceToken */
- ), Bt(g.createJsxSpreadAttribute(ke), H);
- }
- function ln(H, ke) {
- const We = U();
- Ft(
- 31
- /* LessThanSlashToken */
- );
- const gt = H6();
- return Ft(
- 32,
- /*diagnosticMessage*/
- void 0,
- /*shouldAdvance*/
- !1
- ) && (ke || !yv(H.tagName, gt) ? Ie() : Xt()), Bt(g.createJsxClosingElement(gt), We);
- }
- function G6(H) {
- const ke = U();
- return Ft(
- 31
- /* LessThanSlashToken */
- ), Ft(
- 32,
- p.Expected_corresponding_closing_tag_for_JSX_fragment,
- /*shouldAdvance*/
- !1
- ) && (H ? Ie() : Xt()), Bt(g.createJsxJsxClosingFragment(), ke);
- }
- function US() {
- E.assert(we !== 1, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");
- const H = U();
- Ft(
- 30
- /* LessThanToken */
- );
- const ke = xl();
- Ft(
- 32
- /* GreaterThanToken */
- );
- const We = Qh();
- return Bt(g.createTypeAssertion(ke, We), H);
- }
- function Eu() {
- return Ie(), c_(Z()) || Z() === 23 || F_();
- }
- function Du() {
- return Z() === 29 && zt(Eu);
- }
- function kf(H) {
- if (H.flags & 64)
- return !0;
- if (Ox(H)) {
- let ke = H.expression;
- for (; Ox(ke) && !(ke.flags & 64); )
- ke = ke.expression;
- if (ke.flags & 64) {
- for (; Ox(H); )
- H.flags |= 64, H = H.expression;
- return !0;
- }
- }
- return !1;
- }
- function Jv(H, ke, We) {
- const gt = It(
- /*allowIdentifierNames*/
- !0,
- /*allowPrivateIdentifiers*/
- !0,
- /*allowUnicodeEscapeSequenceInIdentifierName*/
- !0
- ), Rt = We || kf(ke), gr = Rt ? z(ke, We, gt) : B(ke, gt);
- if (Rt && Di(gr.name) && Ae(gr.name, p.An_optional_chain_cannot_contain_private_identifiers), Oh(ke) && ke.typeArguments) {
- const jn = ke.typeArguments.pos - 1, Pi = aa(ve, ke.typeArguments.end) + 1;
- M(jn, Pi, p.An_instantiation_expression_cannot_be_followed_by_a_property_access);
- }
- return Bt(gr, H);
- }
- function VS(H, ke, We) {
- let gt;
- if (Z() === 24)
- gt = to(
- 80,
- /*reportAtCurrentPosition*/
- !0,
- p.An_element_access_expression_should_take_an_argument
- );
- else {
- const gr = rr(fu);
- Of(gr) && (gr.text = _u(gr.text)), gt = gr;
- }
- Ft(
- 24
- /* CloseBracketToken */
- );
- const Rt = We || kf(ke) ? q(ke, We, gt) : X(ke, gt);
- return Bt(Rt, H);
- }
- function oh(H, ke, We) {
- for (; ; ) {
- let gt, Rt = !1;
- if (We && Du() ? (gt = xs(
- 29
- /* QuestionDotToken */
- ), Rt = c_(Z())) : Rt = vi(
- 25
- /* DotToken */
- ), Rt) {
- ke = Jv(H, ke, gt);
- continue;
- }
- if ((gt || !He()) && vi(
- 23
- /* OpenBracketToken */
- )) {
- ke = VS(H, ke, gt);
- continue;
- }
- if (F_()) {
- ke = !gt && ke.kind === 233 ? Om(H, ke.expression, gt, ke.typeArguments) : Om(
- H,
- ke,
- gt,
- /*typeArguments*/
- void 0
- );
- continue;
- }
- if (!gt) {
- if (Z() === 54 && !t.hasPrecedingLineBreak()) {
- Ie(), ke = Bt(g.createNonNullExpression(ke), H);
- continue;
- }
- const gr = mr(Y0);
- if (gr) {
- ke = Bt(g.createExpressionWithTypeArguments(ke, gr), H);
- continue;
- }
- }
- return ke;
- }
- }
- function F_() {
- return Z() === 15 || Z() === 16;
- }
- function Om(H, ke, We, gt) {
- const Rt = g.createTaggedTemplateExpression(
- ke,
- gt,
- Z() === 15 ? (nt(
- /*isTaggedTemplate*/
- !0
- ), yt()) : Sr(
- /*isTaggedTemplate*/
- !0
- )
- );
- return (We || ke.flags & 64) && (Rt.flags |= 64), Rt.questionDotToken = We, Bt(Rt, H);
- }
- function Gf(H, ke) {
- for (; ; ) {
- ke = oh(
- H,
- ke,
- /*allowOptionalChain*/
- !0
- );
- let We;
- const gt = ca(
- 29
- /* QuestionDotToken */
- );
- if (gt && (We = mr(Y0), F_())) {
- ke = Om(H, ke, gt, We);
- continue;
- }
- if (We || Z() === 21) {
- !gt && ke.kind === 233 && (We = ke.typeArguments, ke = ke.expression);
- const Rt = Q0(), gr = gt || kf(ke) ? ae(ke, gt, We, Rt) : V(ke, We, Rt);
- ke = Bt(gr, H);
- continue;
- }
- if (gt) {
- const Rt = to(
- 80,
- /*reportAtCurrentPosition*/
- !1,
- p.Identifier_expected
- );
- ke = Bt(z(ke, gt, Rt), H);
- }
- break;
- }
- return ke;
- }
- function Q0() {
- Ft(
- 21
- /* OpenParenToken */
- );
- const H = vl(11, $S);
- return Ft(
- 22
- /* CloseParenToken */
- ), H;
- }
- function Y0() {
- if (jr & 524288 || ot() !== 30)
- return;
- Ie();
- const H = vl(20, xl);
- if (yr() === 32)
- return Ie(), H && _2() ? H : void 0;
- }
- function _2() {
- switch (Z()) {
- case 21:
- case 15:
- case 16:
- return !0;
- case 30:
- case 32:
- case 40:
- case 41:
- return !1;
- }
- return t.hasPrecedingLineBreak() || ah() || !gg();
- }
- function qS() {
- switch (Z()) {
- case 15:
- t.getTokenFlags() & 26656 && nt(
- /*isTaggedTemplate*/
- !1
- );
- case 9:
- case 10:
- case 11:
- return yt();
- case 110:
- case 108:
- case 106:
- case 112:
- case 97:
- return Zc();
- case 21:
- return _1();
- case 23:
- return Ud();
- case 19:
- return zv();
- case 134:
- if (!zt(Yo))
- break;
- return f1();
- case 60:
- return Ki();
- case 86:
- return Hi();
- case 100:
- return f1();
- case 105:
- return Zh();
- case 44:
- case 69:
- if ($r() === 14)
- return yt();
- break;
- case 16:
- return Sr(
- /*isTaggedTemplate*/
- !1
- );
- case 81:
- return ar();
- }
- return Ao(p.Expression_expected);
- }
- function _1() {
- const H = U(), ke = be();
- Ft(
- 21
- /* OpenParenToken */
- );
- const We = rr(fu);
- return Ft(
- 22
- /* CloseParenToken */
- ), Jr(Bt(G(We), H), ke);
- }
- function HS() {
- const H = U();
- Ft(
- 26
- /* DotDotDotToken */
- );
- const ke = O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- );
- return Bt(g.createSpreadElement(ke), H);
- }
- function GS() {
- return Z() === 26 ? HS() : Z() === 28 ? Bt(g.createOmittedExpression(), U()) : O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- );
- }
- function $S() {
- return Ws(n, GS);
- }
- function Ud() {
- const H = U(), ke = t.getTokenStart(), We = Ft(
- 23
- /* OpenBracketToken */
- ), gt = t.hasPrecedingLineBreak(), Rt = vl(15, GS);
- return io(23, 24, We, ke), Bt(F(Rt, gt), H);
- }
- function $6() {
- const H = U(), ke = be();
- if (ca(
- 26
- /* DotDotDotToken */
- )) {
- const Wi = O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- );
- return Jr(Bt(g.createSpreadAssignment(Wi), H), ke);
- }
- const We = Yt(
- /*allowDecorators*/
- !0
- );
- if (An(
- 139
- /* GetKeyword */
- ))
- return id(
- H,
- ke,
- We,
- 177,
- 0
- /* None */
- );
- if (An(
- 153
- /* SetKeyword */
- ))
- return id(
- H,
- ke,
- We,
- 178,
- 0
- /* None */
- );
- const gt = ca(
- 42
- /* AsteriskToken */
- ), Rt = hr(), gr = zr(), jn = ca(
- 58
- /* QuestionToken */
- ), Pi = ca(
- 54
- /* ExclamationToken */
- );
- if (gt || Z() === 21 || Z() === 30)
- return _f(H, ke, We, gt, gr, jn, Pi);
- let ui;
- if (Rt && Z() !== 59) {
- const Wi = ca(
- 64
- /* EqualsToken */
- ), Ka = Wi ? rr(() => O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- )) : void 0;
- ui = g.createShorthandPropertyAssignment(gr, Ka), ui.equalsToken = Wi;
- } else {
- Ft(
- 59
- /* ColonToken */
- );
- const Wi = rr(() => O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- ));
- ui = g.createPropertyAssignment(gr, Wi);
- }
- return ui.modifiers = We, ui.questionToken = jn, ui.exclamationToken = Pi, Jr(Bt(ui, H), ke);
- }
- function zv() {
- const H = U(), ke = t.getTokenStart(), We = Ft(
- 19
- /* OpenBraceToken */
- ), gt = t.hasPrecedingLineBreak(), Rt = vl(
- 12,
- $6,
- /*considerSemicolonAsDelimiter*/
- !0
- );
- return io(19, 20, We, ke), Bt(O(Rt, gt), H);
- }
- function f1() {
- const H = He();
- qn(
- /*val*/
- !1
- );
- const ke = U(), We = be(), gt = Yt(
- /*allowDecorators*/
- !1
- );
- Ft(
- 100
- /* FunctionKeyword */
- );
- const Rt = ca(
- 42
- /* AsteriskToken */
- ), gr = Rt ? 1 : 0, jn = ut(gt, tD) ? 2 : 0, Pi = gr && jn ? Ve(ch) : gr ? te(ch) : jn ? K(ch) : ch(), ui = N_(), _i = Kp(gr | jn), Wi = Zp(
- 59,
- /*isType*/
- !1
- ), Ka = Z0(gr | jn);
- qn(H);
- const eo = g.createFunctionExpression(gt, Rt, Pi, ui, _i, Wi, Ka);
- return Jr(Bt(eo, ke), We);
- }
- function ch() {
- return Kt() ? of() : void 0;
- }
- function Zh() {
- const H = U();
- if (Ft(
- 105
- /* NewKeyword */
- ), vi(
- 25
- /* DotToken */
- )) {
- const gr = ge();
- return Bt(g.createMetaProperty(105, gr), H);
- }
- const ke = U();
- let We = oh(
- ke,
- qS(),
- /*allowOptionalChain*/
- !1
- ), gt;
- We.kind === 233 && (gt = We.typeArguments, We = We.expression), Z() === 29 && Zt(p.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, _4(ve, We));
- const Rt = Z() === 21 ? Q0() : void 0;
- return Bt(ee(We, gt, Rt), H);
- }
- function hd(H, ke) {
- const We = U(), gt = be(), Rt = t.getTokenStart(), gr = Ft(19, ke);
- if (gr || H) {
- const jn = t.hasPrecedingLineBreak(), Pi = ka(1, $f);
- io(19, 20, gr, Rt);
- const ui = Jr(Bt(ue(Pi, jn), We), gt);
- return Z() === 64 && (Zt(p.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses), Ie()), ui;
- } else {
- const jn = r_();
- return Jr(Bt(ue(
- jn,
- /*multiLine*/
- void 0
- ), We), gt);
- }
- }
- function Z0(H, ke) {
- const We = at();
- ti(!!(H & 1));
- const gt = Vt();
- Oi(!!(H & 2));
- const Rt = Nt;
- Nt = !1;
- const gr = He();
- gr && qn(
- /*val*/
- !1
- );
- const jn = hd(!!(H & 16), ke);
- return gr && qn(
- /*val*/
- !0
- ), Nt = Rt, ti(We), Oi(gt), jn;
- }
- function XS() {
- const H = U(), ke = be();
- return Ft(
- 27
- /* SemicolonToken */
- ), Jr(Bt(g.createEmptyStatement(), H), ke);
- }
- function kl() {
- const H = U(), ke = be();
- Ft(
- 101
- /* IfKeyword */
- );
- const We = t.getTokenStart(), gt = Ft(
- 21
- /* OpenParenToken */
- ), Rt = rr(fu);
- io(21, 22, gt, We);
- const gr = $f(), jn = vi(
- 93
- /* ElseKeyword */
- ) ? $f() : void 0;
- return Jr(Bt(ie(Rt, gr, jn), H), ke);
- }
- function QS() {
- const H = U(), ke = be();
- Ft(
- 92
- /* DoKeyword */
- );
- const We = $f();
- Ft(
- 117
- /* WhileKeyword */
- );
- const gt = t.getTokenStart(), Rt = Ft(
- 21
- /* OpenParenToken */
- ), gr = rr(fu);
- return io(21, 22, Rt, gt), vi(
- 27
- /* SemicolonToken */
- ), Jr(Bt(g.createDoStatement(We, gr), H), ke);
- }
- function yg() {
- const H = U(), ke = be();
- Ft(
- 117
- /* WhileKeyword */
- );
- const We = t.getTokenStart(), gt = Ft(
- 21
- /* OpenParenToken */
- ), Rt = rr(fu);
- io(21, 22, gt, We);
- const gr = $f();
- return Jr(Bt(Se(Rt, gr), H), ke);
- }
- function YS() {
- const H = U(), ke = be();
- Ft(
- 99
- /* ForKeyword */
- );
- const We = ca(
- 135
- /* AwaitKeyword */
- );
- Ft(
- 21
- /* OpenParenToken */
- );
- let gt;
- Z() !== 27 && (Z() === 115 || Z() === 121 || Z() === 87 || Z() === 160 && zt(Sk) || // this one is meant to allow of
- Z() === 135 && zt(Tk) ? gt = Z6(
- /*inForStatementInitializer*/
- !0
- ) : gt = Ea(fu));
- let Rt;
- if (We ? Ft(
- 165
- /* OfKeyword */
- ) : vi(
- 165
- /* OfKeyword */
- )) {
- const gr = rr(() => O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- ));
- Ft(
- 22
- /* CloseParenToken */
- ), Rt = oe(We, gt, gr, $f());
- } else if (vi(
- 103
- /* InKeyword */
- )) {
- const gr = rr(fu);
- Ft(
- 22
- /* CloseParenToken */
- ), Rt = g.createForInStatement(gt, gr, $f());
- } else {
- Ft(
- 27
- /* SemicolonToken */
- );
- const gr = Z() !== 27 && Z() !== 22 ? rr(fu) : void 0;
- Ft(
- 27
- /* SemicolonToken */
- );
- const jn = Z() !== 22 ? rr(fu) : void 0;
- Ft(
- 22
- /* CloseParenToken */
- ), Rt = J(gt, gr, jn, $f());
- }
- return Jr(Bt(Rt, H), ke);
- }
- function Wv(H) {
- const ke = U(), We = be();
- Ft(
- H === 252 ? 83 : 88
- /* ContinueKeyword */
- );
- const gt = Na() ? void 0 : Ao();
- Vi();
- const Rt = H === 252 ? g.createBreakStatement(gt) : g.createContinueStatement(gt);
- return Jr(Bt(Rt, ke), We);
- }
- function Kh() {
- const H = U(), ke = be();
- Ft(
- 107
- /* ReturnKeyword */
- );
- const We = Na() ? void 0 : rr(fu);
- return Vi(), Jr(Bt(g.createReturnStatement(We), H), ke);
- }
- function p1() {
- const H = U(), ke = be();
- Ft(
- 118
- /* WithKeyword */
- );
- const We = t.getTokenStart(), gt = Ft(
- 21
- /* OpenParenToken */
- ), Rt = rr(fu);
- io(21, 22, gt, We);
- const gr = Hs(67108864, $f);
- return Jr(Bt(g.createWithStatement(Rt, gr), H), ke);
- }
- function f2() {
- const H = U(), ke = be();
- Ft(
- 84
- /* CaseKeyword */
- );
- const We = rr(fu);
- Ft(
- 59
- /* ColonToken */
- );
- const gt = ka(3, $f);
- return Jr(Bt(g.createCaseClause(We, gt), H), ke);
- }
- function Mc() {
- const H = U();
- Ft(
- 90
- /* DefaultKeyword */
- ), Ft(
- 59
- /* ColonToken */
- );
- const ke = ka(3, $f);
- return Bt(g.createDefaultClause(ke), H);
- }
- function Zl() {
- return Z() === 84 ? f2() : Mc();
- }
- function X6() {
- const H = U();
- Ft(
- 19
- /* OpenBraceToken */
- );
- const ke = ka(2, Zl);
- return Ft(
- 20
- /* CloseBraceToken */
- ), Bt(g.createCaseBlock(ke), H);
- }
- function Pu() {
- const H = U(), ke = be();
- Ft(
- 109
- /* SwitchKeyword */
- ), Ft(
- 21
- /* OpenParenToken */
- );
- const We = rr(fu);
- Ft(
- 22
- /* CloseParenToken */
- );
- const gt = X6();
- return Jr(Bt(g.createSwitchStatement(We, gt), H), ke);
- }
- function L_() {
- const H = U(), ke = be();
- Ft(
- 111
- /* ThrowKeyword */
- );
- let We = t.hasPrecedingLineBreak() ? void 0 : rr(fu);
- return We === void 0 && (Wt++, We = Bt(D(""), U())), Ia() || gs(We), Jr(Bt(g.createThrowStatement(We), H), ke);
- }
- function yk() {
- const H = U(), ke = be();
- Ft(
- 113
- /* TryKeyword */
- );
- const We = hd(
- /*ignoreMissingOpenBrace*/
- !1
- ), gt = Z() === 85 ? Fm() : void 0;
- let Rt;
- return (!gt || Z() === 98) && (Ft(98, p.catch_or_finally_expected), Rt = hd(
- /*ignoreMissingOpenBrace*/
- !1
- )), Jr(Bt(g.createTryStatement(We, gt, Rt), H), ke);
- }
- function Fm() {
- const H = U();
- Ft(
- 85
- /* CatchKeyword */
- );
- let ke;
- vi(
- 21
- /* OpenParenToken */
- ) ? (ke = g2(), Ft(
- 22
- /* CloseParenToken */
- )) : ke = void 0;
- const We = hd(
- /*ignoreMissingOpenBrace*/
- !1
- );
- return Bt(g.createCatchClause(ke, We), H);
- }
- function vk() {
- const H = U(), ke = be();
- return Ft(
- 89
- /* DebuggerKeyword */
- ), Vi(), Jr(Bt(g.createDebuggerStatement(), H), ke);
- }
- function K0() {
- const H = U();
- let ke = be(), We;
- const gt = Z() === 21, Rt = rr(fu);
- return Oe(Rt) && vi(
- 59
- /* ColonToken */
- ) ? We = g.createLabeledStatement(Rt, $f()) : (Ia() || gs(Rt), We = ne(Rt), gt && (ke = !1)), Jr(Bt(We, H), ke);
- }
- function ZS() {
- return Ie(), c_(Z()) && !t.hasPrecedingLineBreak();
- }
- function gP() {
- return Ie(), Z() === 86 && !t.hasPrecedingLineBreak();
- }
- function Yo() {
- return Ie(), Z() === 100 && !t.hasPrecedingLineBreak();
- }
- function Q6() {
- return Ie(), (c_(Z()) || Z() === 9 || Z() === 10 || Z() === 11) && !t.hasPrecedingLineBreak();
- }
- function bk() {
- for (; ; )
- switch (Z()) {
- case 115:
- case 121:
- case 87:
- case 100:
- case 86:
- case 94:
- return !0;
- case 160:
- return M_();
- case 135:
- return m1();
- case 120:
- case 156:
- return Nm();
- case 144:
- case 145:
- return ey();
- case 128:
- case 129:
- case 134:
- case 138:
- case 123:
- case 124:
- case 125:
- case 148:
- const H = Z();
- if (Ie(), t.hasPrecedingLineBreak())
- return !1;
- if (H === 138 && Z() === 156)
- return !0;
- continue;
- case 162:
- return Ie(), Z() === 19 || Z() === 80 || Z() === 95;
- case 102:
- return Ie(), Z() === 11 || Z() === 42 || Z() === 19 || c_(Z());
- case 95:
- let ke = Ie();
- if (ke === 156 && (ke = zt(Ie)), ke === 64 || ke === 42 || ke === 19 || ke === 90 || ke === 130 || ke === 60)
- return !0;
- continue;
- case 126:
- Ie();
- continue;
- default:
- return !1;
- }
- }
- function d1() {
- return zt(bk);
- }
- function KS() {
- switch (Z()) {
- case 60:
- case 27:
- case 19:
- case 115:
- case 121:
- case 160:
- case 100:
- case 86:
- case 94:
- case 101:
- case 92:
- case 117:
- case 99:
- case 88:
- case 83:
- case 107:
- case 118:
- case 109:
- case 111:
- case 113:
- case 89:
- case 85:
- case 98:
- return !0;
- case 102:
- return d1() || zt(fr);
- case 87:
- case 95:
- return d1();
- case 134:
- case 138:
- case 120:
- case 144:
- case 145:
- case 156:
- case 162:
- return !0;
- case 129:
- case 125:
- case 123:
- case 124:
- case 126:
- case 148:
- return d1() || !zt(ZS);
- default:
- return gg();
- }
- }
- function v_() {
- return Ie(), Kt() || Z() === 19 || Z() === 23;
- }
- function p2() {
- return zt(v_);
- }
- function Sk() {
- return d2(
- /*disallowOf*/
- !0
- );
- }
- function d2(H) {
- return Ie(), H && Z() === 165 ? !1 : (Kt() || Z() === 19) && !t.hasPrecedingLineBreak();
- }
- function M_() {
- return zt(d2);
- }
- function Tk(H) {
- return Ie() === 160 ? d2(H) : !1;
- }
- function m1() {
- return zt(Tk);
- }
- function $f() {
- switch (Z()) {
- case 27:
- return XS();
- case 19:
- return hd(
- /*ignoreMissingOpenBrace*/
- !1
- );
- case 115:
- return Uv(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- case 121:
- if (p2())
- return Uv(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- break;
- case 135:
- if (m1())
- return Uv(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- break;
- case 160:
- if (M_())
- return Uv(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- break;
- case 100:
- return h2(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- case 86:
- return Li(
- U(),
- be(),
- /*modifiers*/
- void 0
- );
- case 101:
- return kl();
- case 92:
- return QS();
- case 117:
- return yg();
- case 99:
- return YS();
- case 88:
- return Wv(
- 251
- /* ContinueStatement */
- );
- case 83:
- return Wv(
- 252
- /* BreakStatement */
- );
- case 107:
- return Kh();
- case 118:
- return p1();
- case 109:
- return Pu();
- case 111:
- return L_();
- case 113:
- case 85:
- case 98:
- return yk();
- case 89:
- return vk();
- case 60:
- return g1();
- case 134:
- case 120:
- case 156:
- case 144:
- case 145:
- case 138:
- case 87:
- case 94:
- case 95:
- case 102:
- case 123:
- case 124:
- case 125:
- case 128:
- case 129:
- case 126:
- case 148:
- case 162:
- if (d1())
- return g1();
- break;
- }
- return K0();
- }
- function eT(H) {
- return H.kind === 138;
- }
- function g1() {
- const H = U(), ke = be(), We = Yt(
- /*allowDecorators*/
- !0
- );
- if (ut(We, eT)) {
- const Rt = hP(H);
- if (Rt)
- return Rt;
- for (const gr of We)
- gr.flags |= 33554432;
- return Hs(33554432, () => m2(H, ke, We));
- } else
- return m2(H, ke, We);
- }
- function hP(H) {
- return Hs(33554432, () => {
- const ke = yl(_r, H);
- if (ke)
- return so(ke);
- });
- }
- function m2(H, ke, We) {
- switch (Z()) {
- case 115:
- case 121:
- case 87:
- case 160:
- case 135:
- return Uv(H, ke, We);
- case 100:
- return h2(H, ke, We);
- case 86:
- return Li(H, ke, We);
- case 120:
- return nT(H, ke, We);
- case 156:
- return Hd(H, ke, We);
- case 94:
- return ry(H, ke, We);
- case 162:
- case 144:
- case 145:
- return aN(H, ke, We);
- case 102:
- return K6(H, ke, We);
- case 95:
- switch (Ie(), Z()) {
- case 90:
- case 64:
- return _N(H, ke, We);
- case 130:
- return vP(H, ke, We);
- default:
- return aT(H, ke, We);
- }
- default:
- if (We) {
- const gt = to(
- 282,
- /*reportAtCurrentPosition*/
- !0,
- p.Declaration_expected
- );
- return q4(gt, H), gt.modifiers = We, gt;
- }
- return;
- }
- }
- function tT() {
- return Ie() === 11;
- }
- function xk() {
- return Ie(), Z() === 161 || Z() === 64;
- }
- function ey() {
- return Ie(), !t.hasPrecedingLineBreak() && (hr() || Z() === 11);
- }
- function n_(H, ke) {
- if (Z() !== 19) {
- if (H & 4) {
- qh();
- return;
- }
- if (Na()) {
- Vi();
- return;
- }
- }
- return Z0(H, ke);
- }
- function lh() {
- const H = U();
- if (Z() === 28)
- return Bt(g.createOmittedExpression(), H);
- const ke = ca(
- 26
- /* DotDotDotToken */
- ), We = i_(), gt = Gh();
- return Bt(g.createBindingElement(
- ke,
- /*propertyName*/
- void 0,
- We,
- gt
- ), H);
- }
- function uh() {
- const H = U(), ke = ca(
- 26
- /* DotDotDotToken */
- ), We = Kt();
- let gt = zr(), Rt;
- We && Z() !== 59 ? (Rt = gt, gt = void 0) : (Ft(
- 59
- /* ColonToken */
- ), Rt = i_());
- const gr = Gh();
- return Bt(g.createBindingElement(ke, gt, Rt, gr), H);
- }
- function Y6() {
- const H = U();
- Ft(
- 19
- /* OpenBraceToken */
- );
- const ke = rr(() => vl(9, uh));
- return Ft(
- 20
- /* CloseBraceToken */
- ), Bt(g.createObjectBindingPattern(ke), H);
- }
- function Ra() {
- const H = U();
- Ft(
- 23
- /* OpenBracketToken */
- );
- const ke = rr(() => vl(10, lh));
- return Ft(
- 24
- /* CloseBracketToken */
- ), Bt(g.createArrayBindingPattern(ke), H);
- }
- function Tn() {
- return Z() === 19 || Z() === 23 || Z() === 81 || Kt();
- }
- function i_(H) {
- return Z() === 23 ? Ra() : Z() === 19 ? Y6() : of(H);
- }
- function Cf() {
- return g2(
- /*allowExclamation*/
- !0
- );
- }
- function g2(H) {
- const ke = U(), We = be(), gt = i_(p.Private_identifiers_are_not_allowed_in_variable_declarations);
- let Rt;
- H && gt.kind === 80 && Z() === 54 && !t.hasPrecedingLineBreak() && (Rt = Zc());
- const gr = Jd(), jn = jv(Z()) ? void 0 : Gh(), Pi = _e(gt, Rt, gr, jn);
- return Jr(Bt(Pi, ke), We);
- }
- function Z6(H) {
- const ke = U();
- let We = 0;
- switch (Z()) {
- case 115:
- break;
- case 121:
- We |= 1;
- break;
- case 87:
- We |= 2;
- break;
- case 160:
- We |= 4;
- break;
- case 135:
- E.assert(m1()), We |= 6, Ie();
- break;
- default:
- E.fail();
- }
- Ie();
- let gt;
- if (Z() === 165 && zt(kk))
- gt = r_();
- else {
- const Rt = $e();
- mn(H), gt = vl(
- 8,
- H ? g2 : Cf
- ), mn(Rt);
- }
- return Bt(he(gt, We), ke);
- }
- function kk() {
- return Wf() && Ie() === 22;
- }
- function Uv(H, ke, We) {
- const gt = Z6(
- /*inForStatementInitializer*/
- !1
- );
- Vi();
- const Rt = re(We, gt);
- return Jr(Bt(Rt, H), ke);
- }
- function h2(H, ke, We) {
- const gt = Vt(), Rt = mm(We);
- Ft(
- 100
- /* FunctionKeyword */
- );
- const gr = ca(
- 42
- /* AsteriskToken */
- ), jn = Rt & 2048 ? ch() : of(), Pi = gr ? 1 : 0, ui = Rt & 1024 ? 2 : 0, _i = N_();
- Rt & 32 && Oi(
- /*value*/
- !0
- );
- const Wi = Kp(Pi | ui), Ka = Zp(
- 59,
- /*isType*/
- !1
- ), eo = n_(Pi | ui, p.or_expected);
- Oi(gt);
- const wa = g.createFunctionDeclaration(We, gr, jn, _i, Wi, Ka, eo);
- return Jr(Bt(wa, H), ke);
- }
- function y2() {
- if (Z() === 137)
- return Ft(
- 137
- /* ConstructorKeyword */
- );
- if (Z() === 11 && zt(Ie) === 21)
- return mr(() => {
- const H = yt();
- return H.text === "constructor" ? H : void 0;
- });
- }
- function nd(H, ke, We) {
- return mr(() => {
- if (y2()) {
- const gt = N_(), Rt = Kp(
- 0
- /* None */
- ), gr = Zp(
- 59,
- /*isType*/
- !1
- ), jn = n_(0, p.or_expected), Pi = g.createConstructorDeclaration(We, Rt, jn);
- return Pi.typeParameters = gt, Pi.type = gr, Jr(Bt(Pi, H), ke);
- }
- });
- }
- function _f(H, ke, We, gt, Rt, gr, jn, Pi) {
- const ui = gt ? 1 : 0, _i = ut(We, tD) ? 2 : 0, Wi = N_(), Ka = Kp(ui | _i), eo = Zp(
- 59,
- /*isType*/
- !1
- ), wa = n_(ui | _i, Pi), xp = g.createMethodDeclaration(
- We,
- gt,
- Rt,
- gr,
- Wi,
- Ka,
- eo,
- wa
- );
- return xp.exclamationToken = jn, Jr(Bt(xp, H), ke);
- }
- function ff(H, ke, We, gt, Rt) {
- const gr = !Rt && !t.hasPrecedingLineBreak() ? ca(
- 54
- /* ExclamationToken */
- ) : void 0, jn = Jd(), Pi = Ws(90112, Gh);
- lc(gt, jn, Pi);
- const ui = g.createPropertyDeclaration(
- We,
- gt,
- Rt || gr,
- jn,
- Pi
- );
- return Jr(Bt(ui, H), ke);
- }
- function Vd(H, ke, We) {
- const gt = ca(
- 42
- /* AsteriskToken */
- ), Rt = zr(), gr = ca(
- 58
- /* QuestionToken */
- );
- return gt || Z() === 21 || Z() === 30 ? _f(
- H,
- ke,
- We,
- gt,
- Rt,
- gr,
- /*exclamationToken*/
- void 0,
- p.or_expected
- ) : ff(H, ke, We, Rt, gr);
- }
- function id(H, ke, We, gt, Rt) {
- const gr = zr(), jn = N_(), Pi = Kp(
- 0
- /* None */
- ), ui = Zp(
- 59,
- /*isType*/
- !1
- ), _i = n_(Rt), Wi = gt === 177 ? g.createGetAccessorDeclaration(We, gr, Pi, ui, _i) : g.createSetAccessorDeclaration(We, gr, Pi, _i);
- return Wi.typeParameters = jn, K_(Wi) && (Wi.type = ui), Jr(Bt(Wi, H), ke);
- }
- function rT() {
- let H;
- if (Z() === 60)
- return !0;
- for (; wy(Z()); ) {
- if (H = Z(), Sj(H))
- return !0;
- Ie();
- }
- if (Z() === 42 || (rt() && (H = Z(), Ie()), Z() === 23))
- return !0;
- if (H !== void 0) {
- if (!p_(H) || H === 153 || H === 139)
- return !0;
- switch (Z()) {
- case 21:
- case 30:
- case 54:
- case 59:
- case 64:
- case 58:
- return !0;
- default:
- return Na();
- }
- }
- return !1;
- }
- function ol(H, ke, We) {
- xs(
- 126
- /* StaticKeyword */
- );
- const gt = Ck(), Rt = Jr(Bt(g.createClassStaticBlockDeclaration(gt), H), ke);
- return Rt.modifiers = We, Rt;
- }
- function Ck() {
- const H = at(), ke = Vt();
- ti(!1), Oi(!0);
- const We = hd(
- /*ignoreMissingOpenBrace*/
- !1
- );
- return ti(H), Oi(ke), We;
- }
- function k() {
- if (Vt() && Z() === 135) {
- const H = U(), ke = Ao(p.Expression_expected);
- Ie();
- const We = oh(
- H,
- ke,
- /*allowOptionalChain*/
- !0
- );
- return Gf(H, We);
- }
- return u1();
- }
- function ce() {
- const H = U();
- if (!vi(
- 60
- /* AtToken */
- ))
- return;
- const ke = ze(k);
- return Bt(g.createDecorator(ke), H);
- }
- function pt(H, ke, We) {
- const gt = U(), Rt = Z();
- if (Z() === 87 && ke) {
- if (!mr(ri))
- return;
- } else {
- if (We && Z() === 126 && zt(qv))
- return;
- if (H && Z() === 126)
- return;
- if (!vc())
- return;
- }
- return Bt(I(Rt), gt);
- }
- function Yt(H, ke, We) {
- const gt = U();
- let Rt, gr, jn, Pi = !1, ui = !1, _i = !1;
- if (H && Z() === 60)
- for (; gr = ce(); )
- Rt = wr(Rt, gr);
- for (; jn = pt(Pi, ke, We); )
- jn.kind === 126 && (Pi = !0), Rt = wr(Rt, jn), ui = !0;
- if (ui && H && Z() === 60)
- for (; gr = ce(); )
- Rt = wr(Rt, gr), _i = !0;
- if (_i)
- for (; jn = pt(Pi, ke, We); )
- jn.kind === 126 && (Pi = !0), Rt = wr(Rt, jn);
- return Rt && ba(Rt, gt);
- }
- function ai() {
- let H;
- if (Z() === 134) {
- const ke = U();
- Ie();
- const We = Bt(I(
- 134
- /* AsyncKeyword */
- ), ke);
- H = ba([We], ke);
- }
- return H;
- }
- function qi() {
- const H = U(), ke = be();
- if (Z() === 27)
- return Ie(), Jr(Bt(g.createSemicolonClassElement(), H), ke);
- const We = Yt(
- /*allowDecorators*/
- !0,
- /*permitConstAsModifier*/
- !0,
- /*stopOnStartOfClassStaticBlock*/
- !0
- );
- if (Z() === 126 && zt(qv))
- return ol(H, ke, We);
- if (An(
- 139
- /* GetKeyword */
- ))
- return id(
- H,
- ke,
- We,
- 177,
- 0
- /* None */
- );
- if (An(
- 153
- /* SetKeyword */
- ))
- return id(
- H,
- ke,
- We,
- 178,
- 0
- /* None */
- );
- if (Z() === 137 || Z() === 11) {
- const gt = nd(H, ke, We);
- if (gt)
- return gt;
- }
- if (mg())
- return Ov(H, ke, We);
- if (c_(Z()) || Z() === 11 || Z() === 9 || Z() === 10 || Z() === 42 || Z() === 23)
- if (ut(We, eT)) {
- for (const Rt of We)
- Rt.flags |= 33554432;
- return Hs(33554432, () => Vd(H, ke, We));
- } else
- return Vd(H, ke, We);
- if (We) {
- const gt = to(
- 80,
- /*reportAtCurrentPosition*/
- !0,
- p.Declaration_expected
- );
- return ff(
- H,
- ke,
- We,
- gt,
- /*questionToken*/
- void 0
- );
- }
- return E.fail("Should not have attempted to parse class member declaration.");
- }
- function Ki() {
- const H = U(), ke = be(), We = Yt(
- /*allowDecorators*/
- !0
- );
- if (Z() === 86)
- return Wu(
- H,
- ke,
- We,
- 231
- /* ClassExpression */
- );
- const gt = to(
- 282,
- /*reportAtCurrentPosition*/
- !0,
- p.Expression_expected
- );
- return q4(gt, H), gt.modifiers = We, gt;
- }
- function Hi() {
- return Wu(
- U(),
- be(),
- /*modifiers*/
- void 0,
- 231
- /* ClassExpression */
- );
- }
- function Li(H, ke, We) {
- return Wu(
- H,
- ke,
- We,
- 263
- /* ClassDeclaration */
- );
- }
- function Wu(H, ke, We, gt) {
- const Rt = Vt();
- Ft(
- 86
- /* ClassKeyword */
- );
- const gr = Ml(), jn = N_();
- ut(We, Cx) && Oi(
- /*value*/
- !0
- );
- const Pi = ty();
- let ui;
- Ft(
- 19
- /* OpenBraceToken */
- ) ? (ui = Ek(), Ft(
- 20
- /* CloseBraceToken */
- )) : ui = r_(), Oi(Rt);
- const _i = gt === 263 ? g.createClassDeclaration(We, gr, jn, Pi, ui) : g.createClassExpression(We, gr, jn, Pi, ui);
- return Jr(Bt(_i, H), ke);
- }
- function Ml() {
- return Kt() && !qd() ? Wc(Kt()) : void 0;
- }
- function qd() {
- return Z() === 119 && zt(Lc);
- }
- function ty() {
- if (b2())
- return ka(22, pf);
- }
- function pf() {
- const H = U(), ke = Z();
- E.assert(
- ke === 96 || ke === 119
- /* ImplementsKeyword */
- ), Ie();
- const We = vl(7, v2);
- return Bt(g.createHeritageClause(ke, We), H);
- }
- function v2() {
- const H = U(), ke = u1();
- if (ke.kind === 233)
- return ke;
- const We = Vv();
- return Bt(g.createExpressionWithTypeArguments(ke, We), H);
- }
- function Vv() {
- return Z() === 30 ? Vf(
- 20,
- xl,
- 30,
- 32
- /* GreaterThanToken */
- ) : void 0;
- }
- function b2() {
- return Z() === 96 || Z() === 119;
- }
- function Ek() {
- return ka(5, qi);
- }
- function nT(H, ke, We) {
- Ft(
- 120
- /* InterfaceKeyword */
- );
- const gt = Ao(), Rt = N_(), gr = ty(), jn = kr(), Pi = g.createInterfaceDeclaration(We, gt, Rt, gr, jn);
- return Jr(Bt(Pi, H), ke);
- }
- function Hd(H, ke, We) {
- Ft(
- 156
- /* TypeKeyword */
- ), t.hasPrecedingLineBreak() && Zt(p.Line_break_not_permitted_here);
- const gt = Ao(), Rt = N_();
- Ft(
- 64
- /* EqualsToken */
- );
- const gr = Z() === 141 && mr(zu) || xl();
- Vi();
- const jn = g.createTypeAliasDeclaration(We, gt, Rt, gr);
- return Jr(Bt(jn, H), ke);
- }
- function _h() {
- const H = U(), ke = be(), We = zr(), gt = rr(Gh);
- return Jr(Bt(g.createEnumMember(We, gt), H), ke);
- }
- function ry(H, ke, We) {
- Ft(
- 94
- /* EnumKeyword */
- );
- const gt = Ao();
- let Rt;
- Ft(
- 19
- /* OpenBraceToken */
- ) ? (Rt = Ke(() => vl(6, _h)), Ft(
- 20
- /* CloseBraceToken */
- )) : Rt = r_();
- const gr = g.createEnumDeclaration(We, gt, Rt);
- return Jr(Bt(gr, H), ke);
- }
- function Dk() {
- const H = U();
- let ke;
- return Ft(
- 19
- /* OpenBraceToken */
- ) ? (ke = ka(1, $f), Ft(
- 20
- /* CloseBraceToken */
- )) : ke = r_(), Bt(g.createModuleBlock(ke), H);
- }
- function h1(H, ke, We, gt) {
- const Rt = gt & 32, gr = gt & 8 ? ge() : Ao(), jn = vi(
- 25
- /* DotToken */
- ) ? h1(
- U(),
- /*hasJSDoc*/
- !1,
- /*modifiers*/
- void 0,
- 8 | Rt
- ) : Dk(), Pi = g.createModuleDeclaration(We, gr, jn, gt);
- return Jr(Bt(Pi, H), ke);
- }
- function yP(H, ke, We) {
- let gt = 0, Rt;
- Z() === 162 ? (Rt = Ao(), gt |= 2048) : (Rt = yt(), Rt.text = _u(Rt.text));
- let gr;
- Z() === 19 ? gr = Dk() : Vi();
- const jn = g.createModuleDeclaration(We, Rt, gr, gt);
- return Jr(Bt(jn, H), ke);
- }
- function aN(H, ke, We) {
- let gt = 0;
- if (Z() === 162)
- return yP(H, ke, We);
- if (vi(
- 145
- /* NamespaceKeyword */
- ))
- gt |= 32;
- else if (Ft(
- 144
- /* ModuleKeyword */
- ), Z() === 11)
- return yP(H, ke, We);
- return h1(H, ke, We, gt);
- }
- function oN() {
- return Z() === 149 && zt(Ji);
- }
- function Ji() {
- return Ie() === 21;
- }
- function qv() {
- return Ie() === 19;
- }
- function Hr() {
- return Ie() === 44;
- }
- function vP(H, ke, We) {
- Ft(
- 130
- /* AsKeyword */
- ), Ft(
- 145
- /* NamespaceKeyword */
- );
- const gt = Ao();
- Vi();
- const Rt = g.createNamespaceExportDeclaration(gt);
- return Rt.modifiers = We, Jr(Bt(Rt, H), ke);
- }
- function K6(H, ke, We) {
- Ft(
- 102
- /* ImportKeyword */
- );
- const gt = t.getTokenFullStart();
- let Rt;
- hr() && (Rt = Ao());
- let gr = !1;
- if (Rt?.escapedText === "type" && (Z() !== 161 || hr() && zt(xk)) && (hr() || SL()) && (gr = !0, Rt = hr() ? Ao() : void 0), Rt && !Lm())
- return TL(H, ke, We, Rt, gr);
- const jn = y1(Rt, gt, gr), Pi = sT(), ui = eE();
- Vi();
- const _i = g.createImportDeclaration(We, jn, Pi, ui);
- return Jr(Bt(_i, H), ke);
- }
- function y1(H, ke, We, gt = !1) {
- let Rt;
- return (H || // import id
- Z() === 42 || // import *
- Z() === 19) && (Rt = SP(H, ke, We, gt), Ft(
- 161
- /* FromKeyword */
- )), Rt;
- }
- function eE() {
- const H = Z();
- if ((H === 118 || H === 132) && !t.hasPrecedingLineBreak())
- return bP(H);
- }
- function cN() {
- const H = U(), ke = c_(Z()) ? ge() : ns(
- 11
- /* StringLiteral */
- );
- Ft(
- 59
- /* ColonToken */
- );
- const We = O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- );
- return Bt(g.createImportAttribute(ke, We), H);
- }
- function bP(H, ke) {
- const We = U();
- ke || Ft(H);
- const gt = t.getTokenStart();
- if (Ft(
- 19
- /* OpenBraceToken */
- )) {
- const Rt = t.hasPrecedingLineBreak(), gr = vl(
- 24,
- cN,
- /*considerSemicolonAsDelimiter*/
- !0
- );
- if (!Ft(
- 20
- /* CloseBraceToken */
- )) {
- const jn = Ro(fe);
- jn && jn.code === p._0_expected.code && Rs(
- jn,
- fx(le, ve, gt, 1, p.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
- );
- }
- return Bt(g.createImportAttributes(gr, Rt, H), We);
- } else {
- const Rt = ba(
- [],
- U(),
- /*end*/
- void 0,
- /*hasTrailingComma*/
- !1
- );
- return Bt(g.createImportAttributes(
- Rt,
- /*multiLine*/
- !1,
- H
- ), We);
- }
- }
- function SL() {
- return Z() === 42 || Z() === 19;
- }
- function Lm() {
- return Z() === 28 || Z() === 161;
- }
- function TL(H, ke, We, gt, Rt) {
- Ft(
- 64
- /* EqualsToken */
- );
- const gr = xL();
- Vi();
- const jn = g.createImportEqualsDeclaration(We, Rt, gt, gr);
- return Jr(Bt(jn, H), ke);
- }
- function SP(H, ke, We, gt) {
- let Rt;
- return (!H || vi(
- 28
- /* CommaToken */
- )) && (gt && t.setSkipJsDocLeadingAsterisks(!0), Rt = Z() === 42 ? lN() : tE(
- 275
- /* NamedImports */
- ), gt && t.setSkipJsDocLeadingAsterisks(!1)), Bt(g.createImportClause(We, H, Rt), ke);
- }
- function xL() {
- return oN() ? iT() : Y(
- /*allowReservedWords*/
- !1
- );
- }
- function iT() {
- const H = U();
- Ft(
- 149
- /* RequireKeyword */
- ), Ft(
- 21
- /* OpenParenToken */
- );
- const ke = sT();
- return Ft(
- 22
- /* CloseParenToken */
- ), Bt(g.createExternalModuleReference(ke), H);
- }
- function sT() {
- if (Z() === 11) {
- const H = yt();
- return H.text = _u(H.text), H;
- } else
- return fu();
- }
- function lN() {
- const H = U();
- Ft(
- 42
- /* AsteriskToken */
- ), Ft(
- 130
- /* AsKeyword */
- );
- const ke = Ao();
- return Bt(g.createNamespaceImport(ke), H);
- }
- function v1() {
- return c_(Z()) || Z() === 11;
- }
- function yd(H) {
- return Z() === 11 ? yt() : H();
- }
- function tE(H) {
- const ke = U(), We = H === 275 ? g.createNamedImports(Vf(
- 23,
- b1,
- 19,
- 20
- /* CloseBraceToken */
- )) : g.createNamedExports(Vf(
- 23,
- vg,
- 19,
- 20
- /* CloseBraceToken */
- ));
- return Bt(We, ke);
- }
- function vg() {
- const H = be();
- return Jr(uN(
- 281
- /* ExportSpecifier */
- ), H);
- }
- function b1() {
- return uN(
- 276
- /* ImportSpecifier */
- );
- }
- function uN(H) {
- const ke = U();
- let We = p_(Z()) && !hr(), gt = t.getTokenStart(), Rt = t.getTokenEnd(), gr = !1, jn, Pi = !0, ui = yd(ge);
- if (ui.kind === 80 && ui.escapedText === "type")
- if (Z() === 130) {
- const Ka = ge();
- if (Z() === 130) {
- const eo = ge();
- v1() ? (gr = !0, jn = Ka, ui = yd(Wi), Pi = !1) : (jn = ui, ui = eo, Pi = !1);
- } else v1() ? (jn = ui, Pi = !1, ui = yd(Wi)) : (gr = !0, ui = Ka);
- } else v1() && (gr = !0, ui = yd(Wi));
- Pi && Z() === 130 && (jn = ui, Ft(
- 130
- /* AsKeyword */
- ), ui = yd(Wi)), H === 276 && (ui.kind !== 80 ? (M(aa(ve, ui.pos), ui.end, p.Identifier_expected), ui = wd(to(
- 80,
- /*reportAtCurrentPosition*/
- !1
- ), ui.pos, ui.pos)) : We && M(gt, Rt, p.Identifier_expected));
- const _i = H === 276 ? g.createImportSpecifier(gr, jn, ui) : g.createExportSpecifier(gr, jn, ui);
- return Bt(_i, ke);
- function Wi() {
- return We = p_(Z()) && !hr(), gt = t.getTokenStart(), Rt = t.getTokenEnd(), ge();
- }
- }
- function bg(H) {
- return Bt(g.createNamespaceExport(yd(ge)), H);
- }
- function aT(H, ke, We) {
- const gt = Vt();
- Oi(
- /*value*/
- !0
- );
- let Rt, gr, jn;
- const Pi = vi(
- 156
- /* TypeKeyword */
- ), ui = U();
- vi(
- 42
- /* AsteriskToken */
- ) ? (vi(
- 130
- /* AsKeyword */
- ) && (Rt = bg(ui)), Ft(
- 161
- /* FromKeyword */
- ), gr = sT()) : (Rt = tE(
- 279
- /* NamedExports */
- ), (Z() === 161 || Z() === 11 && !t.hasPrecedingLineBreak()) && (Ft(
- 161
- /* FromKeyword */
- ), gr = sT()));
- const _i = Z();
- gr && (_i === 118 || _i === 132) && !t.hasPrecedingLineBreak() && (jn = bP(_i)), Vi(), Oi(gt);
- const Wi = g.createExportDeclaration(We, Pi, Rt, gr, jn);
- return Jr(Bt(Wi, H), ke);
- }
- function _N(H, ke, We) {
- const gt = Vt();
- Oi(
- /*value*/
- !0
- );
- let Rt;
- vi(
- 64
- /* EqualsToken */
- ) ? Rt = !0 : Ft(
- 90
- /* DefaultKeyword */
- );
- const gr = O_(
- /*allowReturnTypeInArrowFunction*/
- !0
- );
- Vi(), Oi(gt);
- const jn = g.createExportAssignment(We, Rt, gr);
- return Jr(Bt(jn, H), ke);
- }
- let Rc;
- ((H) => {
- H[H.SourceElements = 0] = "SourceElements", H[H.BlockStatements = 1] = "BlockStatements", H[H.SwitchClauses = 2] = "SwitchClauses", H[H.SwitchClauseStatements = 3] = "SwitchClauseStatements", H[H.TypeMembers = 4] = "TypeMembers", H[H.ClassMembers = 5] = "ClassMembers", H[H.EnumMembers = 6] = "EnumMembers", H[H.HeritageClauseElement = 7] = "HeritageClauseElement", H[H.VariableDeclarations = 8] = "VariableDeclarations", H[H.ObjectBindingElements = 9] = "ObjectBindingElements", H[H.ArrayBindingElements = 10] = "ArrayBindingElements", H[H.ArgumentExpressions = 11] = "ArgumentExpressions", H[H.ObjectLiteralMembers = 12] = "ObjectLiteralMembers", H[H.JsxAttributes = 13] = "JsxAttributes", H[H.JsxChildren = 14] = "JsxChildren", H[H.ArrayLiteralMembers = 15] = "ArrayLiteralMembers", H[H.Parameters = 16] = "Parameters", H[H.JSDocParameters = 17] = "JSDocParameters", H[H.RestProperties = 18] = "RestProperties", H[H.TypeParameters = 19] = "TypeParameters", H[H.TypeArguments = 20] = "TypeArguments", H[H.TupleElementTypes = 21] = "TupleElementTypes", H[H.HeritageClauses = 22] = "HeritageClauses", H[H.ImportOrExportSpecifiers = 23] = "ImportOrExportSpecifiers", H[H.ImportAttributes = 24] = "ImportAttributes", H[H.JSDocComment = 25] = "JSDocComment", H[H.Count = 26] = "Count";
- })(Rc || (Rc = {}));
- let Pk;
- ((H) => {
- H[H.False = 0] = "False", H[H.True = 1] = "True", H[H.Unknown = 2] = "Unknown";
- })(Pk || (Pk = {}));
- let Wa;
- ((H) => {
- function ke(_i, Wi, Ka) {
- ki(
- "file.js",
- _i,
- 99,
- /*syntaxCursor*/
- void 0,
- 1,
- 0
- /* ParseAll */
- ), t.setText(_i, Wi, Ka), et = t.scan();
- const eo = We(), wa = Ot(
- "file.js",
- 99,
- 1,
- /*isDeclarationFile*/
- !1,
- [],
- I(
- 1
- /* EndOfFileToken */
- ),
- 0,
- ja
- ), xp = px(fe, wa);
- return Me && (wa.jsDocDiagnostics = px(Me, wa)), rs(), eo ? { jsDocTypeExpression: eo, diagnostics: xp } : void 0;
- }
- H.parseJSDocTypeExpressionForTests = ke;
- function We(_i) {
- const Wi = U(), Ka = (_i ? vi : Ft)(
- 19
- /* OpenBraceToken */
- ), eo = Hs(16777216, Sp);
- (!_i || Ka) && Ic(
- 20
- /* CloseBraceToken */
- );
- const wa = g.createJSDocTypeExpression(eo);
- return Fe(wa), Bt(wa, Wi);
- }
- H.parseJSDocTypeExpression = We;
- function gt() {
- const _i = U(), Wi = vi(
- 19
- /* OpenBraceToken */
- ), Ka = U();
- let eo = Y(
- /*allowReservedWords*/
- !1
- );
- for (; Z() === 81; )
- wt(), At(), eo = Bt(g.createJSDocMemberName(eo, Ao()), Ka);
- Wi && Ic(
- 20
- /* CloseBraceToken */
- );
- const wa = g.createJSDocNameReference(eo);
- return Fe(wa), Bt(wa, _i);
- }
- H.parseJSDocNameReference = gt;
- function Rt(_i, Wi, Ka) {
- ki(
- "",
- _i,
- 99,
- /*syntaxCursor*/
- void 0,
- 1,
- 0
- /* ParseAll */
- );
- const eo = Hs(16777216, () => ui(Wi, Ka)), xp = px(fe, { languageVariant: 0, text: _i });
- return rs(), eo ? { jsDoc: eo, diagnostics: xp } : void 0;
- }
- H.parseIsolatedJSDocComment = Rt;
- function gr(_i, Wi, Ka) {
- const eo = et, wa = fe.length, xp = Qt, cl = Hs(16777216, () => ui(Wi, Ka));
- return Aa(cl, _i), jr & 524288 && (Me || (Me = []), Fn(Me, fe, wa)), et = eo, fe.length = wa, Qt = xp, cl;
- }
- H.parseJSDocComment = gr;
- let jn;
- ((_i) => {
- _i[_i.BeginningOfLine = 0] = "BeginningOfLine", _i[_i.SawAsterisk = 1] = "SawAsterisk", _i[_i.SavingComments = 2] = "SavingComments", _i[_i.SavingBackticks = 3] = "SavingBackticks";
- })(jn || (jn = {}));
- let Pi;
- ((_i) => {
- _i[_i.Property = 1] = "Property", _i[_i.Parameter = 2] = "Parameter", _i[_i.CallbackParameter = 4] = "CallbackParameter";
- })(Pi || (Pi = {}));
- function ui(_i = 0, Wi) {
- const Ka = ve, eo = Wi === void 0 ? Ka.length : _i + Wi;
- if (Wi = eo - _i, E.assert(_i >= 0), E.assert(_i <= eo), E.assert(eo <= Ka.length), !oz(Ka, _i))
- return;
- let wa, xp, cl, Xf, e0, fh = [];
- const S1 = [], kL = _r;
- _r |= 1 << 25;
- const Oa = t.scanRange(_i + 3, Wi - 5, Kc);
- return _r = kL, Oa;
- function Kc() {
- let Cr = 1, Pn, Mn = _i - (Ka.lastIndexOf(`
-`, _i) + 1) + 4;
- function mi(oo) {
- Pn || (Pn = Mn), fh.push(oo), Mn += oo.length;
- }
- for (At(); vd(
- 5
- /* WhitespaceTrivia */
- ); ) ;
- vd(
- 4
- /* NewLineTrivia */
- ) && (Cr = 0, Mn = 0);
- e:
- for (; ; ) {
- switch (Z()) {
- case 60:
- S2(fh), e0 || (e0 = U()), ts(on(Mn)), Cr = 0, Pn = void 0;
- break;
- case 4:
- fh.push(t.getTokenText()), Cr = 0, Mn = 0;
- break;
- case 42:
- const oo = t.getTokenText();
- Cr === 1 ? (Cr = 2, mi(oo)) : (E.assert(
- Cr === 0
- /* BeginningOfLine */
- ), Cr = 1, Mn += oo.length);
- break;
- case 5:
- E.assert(Cr !== 2, "whitespace shouldn't come from the scanner while saving top-level comment text");
- const No = t.getTokenText();
- Pn !== void 0 && Mn + No.length > Pn && fh.push(No.slice(Pn - Mn)), Mn += No.length;
- break;
- case 1:
- break e;
- case 82:
- Cr = 2, mi(t.getTokenValue());
- break;
- case 19:
- Cr = 2;
- const Tg = t.getTokenFullStart(), Rm = t.getTokenEnd() - 1, Gd = R(Rm);
- if (Gd) {
- Xf || t0(fh), S1.push(Bt(g.createJSDocText(fh.join("")), Xf ?? _i, Tg)), S1.push(Gd), fh = [], Xf = t.getTokenEnd();
- break;
- }
- default:
- Cr = 2, mi(t.getTokenText());
- break;
- }
- Cr === 2 ? Dr(
- /*inBackticks*/
- !1
- ) : At();
- }
- const oi = fh.join("").trimEnd();
- S1.length && oi.length && S1.push(Bt(g.createJSDocText(oi), Xf ?? _i, e0)), S1.length && wa && E.assertIsDefined(e0, "having parsed tags implies that the end of the comment span should be set");
- const Fa = wa && ba(wa, xp, cl);
- return Bt(g.createJSDocComment(S1.length ? ba(S1, _i, e0) : oi.length ? oi : void 0, Fa), _i, eo);
- }
- function t0(Cr) {
- for (; Cr.length && (Cr[0] === `
-` || Cr[0] === "\r"); )
- Cr.shift();
- }
- function S2(Cr) {
- for (; Cr.length; ) {
- const Pn = Cr[Cr.length - 1].trimEnd();
- if (Pn === "")
- Cr.pop();
- else if (Pn.length < Cr[Cr.length - 1].length) {
- Cr[Cr.length - 1] = Pn;
- break;
- } else
- break;
- }
- }
- function TP() {
- for (; ; ) {
- if (At(), Z() === 1)
- return !0;
- if (!(Z() === 5 || Z() === 4))
- return !1;
- }
- }
- function Ef() {
- if (!((Z() === 5 || Z() === 4) && zt(TP)))
- for (; Z() === 5 || Z() === 4; )
- At();
- }
- function Hv() {
- if ((Z() === 5 || Z() === 4) && zt(TP))
- return "";
- let Cr = t.hasPrecedingLineBreak(), Pn = !1, Mn = "";
- for (; Cr && Z() === 42 || Z() === 5 || Z() === 4; )
- Mn += t.getTokenText(), Z() === 4 ? (Cr = !0, Pn = !0, Mn = "") : Z() === 42 && (Cr = !1), At();
- return Pn ? Mn : "";
- }
- function on(Cr) {
- E.assert(
- Z() === 60
- /* AtToken */
- );
- const Pn = t.getTokenStart();
- At();
- const Mn = Gv(
- /*message*/
- void 0
- ), mi = Hv();
- let oi;
- switch (Mn.escapedText) {
- case "author":
- oi = T_e(Pn, Mn, Cr, mi);
- break;
- case "implements":
- oi = fN(Pn, Mn, Cr, mi);
- break;
- case "augments":
- case "extends":
- oi = oG(Pn, Mn, Cr, mi);
- break;
- case "class":
- case "constructor":
- oi = wk(Pn, g.createJSDocClassTag, Mn, Cr, mi);
- break;
- case "public":
- oi = wk(Pn, g.createJSDocPublicTag, Mn, Cr, mi);
- break;
- case "private":
- oi = wk(Pn, g.createJSDocPrivateTag, Mn, Cr, mi);
- break;
- case "protected":
- oi = wk(Pn, g.createJSDocProtectedTag, Mn, Cr, mi);
- break;
- case "readonly":
- oi = wk(Pn, g.createJSDocReadonlyTag, Mn, Cr, mi);
- break;
- case "override":
- oi = wk(Pn, g.createJSDocOverrideTag, Mn, Cr, mi);
- break;
- case "deprecated":
- Ri = !0, oi = wk(Pn, g.createJSDocDeprecatedTag, Mn, Cr, mi);
- break;
- case "this":
- oi = _G(Pn, Mn, Cr, mi);
- break;
- case "enum":
- oi = k_e(Pn, Mn, Cr, mi);
- break;
- case "arg":
- case "argument":
- case "param":
- return Qf(Pn, Mn, 2, Cr);
- case "return":
- case "returns":
- oi = S_e(Pn, Mn, Cr, mi);
- break;
- case "template":
- oi = EL(Pn, Mn, Cr, mi);
- break;
- case "type":
- oi = aG(Pn, Mn, Cr, mi);
- break;
- case "typedef":
- oi = nE(Pn, Mn, Cr, mi);
- break;
- case "callback":
- oi = nn(Pn, Mn, Cr, mi);
- break;
- case "overload":
- oi = x1(Pn, Mn, Cr, mi);
- break;
- case "satisfies":
- oi = cG(Pn, Mn, Cr, mi);
- break;
- case "see":
- oi = oT(Pn, Mn, Cr, mi);
- break;
- case "exception":
- case "throws":
- oi = xP(Pn, Mn, Cr, mi);
- break;
- case "import":
- oi = kP(Pn, Mn, Cr, mi);
- break;
- default:
- oi = pn(Pn, Mn, Cr, mi);
- break;
- }
- return oi;
- }
- function v(Cr, Pn, Mn, mi) {
- return mi || (Mn += Pn - Cr), w(Mn, mi.slice(Mn));
- }
- function w(Cr, Pn) {
- const Mn = U();
- let mi = [];
- const oi = [];
- let Fa, oo = 0, No;
- function Tg(jm) {
- No || (No = Cr), mi.push(jm), Cr += jm.length;
- }
- Pn !== void 0 && (Pn !== "" && Tg(Pn), oo = 1);
- let Rm = Z();
- e:
- for (; ; ) {
- switch (Rm) {
- case 4:
- oo = 0, mi.push(t.getTokenText()), Cr = 0;
- break;
- case 60:
- t.resetTokenState(t.getTokenEnd() - 1);
- break e;
- case 1:
- break e;
- case 5:
- E.assert(oo !== 2 && oo !== 3, "whitespace shouldn't come from the scanner while saving comment text");
- const jm = t.getTokenText();
- No !== void 0 && Cr + jm.length > No && (mi.push(jm.slice(No - Cr)), oo = 2), Cr += jm.length;
- break;
- case 19:
- oo = 2;
- const dN = t.getTokenFullStart(), aE = t.getTokenEnd() - 1, b_ = R(aE);
- b_ ? (oi.push(Bt(g.createJSDocText(mi.join("")), Fa ?? Mn, dN)), oi.push(b_), mi = [], Fa = t.getTokenEnd()) : Tg(t.getTokenText());
- break;
- case 62:
- oo === 3 ? oo = 2 : oo = 3, Tg(t.getTokenText());
- break;
- case 82:
- oo !== 3 && (oo = 2), Tg(t.getTokenValue());
- break;
- case 42:
- if (oo === 0) {
- oo = 1, Cr += 1;
- break;
- }
- default:
- oo !== 3 && (oo = 2), Tg(t.getTokenText());
- break;
- }
- oo === 2 || oo === 3 ? Rm = Dr(
- oo === 3
- /* SavingBackticks */
- ) : Rm = At();
- }
- t0(mi);
- const Gd = mi.join("").trimEnd();
- if (oi.length)
- return Gd.length && oi.push(Bt(g.createJSDocText(Gd), Fa ?? Mn)), ba(oi, Mn, t.getTokenEnd());
- if (Gd.length)
- return Gd;
- }
- function R(Cr) {
- const Pn = mr(Be);
- if (!Pn)
- return;
- At(), Ef();
- const Mn = se(), mi = [];
- for (; Z() !== 20 && Z() !== 4 && Z() !== 1; )
- mi.push(t.getTokenText()), At();
- const oi = Pn === "link" ? g.createJSDocLink : Pn === "linkcode" ? g.createJSDocLinkCode : g.createJSDocLinkPlain;
- return Bt(oi(Mn, mi.join("")), Cr, t.getTokenEnd());
- }
- function se() {
- if (c_(Z())) {
- const Cr = U();
- let Pn = ge();
- for (; vi(
- 25
- /* DotToken */
- ); )
- Pn = Bt(g.createQualifiedName(Pn, Z() === 81 ? to(
- 80,
- /*reportAtCurrentPosition*/
- !1
- ) : ge()), Cr);
- for (; Z() === 81; )
- wt(), At(), Pn = Bt(g.createJSDocMemberName(Pn, Ao()), Cr);
- return Pn;
- }
- }
- function Be() {
- if (Hv(), Z() === 19 && At() === 60 && c_(At())) {
- const Cr = t.getTokenValue();
- if (Lt(Cr)) return Cr;
- }
- }
- function Lt(Cr) {
- return Cr === "link" || Cr === "linkcode" || Cr === "linkplain";
- }
- function pn(Cr, Pn, Mn, mi) {
- return Bt(g.createJSDocUnknownTag(Pn, v(Cr, U(), Mn, mi)), Cr);
- }
- function ts(Cr) {
- Cr && (wa ? wa.push(Cr) : (wa = [Cr], xp = Cr.pos), cl = Cr.end);
- }
- function ao() {
- return Hv(), Z() === 19 ? We() : void 0;
- }
- function kp() {
- const Cr = vd(
- 23
- /* OpenBracketToken */
- );
- Cr && Ef();
- const Pn = vd(
- 62
- /* BacktickToken */
- ), Mn = E_e();
- return Pn && Cu(
- 62
- /* BacktickToken */
- ), Cr && (Ef(), ca(
- 64
- /* EqualsToken */
- ) && fu(), Ft(
- 24
- /* CloseBracketToken */
- )), { name: Mn, isBracketed: Cr };
- }
- function Sg(Cr) {
- switch (Cr.kind) {
- case 151:
- return !0;
- case 188:
- return Sg(Cr.elementType);
- default:
- return vf(Cr) && Oe(Cr.typeName) && Cr.typeName.escapedText === "Object" && !Cr.typeArguments;
- }
- }
- function Qf(Cr, Pn, Mn, mi) {
- let oi = ao(), Fa = !oi;
- Hv();
- const { name: oo, isBracketed: No } = kp(), Tg = Hv();
- Fa && !zt(Be) && (oi = ao());
- const Rm = v(Cr, U(), mi, Tg), Gd = rE(oi, oo, Mn, mi);
- Gd && (oi = Gd, Fa = !0);
- const jm = Mn === 1 ? g.createJSDocPropertyTag(Pn, oo, No, oi, Fa, Rm) : g.createJSDocParameterTag(Pn, oo, No, oi, Fa, Rm);
- return Bt(jm, Cr);
- }
- function rE(Cr, Pn, Mn, mi) {
- if (Cr && Sg(Cr.type)) {
- const oi = U();
- let Fa, oo;
- for (; Fa = mr(() => cT(Mn, mi, Pn)); )
- Fa.kind === 341 || Fa.kind === 348 ? oo = wr(oo, Fa) : Fa.kind === 345 && Ae(Fa.tagName, p.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
- if (oo) {
- const No = Bt(g.createJSDocTypeLiteral(
- oo,
- Cr.type.kind === 188
- /* ArrayType */
- ), oi);
- return Bt(g.createJSDocTypeExpression(No), oi);
- }
- }
- }
- function S_e(Cr, Pn, Mn, mi) {
- ut(wa, nO) && M(Pn.pos, t.getTokenStart(), p._0_tag_already_specified, Ei(Pn.escapedText));
- const oi = ao();
- return Bt(g.createJSDocReturnTag(Pn, oi, v(Cr, U(), Mn, mi)), Cr);
- }
- function aG(Cr, Pn, Mn, mi) {
- ut(wa, fD) && M(Pn.pos, t.getTokenStart(), p._0_tag_already_specified, Ei(Pn.escapedText));
- const oi = We(
- /*mayOmitBraces*/
- !0
- ), Fa = Mn !== void 0 && mi !== void 0 ? v(Cr, U(), Mn, mi) : void 0;
- return Bt(g.createJSDocTypeTag(Pn, oi, Fa), Cr);
- }
- function oT(Cr, Pn, Mn, mi) {
- const Fa = Z() === 23 || zt(() => At() === 60 && c_(At()) && Lt(t.getTokenValue())) ? void 0 : gt(), oo = Mn !== void 0 && mi !== void 0 ? v(Cr, U(), Mn, mi) : void 0;
- return Bt(g.createJSDocSeeTag(Pn, Fa, oo), Cr);
- }
- function xP(Cr, Pn, Mn, mi) {
- const oi = ao(), Fa = v(Cr, U(), Mn, mi);
- return Bt(g.createJSDocThrowsTag(Pn, oi, Fa), Cr);
- }
- function T_e(Cr, Pn, Mn, mi) {
- const oi = U(), Fa = x_e();
- let oo = t.getTokenFullStart();
- const No = v(Cr, oo, Mn, mi);
- No || (oo = t.getTokenFullStart());
- const Tg = typeof No != "string" ? ba(Qi([Bt(Fa, oi, oo)], No), oi) : Fa.text + No;
- return Bt(g.createJSDocAuthorTag(Pn, Tg), Cr);
- }
- function x_e() {
- const Cr = [];
- let Pn = !1, Mn = t.getToken();
- for (; Mn !== 1 && Mn !== 4; ) {
- if (Mn === 30)
- Pn = !0;
- else {
- if (Mn === 60 && !Pn)
- break;
- if (Mn === 32 && Pn) {
- Cr.push(t.getTokenText()), t.resetTokenState(t.getTokenEnd());
- break;
- }
- }
- Cr.push(t.getTokenText()), Mn = At();
- }
- return g.createJSDocText(Cr.join(""));
- }
- function fN(Cr, Pn, Mn, mi) {
- const oi = lG();
- return Bt(g.createJSDocImplementsTag(Pn, oi, v(Cr, U(), Mn, mi)), Cr);
- }
- function oG(Cr, Pn, Mn, mi) {
- const oi = lG();
- return Bt(g.createJSDocAugmentsTag(Pn, oi, v(Cr, U(), Mn, mi)), Cr);
- }
- function cG(Cr, Pn, Mn, mi) {
- const oi = We(
- /*mayOmitBraces*/
- !1
- ), Fa = Mn !== void 0 && mi !== void 0 ? v(Cr, U(), Mn, mi) : void 0;
- return Bt(g.createJSDocSatisfiesTag(Pn, oi, Fa), Cr);
- }
- function kP(Cr, Pn, Mn, mi) {
- const oi = t.getTokenFullStart();
- let Fa;
- hr() && (Fa = Ao());
- const oo = y1(
- Fa,
- oi,
- /*isTypeOnly*/
- !0,
- /*skipJsDocLeadingAsterisks*/
- !0
- ), No = sT(), Tg = eE(), Rm = Mn !== void 0 && mi !== void 0 ? v(Cr, U(), Mn, mi) : void 0;
- return Bt(g.createJSDocImportTag(Pn, oo, No, Tg, Rm), Cr);
- }
- function lG() {
- const Cr = vi(
- 19
- /* OpenBraceToken */
- ), Pn = U(), Mn = uG();
- t.setSkipJsDocLeadingAsterisks(!0);
- const mi = Vv();
- t.setSkipJsDocLeadingAsterisks(!1);
- const oi = g.createExpressionWithTypeArguments(Mn, mi), Fa = Bt(oi, Pn);
- return Cr && Ft(
- 20
- /* CloseBraceToken */
- ), Fa;
- }
- function uG() {
- const Cr = U();
- let Pn = Gv();
- for (; vi(
- 25
- /* DotToken */
- ); ) {
- const Mn = Gv();
- Pn = Bt(B(Pn, Mn), Cr);
- }
- return Pn;
- }
- function wk(Cr, Pn, Mn, mi, oi) {
- return Bt(Pn(Mn, v(Cr, U(), mi, oi)), Cr);
- }
- function _G(Cr, Pn, Mn, mi) {
- const oi = We(
- /*mayOmitBraces*/
- !0
- );
- return Ef(), Bt(g.createJSDocThisTag(Pn, oi, v(Cr, U(), Mn, mi)), Cr);
- }
- function k_e(Cr, Pn, Mn, mi) {
- const oi = We(
- /*mayOmitBraces*/
- !0
- );
- return Ef(), Bt(g.createJSDocEnumTag(Pn, oi, v(Cr, U(), Mn, mi)), Cr);
- }
- function nE(Cr, Pn, Mn, mi) {
- let oi = ao();
- Hv();
- const Fa = pN();
- Ef();
- let oo = w(Mn), No;
- if (!oi || Sg(oi.type)) {
- let Rm, Gd, jm, dN = !1;
- for (; (Rm = mr(() => Mm(Mn))) && Rm.kind !== 345; )
- if (dN = !0, Rm.kind === 344)
- if (Gd) {
- const aE = Zt(p.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
- aE && Rs(aE, fx(le, ve, 0, 0, p.The_tag_was_first_specified_here));
- break;
- } else
- Gd = Rm;
- else
- jm = wr(jm, Rm);
- if (dN) {
- const aE = oi && oi.type.kind === 188, b_ = g.createJSDocTypeLiteral(jm, aE);
- oi = Gd && Gd.typeExpression && !Sg(Gd.typeExpression.type) ? Gd.typeExpression : Bt(b_, Cr), No = oi.end;
- }
- }
- No = No || oo !== void 0 ? U() : (Fa ?? oi ?? Pn).end, oo || (oo = v(Cr, No, Mn, mi));
- const Tg = g.createJSDocTypedefTag(Pn, oi, Fa, oo);
- return Bt(Tg, Cr, No);
- }
- function pN(Cr) {
- const Pn = t.getTokenStart();
- if (!c_(Z()))
- return;
- const Mn = Gv();
- if (vi(
- 25
- /* DotToken */
- )) {
- const mi = pN(
- /*nested*/
- !0
- ), oi = g.createModuleDeclaration(
- /*modifiers*/
- void 0,
- Mn,
- mi,
- Cr ? 8 : void 0
- );
- return Bt(oi, Pn);
- }
- return Cr && (Mn.flags |= 4096), Mn;
- }
- function C_e(Cr) {
- const Pn = U();
- let Mn, mi;
- for (; Mn = mr(() => cT(4, Cr)); ) {
- if (Mn.kind === 345) {
- Ae(Mn.tagName, p.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
- break;
- }
- mi = wr(mi, Mn);
- }
- return ba(mi || [], Pn);
- }
- function T1(Cr, Pn) {
- const Mn = C_e(Pn), mi = mr(() => {
- if (vd(
- 60
- /* AtToken */
- )) {
- const oi = on(Pn);
- if (oi && oi.kind === 342)
- return oi;
- }
- });
- return Bt(g.createJSDocSignature(
- /*typeParameters*/
- void 0,
- Mn,
- mi
- ), Cr);
- }
- function nn(Cr, Pn, Mn, mi) {
- const oi = pN();
- Ef();
- let Fa = w(Mn);
- const oo = T1(Cr, Mn);
- Fa || (Fa = v(Cr, U(), Mn, mi));
- const No = Fa !== void 0 ? U() : oo.end;
- return Bt(g.createJSDocCallbackTag(Pn, oo, oi, Fa), Cr, No);
- }
- function x1(Cr, Pn, Mn, mi) {
- Ef();
- let oi = w(Mn);
- const Fa = T1(Cr, Mn);
- oi || (oi = v(Cr, U(), Mn, mi));
- const oo = oi !== void 0 ? U() : Fa.end;
- return Bt(g.createJSDocOverloadTag(Pn, Fa, oi), Cr, oo);
- }
- function fG(Cr, Pn) {
- for (; !Oe(Cr) || !Oe(Pn); )
- if (!Oe(Cr) && !Oe(Pn) && Cr.right.escapedText === Pn.right.escapedText)
- Cr = Cr.left, Pn = Pn.left;
- else
- return !1;
- return Cr.escapedText === Pn.escapedText;
- }
- function Mm(Cr) {
- return cT(1, Cr);
- }
- function cT(Cr, Pn, Mn) {
- let mi = !0, oi = !1;
- for (; ; )
- switch (At()) {
- case 60:
- if (mi) {
- const Fa = iE(Cr, Pn);
- return Fa && (Fa.kind === 341 || Fa.kind === 348) && Mn && (Oe(Fa.name) || !fG(Mn, Fa.name.left)) ? !1 : Fa;
- }
- oi = !1;
- break;
- case 4:
- mi = !0, oi = !1;
- break;
- case 42:
- oi && (mi = !1), oi = !0;
- break;
- case 80:
- mi = !1;
- break;
- case 1:
- return !1;
- }
- }
- function iE(Cr, Pn) {
- E.assert(
- Z() === 60
- /* AtToken */
- );
- const Mn = t.getTokenFullStart();
- At();
- const mi = Gv(), oi = Hv();
- let Fa;
- switch (mi.escapedText) {
- case "type":
- return Cr === 1 && aG(Mn, mi);
- case "prop":
- case "property":
- Fa = 1;
- break;
- case "arg":
- case "argument":
- case "param":
- Fa = 6;
- break;
- case "template":
- return EL(Mn, mi, Pn, oi);
- case "this":
- return _G(Mn, mi, Pn, oi);
- default:
- return !1;
- }
- return Cr & Fa ? Qf(Mn, mi, Cr, Pn) : !1;
- }
- function CL() {
- const Cr = U(), Pn = vd(
- 23
- /* OpenBracketToken */
- );
- Pn && Ef();
- const Mn = Yt(
- /*allowDecorators*/
- !1,
- /*permitConstAsModifier*/
- !0
- ), mi = Gv(p.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
- let oi;
- if (Pn && (Ef(), Ft(
- 64
- /* EqualsToken */
- ), oi = Hs(16777216, Sp), Ft(
- 24
- /* CloseBracketToken */
- )), !rc(mi))
- return Bt(g.createTypeParameterDeclaration(
- Mn,
- mi,
- /*constraint*/
- void 0,
- oi
- ), Cr);
- }
- function sE() {
- const Cr = U(), Pn = [];
- do {
- Ef();
- const Mn = CL();
- Mn !== void 0 && Pn.push(Mn), Hv();
- } while (vd(
- 28
- /* CommaToken */
- ));
- return ba(Pn, Cr);
- }
- function EL(Cr, Pn, Mn, mi) {
- const oi = Z() === 19 ? We() : void 0, Fa = sE();
- return Bt(g.createJSDocTemplateTag(Pn, oi, Fa, v(Cr, U(), Mn, mi)), Cr);
- }
- function vd(Cr) {
- return Z() === Cr ? (At(), !0) : !1;
- }
- function E_e() {
- let Cr = Gv();
- for (vi(
- 23
- /* OpenBracketToken */
- ) && Ft(
- 24
- /* CloseBracketToken */
- ); vi(
- 25
- /* DotToken */
- ); ) {
- const Pn = Gv();
- vi(
- 23
- /* OpenBracketToken */
- ) && Ft(
- 24
- /* CloseBracketToken */
- ), Cr = st(Cr, Pn);
- }
- return Cr;
- }
- function Gv(Cr) {
- if (!c_(Z()))
- return to(
- 80,
- /*reportAtCurrentPosition*/
- !Cr,
- Cr || p.Identifier_expected
- );
- Wt++;
- const Pn = t.getTokenStart(), Mn = t.getTokenEnd(), mi = Z(), oi = _u(t.getTokenValue()), Fa = Bt(D(oi, mi), Pn, Mn);
- return At(), Fa;
- }
- }
- })(Wa = e.JSDocParser || (e.JSDocParser = {}));
- })(hv || (hv = {}));
- var Xhe = /* @__PURE__ */ new WeakSet();
- function L9e(e) {
- Xhe.has(e) && E.fail("Source file has already been incrementally parsed"), Xhe.add(e);
- }
- var Qhe = /* @__PURE__ */ new WeakSet();
- function M9e(e) {
- return Qhe.has(e);
- }
- function Ite(e) {
- Qhe.add(e);
- }
- var lz;
- ((e) => {
- function t(T, C, D, P) {
- if (P = P || E.shouldAssert(
- 2
- /* Aggressive */
- ), g(T, C, D, P), fY(D))
- return T;
- if (T.statements.length === 0)
- return hv.parseSourceFile(
- T.fileName,
- C,
- T.languageVersion,
- /*syntaxCursor*/
- void 0,
- /*setParentNodes*/
- !0,
- T.scriptKind,
- T.setExternalModuleIndicator,
- T.jsDocParsingMode
- );
- L9e(T), hv.fixupParentReferences(T);
- const I = T.text, F = h(T), O = u(T, D);
- g(T, C, O, P), E.assert(O.span.start <= D.span.start), E.assert(ec(O.span) === ec(D.span)), E.assert(ec(YE(O)) === ec(YE(D)));
- const B = YE(O).length - O.span.length;
- _(T, O.span.start, ec(O.span), ec(YE(O)), B, I, C, P);
- const z = hv.parseSourceFile(
- T.fileName,
- C,
- T.languageVersion,
- F,
- /*setParentNodes*/
- !0,
- T.scriptKind,
- T.setExternalModuleIndicator,
- T.jsDocParsingMode
- );
- return z.commentDirectives = n(
- T.commentDirectives,
- z.commentDirectives,
- O.span.start,
- ec(O.span),
- B,
- I,
- C,
- P
- ), z.impliedNodeFormat = T.impliedNodeFormat, cte(T, z), z;
- }
- e.updateSourceFile = t;
- function n(T, C, D, P, I, F, O, B) {
- if (!T) return C;
- let z, X = !1;
- for (const V of T) {
- const { range: ae, type: ee } = V;
- if (ae.end < D)
- z = wr(z, V);
- else if (ae.pos > P) {
- q();
- const G = {
- range: { pos: ae.pos + I, end: ae.end + I },
- type: ee
- };
- z = wr(z, G), B && E.assert(F.substring(ae.pos, ae.end) === O.substring(G.range.pos, G.range.end));
- }
- }
- return q(), z;
- function q() {
- X || (X = !0, z ? C && z.push(...C) : z = C);
- }
- }
- function i(T, C, D, P, I, F, O) {
- D ? z(T) : B(T);
- return;
- function B(X) {
- let q = "";
- if (O && s(X) && (q = I.substring(X.pos, X.end)), $J(X, C), wd(X, X.pos + P, X.end + P), O && s(X) && E.assert(q === F.substring(X.pos, X.end)), bs(X, B, z), gf(X))
- for (const V of X.jsDoc)
- B(V);
- c(X, O);
- }
- function z(X) {
- wd(X, X.pos + P, X.end + P);
- for (const q of X)
- B(q);
- }
- }
- function s(T) {
- switch (T.kind) {
- case 11:
- case 9:
- case 80:
- return !0;
- }
- return !1;
- }
- function o(T, C, D, P, I) {
- E.assert(T.end >= C, "Adjusting an element that was entirely before the change range"), E.assert(T.pos <= D, "Adjusting an element that was entirely after the change range"), E.assert(T.pos <= T.end);
- const F = Math.min(T.pos, P), O = T.end >= D ? (
- // Element ends after the change range. Always adjust the end pos.
- T.end + I
- ) : (
- // Element ends in the change range. The element will keep its position if
- // possible. Or Move backward to the new-end if it's in the 'Y' range.
- Math.min(T.end, P)
- );
- if (E.assert(F <= O), T.parent) {
- const B = T.parent;
- E.assertGreaterThanOrEqual(F, B.pos), E.assertLessThanOrEqual(O, B.end);
- }
- wd(T, F, O);
- }
- function c(T, C) {
- if (C) {
- let D = T.pos;
- const P = (I) => {
- E.assert(I.pos >= D), D = I.end;
- };
- if (gf(T))
- for (const I of T.jsDoc)
- P(I);
- bs(T, P), E.assert(D <= T.end);
- }
- }
- function _(T, C, D, P, I, F, O, B) {
- z(T);
- return;
- function z(q) {
- if (E.assert(q.pos <= q.end), q.pos > D) {
- i(
- q,
- T,
- /*isArray*/
- !1,
- I,
- F,
- O,
- B
- );
- return;
- }
- const V = q.end;
- if (V >= C) {
- if (Ite(q), $J(q, T), o(q, C, D, P, I), bs(q, z, X), gf(q))
- for (const ae of q.jsDoc)
- z(ae);
- c(q, B);
- return;
- }
- E.assert(V < C);
- }
- function X(q) {
- if (E.assert(q.pos <= q.end), q.pos > D) {
- i(
- q,
- T,
- /*isArray*/
- !0,
- I,
- F,
- O,
- B
- );
- return;
- }
- const V = q.end;
- if (V >= C) {
- Ite(q), o(q, C, D, P, I);
- for (const ae of q)
- z(ae);
- return;
- }
- E.assert(V < C);
- }
- }
- function u(T, C) {
- let P = C.span.start;
- for (let O = 0; P > 0 && O <= 1; O++) {
- const B = d(T, P);
- E.assert(B.pos <= P);
- const z = B.pos;
- P = Math.max(0, z - 1);
- }
- const I = kc(P, ec(C.span)), F = C.newLength + (C.span.start - P);
- return Tw(I, F);
- }
- function d(T, C) {
- let D = T, P;
- if (bs(T, F), P) {
- const O = I(P);
- O.pos > D.pos && (D = O);
- }
- return D;
- function I(O) {
- for (; ; ) {
- const B = qB(O);
- if (B)
- O = B;
- else
- return O;
- }
- }
- function F(O) {
- if (!rc(O))
- if (O.pos <= C) {
- if (O.pos >= D.pos && (D = O), C < O.end)
- return bs(O, F), !0;
- E.assert(O.end <= C), P = O;
- } else
- return E.assert(O.pos > C), !0;
- }
- }
- function g(T, C, D, P) {
- const I = T.text;
- if (D && (E.assert(I.length - D.span.length + D.newLength === C.length), P || E.shouldAssert(
- 3
- /* VeryAggressive */
- ))) {
- const F = I.substr(0, D.span.start), O = C.substr(0, D.span.start);
- E.assert(F === O);
- const B = I.substring(ec(D.span), I.length), z = C.substring(ec(YE(D)), C.length);
- E.assert(B === z);
- }
- }
- function h(T) {
- let C = T.statements, D = 0;
- E.assert(D < C.length);
- let P = C[D], I = -1;
- return {
- currentNode(O) {
- return O !== I && (P && P.end === O && D < C.length - 1 && (D++, P = C[D]), (!P || P.pos !== O) && F(O)), I = O, E.assert(!P || P.pos === O), P;
- }
- };
- function F(O) {
- C = void 0, D = -1, P = void 0, bs(T, B, z);
- return;
- function B(X) {
- return O >= X.pos && O < X.end ? (bs(X, B, z), !0) : !1;
- }
- function z(X) {
- if (O >= X.pos && O < X.end)
- for (let q = 0; q < X.length; q++) {
- const V = X[q];
- if (V) {
- if (V.pos === O)
- return C = X, D = q, P = V, !0;
- if (V.pos < O && O < V.end)
- return bs(V, B, z), !0;
- }
- }
- return !1;
- }
- }
- }
- e.createSyntaxCursor = h;
- let S;
- ((T) => {
- T[T.Value = -1] = "Value";
- })(S || (S = {}));
- })(lz || (lz = {}));
- function wl(e) {
- return uz(e) !== void 0;
- }
- function uz(e) {
- const t = rC(
- e,
- T5,
- /*ignoreCase*/
- !1
- );
- if (t)
- return t;
- if (qo(
- e,
- ".ts"
- /* Ts */
- )) {
- const n = Hc(e).lastIndexOf(".d.");
- if (n >= 0)
- return e.substring(n);
- }
- }
- function R9e(e, t, n, i) {
- if (e) {
- if (e === "import")
- return 99;
- if (e === "require")
- return 1;
- i(t, n - t, p.resolution_mode_should_be_either_require_or_import);
- }
- }
- function _z(e, t) {
- const n = [];
- for (const i of Ig(t, 0) || Ue) {
- const s = t.substring(i.pos, i.end);
- z9e(n, i, s);
- }
- e.pragmas = /* @__PURE__ */ new Map();
- for (const i of n) {
- if (e.pragmas.has(i.name)) {
- const s = e.pragmas.get(i.name);
- s instanceof Array ? s.push(i.args) : e.pragmas.set(i.name, [s, i.args]);
- continue;
- }
- e.pragmas.set(i.name, i.args);
- }
- }
- function fz(e, t) {
- e.checkJsDirective = void 0, e.referencedFiles = [], e.typeReferenceDirectives = [], e.libReferenceDirectives = [], e.amdDependencies = [], e.hasNoDefaultLib = !1, e.pragmas.forEach((n, i) => {
- switch (i) {
- case "reference": {
- const s = e.referencedFiles, o = e.typeReferenceDirectives, c = e.libReferenceDirectives;
- ir(FT(n), (_) => {
- const { types: u, lib: d, path: g, ["resolution-mode"]: h, preserve: S } = _.arguments, T = S === "true" ? !0 : void 0;
- if (_.arguments["no-default-lib"] === "true")
- e.hasNoDefaultLib = !0;
- else if (u) {
- const C = R9e(h, u.pos, u.end, t);
- o.push({ pos: u.pos, end: u.end, fileName: u.value, ...C ? { resolutionMode: C } : {}, ...T ? { preserve: T } : {} });
- } else d ? c.push({ pos: d.pos, end: d.end, fileName: d.value, ...T ? { preserve: T } : {} }) : g ? s.push({ pos: g.pos, end: g.end, fileName: g.value, ...T ? { preserve: T } : {} }) : t(_.range.pos, _.range.end - _.range.pos, p.Invalid_reference_directive_syntax);
- });
- break;
- }
- case "amd-dependency": {
- e.amdDependencies = lr(
- FT(n),
- (s) => ({ name: s.arguments.name, path: s.arguments.path })
- );
- break;
- }
- case "amd-module": {
- if (n instanceof Array)
- for (const s of n)
- e.moduleName && t(s.range.pos, s.range.end - s.range.pos, p.An_AMD_module_cannot_have_multiple_name_assignments), e.moduleName = s.arguments.name;
- else
- e.moduleName = n.arguments.name;
- break;
- }
- case "ts-nocheck":
- case "ts-check": {
- ir(FT(n), (s) => {
- (!e.checkJsDirective || s.range.pos > e.checkJsDirective.pos) && (e.checkJsDirective = {
- enabled: i === "ts-check",
- end: s.range.end,
- pos: s.range.pos
- });
- });
- break;
- }
- case "jsx":
- case "jsxfrag":
- case "jsximportsource":
- case "jsxruntime":
- return;
- default:
- E.fail("Unhandled pragma kind");
- }
- });
- }
- var Ote = /* @__PURE__ */ new Map();
- function j9e(e) {
- if (Ote.has(e))
- return Ote.get(e);
- const t = new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`, "im");
- return Ote.set(e, t), t;
- }
- var B9e = /^\/\/\/\s*<(\S+)\s.*?\/>/m, J9e = /^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;
- function z9e(e, t, n) {
- const i = t.kind === 2 && B9e.exec(n);
- if (i) {
- const o = i[1].toLowerCase(), c = TI[o];
- if (!c || !(c.kind & 1))
- return;
- if (c.args) {
- const _ = {};
- for (const u of c.args) {
- const g = j9e(u.name).exec(n);
- if (!g && !u.optional)
- return;
- if (g) {
- const h = g[2] || g[3];
- if (u.captureSpan) {
- const S = t.pos + g.index + g[1].length + 1;
- _[u.name] = {
- value: h,
- pos: S,
- end: S + h.length
- };
- } else
- _[u.name] = h;
- }
- }
- e.push({ name: o, args: { arguments: _, range: t } });
- } else
- e.push({ name: o, args: { arguments: {}, range: t } });
- return;
- }
- const s = t.kind === 2 && J9e.exec(n);
- if (s)
- return Yhe(e, t, 2, s);
- if (t.kind === 3) {
- const o = /@(\S+)(\s+(?:\S.*)?)?$/gm;
- let c;
- for (; c = o.exec(n); )
- Yhe(e, t, 4, c);
- }
- }
- function Yhe(e, t, n, i) {
- if (!i) return;
- const s = i[1].toLowerCase(), o = TI[s];
- if (!o || !(o.kind & n))
- return;
- const c = i[2], _ = W9e(o, c);
- _ !== "fail" && e.push({ name: s, args: { arguments: _, range: t } });
- }
- function W9e(e, t) {
- if (!t) return {};
- if (!e.args) return {};
- const n = t.trim().split(/\s+/), i = {};
- for (let s = 0; s < e.args.length; s++) {
- const o = e.args[s];
- if (!n[s] && !o.optional)
- return "fail";
- if (o.captureSpan)
- return E.fail("Capture spans not yet implemented for non-xml pragmas");
- i[o.name] = n[s];
- }
- return i;
- }
- function yv(e, t) {
- return e.kind !== t.kind ? !1 : e.kind === 80 ? e.escapedText === t.escapedText : e.kind === 110 ? !0 : e.kind === 295 ? e.namespace.escapedText === t.namespace.escapedText && e.name.escapedText === t.name.escapedText : e.name.escapedText === t.name.escapedText && yv(e.expression, t.expression);
- }
- var Fte = {
- name: "compileOnSave",
- type: "boolean",
- defaultValueDescription: !1
- }, Zhe = new Map(Object.entries({
- preserve: 1,
- "react-native": 3,
- react: 2,
- "react-jsx": 4,
- "react-jsxdev": 5
- /* ReactJSXDev */
- })), gA = new Map(wE(Zhe.entries(), ([e, t]) => ["" + t, e])), Khe = [
- // JavaScript only
- ["es5", "lib.es5.d.ts"],
- ["es6", "lib.es2015.d.ts"],
- ["es2015", "lib.es2015.d.ts"],
- ["es7", "lib.es2016.d.ts"],
- ["es2016", "lib.es2016.d.ts"],
- ["es2017", "lib.es2017.d.ts"],
- ["es2018", "lib.es2018.d.ts"],
- ["es2019", "lib.es2019.d.ts"],
- ["es2020", "lib.es2020.d.ts"],
- ["es2021", "lib.es2021.d.ts"],
- ["es2022", "lib.es2022.d.ts"],
- ["es2023", "lib.es2023.d.ts"],
- ["esnext", "lib.esnext.d.ts"],
- // Host only
- ["dom", "lib.dom.d.ts"],
- ["dom.iterable", "lib.dom.iterable.d.ts"],
- ["dom.asynciterable", "lib.dom.asynciterable.d.ts"],
- ["webworker", "lib.webworker.d.ts"],
- ["webworker.importscripts", "lib.webworker.importscripts.d.ts"],
- ["webworker.iterable", "lib.webworker.iterable.d.ts"],
- ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"],
- ["scripthost", "lib.scripthost.d.ts"],
- // ES2015 Or ESNext By-feature options
- ["es2015.core", "lib.es2015.core.d.ts"],
- ["es2015.collection", "lib.es2015.collection.d.ts"],
- ["es2015.generator", "lib.es2015.generator.d.ts"],
- ["es2015.iterable", "lib.es2015.iterable.d.ts"],
- ["es2015.promise", "lib.es2015.promise.d.ts"],
- ["es2015.proxy", "lib.es2015.proxy.d.ts"],
- ["es2015.reflect", "lib.es2015.reflect.d.ts"],
- ["es2015.symbol", "lib.es2015.symbol.d.ts"],
- ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
- ["es2016.array.include", "lib.es2016.array.include.d.ts"],
- ["es2016.intl", "lib.es2016.intl.d.ts"],
- ["es2017.date", "lib.es2017.date.d.ts"],
- ["es2017.object", "lib.es2017.object.d.ts"],
- ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
- ["es2017.string", "lib.es2017.string.d.ts"],
- ["es2017.intl", "lib.es2017.intl.d.ts"],
- ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"],
- ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"],
- ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"],
- ["es2018.intl", "lib.es2018.intl.d.ts"],
- ["es2018.promise", "lib.es2018.promise.d.ts"],
- ["es2018.regexp", "lib.es2018.regexp.d.ts"],
- ["es2019.array", "lib.es2019.array.d.ts"],
- ["es2019.object", "lib.es2019.object.d.ts"],
- ["es2019.string", "lib.es2019.string.d.ts"],
- ["es2019.symbol", "lib.es2019.symbol.d.ts"],
- ["es2019.intl", "lib.es2019.intl.d.ts"],
- ["es2020.bigint", "lib.es2020.bigint.d.ts"],
- ["es2020.date", "lib.es2020.date.d.ts"],
- ["es2020.promise", "lib.es2020.promise.d.ts"],
- ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"],
- ["es2020.string", "lib.es2020.string.d.ts"],
- ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"],
- ["es2020.intl", "lib.es2020.intl.d.ts"],
- ["es2020.number", "lib.es2020.number.d.ts"],
- ["es2021.promise", "lib.es2021.promise.d.ts"],
- ["es2021.string", "lib.es2021.string.d.ts"],
- ["es2021.weakref", "lib.es2021.weakref.d.ts"],
- ["es2021.intl", "lib.es2021.intl.d.ts"],
- ["es2022.array", "lib.es2022.array.d.ts"],
- ["es2022.error", "lib.es2022.error.d.ts"],
- ["es2022.intl", "lib.es2022.intl.d.ts"],
- ["es2022.object", "lib.es2022.object.d.ts"],
- ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"],
- ["es2022.string", "lib.es2022.string.d.ts"],
- ["es2022.regexp", "lib.es2022.regexp.d.ts"],
- ["es2023.array", "lib.es2023.array.d.ts"],
- ["es2023.collection", "lib.es2023.collection.d.ts"],
- ["es2023.intl", "lib.es2023.intl.d.ts"],
- ["esnext.array", "lib.es2023.array.d.ts"],
- ["esnext.collection", "lib.esnext.collection.d.ts"],
- ["esnext.symbol", "lib.es2019.symbol.d.ts"],
- ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
- ["esnext.intl", "lib.esnext.intl.d.ts"],
- ["esnext.disposable", "lib.esnext.disposable.d.ts"],
- ["esnext.bigint", "lib.es2020.bigint.d.ts"],
- ["esnext.string", "lib.es2022.string.d.ts"],
- ["esnext.promise", "lib.esnext.promise.d.ts"],
- ["esnext.weakref", "lib.es2021.weakref.d.ts"],
- ["esnext.decorators", "lib.esnext.decorators.d.ts"],
- ["esnext.object", "lib.esnext.object.d.ts"],
- ["esnext.array", "lib.esnext.array.d.ts"],
- ["esnext.regexp", "lib.esnext.regexp.d.ts"],
- ["esnext.string", "lib.esnext.string.d.ts"],
- ["esnext.iterator", "lib.esnext.iterator.d.ts"],
- ["decorators", "lib.decorators.d.ts"],
- ["decorators.legacy", "lib.decorators.legacy.d.ts"]
- ], mO = Khe.map((e) => e[0]), pz = new Map(Khe), zx = [
- {
- name: "watchFile",
- type: new Map(Object.entries({
- fixedpollinginterval: 0,
- prioritypollinginterval: 1,
- dynamicprioritypolling: 2,
- fixedchunksizepolling: 3,
- usefsevents: 4,
- usefseventsonparentdirectory: 5
- /* UseFsEventsOnParentDirectory */
- })),
- category: p.Watch_and_Build_Modes,
- description: p.Specify_how_the_TypeScript_watch_mode_works,
- defaultValueDescription: 4
- /* UseFsEvents */
- },
- {
- name: "watchDirectory",
- type: new Map(Object.entries({
- usefsevents: 0,
- fixedpollinginterval: 1,
- dynamicprioritypolling: 2,
- fixedchunksizepolling: 3
- /* FixedChunkSizePolling */
- })),
- category: p.Watch_and_Build_Modes,
- description: p.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
- defaultValueDescription: 0
- /* UseFsEvents */
- },
- {
- name: "fallbackPolling",
- type: new Map(Object.entries({
- fixedinterval: 0,
- priorityinterval: 1,
- dynamicpriority: 2,
- fixedchunksize: 3
- /* FixedChunkSize */
- })),
- category: p.Watch_and_Build_Modes,
- description: p.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
- defaultValueDescription: 1
- /* PriorityInterval */
- },
- {
- name: "synchronousWatchDirectory",
- type: "boolean",
- category: p.Watch_and_Build_Modes,
- description: p.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
- defaultValueDescription: !1
- },
- {
- name: "excludeDirectories",
- type: "list",
- element: {
- name: "excludeDirectory",
- type: "string",
- isFilePath: !0,
- extraValidation: rre
- },
- allowConfigDirTemplateSubstitution: !0,
- category: p.Watch_and_Build_Modes,
- description: p.Remove_a_list_of_directories_from_the_watch_process
- },
- {
- name: "excludeFiles",
- type: "list",
- element: {
- name: "excludeFile",
- type: "string",
- isFilePath: !0,
- extraValidation: rre
- },
- allowConfigDirTemplateSubstitution: !0,
- category: p.Watch_and_Build_Modes,
- description: p.Remove_a_list_of_files_from_the_watch_mode_s_processing
- }
- ], gO = [
- {
- name: "help",
- shortName: "h",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- isCommandLineOnly: !0,
- category: p.Command_line_Options,
- description: p.Print_this_message,
- defaultValueDescription: !1
- },
- {
- name: "help",
- shortName: "?",
- type: "boolean",
- isCommandLineOnly: !0,
- category: p.Command_line_Options,
- defaultValueDescription: !1
- },
- {
- name: "watch",
- shortName: "w",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- isCommandLineOnly: !0,
- category: p.Command_line_Options,
- description: p.Watch_input_files,
- defaultValueDescription: !1
- },
- {
- name: "preserveWatchOutput",
- type: "boolean",
- showInSimplifiedHelpView: !1,
- category: p.Output_Formatting,
- description: p.Disable_wiping_the_console_in_watch_mode,
- defaultValueDescription: !1
- },
- {
- name: "listFiles",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Print_all_of_the_files_read_during_the_compilation,
- defaultValueDescription: !1
- },
- {
- name: "explainFiles",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Print_files_read_during_the_compilation_including_why_it_was_included,
- defaultValueDescription: !1
- },
- {
- name: "listEmittedFiles",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Print_the_names_of_emitted_files_after_a_compilation,
- defaultValueDescription: !1
- },
- {
- name: "pretty",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Output_Formatting,
- description: p.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
- defaultValueDescription: !0
- },
- {
- name: "traceResolution",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Log_paths_used_during_the_moduleResolution_process,
- defaultValueDescription: !1
- },
- {
- name: "diagnostics",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Output_compiler_performance_information_after_building,
- defaultValueDescription: !1
- },
- {
- name: "extendedDiagnostics",
- type: "boolean",
- category: p.Compiler_Diagnostics,
- description: p.Output_more_detailed_compiler_performance_information_after_building,
- defaultValueDescription: !1
- },
- {
- name: "generateCpuProfile",
- type: "string",
- isFilePath: !0,
- paramType: p.FILE_OR_DIRECTORY,
- category: p.Compiler_Diagnostics,
- description: p.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,
- defaultValueDescription: "profile.cpuprofile"
- },
- {
- name: "generateTrace",
- type: "string",
- isFilePath: !0,
- paramType: p.DIRECTORY,
- category: p.Compiler_Diagnostics,
- description: p.Generates_an_event_trace_and_a_list_of_types
- },
- {
- name: "incremental",
- shortName: "i",
- type: "boolean",
- category: p.Projects,
- description: p.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,
- transpileOptionValue: void 0,
- defaultValueDescription: p.false_unless_composite_is_set
- },
- {
- name: "declaration",
- shortName: "d",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- transpileOptionValue: void 0,
- description: p.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,
- defaultValueDescription: p.false_unless_composite_is_set
- },
- {
- name: "declarationMap",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- defaultValueDescription: !1,
- description: p.Create_sourcemaps_for_d_ts_files
- },
- {
- name: "emitDeclarationOnly",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- description: p.Only_output_d_ts_files_and_not_JavaScript_files,
- transpileOptionValue: void 0,
- defaultValueDescription: !1
- },
- {
- name: "sourceMap",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- defaultValueDescription: !1,
- description: p.Create_source_map_files_for_emitted_JavaScript_files
- },
- {
- name: "inlineSourceMap",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Include_sourcemap_files_inside_the_emitted_JavaScript,
- defaultValueDescription: !1
- },
- {
- name: "noCheck",
- type: "boolean",
- showInSimplifiedHelpView: !1,
- category: p.Compiler_Diagnostics,
- description: p.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
- transpileOptionValue: !0,
- defaultValueDescription: !1
- // Not setting affectsSemanticDiagnostics or affectsBuildInfo because we dont want all diagnostics to go away, its handled in builder
- },
- {
- name: "noEmit",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- description: p.Disable_emitting_files_from_a_compilation,
- transpileOptionValue: void 0,
- defaultValueDescription: !1
- },
- {
- name: "assumeChangesOnlyAffectDirectDependencies",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Watch_and_Build_Modes,
- description: p.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,
- defaultValueDescription: !1
- },
- {
- name: "locale",
- type: "string",
- category: p.Command_line_Options,
- isCommandLineOnly: !0,
- description: p.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,
- defaultValueDescription: p.Platform_specific
- }
- ], dz = {
- name: "target",
- shortName: "t",
- type: new Map(Object.entries({
- es3: 0,
- es5: 1,
- es6: 2,
- es2015: 2,
- es2016: 3,
- es2017: 4,
- es2018: 5,
- es2019: 6,
- es2020: 7,
- es2021: 8,
- es2022: 9,
- es2023: 10,
- esnext: 99
- /* ESNext */
- })),
- affectsSourceFile: !0,
- affectsModuleResolution: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- deprecatedKeys: /* @__PURE__ */ new Set(["es3"]),
- paramType: p.VERSION,
- showInSimplifiedHelpView: !0,
- category: p.Language_and_Environment,
- description: p.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
- defaultValueDescription: 1
- /* ES5 */
- }, Lte = {
- name: "module",
- shortName: "m",
- type: new Map(Object.entries({
- none: 0,
- commonjs: 1,
- amd: 2,
- system: 4,
- umd: 3,
- es6: 5,
- es2015: 5,
- es2020: 6,
- es2022: 7,
- esnext: 99,
- node16: 100,
- nodenext: 199,
- preserve: 200
- /* Preserve */
- })),
- affectsSourceFile: !0,
- affectsModuleResolution: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- paramType: p.KIND,
- showInSimplifiedHelpView: !0,
- category: p.Modules,
- description: p.Specify_what_module_code_is_generated,
- defaultValueDescription: void 0
- }, Mte = [
- // CommandLine only options
- {
- name: "all",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- description: p.Show_all_compiler_options,
- defaultValueDescription: !1
- },
- {
- name: "version",
- shortName: "v",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- description: p.Print_the_compiler_s_version,
- defaultValueDescription: !1
- },
- {
- name: "init",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- description: p.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
- defaultValueDescription: !1
- },
- {
- name: "project",
- shortName: "p",
- type: "string",
- isFilePath: !0,
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- paramType: p.FILE_OR_DIRECTORY,
- description: p.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json
- },
- {
- name: "build",
- type: "boolean",
- shortName: "b",
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- description: p.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
- defaultValueDescription: !1
- },
- {
- name: "showConfig",
- type: "boolean",
- showInSimplifiedHelpView: !0,
- category: p.Command_line_Options,
- isCommandLineOnly: !0,
- description: p.Print_the_final_configuration_instead_of_building,
- defaultValueDescription: !1
- },
- {
- name: "listFilesOnly",
- type: "boolean",
- category: p.Command_line_Options,
- isCommandLineOnly: !0,
- description: p.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
- defaultValueDescription: !1
- },
- // Basic
- dz,
- Lte,
- {
- name: "lib",
- type: "list",
- element: {
- name: "lib",
- type: pz,
- defaultValueDescription: void 0
- },
- affectsProgramStructure: !0,
- showInSimplifiedHelpView: !0,
- category: p.Language_and_Environment,
- description: p.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,
- transpileOptionValue: void 0
- },
- {
- name: "allowJs",
- type: "boolean",
- allowJsFlag: !0,
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.JavaScript_Support,
- description: p.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
- defaultValueDescription: !1
- },
- {
- name: "checkJs",
- type: "boolean",
- affectsModuleResolution: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.JavaScript_Support,
- description: p.Enable_error_reporting_in_type_checked_JavaScript_files,
- defaultValueDescription: !1
- },
- {
- name: "jsx",
- type: Zhe,
- affectsSourceFile: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsModuleResolution: !0,
- // The checker emits an error when it sees JSX but this option is not set in compilerOptions.
- // This is effectively a semantic error, so mark this option as affecting semantic diagnostics
- // so we know to refresh errors when this option is changed.
- affectsSemanticDiagnostics: !0,
- paramType: p.KIND,
- showInSimplifiedHelpView: !0,
- category: p.Language_and_Environment,
- description: p.Specify_what_JSX_code_is_generated,
- defaultValueDescription: void 0
- },
- {
- name: "outFile",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsDeclarationPath: !0,
- isFilePath: !0,
- paramType: p.FILE,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- description: p.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,
- transpileOptionValue: void 0
- },
- {
- name: "outDir",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsDeclarationPath: !0,
- isFilePath: !0,
- paramType: p.DIRECTORY,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- description: p.Specify_an_output_folder_for_all_emitted_files
- },
- {
- name: "rootDir",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsDeclarationPath: !0,
- isFilePath: !0,
- paramType: p.LOCATION,
- category: p.Modules,
- description: p.Specify_the_root_folder_within_your_source_files,
- defaultValueDescription: p.Computed_from_the_list_of_input_files
- },
- {
- name: "composite",
- type: "boolean",
- // Not setting affectsEmit because we calculate this flag might not affect full emit
- affectsBuildInfo: !0,
- isTSConfigOnly: !0,
- category: p.Projects,
- transpileOptionValue: void 0,
- defaultValueDescription: !1,
- description: p.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references
- },
- {
- name: "tsBuildInfoFile",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- isFilePath: !0,
- paramType: p.FILE,
- category: p.Projects,
- transpileOptionValue: void 0,
- defaultValueDescription: ".tsbuildinfo",
- description: p.Specify_the_path_to_tsbuildinfo_incremental_compilation_file
- },
- {
- name: "removeComments",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Emit,
- defaultValueDescription: !1,
- description: p.Disable_emitting_comments
- },
- {
- name: "importHelpers",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsSourceFile: !0,
- category: p.Emit,
- description: p.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
- defaultValueDescription: !1
- },
- {
- name: "importsNotUsedAsValues",
- type: new Map(Object.entries({
- remove: 0,
- preserve: 1,
- error: 2
- /* Error */
- })),
- affectsEmit: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
- defaultValueDescription: 0
- /* Remove */
- },
- {
- name: "downlevelIteration",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
- defaultValueDescription: !1
- },
- {
- name: "isolatedModules",
- type: "boolean",
- category: p.Interop_Constraints,
- description: p.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,
- transpileOptionValue: !0,
- defaultValueDescription: !1
- },
- {
- name: "verbatimModuleSyntax",
- type: "boolean",
- affectsEmit: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Interop_Constraints,
- description: p.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting,
- defaultValueDescription: !1
- },
- {
- name: "isolatedDeclarations",
- type: "boolean",
- category: p.Interop_Constraints,
- description: p.Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files,
- defaultValueDescription: !1,
- affectsBuildInfo: !0,
- affectsSemanticDiagnostics: !0
- },
- // Strict Type Checks
- {
- name: "strict",
- type: "boolean",
- // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here
- // The value of each strictFlag depends on own strictFlag value or this and never accessed directly.
- // But we need to store `strict` in builf info, even though it won't be examined directly, so that the
- // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Type_Checking,
- description: p.Enable_all_strict_type_checking_options,
- defaultValueDescription: !1
- },
- {
- name: "noImplicitAny",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "strictNullChecks",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.When_type_checking_take_into_account_null_and_undefined,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "strictFunctionTypes",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "strictBindCallApply",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "strictPropertyInitialization",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "strictBuiltinIteratorReturn",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "noImplicitThis",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Enable_error_reporting_when_this_is_given_the_type_any,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "useUnknownInCatchVariables",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Default_catch_clause_variables_as_unknown_instead_of_any,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- {
- name: "alwaysStrict",
- type: "boolean",
- affectsSourceFile: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- strictFlag: !0,
- category: p.Type_Checking,
- description: p.Ensure_use_strict_is_always_emitted,
- defaultValueDescription: p.false_unless_strict_is_set
- },
- // Additional Checks
- {
- name: "noUnusedLocals",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Enable_error_reporting_when_local_variables_aren_t_read,
- defaultValueDescription: !1
- },
- {
- name: "noUnusedParameters",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Raise_an_error_when_a_function_parameter_isn_t_read,
- defaultValueDescription: !1
- },
- {
- name: "exactOptionalPropertyTypes",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
- defaultValueDescription: !1
- },
- {
- name: "noImplicitReturns",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
- defaultValueDescription: !1
- },
- {
- name: "noFallthroughCasesInSwitch",
- type: "boolean",
- affectsBindDiagnostics: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
- defaultValueDescription: !1
- },
- {
- name: "noUncheckedIndexedAccess",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Add_undefined_to_a_type_when_accessed_using_an_index,
- defaultValueDescription: !1
- },
- {
- name: "noImplicitOverride",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
- defaultValueDescription: !1
- },
- {
- name: "noPropertyAccessFromIndexSignature",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !1,
- category: p.Type_Checking,
- description: p.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
- defaultValueDescription: !1
- },
- // Module Resolution
- {
- name: "moduleResolution",
- type: new Map(Object.entries({
- // N.B. The first entry specifies the value shown in `tsc --init`
- node10: 2,
- node: 2,
- classic: 1,
- node16: 3,
- nodenext: 99,
- bundler: 100
- /* Bundler */
- })),
- deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
- affectsSourceFile: !0,
- affectsModuleResolution: !0,
- paramType: p.STRATEGY,
- category: p.Modules,
- description: p.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,
- defaultValueDescription: p.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node
- },
- {
- name: "baseUrl",
- type: "string",
- affectsModuleResolution: !0,
- isFilePath: !0,
- category: p.Modules,
- description: p.Specify_the_base_directory_to_resolve_non_relative_module_names
- },
- {
- // this option can only be specified in tsconfig.json
- // use type = object to copy the value as-is
- name: "paths",
- type: "object",
- affectsModuleResolution: !0,
- allowConfigDirTemplateSubstitution: !0,
- isTSConfigOnly: !0,
- category: p.Modules,
- description: p.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,
- transpileOptionValue: void 0
- },
- {
- // this option can only be specified in tsconfig.json
- // use type = object to copy the value as-is
- name: "rootDirs",
- type: "list",
- isTSConfigOnly: !0,
- element: {
- name: "rootDirs",
- type: "string",
- isFilePath: !0
- },
- affectsModuleResolution: !0,
- allowConfigDirTemplateSubstitution: !0,
- category: p.Modules,
- description: p.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,
- transpileOptionValue: void 0,
- defaultValueDescription: p.Computed_from_the_list_of_input_files
- },
- {
- name: "typeRoots",
- type: "list",
- element: {
- name: "typeRoots",
- type: "string",
- isFilePath: !0
- },
- affectsModuleResolution: !0,
- allowConfigDirTemplateSubstitution: !0,
- category: p.Modules,
- description: p.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types
- },
- {
- name: "types",
- type: "list",
- element: {
- name: "types",
- type: "string"
- },
- affectsProgramStructure: !0,
- showInSimplifiedHelpView: !0,
- category: p.Modules,
- description: p.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,
- transpileOptionValue: void 0
- },
- {
- name: "allowSyntheticDefaultImports",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Interop_Constraints,
- description: p.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,
- defaultValueDescription: p.module_system_or_esModuleInterop
- },
- {
- name: "esModuleInterop",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- showInSimplifiedHelpView: !0,
- category: p.Interop_Constraints,
- description: p.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
- defaultValueDescription: !1
- },
- {
- name: "preserveSymlinks",
- type: "boolean",
- category: p.Interop_Constraints,
- description: p.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
- defaultValueDescription: !1
- },
- {
- name: "allowUmdGlobalAccess",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Modules,
- description: p.Allow_accessing_UMD_globals_from_modules,
- defaultValueDescription: !1
- },
- {
- name: "moduleSuffixes",
- type: "list",
- element: {
- name: "suffix",
- type: "string"
- },
- listPreserveFalsyValues: !0,
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.List_of_file_name_suffixes_to_search_when_resolving_a_module
- },
- {
- name: "allowImportingTsExtensions",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Modules,
- description: p.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
- defaultValueDescription: !1,
- transpileOptionValue: void 0
- },
- {
- name: "resolvePackageJsonExports",
- type: "boolean",
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.Use_the_package_json_exports_field_when_resolving_package_imports,
- defaultValueDescription: p.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false
- },
- {
- name: "resolvePackageJsonImports",
- type: "boolean",
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.Use_the_package_json_imports_field_when_resolving_imports,
- defaultValueDescription: p.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false
- },
- {
- name: "customConditions",
- type: "list",
- element: {
- name: "condition",
- type: "string"
- },
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports
- },
- {
- name: "noUncheckedSideEffectImports",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Modules,
- description: p.Check_side_effect_imports,
- defaultValueDescription: !1
- },
- // Source Maps
- {
- name: "sourceRoot",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- paramType: p.LOCATION,
- category: p.Emit,
- description: p.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code
- },
- {
- name: "mapRoot",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- paramType: p.LOCATION,
- category: p.Emit,
- description: p.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations
- },
- {
- name: "inlineSources",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
- defaultValueDescription: !1
- },
- // Experimental
- {
- name: "experimentalDecorators",
- type: "boolean",
- affectsEmit: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Language_and_Environment,
- description: p.Enable_experimental_support_for_legacy_experimental_decorators,
- defaultValueDescription: !1
- },
- {
- name: "emitDecoratorMetadata",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Language_and_Environment,
- description: p.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
- defaultValueDescription: !1
- },
- // Advanced
- {
- name: "jsxFactory",
- type: "string",
- category: p.Language_and_Environment,
- description: p.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,
- defaultValueDescription: "`React.createElement`"
- },
- {
- name: "jsxFragmentFactory",
- type: "string",
- category: p.Language_and_Environment,
- description: p.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,
- defaultValueDescription: "React.Fragment"
- },
- {
- name: "jsxImportSource",
- type: "string",
- affectsSemanticDiagnostics: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsModuleResolution: !0,
- affectsSourceFile: !0,
- category: p.Language_and_Environment,
- description: p.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
- defaultValueDescription: "react"
- },
- {
- name: "resolveJsonModule",
- type: "boolean",
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.Enable_importing_json_files,
- defaultValueDescription: !1
- },
- {
- name: "allowArbitraryExtensions",
- type: "boolean",
- affectsProgramStructure: !0,
- category: p.Modules,
- description: p.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,
- defaultValueDescription: !1
- },
- {
- name: "out",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsDeclarationPath: !0,
- isFilePath: !1,
- // This is intentionally broken to support compatibility with existing tsconfig files
- // for correct behaviour, please use outFile
- category: p.Backwards_Compatibility,
- paramType: p.FILE,
- transpileOptionValue: void 0,
- description: p.Deprecated_setting_Use_outFile_instead
- },
- {
- name: "reactNamespace",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Language_and_Environment,
- description: p.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,
- defaultValueDescription: "`React`"
- },
- {
- name: "skipDefaultLibCheck",
- type: "boolean",
- // We need to store these to determine whether `lib` files need to be rechecked
- affectsBuildInfo: !0,
- category: p.Completeness,
- description: p.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
- defaultValueDescription: !1
- },
- {
- name: "charset",
- type: "string",
- category: p.Backwards_Compatibility,
- description: p.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,
- defaultValueDescription: "utf8"
- },
- {
- name: "emitBOM",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
- defaultValueDescription: !1
- },
- {
- name: "newLine",
- type: new Map(Object.entries({
- crlf: 0,
- lf: 1
- /* LineFeed */
- })),
- affectsEmit: !0,
- affectsBuildInfo: !0,
- paramType: p.NEWLINE,
- category: p.Emit,
- description: p.Set_the_newline_character_for_emitting_files,
- defaultValueDescription: "lf"
- },
- {
- name: "noErrorTruncation",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Output_Formatting,
- description: p.Disable_truncating_types_in_error_messages,
- defaultValueDescription: !1
- },
- {
- name: "noLib",
- type: "boolean",
- category: p.Language_and_Environment,
- affectsProgramStructure: !0,
- description: p.Disable_including_any_library_files_including_the_default_lib_d_ts,
- // We are not returning a sourceFile for lib file when asked by the program,
- // so pass --noLib to avoid reporting a file not found error.
- transpileOptionValue: !0,
- defaultValueDescription: !1
- },
- {
- name: "noResolve",
- type: "boolean",
- affectsModuleResolution: !0,
- category: p.Modules,
- description: p.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,
- // We are not doing a full typecheck, we are not resolving the whole context,
- // so pass --noResolve to avoid reporting missing file errors.
- transpileOptionValue: !0,
- defaultValueDescription: !1
- },
- {
- name: "stripInternal",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
- defaultValueDescription: !1
- },
- {
- name: "disableSizeLimit",
- type: "boolean",
- affectsProgramStructure: !0,
- category: p.Editor_Support,
- description: p.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,
- defaultValueDescription: !1
- },
- {
- name: "disableSourceOfProjectReferenceRedirect",
- type: "boolean",
- isTSConfigOnly: !0,
- category: p.Projects,
- description: p.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
- defaultValueDescription: !1
- },
- {
- name: "disableSolutionSearching",
- type: "boolean",
- isTSConfigOnly: !0,
- category: p.Projects,
- description: p.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
- defaultValueDescription: !1
- },
- {
- name: "disableReferencedProjectLoad",
- type: "boolean",
- isTSConfigOnly: !0,
- category: p.Projects,
- description: p.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
- defaultValueDescription: !1
- },
- {
- name: "noImplicitUseStrict",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
- defaultValueDescription: !1
- },
- {
- name: "noEmitHelpers",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
- defaultValueDescription: !1
- },
- {
- name: "noEmitOnError",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- transpileOptionValue: void 0,
- description: p.Disable_emitting_files_if_any_type_checking_errors_are_reported,
- defaultValueDescription: !1
- },
- {
- name: "preserveConstEnums",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Emit,
- description: p.Disable_erasing_const_enum_declarations_in_generated_code,
- defaultValueDescription: !1
- },
- {
- name: "declarationDir",
- type: "string",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- affectsDeclarationPath: !0,
- isFilePath: !0,
- paramType: p.DIRECTORY,
- category: p.Emit,
- transpileOptionValue: void 0,
- description: p.Specify_the_output_directory_for_generated_declaration_files
- },
- {
- name: "skipLibCheck",
- type: "boolean",
- // We need to store these to determine whether `lib` files need to be rechecked
- affectsBuildInfo: !0,
- category: p.Completeness,
- description: p.Skip_type_checking_all_d_ts_files,
- defaultValueDescription: !1
- },
- {
- name: "allowUnusedLabels",
- type: "boolean",
- affectsBindDiagnostics: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Disable_error_reporting_for_unused_labels,
- defaultValueDescription: void 0
- },
- {
- name: "allowUnreachableCode",
- type: "boolean",
- affectsBindDiagnostics: !0,
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Type_Checking,
- description: p.Disable_error_reporting_for_unreachable_code,
- defaultValueDescription: void 0
- },
- {
- name: "suppressExcessPropertyErrors",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
- defaultValueDescription: !1
- },
- {
- name: "suppressImplicitAnyIndexErrors",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
- defaultValueDescription: !1
- },
- {
- name: "forceConsistentCasingInFileNames",
- type: "boolean",
- affectsModuleResolution: !0,
- category: p.Interop_Constraints,
- description: p.Ensure_that_casing_is_correct_in_imports,
- defaultValueDescription: !0
- },
- {
- name: "maxNodeModuleJsDepth",
- type: "number",
- affectsModuleResolution: !0,
- category: p.JavaScript_Support,
- description: p.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,
- defaultValueDescription: 0
- },
- {
- name: "noStrictGenericChecks",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Disable_strict_checking_of_generic_signatures_in_function_types,
- defaultValueDescription: !1
- },
- {
- name: "useDefineForClassFields",
- type: "boolean",
- affectsSemanticDiagnostics: !0,
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Language_and_Environment,
- description: p.Emit_ECMAScript_standard_compliant_class_fields,
- defaultValueDescription: p.true_for_ES2022_and_above_including_ESNext
- },
- {
- name: "preserveValueImports",
- type: "boolean",
- affectsEmit: !0,
- affectsBuildInfo: !0,
- category: p.Backwards_Compatibility,
- description: p.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
- defaultValueDescription: !1
- },
- {
- name: "keyofStringsOnly",
- type: "boolean",
- category: p.Backwards_Compatibility,
- description: p.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,
- defaultValueDescription: !1
- },
- {
- // A list of plugins to load in the language service
- name: "plugins",
- type: "list",
- isTSConfigOnly: !0,
- element: {
- name: "plugin",
- type: "object"
- },
- description: p.Specify_a_list_of_language_service_plugins_to_include,
- category: p.Editor_Support
- },
- {
- name: "moduleDetection",
- type: new Map(Object.entries({
- auto: 2,
- legacy: 1,
- force: 3
- /* Force */
- })),
- affectsSourceFile: !0,
- affectsModuleResolution: !0,
- description: p.Control_what_method_is_used_to_detect_module_format_JS_files,
- category: p.Language_and_Environment,
- defaultValueDescription: p.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules
- },
- {
- name: "ignoreDeprecations",
- type: "string",
- defaultValueDescription: void 0
- }
- ], Od = [
- ...gO,
- ...Mte
- ], Rte = Od.filter((e) => !!e.affectsSemanticDiagnostics), jte = Od.filter((e) => !!e.affectsEmit), Bte = Od.filter((e) => !!e.affectsDeclarationPath), mz = Od.filter((e) => !!e.affectsModuleResolution), gz = Od.filter((e) => !!e.affectsSourceFile || !!e.affectsBindDiagnostics), Jte = Od.filter((e) => !!e.affectsProgramStructure), zte = Od.filter((e) => co(e, "transpileOptionValue")), U9e = Od.filter(
- (e) => e.allowConfigDirTemplateSubstitution || !e.isCommandLineOnly && e.isFilePath
- ), V9e = zx.filter(
- (e) => e.allowConfigDirTemplateSubstitution || !e.isCommandLineOnly && e.isFilePath
- ), Wte = Od.filter(q9e);
- function q9e(e) {
- return !_s(e.type);
- }
- var hz = [
- {
- name: "verbose",
- shortName: "v",
- category: p.Command_line_Options,
- description: p.Enable_verbose_logging,
- type: "boolean",
- defaultValueDescription: !1
- },
- {
- name: "dry",
- shortName: "d",
- category: p.Command_line_Options,
- description: p.Show_what_would_be_built_or_deleted_if_specified_with_clean,
- type: "boolean",
- defaultValueDescription: !1
- },
- {
- name: "force",
- shortName: "f",
- category: p.Command_line_Options,
- description: p.Build_all_projects_including_those_that_appear_to_be_up_to_date,
- type: "boolean",
- defaultValueDescription: !1
- },
- {
- name: "clean",
- category: p.Command_line_Options,
- description: p.Delete_the_outputs_of_all_projects,
- type: "boolean",
- defaultValueDescription: !1
- },
- {
- name: "stopBuildOnErrors",
- category: p.Command_line_Options,
- description: p.Skip_building_downstream_projects_on_error_in_upstream_project,
- type: "boolean",
- defaultValueDescription: !1
- }
- ], hA = [
- ...gO,
- ...hz
- ], hO = [
- {
- name: "enable",
- type: "boolean",
- defaultValueDescription: !1
- },
- {
- name: "include",
- type: "list",
- element: {
- name: "include",
- type: "string"
- }
- },
- {
- name: "exclude",
- type: "list",
- element: {
- name: "exclude",
- type: "string"
- }
- },
- {
- name: "disableFilenameBasedTypeAcquisition",
- type: "boolean",
- defaultValueDescription: !1
- }
- ];
- function yO(e) {
- const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
- return ir(e, (i) => {
- t.set(i.name.toLowerCase(), i), i.shortName && n.set(i.shortName, i.name);
- }), { optionsNameMap: t, shortOptionNames: n };
- }
- var e0e;
- function i6() {
- return e0e || (e0e = yO(Od));
- }
- var H9e = {
- diagnostic: p.Compiler_option_0_may_only_be_used_with_build,
- getOptionsNameMap: s0e
- }, yz = {
- module: 1,
- target: 3,
- strict: !0,
- esModuleInterop: !0,
- forceConsistentCasingInFileNames: !0,
- skipLibCheck: !0
- };
- function Ute(e) {
- return t0e(e, Go);
- }
- function t0e(e, t) {
- const n = as(e.type.keys()), i = (e.deprecatedKeys ? n.filter((s) => !e.deprecatedKeys.has(s)) : n).map((s) => `'${s}'`).join(", ");
- return t(p.Argument_for_0_option_must_be_Colon_1, `--${e.name}`, i);
- }
- function vO(e, t, n) {
- return J0e(e, (t ?? "").trim(), n);
- }
- function Vte(e, t = "", n) {
- if (t = t.trim(), Ui(t, "-"))
- return;
- if (e.type === "listOrElement" && !t.includes(","))
- return Wx(e, t, n);
- if (t === "")
- return [];
- const i = t.split(",");
- switch (e.element.type) {
- case "number":
- return Ai(i, (s) => Wx(e.element, parseInt(s), n));
- case "string":
- return Ai(i, (s) => Wx(e.element, s || "", n));
- case "boolean":
- case "object":
- return E.fail(`List of ${e.element.type} is not yet supported.`);
- default:
- return Ai(i, (s) => vO(e.element, s, n));
- }
- }
- function r0e(e) {
- return e.name;
- }
- function qte(e, t, n, i, s) {
- var o;
- if ((o = t.alternateMode) != null && o.getOptionsNameMap().optionsNameMap.has(e.toLowerCase()))
- return vv(s, i, t.alternateMode.diagnostic, e);
- const c = _b(e, t.optionDeclarations, r0e);
- return c ? vv(s, i, t.unknownDidYouMeanDiagnostic, n || e, c.name) : vv(s, i, t.unknownOptionDiagnostic, n || e);
- }
- function vz(e, t, n) {
- const i = {};
- let s;
- const o = [], c = [];
- return _(t), {
- options: i,
- watchOptions: s,
- fileNames: o,
- errors: c
- };
- function _(d) {
- let g = 0;
- for (; g < d.length; ) {
- const h = d[g];
- if (g++, h.charCodeAt(0) === 64)
- u(h.slice(1));
- else if (h.charCodeAt(0) === 45) {
- const S = h.slice(h.charCodeAt(1) === 45 ? 2 : 1), T = Gte(
- e.getOptionsNameMap,
- S,
- /*allowShort*/
- !0
- );
- if (T)
- g = n0e(d, g, e, T, i, c);
- else {
- const C = Gte(
- xz.getOptionsNameMap,
- S,
- /*allowShort*/
- !0
- );
- C ? g = n0e(d, g, xz, C, s || (s = {}), c) : c.push(qte(S, e, h));
- }
- } else
- o.push(h);
- }
- }
- function u(d) {
- const g = yD(d, n || ((T) => ll.readFile(T)));
- if (!_s(g)) {
- c.push(g);
- return;
- }
- const h = [];
- let S = 0;
- for (; ; ) {
- for (; S < g.length && g.charCodeAt(S) <= 32; ) S++;
- if (S >= g.length) break;
- const T = S;
- if (g.charCodeAt(T) === 34) {
- for (S++; S < g.length && g.charCodeAt(S) !== 34; ) S++;
- S < g.length ? (h.push(g.substring(T + 1, S)), S++) : c.push(Go(p.Unterminated_quoted_string_in_response_file_0, d));
- } else {
- for (; g.charCodeAt(S) > 32; ) S++;
- h.push(g.substring(T, S));
- }
- }
- _(h);
- }
- }
- function n0e(e, t, n, i, s, o) {
- if (i.isTSConfigOnly) {
- const c = e[t];
- c === "null" ? (s[i.name] = void 0, t++) : i.type === "boolean" ? c === "false" ? (s[i.name] = Wx(
- i,
- /*value*/
- !1,
- o
- ), t++) : (c === "true" && t++, o.push(Go(p.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, i.name))) : (o.push(Go(p.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, i.name)), c && !Ui(c, "-") && t++);
- } else if (!e[t] && i.type !== "boolean" && o.push(Go(n.optionTypeMismatchDiagnostic, i.name, kz(i))), e[t] !== "null")
- switch (i.type) {
- case "number":
- s[i.name] = Wx(i, parseInt(e[t]), o), t++;
- break;
- case "boolean":
- const c = e[t];
- s[i.name] = Wx(i, c !== "false", o), (c === "false" || c === "true") && t++;
- break;
- case "string":
- s[i.name] = Wx(i, e[t] || "", o), t++;
- break;
- case "list":
- const _ = Vte(i, e[t], o);
- s[i.name] = _ || [], _ && t++;
- break;
- case "listOrElement":
- E.fail("listOrElement not supported here");
- break;
- default:
- s[i.name] = vO(i, e[t], o), t++;
- break;
- }
- else
- s[i.name] = void 0, t++;
- return t;
- }
- var bO = {
- alternateMode: H9e,
- getOptionsNameMap: i6,
- optionDeclarations: Od,
- unknownOptionDiagnostic: p.Unknown_compiler_option_0,
- unknownDidYouMeanDiagnostic: p.Unknown_compiler_option_0_Did_you_mean_1,
- optionTypeMismatchDiagnostic: p.Compiler_option_0_expects_an_argument
- };
- function Hte(e, t) {
- return vz(bO, e, t);
- }
- function bz(e, t) {
- return Gte(i6, e, t);
- }
- function Gte(e, t, n = !1) {
- t = t.toLowerCase();
- const { optionsNameMap: i, shortOptionNames: s } = e();
- if (n) {
- const o = s.get(t);
- o !== void 0 && (t = o);
- }
- return i.get(t);
- }
- var i0e;
- function s0e() {
- return i0e || (i0e = yO(hA));
- }
- var G9e = {
- diagnostic: p.Compiler_option_0_may_not_be_used_with_build,
- getOptionsNameMap: i6
- }, $9e = {
- alternateMode: G9e,
- getOptionsNameMap: s0e,
- optionDeclarations: hA,
- unknownOptionDiagnostic: p.Unknown_build_option_0,
- unknownDidYouMeanDiagnostic: p.Unknown_build_option_0_Did_you_mean_1,
- optionTypeMismatchDiagnostic: p.Build_option_0_requires_a_value_of_type_1
- };
- function $te(e) {
- const { options: t, watchOptions: n, fileNames: i, errors: s } = vz(
- $9e,
- e
- ), o = t;
- return i.length === 0 && i.push("."), o.clean && o.force && s.push(Go(p.Options_0_and_1_cannot_be_combined, "clean", "force")), o.clean && o.verbose && s.push(Go(p.Options_0_and_1_cannot_be_combined, "clean", "verbose")), o.clean && o.watch && s.push(Go(p.Options_0_and_1_cannot_be_combined, "clean", "watch")), o.watch && o.dry && s.push(Go(p.Options_0_and_1_cannot_be_combined, "watch", "dry")), { buildOptions: o, watchOptions: n, projects: i, errors: s };
- }
- function g_(e, ...t) {
- return Bs(Go(e, ...t).messageText, _s);
- }
- function yA(e, t, n, i, s, o) {
- const c = yD(e, (d) => n.readFile(d));
- if (!_s(c)) {
- n.onUnRecoverableConfigFileDiagnostic(c);
- return;
- }
- const _ = mA(e, c), u = n.getCurrentDirectory();
- return _.path = uo(e, u, zl(n.useCaseSensitiveFileNames)), _.resolvedPath = _.path, _.originalFileName = _.fileName, SA(
- _,
- n,
- es(Xn(e), u),
- t,
- es(e, u),
- /*resolutionStack*/
- void 0,
- o,
- i,
- s
- );
- }
- function vA(e, t) {
- const n = yD(e, t);
- return _s(n) ? Sz(e, n) : { config: {}, error: n };
- }
- function Sz(e, t) {
- const n = mA(e, t);
- return {
- config: y0e(
- n,
- n.parseDiagnostics,
- /*jsonConversionNotifier*/
- void 0
- ),
- error: n.parseDiagnostics.length ? n.parseDiagnostics[0] : void 0
- };
- }
- function Xte(e, t) {
- const n = yD(e, t);
- return _s(n) ? mA(e, n) : { fileName: e, parseDiagnostics: [n] };
- }
- function yD(e, t) {
- let n;
- try {
- n = t(e);
- } catch (i) {
- return Go(p.Cannot_read_file_0_Colon_1, e, i.message);
- }
- return n === void 0 ? Go(p.Cannot_read_file_0, e) : n;
- }
- function Tz(e) {
- return Yk(e, r0e);
- }
- var a0e = {
- optionDeclarations: hO,
- unknownOptionDiagnostic: p.Unknown_type_acquisition_option_0,
- unknownDidYouMeanDiagnostic: p.Unknown_type_acquisition_option_0_Did_you_mean_1
- }, o0e;
- function c0e() {
- return o0e || (o0e = yO(zx));
- }
- var xz = {
- getOptionsNameMap: c0e,
- optionDeclarations: zx,
- unknownOptionDiagnostic: p.Unknown_watch_option_0,
- unknownDidYouMeanDiagnostic: p.Unknown_watch_option_0_Did_you_mean_1,
- optionTypeMismatchDiagnostic: p.Watch_option_0_requires_a_value_of_type_1
- }, l0e;
- function u0e() {
- return l0e || (l0e = Tz(Od));
- }
- var _0e;
- function f0e() {
- return _0e || (_0e = Tz(zx));
- }
- var p0e;
- function d0e() {
- return p0e || (p0e = Tz(hO));
- }
- var SO = {
- name: "extends",
- type: "listOrElement",
- element: {
- name: "extends",
- type: "string"
- },
- category: p.File_Management,
- disallowNullOrUndefined: !0
- }, m0e = {
- name: "compilerOptions",
- type: "object",
- elementOptions: u0e(),
- extraKeyDiagnostics: bO
- }, g0e = {
- name: "watchOptions",
- type: "object",
- elementOptions: f0e(),
- extraKeyDiagnostics: xz
- }, h0e = {
- name: "typeAcquisition",
- type: "object",
- elementOptions: d0e(),
- extraKeyDiagnostics: a0e
- }, Qte;
- function X9e() {
- return Qte === void 0 && (Qte = {
- name: void 0,
- // should never be needed since this is root
- type: "object",
- elementOptions: Tz([
- m0e,
- g0e,
- h0e,
- SO,
- {
- name: "references",
- type: "list",
- element: {
- name: "references",
- type: "object"
- },
- category: p.Projects
- },
- {
- name: "files",
- type: "list",
- element: {
- name: "files",
- type: "string"
- },
- category: p.File_Management
- },
- {
- name: "include",
- type: "list",
- element: {
- name: "include",
- type: "string"
- },
- category: p.File_Management,
- defaultValueDescription: p.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk
- },
- {
- name: "exclude",
- type: "list",
- element: {
- name: "exclude",
- type: "string"
- },
- category: p.File_Management,
- defaultValueDescription: p.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified
- },
- Fte
- ])
- }), Qte;
- }
- function y0e(e, t, n) {
- var i;
- const s = (i = e.statements[0]) == null ? void 0 : i.expression;
- if (s && s.kind !== 210) {
- if (t.push(sp(
- e,
- s,
- p.The_root_value_of_a_0_file_must_be_an_object,
- Hc(e.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json"
- )), $l(s)) {
- const o = On(s.elements, Ks);
- if (o)
- return bA(
- e,
- o,
- t,
- /*returnValue*/
- !0,
- n
- );
- }
- return {};
- }
- return bA(
- e,
- s,
- t,
- /*returnValue*/
- !0,
- n
- );
- }
- function Yte(e, t) {
- var n;
- return bA(
- e,
- (n = e.statements[0]) == null ? void 0 : n.expression,
- t,
- /*returnValue*/
- !0,
- /*jsonConversionNotifier*/
- void 0
- );
- }
- function bA(e, t, n, i, s) {
- if (!t)
- return i ? {} : void 0;
- return _(t, s?.rootOptions);
- function o(d, g) {
- var h;
- const S = i ? {} : void 0;
- for (const T of d.properties) {
- if (T.kind !== 303) {
- n.push(sp(e, T, p.Property_assignment_expected));
- continue;
- }
- T.questionToken && n.push(sp(e, T.questionToken, p.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")), u(T.name) || n.push(sp(e, T.name, p.String_literal_with_double_quotes_expected));
- const C = Ww(T.name) ? void 0 : QT(T.name), D = C && Ei(C), P = D ? (h = g?.elementOptions) == null ? void 0 : h.get(D) : void 0, I = _(T.initializer, P);
- typeof D < "u" && (i && (S[D] = I), s?.onPropertySet(D, I, T, g, P));
- }
- return S;
- }
- function c(d, g) {
- if (!i) {
- d.forEach((h) => _(h, g));
- return;
- }
- return Ln(d.map((h) => _(h, g)), (h) => h !== void 0);
- }
- function _(d, g) {
- switch (d.kind) {
- case 112:
- return !0;
- case 97:
- return !1;
- case 106:
- return null;
- case 11:
- return u(d) || n.push(sp(e, d, p.String_literal_with_double_quotes_expected)), d.text;
- case 9:
- return Number(d.text);
- case 224:
- if (d.operator !== 41 || d.operand.kind !== 9)
- break;
- return -Number(d.operand.text);
- case 210:
- return o(d, g);
- case 209:
- return c(
- d.elements,
- g && g.element
- );
- }
- g ? n.push(sp(e, d, p.Compiler_option_0_requires_a_value_of_type_1, g.name, kz(g))) : n.push(sp(e, d, p.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal));
- }
- function u(d) {
- return oa(d) && w7(d, e);
- }
- }
- function kz(e) {
- return e.type === "listOrElement" ? `${kz(e.element)} or Array` : e.type === "list" ? "Array" : _s(e.type) ? e.type : "string";
- }
- function v0e(e, t) {
- if (e) {
- if (TA(t)) return !e.disallowNullOrUndefined;
- if (e.type === "list")
- return us(t);
- if (e.type === "listOrElement")
- return us(t) || v0e(e.element, t);
- const n = _s(e.type) ? e.type : "string";
- return typeof t === n;
- }
- return !1;
- }
- function Cz(e, t, n) {
- var i, s, o;
- const c = zl(n.useCaseSensitiveFileNames), _ = lr(
- Ln(
- e.fileNames,
- (s = (i = e.options.configFile) == null ? void 0 : i.configFileSpecs) != null && s.validatedIncludeSpecs ? Y9e(
- t,
- e.options.configFile.configFileSpecs.validatedIncludeSpecs,
- e.options.configFile.configFileSpecs.validatedExcludeSpecs,
- n
- ) : B1
- ),
- (C) => qE(es(t, n.getCurrentDirectory()), es(C, n.getCurrentDirectory()), c)
- ), u = { configFilePath: es(t, n.getCurrentDirectory()), useCaseSensitiveFileNames: n.useCaseSensitiveFileNames }, d = xO(e.options, u), g = e.watchOptions && Z9e(e.watchOptions), h = {
- compilerOptions: {
- ...TO(d),
- showConfig: void 0,
- configFile: void 0,
- configFilePath: void 0,
- help: void 0,
- init: void 0,
- listFiles: void 0,
- listEmittedFiles: void 0,
- project: void 0,
- build: void 0,
- version: void 0
- },
- watchOptions: g && TO(g),
- references: lr(e.projectReferences, (C) => ({ ...C, path: C.originalPath ? C.originalPath : "", originalPath: void 0 })),
- files: Nr(_) ? _ : void 0,
- ...(o = e.options.configFile) != null && o.configFileSpecs ? {
- include: Q9e(e.options.configFile.configFileSpecs.validatedIncludeSpecs),
- exclude: e.options.configFile.configFileSpecs.validatedExcludeSpecs
- } : {},
- compileOnSave: e.compileOnSave ? !0 : void 0
- }, S = new Set(d.keys()), T = {};
- for (const C in rl)
- if (!S.has(C) && ut(rl[C].dependencies, (D) => S.has(D))) {
- const D = rl[C].computeValue(e.options), P = rl[C].computeValue({});
- D !== P && (T[C] = rl[C].computeValue(e.options));
- }
- return z2(h.compilerOptions, TO(xO(T, u))), h;
- }
- function TO(e) {
- return Object.fromEntries(e);
- }
- function Q9e(e) {
- if (Nr(e)) {
- if (Nr(e) !== 1) return e;
- if (e[0] !== C0e)
- return e;
- }
- }
- function Y9e(e, t, n, i) {
- if (!t) return B1;
- const s = y5(e, n, t, i.useCaseSensitiveFileNames, i.getCurrentDirectory()), o = s.excludePattern && Jy(s.excludePattern, i.useCaseSensitiveFileNames), c = s.includeFilePattern && Jy(s.includeFilePattern, i.useCaseSensitiveFileNames);
- return c ? o ? (_) => !(c.test(_) && !o.test(_)) : (_) => !c.test(_) : o ? (_) => o.test(_) : B1;
- }
- function b0e(e) {
- switch (e.type) {
- case "string":
- case "number":
- case "boolean":
- case "object":
- return;
- case "list":
- case "listOrElement":
- return b0e(e.element);
- default:
- return e.type;
- }
- }
- function Ez(e, t) {
- return El(t, (n, i) => {
- if (n === e)
- return i;
- });
- }
- function xO(e, t) {
- return S0e(e, i6(), t);
- }
- function Z9e(e) {
- return S0e(e, c0e());
- }
- function S0e(e, { optionsNameMap: t }, n) {
- const i = /* @__PURE__ */ new Map(), s = n && zl(n.useCaseSensitiveFileNames);
- for (const o in e)
- if (co(e, o)) {
- if (t.has(o) && (t.get(o).category === p.Command_line_Options || t.get(o).category === p.Output_Formatting))
- continue;
- const c = e[o], _ = t.get(o.toLowerCase());
- if (_) {
- E.assert(_.type !== "listOrElement");
- const u = b0e(_);
- u ? _.type === "list" ? i.set(o, c.map((d) => Ez(d, u))) : i.set(o, Ez(c, u)) : n && _.isFilePath ? i.set(o, qE(n.configFilePath, es(c, Xn(n.configFilePath)), s)) : n && _.type === "list" && _.element.isFilePath ? i.set(o, c.map((d) => qE(n.configFilePath, es(d, Xn(n.configFilePath)), s))) : i.set(o, c);
- }
- }
- return i;
- }
- function Zte(e, t) {
- const n = T0e(e);
- return s();
- function i(o) {
- return Array(o + 1).join(" ");
- }
- function s() {
- const o = [], c = i(2);
- return Mte.forEach((_) => {
- if (!n.has(_.name))
- return;
- const u = n.get(_.name), d = are(_);
- u !== d ? o.push(`${c}${_.name}: ${u}`) : co(yz, _.name) && o.push(`${c}${_.name}: ${d}`);
- }), o.join(t) + t;
- }
- }
- function T0e(e) {
- const t = pI(e, yz);
- return xO(t);
- }
- function Kte(e, t, n) {
- const i = T0e(e);
- return c();
- function s(_) {
- return Array(_ + 1).join(" ");
- }
- function o({ category: _, name: u, isCommandLineOnly: d }) {
- const g = [p.Command_line_Options, p.Editor_Support, p.Compiler_Diagnostics, p.Backwards_Compatibility, p.Watch_and_Build_Modes, p.Output_Formatting];
- return !d && _ !== void 0 && (!g.includes(_) || i.has(u));
- }
- function c() {
- const _ = /* @__PURE__ */ new Map();
- _.set(p.Projects, []), _.set(p.Language_and_Environment, []), _.set(p.Modules, []), _.set(p.JavaScript_Support, []), _.set(p.Emit, []), _.set(p.Interop_Constraints, []), _.set(p.Type_Checking, []), _.set(p.Completeness, []);
- for (const T of Od)
- if (o(T)) {
- let C = _.get(T.category);
- C || _.set(T.category, C = []), C.push(T);
- }
- let u = 0, d = 0;
- const g = [];
- _.forEach((T, C) => {
- g.length !== 0 && g.push({ value: "" }), g.push({ value: `/* ${ms(C)} */` });
- for (const D of T) {
- let P;
- i.has(D.name) ? P = `"${D.name}": ${JSON.stringify(i.get(D.name))}${(d += 1) === i.size ? "" : ","}` : P = `// "${D.name}": ${JSON.stringify(are(D))},`, g.push({
- value: P,
- description: `/* ${D.description && ms(D.description) || D.name} */`
- }), u = Math.max(P.length, u);
- }
- });
- const h = s(2), S = [];
- S.push("{"), S.push(`${h}"compilerOptions": {`), S.push(`${h}${h}/* ${ms(p.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`), S.push("");
- for (const T of g) {
- const { value: C, description: D = "" } = T;
- S.push(C && `${h}${h}${C}${D && s(u - C.length + 2) + D}`);
- }
- if (t.length) {
- S.push(`${h}},`), S.push(`${h}"files": [`);
- for (let T = 0; T < t.length; T++)
- S.push(`${h}${h}${JSON.stringify(t[T])}${T === t.length - 1 ? "" : ","}`);
- S.push(`${h}]`);
- } else
- S.push(`${h}}`);
- return S.push("}"), S.join(n) + n;
- }
- }
- function kO(e, t) {
- const n = {}, i = i6().optionsNameMap;
- for (const s in e)
- co(e, s) && (n[s] = K9e(
- i.get(s.toLowerCase()),
- e[s],
- t
- ));
- return n.configFilePath && (n.configFilePath = t(n.configFilePath)), n;
- }
- function K9e(e, t, n) {
- if (e && !TA(t)) {
- if (e.type === "list") {
- const i = t;
- if (e.element.isFilePath && i.length)
- return i.map(n);
- } else if (e.isFilePath)
- return n(t);
- E.assert(e.type !== "listOrElement");
- }
- return t;
- }
- function x0e(e, t, n, i, s, o, c, _, u) {
- return E0e(
- e,
- /*sourceFile*/
- void 0,
- t,
- n,
- i,
- u,
- s,
- o,
- c,
- _
- );
- }
- function SA(e, t, n, i, s, o, c, _, u) {
- var d, g;
- (d = rn) == null || d.push(rn.Phase.Parse, "parseJsonSourceFileConfigFileContent", { path: e.fileName });
- const h = E0e(
- /*json*/
- void 0,
- e,
- t,
- n,
- i,
- u,
- s,
- o,
- c,
- _
- );
- return (g = rn) == null || g.pop(), h;
- }
- function Dz(e, t) {
- t && Object.defineProperty(e, "configFile", { enumerable: !1, writable: !1, value: t });
- }
- function TA(e) {
- return e == null;
- }
- function k0e(e, t) {
- return Xn(es(e, t));
- }
- var C0e = "**/*";
- function E0e(e, t, n, i, s = {}, o, c, _ = [], u = [], d) {
- E.assert(e === void 0 && t !== void 0 || e !== void 0 && t === void 0);
- const g = [], h = I0e(e, t, n, i, c, _, g, d), { raw: S } = h, T = D0e(
- pI(s, h.options || {}),
- U9e,
- i
- ), C = CO(
- o && h.watchOptions ? pI(o, h.watchOptions) : h.watchOptions || o,
- i
- );
- T.configFilePath = c && Wl(c);
- const D = Os(c ? k0e(c, i) : i), P = I();
- return t && (t.configFileSpecs = P), Dz(T, t), {
- options: T,
- watchOptions: C,
- fileNames: F(D),
- projectReferences: O(D),
- typeAcquisition: h.typeAcquisition || wz(),
- raw: S,
- errors: g,
- // Wildcard directories (provided as part of a wildcard path) are stored in a
- // file map that marks whether it was a regular wildcard match (with a `*` or `?` token),
- // or a recursive directory. This information is used by filesystem watchers to monitor for
- // new entries in these paths.
- wildcardDirectories: _Le(P, D, n.useCaseSensitiveFileNames),
- compileOnSave: !!S.compileOnSave
- };
- function I() {
- const V = X("references", (he) => typeof he == "object", "object"), ae = B(z("files"));
- if (ae) {
- const he = V === "no-prop" || us(V) && V.length === 0, le = co(S, "extends");
- if (ae.length === 0 && he && !le)
- if (t) {
- const me = c || "tsconfig.json", ve = p.The_files_list_in_config_file_0_is_empty, tt = $w(t, "files", (we) => we.initializer), Te = vv(t, tt, ve, me);
- g.push(Te);
- } else
- q(p.The_files_list_in_config_file_0_is_empty, c || "tsconfig.json");
- }
- let ee = B(z("include"));
- const G = z("exclude");
- let ue = !1, re = B(G);
- if (G === "no-prop") {
- const he = T.outDir, le = T.declarationDir;
- (he || le) && (re = Ln([he, le], (me) => !!me));
- }
- ae === void 0 && ee === void 0 && (ee = [C0e], ue = !0);
- let ne, ie, Se, J;
- ee && (ne = V0e(
- ee,
- g,
- /*disallowTrailingRecursion*/
- !0,
- t,
- "include"
- ), Se = EO(
- ne,
- D
- ) || ne), re && (ie = V0e(
- re,
- g,
- /*disallowTrailingRecursion*/
- !1,
- t,
- "exclude"
- ), J = EO(
- ie,
- D
- ) || ie);
- const oe = Ln(ae, _s), _e = EO(
- oe,
- D
- ) || oe;
- return {
- filesSpecs: ae,
- includeSpecs: ee,
- excludeSpecs: re,
- validatedFilesSpec: _e,
- validatedIncludeSpecs: Se,
- validatedExcludeSpecs: J,
- validatedFilesSpecBeforeSubstitution: oe,
- validatedIncludeSpecsBeforeSubstitution: ne,
- validatedExcludeSpecsBeforeSubstitution: ie,
- pathPatterns: void 0,
- // Initialized on first use
- isDefaultIncludeSpec: ue
- };
- }
- function F(V) {
- const ae = bD(P, V, T, n, u);
- return N0e(ae, vD(S), _) && g.push(A0e(P, c)), ae;
- }
- function O(V) {
- let ae;
- const ee = X("references", (G) => typeof G == "object", "object");
- if (us(ee))
- for (const G of ee)
- typeof G.path != "string" ? q(p.Compiler_option_0_requires_a_value_of_type_1, "reference.path", "string") : (ae || (ae = [])).push({
- path: es(G.path, V),
- originalPath: G.path,
- prepend: G.prepend,
- circular: G.circular
- });
- return ae;
- }
- function B(V) {
- return us(V) ? V : void 0;
- }
- function z(V) {
- return X(V, _s, "string");
- }
- function X(V, ae, ee) {
- if (co(S, V) && !TA(S[V]))
- if (us(S[V])) {
- const G = S[V];
- return !t && !Mi(G, ae) && g.push(Go(p.Compiler_option_0_requires_a_value_of_type_1, V, ee)), G;
- } else
- return q(p.Compiler_option_0_requires_a_value_of_type_1, V, "Array"), "not-array";
- return "no-prop";
- }
- function q(V, ...ae) {
- t || g.push(Go(V, ...ae));
- }
- }
- function CO(e, t) {
- return D0e(e, V9e, t);
- }
- function D0e(e, t, n) {
- if (!e) return e;
- let i;
- for (const o of t)
- if (e[o.name] !== void 0) {
- const c = e[o.name];
- switch (o.type) {
- case "string":
- E.assert(o.isFilePath), Pz(c) && s(o, w0e(c, n));
- break;
- case "list":
- E.assert(o.element.isFilePath);
- const _ = EO(c, n);
- _ && s(o, _);
- break;
- case "object":
- E.assert(o.name === "paths");
- const u = eLe(c, n);
- u && s(o, u);
- break;
- default:
- E.fail("option type not supported");
- }
- }
- return i || e;
- function s(o, c) {
- (i ?? (i = z2({}, e)))[o.name] = c;
- }
- }
- var P0e = "${configDir}";
- function Pz(e) {
- return _s(e) && Ui(
- e,
- P0e,
- /*ignoreCase*/
- !0
- );
- }
- function w0e(e, t) {
- return es(e.replace(P0e, "./"), t);
- }
- function EO(e, t) {
- if (!e) return e;
- let n;
- return e.forEach((i, s) => {
- Pz(i) && ((n ?? (n = e.slice()))[s] = w0e(i, t));
- }), n;
- }
- function eLe(e, t) {
- let n;
- return rm(e).forEach((s) => {
- if (!us(e[s])) return;
- const o = EO(e[s], t);
- o && ((n ?? (n = z2({}, e)))[s] = o);
- }), n;
- }
- function tLe(e) {
- return e.code === p.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code;
- }
- function A0e({ includeSpecs: e, excludeSpecs: t }, n) {
- return Go(
- p.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,
- n || "tsconfig.json",
- JSON.stringify(e || []),
- JSON.stringify(t || [])
- );
- }
- function N0e(e, t, n) {
- return e.length === 0 && t && (!n || n.length === 0);
- }
- function vD(e) {
- return !co(e, "files") && !co(e, "references");
- }
- function DO(e, t, n, i, s) {
- const o = i.length;
- return N0e(e, s) ? i.push(A0e(n, t)) : nR(i, (c) => !tLe(c)), o !== i.length;
- }
- function rLe(e) {
- return !!e.options;
- }
- function I0e(e, t, n, i, s, o, c, _) {
- var u;
- i = Wl(i);
- const d = es(s || "", i);
- if (o.includes(d))
- return c.push(Go(p.Circularity_detected_while_resolving_configuration_Colon_0, [...o, d].join(" -> "))), { raw: e || Yte(t, c) };
- const g = e ? nLe(e, n, i, s, c) : iLe(t, n, i, s, c);
- if ((u = g.options) != null && u.paths && (g.options.pathsBasePath = i), g.extendedConfigPath) {
- o = o.concat([d]);
- const S = { options: {} };
- _s(g.extendedConfigPath) ? h(S, g.extendedConfigPath) : g.extendedConfigPath.forEach((T) => h(S, T)), S.include && (g.raw.include = S.include), S.exclude && (g.raw.exclude = S.exclude), S.files && (g.raw.files = S.files), g.raw.compileOnSave === void 0 && S.compileOnSave && (g.raw.compileOnSave = S.compileOnSave), t && S.extendedSourceFiles && (t.extendedSourceFiles = as(S.extendedSourceFiles.keys())), g.options = z2(S.options, g.options), g.watchOptions = g.watchOptions && S.watchOptions ? z2(S.watchOptions, g.watchOptions) : g.watchOptions || S.watchOptions;
- }
- return g;
- function h(S, T) {
- const C = sLe(t, T, n, o, c, _, S);
- if (C && rLe(C)) {
- const D = C.raw;
- let P;
- const I = (F) => {
- g.raw[F] || D[F] && (S[F] = lr(D[F], (O) => Pz(O) || H_(O) ? O : Bn(
- P || (P = VE(Xn(T), i, zl(n.useCaseSensitiveFileNames))),
- O
- )));
- };
- I("include"), I("exclude"), I("files"), D.compileOnSave !== void 0 && (S.compileOnSave = D.compileOnSave), z2(S.options, C.options), S.watchOptions = S.watchOptions && C.watchOptions ? z2({}, S.watchOptions, C.watchOptions) : S.watchOptions || C.watchOptions;
- }
- }
- }
- function nLe(e, t, n, i, s) {
- co(e, "excludes") && s.push(Go(p.Unknown_option_excludes_Did_you_mean_exclude));
- const o = j0e(e.compilerOptions, n, s, i), c = B0e(e.typeAcquisition, n, s, i), _ = oLe(e.watchOptions, n, s);
- e.compileOnSave = aLe(e, n, s);
- const u = e.extends || e.extends === "" ? O0e(e.extends, t, n, i, s) : void 0;
- return { raw: e, options: o, watchOptions: _, typeAcquisition: c, extendedConfigPath: u };
- }
- function O0e(e, t, n, i, s, o, c, _) {
- let u;
- const d = i ? k0e(i, n) : n;
- if (_s(e))
- u = F0e(
- e,
- t,
- d,
- s,
- c,
- _
- );
- else if (us(e)) {
- u = [];
- for (let g = 0; g < e.length; g++) {
- const h = e[g];
- _s(h) ? u = wr(
- u,
- F0e(
- h,
- t,
- d,
- s,
- c?.elements[g],
- _
- )
- ) : kS(SO.element, e, n, s, o, c?.elements[g], _);
- }
- } else
- kS(SO, e, n, s, o, c, _);
- return u;
- }
- function iLe(e, t, n, i, s) {
- const o = R0e(i);
- let c, _, u, d;
- const g = X9e(), h = y0e(
- e,
- s,
- { rootOptions: g, onPropertySet: S }
- );
- return c || (c = wz(i)), d && h && h.compilerOptions === void 0 && s.push(sp(e, d[0], p._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, QT(d[0]))), { raw: h, options: o, watchOptions: _, typeAcquisition: c, extendedConfigPath: u };
- function S(T, C, D, P, I) {
- if (I && I !== SO && (C = kS(I, C, n, s, D, D.initializer, e)), P?.name)
- if (I) {
- let F;
- P === m0e ? F = o : P === g0e ? F = _ ?? (_ = {}) : P === h0e ? F = c ?? (c = wz(i)) : E.fail("Unknown option"), F[I.name] = C;
- } else T && P?.extraKeyDiagnostics && (P.elementOptions ? s.push(qte(
- T,
- P.extraKeyDiagnostics,
- /*unknownOptionErrorText*/
- void 0,
- D.name,
- e
- )) : s.push(sp(e, D.name, P.extraKeyDiagnostics.unknownOptionDiagnostic, T)));
- else P === g && (I === SO ? u = O0e(C, t, n, i, s, D, D.initializer, e) : I || (T === "excludes" && s.push(sp(e, D.name, p.Unknown_option_excludes_Did_you_mean_exclude)), On(Mte, (F) => F.name === T) && (d = wr(d, D.name))));
- }
- }
- function F0e(e, t, n, i, s, o) {
- if (e = Wl(e), H_(e) || Ui(e, "./") || Ui(e, "../")) {
- let _ = es(e, n);
- if (!t.fileExists(_) && !Zo(
- _,
- ".json"
- /* Json */
- ) && (_ = `${_}.json`, !t.fileExists(_))) {
- i.push(vv(o, s, p.File_0_not_found, e));
- return;
- }
- return _;
- }
- const c = vre(e, Bn(n, "tsconfig.json"), t);
- if (c.resolvedModule)
- return c.resolvedModule.resolvedFileName;
- e === "" ? i.push(vv(o, s, p.Compiler_option_0_cannot_be_given_an_empty_string, "extends")) : i.push(vv(o, s, p.File_0_not_found, e));
- }
- function sLe(e, t, n, i, s, o, c) {
- const _ = n.useCaseSensitiveFileNames ? t : vy(t);
- let u, d, g;
- if (o && (u = o.get(_)) ? { extendedResult: d, extendedConfig: g } = u : (d = Xte(t, (h) => n.readFile(h)), d.parseDiagnostics.length || (g = I0e(
- /*json*/
- void 0,
- d,
- n,
- Xn(t),
- Hc(t),
- i,
- s,
- o
- )), o && o.set(_, { extendedResult: d, extendedConfig: g })), e && ((c.extendedSourceFiles ?? (c.extendedSourceFiles = /* @__PURE__ */ new Set())).add(d.fileName), d.extendedSourceFiles))
- for (const h of d.extendedSourceFiles)
- c.extendedSourceFiles.add(h);
- if (d.parseDiagnostics.length) {
- s.push(...d.parseDiagnostics);
- return;
- }
- return g;
- }
- function aLe(e, t, n) {
- if (!co(e, Fte.name))
- return !1;
- const i = kS(Fte, e.compileOnSave, t, n);
- return typeof i == "boolean" && i;
- }
- function L0e(e, t, n) {
- const i = [];
- return { options: j0e(e, t, i, n), errors: i };
- }
- function M0e(e, t, n) {
- const i = [];
- return { options: B0e(e, t, i, n), errors: i };
- }
- function R0e(e) {
- return e && Hc(e) === "jsconfig.json" ? { allowJs: !0, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: !0, skipLibCheck: !0, noEmit: !0 } : {};
- }
- function j0e(e, t, n, i) {
- const s = R0e(i);
- return ere(u0e(), e, t, s, bO, n), i && (s.configFilePath = Wl(i)), s;
- }
- function wz(e) {
- return { enable: !!e && Hc(e) === "jsconfig.json", include: [], exclude: [] };
- }
- function B0e(e, t, n, i) {
- const s = wz(i);
- return ere(d0e(), e, t, s, a0e, n), s;
- }
- function oLe(e, t, n) {
- return ere(
- f0e(),
- e,
- t,
- /*defaultOptions*/
- void 0,
- xz,
- n
- );
- }
- function ere(e, t, n, i, s, o) {
- if (t) {
- for (const c in t) {
- const _ = e.get(c);
- _ ? (i || (i = {}))[_.name] = kS(_, t[c], n, o) : o.push(qte(c, s));
- }
- return i;
- }
- }
- function vv(e, t, n, ...i) {
- return e && t ? sp(e, t, n, ...i) : Go(n, ...i);
- }
- function kS(e, t, n, i, s, o, c) {
- if (e.isCommandLineOnly) {
- i.push(vv(c, s?.name, p.Option_0_can_only_be_specified_on_command_line, e.name));
- return;
- }
- if (v0e(e, t)) {
- const _ = e.type;
- if (_ === "list" && us(t))
- return z0e(e, t, n, i, s, o, c);
- if (_ === "listOrElement")
- return us(t) ? z0e(e, t, n, i, s, o, c) : kS(e.element, t, n, i, s, o, c);
- if (!_s(e.type))
- return J0e(e, t, i, o, c);
- const u = Wx(e, t, i, o, c);
- return TA(u) ? u : cLe(e, n, u);
- } else
- i.push(vv(c, o, p.Compiler_option_0_requires_a_value_of_type_1, e.name, kz(e)));
- }
- function cLe(e, t, n) {
- return e.isFilePath && (n = Wl(n), n = Pz(n) ? n : es(n, t), n === "" && (n = ".")), n;
- }
- function Wx(e, t, n, i, s) {
- var o;
- if (TA(t)) return;
- const c = (o = e.extraValidation) == null ? void 0 : o.call(e, t);
- if (!c) return t;
- n.push(vv(s, i, ...c));
- }
- function J0e(e, t, n, i, s) {
- if (TA(t)) return;
- const o = t.toLowerCase(), c = e.type.get(o);
- if (c !== void 0)
- return Wx(e, c, n, i, s);
- n.push(t0e(e, (_, ...u) => vv(s, i, _, ...u)));
- }
- function z0e(e, t, n, i, s, o, c) {
- return Ln(lr(t, (_, u) => kS(e.element, _, n, i, s, o?.elements[u], c)), (_) => e.listPreserveFalsyValues ? !0 : !!_);
- }
- var lLe = /(?:^|\/)\*\*\/?$/, uLe = /^[^*?]*(?=\/[^/]*[*?])/;
- function bD(e, t, n, i, s = Ue) {
- t = Os(t);
- const o = zl(i.useCaseSensitiveFileNames), c = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), { validatedFilesSpec: d, validatedIncludeSpecs: g, validatedExcludeSpecs: h } = e, S = B4(n, s), T = J3(n, S);
- if (d)
- for (const I of d) {
- const F = es(I, t);
- c.set(o(F), F);
- }
- let C;
- if (g && g.length > 0)
- for (const I of i.readDirectory(
- t,
- Np(T),
- h,
- g,
- /*depth*/
- void 0
- )) {
- if (qo(
- I,
- ".json"
- /* Json */
- )) {
- if (!C) {
- const B = g.filter((X) => Zo(
- X,
- ".json"
- /* Json */
- )), z = lr(g5(B, t, "files"), (X) => `^${X}$`);
- C = z ? z.map((X) => Jy(X, i.useCaseSensitiveFileNames)) : Ue;
- }
- if (ac(C, (B) => B.test(I)) !== -1) {
- const B = o(I);
- !c.has(B) && !u.has(B) && u.set(B, I);
- }
- continue;
- }
- if (pLe(I, c, _, S, o))
- continue;
- dLe(I, _, S, o);
- const F = o(I);
- !c.has(F) && !_.has(F) && _.set(F, I);
- }
- const D = as(c.values()), P = as(_.values());
- return D.concat(P, as(u.values()));
- }
- function tre(e, t, n, i, s) {
- const { validatedFilesSpec: o, validatedIncludeSpecs: c, validatedExcludeSpecs: _ } = t;
- if (!Nr(c) || !Nr(_)) return !1;
- n = Os(n);
- const u = zl(i);
- if (o) {
- for (const d of o)
- if (u(es(d, n)) === e) return !1;
- }
- return U0e(e, _, i, s, n);
- }
- function W0e(e) {
- const t = Ui(e, "**/") ? 0 : e.indexOf("/**/");
- return t === -1 ? !1 : (Zo(e, "/..") ? e.length : e.lastIndexOf("/../")) > t;
- }
- function PO(e, t, n, i) {
- return U0e(
- e,
- Ln(t, (s) => !W0e(s)),
- n,
- i
- );
- }
- function U0e(e, t, n, i, s) {
- const o = j4(t, Bn(Os(i), s), "exclude"), c = o && Jy(o, n);
- return c ? c.test(e) ? !0 : !tC(e) && c.test(ul(e)) : !1;
- }
- function V0e(e, t, n, i, s) {
- return e.filter((c) => {
- if (!_s(c)) return !1;
- const _ = rre(c, n);
- return _ !== void 0 && t.push(o(..._)), _ === void 0;
- });
- function o(c, _) {
- const u = y7(i, s, _);
- return vv(i, u, c, _);
- }
- }
- function rre(e, t) {
- if (E.assert(typeof e == "string"), t && lLe.test(e))
- return [p.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, e];
- if (W0e(e))
- return [p.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, e];
- }
- function _Le({ validatedIncludeSpecs: e, validatedExcludeSpecs: t }, n, i) {
- const s = j4(t, n, "exclude"), o = s && new RegExp(s, i ? "" : "i"), c = {}, _ = /* @__PURE__ */ new Map();
- if (e !== void 0) {
- const u = [];
- for (const d of e) {
- const g = Os(Bn(n, d));
- if (o && o.test(g))
- continue;
- const h = fLe(g, i);
- if (h) {
- const { key: S, path: T, flags: C } = h, D = _.get(S), P = D !== void 0 ? c[D] : void 0;
- (P === void 0 || P < C) && (c[D !== void 0 ? D : T] = C, D === void 0 && _.set(S, T), C === 1 && u.push(S));
- }
- }
- for (const d in c)
- if (co(c, d))
- for (const g of u) {
- const h = nre(d, i);
- h !== g && np(g, h, n, !i) && delete c[d];
- }
- }
- return c;
- }
- function nre(e, t) {
- return t ? e : vy(e);
- }
- function fLe(e, t) {
- const n = uLe.exec(e);
- if (n) {
- const i = e.indexOf("?"), s = e.indexOf("*"), o = e.lastIndexOf(Vo);
- return {
- key: nre(n[0], t),
- path: n[0],
- flags: i !== -1 && i < o || s !== -1 && s < o ? 1 : 0
- /* None */
- };
- }
- if (rJ(e.substring(e.lastIndexOf(Vo) + 1))) {
- const i = W1(e);
- return {
- key: nre(i, t),
- path: i,
- flags: 1
- /* Recursive */
- };
- }
- }
- function pLe(e, t, n, i, s) {
- const o = ir(i, (c) => xc(e, c) ? c : void 0);
- if (!o)
- return !1;
- for (const c of o) {
- if (qo(e, c) && (c !== ".ts" || !qo(
- e,
- ".d.ts"
- /* Dts */
- )))
- return !1;
- const _ = s(zy(e, c));
- if (t.has(_) || n.has(_)) {
- if (c === ".d.ts" && (qo(
- e,
- ".js"
- /* Js */
- ) || qo(
- e,
- ".jsx"
- /* Jsx */
- )))
- continue;
- return !0;
- }
- }
- return !1;
- }
- function dLe(e, t, n, i) {
- const s = ir(n, (o) => xc(e, o) ? o : void 0);
- if (s)
- for (let o = s.length - 1; o >= 0; o--) {
- const c = s[o];
- if (qo(e, c))
- return;
- const _ = i(zy(e, c));
- t.delete(_);
- }
- }
- function ire(e) {
- const t = {};
- for (const n in e)
- if (co(e, n)) {
- const i = bz(n);
- i !== void 0 && (t[n] = sre(e[n], i));
- }
- return t;
- }
- function sre(e, t) {
- if (e === void 0) return e;
- switch (t.type) {
- case "object":
- return "";
- case "string":
- return "";
- case "number":
- return typeof e == "number" ? e : "";
- case "boolean":
- return typeof e == "boolean" ? e : "";
- case "listOrElement":
- if (!us(e)) return sre(e, t.element);
- case "list":
- const n = t.element;
- return us(e) ? Ai(e, (i) => sre(i, n)) : "";
- default:
- return El(t.type, (i, s) => {
- if (i === e)
- return s;
- });
- }
- }
- function are(e) {
- switch (e.type) {
- case "number":
- return 1;
- case "boolean":
- return !0;
- case "string":
- const t = e.defaultValueDescription;
- return e.isFilePath ? `./${t && typeof t == "string" ? t : ""}` : "";
- case "list":
- return [];
- case "listOrElement":
- return are(e.element);
- case "object":
- return {};
- default:
- const n = rw(e.type.keys());
- return n !== void 0 ? n : E.fail("Expected 'option.type' to have entries.");
- }
- }
- function Zi(e, t, ...n) {
- e.trace(dx(t, ...n));
- }
- function Xy(e, t) {
- return !!e.traceResolution && t.trace !== void 0;
- }
- function Ux(e, t, n) {
- let i;
- if (t && e) {
- const s = e.contents.packageJsonContent;
- typeof s.name == "string" && typeof s.version == "string" && (i = {
- name: s.name,
- subModuleName: t.path.slice(e.packageDirectory.length + Vo.length),
- version: s.version,
- peerDependencies: MLe(e, n)
- });
- }
- return t && { path: t.path, extension: t.ext, packageId: i, resolvedUsingTsExtension: t.resolvedUsingTsExtension };
- }
- function Az(e) {
- return Ux(
- /*packageInfo*/
- void 0,
- e,
- /*state*/
- void 0
- );
- }
- function q0e(e) {
- if (e)
- return E.assert(e.packageId === void 0), { path: e.path, ext: e.extension, resolvedUsingTsExtension: e.resolvedUsingTsExtension };
- }
- function wO(e) {
- const t = [];
- return e & 1 && t.push("TypeScript"), e & 2 && t.push("JavaScript"), e & 4 && t.push("Declaration"), e & 8 && t.push("JSON"), t.join(", ");
- }
- function mLe(e) {
- const t = [];
- return e & 1 && t.push(...B3), e & 2 && t.push(...jC), e & 4 && t.push(...T5), e & 8 && t.push(
- ".json"
- /* Json */
- ), t;
- }
- function ore(e) {
- if (e)
- return E.assert(C5(e.extension)), { fileName: e.path, packageId: e.packageId };
- }
- function H0e(e, t, n, i, s, o, c, _, u) {
- if (!c.resultFromCache && !c.compilerOptions.preserveSymlinks && t && n && !t.originalPath && !Sl(e)) {
- const { resolvedFileName: d, originalPath: g } = $0e(t.path, c.host, c.traceEnabled);
- g && (t = { ...t, path: d, originalPath: g });
- }
- return G0e(
- t,
- n,
- i,
- s,
- o,
- c.resultFromCache,
- _,
- u
- );
- }
- function G0e(e, t, n, i, s, o, c, _) {
- return o ? c?.isReadonly ? {
- ...o,
- failedLookupLocations: cre(o.failedLookupLocations, n),
- affectingLocations: cre(o.affectingLocations, i),
- resolutionDiagnostics: cre(o.resolutionDiagnostics, s)
- } : (o.failedLookupLocations = s6(o.failedLookupLocations, n), o.affectingLocations = s6(o.affectingLocations, i), o.resolutionDiagnostics = s6(o.resolutionDiagnostics, s), o) : {
- resolvedModule: e && {
- resolvedFileName: e.path,
- originalPath: e.originalPath === !0 ? void 0 : e.originalPath,
- extension: e.extension,
- isExternalLibraryImport: t,
- packageId: e.packageId,
- resolvedUsingTsExtension: !!e.resolvedUsingTsExtension
- },
- failedLookupLocations: SD(n),
- affectingLocations: SD(i),
- resolutionDiagnostics: SD(s),
- alternateResult: _
- };
- }
- function SD(e) {
- return e.length ? e : void 0;
- }
- function s6(e, t) {
- return t?.length ? e?.length ? (e.push(...t), e) : t : e;
- }
- function cre(e, t) {
- return e?.length ? t.length ? [...e, ...t] : e.slice() : SD(t);
- }
- function lre(e, t, n, i) {
- if (!co(e, t)) {
- i.traceEnabled && Zi(i.host, p.package_json_does_not_have_a_0_field, t);
- return;
- }
- const s = e[t];
- if (typeof s !== n || s === null) {
- i.traceEnabled && Zi(i.host, p.Expected_type_of_0_field_in_package_json_to_be_1_got_2, t, n, s === null ? "null" : typeof s);
- return;
- }
- return s;
- }
- function Nz(e, t, n, i) {
- const s = lre(e, t, "string", i);
- if (s === void 0)
- return;
- if (!s) {
- i.traceEnabled && Zi(i.host, p.package_json_had_a_falsy_0_field, t);
- return;
- }
- const o = Os(Bn(n, s));
- return i.traceEnabled && Zi(i.host, p.package_json_has_0_field_1_that_references_2, t, s, o), o;
- }
- function gLe(e, t, n) {
- return Nz(e, "typings", t, n) || Nz(e, "types", t, n);
- }
- function hLe(e, t, n) {
- return Nz(e, "tsconfig", t, n);
- }
- function yLe(e, t, n) {
- return Nz(e, "main", t, n);
- }
- function vLe(e, t) {
- const n = lre(e, "typesVersions", "object", t);
- if (n !== void 0)
- return t.traceEnabled && Zi(t.host, p.package_json_has_a_typesVersions_field_with_version_specific_path_mappings), n;
- }
- function bLe(e, t) {
- const n = vLe(e, t);
- if (n === void 0) return;
- if (t.traceEnabled)
- for (const c in n)
- co(n, c) && !vI.tryParse(c) && Zi(t.host, p.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, c);
- const i = AO(n);
- if (!i) {
- t.traceEnabled && Zi(t.host, p.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, wf);
- return;
- }
- const { version: s, paths: o } = i;
- if (typeof o != "object") {
- t.traceEnabled && Zi(t.host, p.Expected_type_of_0_field_in_package_json_to_be_1_got_2, `typesVersions['${s}']`, "object", typeof o);
- return;
- }
- return i;
- }
- var ure;
- function AO(e) {
- ure || (ure = new Sd(U_));
- for (const t in e) {
- if (!co(e, t)) continue;
- const n = vI.tryParse(t);
- if (n !== void 0 && n.test(ure))
- return { version: t, paths: e[t] };
- }
- }
- function TD(e, t) {
- if (e.typeRoots)
- return e.typeRoots;
- let n;
- if (e.configFilePath ? n = Xn(e.configFilePath) : t.getCurrentDirectory && (n = t.getCurrentDirectory()), n !== void 0)
- return SLe(n);
- }
- function SLe(e) {
- let t;
- return Fp(Os(e), (n) => {
- const i = Bn(n, TLe);
- (t ?? (t = [])).push(i);
- }), t;
- }
- var TLe = Bn("node_modules", "@types");
- function xLe(e, t, n) {
- const i = typeof n.useCaseSensitiveFileNames == "function" ? n.useCaseSensitiveFileNames() : n.useCaseSensitiveFileNames;
- return Sh(e, t, !i) === 0;
- }
- function $0e(e, t, n) {
- const i = nye(e, t, n), s = xLe(e, i, t);
- return {
- // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames
- resolvedFileName: s ? e : i,
- originalPath: s ? void 0 : e
- };
- }
- function X0e(e, t, n) {
- const i = Zo(e, "/node_modules/@types") || Zo(e, "/node_modules/@types/") ? mye(t, n) : t;
- return Bn(e, i);
- }
- function _re(e, t, n, i, s, o, c) {
- E.assert(typeof e == "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
- const _ = Xy(n, i);
- s && (n = s.commandLine.options);
- const u = t ? Xn(t) : void 0;
- let d = u ? o?.getFromDirectoryCache(e, c, u, s) : void 0;
- if (!d && u && !Sl(e) && (d = o?.getFromNonRelativeNameCache(e, c, u, s)), d)
- return _ && (Zi(i, p.Resolving_type_reference_directive_0_containing_file_1, e, t), s && Zi(i, p.Using_compiler_options_of_project_reference_redirect_0, s.sourceFile.fileName), Zi(i, p.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, e, u), z(d)), d;
- const g = TD(n, i);
- _ && (t === void 0 ? g === void 0 ? Zi(i, p.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, e) : Zi(i, p.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, e, g) : g === void 0 ? Zi(i, p.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, e, t) : Zi(i, p.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, e, t, g), s && Zi(i, p.Using_compiler_options_of_project_reference_redirect_0, s.sourceFile.fileName));
- const h = [], S = [];
- let T = fre(n);
- c !== void 0 && (T |= 30);
- const C = yu(n);
- c === 99 && 3 <= C && C <= 99 && (T |= 32);
- const D = T & 8 ? Qy(n, c) : [], P = [], I = {
- compilerOptions: n,
- host: i,
- traceEnabled: _,
- failedLookupLocations: h,
- affectingLocations: S,
- packageJsonInfoCache: o,
- features: T,
- conditions: D,
- requestContainingDirectory: u,
- reportDiagnostic: (V) => void P.push(V),
- isConfigLookup: !1,
- candidateIsFromPackageJsonField: !1,
- resolvedPackageDirectory: !1
- };
- let F = X(), O = !0;
- F || (F = q(), O = !1);
- let B;
- if (F) {
- const { fileName: V, packageId: ae } = F;
- let ee = V, G;
- n.preserveSymlinks || ({ resolvedFileName: ee, originalPath: G } = $0e(V, i, _)), B = {
- primary: O,
- resolvedFileName: ee,
- originalPath: G,
- packageId: ae,
- isExternalLibraryImport: Yy(V)
- };
- }
- return d = {
- resolvedTypeReferenceDirective: B,
- failedLookupLocations: SD(h),
- affectingLocations: SD(S),
- resolutionDiagnostics: SD(P)
- }, u && o && !o.isReadonly && (o.getOrCreateCacheForDirectory(u, s).set(
- e,
- /*mode*/
- c,
- d
- ), Sl(e) || o.getOrCreateCacheForNonRelativeName(e, c, s).set(u, d)), _ && z(d), d;
- function z(V) {
- var ae;
- (ae = V.resolvedTypeReferenceDirective) != null && ae.resolvedFileName ? V.resolvedTypeReferenceDirective.packageId ? Zi(i, p.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, e, V.resolvedTypeReferenceDirective.resolvedFileName, Q1(V.resolvedTypeReferenceDirective.packageId), V.resolvedTypeReferenceDirective.primary) : Zi(i, p.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, e, V.resolvedTypeReferenceDirective.resolvedFileName, V.resolvedTypeReferenceDirective.primary) : Zi(i, p.Type_reference_directive_0_was_not_resolved, e);
- }
- function X() {
- if (g && g.length)
- return _ && Zi(i, p.Resolving_with_primary_search_path_0, g.join(", ")), Tc(g, (V) => {
- const ae = X0e(V, e, I), ee = Dd(V, i);
- if (!ee && _ && Zi(i, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, V), n.typeRoots) {
- const G = c6(4, ae, !ee, I);
- if (G) {
- const ue = kA(G.path), re = ue ? CS(
- ue,
- /*onlyRecordFailures*/
- !1,
- I
- ) : void 0;
- return ore(Ux(re, G, I));
- }
- }
- return ore(
- Sre(4, ae, !ee, I)
- );
- });
- _ && Zi(i, p.Root_directory_cannot_be_determined_skipping_primary_search_paths);
- }
- function q() {
- const V = t && Xn(t);
- if (V !== void 0) {
- let ae;
- if (!n.typeRoots || !Zo(t, RD))
- if (_ && Zi(i, p.Looking_up_in_node_modules_folder_initial_location_0, V), Sl(e)) {
- const { path: ee } = rye(V, e);
- ae = Lz(
- 4,
- ee,
- /*onlyRecordFailures*/
- !1,
- I,
- /*considerPackageJson*/
- !0
- );
- } else {
- const ee = _ye(
- 4,
- e,
- V,
- I,
- /*cache*/
- void 0,
- /*redirectedReference*/
- void 0
- );
- ae = ee && ee.value;
- }
- else _ && Zi(i, p.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder);
- return ore(ae);
- } else
- _ && Zi(i, p.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder);
- }
- }
- function fre(e) {
- let t = 0;
- switch (yu(e)) {
- case 3:
- t = 30;
- break;
- case 99:
- t = 30;
- break;
- case 100:
- t = 30;
- break;
- }
- return e.resolvePackageJsonExports ? t |= 8 : e.resolvePackageJsonExports === !1 && (t &= -9), e.resolvePackageJsonImports ? t |= 2 : e.resolvePackageJsonImports === !1 && (t &= -3), t;
- }
- function Qy(e, t) {
- const n = yu(e);
- if (t === void 0) {
- if (n === 100)
- t = 99;
- else if (n === 2)
- return [];
- }
- const i = t === 99 ? ["import"] : ["require"];
- return e.noDtsResolution || i.push("types"), n !== 100 && i.push("node"), Qi(i, e.customConditions);
- }
- function Iz(e, t, n, i, s) {
- const o = kD(s?.getPackageJsonInfoCache(), i, n);
- return Fp(t, (c) => {
- if (Hc(c) !== "node_modules") {
- const _ = Bn(c, "node_modules"), u = Bn(_, e);
- return CS(
- u,
- /*onlyRecordFailures*/
- !1,
- o
- );
- }
- });
- }
- function NO(e, t) {
- if (e.types)
- return e.types;
- const n = [];
- if (t.directoryExists && t.getDirectories) {
- const i = TD(e, t);
- if (i) {
- for (const s of i)
- if (t.directoryExists(s))
- for (const o of t.getDirectories(s)) {
- const c = Os(o), _ = Bn(s, c, "package.json");
- if (!(t.fileExists(_) && I4(_, t).typings === null)) {
- const d = Hc(c);
- d.charCodeAt(0) !== 46 && n.push(d);
- }
- }
- }
- }
- return n;
- }
- function IO(e) {
- return !!e?.contents;
- }
- function pre(e) {
- return !!e && !e.contents;
- }
- function dre(e) {
- var t;
- if (e === null || typeof e != "object")
- return "" + e;
- if (us(e))
- return `[${(t = e.map((i) => dre(i))) == null ? void 0 : t.join(",")}]`;
- let n = "{";
- for (const i in e)
- co(e, i) && (n += `${i}: ${dre(e[i])}`);
- return n + "}";
- }
- function Oz(e, t) {
- return t.map((n) => dre(f5(e, n))).join("|") + `|${e.pathsBasePath}`;
- }
- function Q0e(e, t) {
- const n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
- let s = /* @__PURE__ */ new Map();
- return e && n.set(e, s), {
- getMapOfCacheRedirects: o,
- getOrCreateMapOfCacheRedirects: c,
- update: _,
- clear: d,
- getOwnMap: () => s
- };
- function o(h) {
- return h ? u(
- h.commandLine.options,
- /*create*/
- !1
- ) : s;
- }
- function c(h) {
- return h ? u(
- h.commandLine.options,
- /*create*/
- !0
- ) : s;
- }
- function _(h) {
- e !== h && (e ? s = u(
- h,
- /*create*/
- !0
- ) : n.set(h, s), e = h);
- }
- function u(h, S) {
- let T = n.get(h);
- if (T) return T;
- const C = g(h);
- if (T = i.get(C), !T) {
- if (e) {
- const D = g(e);
- D === C ? T = s : i.has(D) || i.set(D, s);
- }
- S && (T ?? (T = /* @__PURE__ */ new Map())), T && i.set(C, T);
- }
- return T && n.set(h, T), T;
- }
- function d() {
- const h = e && t.get(e);
- s.clear(), n.clear(), t.clear(), i.clear(), e && (h && t.set(e, h), n.set(e, s));
- }
- function g(h) {
- let S = t.get(h);
- return S || t.set(h, S = Oz(h, mz)), S;
- }
- }
- function kLe(e, t) {
- let n;
- return { getPackageJsonInfo: i, setPackageJsonInfo: s, clear: o, getInternalMap: c };
- function i(_) {
- return n?.get(uo(_, e, t));
- }
- function s(_, u) {
- (n || (n = /* @__PURE__ */ new Map())).set(uo(_, e, t), u);
- }
- function o() {
- n = void 0;
- }
- function c() {
- return n;
- }
- }
- function Y0e(e, t, n, i) {
- const s = e.getOrCreateMapOfCacheRedirects(t);
- let o = s.get(n);
- return o || (o = i(), s.set(n, o)), o;
- }
- function CLe(e, t, n, i) {
- const s = Q0e(n, i);
- return {
- getFromDirectoryCache: u,
- getOrCreateCacheForDirectory: _,
- clear: o,
- update: c,
- directoryToModuleNameMap: s
- };
- function o() {
- s.clear();
- }
- function c(d) {
- s.update(d);
- }
- function _(d, g) {
- const h = uo(d, e, t);
- return Y0e(s, g, h, () => a6());
- }
- function u(d, g, h, S) {
- var T, C;
- const D = uo(h, e, t);
- return (C = (T = s.getMapOfCacheRedirects(S)) == null ? void 0 : T.get(D)) == null ? void 0 : C.get(d, g);
- }
- }
- function xD(e, t) {
- return t === void 0 ? e : `${t}|${e}`;
- }
- function a6() {
- const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = {
- get(s, o) {
- return e.get(i(s, o));
- },
- set(s, o, c) {
- return e.set(i(s, o), c), n;
- },
- delete(s, o) {
- return e.delete(i(s, o)), n;
- },
- has(s, o) {
- return e.has(i(s, o));
- },
- forEach(s) {
- return e.forEach((o, c) => {
- const [_, u] = t.get(c);
- return s(o, _, u);
- });
- },
- size() {
- return e.size;
- }
- };
- return n;
- function i(s, o) {
- const c = xD(s, o);
- return t.set(c, [s, o]), c;
- }
- }
- function ELe(e) {
- return e.resolvedModule && (e.resolvedModule.originalPath || e.resolvedModule.resolvedFileName);
- }
- function DLe(e) {
- return e.resolvedTypeReferenceDirective && (e.resolvedTypeReferenceDirective.originalPath || e.resolvedTypeReferenceDirective.resolvedFileName);
- }
- function PLe(e, t, n, i, s) {
- const o = Q0e(n, s);
- return {
- getFromNonRelativeNameCache: u,
- getOrCreateCacheForNonRelativeName: d,
- clear: c,
- update: _
- };
- function c() {
- o.clear();
- }
- function _(h) {
- o.update(h);
- }
- function u(h, S, T, C) {
- var D, P;
- return E.assert(!Sl(h)), (P = (D = o.getMapOfCacheRedirects(C)) == null ? void 0 : D.get(xD(h, S))) == null ? void 0 : P.get(T);
- }
- function d(h, S, T) {
- return E.assert(!Sl(h)), Y0e(o, T, xD(h, S), g);
- }
- function g() {
- const h = /* @__PURE__ */ new Map();
- return { get: S, set: T };
- function S(D) {
- return h.get(uo(D, e, t));
- }
- function T(D, P) {
- const I = uo(D, e, t);
- if (h.has(I))
- return;
- h.set(I, P);
- const F = i(P), O = F && C(I, F);
- let B = I;
- for (; B !== O; ) {
- const z = Xn(B);
- if (z === B || h.has(z))
- break;
- h.set(z, P), B = z;
- }
- }
- function C(D, P) {
- const I = uo(Xn(P), e, t);
- let F = 0;
- const O = Math.min(D.length, I.length);
- for (; F < O && D.charCodeAt(F) === I.charCodeAt(F); )
- F++;
- if (F === D.length && (I.length === F || I[F] === Vo))
- return D;
- const B = Km(D);
- if (F < B)
- return;
- const z = D.lastIndexOf(Vo, F - 1);
- if (z !== -1)
- return D.substr(0, Math.max(z, B));
- }
- }
- }
- function Z0e(e, t, n, i, s, o) {
- o ?? (o = /* @__PURE__ */ new Map());
- const c = CLe(
- e,
- t,
- n,
- o
- ), _ = PLe(
- e,
- t,
- n,
- s,
- o
- );
- return i ?? (i = kLe(e, t)), {
- ...i,
- ...c,
- ..._,
- clear: u,
- update: g,
- getPackageJsonInfoCache: () => i,
- clearAllExceptPackageJsonInfoCache: d,
- optionsToRedirectsKey: o
- };
- function u() {
- d(), i.clear();
- }
- function d() {
- c.clear(), _.clear();
- }
- function g(h) {
- c.update(h), _.update(h);
- }
- }
- function o6(e, t, n, i, s) {
- const o = Z0e(
- e,
- t,
- n,
- i,
- ELe,
- s
- );
- return o.getOrCreateCacheForModuleName = (c, _, u) => o.getOrCreateCacheForNonRelativeName(c, _, u), o;
- }
- function OO(e, t, n, i, s) {
- return Z0e(
- e,
- t,
- n,
- i,
- DLe,
- s
- );
- }
- function Fz(e) {
- return { moduleResolution: 2, traceResolution: e.traceResolution };
- }
- function FO(e, t, n, i, s) {
- return Vx(e, t, Fz(n), i, s);
- }
- function K0e(e, t, n, i) {
- const s = Xn(t);
- return n.getFromDirectoryCache(
- e,
- i,
- s,
- /*redirectedReference*/
- void 0
- );
- }
- function Vx(e, t, n, i, s, o, c) {
- const _ = Xy(n, i);
- o && (n = o.commandLine.options), _ && (Zi(i, p.Resolving_module_0_from_1, e, t), o && Zi(i, p.Using_compiler_options_of_project_reference_redirect_0, o.sourceFile.fileName));
- const u = Xn(t);
- let d = s?.getFromDirectoryCache(e, c, u, o);
- if (d)
- _ && Zi(i, p.Resolution_for_module_0_was_found_in_cache_from_location_1, e, u);
- else {
- let g = n.moduleResolution;
- switch (g === void 0 ? (g = yu(n), _ && Zi(i, p.Module_resolution_kind_is_not_specified_using_0, zE[g])) : _ && Zi(i, p.Explicitly_specified_module_resolution_kind_Colon_0, zE[g]), g) {
- case 3:
- d = ILe(e, t, n, i, s, o, c);
- break;
- case 99:
- d = OLe(e, t, n, i, s, o, c);
- break;
- case 2:
- d = yre(e, t, n, i, s, o, c ? Qy(n, c) : void 0);
- break;
- case 1:
- d = kre(e, t, n, i, s, o);
- break;
- case 100:
- d = hre(e, t, n, i, s, o, c ? Qy(n, c) : void 0);
- break;
- default:
- return E.fail(`Unexpected moduleResolution: ${g}`);
- }
- s && !s.isReadonly && (s.getOrCreateCacheForDirectory(u, o).set(e, c, d), Sl(e) || s.getOrCreateCacheForNonRelativeName(e, c, o).set(u, d));
- }
- return _ && (d.resolvedModule ? d.resolvedModule.packageId ? Zi(i, p.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, e, d.resolvedModule.resolvedFileName, Q1(d.resolvedModule.packageId)) : Zi(i, p.Module_name_0_was_successfully_resolved_to_1, e, d.resolvedModule.resolvedFileName) : Zi(i, p.Module_name_0_was_not_resolved, e)), d;
- }
- function eye(e, t, n, i, s) {
- const o = wLe(e, t, i, s);
- return o ? o.value : Sl(t) ? ALe(e, t, n, i, s) : NLe(e, t, i, s);
- }
- function wLe(e, t, n, i) {
- var s;
- const { baseUrl: o, paths: c, configFile: _ } = i.compilerOptions;
- if (c && !If(t)) {
- i.traceEnabled && (o && Zi(i.host, p.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, o, t), Zi(i.host, p.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, t));
- const u = U7(i.compilerOptions, i.host), d = _?.configFileSpecs ? (s = _.configFileSpecs).pathPatterns || (s.pathPatterns = k5(c)) : void 0;
- return Tre(
- e,
- t,
- u,
- c,
- d,
- n,
- /*onlyRecordFailures*/
- !1,
- i
- );
- }
- }
- function ALe(e, t, n, i, s) {
- if (!s.compilerOptions.rootDirs)
- return;
- s.traceEnabled && Zi(s.host, p.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, t);
- const o = Os(Bn(n, t));
- let c, _;
- for (const u of s.compilerOptions.rootDirs) {
- let d = Os(u);
- Zo(d, Vo) || (d += Vo);
- const g = Ui(o, d) && (_ === void 0 || _.length < d.length);
- s.traceEnabled && Zi(s.host, p.Checking_if_0_is_the_longest_matching_prefix_for_1_2, d, o, g), g && (_ = d, c = u);
- }
- if (_) {
- s.traceEnabled && Zi(s.host, p.Longest_matching_prefix_for_0_is_1, o, _);
- const u = o.substr(_.length);
- s.traceEnabled && Zi(s.host, p.Loading_0_from_the_root_dir_1_candidate_location_2, u, _, o);
- const d = i(e, o, !Dd(n, s.host), s);
- if (d)
- return d;
- s.traceEnabled && Zi(s.host, p.Trying_other_entries_in_rootDirs);
- for (const g of s.compilerOptions.rootDirs) {
- if (g === c)
- continue;
- const h = Bn(Os(g), u);
- s.traceEnabled && Zi(s.host, p.Loading_0_from_the_root_dir_1_candidate_location_2, u, g, h);
- const S = Xn(h), T = i(e, h, !Dd(S, s.host), s);
- if (T)
- return T;
- }
- s.traceEnabled && Zi(s.host, p.Module_resolution_using_rootDirs_has_failed);
- }
- }
- function NLe(e, t, n, i) {
- const { baseUrl: s } = i.compilerOptions;
- if (!s)
- return;
- i.traceEnabled && Zi(i.host, p.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, s, t);
- const o = Os(Bn(s, t));
- return i.traceEnabled && Zi(i.host, p.Resolving_module_name_0_relative_to_base_url_1_2, t, s, o), n(e, o, !Dd(Xn(o), i.host), i);
- }
- function mre(e, t, n) {
- const { resolvedModule: i, failedLookupLocations: s } = FLe(e, t, n);
- if (!i)
- throw new Error(`Could not resolve JS module '${e}' starting at '${t}'. Looked in: ${s?.join(", ")}`);
- return i.resolvedFileName;
- }
- var gre = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Imports = 2] = "Imports", e[e.SelfName = 4] = "SelfName", e[e.Exports = 8] = "Exports", e[e.ExportsPatternTrailers = 16] = "ExportsPatternTrailers", e[e.AllFeatures = 30] = "AllFeatures", e[e.Node16Default = 30] = "Node16Default", e[
- e.NodeNextDefault = 30
- /* AllFeatures */
- ] = "NodeNextDefault", e[e.BundlerDefault = 30] = "BundlerDefault", e[e.EsmMode = 32] = "EsmMode", e))(gre || {});
- function ILe(e, t, n, i, s, o, c) {
- return tye(
- 30,
- e,
- t,
- n,
- i,
- s,
- o,
- c
- );
- }
- function OLe(e, t, n, i, s, o, c) {
- return tye(
- 30,
- e,
- t,
- n,
- i,
- s,
- o,
- c
- );
- }
- function tye(e, t, n, i, s, o, c, _, u) {
- const d = Xn(n), g = _ === 99 ? 32 : 0;
- let h = i.noDtsResolution ? 3 : 7;
- return Ab(i) && (h |= 8), xA(
- e | g,
- t,
- d,
- i,
- s,
- o,
- h,
- /*isConfigLookup*/
- !1,
- c,
- u
- );
- }
- function FLe(e, t, n) {
- return xA(
- 0,
- e,
- t,
- { moduleResolution: 2, allowJs: !0 },
- n,
- /*cache*/
- void 0,
- 2,
- /*isConfigLookup*/
- !1,
- /*redirectedReference*/
- void 0,
- /*conditions*/
- void 0
- );
- }
- function hre(e, t, n, i, s, o, c) {
- const _ = Xn(t);
- let u = n.noDtsResolution ? 3 : 7;
- return Ab(n) && (u |= 8), xA(
- fre(n),
- e,
- _,
- n,
- i,
- s,
- u,
- /*isConfigLookup*/
- !1,
- o,
- c
- );
- }
- function yre(e, t, n, i, s, o, c, _) {
- let u;
- return _ ? u = 8 : n.noDtsResolution ? (u = 3, Ab(n) && (u |= 8)) : u = Ab(n) ? 15 : 7, xA(c ? 30 : 0, e, Xn(t), n, i, s, u, !!_, o, c);
- }
- function vre(e, t, n) {
- return xA(
- 30,
- e,
- Xn(t),
- {
- moduleResolution: 99
- /* NodeNext */
- },
- n,
- /*cache*/
- void 0,
- 8,
- /*isConfigLookup*/
- !0,
- /*redirectedReference*/
- void 0,
- /*conditions*/
- void 0
- );
- }
- function xA(e, t, n, i, s, o, c, _, u, d) {
- var g, h, S, T, C;
- const D = Xy(i, s), P = [], I = [], F = yu(i);
- d ?? (d = Qy(
- i,
- F === 100 || F === 2 ? void 0 : e & 32 ? 99 : 1
- /* CommonJS */
- ));
- const O = [], B = {
- compilerOptions: i,
- host: s,
- traceEnabled: D,
- failedLookupLocations: P,
- affectingLocations: I,
- packageJsonInfoCache: o,
- features: e,
- conditions: d ?? Ue,
- requestContainingDirectory: n,
- reportDiagnostic: (V) => void O.push(V),
- isConfigLookup: _,
- candidateIsFromPackageJsonField: !1,
- resolvedPackageDirectory: !1
- };
- D && RC(F) && Zi(s, p.Resolving_in_0_mode_with_conditions_1, e & 32 ? "ESM" : "CJS", B.conditions.map((V) => `'${V}'`).join(", "));
- let z;
- if (F === 2) {
- const V = c & 5, ae = c & -6;
- z = V && q(V, B) || ae && q(ae, B) || void 0;
- } else
- z = q(c, B);
- let X;
- if (B.resolvedPackageDirectory && !_ && !Sl(t)) {
- const V = z?.value && c & 5 && !cye(5, z.value.resolved.extension);
- if ((g = z?.value) != null && g.isExternalLibraryImport && V && e & 8 && d?.includes("import")) {
- Zy(B, p.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
- const ae = {
- ...B,
- features: B.features & -9,
- reportDiagnostic: ja
- }, ee = q(c & 5, ae);
- (h = ee?.value) != null && h.isExternalLibraryImport && (X = ee.value.resolved.path);
- } else if ((!z?.value || V) && F === 2) {
- Zy(B, p.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);
- const ae = {
- ...B.compilerOptions,
- moduleResolution: 100
- /* Bundler */
- }, ee = {
- ...B,
- compilerOptions: ae,
- features: 30,
- conditions: Qy(ae),
- reportDiagnostic: ja
- }, G = q(c & 5, ee);
- (S = G?.value) != null && S.isExternalLibraryImport && (X = G.value.resolved.path);
- }
- }
- return H0e(
- t,
- (T = z?.value) == null ? void 0 : T.resolved,
- (C = z?.value) == null ? void 0 : C.isExternalLibraryImport,
- P,
- I,
- O,
- B,
- o,
- X
- );
- function q(V, ae) {
- const G = eye(V, t, n, (ue, re, ne, ie) => Lz(
- ue,
- re,
- ne,
- ie,
- /*considerPackageJson*/
- !0
- ), ae);
- if (G)
- return Rf({ resolved: G, isExternalLibraryImport: Yy(G.path) });
- if (Sl(t)) {
- const { path: ue, parts: re } = rye(n, t), ne = Lz(
- V,
- ue,
- /*onlyRecordFailures*/
- !1,
- ae,
- /*considerPackageJson*/
- !0
- );
- return ne && Rf({ resolved: ne, isExternalLibraryImport: ss(re, "node_modules") });
- } else {
- let ue;
- if (e & 2 && Ui(t, "#") && (ue = JLe(V, t, n, ae, o, u)), !ue && e & 4 && (ue = BLe(V, t, n, ae, o, u)), !ue) {
- if (t.includes(":")) {
- D && Zi(s, p.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, t, wO(V));
- return;
- }
- D && Zi(s, p.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, t, wO(V)), ue = _ye(V, t, n, ae, o, u);
- }
- return V & 4 && (ue ?? (ue = hye(t, ae))), ue && { value: ue.value && { resolved: ue.value, isExternalLibraryImport: !0 } };
- }
- }
- }
- function rye(e, t) {
- const n = Bn(e, t), i = Cl(n), s = Ro(i);
- return { path: s === "." || s === ".." ? ul(Os(n)) : Os(n), parts: i };
- }
- function nye(e, t, n) {
- if (!t.realpath)
- return e;
- const i = Os(t.realpath(e));
- return n && Zi(t, p.Resolving_real_path_for_0_result_1, e, i), i;
- }
- function Lz(e, t, n, i, s) {
- if (i.traceEnabled && Zi(i.host, p.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, t, wO(e)), !xy(t)) {
- if (!n) {
- const c = Xn(t);
- Dd(c, i.host) || (i.traceEnabled && Zi(i.host, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, c), n = !0);
- }
- const o = c6(e, t, n, i);
- if (o) {
- const c = s ? kA(o.path) : void 0, _ = c ? CS(
- c,
- /*onlyRecordFailures*/
- !1,
- i
- ) : void 0;
- return Ux(_, o, i);
- }
- }
- if (n || Dd(t, i.host) || (i.traceEnabled && Zi(i.host, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, t), n = !0), !(i.features & 32))
- return Sre(e, t, n, i, s);
- }
- var Xg = "/node_modules/";
- function Yy(e) {
- return e.includes(Xg);
- }
- function kA(e, t) {
- const n = Os(e), i = n.lastIndexOf(Xg);
- if (i === -1)
- return;
- const s = i + Xg.length;
- let o = iye(n, s, t);
- return n.charCodeAt(s) === 64 && (o = iye(n, o, t)), n.slice(0, o);
- }
- function iye(e, t, n) {
- const i = e.indexOf(Vo, t + 1);
- return i === -1 ? n ? e.length : t : i;
- }
- function bre(e, t, n, i) {
- return Az(c6(e, t, n, i));
- }
- function c6(e, t, n, i) {
- const s = sye(e, t, n, i);
- if (s)
- return s;
- if (!(i.features & 32)) {
- const o = aye(t, e, "", n, i);
- if (o)
- return o;
- }
- }
- function sye(e, t, n, i) {
- if (!Hc(t).includes("."))
- return;
- let o = $u(t);
- o === t && (o = t.substring(0, t.lastIndexOf(".")));
- const c = t.substring(o.length);
- return i.traceEnabled && Zi(i.host, p.File_name_0_has_a_1_extension_stripping_it, t, c), aye(o, e, c, n, i);
- }
- function Mz(e, t, n, i) {
- return e & 1 && xc(t, B3) || e & 4 && xc(t, T5) ? Rz(t, n, i) !== void 0 ? { path: t, ext: Z7(t), resolvedUsingTsExtension: void 0 } : void 0 : i.isConfigLookup && e === 8 && qo(
- t,
- ".json"
- /* Json */
- ) ? Rz(t, n, i) !== void 0 ? { path: t, ext: ".json", resolvedUsingTsExtension: void 0 } : void 0 : sye(e, t, n, i);
- }
- function aye(e, t, n, i, s) {
- if (!i) {
- const c = Xn(e);
- c && (i = !Dd(c, s.host));
- }
- switch (n) {
- case ".mjs":
- case ".mts":
- case ".d.mts":
- return t & 1 && o(
- ".mts",
- n === ".mts" || n === ".d.mts"
- /* Dmts */
- ) || t & 4 && o(
- ".d.mts",
- n === ".mts" || n === ".d.mts"
- /* Dmts */
- ) || t & 2 && o(
- ".mjs"
- /* Mjs */
- ) || void 0;
- case ".cjs":
- case ".cts":
- case ".d.cts":
- return t & 1 && o(
- ".cts",
- n === ".cts" || n === ".d.cts"
- /* Dcts */
- ) || t & 4 && o(
- ".d.cts",
- n === ".cts" || n === ".d.cts"
- /* Dcts */
- ) || t & 2 && o(
- ".cjs"
- /* Cjs */
- ) || void 0;
- case ".json":
- return t & 4 && o(".d.json.ts") || t & 8 && o(
- ".json"
- /* Json */
- ) || void 0;
- case ".tsx":
- case ".jsx":
- return t & 1 && (o(
- ".tsx",
- n === ".tsx"
- /* Tsx */
- ) || o(
- ".ts",
- n === ".tsx"
- /* Tsx */
- )) || t & 4 && o(
- ".d.ts",
- n === ".tsx"
- /* Tsx */
- ) || t & 2 && (o(
- ".jsx"
- /* Jsx */
- ) || o(
- ".js"
- /* Js */
- )) || void 0;
- case ".ts":
- case ".d.ts":
- case ".js":
- case "":
- return t & 1 && (o(
- ".ts",
- n === ".ts" || n === ".d.ts"
- /* Dts */
- ) || o(
- ".tsx",
- n === ".ts" || n === ".d.ts"
- /* Dts */
- )) || t & 4 && o(
- ".d.ts",
- n === ".ts" || n === ".d.ts"
- /* Dts */
- ) || t & 2 && (o(
- ".js"
- /* Js */
- ) || o(
- ".jsx"
- /* Jsx */
- )) || s.isConfigLookup && o(
- ".json"
- /* Json */
- ) || void 0;
- default:
- return t & 4 && !wl(e + n) && o(`.d${n}.ts`) || void 0;
- }
- function o(c, _) {
- const u = Rz(e + c, i, s);
- return u === void 0 ? void 0 : { path: u, ext: c, resolvedUsingTsExtension: !s.candidateIsFromPackageJsonField && _ };
- }
- }
- function Rz(e, t, n) {
- var i;
- if (!((i = n.compilerOptions.moduleSuffixes) != null && i.length))
- return oye(e, t, n);
- const s = Vg(e) ?? "", o = s ? W3(e, s) : e;
- return ir(n.compilerOptions.moduleSuffixes, (c) => oye(o + c + s, t, n));
- }
- function oye(e, t, n) {
- var i;
- if (!t) {
- if (n.host.fileExists(e))
- return n.traceEnabled && Zi(n.host, p.File_0_exists_use_it_as_a_name_resolution_result, e), e;
- n.traceEnabled && Zi(n.host, p.File_0_does_not_exist, e);
- }
- (i = n.failedLookupLocations) == null || i.push(e);
- }
- function Sre(e, t, n, i, s = !0) {
- const o = s ? CS(t, n, i) : void 0, c = o && o.contents.packageJsonContent, _ = o && LO(o, i);
- return Ux(o, Bz(e, t, n, i, c, _), i);
- }
- function jz(e, t, n, i, s) {
- if (!s && e.contents.resolvedEntrypoints !== void 0)
- return e.contents.resolvedEntrypoints;
- let o;
- const c = 5 | (s ? 2 : 0), _ = fre(t), u = kD(i?.getPackageJsonInfoCache(), n, t);
- u.conditions = Qy(t), u.requestContainingDirectory = e.packageDirectory;
- const d = Bz(
- c,
- e.packageDirectory,
- /*onlyRecordFailures*/
- !1,
- u,
- e.contents.packageJsonContent,
- LO(e, u)
- );
- if (o = wr(o, d?.path), _ & 8 && e.contents.packageJsonContent.exports) {
- const g = cb(
- [Qy(
- t,
- 99
- /* ESNext */
- ), Qy(
- t,
- 1
- /* CommonJS */
- )],
- Af
- );
- for (const h of g) {
- const S = { ...u, failedLookupLocations: [], conditions: h, host: n }, T = LLe(
- e,
- e.contents.packageJsonContent.exports,
- S,
- c
- );
- if (T)
- for (const C of T)
- o = bh(o, C.path);
- }
- }
- return e.contents.resolvedEntrypoints = o || !1;
- }
- function LLe(e, t, n, i) {
- let s;
- if (us(t))
- for (const c of t)
- o(c);
- else if (typeof t == "object" && t !== null && RO(t))
- for (const c in t)
- o(t[c]);
- else
- o(t);
- return s;
- function o(c) {
- var _, u;
- if (typeof c == "string" && Ui(c, "./"))
- if (c.includes("*") && n.host.readDirectory) {
- if (c.indexOf("*") !== c.lastIndexOf("*"))
- return !1;
- n.host.readDirectory(
- e.packageDirectory,
- mLe(i),
- /*excludes*/
- void 0,
- [
- DI(uS(c, "**/*"), ".*")
- ]
- ).forEach((d) => {
- s = bh(s, {
- path: d,
- ext: rC(d),
- resolvedUsingTsExtension: void 0
- });
- });
- } else {
- const d = Cl(c).slice(2);
- if (d.includes("..") || d.includes(".") || d.includes("node_modules"))
- return !1;
- const g = Bn(e.packageDirectory, c), h = es(g, (u = (_ = n.host).getCurrentDirectory) == null ? void 0 : u.call(_)), S = Mz(
- i,
- h,
- /*onlyRecordFailures*/
- !1,
- n
- );
- if (S)
- return s = bh(s, S, (T, C) => T.path === C.path), !0;
- }
- else if (Array.isArray(c)) {
- for (const d of c)
- if (o(d))
- return !0;
- } else if (typeof c == "object" && c !== null)
- return ir(rm(c), (d) => {
- if (d === "default" || ss(n.conditions, d) || CA(n.conditions, d))
- return o(c[d]), !0;
- });
- }
- }
- function kD(e, t, n) {
- return {
- host: t,
- compilerOptions: n,
- traceEnabled: Xy(n, t),
- failedLookupLocations: void 0,
- affectingLocations: void 0,
- packageJsonInfoCache: e,
- features: 0,
- conditions: Ue,
- requestContainingDirectory: void 0,
- reportDiagnostic: ja,
- isConfigLookup: !1,
- candidateIsFromPackageJsonField: !1,
- resolvedPackageDirectory: !1
- };
- }
- function CD(e, t) {
- return Fp(
- e,
- (n) => CS(
- n,
- /*onlyRecordFailures*/
- !1,
- t
- )
- );
- }
- function LO(e, t) {
- return e.contents.versionPaths === void 0 && (e.contents.versionPaths = bLe(e.contents.packageJsonContent, t) || !1), e.contents.versionPaths || void 0;
- }
- function MLe(e, t) {
- return e.contents.peerDependencies === void 0 && (e.contents.peerDependencies = RLe(e, t) || !1), e.contents.peerDependencies || void 0;
- }
- function RLe(e, t) {
- const n = lre(e.contents.packageJsonContent, "peerDependencies", "object", t);
- if (n === void 0) return;
- t.traceEnabled && Zi(t.host, p.package_json_has_a_peerDependencies_field);
- const i = nye(e.packageDirectory, t.host, t.traceEnabled), s = i.substring(0, i.lastIndexOf("node_modules") + 12) + Vo;
- let o = "";
- for (const c in n)
- if (co(n, c)) {
- const _ = CS(
- s + c,
- /*onlyRecordFailures*/
- !1,
- t
- );
- if (_) {
- const u = _.contents.packageJsonContent.version;
- o += `+${c}@${u}`, t.traceEnabled && Zi(t.host, p.Found_peerDependency_0_with_1_version, c, u);
- } else
- t.traceEnabled && Zi(t.host, p.Failed_to_find_peerDependency_0, c);
- }
- return o;
- }
- function CS(e, t, n) {
- var i, s, o, c, _, u;
- const { host: d, traceEnabled: g } = n, h = Bn(e, "package.json");
- if (t) {
- (i = n.failedLookupLocations) == null || i.push(h);
- return;
- }
- const S = (s = n.packageJsonInfoCache) == null ? void 0 : s.getPackageJsonInfo(h);
- if (S !== void 0) {
- if (IO(S))
- return g && Zi(d, p.File_0_exists_according_to_earlier_cached_lookups, h), (o = n.affectingLocations) == null || o.push(h), S.packageDirectory === e ? S : { packageDirectory: e, contents: S.contents };
- S.directoryExists && g && Zi(d, p.File_0_does_not_exist_according_to_earlier_cached_lookups, h), (c = n.failedLookupLocations) == null || c.push(h);
- return;
- }
- const T = Dd(e, d);
- if (T && d.fileExists(h)) {
- const C = I4(h, d);
- g && Zi(d, p.Found_package_json_at_0, h);
- const D = { packageDirectory: e, contents: { packageJsonContent: C, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
- return n.packageJsonInfoCache && !n.packageJsonInfoCache.isReadonly && n.packageJsonInfoCache.setPackageJsonInfo(h, D), (_ = n.affectingLocations) == null || _.push(h), D;
- } else
- T && g && Zi(d, p.File_0_does_not_exist, h), n.packageJsonInfoCache && !n.packageJsonInfoCache.isReadonly && n.packageJsonInfoCache.setPackageJsonInfo(h, { packageDirectory: e, directoryExists: T }), (u = n.failedLookupLocations) == null || u.push(h);
- }
- function Bz(e, t, n, i, s, o) {
- let c;
- s && (i.isConfigLookup ? c = hLe(s, t, i) : c = e & 4 && gLe(s, t, i) || e & 7 && yLe(s, t, i) || void 0);
- const _ = (S, T, C, D) => {
- const P = Mz(S, T, C, D);
- if (P)
- return Az(P);
- const I = S === 4 ? 5 : S, F = D.features, O = D.candidateIsFromPackageJsonField;
- D.candidateIsFromPackageJsonField = !0, s?.type !== "module" && (D.features &= -33);
- const B = Lz(
- I,
- T,
- C,
- D,
- /*considerPackageJson*/
- !1
- );
- return D.features = F, D.candidateIsFromPackageJsonField = O, B;
- }, u = c ? !Dd(Xn(c), i.host) : void 0, d = n || !Dd(t, i.host), g = Bn(t, i.isConfigLookup ? "tsconfig" : "index");
- if (o && (!c || np(t, c))) {
- const S = ld(
- t,
- c || g,
- /*ignoreCase*/
- !1
- );
- i.traceEnabled && Zi(i.host, p.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, o.version, U_, S);
- const T = Tre(
- e,
- S,
- t,
- o.paths,
- /*pathPatterns*/
- void 0,
- _,
- u || d,
- i
- );
- if (T)
- return q0e(T.value);
- }
- const h = c && q0e(_(e, c, u, i));
- if (h) return h;
- if (!(i.features & 32))
- return c6(e, g, d, i);
- }
- function cye(e, t) {
- return e & 2 && (t === ".js" || t === ".jsx" || t === ".mjs" || t === ".cjs") || e & 1 && (t === ".ts" || t === ".tsx" || t === ".mts" || t === ".cts") || e & 4 && (t === ".d.ts" || t === ".d.mts" || t === ".d.cts") || e & 8 && t === ".json" || !1;
- }
- function MO(e) {
- let t = e.indexOf(Vo);
- return e[0] === "@" && (t = e.indexOf(Vo, t + 1)), t === -1 ? { packageName: e, rest: "" } : { packageName: e.slice(0, t), rest: e.slice(t + 1) };
- }
- function RO(e) {
- return Mi(rm(e), (t) => Ui(t, "."));
- }
- function jLe(e) {
- return !ut(rm(e), (t) => Ui(t, "."));
- }
- function BLe(e, t, n, i, s, o) {
- var c, _;
- const u = es(n, (_ = (c = i.host).getCurrentDirectory) == null ? void 0 : _.call(c)), d = CD(u, i);
- if (!d || !d.contents.packageJsonContent.exports || typeof d.contents.packageJsonContent.name != "string")
- return;
- const g = Cl(t), h = Cl(d.contents.packageJsonContent.name);
- if (!Mi(h, (P, I) => g[I] === P))
- return;
- const S = g.slice(h.length), T = Nr(S) ? `.${Vo}${S.join(Vo)}` : ".";
- if (By(i.compilerOptions) && !Yy(n))
- return Jz(d, e, T, i, s, o);
- const C = e & 5, D = e & -6;
- return Jz(d, C, T, i, s, o) || Jz(d, D, T, i, s, o);
- }
- function Jz(e, t, n, i, s, o) {
- if (e.contents.packageJsonContent.exports) {
- if (n === ".") {
- let c;
- if (typeof e.contents.packageJsonContent.exports == "string" || Array.isArray(e.contents.packageJsonContent.exports) || typeof e.contents.packageJsonContent.exports == "object" && jLe(e.contents.packageJsonContent.exports) ? c = e.contents.packageJsonContent.exports : co(e.contents.packageJsonContent.exports, ".") && (c = e.contents.packageJsonContent.exports["."]), c)
- return uye(
- t,
- i,
- s,
- o,
- n,
- e,
- /*isImports*/
- !1
- )(
- c,
- "",
- /*pattern*/
- !1,
- "."
- );
- } else if (RO(e.contents.packageJsonContent.exports)) {
- if (typeof e.contents.packageJsonContent.exports != "object")
- return i.traceEnabled && Zi(i.host, p.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, n, e.packageDirectory), Rf(
- /*value*/
- void 0
- );
- const c = lye(
- t,
- i,
- s,
- o,
- n,
- e.contents.packageJsonContent.exports,
- e,
- /*isImports*/
- !1
- );
- if (c)
- return c;
- }
- return i.traceEnabled && Zi(i.host, p.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, n, e.packageDirectory), Rf(
- /*value*/
- void 0
- );
- }
- }
- function JLe(e, t, n, i, s, o) {
- var c, _;
- if (t === "#" || Ui(t, "#/"))
- return i.traceEnabled && Zi(i.host, p.Invalid_import_specifier_0_has_no_possible_resolutions, t), Rf(
- /*value*/
- void 0
- );
- const u = es(n, (_ = (c = i.host).getCurrentDirectory) == null ? void 0 : _.call(c)), d = CD(u, i);
- if (!d)
- return i.traceEnabled && Zi(i.host, p.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, u), Rf(
- /*value*/
- void 0
- );
- if (!d.contents.packageJsonContent.imports)
- return i.traceEnabled && Zi(i.host, p.package_json_scope_0_has_no_imports_defined, d.packageDirectory), Rf(
- /*value*/
- void 0
- );
- const g = lye(
- e,
- i,
- s,
- o,
- t,
- d.contents.packageJsonContent.imports,
- d,
- /*isImports*/
- !0
- );
- return g || (i.traceEnabled && Zi(i.host, p.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, t, d.packageDirectory), Rf(
- /*value*/
- void 0
- ));
- }
- function zz(e, t) {
- const n = e.indexOf("*"), i = t.indexOf("*"), s = n === -1 ? e.length : n + 1, o = i === -1 ? t.length : i + 1;
- return s > o ? -1 : o > s || n === -1 ? 1 : i === -1 || e.length > t.length ? -1 : t.length > e.length ? 1 : 0;
- }
- function lye(e, t, n, i, s, o, c, _) {
- const u = uye(e, t, n, i, s, c, _);
- if (!Zo(s, Vo) && !s.includes("*") && co(o, s)) {
- const h = o[s];
- return u(
- h,
- /*subpath*/
- "",
- /*pattern*/
- !1,
- s
- );
- }
- const d = V_(Ln(rm(o), (h) => zLe(h) || Zo(h, "/")), zz);
- for (const h of d)
- if (t.features & 16 && g(h, s)) {
- const S = o[h], T = h.indexOf("*"), C = s.substring(h.substring(0, T).length, s.length - (h.length - 1 - T));
- return u(
- S,
- C,
- /*pattern*/
- !0,
- h
- );
- } else if (Zo(h, "*") && Ui(s, h.substring(0, h.length - 1))) {
- const S = o[h], T = s.substring(h.length - 1);
- return u(
- S,
- T,
- /*pattern*/
- !0,
- h
- );
- } else if (Ui(s, h)) {
- const S = o[h], T = s.substring(h.length);
- return u(
- S,
- T,
- /*pattern*/
- !1,
- h
- );
- }
- function g(h, S) {
- if (Zo(h, "*")) return !1;
- const T = h.indexOf("*");
- return T === -1 ? !1 : Ui(S, h.substring(0, T)) && Zo(S, h.substring(T + 1));
- }
- }
- function zLe(e) {
- const t = e.indexOf("*");
- return t !== -1 && t === e.lastIndexOf("*");
- }
- function uye(e, t, n, i, s, o, c) {
- return _;
- function _(u, d, g, h) {
- if (typeof u == "string") {
- if (!g && d.length > 0 && !Zo(u, "/"))
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- if (!Ui(u, "./")) {
- if (c && !Ui(u, "../") && !Ui(u, "/") && !H_(u)) {
- const z = g ? u.replace(/\*/g, d) : u + d;
- Zy(t, p.Using_0_subpath_1_with_target_2, "imports", h, z), Zy(t, p.Resolving_module_0_from_1, z, o.packageDirectory + "/");
- const X = xA(
- t.features,
- z,
- o.packageDirectory + "/",
- t.compilerOptions,
- t.host,
- n,
- e,
- /*isConfigLookup*/
- !1,
- i,
- t.conditions
- );
- return Rf(
- X.resolvedModule ? {
- path: X.resolvedModule.resolvedFileName,
- extension: X.resolvedModule.extension,
- packageId: X.resolvedModule.packageId,
- originalPath: X.resolvedModule.originalPath,
- resolvedUsingTsExtension: X.resolvedModule.resolvedUsingTsExtension
- } : void 0
- );
- }
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- }
- const P = (If(u) ? Cl(u).slice(1) : Cl(u)).slice(1);
- if (P.includes("..") || P.includes(".") || P.includes("node_modules"))
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- const I = Bn(o.packageDirectory, u), F = Cl(d);
- if (F.includes("..") || F.includes(".") || F.includes("node_modules"))
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- t.traceEnabled && Zi(t.host, p.Using_0_subpath_1_with_target_2, c ? "imports" : "exports", h, g ? u.replace(/\*/g, d) : u + d);
- const O = S(g ? I.replace(/\*/g, d) : I + d), B = C(O, d, Bn(o.packageDirectory, "package.json"), c);
- return B || Rf(Ux(o, Mz(
- e,
- O,
- /*onlyRecordFailures*/
- !1,
- t
- ), t));
- } else if (typeof u == "object" && u !== null)
- if (Array.isArray(u)) {
- if (!Nr(u))
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- for (const D of u) {
- const P = _(D, d, g, h);
- if (P)
- return P;
- }
- } else {
- Zy(t, p.Entering_conditional_exports);
- for (const D of rm(u))
- if (D === "default" || t.conditions.includes(D) || CA(t.conditions, D)) {
- Zy(t, p.Matched_0_condition_1, c ? "imports" : "exports", D);
- const P = u[D], I = _(P, d, g, h);
- if (I)
- return Zy(t, p.Resolved_under_condition_0, D), Zy(t, p.Exiting_conditional_exports), I;
- Zy(t, p.Failed_to_resolve_under_condition_0, D);
- } else
- Zy(t, p.Saw_non_matching_condition_0, D);
- Zy(t, p.Exiting_conditional_exports);
- return;
- }
- else if (u === null)
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_explicitly_maps_specifier_1_to_null, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- return t.traceEnabled && Zi(t.host, p.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, o.packageDirectory, s), Rf(
- /*value*/
- void 0
- );
- function S(D) {
- var P, I;
- return D === void 0 ? D : es(D, (I = (P = t.host).getCurrentDirectory) == null ? void 0 : I.call(P));
- }
- function T(D, P) {
- return ul(Bn(D, P));
- }
- function C(D, P, I, F) {
- var O, B, z, X;
- if (!t.isConfigLookup && (t.compilerOptions.declarationDir || t.compilerOptions.outDir) && !D.includes("/node_modules/") && (!t.compilerOptions.configFile || np(o.packageDirectory, S(t.compilerOptions.configFile.fileName), !Wz(t)))) {
- const V = S0({ useCaseSensitiveFileNames: () => Wz(t) }), ae = [];
- if (t.compilerOptions.rootDir || t.compilerOptions.composite && t.compilerOptions.configFilePath) {
- const ee = S(LD(t.compilerOptions, () => [], ((B = (O = t.host).getCurrentDirectory) == null ? void 0 : B.call(O)) || "", V));
- ae.push(ee);
- } else if (t.requestContainingDirectory) {
- const ee = S(Bn(t.requestContainingDirectory, "index.ts")), G = S(LD(t.compilerOptions, () => [ee, S(I)], ((X = (z = t.host).getCurrentDirectory) == null ? void 0 : X.call(z)) || "", V));
- ae.push(G);
- let ue = ul(G);
- for (; ue && ue.length > 1; ) {
- const re = Cl(ue);
- re.pop();
- const ne = p0(re);
- ae.unshift(ne), ue = ul(ne);
- }
- }
- ae.length > 1 && t.reportDiagnostic(Go(
- F ? p.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate : p.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,
- P === "" ? "." : P,
- // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird
- I
- ));
- for (const ee of ae) {
- const G = q(ee);
- for (const ue of G)
- if (np(ue, D, !Wz(t))) {
- const re = D.slice(ue.length + 1), ne = Bn(ee, re), ie = [
- ".mjs",
- ".cjs",
- ".js",
- ".json",
- ".d.mts",
- ".d.cts",
- ".d.ts"
- /* Dts */
- ];
- for (const Se of ie)
- if (qo(ne, Se)) {
- const J = sK(ne);
- for (const oe of J) {
- if (!cye(e, oe)) continue;
- const _e = fw(ne, oe, Se, !Wz(t));
- if (t.host.fileExists(_e))
- return Rf(Ux(o, Mz(
- e,
- _e,
- /*onlyRecordFailures*/
- !1,
- t
- ), t));
- }
- }
- }
- }
- }
- return;
- function q(V) {
- var ae, ee;
- const G = t.compilerOptions.configFile ? ((ee = (ae = t.host).getCurrentDirectory) == null ? void 0 : ee.call(ae)) || "" : V, ue = [];
- return t.compilerOptions.declarationDir && ue.push(S(T(G, t.compilerOptions.declarationDir))), t.compilerOptions.outDir && t.compilerOptions.outDir !== t.compilerOptions.declarationDir && ue.push(S(T(G, t.compilerOptions.outDir))), ue;
- }
- }
- }
- }
- function CA(e, t) {
- if (!e.includes("types") || !Ui(t, "types@")) return !1;
- const n = vI.tryParse(t.substring(6));
- return n ? n.test(U_) : !1;
- }
- function _ye(e, t, n, i, s, o) {
- return fye(
- e,
- t,
- n,
- i,
- /*typesScopeOnly*/
- !1,
- s,
- o
- );
- }
- function WLe(e, t, n) {
- return fye(
- 4,
- e,
- t,
- n,
- /*typesScopeOnly*/
- !0,
- /*cache*/
- void 0,
- /*redirectedReference*/
- void 0
- );
- }
- function fye(e, t, n, i, s, o, c) {
- const _ = i.features === 0 ? void 0 : i.features & 32 ? 99 : 1, u = e & 5, d = e & -6;
- if (u) {
- Zy(i, p.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, wO(u));
- const h = g(u);
- if (h) return h;
- }
- if (d && !s)
- return Zy(i, p.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, wO(d)), g(d);
- function g(h) {
- return Fp(Wl(n), (S) => {
- if (Hc(S) !== "node_modules") {
- const T = gye(o, t, _, S, c, i);
- return T || Rf(pye(h, t, S, i, s, o, c));
- }
- });
- }
- }
- function pye(e, t, n, i, s, o, c) {
- const _ = Bn(n, "node_modules"), u = Dd(_, i.host);
- if (!u && i.traceEnabled && Zi(i.host, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, _), !s) {
- const d = dye(e, t, _, u, i, o, c);
- if (d)
- return d;
- }
- if (e & 4) {
- const d = Bn(_, "@types");
- let g = u;
- return u && !Dd(d, i.host) && (i.traceEnabled && Zi(i.host, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, d), g = !1), dye(4, mye(t, i), d, g, i, o, c);
- }
- }
- function dye(e, t, n, i, s, o, c) {
- var _, u;
- const d = Os(Bn(n, t)), { packageName: g, rest: h } = MO(t), S = Bn(n, g);
- let T, C = CS(d, !i, s);
- if (h !== "" && C && (!(s.features & 8) || !co(((_ = T = CS(S, !i, s)) == null ? void 0 : _.contents.packageJsonContent) ?? Ue, "exports"))) {
- const I = c6(e, d, !i, s);
- if (I)
- return Az(I);
- const F = Bz(
- e,
- d,
- !i,
- s,
- C.contents.packageJsonContent,
- LO(C, s)
- );
- return Ux(C, F, s);
- }
- const D = (I, F, O, B) => {
- let z = (h || !(B.features & 32)) && c6(I, F, O, B) || Bz(
- I,
- F,
- O,
- B,
- C && C.contents.packageJsonContent,
- C && LO(C, B)
- );
- return !z && C && (C.contents.packageJsonContent.exports === void 0 || C.contents.packageJsonContent.exports === null) && B.features & 32 && (z = c6(I, Bn(F, "index.js"), O, B)), Ux(C, z, B);
- };
- if (h !== "" && (C = T ?? CS(S, !i, s)), C && (s.resolvedPackageDirectory = !0), C && C.contents.packageJsonContent.exports && s.features & 8)
- return (u = Jz(C, e, Bn(".", h), s, o, c)) == null ? void 0 : u.value;
- const P = h !== "" && C ? LO(C, s) : void 0;
- if (P) {
- s.traceEnabled && Zi(s.host, p.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, P.version, U_, h);
- const I = i && Dd(S, s.host), F = Tre(
- e,
- h,
- S,
- P.paths,
- /*pathPatterns*/
- void 0,
- D,
- !I,
- s
- );
- if (F)
- return F.value;
- }
- return D(e, d, !i, s);
- }
- function Tre(e, t, n, i, s, o, c, _) {
- s || (s = k5(i));
- const u = oJ(s, t);
- if (u) {
- const d = _s(u) ? void 0 : PX(u, t), g = _s(u) ? u : DX(u);
- return _.traceEnabled && Zi(_.host, p.Module_name_0_matched_pattern_1, t, g), { value: ir(i[g], (S) => {
- const T = d ? uS(S, d) : S, C = Os(Bn(n, T));
- _.traceEnabled && Zi(_.host, p.Trying_substitution_0_candidate_module_location_Colon_1, S, T);
- const D = Vg(S);
- if (D !== void 0) {
- const P = Rz(C, c, _);
- if (P !== void 0)
- return Az({ path: P, ext: D, resolvedUsingTsExtension: void 0 });
- }
- return o(e, C, c || !Dd(Xn(C), _.host), _);
- }) };
- }
- }
- var xre = "__";
- function mye(e, t) {
- const n = l6(e);
- return t.traceEnabled && n !== e && Zi(t.host, p.Scoped_package_detected_looking_in_0, n), n;
- }
- function jO(e) {
- return `@types/${l6(e)}`;
- }
- function l6(e) {
- if (Ui(e, "@")) {
- const t = e.replace(Vo, xre);
- if (t !== e)
- return t.slice(1);
- }
- return e;
- }
- function ED(e) {
- const t = FE(e, "@types/");
- return t !== e ? EA(t) : e;
- }
- function EA(e) {
- return e.includes(xre) ? "@" + e.replace(xre, Vo) : e;
- }
- function gye(e, t, n, i, s, o) {
- const c = e && e.getFromNonRelativeNameCache(t, n, i, s);
- if (c)
- return o.traceEnabled && Zi(o.host, p.Resolution_for_module_0_was_found_in_cache_from_location_1, t, i), o.resultFromCache = c, {
- value: c.resolvedModule && {
- path: c.resolvedModule.resolvedFileName,
- originalPath: c.resolvedModule.originalPath || !0,
- extension: c.resolvedModule.extension,
- packageId: c.resolvedModule.packageId,
- resolvedUsingTsExtension: c.resolvedModule.resolvedUsingTsExtension
- }
- };
- }
- function kre(e, t, n, i, s, o) {
- const c = Xy(n, i), _ = [], u = [], d = Xn(t), g = [], h = {
- compilerOptions: n,
- host: i,
- traceEnabled: c,
- failedLookupLocations: _,
- affectingLocations: u,
- packageJsonInfoCache: s,
- features: 0,
- conditions: [],
- requestContainingDirectory: d,
- reportDiagnostic: (C) => void g.push(C),
- isConfigLookup: !1,
- candidateIsFromPackageJsonField: !1,
- resolvedPackageDirectory: !1
- }, S = T(
- 5
- /* Declaration */
- ) || T(2 | (n.resolveJsonModule ? 8 : 0));
- return H0e(
- e,
- S && S.value,
- S?.value && Yy(S.value.path),
- _,
- u,
- g,
- h,
- s
- );
- function T(C) {
- const D = eye(C, e, d, bre, h);
- if (D)
- return { value: D };
- if (Sl(e)) {
- const P = Os(Bn(d, e));
- return Rf(bre(
- C,
- P,
- /*onlyRecordFailures*/
- !1,
- h
- ));
- } else {
- const P = Fp(d, (I) => {
- const F = gye(
- s,
- e,
- /*mode*/
- void 0,
- I,
- o,
- h
- );
- if (F)
- return F;
- const O = Os(Bn(I, e));
- return Rf(bre(
- C,
- O,
- /*onlyRecordFailures*/
- !1,
- h
- ));
- });
- if (P) return P;
- if (C & 5) {
- let I = WLe(e, d, h);
- return C & 4 && (I ?? (I = hye(e, h))), I;
- }
- }
- }
- }
- function hye(e, t) {
- if (t.compilerOptions.typeRoots)
- for (const n of t.compilerOptions.typeRoots) {
- const i = X0e(n, e, t), s = Dd(n, t.host);
- !s && t.traceEnabled && Zi(t.host, p.Directory_0_does_not_exist_skipping_all_lookups_in_it, n);
- const o = c6(4, i, !s, t);
- if (o) {
- const _ = kA(o.path), u = _ ? CS(
- _,
- /*onlyRecordFailures*/
- !1,
- t
- ) : void 0;
- return Rf(Ux(u, o, t));
- }
- const c = Sre(4, i, !s, t);
- if (c) return Rf(c);
- }
- }
- function u6(e, t) {
- return !!e.allowImportingTsExtensions || t && wl(t);
- }
- function Cre(e, t, n, i, s, o) {
- const c = Xy(n, i);
- c && Zi(i, p.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, t, e, s);
- const _ = [], u = [], d = [], g = {
- compilerOptions: n,
- host: i,
- traceEnabled: c,
- failedLookupLocations: _,
- affectingLocations: u,
- packageJsonInfoCache: o,
- features: 0,
- conditions: [],
- requestContainingDirectory: void 0,
- reportDiagnostic: (S) => void d.push(S),
- isConfigLookup: !1,
- candidateIsFromPackageJsonField: !1,
- resolvedPackageDirectory: !1
- }, h = pye(
- 4,
- e,
- s,
- g,
- /*typesScopeOnly*/
- !1,
- /*cache*/
- void 0,
- /*redirectedReference*/
- void 0
- );
- return G0e(
- h,
- /*isExternalLibraryImport*/
- !0,
- _,
- u,
- d,
- g.resultFromCache,
- /*cache*/
- void 0
- );
- }
- function Rf(e) {
- return e !== void 0 ? { value: e } : void 0;
- }
- function Zy(e, t, ...n) {
- e.traceEnabled && Zi(e.host, t, ...n);
- }
- function Wz(e) {
- return e.host.useCaseSensitiveFileNames ? typeof e.host.useCaseSensitiveFileNames == "boolean" ? e.host.useCaseSensitiveFileNames : e.host.useCaseSensitiveFileNames() : !0;
- }
- var Ere = /* @__PURE__ */ ((e) => (e[e.NonInstantiated = 0] = "NonInstantiated", e[e.Instantiated = 1] = "Instantiated", e[e.ConstEnumOnly = 2] = "ConstEnumOnly", e))(Ere || {});
- function Rh(e, t) {
- return e.body && !e.body.parent && (Aa(e.body, e), Nh(
- e.body,
- /*incremental*/
- !1
- )), e.body ? Dre(e.body, t) : 1;
- }
- function Dre(e, t = /* @__PURE__ */ new Map()) {
- const n = Ma(e);
- if (t.has(n))
- return t.get(n) || 0;
- t.set(n, void 0);
- const i = ULe(e, t);
- return t.set(n, i), i;
- }
- function ULe(e, t) {
- switch (e.kind) {
- case 264:
- case 265:
- return 0;
- case 266:
- if (Y1(e))
- return 2;
- break;
- case 272:
- case 271:
- if (!Gn(
- e,
- 32
- /* Export */
- ))
- return 0;
- break;
- case 278:
- const n = e;
- if (!n.moduleSpecifier && n.exportClause && n.exportClause.kind === 279) {
- let i = 0;
- for (const s of n.exportClause.elements) {
- const o = VLe(s, t);
- if (o > i && (i = o), i === 1)
- return i;
- }
- return i;
- }
- break;
- case 268: {
- let i = 0;
- return bs(e, (s) => {
- const o = Dre(s, t);
- switch (o) {
- case 0:
- return;
- case 2:
- i = 2;
- return;
- case 1:
- return i = 1, !0;
- default:
- E.assertNever(o);
- }
- }), i;
- }
- case 267:
- return Rh(e, t);
- case 80:
- if (e.flags & 4096)
- return 0;
- }
- return 1;
- }
- function VLe(e, t) {
- const n = e.propertyName || e.name;
- if (n.kind !== 80)
- return 1;
- let i = e.parent;
- for (; i; ) {
- if (Cs(i) || Sm(i) || Si(i)) {
- const s = i.statements;
- let o;
- for (const c of s)
- if (xw(c, n)) {
- c.parent || (Aa(c, i), Nh(
- c,
- /*incremental*/
- !1
- ));
- const _ = Dre(c, t);
- if ((o === void 0 || _ > o) && (o = _), o === 1)
- return o;
- c.kind === 271 && (o = 1);
- }
- if (o !== void 0)
- return o;
- }
- i = i.parent;
- }
- return 1;
- }
- var Pre = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.IsContainer = 1] = "IsContainer", e[e.IsBlockScopedContainer = 2] = "IsBlockScopedContainer", e[e.IsControlFlowContainer = 4] = "IsControlFlowContainer", e[e.IsFunctionLike = 8] = "IsFunctionLike", e[e.IsFunctionExpression = 16] = "IsFunctionExpression", e[e.HasLocals = 32] = "HasLocals", e[e.IsInterface = 64] = "IsInterface", e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor = 128] = "IsObjectLiteralOrClassExpressionMethodOrAccessor", e))(Pre || {});
- function _g(e, t, n) {
- return E.attachFlowNodeDebugInfo({ flags: e, id: 0, node: t, antecedent: n });
- }
- var qLe = /* @__PURE__ */ HLe();
- function wre(e, t) {
- Ko("beforeBind"), qLe(e, t), Ko("afterBind"), rp("Bind", "beforeBind", "afterBind");
- }
- function HLe() {
- var e, t, n, i, s, o, c, _, u, d, g, h, S, T, C, D, P, I, F, O, B, z, X, q, V = !1, ae = 0, ee, G, ue = _g(
- 1,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), re = _g(
- 1,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), ne = dt();
- return Se;
- function ie(L, Ce, ...yt) {
- return sp(Tr(L) || e, L, Ce, ...yt);
- }
- function Se(L, Ce) {
- var yt, Mr;
- e = L, t = Ce, n = pa(t), q = J(e, Ce), G = /* @__PURE__ */ new Set(), ae = 0, ee = Gl.getSymbolConstructor(), E.attachFlowNodeDebugInfo(ue), E.attachFlowNodeDebugInfo(re), e.locals || ((yt = rn) == null || yt.push(
- rn.Phase.Bind,
- "bindSourceFile",
- { path: e.path },
- /*separateBeginAndEnd*/
- !0
- ), ar(e), (Mr = rn) == null || Mr.pop(), e.symbolCount = ae, e.classifiableNames = G, Ll(), xs()), e = void 0, t = void 0, n = void 0, i = void 0, s = void 0, o = void 0, c = void 0, _ = void 0, u = void 0, g = void 0, d = !1, h = void 0, S = void 0, T = void 0, C = void 0, D = void 0, P = void 0, I = void 0, O = void 0, B = !1, z = !1, V = !1, X = 0;
- }
- function J(L, Ce) {
- return cu(Ce, "alwaysStrict") && !L.isDeclarationFile ? !0 : !!L.externalModuleIndicator;
- }
- function oe(L, Ce) {
- return ae++, new ee(L, Ce);
- }
- function _e(L, Ce, yt) {
- L.flags |= yt, Ce.symbol = L, L.declarations = bh(L.declarations, Ce), yt & 1955 && !L.exports && (L.exports = Js()), yt & 6240 && !L.members && (L.members = Js()), L.constEnumOnlyModule && L.flags & 304 && (L.constEnumOnlyModule = !1), yt & 111551 && l3(L, Ce);
- }
- function he(L) {
- if (L.kind === 277)
- return L.isExportEquals ? "export=" : "default";
- const Ce = os(L);
- if (Ce) {
- if (Fu(L)) {
- const yt = Jp(Ce);
- return ig(L) ? "__global" : `"${yt}"`;
- }
- if (Ce.kind === 167) {
- const yt = Ce.expression;
- if (Of(yt))
- return tc(yt.text);
- if (M7(yt))
- return qs(yt.operator) + yt.operand.text;
- E.fail("Only computed properties with literal names have declaration names");
- }
- if (Di(Ce)) {
- const yt = Ol(L);
- if (!yt)
- return;
- const Mr = yt.symbol;
- return v3(Mr, Ce.escapedText);
- }
- return Nd(Ce) ? yx(Ce) : fm(Ce) ? C4(Ce) : void 0;
- }
- switch (L.kind) {
- case 176:
- return "__constructor";
- case 184:
- case 179:
- case 323:
- return "__call";
- case 185:
- case 180:
- return "__new";
- case 181:
- return "__index";
- case 278:
- return "__export";
- case 307:
- return "export=";
- case 226:
- if (Cc(L) === 2)
- return "export=";
- E.fail("Unknown binary declaration kind");
- break;
- case 317:
- return CC(L) ? "__new" : "__call";
- case 169:
- return E.assert(L.parent.kind === 317, "Impossible parameter parent kind", () => `parent is: ${E.formatSyntaxKind(L.parent.kind)}, expected JSDocFunctionType`), "arg" + L.parent.parameters.indexOf(L);
- }
- }
- function le(L) {
- return Vl(L) ? _o(L.name) : Ei(E.checkDefined(he(L)));
- }
- function me(L, Ce, yt, Mr, hi, Es, ns) {
- E.assert(ns || !Dh(yt));
- const Ds = Gn(
- yt,
- 2048
- /* Default */
- ) || vu(yt) && ng(yt.name), Pa = ns ? "__computed" : Ds && Ce ? "default" : he(yt);
- let ga;
- if (Pa === void 0)
- ga = oe(
- 0,
- "__missing"
- /* Missing */
- );
- else if (ga = L.get(Pa), Mr & 2885600 && G.add(Pa), !ga)
- L.set(Pa, ga = oe(0, Pa)), Es && (ga.isReplaceableByMethod = !0);
- else {
- if (Es && !ga.isReplaceableByMethod)
- return ga;
- if (ga.flags & hi) {
- if (ga.isReplaceableByMethod)
- L.set(Pa, ga = oe(0, Pa));
- else if (!(Mr & 3 && ga.flags & 67108864)) {
- Vl(yt) && Aa(yt.name, yt);
- let $o = ga.flags & 2 ? p.Cannot_redeclare_block_scoped_variable_0 : p.Duplicate_identifier_0, vp = !0;
- (ga.flags & 384 || Mr & 384) && ($o = p.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations, vp = !1);
- let dd = !1;
- Nr(ga.declarations) && (Ds || ga.declarations && ga.declarations.length && yt.kind === 277 && !yt.isExportEquals) && ($o = p.A_module_cannot_have_multiple_default_exports, vp = !1, dd = !0);
- const jd = [];
- Vp(yt) && rc(yt.type) && Gn(
- yt,
- 32
- /* Export */
- ) && ga.flags & 2887656 && jd.push(ie(yt, p.Did_you_mean_0, `export type { ${Ei(yt.name.escapedText)} }`));
- const Kg = os(yt) || yt;
- ir(ga.declarations, (eh, bp) => {
- const Sp = os(eh) || eh, Mo = vp ? ie(Sp, $o, le(eh)) : ie(Sp, $o);
- e.bindDiagnostics.push(
- dd ? Rs(Mo, ie(Kg, bp === 0 ? p.Another_export_default_is_here : p.and_here)) : Mo
- ), dd && jd.push(ie(Sp, p.The_first_export_default_is_here));
- });
- const J0 = vp ? ie(Kg, $o, le(yt)) : ie(Kg, $o);
- e.bindDiagnostics.push(Rs(J0, ...jd)), ga = oe(0, Pa);
- }
- }
- }
- return _e(ga, yt, Mr), ga.parent ? E.assert(ga.parent === Ce, "Existing symbol parent should match new one") : ga.parent = Ce, ga;
- }
- function ve(L, Ce, yt) {
- const Mr = !!(U1(L) & 32) || tt(L);
- if (Ce & 2097152)
- return L.kind === 281 || L.kind === 271 && Mr ? me(s.symbol.exports, s.symbol, L, Ce, yt) : (E.assertNode(s, tg), me(
- s.locals,
- /*parent*/
- void 0,
- L,
- Ce,
- yt
- ));
- if (Bp(L) && E.assert(cn(L)), !Fu(L) && (Mr || s.flags & 128)) {
- if (!tg(s) || !s.locals || Gn(
- L,
- 2048
- /* Default */
- ) && !he(L))
- return me(s.symbol.exports, s.symbol, L, Ce, yt);
- const hi = Ce & 111551 ? 1048576 : 0, Es = me(
- s.locals,
- /*parent*/
- void 0,
- L,
- hi,
- yt
- );
- return Es.exportSymbol = me(s.symbol.exports, s.symbol, L, Ce, yt), L.localSymbol = Es, Es;
- } else
- return E.assertNode(s, tg), me(
- s.locals,
- /*parent*/
- void 0,
- L,
- Ce,
- yt
- );
- }
- function tt(L) {
- if (L.parent && zc(L) && (L = L.parent), !Bp(L)) return !1;
- if (!sA(L) && L.fullName) return !0;
- const Ce = os(L);
- return Ce ? !!(A3(Ce.parent) && Uf(Ce.parent) || ql(Ce.parent) && U1(Ce.parent) & 32) : !1;
- }
- function Te(L, Ce) {
- const yt = s, Mr = o, hi = c;
- if (Ce & 1 ? (L.kind !== 219 && (o = s), s = c = L, Ce & 32 && (s.locals = Js(), zt(s))) : Ce & 2 && (c = L, Ce & 32 && (c.locals = void 0)), Ce & 4) {
- const Es = h, ns = S, Ds = T, Pa = C, ga = I, $o = O, vp = B, dd = Ce & 16 && !Gn(
- L,
- 1024
- /* Async */
- ) && !L.asteriskToken && !!bb(L) || L.kind === 175;
- dd || (h = _g(
- 2,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), Ce & 144 && (h.node = L)), C = dd || L.kind === 176 || cn(L) && (L.kind === 262 || L.kind === 218) ? Nt() : void 0, I = void 0, S = void 0, T = void 0, O = void 0, B = !1, Qe(L), L.flags &= -5633, !(h.flags & 1) && Ce & 8 && Mp(L.body) && (L.flags |= 512, B && (L.flags |= 1024), L.endFlowNode = h), L.kind === 307 && (L.flags |= X, L.endFlowNode = h), C && (zn(C, h), h = Jr(C), (L.kind === 176 || L.kind === 175 || cn(L) && (L.kind === 262 || L.kind === 218)) && (L.returnFlowNode = h)), dd || (h = Es), S = ns, T = Ds, C = Pa, I = ga, O = $o, B = vp;
- } else Ce & 64 ? (d = !1, Qe(L), E.assertNotNode(L, Oe), L.flags = d ? L.flags | 256 : L.flags & -257) : Qe(L);
- s = yt, o = Mr, c = hi;
- }
- function we(L) {
- fe(L, (Ce) => Ce.kind === 262 ? ar(Ce) : void 0), fe(L, (Ce) => Ce.kind !== 262 ? ar(Ce) : void 0);
- }
- function fe(L, Ce = ar) {
- L !== void 0 && ir(L, Ce);
- }
- function Me(L) {
- bs(L, ar, fe);
- }
- function Qe(L) {
- const Ce = V;
- if (V = !1, si(L)) {
- Me(L), An(L), V = Ce;
- return;
- }
- switch (L.kind >= 243 && L.kind <= 259 && (!t.allowUnreachableCode || L.kind === 253) && (L.flowNode = h), L.kind) {
- case 247:
- Ws(L);
- break;
- case 246:
- Hs(L);
- break;
- case 248:
- rr(L);
- break;
- case 249:
- case 250:
- Ea(L);
- break;
- case 245:
- Xe(L);
- break;
- case 253:
- case 257:
- Tt(L);
- break;
- case 252:
- case 251:
- K(L);
- break;
- case 258:
- De(L);
- break;
- case 255:
- Ve(L);
- break;
- case 269:
- Ke(L);
- break;
- case 296:
- xe(L);
- break;
- case 244:
- at(L);
- break;
- case 256:
- bt(L);
- break;
- case 224:
- vn(L);
- break;
- case 225:
- M(L);
- break;
- case 226:
- if (x0(L)) {
- V = Ce, Ae(L);
- return;
- }
- ne(L);
- break;
- case 220:
- U(L);
- break;
- case 227:
- be(L);
- break;
- case 260:
- ht(L);
- break;
- case 211:
- case 212:
- Ht(L);
- break;
- case 213:
- en(L);
- break;
- case 235:
- Xt(L);
- break;
- case 346:
- case 338:
- case 340:
- Dr(L);
- break;
- case 351:
- $r(L);
- break;
- case 307: {
- we(L.statements), ar(L.endOfFileToken);
- break;
- }
- case 241:
- case 268:
- we(L.statements);
- break;
- case 208:
- Le(L);
- break;
- case 169:
- Ie(L);
- break;
- case 210:
- case 209:
- case 303:
- case 230:
- V = Ce;
- default:
- Me(L);
- break;
- }
- An(L), V = Ce;
- }
- function et(L) {
- switch (L.kind) {
- case 80:
- case 110:
- return !0;
- case 211:
- case 212:
- return ft(L);
- case 213:
- return Wt(L);
- case 217:
- if (xS(L))
- return !1;
- case 235:
- return et(L.expression);
- case 226:
- return Ir(L);
- case 224:
- return L.operator === 54 && et(L.operand);
- case 221:
- return et(L.expression);
- }
- return !1;
- }
- function Re(L) {
- switch (L.kind) {
- case 80:
- case 110:
- case 108:
- case 236:
- return !0;
- case 211:
- case 217:
- case 235:
- return Re(L.expression);
- case 212:
- return (Of(L.argumentExpression) || yo(L.argumentExpression)) && Re(L.expression);
- case 226:
- return L.operatorToken.kind === 28 && Re(L.right) || Ph(L.operatorToken.kind) && __(L.left);
- }
- return !1;
- }
- function ft(L) {
- return Re(L) || hu(L) && ft(L.expression);
- }
- function Wt(L) {
- if (L.arguments) {
- for (const Ce of L.arguments)
- if (ft(Ce))
- return !0;
- }
- return !!(L.expression.kind === 211 && ft(L.expression.expression));
- }
- function _r(L, Ce) {
- return GC(L) && jr(L.expression) && Xa(Ce);
- }
- function Ir(L) {
- switch (L.operatorToken.kind) {
- case 64:
- case 76:
- case 77:
- case 78:
- return ft(L.left);
- case 35:
- case 36:
- case 37:
- case 38:
- return jr(L.left) || jr(L.right) || _r(L.right, L.left) || _r(L.left, L.right) || a4(L.right) && et(L.left) || a4(L.left) && et(L.right);
- case 104:
- return jr(L.left);
- case 103:
- return et(L.right);
- case 28:
- return et(L.right);
- }
- return !1;
- }
- function jr(L) {
- switch (L.kind) {
- case 217:
- return jr(L.expression);
- case 226:
- switch (L.operatorToken.kind) {
- case 64:
- return jr(L.left);
- case 28:
- return jr(L.right);
- }
- }
- return ft(L);
- }
- function Nt() {
- return _g(
- 4,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- );
- }
- function Qt() {
- return _g(
- 8,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- );
- }
- function Br(L, Ce, yt) {
- return _g(1024, { target: L, antecedents: Ce }, yt);
- }
- function xr(L) {
- L.flags |= L.flags & 2048 ? 4096 : 2048;
- }
- function zn(L, Ce) {
- !(Ce.flags & 1) && !ss(L.antecedent, Ce) && ((L.antecedent || (L.antecedent = [])).push(Ce), xr(Ce));
- }
- function ki(L, Ce, yt) {
- return Ce.flags & 1 ? Ce : yt ? (yt.kind === 112 && L & 64 || yt.kind === 97 && L & 32) && !JI(yt) && !gj(yt.parent) ? ue : et(yt) ? (xr(Ce), _g(L, yt, Ce)) : Ce : L & 32 ? Ce : ue;
- }
- function rs(L, Ce, yt, Mr) {
- return xr(L), _g(128, { switchStatement: Ce, clauseStart: yt, clauseEnd: Mr }, L);
- }
- function ei(L, Ce, yt) {
- xr(Ce), z = !0;
- const Mr = _g(L, yt, Ce);
- return I && zn(I, Mr), Mr;
- }
- function Ri(L, Ce) {
- return xr(L), z = !0, _g(512, Ce, L);
- }
- function Jr(L) {
- const Ce = L.antecedent;
- return Ce ? Ce.length === 1 ? Ce[0] : L : ue;
- }
- function ji(L) {
- const Ce = L.parent;
- switch (Ce.kind) {
- case 245:
- case 247:
- case 246:
- return Ce.expression === L;
- case 248:
- case 227:
- return Ce.condition === L;
- }
- return !1;
- }
- function Fe(L) {
- for (; ; )
- if (L.kind === 217)
- L = L.expression;
- else if (L.kind === 224 && L.operator === 54)
- L = L.operand;
- else
- return P3(L);
- }
- function Ot(L) {
- return FB(Ba(L));
- }
- function Ar(L) {
- for (; Yu(L.parent) || uv(L.parent) && L.parent.operator === 54; )
- L = L.parent;
- return !ji(L) && !Fe(L.parent) && !(hu(L.parent) && L.parent.expression === L);
- }
- function mn(L, Ce, yt, Mr) {
- const hi = D, Es = P;
- D = yt, P = Mr, L(Ce), D = hi, P = Es;
- }
- function ti(L, Ce, yt) {
- mn(ar, L, Ce, yt), (!L || !Ot(L) && !Fe(L) && !(hu(L) && e4(L))) && (zn(Ce, ki(32, h, L)), zn(yt, ki(64, h, L)));
- }
- function qn(L, Ce, yt) {
- const Mr = S, hi = T;
- S = Ce, T = yt, ar(L), S = Mr, T = hi;
- }
- function Oi(L, Ce) {
- let yt = O;
- for (; yt && L.parent.kind === 256; )
- yt.continueTarget = Ce, yt = yt.next, L = L.parent;
- return Ce;
- }
- function Ws(L) {
- const Ce = Oi(L, Qt()), yt = Nt(), Mr = Nt();
- zn(Ce, h), h = Ce, ti(L.expression, yt, Mr), h = Jr(yt), qn(L.statement, Mr, Ce), zn(Ce, h), h = Jr(Mr);
- }
- function Hs(L) {
- const Ce = Qt(), yt = Oi(L, Nt()), Mr = Nt();
- zn(Ce, h), h = Ce, qn(L.statement, Mr, yt), zn(yt, h), h = Jr(yt), ti(L.expression, Ce, Mr), h = Jr(Mr);
- }
- function rr(L) {
- const Ce = Oi(L, Qt()), yt = Nt(), Mr = Nt();
- ar(L.initializer), zn(Ce, h), h = Ce, ti(L.condition, yt, Mr), h = Jr(yt), qn(L.statement, Mr, Ce), ar(L.incrementor), zn(Ce, h), h = Jr(Mr);
- }
- function Ea(L) {
- const Ce = Oi(L, Qt()), yt = Nt();
- ar(L.expression), zn(Ce, h), h = Ce, L.kind === 250 && ar(L.awaitModifier), zn(yt, h), ar(L.initializer), L.initializer.kind !== 261 && Vt(L.initializer), qn(L.statement, yt, Ce), zn(Ce, h), h = Jr(yt);
- }
- function Xe(L) {
- const Ce = Nt(), yt = Nt(), Mr = Nt();
- ti(L.expression, Ce, yt), h = Jr(Ce), ar(L.thenStatement), zn(Mr, h), h = Jr(yt), ar(L.elseStatement), zn(Mr, h), h = Jr(Mr);
- }
- function Tt(L) {
- ar(L.expression), L.kind === 253 && (B = !0, C && zn(C, h)), h = ue, z = !0;
- }
- function te(L) {
- for (let Ce = O; Ce; Ce = Ce.next)
- if (Ce.name === L)
- return Ce;
- }
- function ze(L, Ce, yt) {
- const Mr = L.kind === 252 ? Ce : yt;
- Mr && (zn(Mr, h), h = ue, z = !0);
- }
- function K(L) {
- if (ar(L.label), L.label) {
- const Ce = te(L.label.escapedText);
- Ce && (Ce.referenced = !0, ze(L, Ce.breakTarget, Ce.continueTarget));
- } else
- ze(L, S, T);
- }
- function De(L) {
- const Ce = C, yt = I, Mr = Nt(), hi = Nt();
- let Es = Nt();
- if (L.finallyBlock && (C = hi), zn(Es, h), I = Es, ar(L.tryBlock), zn(Mr, h), L.catchClause && (h = Jr(Es), Es = Nt(), zn(Es, h), I = Es, ar(L.catchClause), zn(Mr, h)), C = Ce, I = yt, L.finallyBlock) {
- const ns = Nt();
- ns.antecedent = Qi(Qi(Mr.antecedent, Es.antecedent), hi.antecedent), h = ns, ar(L.finallyBlock), h.flags & 1 ? h = ue : (C && hi.antecedent && zn(C, Br(ns, hi.antecedent, h)), I && Es.antecedent && zn(I, Br(ns, Es.antecedent, h)), h = Mr.antecedent ? Br(ns, Mr.antecedent, h) : ue);
- } else
- h = Jr(Mr);
- }
- function Ve(L) {
- const Ce = Nt();
- ar(L.expression);
- const yt = S, Mr = F;
- S = Ce, F = h, ar(L.caseBlock), zn(Ce, h);
- const hi = ir(
- L.caseBlock.clauses,
- (Es) => Es.kind === 297
- /* DefaultClause */
- );
- L.possiblyExhaustive = !hi && !Ce.antecedent, hi || zn(Ce, rs(F, L, 0, 0)), S = yt, F = Mr, h = Jr(Ce);
- }
- function Ke(L) {
- const Ce = L.clauses, yt = L.parent.expression.kind === 112 || et(L.parent.expression);
- let Mr = ue;
- for (let hi = 0; hi < Ce.length; hi++) {
- const Es = hi;
- for (; !Ce[hi].statements.length && hi + 1 < Ce.length; )
- Mr === ue && (h = F), ar(Ce[hi]), hi++;
- const ns = Nt();
- zn(ns, yt ? rs(F, L.parent, Es, hi + 1) : F), zn(ns, Mr), h = Jr(ns);
- const Ds = Ce[hi];
- ar(Ds), Mr = h, !(h.flags & 1) && hi !== Ce.length - 1 && t.noFallthroughCasesInSwitch && (Ds.fallthroughFlowNode = h);
- }
- }
- function xe(L) {
- const Ce = h;
- h = F, ar(L.expression), h = Ce, fe(L.statements);
- }
- function at(L) {
- ar(L.expression), $e(L.expression);
- }
- function $e(L) {
- if (L.kind === 213) {
- const Ce = L;
- Ce.expression.kind !== 108 && w3(Ce.expression) && (h = Ri(h, Ce));
- }
- }
- function bt(L) {
- const Ce = Nt();
- O = {
- next: O,
- name: L.label.escapedText,
- breakTarget: Ce,
- continueTarget: void 0,
- referenced: !1
- }, ar(L.label), ar(L.statement), !O.referenced && !t.allowUnusedLabels && $t(JK(t), L.label, p.Unused_label), O = O.next, zn(Ce, h), h = Jr(Ce);
- }
- function He(L) {
- L.kind === 226 && L.operatorToken.kind === 64 ? Vt(L.left) : Vt(L);
- }
- function Vt(L) {
- if (Re(L))
- h = ei(16, h, L);
- else if (L.kind === 209)
- for (const Ce of L.elements)
- Ce.kind === 230 ? Vt(Ce.expression) : He(Ce);
- else if (L.kind === 210)
- for (const Ce of L.properties)
- Ce.kind === 303 ? He(Ce.initializer) : Ce.kind === 304 ? Vt(Ce.name) : Ce.kind === 305 && Vt(Ce.expression);
- }
- function Zt(L, Ce, yt) {
- const Mr = Nt();
- L.operatorToken.kind === 56 || L.operatorToken.kind === 77 ? ti(L.left, Mr, yt) : ti(L.left, Ce, Mr), h = Jr(Mr), ar(L.operatorToken), w4(L.operatorToken.kind) ? (mn(ar, L.right, Ce, yt), Vt(L.left), zn(Ce, ki(32, h, L)), zn(yt, ki(64, h, L))) : ti(L.right, Ce, yt);
- }
- function vn(L) {
- if (L.operator === 54) {
- const Ce = D;
- D = P, P = Ce, Me(L), P = D, D = Ce;
- } else
- Me(L), (L.operator === 46 || L.operator === 47) && Vt(L.operand);
- }
- function M(L) {
- Me(L), (L.operator === 46 || L.operator === 47) && Vt(L.operand);
- }
- function Ae(L) {
- V ? (V = !1, ar(L.operatorToken), ar(L.right), V = !0, ar(L.left)) : (V = !0, ar(L.left), V = !1, ar(L.operatorToken), ar(L.right)), Vt(L.left);
- }
- function dt() {
- return fO(
- L,
- Ce,
- yt,
- Mr,
- hi,
- /*foldState*/
- void 0
- );
- function L(ns, Ds) {
- if (Ds) {
- Ds.stackIndex++, Aa(ns, i);
- const ga = q;
- za(ns);
- const $o = i;
- i = ns, Ds.skip = !1, Ds.inStrictModeStack[Ds.stackIndex] = ga, Ds.parentStack[Ds.stackIndex] = $o;
- } else
- Ds = {
- stackIndex: 0,
- skip: !1,
- inStrictModeStack: [void 0],
- parentStack: [void 0]
- };
- const Pa = ns.operatorToken.kind;
- if (X7(Pa) || w4(Pa)) {
- if (Ar(ns)) {
- const ga = Nt(), $o = h, vp = z;
- z = !1, Zt(ns, ga, ga), h = z ? Jr(ga) : $o, z || (z = vp);
- } else
- Zt(ns, D, P);
- Ds.skip = !0;
- }
- return Ds;
- }
- function Ce(ns, Ds, Pa) {
- if (!Ds.skip) {
- const ga = Es(ns);
- return Pa.operatorToken.kind === 28 && $e(ns), ga;
- }
- }
- function yt(ns, Ds, Pa) {
- Ds.skip || ar(ns);
- }
- function Mr(ns, Ds, Pa) {
- if (!Ds.skip) {
- const ga = Es(ns);
- return Pa.operatorToken.kind === 28 && $e(ns), ga;
- }
- }
- function hi(ns, Ds) {
- if (!Ds.skip) {
- const $o = ns.operatorToken.kind;
- if (Ph($o) && !b0(ns) && (Vt(ns.left), $o === 64 && ns.left.kind === 212)) {
- const vp = ns.left;
- jr(vp.expression) && (h = ei(256, h, ns));
- }
- }
- const Pa = Ds.inStrictModeStack[Ds.stackIndex], ga = Ds.parentStack[Ds.stackIndex];
- Pa !== void 0 && (q = Pa), ga !== void 0 && (i = ga), Ds.skip = !1, Ds.stackIndex--;
- }
- function Es(ns) {
- if (ns && dn(ns) && !x0(ns))
- return ns;
- ar(ns);
- }
- }
- function U(L) {
- Me(L), L.expression.kind === 211 && Vt(L.expression);
- }
- function be(L) {
- const Ce = Nt(), yt = Nt(), Mr = Nt(), hi = h, Es = z;
- z = !1, ti(L.condition, Ce, yt), h = Jr(Ce), ar(L.questionToken), ar(L.whenTrue), zn(Mr, h), h = Jr(yt), ar(L.colonToken), ar(L.whenFalse), zn(Mr, h), h = z ? Jr(Mr) : hi, z || (z = Es);
- }
- function Z(L) {
- const Ce = ml(L) ? void 0 : L.name;
- if (As(Ce))
- for (const yt of Ce.elements)
- Z(yt);
- else
- h = ei(16, h, L);
- }
- function ht(L) {
- Me(L), (L.initializer || Z2(L.parent.parent)) && Z(L);
- }
- function Le(L) {
- ar(L.dotDotDotToken), ar(L.propertyName), At(L.initializer), ar(L.name);
- }
- function Ie(L) {
- fe(L.modifiers), ar(L.dotDotDotToken), ar(L.questionToken), ar(L.type), At(L.initializer), ar(L.name);
- }
- function At(L) {
- if (!L)
- return;
- const Ce = h;
- if (ar(L), Ce === ue || Ce === h)
- return;
- const yt = Nt();
- zn(yt, Ce), zn(yt, h), h = Jr(yt);
- }
- function Dr(L) {
- ar(L.tagName), L.kind !== 340 && L.fullName && (Aa(L.fullName, L), Nh(
- L.fullName,
- /*incremental*/
- !1
- )), typeof L.comment != "string" && fe(L.comment);
- }
- function yr(L) {
- Me(L);
- const Ce = ev(L);
- Ce && Ce.kind !== 174 && _e(
- Ce.symbol,
- Ce,
- 32
- /* Class */
- );
- }
- function $r(L) {
- ar(L.tagName), ar(L.moduleSpecifier), ar(L.attributes), typeof L.comment != "string" && fe(L.comment);
- }
- function nt(L, Ce, yt) {
- mn(ar, L, Ce, yt), (!hu(L) || e4(L)) && (zn(Ce, ki(32, h, L)), zn(yt, ki(64, h, L)));
- }
- function ot(L) {
- switch (L.kind) {
- case 211:
- ar(L.questionDotToken), ar(L.name);
- break;
- case 212:
- ar(L.questionDotToken), ar(L.argumentExpression);
- break;
- case 213:
- ar(L.questionDotToken), fe(L.typeArguments), fe(L.arguments);
- break;
- }
- }
- function wt(L, Ce, yt) {
- const Mr = KE(L) ? Nt() : void 0;
- nt(L.expression, Mr || Ce, yt), Mr && (h = Jr(Mr)), mn(ot, L, Ce, yt), e4(L) && (zn(Ce, ki(32, h, L)), zn(yt, ki(64, h, L)));
- }
- function jt(L) {
- if (Ar(L)) {
- const Ce = Nt(), yt = h, Mr = z;
- wt(L, Ce, Ce), h = z ? Jr(Ce) : yt, z || (z = Mr);
- } else
- wt(L, D, P);
- }
- function Xt(L) {
- hu(L) ? jt(L) : Me(L);
- }
- function Ht(L) {
- hu(L) ? jt(L) : Me(L);
- }
- function en(L) {
- if (hu(L))
- jt(L);
- else {
- const Ce = Ba(L.expression);
- Ce.kind === 218 || Ce.kind === 219 ? (fe(L.typeArguments), fe(L.arguments), ar(L.expression)) : (Me(L), L.expression.kind === 108 && (h = Ri(h, L)));
- }
- if (L.expression.kind === 211) {
- const Ce = L.expression;
- Oe(Ce.name) && jr(Ce.expression) && vB(Ce.name) && (h = ei(256, h, L));
- }
- }
- function zt(L) {
- _ && (_.nextContainer = L), _ = L;
- }
- function mr(L, Ce, yt) {
- switch (s.kind) {
- case 267:
- return ve(L, Ce, yt);
- case 307:
- return hr(L, Ce, yt);
- case 231:
- case 263:
- return Kt(L, Ce, yt);
- case 266:
- return me(s.symbol.exports, s.symbol, L, Ce, yt);
- case 187:
- case 322:
- case 210:
- case 264:
- case 292:
- return me(s.symbol.members, s.symbol, L, Ce, yt);
- case 184:
- case 185:
- case 179:
- case 180:
- case 323:
- case 181:
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- case 262:
- case 218:
- case 219:
- case 317:
- case 175:
- case 265:
- case 200:
- return s.locals && E.assertNode(s, tg), me(
- s.locals,
- /*parent*/
- void 0,
- L,
- Ce,
- yt
- );
- }
- }
- function Kt(L, Ce, yt) {
- return zs(L) ? me(s.symbol.exports, s.symbol, L, Ce, yt) : me(s.symbol.members, s.symbol, L, Ce, yt);
- }
- function hr(L, Ce, yt) {
- return il(e) ? ve(L, Ce, yt) : me(
- e.locals,
- /*parent*/
- void 0,
- L,
- Ce,
- yt
- );
- }
- function Ft(L) {
- const Ce = Si(L) ? L : Wn(L.body, Sm);
- return !!Ce && Ce.statements.some((yt) => Nc(yt) || wo(yt));
- }
- function Ss(L) {
- L.flags & 33554432 && !Ft(L) ? L.flags |= 128 : L.flags &= -129;
- }
- function gs(L) {
- if (Ss(L), Fu(L))
- if (Gn(
- L,
- 32
- /* Export */
- ) && Ct(L, p.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible), Uj(L))
- Ts(L);
- else {
- let Ce;
- if (L.name.kind === 11) {
- const { text: Mr } = L.name;
- Ce = BC(Mr), Ce === void 0 && Ct(L.name, p.Pattern_0_can_have_at_most_one_Asterisk_character, Mr);
- }
- const yt = mr(
- L,
- 512,
- 110735
- /* ValueModuleExcludes */
- );
- e.patternAmbientModules = wr(e.patternAmbientModules, Ce && !_s(Ce) ? { pattern: Ce, symbol: yt } : void 0);
- }
- else {
- const Ce = Ts(L);
- if (Ce !== 0) {
- const { symbol: yt } = L;
- yt.constEnumOnlyModule = !(yt.flags & 304) && Ce === 2 && yt.constEnumOnlyModule !== !1;
- }
- }
- }
- function Ts(L) {
- const Ce = Rh(L), yt = Ce !== 0;
- return mr(
- L,
- yt ? 512 : 1024,
- yt ? 110735 : 0
- /* NamespaceModuleExcludes */
- ), Ce;
- }
- function Ua(L) {
- const Ce = oe(131072, he(L));
- _e(
- Ce,
- L,
- 131072
- /* Signature */
- );
- const yt = oe(
- 2048,
- "__type"
- /* Type */
- );
- _e(
- yt,
- L,
- 2048
- /* TypeLiteral */
- ), yt.members = Js(), yt.members.set(Ce.escapedName, Ce);
- }
- function lc(L) {
- return vi(
- L,
- 4096,
- "__object"
- /* Object */
- );
- }
- function Ic(L) {
- return vi(
- L,
- 4096,
- "__jsxAttributes"
- /* JSXAttributes */
- );
- }
- function io(L, Ce, yt) {
- return mr(L, Ce, yt);
- }
- function vi(L, Ce, yt) {
- const Mr = oe(Ce, yt);
- return Ce & 106508 && (Mr.parent = s.symbol), _e(Mr, L, Ce), Mr;
- }
- function ca(L, Ce, yt) {
- switch (c.kind) {
- case 267:
- ve(L, Ce, yt);
- break;
- case 307:
- if (X_(s)) {
- ve(L, Ce, yt);
- break;
- }
- default:
- E.assertNode(c, tg), c.locals || (c.locals = Js(), zt(c)), me(
- c.locals,
- /*parent*/
- void 0,
- L,
- Ce,
- yt
- );
- }
- }
- function Ll() {
- if (!u)
- return;
- const L = s, Ce = _, yt = c, Mr = i, hi = h;
- for (const Es of u) {
- const ns = Es.parent.parent;
- s = _7(ns) || e, c = Cd(ns) || e, h = _g(
- 2,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), i = Es, ar(Es.typeExpression);
- const Ds = os(Es);
- if ((sA(Es) || !Es.fullName) && Ds && A3(Ds.parent)) {
- const Pa = Uf(Ds.parent);
- if (Pa) {
- A_(
- e.symbol,
- Ds.parent,
- Pa,
- !!or(Ds, ($o) => Cn($o) && $o.name.escapedText === "prototype"),
- /*containerIsClass*/
- !1
- );
- const ga = s;
- switch (o3(Ds.parent)) {
- case 1:
- case 2:
- X_(e) ? s = e : s = void 0;
- break;
- case 4:
- s = Ds.parent.expression;
- break;
- case 3:
- s = Ds.parent.expression.name;
- break;
- case 5:
- s = qb(e, Ds.parent.expression) ? e : Cn(Ds.parent.expression) ? Ds.parent.expression.name : Ds.parent.expression;
- break;
- case 0:
- return E.fail("Shouldn't have detected typedef or enum on non-assignment declaration");
- }
- s && ve(
- Es,
- 524288,
- 788968
- /* TypeAliasExcludes */
- ), s = ga;
- }
- } else sA(Es) || !Es.fullName || Es.fullName.kind === 80 ? (i = Es.parent, ca(
- Es,
- 524288,
- 788968
- /* TypeAliasExcludes */
- )) : ar(Es.fullName);
- }
- s = L, _ = Ce, c = yt, i = Mr, h = hi;
- }
- function xs() {
- if (g === void 0)
- return;
- const L = s, Ce = _, yt = c, Mr = i, hi = h;
- for (const Es of g) {
- const ns = xb(Es), Ds = ns ? _7(ns) : void 0, Pa = ns ? Cd(ns) : void 0;
- s = Ds || e, c = Pa || e, h = _g(
- 2,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), i = Es, ar(Es.importClause);
- }
- s = L, _ = Ce, c = yt, i = Mr, h = hi;
- }
- function Cu(L) {
- if (!e.parseDiagnostics.length && !(L.flags & 33554432) && !(L.flags & 16777216) && !XZ(L)) {
- const Ce = G2(L);
- if (Ce === void 0)
- return;
- q && Ce >= 119 && Ce <= 127 ? e.bindDiagnostics.push(ie(L, Zc(L), _o(L))) : Ce === 135 ? il(e) && S7(L) ? e.bindDiagnostics.push(ie(L, p.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, _o(L))) : L.flags & 65536 && e.bindDiagnostics.push(ie(L, p.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, _o(L))) : Ce === 127 && L.flags & 16384 && e.bindDiagnostics.push(ie(L, p.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, _o(L)));
- }
- }
- function Zc(L) {
- return Ol(L) ? p.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode : e.externalModuleIndicator ? p.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode : p.Identifier_expected_0_is_a_reserved_word_in_strict_mode;
- }
- function Yi(L) {
- L.escapedText === "#constructor" && (e.parseDiagnostics.length || e.bindDiagnostics.push(ie(L, p.constructor_is_a_reserved_word, _o(L))));
- }
- function Na(L) {
- q && __(L.left) && Ph(L.operatorToken.kind) && Bt(L, L.left);
- }
- function Ia(L) {
- q && L.variableDeclaration && Bt(L, L.variableDeclaration.name);
- }
- function Vi(L) {
- if (q && L.expression.kind === 80) {
- const Ce = tS(e, L.expression);
- e.bindDiagnostics.push(fl(e, Ce.start, Ce.length, p.delete_cannot_be_called_on_an_identifier_in_strict_mode));
- }
- }
- function ba(L) {
- return Oe(L) && (L.escapedText === "eval" || L.escapedText === "arguments");
- }
- function Bt(L, Ce) {
- if (Ce && Ce.kind === 80) {
- const yt = Ce;
- if (ba(yt)) {
- const Mr = tS(e, Ce);
- e.bindDiagnostics.push(fl(e, Mr.start, Mr.length, to(L), Nn(yt)));
- }
- }
- }
- function to(L) {
- return Ol(L) ? p.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode : e.externalModuleIndicator ? p.Invalid_use_of_0_Modules_are_automatically_in_strict_mode : p.Invalid_use_of_0_in_strict_mode;
- }
- function _u(L) {
- q && !(L.flags & 33554432) && Bt(L, L.name);
- }
- function Wc(L) {
- return Ol(L) ? p.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode : e.externalModuleIndicator ? p.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode : p.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5;
- }
- function of(L) {
- if (n < 2 && c.kind !== 307 && c.kind !== 267 && !lC(c)) {
- const Ce = tS(e, L);
- e.bindDiagnostics.push(fl(e, Ce.start, Ce.length, Wc(L)));
- }
- }
- function Ao(L) {
- q && Bt(L, L.operand);
- }
- function ge(L) {
- q && (L.operator === 46 || L.operator === 47) && Bt(L, L.operand);
- }
- function $(L) {
- q && Ct(L, p.with_statements_are_not_allowed_in_strict_mode);
- }
- function rt(L) {
- q && pa(t) >= 2 && (qY(L.statement) || yc(L.statement)) && Ct(L.label, p.A_label_is_not_allowed_here);
- }
- function Ct(L, Ce, ...yt) {
- const Mr = cm(e, L.pos);
- e.bindDiagnostics.push(fl(e, Mr.start, Mr.length, Ce, ...yt));
- }
- function $t(L, Ce, yt) {
- zr(L, Ce, Ce, yt);
- }
- function zr(L, Ce, yt, Mr) {
- $n(L, { pos: Oy(Ce, e), end: yt.end }, Mr);
- }
- function $n(L, Ce, yt) {
- const Mr = fl(e, Ce.pos, Ce.end - Ce.pos, yt);
- L ? e.bindDiagnostics.push(Mr) : e.bindSuggestionDiagnostics = wr(e.bindSuggestionDiagnostics, {
- ...Mr,
- category: 2
- /* Suggestion */
- });
- }
- function ar(L) {
- if (!L)
- return;
- Aa(L, i), rn && (L.tracingPath = e.path);
- const Ce = q;
- if (za(L), L.kind > 165) {
- const yt = i;
- i = L;
- const Mr = Uz(L);
- Mr === 0 ? Qe(L) : Te(L, Mr), i = yt;
- } else {
- const yt = i;
- L.kind === 1 && (i = L), An(L), i = yt;
- }
- q = Ce;
- }
- function An(L) {
- if (gf(L))
- if (cn(L))
- for (const Ce of L.jsDoc)
- ar(Ce);
- else
- for (const Ce of L.jsDoc)
- Aa(Ce, L), Nh(
- Ce,
- /*incremental*/
- !1
- );
- }
- function ri(L) {
- if (!q)
- for (const Ce of L) {
- if (!lm(Ce))
- return;
- if (Fi(Ce)) {
- q = !0;
- return;
- }
- }
- }
- function Fi(L) {
- const Ce = gb(e, L.expression);
- return Ce === '"use strict"' || Ce === "'use strict'";
- }
- function za(L) {
- switch (L.kind) {
- case 80:
- if (L.flags & 4096) {
- let ns = L.parent;
- for (; ns && !Bp(ns); )
- ns = ns.parent;
- ca(
- ns,
- 524288,
- 788968
- /* TypeAliasExcludes */
- );
- break;
- }
- case 110:
- return h && (_t(L) || i.kind === 304) && (L.flowNode = h), Cu(L);
- case 166:
- h && C7(L) && (L.flowNode = h);
- break;
- case 236:
- case 108:
- L.flowNode = h;
- break;
- case 81:
- return Yi(L);
- case 211:
- case 212:
- const Ce = L;
- h && Re(Ce) && (Ce.flowNode = h), JZ(Ce) && Pc(Ce), cn(Ce) && e.commonJsModuleIndicator && jg(Ce) && !BO(c, "module") && me(
- e.locals,
- /*parent*/
- void 0,
- Ce.expression,
- 134217729,
- 111550
- /* FunctionScopedVariableExcludes */
- );
- break;
- case 226:
- switch (Cc(L)) {
- case 1:
- Pe(L);
- break;
- case 2:
- Et(L);
- break;
- case 3:
- Va(L.left, L);
- break;
- case 6:
- yl(L);
- break;
- case 4:
- $i(L);
- break;
- case 5:
- const ns = L.left.expression;
- if (cn(L) && Oe(ns)) {
- const Ds = BO(c, ns.escapedText);
- if (T7(Ds?.valueDeclaration)) {
- $i(L);
- break;
- }
- }
- cf(L);
- break;
- case 0:
- break;
- default:
- E.fail("Unknown binary expression special property assignment kind");
- }
- return Na(L);
- case 299:
- return Ia(L);
- case 220:
- return Vi(L);
- case 225:
- return Ao(L);
- case 224:
- return ge(L);
- case 254:
- return $(L);
- case 256:
- return rt(L);
- case 197:
- d = !0;
- return;
- case 182:
- break;
- case 168:
- return Vr(L);
- case 169:
- return Y(L);
- case 260:
- return Vf(L);
- case 208:
- return L.flowNode = h, Vf(L);
- case 172:
- case 171:
- return Uo(L);
- case 303:
- case 304:
- return Mt(
- L,
- 4,
- 0
- /* PropertyExcludes */
- );
- case 306:
- return Mt(
- L,
- 8,
- 900095
- /* EnumMemberExcludes */
- );
- case 179:
- case 180:
- case 181:
- return mr(
- L,
- 131072,
- 0
- /* None */
- );
- case 174:
- case 173:
- return Mt(
- L,
- 8192 | (L.questionToken ? 16777216 : 0),
- jp(L) ? 0 : 103359
- /* MethodExcludes */
- );
- case 262:
- return st(L);
- case 176:
- return mr(
- L,
- 16384,
- /*symbolExcludes:*/
- 0
- /* None */
- );
- case 177:
- return Mt(
- L,
- 32768,
- 46015
- /* GetAccessorExcludes */
- );
- case 178:
- return Mt(
- L,
- 65536,
- 78783
- /* SetAccessorExcludes */
- );
- case 184:
- case 317:
- case 323:
- case 185:
- return Ua(L);
- case 187:
- case 322:
- case 200:
- return vc(L);
- case 332:
- return yr(L);
- case 210:
- return lc(L);
- case 218:
- case 219:
- return It(L);
- case 213:
- switch (Cc(L)) {
- case 7:
- return Uc(L);
- case 8:
- return hp(L);
- case 9:
- return so(L);
- case 0:
- break;
- default:
- return E.fail("Unknown call expression assignment declaration kind");
- }
- cn(L) && Uh(L);
- break;
- case 231:
- case 263:
- return q = !0, r_(L);
- case 264:
- return ca(
- L,
- 64,
- 788872
- /* InterfaceExcludes */
- );
- case 265:
- return ca(
- L,
- 524288,
- 788968
- /* TypeAliasExcludes */
- );
- case 266:
- return Zg(L);
- case 267:
- return gs(L);
- case 292:
- return Ic(L);
- case 291:
- return io(
- L,
- 4,
- 0
- /* PropertyExcludes */
- );
- case 271:
- case 274:
- case 276:
- case 281:
- return mr(
- L,
- 2097152,
- 2097152
- /* AliasExcludes */
- );
- case 270:
- return _c(L);
- case 273:
- return Lc(L);
- case 278:
- return Wf(L);
- case 277:
- return Lo(L);
- case 307:
- return ri(L.statements), Oc();
- case 241:
- if (!lC(L.parent))
- return;
- case 268:
- return ri(L.statements);
- case 341:
- if (L.parent.kind === 323)
- return Y(L);
- if (L.parent.kind !== 322)
- break;
- case 348:
- const hi = L, Es = hi.isBracketed || hi.typeExpression && hi.typeExpression.type.kind === 316 ? 16777220 : 4;
- return mr(
- hi,
- Es,
- 0
- /* PropertyExcludes */
- );
- case 346:
- case 338:
- case 340:
- return (u || (u = [])).push(L);
- case 339:
- return ar(L.typeExpression);
- case 351:
- return (g || (g = [])).push(L);
- }
- }
- function Uo(L) {
- const Ce = u_(L), yt = Ce ? 98304 : 4, Mr = Ce ? 13247 : 0;
- return Mt(L, yt | (L.questionToken ? 16777216 : 0), Mr);
- }
- function vc(L) {
- return vi(
- L,
- 2048,
- "__type"
- /* Type */
- );
- }
- function Oc() {
- if (Ss(e), il(e))
- Fc();
- else if (Rp(e)) {
- Fc();
- const L = e.symbol;
- me(
- e.symbol.exports,
- e.symbol,
- e,
- 4,
- -1
- /* All */
- ), e.symbol = L;
- }
- }
- function Fc() {
- vi(e, 512, `"${$u(e.fileName)}"`);
- }
- function Lo(L) {
- if (!s.symbol || !s.symbol.exports)
- vi(L, 111551, he(L));
- else {
- const Ce = h3(L) ? 2097152 : 4, yt = me(
- s.symbol.exports,
- s.symbol,
- L,
- Ce,
- -1
- /* All */
- );
- L.isExportEquals && l3(yt, L);
- }
- }
- function _c(L) {
- ut(L.modifiers) && e.bindDiagnostics.push(ie(L, p.Modifiers_cannot_appear_here));
- const Ce = Si(L.parent) ? il(L.parent) ? L.parent.isDeclarationFile ? void 0 : p.Global_module_exports_may_only_appear_in_declaration_files : p.Global_module_exports_may_only_appear_in_module_files : p.Global_module_exports_may_only_appear_at_top_level;
- Ce ? e.bindDiagnostics.push(ie(L, Ce)) : (e.symbol.globalExports = e.symbol.globalExports || Js(), me(
- e.symbol.globalExports,
- e.symbol,
- L,
- 2097152,
- 2097152
- /* AliasExcludes */
- ));
- }
- function Wf(L) {
- !s.symbol || !s.symbol.exports ? vi(L, 8388608, he(L)) : L.exportClause ? ug(L.exportClause) && (Aa(L.exportClause, L), me(
- s.symbol.exports,
- s.symbol,
- L.exportClause,
- 2097152,
- 2097152
- /* AliasExcludes */
- )) : me(
- s.symbol.exports,
- s.symbol,
- L,
- 8388608,
- 0
- /* None */
- );
- }
- function Lc(L) {
- L.name && mr(
- L,
- 2097152,
- 2097152
- /* AliasExcludes */
- );
- }
- function al(L) {
- return e.externalModuleIndicator && e.externalModuleIndicator !== !0 ? !1 : (e.commonJsModuleIndicator || (e.commonJsModuleIndicator = L, e.externalModuleIndicator || Fc()), !0);
- }
- function hp(L) {
- if (!al(L))
- return;
- const Ce = vl(
- L.arguments[0],
- /*parent*/
- void 0,
- (yt, Mr) => (Mr && _e(
- Mr,
- yt,
- 67110400
- /* Assignment */
- ), Mr)
- );
- Ce && me(
- Ce.exports,
- Ce,
- L,
- 1048580,
- 0
- /* None */
- );
- }
- function Pe(L) {
- if (!al(L))
- return;
- const Ce = vl(
- L.left.expression,
- /*parent*/
- void 0,
- (yt, Mr) => (Mr && _e(
- Mr,
- yt,
- 67110400
- /* Assignment */
- ), Mr)
- );
- if (Ce) {
- const Mr = O7(L.right) && (iS(L.left.expression) || jg(L.left.expression)) ? 2097152 : 1048580;
- Aa(L.left, L), me(
- Ce.exports,
- Ce,
- L.left,
- Mr,
- 0
- /* None */
- );
- }
- }
- function Et(L) {
- if (!al(L))
- return;
- const Ce = s3(L.right);
- if (jB(Ce) || s === e && qb(e, Ce))
- return;
- if (Ks(Ce) && Mi(Ce.properties, uu)) {
- ir(Ce.properties, Lr);
- return;
- }
- const yt = h3(L) ? 2097152 : 1049092, Mr = me(
- e.symbol.exports,
- e.symbol,
- L,
- yt | 67108864,
- 0
- /* None */
- );
- l3(Mr, L);
- }
- function Lr(L) {
- me(
- e.symbol.exports,
- e.symbol,
- L,
- 69206016,
- 0
- /* None */
- );
- }
- function $i(L) {
- if (E.assert(cn(L)), dn(L) && Cn(L.left) && Di(L.left.name) || Cn(L) && Di(L.name))
- return;
- const yt = Lu(
- L,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- switch (yt.kind) {
- case 262:
- case 218:
- let Mr = yt.symbol;
- if (dn(yt.parent) && yt.parent.operatorToken.kind === 64) {
- const ns = yt.parent.left;
- Tb(ns) && Ry(ns.expression) && (Mr = y_(ns.expression.expression, o));
- }
- Mr && Mr.valueDeclaration && (Mr.members = Mr.members || Js(), Dh(L) ? Sa(L, Mr, Mr.members) : me(
- Mr.members,
- Mr,
- L,
- 67108868,
- 0
- /* Property */
- ), _e(
- Mr,
- Mr.valueDeclaration,
- 32
- /* Class */
- ));
- break;
- case 176:
- case 172:
- case 174:
- case 177:
- case 178:
- case 175:
- const hi = yt.parent, Es = zs(yt) ? hi.symbol.exports : hi.symbol.members;
- Dh(L) ? Sa(L, hi.symbol, Es) : me(
- Es,
- hi.symbol,
- L,
- 67108868,
- 0,
- /*isReplaceableByMethod*/
- !0
- );
- break;
- case 307:
- if (Dh(L))
- break;
- yt.commonJsModuleIndicator ? me(
- yt.symbol.exports,
- yt.symbol,
- L,
- 1048580,
- 0
- /* None */
- ) : mr(
- L,
- 1,
- 111550
- /* FunctionScopedVariableExcludes */
- );
- break;
- case 267:
- break;
- default:
- E.failBadSyntaxKind(yt);
- }
- }
- function Sa(L, Ce, yt) {
- me(
- yt,
- Ce,
- L,
- 4,
- 0,
- /*isReplaceableByMethod*/
- !0,
- /*isComputedName*/
- !0
- ), ka(L, Ce);
- }
- function ka(L, Ce) {
- Ce && (Ce.assignmentDeclarationMembers || (Ce.assignmentDeclarationMembers = /* @__PURE__ */ new Map())).set(Ma(L), L);
- }
- function Pc(L) {
- L.expression.kind === 110 ? $i(L) : Tb(L) && L.parent.parent.kind === 307 && (Ry(L.expression) ? Va(L, L.parent) : Xp(L));
- }
- function yl(L) {
- Aa(L.left, L), Aa(L.right, L), yp(
- L.left.expression,
- L.left,
- /*isPrototypeProperty*/
- !1,
- /*containerIsClass*/
- !0
- );
- }
- function so(L) {
- const Ce = y_(L.arguments[0].expression);
- Ce && Ce.valueDeclaration && _e(
- Ce,
- Ce.valueDeclaration,
- 32
- /* Class */
- ), Sf(
- L,
- Ce,
- /*isPrototypeProperty*/
- !0
- );
- }
- function Va(L, Ce) {
- const yt = L.expression, Mr = yt.expression;
- Aa(Mr, yt), Aa(yt, L), Aa(L, Ce), yp(
- Mr,
- L,
- /*isPrototypeProperty*/
- !0,
- /*containerIsClass*/
- !0
- );
- }
- function Uc(L) {
- let Ce = y_(L.arguments[0]);
- const yt = L.parent.parent.kind === 307;
- Ce = A_(
- Ce,
- L.arguments[0],
- yt,
- /*isPrototypeProperty*/
- !1,
- /*containerIsClass*/
- !1
- ), Sf(
- L,
- Ce,
- /*isPrototypeProperty*/
- !1
- );
- }
- function cf(L) {
- var Ce;
- const yt = y_(L.left.expression, c) || y_(L.left.expression, s);
- if (!cn(L) && !zZ(yt))
- return;
- const Mr = LC(L.left);
- if (!(Oe(Mr) && ((Ce = BO(s, Mr.escapedText)) == null ? void 0 : Ce.flags) & 2097152))
- if (Aa(L.left, L), Aa(L.right, L), Oe(L.left.expression) && s === e && qb(e, L.left.expression))
- Pe(L);
- else if (Dh(L)) {
- vi(
- L,
- 67108868,
- "__computed"
- /* Computed */
- );
- const hi = A_(
- yt,
- L.left.expression,
- Uf(L.left),
- /*isPrototypeProperty*/
- !1,
- /*containerIsClass*/
- !1
- );
- ka(L, hi);
- } else
- Xp(Bs(L.left, aS));
- }
- function Xp(L) {
- E.assert(!Oe(L)), Aa(L.expression, L), yp(
- L.expression,
- L,
- /*isPrototypeProperty*/
- !1,
- /*containerIsClass*/
- !1
- );
- }
- function A_(L, Ce, yt, Mr, hi) {
- return L?.flags & 2097152 || (yt && !Mr && (L = vl(Ce, L, (Ds, Pa, ga) => {
- if (Pa)
- return _e(Pa, Ds, 67110400), Pa;
- {
- const $o = ga ? ga.exports : e.jsGlobalAugmentations || (e.jsGlobalAugmentations = Js());
- return me($o, ga, Ds, 67110400, 110735);
- }
- })), hi && L && L.valueDeclaration && _e(
- L,
- L.valueDeclaration,
- 32
- /* Class */
- )), L;
- }
- function Sf(L, Ce, yt) {
- if (!Ce || !Yg(Ce))
- return;
- const Mr = yt ? Ce.members || (Ce.members = Js()) : Ce.exports || (Ce.exports = Js());
- let hi = 0, Es = 0;
- no(ZT(L)) ? (hi = 8192, Es = 103359) : Fs(L) && sS(L) && (ut(L.arguments[2].properties, (ns) => {
- const Ds = os(ns);
- return !!Ds && Oe(Ds) && Nn(Ds) === "set";
- }) && (hi |= 65540, Es |= 78783), ut(L.arguments[2].properties, (ns) => {
- const Ds = os(ns);
- return !!Ds && Oe(Ds) && Nn(Ds) === "get";
- }) && (hi |= 32772, Es |= 46015)), hi === 0 && (hi = 4, Es = 0), me(
- Mr,
- Ce,
- L,
- hi | 67108864,
- Es & -67108865
- /* Assignment */
- );
- }
- function Uf(L) {
- return dn(L.parent) ? Qp(L.parent).parent.kind === 307 : L.parent.parent.kind === 307;
- }
- function yp(L, Ce, yt, Mr) {
- let hi = y_(L, c) || y_(L, s);
- const Es = Uf(Ce);
- hi = A_(hi, Ce.expression, Es, yt, Mr), Sf(Ce, hi, yt);
- }
- function Yg(L) {
- if (L.flags & 1072)
- return !0;
- const Ce = L.valueDeclaration;
- if (Ce && Fs(Ce))
- return !!ZT(Ce);
- let yt = Ce ? ii(Ce) ? Ce.initializer : dn(Ce) ? Ce.right : Cn(Ce) && dn(Ce.parent) ? Ce.parent.right : void 0 : void 0;
- if (yt = yt && s3(yt), yt) {
- const Mr = Ry(ii(Ce) ? Ce.name : dn(Ce) ? Ce.left : Ce);
- return !!K1(dn(yt) && (yt.operatorToken.kind === 57 || yt.operatorToken.kind === 61) ? yt.right : yt, Mr);
- }
- return !1;
- }
- function Qp(L) {
- for (; dn(L.parent); )
- L = L.parent;
- return L.parent;
- }
- function y_(L, Ce = s) {
- if (Oe(L))
- return BO(Ce, L.escapedText);
- {
- const yt = y_(L.expression);
- return yt && yt.exports && yt.exports.get(Eh(L));
- }
- }
- function vl(L, Ce, yt) {
- if (qb(e, L))
- return e.symbol;
- if (Oe(L))
- return yt(L, y_(L), Ce);
- {
- const Mr = vl(L.expression, Ce, yt), hi = a3(L);
- return Di(hi) && E.fail("unexpected PrivateIdentifier"), yt(hi, Mr && Mr.exports && Mr.exports.get(Eh(L)), Mr);
- }
- }
- function Uh(L) {
- !e.commonJsModuleIndicator && f_(
- L,
- /*requireStringLiteralLikeArgument*/
- !1
- ) && al(L);
- }
- function r_(L) {
- if (L.kind === 263)
- ca(
- L,
- 32,
- 899503
- /* ClassExcludes */
- );
- else {
- const hi = L.name ? L.name.escapedText : "__class";
- vi(L, 32, hi), L.name && G.add(L.name.escapedText);
- }
- const { symbol: Ce } = L, yt = oe(4194308, "prototype"), Mr = Ce.exports.get(yt.escapedName);
- Mr && (L.name && Aa(L.name, L), e.bindDiagnostics.push(ie(Mr.declarations[0], p.Duplicate_identifier_0, mc(yt)))), Ce.exports.set(yt.escapedName, yt), yt.parent = Ce;
- }
- function Zg(L) {
- return Y1(L) ? ca(
- L,
- 128,
- 899967
- /* ConstEnumExcludes */
- ) : ca(
- L,
- 256,
- 899327
- /* RegularEnumExcludes */
- );
- }
- function Vf(L) {
- if (q && Bt(L, L.name), !As(L.name)) {
- const Ce = L.kind === 260 ? L : L.parent.parent;
- cn(L) && Sb(Ce) && !V1(L) && !(U1(L) & 32) ? mr(
- L,
- 2097152,
- 2097152
- /* AliasExcludes */
- ) : Jj(L) ? ca(
- L,
- 2,
- 111551
- /* BlockScopedVariableExcludes */
- ) : iv(L) ? mr(
- L,
- 1,
- 111551
- /* ParameterExcludes */
- ) : mr(
- L,
- 1,
- 111550
- /* FunctionScopedVariableExcludes */
- );
- }
- }
- function Y(L) {
- if (!(L.kind === 341 && s.kind !== 323) && (q && !(L.flags & 33554432) && Bt(L, L.name), As(L.name) ? vi(L, 1, "__" + L.parent.parameters.indexOf(L)) : mr(
- L,
- 1,
- 111551
- /* ParameterExcludes */
- ), G_(L, L.parent))) {
- const Ce = L.parent.parent;
- me(
- Ce.symbol.members,
- Ce.symbol,
- L,
- 4 | (L.questionToken ? 16777216 : 0),
- 0
- /* PropertyExcludes */
- );
- }
- }
- function st(L) {
- !e.isDeclarationFile && !(L.flags & 33554432) && k4(L) && (X |= 4096), _u(L), q ? (of(L), ca(
- L,
- 16,
- 110991
- /* FunctionExcludes */
- )) : mr(
- L,
- 16,
- 110991
- /* FunctionExcludes */
- );
- }
- function It(L) {
- !e.isDeclarationFile && !(L.flags & 33554432) && k4(L) && (X |= 4096), h && (L.flowNode = h), _u(L);
- const Ce = L.name ? L.name.escapedText : "__function";
- return vi(L, 16, Ce);
- }
- function Mt(L, Ce, yt) {
- return !e.isDeclarationFile && !(L.flags & 33554432) && k4(L) && (X |= 4096), h && h7(L) && (L.flowNode = h), Dh(L) ? vi(
- L,
- Ce,
- "__computed"
- /* Computed */
- ) : mr(L, Ce, yt);
- }
- function Sr(L) {
- const Ce = or(L, (yt) => yt.parent && Mb(yt.parent) && yt.parent.extendsType === yt);
- return Ce && Ce.parent;
- }
- function Vr(L) {
- if (qp(L.parent)) {
- const Ce = I7(L.parent);
- Ce ? (E.assertNode(Ce, tg), Ce.locals ?? (Ce.locals = Js()), me(
- Ce.locals,
- /*parent*/
- void 0,
- L,
- 262144,
- 526824
- /* TypeParameterExcludes */
- )) : mr(
- L,
- 262144,
- 526824
- /* TypeParameterExcludes */
- );
- } else if (L.parent.kind === 195) {
- const Ce = Sr(L.parent);
- Ce ? (E.assertNode(Ce, tg), Ce.locals ?? (Ce.locals = Js()), me(
- Ce.locals,
- /*parent*/
- void 0,
- L,
- 262144,
- 526824
- /* TypeParameterExcludes */
- )) : vi(L, 262144, he(L));
- } else
- mr(
- L,
- 262144,
- 526824
- /* TypeParameterExcludes */
- );
- }
- function En(L) {
- const Ce = Rh(L);
- return Ce === 1 || Ce === 2 && jy(t);
- }
- function si(L) {
- if (!(h.flags & 1))
- return !1;
- if (h === ue && // report error on all statements except empty ones
- (Lw(L) && L.kind !== 242 || // report error on class declarations
- L.kind === 263 || // report errors on enums with preserved emit
- yye(L, t) || // report error on instantiated modules
- L.kind === 267 && En(L)) && (h = re, !t.allowUnreachableCode)) {
- const yt = BK(t) && !(L.flags & 33554432) && (!yc(L) || !!(xh(L.declarationList) & 7) || L.declarationList.declarations.some((Mr) => !!Mr.initializer));
- GLe(L, t, (Mr, hi) => zr(yt, Mr, hi, p.Unreachable_code_detected));
- }
- return !0;
- }
- }
- function yye(e, t) {
- return e.kind === 266 && (!Y1(e) || jy(t));
- }
- function GLe(e, t, n) {
- if (bi(e) && i(e) && Cs(e.parent)) {
- const { statements: o } = e.parent, c = cJ(o, e);
- oR(c, i, (_, u) => n(c[_], c[u - 1]));
- } else
- n(e, e);
- function i(o) {
- return !Ec(o) && !s(o) && // `var x;` may declare a variable used above
- !(yc(o) && !(xh(o) & 7) && o.declarationList.declarations.some((c) => !c.initializer));
- }
- function s(o) {
- switch (o.kind) {
- case 264:
- case 265:
- return !0;
- case 267:
- return Rh(o) !== 1;
- case 266:
- return !yye(o, t);
- default:
- return !1;
- }
- }
- }
- function qb(e, t) {
- let n = 0;
- const i = iw();
- for (i.enqueue(t); !i.isEmpty() && n < 100; ) {
- if (n++, t = i.dequeue(), iS(t) || jg(t))
- return !0;
- if (Oe(t)) {
- const s = BO(e, t.escapedText);
- if (s && s.valueDeclaration && ii(s.valueDeclaration) && s.valueDeclaration.initializer) {
- const o = s.valueDeclaration.initializer;
- i.enqueue(o), Dl(
- o,
- /*excludeCompoundAssignment*/
- !0
- ) && (i.enqueue(o.left), i.enqueue(o.right));
- }
- }
- }
- return !1;
- }
- function Uz(e) {
- switch (e.kind) {
- case 231:
- case 263:
- case 266:
- case 210:
- case 187:
- case 322:
- case 292:
- return 1;
- case 264:
- return 65;
- case 267:
- case 265:
- case 200:
- case 181:
- return 33;
- case 307:
- return 37;
- case 177:
- case 178:
- case 174:
- if (h7(e))
- return 173;
- case 176:
- case 262:
- case 173:
- case 179:
- case 323:
- case 317:
- case 184:
- case 180:
- case 185:
- case 175:
- return 45;
- case 218:
- case 219:
- return 61;
- case 268:
- return 4;
- case 172:
- return e.initializer ? 4 : 0;
- case 299:
- case 248:
- case 249:
- case 250:
- case 269:
- return 34;
- case 241:
- return ys(e.parent) || oc(e.parent) ? 0 : 34;
- }
- return 0;
- }
- function BO(e, t) {
- var n, i, s, o;
- const c = (i = (n = Wn(e, tg)) == null ? void 0 : n.locals) == null ? void 0 : i.get(t);
- if (c)
- return c.exportSymbol ?? c;
- if (Si(e) && e.jsGlobalAugmentations && e.jsGlobalAugmentations.has(t))
- return e.jsGlobalAugmentations.get(t);
- if (kd(e))
- return (o = (s = e.symbol) == null ? void 0 : s.exports) == null ? void 0 : o.get(t);
- }
- function Are(e, t, n, i, s, o, c, _, u, d) {
- return g;
- function g(h = () => !0) {
- const S = [], T = [];
- return {
- walkType: (ae) => {
- try {
- return C(ae), { visitedTypes: OT(S), visitedSymbols: OT(T) };
- } finally {
- Ap(S), Ap(T);
- }
- },
- walkSymbol: (ae) => {
- try {
- return V(ae), { visitedTypes: OT(S), visitedSymbols: OT(T) };
- } finally {
- Ap(S), Ap(T);
- }
- }
- };
- function C(ae) {
- if (!(!ae || S[ae.id] || (S[ae.id] = ae, V(ae.symbol)))) {
- if (ae.flags & 524288) {
- const G = ae, ue = G.objectFlags;
- ue & 4 && D(ae), ue & 32 && B(ae), ue & 3 && X(ae), ue & 24 && q(G);
- }
- ae.flags & 262144 && P(ae), ae.flags & 3145728 && I(ae), ae.flags & 4194304 && F(ae), ae.flags & 8388608 && O(ae);
- }
- }
- function D(ae) {
- C(ae.target), ir(d(ae), C);
- }
- function P(ae) {
- C(_(ae));
- }
- function I(ae) {
- ir(ae.types, C);
- }
- function F(ae) {
- C(ae.type);
- }
- function O(ae) {
- C(ae.objectType), C(ae.indexType), C(ae.constraint);
- }
- function B(ae) {
- C(ae.typeParameter), C(ae.constraintType), C(ae.templateType), C(ae.modifiersType);
- }
- function z(ae) {
- const ee = t(ae);
- ee && C(ee.type), ir(ae.typeParameters, C);
- for (const G of ae.parameters)
- V(G);
- C(e(ae)), C(n(ae));
- }
- function X(ae) {
- q(ae), ir(ae.typeParameters, C), ir(i(ae), C), C(ae.thisType);
- }
- function q(ae) {
- const ee = s(ae);
- for (const G of ee.indexInfos)
- C(G.keyType), C(G.type);
- for (const G of ee.callSignatures)
- z(G);
- for (const G of ee.constructSignatures)
- z(G);
- for (const G of ee.properties)
- V(G);
- }
- function V(ae) {
- if (!ae)
- return !1;
- const ee = na(ae);
- if (T[ee])
- return !1;
- if (T[ee] = ae, !h(ae))
- return !0;
- const G = o(ae);
- return C(G), ae.exports && ae.exports.forEach(V), ir(ae.declarations, (ue) => {
- if (ue.type && ue.type.kind === 186) {
- const re = ue.type, ne = c(u(re.exprName));
- V(ne);
- }
- }), !1;
- }
- }
- }
- var N0 = {};
- La(N0, {
- RelativePreference: () => vye,
- countPathComponents: () => WO,
- forEachFileNameOfModule: () => Cye,
- getLocalModuleSpecifierBetweenFileNames: () => KLe,
- getModuleSpecifier: () => QLe,
- getModuleSpecifierPreferences: () => DA,
- getModuleSpecifiers: () => Tye,
- getModuleSpecifiersWithCacheInfo: () => xye,
- getNodeModulesPackageName: () => YLe,
- tryGetJSExtensionForFile: () => qz,
- tryGetModuleSpecifiersFromCache: () => ZLe,
- tryGetRealFileNameForNonJsDeclarationFileName: () => Aye,
- updateModuleSpecifier: () => XLe
- });
- var $Le = im((e) => {
- try {
- let t = e.indexOf("/");
- if (t !== 0)
- return new RegExp(e);
- const n = e.lastIndexOf("/");
- if (t === n)
- return new RegExp(e);
- for (; (t = e.indexOf("/", t + 1)) !== n; )
- if (e[t - 1] !== "\\")
- return new RegExp(e);
- const i = e.substring(n + 1).replace(/[^iu]/g, "");
- return e = e.substring(1, n), new RegExp(e, i);
- } catch {
- return;
- }
- }), vye = /* @__PURE__ */ ((e) => (e[e.Relative = 0] = "Relative", e[e.NonRelative = 1] = "NonRelative", e[e.Shortest = 2] = "Shortest", e[e.ExternalNonRelative = 3] = "ExternalNonRelative", e))(vye || {});
- function DA({ importModuleSpecifierPreference: e, importModuleSpecifierEnding: t, autoImportSpecifierExcludeRegexes: n }, i, s, o, c) {
- const _ = u();
- return {
- excludeRegexes: n,
- relativePreference: c !== void 0 ? Sl(c) ? 0 : 1 : e === "relative" ? 0 : e === "non-relative" ? 1 : e === "project-relative" ? 3 : 2,
- getAllowedEndingsInPreferredOrder: (d) => {
- const g = Hz(o, i, s), h = d !== g ? u(d) : _, S = yu(s);
- if ((d ?? g) === 99 && 3 <= S && S <= 99)
- return u6(s, o.fileName) ? [
- 3,
- 2
- /* JsExtension */
- ] : [
- 2
- /* JsExtension */
- ];
- if (yu(s) === 1)
- return h === 2 ? [
- 2,
- 1
- /* Index */
- ] : [
- 1,
- 2
- /* JsExtension */
- ];
- const T = u6(s, o.fileName);
- switch (h) {
- case 2:
- return T ? [
- 2,
- 3,
- 0,
- 1
- /* Index */
- ] : [
- 2,
- 0,
- 1
- /* Index */
- ];
- case 3:
- return [
- 3,
- 0,
- 2,
- 1
- /* Index */
- ];
- case 1:
- return T ? [
- 1,
- 0,
- 3,
- 2
- /* JsExtension */
- ] : [
- 1,
- 0,
- 2
- /* JsExtension */
- ];
- case 0:
- return T ? [
- 0,
- 1,
- 3,
- 2
- /* JsExtension */
- ] : [
- 0,
- 1,
- 2
- /* JsExtension */
- ];
- default:
- E.assertNever(h);
- }
- }
- };
- function u(d) {
- if (c !== void 0) {
- if (Ug(c)) return 2;
- if (Zo(c, "/index")) return 1;
- }
- return YK(
- t,
- d ?? Hz(o, i, s),
- s,
- sg(o) ? o : void 0
- );
- }
- }
- function XLe(e, t, n, i, s, o, c = {}) {
- const _ = bye(e, t, n, i, s, DA({}, s, e, t, o), {}, c);
- if (_ !== o)
- return _;
- }
- function QLe(e, t, n, i, s, o = {}) {
- return bye(e, t, n, i, s, DA({}, s, e, t), {}, o);
- }
- function YLe(e, t, n, i, s, o = {}) {
- const c = zO(t.fileName, i), _ = Eye(c, n, i, s, e, o);
- return Tc(_, (u) => Ore(
- u,
- c,
- t,
- i,
- e,
- s,
- /*packageNameOnly*/
- !0,
- o.overrideImportMode
- ));
- }
- function bye(e, t, n, i, s, o, c, _ = {}) {
- const u = zO(n, s), d = Eye(u, i, s, c, e, _);
- return Tc(d, (g) => Ore(
- g,
- u,
- t,
- s,
- e,
- c,
- /*packageNameOnly*/
- void 0,
- _.overrideImportMode
- )) || Nre(i, u, e, s, _.overrideImportMode || Hz(t, s, e), o);
- }
- function ZLe(e, t, n, i, s = {}) {
- const o = Sye(
- e,
- t,
- n,
- i,
- s
- );
- return o[1] && { kind: o[0], moduleSpecifiers: o[1], computedWithoutCache: !1 };
- }
- function Sye(e, t, n, i, s = {}) {
- var o;
- const c = s7(e);
- if (!c)
- return Ue;
- const _ = (o = n.getModuleSpecifierCache) == null ? void 0 : o.call(n), u = _?.get(t.path, c.path, i, s);
- return [u?.kind, u?.moduleSpecifiers, c, u?.modulePaths, _];
- }
- function Tye(e, t, n, i, s, o, c = {}) {
- return xye(
- e,
- t,
- n,
- i,
- s,
- o,
- c,
- /*forAutoImport*/
- !1
- ).moduleSpecifiers;
- }
- function xye(e, t, n, i, s, o, c = {}, _) {
- let u = !1;
- const d = iMe(e, t);
- if (d)
- return {
- kind: "ambient",
- moduleSpecifiers: _ && JO(d, o.autoImportSpecifierExcludeRegexes) ? Ue : [d],
- computedWithoutCache: u
- };
- let [g, h, S, T, C] = Sye(
- e,
- i,
- s,
- o,
- c
- );
- if (h) return { kind: g, moduleSpecifiers: h, computedWithoutCache: u };
- if (!S) return { kind: void 0, moduleSpecifiers: Ue, computedWithoutCache: u };
- u = !0, T || (T = Dye(zO(i.fileName, s), S.originalFileName, s, n, c));
- const D = eMe(
- T,
- n,
- i,
- s,
- o,
- c,
- _
- );
- return C?.set(i.path, S.path, o, c, D.kind, T, D.moduleSpecifiers), D;
- }
- function KLe(e, t, n, i, s, o = {}) {
- const c = zO(e.fileName, i), _ = o.overrideImportMode ?? e.impliedNodeFormat;
- return Nre(
- t,
- c,
- n,
- i,
- _,
- DA(s, i, n, e)
- );
- }
- function eMe(e, t, n, i, s, o = {}, c) {
- const _ = zO(n.fileName, i), u = DA(s, i, t, n), d = sg(n) && ir(e, (D) => ir(
- i.getFileIncludeReasons().get(uo(D.path, i.getCurrentDirectory(), _.getCanonicalFileName)),
- (P) => {
- if (P.kind !== 3 || P.file !== n.path) return;
- const I = i.getModeForResolutionAtIndex(n, P.index), F = o.overrideImportMode ?? i.getDefaultResolutionModeForFile(n);
- if (I !== F && I !== void 0 && F !== void 0)
- return;
- const O = UA(n, P.index).text;
- return u.relativePreference !== 1 || !If(O) ? O : void 0;
- }
- ));
- if (d)
- return { kind: void 0, moduleSpecifiers: [d], computedWithoutCache: !0 };
- const g = ut(e, (D) => D.isInNodeModules);
- let h, S, T, C;
- for (const D of e) {
- const P = D.isInNodeModules ? Ore(
- D,
- _,
- n,
- i,
- t,
- s,
- /*packageNameOnly*/
- void 0,
- o.overrideImportMode
- ) : void 0;
- if (P && !(c && JO(P, u.excludeRegexes)) && (h = wr(h, P), D.isRedirect))
- return { kind: "node_modules", moduleSpecifiers: h, computedWithoutCache: !0 };
- if (!P) {
- const I = Nre(
- D.path,
- _,
- t,
- i,
- o.overrideImportMode || n.impliedNodeFormat,
- u,
- /*pathsOnly*/
- D.isRedirect
- );
- if (!I || c && JO(I, u.excludeRegexes))
- continue;
- D.isRedirect ? T = wr(T, I) : YR(I) ? Yy(I) ? C = wr(C, I) : S = wr(S, I) : (c || !g || D.isInNodeModules) && (C = wr(C, I));
- }
- }
- return S?.length ? { kind: "paths", moduleSpecifiers: S, computedWithoutCache: !0 } : T?.length ? { kind: "redirect", moduleSpecifiers: T, computedWithoutCache: !0 } : h?.length ? { kind: "node_modules", moduleSpecifiers: h, computedWithoutCache: !0 } : { kind: "relative", moduleSpecifiers: C ?? Ue, computedWithoutCache: !0 };
- }
- function JO(e, t) {
- return ut(t, (n) => {
- var i;
- return !!((i = $Le(n)) != null && i.test(e));
- });
- }
- function zO(e, t) {
- e = es(e, t.getCurrentDirectory());
- const n = zl(t.useCaseSensitiveFileNames ? t.useCaseSensitiveFileNames() : !0), i = Xn(e);
- return {
- getCanonicalFileName: n,
- importingSourceFileName: e,
- sourceDirectory: i,
- canonicalSourceDirectory: n(i)
- };
- }
- function Nre(e, t, n, i, s, { getAllowedEndingsInPreferredOrder: o, relativePreference: c, excludeRegexes: _ }, u) {
- const { baseUrl: d, paths: g, rootDirs: h } = n;
- if (u && !g)
- return;
- const { sourceDirectory: S, canonicalSourceDirectory: T, getCanonicalFileName: C } = t, D = o(s), P = h && oMe(h, e, S, C, D, n) || PA(q2(ld(S, e, C)), D, n);
- if (!d && !g && !c5(n) || c === 0)
- return u ? void 0 : P;
- const I = es(U7(n, i) || d, i.getCurrentDirectory()), F = Nye(e, I, C);
- if (!F)
- return u ? void 0 : P;
- const O = u ? void 0 : aMe(
- e,
- S,
- n,
- i,
- s,
- lMe(D)
- ), B = u || O === void 0 ? g && Pye(F, g, D, i, n) : void 0;
- if (u)
- return B;
- const z = O ?? (B === void 0 && d !== void 0 ? PA(F, D, n) : B);
- if (!z)
- return P;
- const X = JO(P, _), q = JO(z, _);
- if (!X && q)
- return P;
- if (X && !q || c === 1 && !If(z))
- return z;
- if (c === 3 && !If(z)) {
- const V = n.configFilePath ? uo(Xn(n.configFilePath), i.getCurrentDirectory(), t.getCanonicalFileName) : t.getCanonicalFileName(i.getCurrentDirectory()), ae = uo(e, V, C), ee = Ui(T, V), G = Ui(ae, V);
- if (ee && !G || !ee && G)
- return z;
- const ue = Ire(i, Xn(ae)), re = Ire(i, S), ne = !sx(i);
- return tMe(ue, re, ne) ? P : z;
- }
- return Iye(z) || WO(P) < WO(z) ? P : z;
- }
- function tMe(e, t, n) {
- return e === t ? !0 : e === void 0 || t === void 0 ? !1 : Sh(e, t, n) === 0;
- }
- function WO(e) {
- let t = 0;
- for (let n = Ui(e, "./") ? 2 : 0; n < e.length; n++)
- e.charCodeAt(n) === 47 && t++;
- return t;
- }
- function kye(e, t) {
- return J1(t.isRedirect, e.isRedirect) || z3(e.path, t.path);
- }
- function Ire(e, t) {
- return e.getNearestAncestorDirectoryWithPackageJson ? e.getNearestAncestorDirectoryWithPackageJson(t) : Fp(t, (n) => e.fileExists(Bn(n, "package.json")) ? n : void 0);
- }
- function Cye(e, t, n, i, s) {
- var o;
- const c = S0(n), _ = n.getCurrentDirectory(), u = n.isSourceOfProjectReferenceRedirect(t) ? n.getProjectReferenceRedirect(t) : void 0, d = uo(t, _, c), g = n.redirectTargetsMap.get(d) || Ue, S = [...u ? [u] : Ue, t, ...g].map((I) => es(I, _));
- let T = !Mi(S, H4);
- if (!i) {
- const I = ir(S, (F) => !(T && H4(F)) && s(F, u === F));
- if (I) return I;
- }
- const C = (o = n.getSymlinkCache) == null ? void 0 : o.call(n).getSymlinkedDirectoriesByRealpath(), D = es(t, _);
- return C && Fp(Xn(D), (I) => {
- const F = C.get(ul(uo(I, _, c)));
- if (F)
- return ej(e, I, c) ? !1 : ir(S, (O) => {
- if (!ej(O, I, c))
- return;
- const B = ld(I, O, c);
- for (const z of F) {
- const X = z1(z, B), q = s(X, O === u);
- if (T = !0, q) return q;
- }
- });
- }) || (i ? ir(S, (I) => T && H4(I) ? void 0 : s(I, I === u)) : void 0);
- }
- function Eye(e, t, n, i, s, o = {}) {
- var c;
- const _ = uo(e.importingSourceFileName, n.getCurrentDirectory(), S0(n)), u = uo(t, n.getCurrentDirectory(), S0(n)), d = (c = n.getModuleSpecifierCache) == null ? void 0 : c.call(n);
- if (d) {
- const h = d.get(_, u, i, o);
- if (h?.modulePaths) return h.modulePaths;
- }
- const g = Dye(e, t, n, s, o);
- return d && d.setModulePaths(_, u, i, o, g), g;
- }
- var rMe = ["dependencies", "peerDependencies", "optionalDependencies"];
- function nMe(e) {
- let t;
- for (const n of rMe) {
- const i = e[n];
- i && typeof i == "object" && (t = Qi(t, rm(i)));
- }
- return t;
- }
- function Dye(e, t, n, i, s) {
- var o, c;
- const _ = (o = n.getModuleResolutionCache) == null ? void 0 : o.call(n), u = (c = n.getSymlinkCache) == null ? void 0 : c.call(n);
- if (_ && u && n.readFile && !Yy(e.importingSourceFileName)) {
- E.type(n);
- const h = kD(_.getPackageJsonInfoCache(), n, {}), S = CD(Xn(e.importingSourceFileName), h);
- if (S) {
- const T = nMe(S.contents.packageJsonContent);
- for (const C of T || Ue) {
- const D = Vx(
- C,
- Bn(S.packageDirectory, "package.json"),
- i,
- n,
- _,
- /*redirectedReference*/
- void 0,
- s.overrideImportMode
- );
- u.setSymlinksFromResolution(D.resolvedModule);
- }
- }
- }
- const d = /* @__PURE__ */ new Map();
- Cye(
- e.importingSourceFileName,
- t,
- n,
- /*preferSymlinks*/
- !0,
- (h, S) => {
- const T = Yy(h);
- d.set(h, { path: e.getCanonicalFileName(h), isRedirect: S, isInNodeModules: T });
- }
- );
- const g = [];
- for (let h = e.canonicalSourceDirectory; d.size !== 0; ) {
- const S = ul(h);
- let T;
- d.forEach(({ path: D, isRedirect: P, isInNodeModules: I }, F) => {
- Ui(D, S) && ((T || (T = [])).push({ path: F, isRedirect: P, isInNodeModules: I }), d.delete(F));
- }), T && (T.length > 1 && T.sort(kye), g.push(...T));
- const C = Xn(h);
- if (C === h) break;
- h = C;
- }
- if (d.size) {
- const h = as(
- d.entries(),
- ([S, { isRedirect: T, isInNodeModules: C }]) => ({ path: S, isRedirect: T, isInNodeModules: C })
- );
- h.length > 1 && h.sort(kye), g.push(...h);
- }
- return g;
- }
- function iMe(e, t) {
- var n;
- const i = (n = e.declarations) == null ? void 0 : n.find(
- (c) => Wj(c) && (!yb(c) || !Sl(Jp(c.name)))
- );
- if (i)
- return i.name.text;
- const o = Ai(e.declarations, (c) => {
- var _, u, d, g;
- if (!zc(c)) return;
- const h = D(c);
- if (!((_ = h?.parent) != null && _.parent && Sm(h.parent) && Fu(h.parent.parent) && Si(h.parent.parent.parent))) return;
- const S = (g = (d = (u = h.parent.parent.symbol.exports) == null ? void 0 : u.get("export=")) == null ? void 0 : d.valueDeclaration) == null ? void 0 : g.expression;
- if (!S) return;
- const T = t.getSymbolAtLocation(S);
- if (!T) return;
- if ((T?.flags & 2097152 ? t.getAliasedSymbol(T) : T) === c.symbol) return h.parent.parent;
- function D(P) {
- for (; P.flags & 8; )
- P = P.parent;
- return P;
- }
- })[0];
- if (o)
- return o.name.text;
- }
- function Pye(e, t, n, i, s) {
- for (const c in t)
- for (const _ of t[c]) {
- const u = Os(_), d = u.indexOf("*"), g = n.map((h) => ({
- ending: h,
- value: PA(e, [h], s)
- }));
- if (Vg(u) && g.push({ ending: void 0, value: e }), d !== -1) {
- const h = u.substring(0, d), S = u.substring(d + 1);
- for (const { ending: T, value: C } of g)
- if (C.length >= h.length + S.length && Ui(C, h) && Zo(C, S) && o({ ending: T, value: C })) {
- const D = C.substring(h.length, C.length - S.length);
- if (!If(D))
- return uS(c, D);
- }
- } else if (ut(g, (h) => h.ending !== 0 && u === h.value) || ut(g, (h) => h.ending === 0 && u === h.value && o(h)))
- return c;
- }
- function o({ ending: c, value: _ }) {
- return c !== 0 || _ === PA(e, [c], s, i);
- }
- }
- function UO(e, t, n, i, s, o, c, _, u, d) {
- if (typeof o == "string") {
- const g = !sx(t), h = () => t.getCommonSourceDirectory(), S = u && vW(n, e, g, h), T = u && yW(n, e, g, h), C = es(
- Bn(i, o),
- /*currentDirectory*/
- void 0
- ), D = gx(n) ? $u(n) + qz(n, e) : void 0, P = d && XK(n);
- switch (_) {
- case 0:
- if (D && Sh(D, C, g) === 0 || Sh(n, C, g) === 0 || S && Sh(S, C, g) === 0 || T && Sh(T, C, g) === 0)
- return { moduleFileToTry: s };
- break;
- case 1:
- if (P && np(n, C, g)) {
- const B = ld(
- C,
- n,
- /*ignoreCase*/
- !1
- );
- return { moduleFileToTry: es(
- Bn(Bn(s, o), B),
- /*currentDirectory*/
- void 0
- ) };
- }
- if (D && np(C, D, g)) {
- const B = ld(
- C,
- D,
- /*ignoreCase*/
- !1
- );
- return { moduleFileToTry: es(
- Bn(Bn(s, o), B),
- /*currentDirectory*/
- void 0
- ) };
- }
- if (!P && np(C, n, g)) {
- const B = ld(
- C,
- n,
- /*ignoreCase*/
- !1
- );
- return { moduleFileToTry: es(
- Bn(Bn(s, o), B),
- /*currentDirectory*/
- void 0
- ) };
- }
- if (S && np(C, S, g)) {
- const B = ld(
- C,
- S,
- /*ignoreCase*/
- !1
- );
- return { moduleFileToTry: Bn(s, B) };
- }
- if (T && np(C, T, g)) {
- const B = DI(ld(
- C,
- T,
- /*ignoreCase*/
- !1
- ), Vz(T, e));
- return { moduleFileToTry: Bn(s, B) };
- }
- break;
- case 2:
- const I = C.indexOf("*"), F = C.slice(0, I), O = C.slice(I + 1);
- if (P && Ui(n, F, g) && Zo(n, O, g)) {
- const B = n.slice(F.length, n.length - O.length);
- return { moduleFileToTry: uS(s, B) };
- }
- if (D && Ui(D, F, g) && Zo(D, O, g)) {
- const B = D.slice(F.length, D.length - O.length);
- return { moduleFileToTry: uS(s, B) };
- }
- if (!P && Ui(n, F, g) && Zo(n, O, g)) {
- const B = n.slice(F.length, n.length - O.length);
- return { moduleFileToTry: uS(s, B) };
- }
- if (S && Ui(S, F, g) && Zo(S, O, g)) {
- const B = S.slice(F.length, S.length - O.length);
- return { moduleFileToTry: uS(s, B) };
- }
- if (T && Ui(T, F, g) && Zo(T, O, g)) {
- const B = T.slice(F.length, T.length - O.length), z = uS(s, B), X = qz(T, e);
- return X ? { moduleFileToTry: DI(z, X) } : void 0;
- }
- break;
- }
- } else {
- if (Array.isArray(o))
- return ir(o, (g) => UO(e, t, n, i, s, g, c, _, u, d));
- if (typeof o == "object" && o !== null) {
- for (const g of rm(o))
- if (g === "default" || c.indexOf(g) >= 0 || CA(c, g)) {
- const h = o[g], S = UO(e, t, n, i, s, h, c, _, u, d);
- if (S)
- return S;
- }
- }
- }
- }
- function sMe(e, t, n, i, s, o, c) {
- return typeof o == "object" && o !== null && !Array.isArray(o) && RO(o) ? ir(rm(o), (_) => {
- const u = es(
- Bn(s, _),
- /*currentDirectory*/
- void 0
- ), d = Zo(_, "/") ? 1 : _.includes("*") ? 2 : 0;
- return UO(
- e,
- t,
- n,
- i,
- u,
- o[_],
- c,
- d,
- /*isImports*/
- !1,
- /*preferTsExtension*/
- !1
- );
- }) : UO(
- e,
- t,
- n,
- i,
- s,
- o,
- c,
- 0,
- /*isImports*/
- !1,
- /*preferTsExtension*/
- !1
- );
- }
- function aMe(e, t, n, i, s, o) {
- var c, _, u;
- if (!i.readFile || !c5(n))
- return;
- const d = Ire(i, t);
- if (!d)
- return;
- const g = Bn(d, "package.json"), h = (_ = (c = i.getPackageJsonInfoCache) == null ? void 0 : c.call(i)) == null ? void 0 : _.getPackageJsonInfo(g);
- if (pre(h) || !i.fileExists(g))
- return;
- const S = h?.contents.packageJsonContent || K7(i.readFile(g)), T = S?.imports;
- if (!T)
- return;
- const C = Qy(n, s);
- return (u = ir(rm(T), (D) => {
- if (!Ui(D, "#") || D === "#" || Ui(D, "#/")) return;
- const P = Zo(D, "/") ? 1 : D.includes("*") ? 2 : 0;
- return UO(
- n,
- i,
- e,
- d,
- D,
- T[D],
- C,
- P,
- /*isImports*/
- !0,
- o
- );
- })) == null ? void 0 : u.moduleFileToTry;
- }
- function oMe(e, t, n, i, s, o) {
- const c = wye(t, e, i);
- if (c === void 0)
- return;
- const _ = wye(n, e, i), u = ta(_, (g) => lr(c, (h) => q2(ld(g, h, i)))), d = yR(u, z3);
- if (d)
- return PA(d, s, o);
- }
- function Ore({ path: e, isRedirect: t }, { getCanonicalFileName: n, canonicalSourceDirectory: i }, s, o, c, _, u, d) {
- if (!o.fileExists || !o.readFile)
- return;
- const g = A5(e);
- if (!g)
- return;
- const S = DA(_, o, c, s).getAllowedEndingsInPreferredOrder();
- let T = e, C = !1;
- if (!u) {
- let B = g.packageRootIndex, z;
- for (; ; ) {
- const { moduleFileToTry: X, packageRootPath: q, blockedByExports: V, verbatimFromExports: ae } = O(B);
- if (yu(c) !== 1) {
- if (V)
- return;
- if (ae)
- return X;
- }
- if (q) {
- T = q, C = !0;
- break;
- }
- if (z || (z = X), B = e.indexOf(Vo, B + 1), B === -1) {
- T = PA(z, S, c, o);
- break;
- }
- }
- }
- if (t && !C)
- return;
- const D = o.getGlobalTypingsCacheLocation && o.getGlobalTypingsCacheLocation(), P = n(T.substring(0, g.topLevelNodeModulesIndex));
- if (!(Ui(i, P) || D && Ui(n(D), P)))
- return;
- const I = T.substring(g.topLevelPackageNameIndex + 1), F = ED(I);
- return yu(c) === 1 && F === I ? void 0 : F;
- function O(B) {
- var z, X;
- const q = e.substring(0, B), V = Bn(q, "package.json");
- let ae = e, ee = !1;
- const G = (X = (z = o.getPackageJsonInfoCache) == null ? void 0 : z.call(o)) == null ? void 0 : X.getPackageJsonInfo(V);
- if (IO(G) || G === void 0 && o.fileExists(V)) {
- const ue = G?.contents.packageJsonContent || K7(o.readFile(V)), re = d || Hz(s, o, c);
- if (M3(c)) {
- const Se = q.substring(g.topLevelPackageNameIndex + 1), J = ED(Se), oe = Qy(c, re), _e = ue?.exports ? sMe(
- c,
- o,
- e,
- q,
- J,
- ue.exports,
- oe
- ) : void 0;
- if (_e)
- return { ..._e, verbatimFromExports: !0 };
- if (ue?.exports)
- return { moduleFileToTry: e, blockedByExports: !0 };
- }
- const ne = ue?.typesVersions ? AO(ue.typesVersions) : void 0;
- if (ne) {
- const Se = e.slice(q.length + 1), J = Pye(
- Se,
- ne.paths,
- S,
- o,
- c
- );
- J === void 0 ? ee = !0 : ae = Bn(q, J);
- }
- const ie = ue?.typings || ue?.types || ue?.main || "index.js";
- if (_s(ie) && !(ee && oJ(k5(ne.paths), ie))) {
- const Se = uo(ie, q, n), J = n(ae);
- if ($u(Se) === $u(J))
- return { packageRootPath: q, moduleFileToTry: ae };
- if (ue?.type !== "module" && !xc(J, x5) && Ui(J, Se) && Xn(J) === W1(Se) && $u(Hc(J)) === "index")
- return { packageRootPath: q, moduleFileToTry: ae };
- }
- } else {
- const ue = n(ae.substring(g.packageRootIndex + 1));
- if (ue === "index.d.ts" || ue === "index.js" || ue === "index.ts" || ue === "index.tsx")
- return { moduleFileToTry: ae, packageRootPath: q };
- }
- return { moduleFileToTry: ae };
- }
- }
- function cMe(e, t) {
- if (!e.fileExists) return;
- const n = Np(B4({ allowJs: !0 }, [{ extension: "node", isMixedContent: !1 }, {
- extension: "json",
- isMixedContent: !1,
- scriptKind: 6
- /* JSON */
- }]));
- for (const i of n) {
- const s = t + i;
- if (e.fileExists(s))
- return s;
- }
- }
- function wye(e, t, n) {
- return Ai(t, (i) => {
- const s = Nye(e, i, n);
- return s !== void 0 && Iye(s) ? void 0 : s;
- });
- }
- function PA(e, t, n, i) {
- if (xc(e, [
- ".json",
- ".mjs",
- ".cjs"
- /* Cjs */
- ]))
- return e;
- const s = $u(e);
- if (e === s)
- return e;
- const o = t.indexOf(
- 2
- /* JsExtension */
- ), c = t.indexOf(
- 3
- /* TsExtension */
- );
- if (xc(e, [
- ".mts",
- ".cts"
- /* Cts */
- ]) && c !== -1 && c < o)
- return e;
- if (xc(e, [
- ".d.mts",
- ".mts",
- ".d.cts",
- ".cts"
- /* Cts */
- ]))
- return s + Vz(e, n);
- if (!xc(e, [
- ".d.ts"
- /* Dts */
- ]) && xc(e, [
- ".ts"
- /* Ts */
- ]) && e.includes(".d."))
- return Aye(e);
- switch (t[0]) {
- case 0:
- const _ = eC(s, "/index");
- return i && _ !== s && cMe(i, _) ? s : _;
- case 1:
- return s;
- case 2:
- return s + Vz(e, n);
- case 3:
- if (wl(e)) {
- const u = t.findIndex(
- (d) => d === 0 || d === 1
- /* Index */
- );
- return u !== -1 && u < o ? s : s + Vz(e, n);
- }
- return e;
- default:
- return E.assertNever(t[0]);
- }
- }
- function Aye(e) {
- const t = Hc(e);
- if (!Zo(
- e,
- ".ts"
- /* Ts */
- ) || !t.includes(".d.") || xc(t, [
- ".d.ts"
- /* Dts */
- ])) return;
- const n = W3(
- e,
- ".ts"
- /* Ts */
- ), i = n.substring(n.lastIndexOf("."));
- return n.substring(0, n.indexOf(".d.")) + i;
- }
- function Vz(e, t) {
- return qz(e, t) ?? E.fail(`Extension ${z4(e)} is unsupported:: FileName:: ${e}`);
- }
- function qz(e, t) {
- const n = Vg(e);
- switch (n) {
- case ".ts":
- case ".d.ts":
- return ".js";
- case ".tsx":
- return t.jsx === 1 ? ".jsx" : ".js";
- case ".js":
- case ".jsx":
- case ".json":
- return n;
- case ".d.mts":
- case ".mts":
- case ".mjs":
- return ".mjs";
- case ".d.cts":
- case ".cts":
- case ".cjs":
- return ".cjs";
- default:
- return;
- }
- }
- function Nye(e, t, n) {
- const i = jT(
- t,
- e,
- t,
- n,
- /*isAbsolutePathAnUrl*/
- !1
- );
- return H_(i) ? void 0 : i;
- }
- function Iye(e) {
- return Ui(e, "..");
- }
- function Hz(e, t, n) {
- return sg(e) ? t.getDefaultResolutionModeForFile(e) : pF(e, n);
- }
- function lMe(e) {
- const t = e.indexOf(
- 3
- /* TsExtension */
- );
- return t > -1 && t < e.indexOf(
- 2
- /* JsExtension */
- );
- }
- var Fre = /^".+"$/, Gz = "(anonymous)", Oye = 1, Fye = 1, Lye = 1, Mye = 1, $z = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.TypeofEQString = 1] = "TypeofEQString", e[e.TypeofEQNumber = 2] = "TypeofEQNumber", e[e.TypeofEQBigInt = 4] = "TypeofEQBigInt", e[e.TypeofEQBoolean = 8] = "TypeofEQBoolean", e[e.TypeofEQSymbol = 16] = "TypeofEQSymbol", e[e.TypeofEQObject = 32] = "TypeofEQObject", e[e.TypeofEQFunction = 64] = "TypeofEQFunction", e[e.TypeofEQHostObject = 128] = "TypeofEQHostObject", e[e.TypeofNEString = 256] = "TypeofNEString", e[e.TypeofNENumber = 512] = "TypeofNENumber", e[e.TypeofNEBigInt = 1024] = "TypeofNEBigInt", e[e.TypeofNEBoolean = 2048] = "TypeofNEBoolean", e[e.TypeofNESymbol = 4096] = "TypeofNESymbol", e[e.TypeofNEObject = 8192] = "TypeofNEObject", e[e.TypeofNEFunction = 16384] = "TypeofNEFunction", e[e.TypeofNEHostObject = 32768] = "TypeofNEHostObject", e[e.EQUndefined = 65536] = "EQUndefined", e[e.EQNull = 131072] = "EQNull", e[e.EQUndefinedOrNull = 262144] = "EQUndefinedOrNull", e[e.NEUndefined = 524288] = "NEUndefined", e[e.NENull = 1048576] = "NENull", e[e.NEUndefinedOrNull = 2097152] = "NEUndefinedOrNull", e[e.Truthy = 4194304] = "Truthy", e[e.Falsy = 8388608] = "Falsy", e[e.IsUndefined = 16777216] = "IsUndefined", e[e.IsNull = 33554432] = "IsNull", e[e.IsUndefinedOrNull = 50331648] = "IsUndefinedOrNull", e[e.All = 134217727] = "All", e[e.BaseStringStrictFacts = 3735041] = "BaseStringStrictFacts", e[e.BaseStringFacts = 12582401] = "BaseStringFacts", e[e.StringStrictFacts = 16317953] = "StringStrictFacts", e[e.StringFacts = 16776705] = "StringFacts", e[e.EmptyStringStrictFacts = 12123649] = "EmptyStringStrictFacts", e[
- e.EmptyStringFacts = 12582401
- /* BaseStringFacts */
- ] = "EmptyStringFacts", e[e.NonEmptyStringStrictFacts = 7929345] = "NonEmptyStringStrictFacts", e[e.NonEmptyStringFacts = 16776705] = "NonEmptyStringFacts", e[e.BaseNumberStrictFacts = 3734786] = "BaseNumberStrictFacts", e[e.BaseNumberFacts = 12582146] = "BaseNumberFacts", e[e.NumberStrictFacts = 16317698] = "NumberStrictFacts", e[e.NumberFacts = 16776450] = "NumberFacts", e[e.ZeroNumberStrictFacts = 12123394] = "ZeroNumberStrictFacts", e[
- e.ZeroNumberFacts = 12582146
- /* BaseNumberFacts */
- ] = "ZeroNumberFacts", e[e.NonZeroNumberStrictFacts = 7929090] = "NonZeroNumberStrictFacts", e[e.NonZeroNumberFacts = 16776450] = "NonZeroNumberFacts", e[e.BaseBigIntStrictFacts = 3734276] = "BaseBigIntStrictFacts", e[e.BaseBigIntFacts = 12581636] = "BaseBigIntFacts", e[e.BigIntStrictFacts = 16317188] = "BigIntStrictFacts", e[e.BigIntFacts = 16775940] = "BigIntFacts", e[e.ZeroBigIntStrictFacts = 12122884] = "ZeroBigIntStrictFacts", e[
- e.ZeroBigIntFacts = 12581636
- /* BaseBigIntFacts */
- ] = "ZeroBigIntFacts", e[e.NonZeroBigIntStrictFacts = 7928580] = "NonZeroBigIntStrictFacts", e[e.NonZeroBigIntFacts = 16775940] = "NonZeroBigIntFacts", e[e.BaseBooleanStrictFacts = 3733256] = "BaseBooleanStrictFacts", e[e.BaseBooleanFacts = 12580616] = "BaseBooleanFacts", e[e.BooleanStrictFacts = 16316168] = "BooleanStrictFacts", e[e.BooleanFacts = 16774920] = "BooleanFacts", e[e.FalseStrictFacts = 12121864] = "FalseStrictFacts", e[
- e.FalseFacts = 12580616
- /* BaseBooleanFacts */
- ] = "FalseFacts", e[e.TrueStrictFacts = 7927560] = "TrueStrictFacts", e[e.TrueFacts = 16774920] = "TrueFacts", e[e.SymbolStrictFacts = 7925520] = "SymbolStrictFacts", e[e.SymbolFacts = 16772880] = "SymbolFacts", e[e.ObjectStrictFacts = 7888800] = "ObjectStrictFacts", e[e.ObjectFacts = 16736160] = "ObjectFacts", e[e.FunctionStrictFacts = 7880640] = "FunctionStrictFacts", e[e.FunctionFacts = 16728e3] = "FunctionFacts", e[e.VoidFacts = 9830144] = "VoidFacts", e[e.UndefinedFacts = 26607360] = "UndefinedFacts", e[e.NullFacts = 42917664] = "NullFacts", e[e.EmptyObjectStrictFacts = 83427327] = "EmptyObjectStrictFacts", e[e.EmptyObjectFacts = 83886079] = "EmptyObjectFacts", e[e.UnknownFacts = 83886079] = "UnknownFacts", e[e.AllTypeofNE = 556800] = "AllTypeofNE", e[e.OrFactsMask = 8256] = "OrFactsMask", e[e.AndFactsMask = 134209471] = "AndFactsMask", e))($z || {}), Lre = new Map(Object.entries({
- string: 256,
- number: 512,
- bigint: 1024,
- boolean: 2048,
- symbol: 4096,
- undefined: 524288,
- object: 8192,
- function: 16384
- /* TypeofNEFunction */
- })), Xz = /* @__PURE__ */ ((e) => (e[e.Normal = 0] = "Normal", e[e.Contextual = 1] = "Contextual", e[e.Inferential = 2] = "Inferential", e[e.SkipContextSensitive = 4] = "SkipContextSensitive", e[e.SkipGenericFunctions = 8] = "SkipGenericFunctions", e[e.IsForSignatureHelp = 16] = "IsForSignatureHelp", e[e.RestBindingElement = 32] = "RestBindingElement", e[e.TypeOnly = 64] = "TypeOnly", e))(Xz || {}), Qz = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.BivariantCallback = 1] = "BivariantCallback", e[e.StrictCallback = 2] = "StrictCallback", e[e.IgnoreReturnTypes = 4] = "IgnoreReturnTypes", e[e.StrictArity = 8] = "StrictArity", e[e.StrictTopSignature = 16] = "StrictTopSignature", e[e.Callback = 3] = "Callback", e))(Qz || {}), uMe = gI(jye, fMe), Yz = new Map(Object.entries({
- Uppercase: 0,
- Lowercase: 1,
- Capitalize: 2,
- Uncapitalize: 3,
- NoInfer: 4
- /* NoInfer */
- })), Rye = class {
- };
- function _Me() {
- this.flags = 0;
- }
- function Ma(e) {
- return e.id || (e.id = Fye, Fye++), e.id;
- }
- function na(e) {
- return e.id || (e.id = Oye, Oye++), e.id;
- }
- function Zz(e, t) {
- const n = Rh(e);
- return n === 1 || t && n === 2;
- }
- function Mre(e) {
- var t = [], n = (r) => {
- t.push(r);
- }, i, s, o = Gl.getSymbolConstructor(), c = Gl.getTypeConstructor(), _ = Gl.getSignatureConstructor(), u = 0, d = 0, g = 0, h = 0, S = 0, T = 0, C, D, P = !1, I = Js(), F = [
- 1
- /* Covariant */
- ], O = e.getCompilerOptions(), B = pa(O), z = Ru(O), X = !!O.experimentalDecorators, q = R3(O), V = ZB(O), ae = mx(O), ee = cu(O, "strictNullChecks"), G = cu(O, "strictFunctionTypes"), ue = cu(O, "strictBindCallApply"), re = cu(O, "strictPropertyInitialization"), ne = cu(O, "strictBuiltinIteratorReturn"), ie = cu(O, "noImplicitAny"), Se = cu(O, "noImplicitThis"), J = cu(O, "useUnknownInCatchVariables"), oe = O.exactOptionalPropertyTypes, _e = !!O.noUncheckedSideEffectImports, he = Jat(), le = Tut(), me = SL(), ve = Bie(O, {
- isEntityNameVisible: oN,
- isExpandoFunctionDeclaration: VIe,
- getAllAccessorDeclarations: QM,
- requiresAddingImplicitUndefined: tX,
- isUndefinedIdentifierExpression(r) {
- return E.assert(Ed(r)), od(r) === we;
- },
- isDefinitelyReferenceToGlobalSymbolObject: xl
- }), tt = mee({
- evaluateElementAccessExpression: _lt,
- evaluateEntityNameExpression: kIe
- }), Te = Js(), we = fa(4, "undefined");
- we.declarations = [];
- var fe = fa(
- 1536,
- "globalThis",
- 8
- /* Readonly */
- );
- fe.exports = Te, fe.declarations = [], Te.set(fe.escapedName, fe);
- var Me = fa(4, "arguments"), Qe = fa(4, "require"), et = O.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", Re = !O.verbatimModuleSyntax, ft, Wt, _r = 0, Ir, jr = 0, Nt = vJ({
- compilerOptions: O,
- requireSymbol: Qe,
- argumentsSymbol: Me,
- globals: Te,
- getSymbolOfDeclaration: Tn,
- error: je,
- getRequiresScopeChangeCache: JS,
- setRequiresScopeChangeCache: u1,
- lookup: Al,
- onPropertyWithInvalidInitializer: zS,
- onFailedToResolveSymbol: Do,
- onSuccessfullyResolvedSymbol: Yh
- }), Qt = vJ({
- compilerOptions: O,
- requireSymbol: Qe,
- argumentsSymbol: Me,
- globals: Te,
- getSymbolOfDeclaration: Tn,
- error: je,
- getRequiresScopeChangeCache: JS,
- setRequiresScopeChangeCache: u1,
- lookup: ost
- });
- const Br = {
- getNodeCount: () => Hu(e.getSourceFiles(), (r, a) => r + a.nodeCount, 0),
- getIdentifierCount: () => Hu(e.getSourceFiles(), (r, a) => r + a.identifierCount, 0),
- getSymbolCount: () => Hu(e.getSourceFiles(), (r, a) => r + a.symbolCount, d),
- getTypeCount: () => u,
- getInstantiationCount: () => g,
- getRelationCacheSizes: () => ({
- assignable: lf.size,
- identity: I_.size,
- subtype: sh.size,
- strictSubtype: Hf.size
- }),
- isUndefinedSymbol: (r) => r === we,
- isArgumentsSymbol: (r) => r === Me,
- isUnknownSymbol: (r) => r === ze,
- getMergedSymbol: Ra,
- symbolIsValue: ff,
- getDiagnostics: IIe,
- getGlobalDiagnostics: Llt,
- getRecursionIdentity: UG,
- getUnmatchedProperties: epe,
- getTypeOfSymbolAtLocation: (r, a) => {
- const l = fs(a);
- return l ? xnt(r, l) : He;
- },
- getTypeOfSymbol: nn,
- getSymbolsOfParameterPropertyDeclaration: (r, a) => {
- const l = fs(r, Ii);
- return l === void 0 ? E.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.") : (E.assert(G_(l, l.parent)), Qh(l, tc(a)));
- },
- getDeclaredTypeOfSymbol: bo,
- getPropertiesOfType: qa,
- getPropertyOfType: (r, a) => Gs(r, tc(a)),
- getPrivateIdentifierPropertyOfType: (r, a, l) => {
- const f = fs(l);
- if (!f)
- return;
- const m = tc(a), y = kM(m, f);
- return y ? x$(r, y) : void 0;
- },
- getTypeOfPropertyOfType: (r, a) => Rc(r, tc(a)),
- getIndexInfoOfType: (r, a) => dh(r, a === 0 ? Ie : At),
- getIndexInfosOfType: wu,
- getIndexInfosOfIndexSymbol: $_e,
- getSignaturesOfType: Ns,
- getIndexTypeOfType: (r, a) => $v(r, a === 0 ? Ie : At),
- getIndexType: (r) => Jm(r),
- getBaseTypes: No,
- getBaseTypeOfLiteralType: o0,
- getWidenedType: J_,
- getWidenedLiteralType: eb,
- getTypeFromTypeNode: (r) => {
- const a = fs(r, fi);
- return a ? Ci(a) : He;
- },
- getParameterType: Kd,
- getParameterIdentifierInfoAtPosition: tat,
- getPromisedTypeOfPromise: QN,
- getAwaitedType: (r) => qk(r),
- getReturnTypeOfSignature: Ha,
- isNullableType: xM,
- getNullableType: sM,
- getNonNullableType: c0,
- getNonOptionalType: GG,
- getTypeArguments: Io,
- typeToTypeNode: me.typeToTypeNode,
- typePredicateToTypePredicateNode: me.typePredicateToTypePredicateNode,
- indexInfoToIndexSignatureDeclaration: me.indexInfoToIndexSignatureDeclaration,
- signatureToSignatureDeclaration: me.signatureToSignatureDeclaration,
- symbolToEntityName: me.symbolToEntityName,
- symbolToExpression: me.symbolToExpression,
- symbolToNode: me.symbolToNode,
- symbolToTypeParameterDeclarations: me.symbolToTypeParameterDeclarations,
- symbolToParameterDeclaration: me.symbolToParameterDeclaration,
- typeParameterToDeclaration: me.typeParameterToDeclaration,
- getSymbolsInScope: (r, a) => {
- const l = fs(r);
- return l ? Mlt(l, a) : [];
- },
- getSymbolAtLocation: (r) => {
- const a = fs(r);
- return a ? od(
- a,
- /*ignoreErrors*/
- !0
- ) : void 0;
- },
- getIndexInfosAtLocation: (r) => {
- const a = fs(r);
- return a ? Vlt(a) : void 0;
- },
- getShorthandAssignmentValueSymbol: (r) => {
- const a = fs(r);
- return a ? qlt(a) : void 0;
- },
- getExportSpecifierLocalTargetSymbol: (r) => {
- const a = fs(r, vu);
- return a ? Hlt(a) : void 0;
- },
- getExportSymbolOfSymbol(r) {
- return Ra(r.exportSymbol || r);
- },
- getTypeAtLocation: (r) => {
- const a = fs(r);
- return a ? Gk(a) : He;
- },
- getTypeOfAssignmentPattern: (r) => {
- const a = fs(r, o4);
- return a && Z$(a) || He;
- },
- getPropertySymbolOfDestructuringAssignment: (r) => {
- const a = fs(r, Oe);
- return a ? Glt(a) : void 0;
- },
- signatureToString: (r, a, l, f) => qv(r, fs(a), l, f),
- typeToString: (r, a, l) => Hr(r, fs(a), l),
- symbolToString: (r, a, l, f) => Ji(r, fs(a), l, f),
- typePredicateToString: (r, a, l) => Lm(r, fs(a), l),
- writeSignature: (r, a, l, f, m) => qv(r, fs(a), l, f, m),
- writeType: (r, a, l, f) => Hr(r, fs(a), l, f),
- writeSymbol: (r, a, l, f, m) => Ji(r, fs(a), l, f, m),
- writeTypePredicate: (r, a, l, f) => Lm(r, fs(a), l, f),
- getAugmentedPropertiesOfType: qde,
- getRootSymbols: BIe,
- getSymbolOfExpando: w$,
- getContextualType: (r, a) => {
- const l = fs(r, _t);
- if (l)
- return a & 4 ? ki(l, () => a_(l, a)) : a_(l, a);
- },
- getContextualTypeForObjectLiteralElement: (r) => {
- const a = fs(r, kh);
- return a ? Dpe(
- a,
- /*contextFlags*/
- void 0
- ) : void 0;
- },
- getContextualTypeForArgumentAtIndex: (r, a) => {
- const l = fs(r, mb);
- return l && Epe(l, a);
- },
- getContextualTypeForJsxAttribute: (r) => {
- const a = fs(r, $I);
- return a && n8e(
- a,
- /*contextFlags*/
- void 0
- );
- },
- isContextSensitive: Kf,
- getTypeOfPropertyOfContextualType: rb,
- getFullyQualifiedName: K0,
- getResolvedSignature: (r, a, l) => rs(
- r,
- a,
- l,
- 0
- /* Normal */
- ),
- getCandidateSignaturesForStringLiteralCompletions: xr,
- getResolvedSignatureForSignatureHelp: (r, a, l) => zn(r, () => rs(
- r,
- a,
- l,
- 16
- /* IsForSignatureHelp */
- )),
- getExpandedParameters: qPe,
- hasEffectiveRestParameter: Pg,
- containsArgumentsReference: q_e,
- getConstantValue: (r) => {
- const a = fs(r, qIe);
- return a ? Gde(a) : void 0;
- },
- isValidPropertyAccess: (r, a) => {
- const l = fs(r, jY);
- return !!l && ust(l, tc(a));
- },
- isValidPropertyAccessForCompletions: (r, a, l) => {
- const f = fs(r, Cn);
- return !!f && O8e(f, a, l);
- },
- getSignatureFromDeclaration: (r) => {
- const a = fs(r, ys);
- return a ? Zf(a) : void 0;
- },
- isImplementationOfOverload: (r) => {
- const a = fs(r, ys);
- return a ? UIe(a) : void 0;
- },
- getImmediateAliasedSymbol: h$,
- getAliasedSymbol: Zl,
- getEmitResolver: Gh,
- requiresAddingImplicitUndefined: tX,
- getExportsOfModule: g1,
- getExportsAndPropertiesOfModule: hP,
- forEachExportAndPropertyOfModule: m2,
- getSymbolWalker: Are(
- RKe,
- Cp,
- Ha,
- No,
- Xd,
- nn,
- Nu,
- s_,
- E_,
- Io
- ),
- getAmbientModules: u_t,
- getJsxIntrinsicTagNamesAt: Vit,
- isOptionalParameter: (r) => {
- const a = fs(r, Ii);
- return a ? ML(a) : !1;
- },
- tryGetMemberInModuleExports: (r, a) => tT(tc(r), a),
- tryGetMemberInModuleExportsAndProperties: (r, a) => xk(tc(r), a),
- tryFindAmbientModule: (r) => _we(
- r,
- /*withAugmentations*/
- !0
- ),
- getApparentType: Uu,
- getUnionType: Qn,
- isTypeAssignableTo: $s,
- createAnonymousType: Li,
- createSignature: ph,
- createSymbol: fa,
- createIndexInfo: Cg,
- getAnyType: () => xe,
- getStringType: () => Ie,
- getStringLiteralType: S_,
- getNumberType: () => At,
- getNumberLiteralType: bd,
- getBigIntType: () => Dr,
- getBigIntLiteralType: HL,
- createPromiseType: LM,
- createArrayType: du,
- getElementTypeOfArrayType: iM,
- getBooleanType: () => wt,
- getFalseType: (r) => r ? yr : $r,
- getTrueType: (r) => r ? nt : ot,
- getVoidType: () => Xt,
- getUndefinedType: () => Ae,
- getNullType: () => ht,
- getESSymbolType: () => jt,
- getNeverType: () => Ht,
- getOptionalType: () => Z,
- getPromiseType: () => JL(
- /*reportErrors*/
- !1
- ),
- getPromiseLikeType: () => Lwe(
- /*reportErrors*/
- !1
- ),
- getAnyAsyncIterableType: () => {
- const r = zL(
- /*reportErrors*/
- !1
- );
- if (r !== Vi)
- return n0(r, [xe, xe, xe]);
- },
- isSymbolAccessible: Hd,
- isArrayType: Dp,
- isTupleType: ha,
- isArrayLikeType: oy,
- isEmptyAnonymousObjectType: Dg,
- isTypeInvalidDueToUnionDiscriminant: yKe,
- getExactOptionalProperties: Ztt,
- getAllPossiblePropertiesOfTypes: vKe,
- getSuggestedSymbolForNonexistentProperty: Upe,
- getSuggestedSymbolForNonexistentJSXAttribute: w8e,
- getSuggestedSymbolForNonexistentSymbol: (r, a, l) => N8e(r, tc(a), l),
- getSuggestedSymbolForNonexistentModule: Vpe,
- getSuggestedSymbolForNonexistentClassMember: P8e,
- getBaseConstraintOfType: Kl,
- getDefaultFromTypeParameter: (r) => r && r.flags & 262144 ? C2(r) : void 0,
- resolveName(r, a, l, f) {
- return Nt(
- a,
- tc(r),
- l,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1,
- f
- );
- },
- getJsxNamespace: (r) => Ei(gg(r)),
- getJsxFragmentFactory: (r) => {
- const a = Xde(r);
- return a && Ei(E_(a).escapedText);
- },
- getAccessibleSymbolChain: ty,
- getTypePredicateOfSignature: Cp,
- resolveExternalModuleName: (r) => {
- const a = fs(r, _t);
- return a && v_(
- a,
- a,
- /*ignoreErrors*/
- !0
- );
- },
- resolveExternalModuleSymbol: M_,
- tryGetThisTypeAt: (r, a, l) => {
- const f = fs(r);
- return f && Tpe(f, a, l);
- },
- getTypeArgumentConstraint: (r) => {
- const a = fs(r, fi);
- return a && vot(a);
- },
- getSuggestionDiagnostics: (r, a) => {
- const l = fs(r, Si) || E.fail("Could not determine parsed source file.");
- if (JC(l, O, e))
- return Ue;
- let f;
- try {
- return i = a, Wde(l), E.assert(!!(bn(l).flags & 1)), f = Fn(f, c2.getDiagnostics(l.fileName)), QNe(NIe(l), (m, y, x) => {
- !GT(m) && !AIe(y, !!(m.flags & 33554432)) && (f || (f = [])).push({
- ...x,
- category: 2
- /* Suggestion */
- });
- }), f || Ue;
- } finally {
- i = void 0;
- }
- },
- runWithCancellationToken: (r, a) => {
- try {
- return i = r, a(Br);
- } finally {
- i = void 0;
- }
- },
- getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: vd,
- isDeclarationVisible: yd,
- isPropertyAccessible: Hpe,
- getTypeOnlyAliasDeclaration: Fm,
- getMemberOverrideModifierStatus: elt,
- isTypeParameterPossiblyReferenced: XL,
- typeHasCallOrConstructSignatures: K$,
- getSymbolFlags: Pu
- };
- function xr(r, a) {
- const l = /* @__PURE__ */ new Set(), f = [];
- ki(a, () => rs(
- r,
- f,
- /*argumentCount*/
- void 0,
- 0
- /* Normal */
- ));
- for (const m of f)
- l.add(m);
- f.length = 0, zn(a, () => rs(
- r,
- f,
- /*argumentCount*/
- void 0,
- 0
- /* Normal */
- ));
- for (const m of f)
- l.add(m);
- return as(l);
- }
- function zn(r, a) {
- if (r = or(r, Cj), r) {
- const l = [], f = [];
- for (; r; ) {
- const y = bn(r);
- if (l.push([y, y.resolvedSignature]), y.resolvedSignature = void 0, Wy(r)) {
- const x = Bi(Tn(r)), N = x.type;
- f.push([x, N]), x.type = void 0;
- }
- r = or(r.parent, Cj);
- }
- const m = a();
- for (const [y, x] of l)
- y.resolvedSignature = x;
- for (const [y, x] of f)
- y.type = x;
- return m;
- }
- return a();
- }
- function ki(r, a) {
- const l = or(r, mb);
- if (l) {
- let m = r;
- do
- bn(m).skipDirectInference = !0, m = m.parent;
- while (m && m !== l);
- }
- P = !0;
- const f = zn(r, a);
- if (P = !1, l) {
- let m = r;
- do
- bn(m).skipDirectInference = void 0, m = m.parent;
- while (m && m !== l);
- }
- return f;
- }
- function rs(r, a, l, f) {
- const m = fs(r, mb);
- ft = l;
- const y = m ? TE(m, a, f) : void 0;
- return ft = void 0, y;
- }
- var ei = /* @__PURE__ */ new Map(), Ri = /* @__PURE__ */ new Map(), Jr = /* @__PURE__ */ new Map(), ji = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map(), Ot = /* @__PURE__ */ new Map(), Ar = /* @__PURE__ */ new Map(), mn = /* @__PURE__ */ new Map(), ti = /* @__PURE__ */ new Map(), qn = /* @__PURE__ */ new Map(), Oi = /* @__PURE__ */ new Map(), Ws = /* @__PURE__ */ new Map(), Hs = /* @__PURE__ */ new Map(), rr = /* @__PURE__ */ new Map(), Ea = /* @__PURE__ */ new Map(), Xe = [], Tt = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set(), ze = fa(4, "unknown"), K = fa(
- 0,
- "__resolving__"
- /* Resolving */
- ), De = /* @__PURE__ */ new Map(), Ve = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Set(), xe = ol(1, "any"), at = ol(1, "any", 262144, "auto"), $e = ol(
- 1,
- "any",
- /*objectFlags*/
- void 0,
- "wildcard"
- ), bt = ol(
- 1,
- "any",
- /*objectFlags*/
- void 0,
- "blocked string"
- ), He = ol(1, "error"), Vt = ol(1, "unresolved"), Zt = ol(1, "any", 65536, "non-inferrable"), vn = ol(1, "intrinsic"), M = ol(2, "unknown"), Ae = ol(32768, "undefined"), dt = ee ? Ae : ol(32768, "undefined", 65536, "widening"), U = ol(
- 32768,
- "undefined",
- /*objectFlags*/
- void 0,
- "missing"
- ), be = oe ? U : Ae, Z = ol(
- 32768,
- "undefined",
- /*objectFlags*/
- void 0,
- "optional"
- ), ht = ol(65536, "null"), Le = ee ? ht : ol(65536, "null", 65536, "widening"), Ie = ol(4, "string"), At = ol(8, "number"), Dr = ol(64, "bigint"), yr = ol(
- 512,
- "false",
- /*objectFlags*/
- void 0,
- "fresh"
- ), $r = ol(512, "false"), nt = ol(
- 512,
- "true",
- /*objectFlags*/
- void 0,
- "fresh"
- ), ot = ol(512, "true");
- nt.regularType = ot, nt.freshType = nt, ot.regularType = ot, ot.freshType = nt, yr.regularType = $r, yr.freshType = yr, $r.regularType = $r, $r.freshType = yr;
- var wt = Qn([$r, ot]), jt = ol(4096, "symbol"), Xt = ol(16384, "void"), Ht = ol(131072, "never"), en = ol(131072, "never", 262144, "silent"), zt = ol(
- 131072,
- "never",
- /*objectFlags*/
- void 0,
- "implicit"
- ), mr = ol(
- 131072,
- "never",
- /*objectFlags*/
- void 0,
- "unreachable"
- ), Kt = ol(67108864, "object"), hr = Qn([Ie, At]), Ft = Qn([Ie, At, jt]), Ss = Qn([At, Dr]), gs = Qn([Ie, At, wt, Dr, ht, Ae]), Ts = fT(["", ""], [At]), Ua = $L((r) => r.flags & 262144 ? ktt(r) : r, () => "(restrictive mapper)"), lc = $L((r) => r.flags & 262144 ? $e : r, () => "(permissive mapper)"), Ic = ol(
- 131072,
- "never",
- /*objectFlags*/
- void 0,
- "unique literal"
- ), io = $L((r) => r.flags & 262144 ? Ic : r, () => "(unique literal mapper)"), vi, ca = $L((r) => (vi && (r === Wc || r === of || r === Ao) && vi(
- /*onlyUnreliable*/
- !0
- ), r), () => "(unmeasurable reporter)"), Ll = $L((r) => (vi && (r === Wc || r === of || r === Ao) && vi(
- /*onlyUnreliable*/
- !1
- ), r), () => "(unreliable reporter)"), xs = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- ), Cu = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- );
- Cu.objectFlags |= 2048;
- var Zc = fa(
- 2048,
- "__type"
- /* Type */
- );
- Zc.members = Js();
- var Yi = Li(Zc, I, Ue, Ue, Ue), Na = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- ), Ia = ee ? Qn([Ae, ht, Na]) : M, Vi = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- );
- Vi.instantiations = /* @__PURE__ */ new Map();
- var ba = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- );
- ba.objectFlags |= 262144;
- var Bt = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- ), to = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- ), _u = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- ), Wc = pt(), of = pt();
- of.constraint = Wc;
- var Ao = pt(), ge = pt(), $ = pt();
- $.constraint = ge;
- var rt = yN(1, "<>", 0, xe), Ct = ph(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- xe,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- 0
- /* None */
- ), $t = ph(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- He,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- 0
- /* None */
- ), zr = ph(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- xe,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- 0
- /* None */
- ), $n = ph(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- en,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- 0
- /* None */
- ), ar = Cg(
- At,
- Ie,
- /*isReadonly*/
- !0
- ), An = /* @__PURE__ */ new Map(), ri = {
- get yieldType() {
- return E.fail("Not supported");
- },
- get returnType() {
- return E.fail("Not supported");
- },
- get nextType() {
- return E.fail("Not supported");
- }
- }, Fi = ib(xe, xe, xe), za = {
- iterableCacheKey: "iterationTypesOfAsyncIterable",
- iteratorCacheKey: "iterationTypesOfAsyncIterator",
- iteratorSymbolName: "asyncIterator",
- getGlobalIteratorType: eet,
- getGlobalIterableType: zL,
- getGlobalIterableIteratorType: Mwe,
- getGlobalIteratorObjectType: ret,
- getGlobalGeneratorType: net,
- getGlobalBuiltinIteratorTypes: tet,
- resolveIterationType: (r, a) => qk(r, a, p.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member),
- mustHaveANextMethodDiagnostic: p.An_async_iterator_must_have_a_next_method,
- mustBeAMethodDiagnostic: p.The_0_property_of_an_async_iterator_must_be_a_method,
- mustHaveAValueDiagnostic: p.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property
- }, Uo = {
- iterableCacheKey: "iterationTypesOfIterable",
- iteratorCacheKey: "iterationTypesOfIterator",
- iteratorSymbolName: "iterator",
- getGlobalIteratorType: iet,
- getGlobalIterableType: EG,
- getGlobalIterableIteratorType: Rwe,
- getGlobalIteratorObjectType: aet,
- getGlobalGeneratorType: oet,
- getGlobalBuiltinIteratorTypes: set,
- resolveIterationType: (r, a) => r,
- mustHaveANextMethodDiagnostic: p.An_iterator_must_have_a_next_method,
- mustBeAMethodDiagnostic: p.The_0_property_of_an_iterator_must_be_a_method,
- mustHaveAValueDiagnostic: p.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property
- }, vc, Oc = /* @__PURE__ */ new Map(), Fc = /* @__PURE__ */ new Map(), Lo, _c, Wf, Lc, al, hp, Pe, Et, Lr, $i, Sa, ka, Pc, yl, so, Va, Uc, cf, Xp, A_, Sf, Uf, yp, Yg, Qp, y_, vl, Uh, r_, Zg, Vf, Y, st, It, Mt, Sr, Vr, En, si, L, Ce, yt, Mr, hi, Es, ns, Ds, Pa, ga, $o, vp, dd, jd, Kg, J0, eh, bp, Sp, Mo, Tf, N_, Bd = /* @__PURE__ */ new Map(), th = 0, Yp = 0, dg = 0, Vh = !1, z0 = 0, Zp, Nv, qf, Kp = [], qh = [], Iv = [], mg = 0, rh = [], Ov = [], n1 = [], Ne = 0, qe = S_(""), vt = bd(0), qt = HL({ negative: !1, base10Value: "0" }), fr = [], qr = [], kr = [], Dn = 0, di = !1, _n = 0, yi = 10, fn = [], ks = [], po = [], Bu = [], ed = [], Ju = [], td = [], zu = [], o2 = [], i1 = [], nh = [], Hh = [], W0 = [], md = [], U0 = [], s1 = [], a1 = [], o1 = [], jS = [], Fv = 0, Da = x3(), c2 = x3(), BS = ce(), Lv, ih, sh = /* @__PURE__ */ new Map(), Hf = /* @__PURE__ */ new Map(), lf = /* @__PURE__ */ new Map(), uf = /* @__PURE__ */ new Map(), I_ = /* @__PURE__ */ new Map(), c1 = /* @__PURE__ */ new Map(), V6 = [
- [".mts", ".mjs"],
- [".ts", ".js"],
- [".cts", ".cjs"],
- [".mjs", ".mjs"],
- [".js", ".js"],
- [".cjs", ".cjs"],
- [".tsx", O.jsx === 1 ? ".jsx" : ".js"],
- [".jsx", ".jsx"],
- [".json", ".json"]
- ];
- return xut(), Br;
- function xl(r) {
- return !Cn(r) || !Oe(r.name) || !Cn(r.expression) && !Oe(r.expression) ? !1 : Oe(r.expression) ? Nn(r.expression) === "Symbol" && Nu(r.expression) === (pE(
- "Symbol",
- 1160127,
- /*diagnostic*/
- void 0
- ) || ze) : Oe(r.expression.expression) ? Nn(r.expression.name) === "Symbol" && Nn(r.expression.expression) === "globalThis" && Nu(r.expression.expression) === fe : !1;
- }
- function Jd(r) {
- return r ? Ea.get(r) : void 0;
- }
- function V0(r, a) {
- return r && Ea.set(r, a), a;
- }
- function gg(r) {
- if (r) {
- const a = Tr(r);
- if (a)
- if (vS(r)) {
- if (a.localJsxFragmentNamespace)
- return a.localJsxFragmentNamespace;
- const l = a.pragmas.get("jsxfrag");
- if (l) {
- const m = us(l) ? l[0] : l;
- if (a.localJsxFragmentFactory = Jx(m.arguments.factory, B), Ge(a.localJsxFragmentFactory, fu, l_), a.localJsxFragmentFactory)
- return a.localJsxFragmentNamespace = E_(a.localJsxFragmentFactory).escapedText;
- }
- const f = Xde(r);
- if (f)
- return a.localJsxFragmentFactory = f, a.localJsxFragmentNamespace = E_(f).escapedText;
- } else {
- const l = fk(a);
- if (l)
- return a.localJsxNamespace = l;
- }
- }
- return Lv || (Lv = "React", O.jsxFactory ? (ih = Jx(O.jsxFactory, B), Ge(ih, fu), ih && (Lv = E_(ih).escapedText)) : O.reactNamespace && (Lv = tc(O.reactNamespace))), ih || (ih = A.createQualifiedName(A.createIdentifier(Ei(Lv)), "createElement")), Lv;
- }
- function fk(r) {
- if (r.localJsxNamespace)
- return r.localJsxNamespace;
- const a = r.pragmas.get("jsx");
- if (a) {
- const l = us(a) ? a[0] : a;
- if (r.localJsxFactory = Jx(l.arguments.factory, B), Ge(r.localJsxFactory, fu, l_), r.localJsxFactory)
- return r.localJsxNamespace = E_(r.localJsxFactory).escapedText;
- }
- }
- function fu(r) {
- return wd(r, -1, -1), br(
- r,
- fu,
- /*context*/
- void 0
- );
- }
- function Gh(r, a, l) {
- return l || IIe(r, a), le;
- }
- function O_(r, a, ...l) {
- const f = r ? Kr(r, a, ...l) : Go(a, ...l), m = Da.lookup(f);
- return m || (Da.add(f), f);
- }
- function Mv(r, a, l, ...f) {
- const m = je(a, l, ...f);
- return m.skippedOn = r, m;
- }
- function Nm(r, a, ...l) {
- return r ? Kr(r, a, ...l) : Go(a, ...l);
- }
- function je(r, a, ...l) {
- const f = Nm(r, a, ...l);
- return Da.add(f), f;
- }
- function zd(r, a) {
- r ? Da.add(a) : c2.add({
- ...a,
- category: 2
- /* Suggestion */
- });
- }
- function Im(r, a, l, ...f) {
- if (a.pos < 0 || a.end < 0) {
- if (!r)
- return;
- const m = Tr(a);
- zd(r, "message" in l ? fl(m, 0, 0, l, ...f) : Qj(m, l));
- return;
- }
- zd(r, "message" in l ? Kr(a, l, ...f) : Rg(Tr(a), a, l));
- }
- function Rv(r, a, l, ...f) {
- const m = je(r, l, ...f);
- if (a) {
- const y = Kr(r, p.Did_you_forget_to_use_await);
- Rs(m, y);
- }
- return m;
- }
- function pk(r, a) {
- const l = Array.isArray(r) ? ir(r, fj) : fj(r);
- return l && Rs(
- a,
- Kr(l, p.The_declaration_was_marked_as_deprecated_here)
- ), c2.add(a), a;
- }
- function $h(r) {
- const a = Cf(r);
- return a && Nr(r.declarations) > 1 ? a.flags & 64 ? ut(r.declarations, q0) : Mi(r.declarations, q0) : !!r.valueDeclaration && q0(r.valueDeclaration) || Nr(r.declarations) && Mi(r.declarations, q0);
- }
- function q0(r) {
- return !!(J2(r) & 536870912);
- }
- function Xh(r, a, l) {
- const f = Kr(r, p._0_is_deprecated, l);
- return pk(a, f);
- }
- function dk(r, a, l, f) {
- const m = l ? Kr(r, p.The_signature_0_of_1_is_deprecated, f, l) : Kr(r, p._0_is_deprecated, f);
- return pk(a, m);
- }
- function fa(r, a, l) {
- d++;
- const f = new o(r | 33554432, a);
- return f.links = new Rye(), f.links.checkFlags = l || 0, f;
- }
- function gd(r, a) {
- const l = fa(1, r);
- return l.links.type = a, l;
- }
- function H0(r, a) {
- const l = fa(4, r);
- return l.links.type = a, l;
- }
- function jv(r) {
- let a = 0;
- return r & 2 && (a |= 111551), r & 1 && (a |= 111550), r & 4 && (a |= 0), r & 8 && (a |= 900095), r & 16 && (a |= 110991), r & 32 && (a |= 899503), r & 64 && (a |= 788872), r & 256 && (a |= 899327), r & 128 && (a |= 899967), r & 512 && (a |= 110735), r & 8192 && (a |= 103359), r & 32768 && (a |= 46015), r & 65536 && (a |= 78783), r & 262144 && (a |= 526824), r & 524288 && (a |= 788968), r & 2097152 && (a |= 2097152), a;
- }
- function xf(r, a) {
- a.mergeId || (a.mergeId = Lye, Lye++), fn[a.mergeId] = r;
- }
- function ah(r) {
- const a = fa(r.flags, r.escapedName);
- return a.declarations = r.declarations ? r.declarations.slice() : [], a.parent = r.parent, r.valueDeclaration && (a.valueDeclaration = r.valueDeclaration), r.constEnumOnlyModule && (a.constEnumOnlyModule = !0), r.members && (a.members = new Map(r.members)), r.exports && (a.exports = new Map(r.exports)), xf(a, r), a;
- }
- function Wd(r, a, l = !1) {
- if (!(r.flags & jv(a.flags)) || (a.flags | r.flags) & 67108864) {
- if (a === r)
- return r;
- if (!(r.flags & 33554432)) {
- const y = Mc(r);
- if (y === ze)
- return a;
- if (!(y.flags & jv(a.flags)) || (a.flags | y.flags) & 67108864)
- r = ah(y);
- else
- return f(r, a), a;
- }
- a.flags & 512 && r.flags & 512 && r.constEnumOnlyModule && !a.constEnumOnlyModule && (r.constEnumOnlyModule = !1), r.flags |= a.flags, a.valueDeclaration && l3(r, a.valueDeclaration), Fn(r.declarations, a.declarations), a.members && (r.members || (r.members = Js()), rd(r.members, a.members, l)), a.exports && (r.exports || (r.exports = Js()), rd(r.exports, a.exports, l, r)), l || xf(r, a);
- } else r.flags & 1024 ? r !== fe && je(
- a.declarations && os(a.declarations[0]),
- p.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,
- Ji(r)
- ) : f(r, a);
- return r;
- function f(y, x) {
- const N = !!(y.flags & 384 || x.flags & 384), j = !!(y.flags & 2 || x.flags & 2), W = N ? p.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : j ? p.Cannot_redeclare_block_scoped_variable_0 : p.Duplicate_identifier_0, Q = x.declarations && Tr(x.declarations[0]), ye = y.declarations && Tr(y.declarations[0]), de = u4(Q, O.checkJs), Ze = u4(ye, O.checkJs), ct = Ji(x);
- if (Q && ye && vc && !N && Q !== ye) {
- const mt = Sh(Q.path, ye.path) === -1 ? Q : ye, Gt = mt === Q ? ye : Q, sr = NE(vc, `${mt.path}|${Gt.path}`, () => ({ firstFile: mt, secondFile: Gt, conflictingSymbols: /* @__PURE__ */ new Map() })), Xr = NE(sr.conflictingSymbols, ct, () => ({ isBlockScoped: j, firstFileLocations: [], secondFileLocations: [] }));
- de || m(Xr.firstFileLocations, x), Ze || m(Xr.secondFileLocations, y);
- } else
- de || hg(x, W, ct, y), Ze || hg(y, W, ct, x);
- }
- function m(y, x) {
- if (x.declarations)
- for (const N of x.declarations)
- tp(y, N);
- }
- }
- function hg(r, a, l, f) {
- ir(r.declarations, (m) => {
- mk(m, a, l, f.declarations);
- });
- }
- function mk(r, a, l, f) {
- const m = (K1(
- r,
- /*isPrototypeAssignment*/
- !1
- ) ? iB(r) : os(r)) || r, y = O_(m, a, l);
- for (const x of f || Ue) {
- const N = (K1(
- x,
- /*isPrototypeAssignment*/
- !1
- ) ? iB(x) : os(x)) || x;
- if (N === m) continue;
- y.relatedInformation = y.relatedInformation || [];
- const j = Kr(N, p._0_was_also_declared_here, l), W = Kr(N, p.and_here);
- Nr(y.relatedInformation) >= 5 || ut(
- y.relatedInformation,
- (Q) => R4(Q, W) === 0 || R4(Q, j) === 0
- /* EqualTo */
- ) || Rs(y, Nr(y.relatedInformation) ? W : j);
- }
- }
- function l1(r, a) {
- if (!r?.size) return a;
- if (!a?.size) return r;
- const l = Js();
- return rd(l, r), rd(l, a), l;
- }
- function rd(r, a, l = !1, f) {
- a.forEach((m, y) => {
- const x = r.get(y), N = x ? Wd(x, m, l) : Ra(m);
- f && x && (N.parent = f), r.set(y, N);
- });
- }
- function gk(r) {
- var a, l, f;
- const m = r.parent;
- if (((a = m.symbol.declarations) == null ? void 0 : a[0]) !== m) {
- E.assert(m.symbol.declarations.length > 1);
- return;
- }
- if (ig(m))
- rd(Te, m.symbol.exports);
- else {
- const y = r.parent.parent.flags & 33554432 ? void 0 : p.Invalid_module_name_in_augmentation_module_0_cannot_be_found;
- let x = p2(
- r,
- r,
- y,
- /*ignoreErrors*/
- !1,
- /*isForAugmentation*/
- !0
- );
- if (!x)
- return;
- if (x = M_(x), x.flags & 1920)
- if (ut(_c, (N) => x === N.symbol)) {
- const N = Wd(
- m.symbol,
- x,
- /*unidirectional*/
- !0
- );
- Wf || (Wf = /* @__PURE__ */ new Map()), Wf.set(r.text, N);
- } else {
- if ((l = x.exports) != null && l.get(
- "__export"
- /* ExportStar */
- ) && ((f = m.symbol.exports) != null && f.size)) {
- const N = P_e(
- x,
- "resolvedExports"
- /* resolvedExports */
- );
- for (const [j, W] of as(m.symbol.exports.entries()))
- N.has(j) && !x.exports.has(j) && Wd(N.get(j), W);
- }
- Wd(x, m.symbol);
- }
- else
- je(r, p.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, r.text);
- }
- }
- function G0() {
- const r = we.escapedName, a = Te.get(r);
- a ? ir(a.declarations, (l) => {
- hx(l) || Da.add(Kr(l, p.Declaration_name_conflicts_with_built_in_global_identifier_0, Ei(r)));
- }) : Te.set(r, we);
- }
- function Bi(r) {
- if (r.flags & 33554432) return r.links;
- const a = na(r);
- return ks[a] ?? (ks[a] = new Rye());
- }
- function bn(r) {
- const a = Ma(r);
- return po[a] || (po[a] = new _Me());
- }
- function Al(r, a, l) {
- if (l) {
- const f = Ra(r.get(a));
- if (f && (f.flags & l || f.flags & 2097152 && Pu(f) & l))
- return f;
- }
- }
- function Qh(r, a) {
- const l = r.parent, f = r.parent.parent, m = Al(
- l.locals,
- a,
- 111551
- /* Value */
- ), y = Al(
- k1(f.symbol),
- a,
- 111551
- /* Value */
- );
- return m && y ? [m, y] : E.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
- }
- function $0(r, a) {
- const l = Tr(r), f = Tr(a), m = Cd(r);
- if (l !== f) {
- if (z && (l.externalModuleIndicator || f.externalModuleIndicator) || !O.outFile || ax(a) || r.flags & 33554432 || x(a, r))
- return !0;
- const j = e.getSourceFiles();
- return j.indexOf(l) <= j.indexOf(f);
- }
- if (a.flags & 16777216 || ax(a) || ope(a))
- return !0;
- if (r.pos <= a.pos && !(cs(r) && Qw(a.parent) && !r.initializer && !r.exclamationToken)) {
- if (r.kind === 208) {
- const j = nv(
- a,
- 208
- /* BindingElement */
- );
- return j ? or(j, va) !== or(r, va) || r.pos < j.pos : $0(nv(
- r,
- 260
- /* VariableDeclaration */
- ), a);
- } else {
- if (r.kind === 260)
- return !y(r, a);
- if (Zn(r)) {
- const j = or(a, (W) => W === r ? "quit" : ma(W) ? W.parent.parent === r : !X && dl(W) && (W.parent === r || hc(W.parent) && W.parent.parent === r || Ew(W.parent) && W.parent.parent === r || cs(W.parent) && W.parent.parent === r || Ii(W.parent) && W.parent.parent.parent === r));
- return j ? !X && dl(j) ? !!or(a, (W) => W === j ? "quit" : ys(W) && !bb(W)) : !1 : !0;
- } else {
- if (cs(r))
- return !N(
- r,
- a,
- /*stopAtAnyPropertyDeclaration*/
- !1
- );
- if (G_(r, r.parent))
- return !(V && Ol(r) === Ol(a) && x(a, r));
- }
- }
- return !0;
- }
- if (a.parent.kind === 281 || a.parent.kind === 277 && a.parent.isExportEquals || a.kind === 277 && a.isExportEquals)
- return !0;
- if (x(a, r))
- return V && Ol(r) && (cs(r) || G_(r, r.parent)) ? !N(
- r,
- a,
- /*stopAtAnyPropertyDeclaration*/
- !0
- ) : !0;
- return !1;
- function y(j, W) {
- switch (j.parent.parent.kind) {
- case 243:
- case 248:
- case 250:
- if (US(W, j, m))
- return !0;
- break;
- }
- const Q = j.parent.parent;
- return Z2(Q) && US(W, Q.expression, m);
- }
- function x(j, W) {
- return !!or(j, (Q) => {
- if (Q === m)
- return "quit";
- if (ys(Q))
- return !0;
- if (oc(Q))
- return W.pos < j.pos;
- const ye = Wn(Q.parent, cs);
- if (ye && ye.initializer === Q) {
- if (zs(Q.parent)) {
- if (W.kind === 174)
- return !0;
- if (cs(W) && Ol(j) === Ol(W)) {
- const Ze = W.name;
- if (Oe(Ze) || Di(Ze)) {
- const ct = nn(Tn(W)), mt = Ln(W.parent.members, oc);
- if (alt(Ze, ct, mt, W.parent.pos, Q.pos))
- return !0;
- }
- }
- } else if (!(W.kind === 172 && !zs(W)) || Ol(j) !== Ol(W))
- return !0;
- }
- return !1;
- });
- }
- function N(j, W, Q) {
- return W.end > j.end ? !1 : or(W, (de) => {
- if (de === j)
- return "quit";
- switch (de.kind) {
- case 219:
- return !0;
- case 172:
- return Q && (cs(j) && de.parent === j.parent || G_(j, j.parent) && de.parent === j.parent.parent) ? "quit" : !0;
- case 241:
- switch (de.parent.kind) {
- case 177:
- case 174:
- case 178:
- return !0;
- default:
- return !1;
- }
- default:
- return !1;
- }
- }) === void 0;
- }
- }
- function JS(r) {
- return bn(r).declarationRequiresScopeChange;
- }
- function u1(r, a) {
- bn(r).declarationRequiresScopeChange = a;
- }
- function zS(r, a, l, f) {
- return V ? !1 : (r && !f && u2(r, a, a) || je(
- r,
- r && l.type && vw(l.type, r.pos) ? p.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : p.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,
- _o(l.name),
- Tp(a)
- ), !0);
- }
- function Do(r, a, l, f) {
- const m = _s(a) ? a : a.escapedText;
- n(() => {
- if (!r || r.parent.kind !== 324 && !u2(r, m, a) && !WS(r) && !H6(r, m, l) && !hs(r, m) && !ln(r, m, l) && !X0(r, m, l) && !Sn(r, m, l)) {
- let y, x;
- if (a && (x = sst(a), x && je(r, f, Tp(a), x)), !x && _n < yi && (y = N8e(r, m, l), y?.valueDeclaration && Fu(y.valueDeclaration) && ig(y.valueDeclaration) && (y = void 0), y)) {
- const j = Ji(y), W = zpe(
- r,
- y,
- /*excludeClasses*/
- !1
- ), Q = l === 1920 || a && typeof a != "string" && fo(a) ? p.Cannot_find_namespace_0_Did_you_mean_1 : W ? p.Could_not_find_name_0_Did_you_mean_1 : p.Cannot_find_name_0_Did_you_mean_1, ye = Nm(r, Q, Tp(a), j);
- ye.canonicalHead = vZ(f, Tp(a)), zd(!W, ye), y.valueDeclaration && Rs(
- ye,
- Kr(y.valueDeclaration, p._0_is_declared_here, j)
- );
- }
- !y && !x && a && je(r, f, Tp(a)), _n++;
- }
- });
- }
- function Yh(r, a, l, f, m, y) {
- n(() => {
- var x;
- const N = a.escapedName, j = f && Si(f) && X_(f);
- if (r && (l & 2 || (l & 32 || l & 384) && (l & 111551) === 111551)) {
- const W = _f(a);
- (W.flags & 2 || W.flags & 32 || W.flags & 384) && G6(W, r);
- }
- if (j && (l & 111551) === 111551 && !(r.flags & 16777216)) {
- const W = Ra(a);
- Nr(W.declarations) && Mi(W.declarations, (Q) => iA(Q) || Si(Q) && !!Q.symbol.globalExports) && Im(!O.allowUmdGlobalAccess, r, p._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, Ei(N));
- }
- if (m && !y && (l & 111551) === 111551) {
- const W = Ra(mG(a)), Q = pm(m);
- W === Tn(m) ? je(r, p.Parameter_0_cannot_reference_itself, _o(m.name)) : W.valueDeclaration && W.valueDeclaration.pos > m.pos && Q.parent.locals && Al(Q.parent.locals, W.escapedName, l) === W && je(r, p.Parameter_0_cannot_reference_identifier_1_declared_after_it, _o(m.name), _o(r));
- }
- if (r && l & 111551 && a.flags & 2097152 && !(a.flags & 111551) && !av(r)) {
- const W = Fm(
- a,
- 111551
- /* Value */
- );
- if (W) {
- const Q = W.kind === 281 || W.kind === 278 || W.kind === 280 ? p._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : p._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type, ye = Ei(N);
- l2(
- je(r, Q, ye),
- W,
- ye
- );
- }
- }
- if (O.isolatedModules && a && j && (l & 111551) === 111551) {
- const Q = Al(Te, N, l) === a && Si(f) && f.locals && Al(
- f.locals,
- N,
- -111552
- /* Value */
- );
- if (Q) {
- const ye = (x = Q.declarations) == null ? void 0 : x.find(
- (de) => de.kind === 276 || de.kind === 273 || de.kind === 274 || de.kind === 271
- /* ImportEqualsDeclaration */
- );
- ye && !i4(ye) && je(ye, p.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, Ei(N));
- }
- }
- });
- }
- function l2(r, a, l) {
- return a ? Rs(
- r,
- Kr(
- a,
- a.kind === 281 || a.kind === 278 || a.kind === 280 ? p._0_was_exported_here : p._0_was_imported_here,
- l
- )
- ) : r;
- }
- function Tp(r) {
- return _s(r) ? Ei(r) : _o(r);
- }
- function u2(r, a, l) {
- if (!Oe(r) || r.escapedText !== a || OIe(r) || ax(r))
- return !1;
- const f = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- let m = f;
- for (; m; ) {
- if (Zn(m.parent)) {
- const y = Tn(m.parent);
- if (!y)
- break;
- const x = nn(y);
- if (Gs(x, a))
- return je(r, p.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, Tp(l), Ji(y)), !0;
- if (m === f && !zs(m)) {
- const N = bo(y).thisType;
- if (Gs(N, a))
- return je(r, p.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, Tp(l)), !0;
- }
- }
- m = m.parent;
- }
- return !1;
- }
- function WS(r) {
- const a = q6(r);
- return a && Yo(
- a,
- 64,
- /*ignoreErrors*/
- !0
- ) ? (je(r, p.Cannot_extend_an_interface_0_Did_you_mean_implements, nc(a)), !0) : !1;
- }
- function q6(r) {
- switch (r.kind) {
- case 80:
- case 211:
- return r.parent ? q6(r.parent) : void 0;
- case 233:
- if (yo(r.expression))
- return r.expression;
- default:
- return;
- }
- }
- function H6(r, a, l) {
- const f = 1920 | (cn(r) ? 111551 : 0);
- if (l === f) {
- const m = Mc(Nt(
- r,
- a,
- 788968 & ~f,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- )), y = r.parent;
- if (m) {
- if (Xu(y)) {
- E.assert(y.left === r, "Should only be resolving left side of qualified name as a namespace");
- const x = y.right.escapedText;
- if (Gs(bo(m), x))
- return je(
- y,
- p.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,
- Ei(a),
- Ei(x)
- ), !0;
- }
- return je(r, p._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, Ei(a)), !0;
- }
- }
- return !1;
- }
- function Sn(r, a, l) {
- if (l & 788584) {
- const f = Mc(Nt(
- r,
- a,
- 111127,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- ));
- if (f && !(f.flags & 1920))
- return je(r, p._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, Ei(a)), !0;
- }
- return !1;
- }
- function pu(r) {
- return r === "any" || r === "string" || r === "number" || r === "boolean" || r === "never" || r === "unknown";
- }
- function hs(r, a) {
- return pu(a) && r.parent.kind === 281 ? (je(r, p.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, a), !0) : !1;
- }
- function X0(r, a, l) {
- if (l & 111551) {
- if (pu(a)) {
- const y = r.parent.parent;
- if (y && y.parent && ef(y)) {
- const x = y.token, N = y.parent.kind;
- N === 264 && x === 96 ? je(r, p.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, Ei(a)) : N === 263 && x === 96 ? je(r, p.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, Ei(a)) : N === 263 && x === 119 && je(r, p.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, Ei(a));
- } else
- je(r, p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, Ei(a));
- return !0;
- }
- const f = Mc(Nt(
- r,
- a,
- 788544,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- )), m = f && Pu(f);
- if (f && m !== void 0 && !(m & 111551)) {
- const y = Ei(a);
- return Bv(a) ? je(r, p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, y) : hk(r, f) ? je(r, p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, y, y === "K" ? "P" : "K") : je(r, p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, y), !0;
- }
- }
- return !1;
- }
- function hk(r, a) {
- const l = or(r.parent, (f) => ma(f) || m_(f) ? !1 : Qu(f) || "quit");
- if (l && l.members.length === 1) {
- const f = bo(a);
- return !!(f.flags & 1048576) && HN(
- f,
- 384,
- /*strict*/
- !0
- );
- }
- return !1;
- }
- function Bv(r) {
- switch (r) {
- case "Promise":
- case "Symbol":
- case "Map":
- case "WeakMap":
- case "Set":
- case "WeakSet":
- return !0;
- }
- return !1;
- }
- function ln(r, a, l) {
- if (l & 111127) {
- if (Mc(Nt(
- r,
- a,
- 1024,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- )))
- return je(
- r,
- p.Cannot_use_namespace_0_as_a_value,
- Ei(a)
- ), !0;
- } else if (l & 788544 && Mc(Nt(
- r,
- a,
- 1536,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- )))
- return je(r, p.Cannot_use_namespace_0_as_a_type, Ei(a)), !0;
- return !1;
- }
- function G6(r, a) {
- var l;
- if (E.assert(!!(r.flags & 2 || r.flags & 32 || r.flags & 384)), r.flags & 67108881 && r.flags & 32)
- return;
- const f = (l = r.declarations) == null ? void 0 : l.find(
- (m) => Jj(m) || Zn(m) || m.kind === 266
- /* EnumDeclaration */
- );
- if (f === void 0) return E.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");
- if (!(f.flags & 33554432) && !$0(f, a)) {
- let m;
- const y = _o(os(f));
- r.flags & 2 ? m = je(a, p.Block_scoped_variable_0_used_before_its_declaration, y) : r.flags & 32 ? m = je(a, p.Class_0_used_before_its_declaration, y) : r.flags & 256 ? m = je(a, p.Enum_0_used_before_its_declaration, y) : (E.assert(!!(r.flags & 128)), Wp(O) && (m = je(a, p.Enum_0_used_before_its_declaration, y))), m && Rs(m, Kr(f, p._0_is_declared_here, y));
- }
- }
- function US(r, a, l) {
- return !!a && !!or(r, (f) => f === a || (f === l || ys(f) && (!bb(f) || Jc(f) & 3) ? "quit" : !1));
- }
- function Eu(r) {
- switch (r.kind) {
- case 271:
- return r;
- case 273:
- return r.parent;
- case 274:
- return r.parent.parent;
- case 276:
- return r.parent.parent.parent;
- default:
- return;
- }
- }
- function Du(r) {
- return r.declarations && ob(r.declarations, kf);
- }
- function kf(r) {
- return r.kind === 271 || r.kind === 270 || r.kind === 273 && !!r.name || r.kind === 274 || r.kind === 280 || r.kind === 276 || r.kind === 281 || r.kind === 277 && h3(r) || dn(r) && Cc(r) === 2 && h3(r) || xo(r) && dn(r.parent) && r.parent.left === r && r.parent.operatorToken.kind === 64 && Jv(r.parent.right) || r.kind === 304 || r.kind === 303 && Jv(r.initializer) || r.kind === 260 && Sb(r) || r.kind === 208 && Sb(r.parent.parent);
- }
- function Jv(r) {
- return O7(r) || vo(r) && qm(r);
- }
- function VS(r, a) {
- const l = kl(r);
- if (l) {
- const m = LC(l.expression).arguments[0];
- return Oe(l.name) ? Mc(Gs(fwe(m), l.name.escapedText)) : void 0;
- }
- if (ii(r) || r.moduleReference.kind === 283) {
- const m = v_(
- r,
- nB(r) || g4(r)
- ), y = M_(m);
- return L_(
- r,
- m,
- y,
- /*overwriteEmpty*/
- !1
- ), y;
- }
- const f = vk(r.moduleReference, a);
- return oh(r, f), f;
- }
- function oh(r, a) {
- if (L_(
- r,
- /*immediateTarget*/
- void 0,
- a,
- /*overwriteEmpty*/
- !1
- ) && !r.isTypeOnly) {
- const l = Fm(Tn(r)), f = l.kind === 281 || l.kind === 278, m = f ? p.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : p.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type, y = f ? p._0_was_exported_here : p._0_was_imported_here, x = l.kind === 278 ? "*" : Fy(l.name);
- Rs(je(r.moduleReference, m), Kr(l, y, x));
- }
- }
- function F_(r, a, l, f) {
- const m = r.exports.get(
- "export="
- /* ExportEquals */
- ), y = m ? Gs(
- nn(m),
- a,
- /*skipObjectFunctionPropertyAugment*/
- !0
- ) : r.exports.get(a), x = Mc(y, f);
- return L_(
- l,
- y,
- x,
- /*overwriteEmpty*/
- !1
- ), x;
- }
- function Om(r) {
- return wo(r) && !r.isExportEquals || Gn(
- r,
- 2048
- /* Default */
- ) || vu(r) || ug(r);
- }
- function Gf(r) {
- return Xa(r) ? e.getEmitSyntaxForUsageLocation(Tr(r), r) : void 0;
- }
- function Q0(r, a) {
- return r === 99 && a === 1;
- }
- function Y0(r) {
- return 100 <= z && z <= 199 ? Gf(r) === 99 && Zo(
- r.text,
- ".json"
- /* Json */
- ) : !1;
- }
- function _2(r, a, l, f) {
- const m = r && Gf(f);
- if (r && m !== void 0) {
- const y = e.getImpliedNodeFormatForEmit(r);
- if (m === 99 && y === 1 && 100 <= z && z <= 199)
- return !0;
- if (m === 99 && y === 99)
- return !1;
- }
- if (!ae)
- return !1;
- if (!r || r.isDeclarationFile) {
- const y = F_(
- a,
- "default",
- /*sourceNode*/
- void 0,
- /*dontResolveAlias*/
- !0
- );
- return !(y && ut(y.declarations, Om) || F_(
- a,
- tc("__esModule"),
- /*sourceNode*/
- void 0,
- l
- ));
- }
- return Gu(r) ? typeof r.externalModuleIndicator != "object" && !F_(
- a,
- tc("__esModule"),
- /*sourceNode*/
- void 0,
- l
- ) : eT(a);
- }
- function qS(r, a) {
- const l = v_(r, r.parent.moduleSpecifier);
- if (l)
- return _1(l, r, a);
- }
- function _1(r, a, l) {
- var f;
- let m;
- Jw(r) ? m = r : m = F_(r, "default", a, l);
- const y = (f = r.declarations) == null ? void 0 : f.find(Si), x = HS(a);
- if (!x)
- return m;
- const N = Y0(x), j = _2(y, r, l, x);
- if (!m && !j && !N)
- if (eT(r) && !ae) {
- const W = z >= 5 ? "allowSyntheticDefaultImports" : "esModuleInterop", ye = r.exports.get(
- "export="
- /* ExportEquals */
- ).valueDeclaration, de = je(a.name, p.Module_0_can_only_be_default_imported_using_the_1_flag, Ji(r), W);
- ye && Rs(
- de,
- Kr(
- ye,
- p.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,
- W
- )
- );
- } else Ad(a) ? GS(r, a) : Zh(r, r, a, G1(a) && a.propertyName || a.name);
- else if (j || N) {
- const W = M_(r, l) || Mc(r, l);
- return L_(
- a,
- r,
- W,
- /*overwriteEmpty*/
- !1
- ), W;
- }
- return L_(
- a,
- m,
- /*finalTarget*/
- void 0,
- /*overwriteEmpty*/
- !1
- ), m;
- }
- function HS(r) {
- switch (r.kind) {
- case 273:
- return r.parent.moduleSpecifier;
- case 271:
- return Fh(r.moduleReference) ? r.moduleReference.expression : void 0;
- case 274:
- return r.parent.parent.moduleSpecifier;
- case 276:
- return r.parent.parent.parent.moduleSpecifier;
- case 281:
- return r.parent.parent.moduleSpecifier;
- default:
- return E.assertNever(r);
- }
- }
- function GS(r, a) {
- var l, f, m;
- if ((l = r.exports) != null && l.has(a.symbol.escapedName))
- je(
- a.name,
- p.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,
- Ji(r),
- Ji(a.symbol)
- );
- else {
- const y = je(a.name, p.Module_0_has_no_default_export, Ji(r)), x = (f = r.exports) == null ? void 0 : f.get(
- "__export"
- /* ExportStar */
- );
- if (x) {
- const N = (m = x.declarations) == null ? void 0 : m.find(
- (j) => {
- var W, Q;
- return !!(Nc(j) && j.moduleSpecifier && ((Q = (W = v_(j, j.moduleSpecifier)) == null ? void 0 : W.exports) != null && Q.has(
- "default"
- /* Default */
- )));
- }
- );
- N && Rs(y, Kr(N, p.export_Asterisk_does_not_re_export_a_default));
- }
- }
- }
- function $S(r, a) {
- const l = r.parent.parent.moduleSpecifier, f = v_(r, l), m = m1(
- f,
- l,
- a,
- /*suppressInteropError*/
- !1
- );
- return L_(
- r,
- f,
- m,
- /*overwriteEmpty*/
- !1
- ), m;
- }
- function Ud(r, a) {
- const l = r.parent.moduleSpecifier, f = l && v_(r, l), m = l && m1(
- f,
- l,
- a,
- /*suppressInteropError*/
- !1
- );
- return L_(
- r,
- f,
- m,
- /*overwriteEmpty*/
- !1
- ), m;
- }
- function $6(r, a) {
- if (r === ze && a === ze)
- return ze;
- if (r.flags & 790504)
- return r;
- const l = fa(r.flags | a.flags, r.escapedName);
- return E.assert(r.declarations || a.declarations), l.declarations = cb(Qi(r.declarations, a.declarations), by), l.parent = r.parent || a.parent, r.valueDeclaration && (l.valueDeclaration = r.valueDeclaration), a.members && (l.members = new Map(a.members)), r.exports && (l.exports = new Map(r.exports)), l;
- }
- function zv(r, a, l, f) {
- var m;
- if (r.flags & 1536) {
- const y = n_(r).get(a), x = Mc(y, f), N = (m = Bi(r).typeOnlyExportStarMap) == null ? void 0 : m.get(a);
- return L_(
- l,
- y,
- x,
- /*overwriteEmpty*/
- !1,
- N,
- a
- ), x;
- }
- }
- function f1(r, a) {
- if (r.flags & 3) {
- const l = r.valueDeclaration.type;
- if (l)
- return Mc(Gs(Ci(l), a));
- }
- }
- function ch(r, a, l = !1) {
- var f;
- const m = nB(r) || r.moduleSpecifier, y = v_(r, m), x = !Cn(a) && a.propertyName || a.name;
- if (!Oe(x) && x.kind !== 11)
- return;
- const N = hb(x), W = m1(
- y,
- m,
- /*dontResolveAlias*/
- !1,
- N === "default" && ae
- );
- if (W && (N || x.kind === 11)) {
- if (Jw(y))
- return y;
- let Q;
- y && y.exports && y.exports.get(
- "export="
- /* ExportEquals */
- ) ? Q = Gs(
- nn(W),
- N,
- /*skipObjectFunctionPropertyAugment*/
- !0
- ) : Q = f1(W, N), Q = Mc(Q, l);
- let ye = zv(W, N, a, l);
- if (ye === void 0 && N === "default") {
- const Ze = (f = y.declarations) == null ? void 0 : f.find(Si);
- (Y0(m) || _2(Ze, y, l, m)) && (ye = M_(y, l) || Mc(y, l));
- }
- const de = ye && Q && ye !== Q ? $6(Q, ye) : ye || Q;
- return de || Zh(y, W, r, x), de;
- }
- }
- function Zh(r, a, l, f) {
- var m;
- const y = K0(r, l), x = _o(f), N = Oe(f) ? Vpe(f, a) : void 0;
- if (N !== void 0) {
- const j = Ji(N), W = je(f, p._0_has_no_exported_member_named_1_Did_you_mean_2, y, x, j);
- N.valueDeclaration && Rs(W, Kr(N.valueDeclaration, p._0_is_declared_here, j));
- } else
- (m = r.exports) != null && m.has(
- "default"
- /* Default */
- ) ? je(
- f,
- p.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,
- y,
- x
- ) : hd(l, f, x, r, y);
- }
- function hd(r, a, l, f, m) {
- var y, x;
- const N = (x = (y = Wn(f.valueDeclaration, tg)) == null ? void 0 : y.locals) == null ? void 0 : x.get(hb(a)), j = f.exports;
- if (N) {
- const W = j?.get(
- "export="
- /* ExportEquals */
- );
- if (W)
- nd(W, N) ? Z0(r, a, l, m) : je(a, p.Module_0_has_no_exported_member_1, m, l);
- else {
- const Q = j ? On(U_e(j), (de) => !!nd(de, N)) : void 0, ye = Q ? je(a, p.Module_0_declares_1_locally_but_it_is_exported_as_2, m, l, Ji(Q)) : je(a, p.Module_0_declares_1_locally_but_it_is_not_exported, m, l);
- N.declarations && Rs(ye, ...lr(N.declarations, (de, Ze) => Kr(de, Ze === 0 ? p._0_is_declared_here : p.and_here, l)));
- }
- } else
- je(a, p.Module_0_has_no_exported_member_1, m, l);
- }
- function Z0(r, a, l, f) {
- if (z >= 5) {
- const m = Wg(O) ? p._0_can_only_be_imported_by_using_a_default_import : p._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
- je(a, m, l);
- } else if (cn(r)) {
- const m = Wg(O) ? p._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import : p._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
- je(a, m, l);
- } else {
- const m = Wg(O) ? p._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import : p._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
- je(a, m, l, l, f);
- }
- }
- function XS(r, a) {
- if (Zu(r) && ng(r.propertyName || r.name)) {
- const x = HS(r), N = x && v_(r, x);
- if (N)
- return _1(N, r, a);
- }
- const l = va(r) ? pm(r) : r.parent.parent.parent, f = kl(l), m = ch(l, f || r, a), y = r.propertyName || r.name;
- return f && m && Oe(y) ? Mc(Gs(nn(m), y.escapedText), a) : (L_(
- r,
- /*immediateTarget*/
- void 0,
- m,
- /*overwriteEmpty*/
- !1
- ), m);
- }
- function kl(r) {
- if (ii(r) && r.initializer && Cn(r.initializer))
- return r.initializer;
- }
- function QS(r, a) {
- if (kd(r.parent)) {
- const l = M_(r.parent.symbol, a);
- return L_(
- r,
- /*immediateTarget*/
- void 0,
- l,
- /*overwriteEmpty*/
- !1
- ), l;
- }
- }
- function yg(r, a, l) {
- const f = r.propertyName || r.name;
- if (ng(f)) {
- const y = HS(r), x = y && v_(r, y);
- if (x)
- return _1(x, r, !!l);
- }
- const m = r.parent.parent.moduleSpecifier ? ch(r.parent.parent, r, l) : f.kind === 11 ? void 0 : (
- // Skip for invalid syntax like this: export { "x" }
- Yo(
- f,
- a,
- /*ignoreErrors*/
- !1,
- l
- )
- );
- return L_(
- r,
- /*immediateTarget*/
- void 0,
- m,
- /*overwriteEmpty*/
- !1
- ), m;
- }
- function YS(r, a) {
- const l = wo(r) ? r.expression : r.right, f = Wv(l, a);
- return L_(
- r,
- /*immediateTarget*/
- void 0,
- f,
- /*overwriteEmpty*/
- !1
- ), f;
- }
- function Wv(r, a) {
- if ($c(r))
- return wc(r).symbol;
- if (!l_(r) && !yo(r))
- return;
- const l = Yo(
- r,
- 901119,
- /*ignoreErrors*/
- !0,
- a
- );
- return l || (wc(r), bn(r).resolvedSymbol);
- }
- function Kh(r, a) {
- if (dn(r.parent) && r.parent.left === r && r.parent.operatorToken.kind === 64)
- return Wv(r.parent.right, a);
- }
- function p1(r, a = !1) {
- switch (r.kind) {
- case 271:
- case 260:
- return VS(r, a);
- case 273:
- return qS(r, a);
- case 274:
- return $S(r, a);
- case 280:
- return Ud(r, a);
- case 276:
- case 208:
- return XS(r, a);
- case 281:
- return yg(r, 901119, a);
- case 277:
- case 226:
- return YS(r, a);
- case 270:
- return QS(r, a);
- case 304:
- return Yo(
- r.name,
- 901119,
- /*ignoreErrors*/
- !0,
- a
- );
- case 303:
- return Wv(r.initializer, a);
- case 212:
- case 211:
- return Kh(r, a);
- default:
- return E.fail();
- }
- }
- function f2(r, a = 901119) {
- return r ? (r.flags & (2097152 | a)) === 2097152 || !!(r.flags & 2097152 && r.flags & 67108864) : !1;
- }
- function Mc(r, a) {
- return !a && f2(r) ? Zl(r) : r;
- }
- function Zl(r) {
- E.assert((r.flags & 2097152) !== 0, "Should only get Alias here.");
- const a = Bi(r);
- if (a.aliasTarget)
- a.aliasTarget === K && (a.aliasTarget = ze);
- else {
- a.aliasTarget = K;
- const l = Du(r);
- if (!l) return E.fail();
- const f = p1(l);
- a.aliasTarget === K ? a.aliasTarget = f || ze : je(l, p.Circular_definition_of_import_alias_0, Ji(r));
- }
- return a.aliasTarget;
- }
- function X6(r) {
- if (Bi(r).aliasTarget !== K)
- return Zl(r);
- }
- function Pu(r, a, l) {
- const f = a && Fm(r), m = f && Nc(f), y = f && (m ? v_(
- f.moduleSpecifier,
- f.moduleSpecifier,
- /*ignoreErrors*/
- !0
- ) : Zl(f.symbol)), x = m && y ? lh(y) : void 0;
- let N = l ? 0 : r.flags, j;
- for (; r.flags & 2097152; ) {
- const W = _f(Zl(r));
- if (!m && W === y || x?.get(W.escapedName) === W)
- break;
- if (W === ze)
- return -1;
- if (W === r || j?.has(W))
- break;
- W.flags & 2097152 && (j ? j.add(W) : j = /* @__PURE__ */ new Set([r, W])), N |= W.flags, r = W;
- }
- return N;
- }
- function L_(r, a, l, f, m, y) {
- if (!r || Cn(r)) return !1;
- const x = Tn(r);
- if (Py(r)) {
- const j = Bi(x);
- return j.typeOnlyDeclaration = r, !0;
- }
- if (m) {
- const j = Bi(x);
- return j.typeOnlyDeclaration = m, x.escapedName !== y && (j.typeOnlyExportStarName = y), !0;
- }
- const N = Bi(x);
- return yk(N, a, f) || yk(N, l, f);
- }
- function yk(r, a, l) {
- var f;
- if (a && (r.typeOnlyDeclaration === void 0 || l && r.typeOnlyDeclaration === !1)) {
- const m = ((f = a.exports) == null ? void 0 : f.get(
- "export="
- /* ExportEquals */
- )) ?? a, y = m.declarations && On(m.declarations, Py);
- r.typeOnlyDeclaration = y ?? Bi(m).typeOnlyDeclaration ?? !1;
- }
- return !!r.typeOnlyDeclaration;
- }
- function Fm(r, a) {
- var l;
- if (!(r.flags & 2097152))
- return;
- const f = Bi(r);
- if (f.typeOnlyDeclaration === void 0) {
- f.typeOnlyDeclaration = !1;
- const m = Mc(r);
- L_(
- (l = r.declarations) == null ? void 0 : l[0],
- Du(r) && h$(r),
- m,
- /*overwriteEmpty*/
- !0
- );
- }
- if (a === void 0)
- return f.typeOnlyDeclaration || void 0;
- if (f.typeOnlyDeclaration) {
- const m = f.typeOnlyDeclaration.kind === 278 ? Mc(lh(f.typeOnlyDeclaration.symbol.parent).get(f.typeOnlyExportStarName || r.escapedName)) : Zl(f.typeOnlyDeclaration.symbol);
- return Pu(m) & a ? f.typeOnlyDeclaration : void 0;
- }
- }
- function vk(r, a) {
- return r.kind === 80 && A4(r) && (r = r.parent), r.kind === 80 || r.parent.kind === 166 ? Yo(
- r,
- 1920,
- /*ignoreErrors*/
- !1,
- a
- ) : (E.assert(
- r.parent.kind === 271
- /* ImportEqualsDeclaration */
- ), Yo(
- r,
- 901119,
- /*ignoreErrors*/
- !1,
- a
- ));
- }
- function K0(r, a) {
- return r.parent ? K0(r.parent, a) + "." + Ji(r) : Ji(
- r,
- a,
- /*meaning*/
- void 0,
- 36
- /* AllowAnyNodeKind */
- );
- }
- function ZS(r) {
- for (; Xu(r.parent); )
- r = r.parent;
- return r;
- }
- function gP(r) {
- let a = E_(r), l = Nt(
- a,
- a,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- if (l) {
- for (; Xu(a.parent); ) {
- const f = nn(l);
- if (l = Gs(f, a.parent.right.escapedText), !l)
- return;
- a = a.parent;
- }
- return l;
- }
- }
- function Yo(r, a, l, f, m) {
- if (rc(r))
- return;
- const y = 1920 | (cn(r) ? a & 111551 : 0);
- let x;
- if (r.kind === 80) {
- const N = a === y || fo(r) ? p.Cannot_find_namespace_0 : uAe(E_(r)), j = cn(r) && !fo(r) ? Q6(r, a) : void 0;
- if (x = Ra(Nt(
- m || r,
- r,
- a,
- l || j ? void 0 : N,
- /*isUse*/
- !0,
- /*excludeGlobals*/
- !1
- )), !x)
- return Ra(j);
- } else if (r.kind === 166 || r.kind === 211) {
- const N = r.kind === 166 ? r.left : r.expression, j = r.kind === 166 ? r.right : r.name;
- let W = Yo(
- N,
- y,
- l,
- /*dontResolveAlias*/
- !1,
- m
- );
- if (!W || rc(j))
- return;
- if (W === ze)
- return W;
- if (W.valueDeclaration && cn(W.valueDeclaration) && yu(O) !== 100 && ii(W.valueDeclaration) && W.valueDeclaration.initializer && tNe(W.valueDeclaration.initializer)) {
- const Q = W.valueDeclaration.initializer.arguments[0], ye = v_(Q, Q);
- if (ye) {
- const de = M_(ye);
- de && (W = de);
- }
- }
- if (x = Ra(Al(n_(W), j.escapedText, a)), !x && W.flags & 2097152 && (x = Ra(Al(n_(Zl(W)), j.escapedText, a))), !x) {
- if (!l) {
- const Q = K0(W), ye = _o(j), de = Vpe(j, W);
- if (de) {
- je(j, p._0_has_no_exported_member_named_1_Did_you_mean_2, Q, ye, Ji(de));
- return;
- }
- const Ze = Xu(r) && ZS(r);
- if (Lc && a & 788968 && Ze && !GC(Ze.parent) && gP(Ze)) {
- je(
- Ze,
- p._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,
- $_(Ze)
- );
- return;
- }
- if (a & 1920 && Xu(r.parent)) {
- const mt = Ra(Al(
- n_(W),
- j.escapedText,
- 788968
- /* Type */
- ));
- if (mt) {
- je(
- r.parent.right,
- p.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,
- Ji(mt),
- Ei(r.parent.right.escapedText)
- );
- return;
- }
- }
- je(j, p.Namespace_0_has_no_exported_member_1, Q, ye);
- }
- return;
- }
- } else
- E.assertNever(r, "Unknown entity name kind.");
- return !fo(r) && l_(r) && (x.flags & 2097152 || r.parent.kind === 277) && L_(
- pB(r),
- x,
- /*finalTarget*/
- void 0,
- /*overwriteEmpty*/
- !0
- ), x.flags & a || f ? x : Zl(x);
- }
- function Q6(r, a) {
- if (kG(r.parent)) {
- const l = bk(r.parent);
- if (l)
- return Nt(
- l,
- r,
- a,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- }
- }
- function bk(r) {
- if (or(r, (m) => uC(m) || m.flags & 16777216 ? Bp(m) : "quit"))
- return;
- const l = xb(r);
- if (l && Pl(l) && c3(l.expression)) {
- const m = Tn(l.expression.left);
- if (m)
- return d1(m);
- }
- if (l && vo(l) && c3(l.parent) && Pl(l.parent.parent)) {
- const m = Tn(l.parent.left);
- if (m)
- return d1(m);
- }
- if (l && (jp(l) || Qc(l)) && dn(l.parent.parent) && Cc(l.parent.parent) === 6) {
- const m = Tn(l.parent.parent.left);
- if (m)
- return d1(m);
- }
- const f = tv(r);
- if (f && ys(f)) {
- const m = Tn(f);
- return m && m.valueDeclaration;
- }
- }
- function d1(r) {
- const a = r.parent.valueDeclaration;
- return a ? (h4(a) ? ZT(a) : K2(a) ? y4(a) : void 0) || a : void 0;
- }
- function KS(r) {
- const a = r.valueDeclaration;
- if (!a || !cn(a) || r.flags & 524288 || K1(
- a,
- /*isPrototypeAssignment*/
- !1
- ))
- return;
- const l = ii(a) ? y4(a) : ZT(a);
- if (l) {
- const f = i_(l);
- if (f)
- return ede(f, r);
- }
- }
- function v_(r, a, l) {
- const m = yu(O) === 1 ? p.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : p.Cannot_find_module_0_or_its_corresponding_type_declarations;
- return p2(r, a, l ? void 0 : m, l);
- }
- function p2(r, a, l, f = !1, m = !1) {
- return Xa(a) ? Sk(r, a.text, l, f ? void 0 : a, m) : void 0;
- }
- function Sk(r, a, l, f, m = !1) {
- var y, x, N, j, W, Q, ye, de, Ze, ct, mt;
- if (f && Ui(a, "@types/")) {
- const Jn = p.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1, Us = FE(a, "@types/");
- je(f, Jn, Us, a);
- }
- const Gt = _we(
- a,
- /*withAugmentations*/
- !0
- );
- if (Gt)
- return Gt;
- const sr = Tr(r), Xr = Xa(r) ? r : ((y = zc(r) ? r : r.parent && zc(r.parent) && r.parent.name === r ? r.parent : void 0) == null ? void 0 : y.name) || ((x = h0(r) ? r : void 0) == null ? void 0 : x.argument.literal) || (cn(r) && Cm(r) ? r.moduleSpecifier : void 0) || (ii(r) && r.initializer && f_(
- r.initializer,
- /*requireStringLiteralLikeArgument*/
- !0
- ) ? r.initializer.arguments[0] : void 0) || ((N = or(r, hf)) == null ? void 0 : N.arguments[0]) || ((j = or(r, ic)) == null ? void 0 : j.moduleSpecifier) || ((W = or(r, Z1)) == null ? void 0 : W.moduleReference.expression) || ((Q = or(r, Nc)) == null ? void 0 : Q.moduleSpecifier), tn = Xr && Xa(Xr) ? e.getModeForUsageLocation(sr, Xr) : e.getDefaultResolutionModeForFile(sr), pr = yu(O), er = (ye = e.getResolvedModule(sr, a, tn)) == null ? void 0 : ye.resolvedModule, gn = f && er && UW(O, er, sr), Un = er && (!gn || gn === p.Module_0_was_resolved_to_1_but_jsx_is_not_set) && e.getSourceFile(er.resolvedFileName);
- if (Un) {
- if (gn && je(f, gn, a, er.resolvedFileName), er.resolvedUsingTsExtension && wl(a)) {
- const Jn = ((de = or(r, ic)) == null ? void 0 : de.importClause) || or(r, Nf(gl, Nc));
- (f && Jn && !Jn.isTypeOnly || or(r, hf)) && je(
- f,
- p.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
- ci(E.checkDefined(Z7(a)))
- );
- } else if (er.resolvedUsingTsExtension && !u6(O, sr.fileName)) {
- const Jn = ((Ze = or(r, ic)) == null ? void 0 : Ze.importClause) || or(r, Nf(gl, Nc));
- if (f && !(Jn?.isTypeOnly || or(r, bm))) {
- const Us = E.checkDefined(Z7(a));
- je(f, p.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, Us);
- }
- }
- if (Un.symbol) {
- if (f && er.isExternalLibraryImport && !J4(er.extension) && d2(
- /*isError*/
- !1,
- f,
- sr,
- tn,
- er,
- a
- ), f && (pr === 3 || pr === 99)) {
- const Jn = sr.impliedNodeFormat === 1 && !or(r, hf) || !!or(r, gl), Us = or(r, (js) => bm(js) || Nc(js) || ic(js) || Cm(js));
- if (Jn && Un.impliedNodeFormat === 99 && !pee(Us))
- if (or(r, gl))
- je(f, p.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, a);
- else {
- let js;
- const Oo = Vg(sr.fileName);
- (Oo === ".ts" || Oo === ".js" || Oo === ".tsx" || Oo === ".jsx") && (js = Fj(sr)), Da.add(Rg(
- Tr(f),
- f,
- vs(
- js,
- p.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead,
- a
- )
- ));
- }
- }
- return Ra(Un.symbol);
- }
- f && l && !bJ(f) && je(f, p.File_0_is_not_a_module, Un.fileName);
- return;
- }
- if (_c) {
- const Jn = TR(_c, (Us) => Us.pattern, a);
- if (Jn) {
- const Us = Wf && Wf.get(a);
- return Ra(Us || Jn.symbol);
- }
- }
- if (!f)
- return;
- if (er && !J4(er.extension) && gn === void 0 || gn === p.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
- if (m) {
- const Jn = p.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
- je(f, Jn, a, er.resolvedFileName);
- } else
- d2(
- /*isError*/
- ie && !!l,
- f,
- sr,
- tn,
- er,
- a
- );
- return;
- }
- if (l) {
- if (er) {
- const Jn = e.getProjectReferenceRedirect(er.resolvedFileName);
- if (Jn) {
- je(f, p.Output_file_0_has_not_been_built_from_source_file_1, Jn, er.resolvedFileName);
- return;
- }
- }
- if (gn)
- je(f, gn, a, er.resolvedFileName);
- else {
- const Jn = If(a) && !tC(a), Us = pr === 3 || pr === 99;
- if (!Ab(O) && qo(
- a,
- ".json"
- /* Json */
- ) && pr !== 1 && u5(O))
- je(f, p.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, a);
- else if (tn === 99 && Us && Jn) {
- const js = es(a, Xn(sr.path)), Oo = (ct = V6.find(([ls, sc]) => e.fileExists(js + ls))) == null ? void 0 : ct[1];
- Oo ? je(f, p.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, a + Oo) : je(f, p.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
- } else if ((mt = e.getResolvedModule(sr, a, tn)) != null && mt.alternateResult) {
- const js = n7(sr, e, a, tn, a);
- Im(
- /*isError*/
- !0,
- f,
- vs(js, l, a)
- );
- } else
- je(f, l, a);
- }
- }
- return;
- function ci(Jn) {
- const Us = W3(a, Jn);
- if (j3(z) || tn === 99) {
- const js = wl(a) && u6(O);
- return Us + (Jn === ".mts" || Jn === ".d.mts" ? js ? ".mts" : ".mjs" : Jn === ".cts" || Jn === ".d.mts" ? js ? ".cts" : ".cjs" : js ? ".ts" : ".js");
- }
- return Us;
- }
- }
- function d2(r, a, l, f, { packageId: m, resolvedFileName: y }, x) {
- if (bJ(a))
- return;
- let N;
- !Sl(x) && m && (N = n7(l, e, x, f, m.name)), Im(
- r,
- a,
- vs(
- N,
- p.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
- x,
- y
- )
- );
- }
- function M_(r, a) {
- if (r?.exports) {
- const l = Mc(r.exports.get(
- "export="
- /* ExportEquals */
- ), a), f = Tk(Ra(l), Ra(r));
- return Ra(f) || r;
- }
- }
- function Tk(r, a) {
- if (!r || r === ze || r === a || a.exports.size === 1 || r.flags & 2097152)
- return r;
- const l = Bi(r);
- if (l.cjsExportMerged)
- return l.cjsExportMerged;
- const f = r.flags & 33554432 ? r : ah(r);
- return f.flags = f.flags | 512, f.exports === void 0 && (f.exports = Js()), a.exports.forEach((m, y) => {
- y !== "export=" && f.exports.set(y, f.exports.has(y) ? Wd(f.exports.get(y), m) : m);
- }), f === r && (Bi(f).resolvedExports = void 0, Bi(f).resolvedMembers = void 0), Bi(f).cjsExportMerged = f, l.cjsExportMerged = f;
- }
- function m1(r, a, l, f) {
- var m;
- const y = M_(r, l);
- if (!l && y) {
- if (!f && !(y.flags & 1539) && !Jo(
- y,
- 307
- /* SourceFile */
- )) {
- const N = z >= 5 ? "allowSyntheticDefaultImports" : "esModuleInterop";
- return je(a, p.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, N), y;
- }
- const x = a.parent;
- if (ic(x) && kC(x) || hf(x)) {
- const N = hf(x) ? x.arguments[0] : x.moduleSpecifier, j = nn(y), W = K8e(j, y, r, N);
- if (W)
- return $f(y, W, x);
- const Q = (m = r?.declarations) == null ? void 0 : m.find(Si), ye = Q && Q0(Gf(N), e.getImpliedNodeFormatForEmit(Q));
- if (Wg(O) || ye) {
- let de = LL(
- j,
- 0
- /* Call */
- );
- if ((!de || !de.length) && (de = LL(
- j,
- 1
- /* Construct */
- )), de && de.length || Gs(
- j,
- "default",
- /*skipObjectFunctionPropertyAugment*/
- !0
- ) || ye) {
- const Ze = j.flags & 3670016 ? eNe(j, y, r, N) : tde(y, y.parent);
- return $f(y, Ze, x);
- }
- }
- }
- }
- return y;
- }
- function $f(r, a, l) {
- const f = fa(r.flags, r.escapedName);
- f.declarations = r.declarations ? r.declarations.slice() : [], f.parent = r.parent, f.links.target = r, f.links.originatingImport = l, r.valueDeclaration && (f.valueDeclaration = r.valueDeclaration), r.constEnumOnlyModule && (f.constEnumOnlyModule = !0), r.members && (f.members = new Map(r.members)), r.exports && (f.exports = new Map(r.exports));
- const m = Xd(a);
- return f.links.type = Li(f, m.members, Ue, Ue, m.indexInfos), f;
- }
- function eT(r) {
- return r.exports.get(
- "export="
- /* ExportEquals */
- ) !== void 0;
- }
- function g1(r) {
- return U_e(lh(r));
- }
- function hP(r) {
- const a = g1(r), l = M_(r);
- if (l !== r) {
- const f = nn(l);
- ey(f) && Fn(a, qa(f));
- }
- return a;
- }
- function m2(r, a) {
- lh(r).forEach((m, y) => {
- Yt(y) || a(m, y);
- });
- const f = M_(r);
- if (f !== r) {
- const m = nn(f);
- ey(m) && hKe(m, (y, x) => {
- a(y, x);
- });
- }
- }
- function tT(r, a) {
- const l = lh(a);
- if (l)
- return l.get(r);
- }
- function xk(r, a) {
- const l = tT(r, a);
- if (l)
- return l;
- const f = M_(a);
- if (f === a)
- return;
- const m = nn(f);
- return ey(m) ? Gs(m, r) : void 0;
- }
- function ey(r) {
- return !(r.flags & 402784252 || wn(r) & 1 || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path
- Dp(r) || ha(r));
- }
- function n_(r) {
- return r.flags & 6256 ? P_e(
- r,
- "resolvedExports"
- /* resolvedExports */
- ) : r.flags & 1536 ? lh(r) : r.exports || I;
- }
- function lh(r) {
- const a = Bi(r);
- if (!a.resolvedExports) {
- const { exports: l, typeOnlyExportStarMap: f } = Y6(r);
- a.resolvedExports = l, a.typeOnlyExportStarMap = f;
- }
- return a.resolvedExports;
- }
- function uh(r, a, l, f) {
- a && a.forEach((m, y) => {
- if (y === "default") return;
- const x = r.get(y);
- if (!x)
- r.set(y, m), l && f && l.set(y, {
- specifierText: nc(f.moduleSpecifier)
- });
- else if (l && f && x && Mc(x) !== Mc(m)) {
- const N = l.get(y);
- N.exportsWithDuplicate ? N.exportsWithDuplicate.push(f) : N.exportsWithDuplicate = [f];
- }
- });
- }
- function Y6(r) {
- const a = [];
- let l;
- const f = /* @__PURE__ */ new Set();
- r = M_(r);
- const m = y(r) || I;
- return l && f.forEach((x) => l.delete(x)), {
- exports: m,
- typeOnlyExportStarMap: l
- };
- function y(x, N, j) {
- if (!j && x?.exports && x.exports.forEach((ye, de) => f.add(de)), !(x && x.exports && tp(a, x)))
- return;
- const W = new Map(x.exports), Q = x.exports.get(
- "__export"
- /* ExportStar */
- );
- if (Q) {
- const ye = Js(), de = /* @__PURE__ */ new Map();
- if (Q.declarations)
- for (const Ze of Q.declarations) {
- const ct = v_(Ze, Ze.moduleSpecifier), mt = y(ct, Ze, j || Ze.isTypeOnly);
- uh(
- ye,
- mt,
- de,
- Ze
- );
- }
- de.forEach(({ exportsWithDuplicate: Ze }, ct) => {
- if (!(ct === "export=" || !(Ze && Ze.length) || W.has(ct)))
- for (const mt of Ze)
- Da.add(Kr(
- mt,
- p.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,
- de.get(ct).specifierText,
- Ei(ct)
- ));
- }), uh(W, ye);
- }
- return N?.isTypeOnly && (l ?? (l = /* @__PURE__ */ new Map()), W.forEach(
- (ye, de) => l.set(
- de,
- N
- )
- )), W;
- }
- }
- function Ra(r) {
- let a;
- return r && r.mergeId && (a = fn[r.mergeId]) ? a : r;
- }
- function Tn(r) {
- return Ra(r.symbol && mG(r.symbol));
- }
- function i_(r) {
- return kd(r) ? Tn(r) : void 0;
- }
- function Cf(r) {
- return Ra(r.parent && mG(r.parent));
- }
- function g2(r) {
- var a, l;
- return (((a = r.valueDeclaration) == null ? void 0 : a.kind) === 219 || ((l = r.valueDeclaration) == null ? void 0 : l.kind) === 218) && i_(r.valueDeclaration.parent) || r;
- }
- function Z6(r, a) {
- const l = Tr(a), f = Ma(l), m = Bi(r);
- let y;
- if (m.extendedContainersByFile && (y = m.extendedContainersByFile.get(f)))
- return y;
- if (l && l.imports) {
- for (const N of l.imports) {
- if (fo(N)) continue;
- const j = v_(
- a,
- N,
- /*ignoreErrors*/
- !0
- );
- !j || !y2(j, r) || (y = wr(y, j));
- }
- if (Nr(y))
- return (m.extendedContainersByFile || (m.extendedContainersByFile = /* @__PURE__ */ new Map())).set(f, y), y;
- }
- if (m.extendedContainers)
- return m.extendedContainers;
- const x = e.getSourceFiles();
- for (const N of x) {
- if (!il(N)) continue;
- const j = Tn(N);
- y2(j, r) && (y = wr(y, j));
- }
- return m.extendedContainers = y || Ue;
- }
- function kk(r, a, l) {
- const f = Cf(r);
- if (f && !(r.flags & 262144))
- return j(f);
- const m = Ai(r.declarations, (Q) => {
- if (!Fu(Q) && Q.parent) {
- if (h1(Q.parent))
- return Tn(Q.parent);
- if (Sm(Q.parent) && Q.parent.parent && M_(Tn(Q.parent.parent)) === r)
- return Tn(Q.parent.parent);
- }
- if ($c(Q) && dn(Q.parent) && Q.parent.operatorToken.kind === 64 && xo(Q.parent.left) && yo(Q.parent.left.expression))
- return jg(Q.parent.left) || iS(Q.parent.left.expression) ? Tn(Tr(Q)) : (wc(Q.parent.left.expression), bn(Q.parent.left.expression).resolvedSymbol);
- });
- if (!Nr(m))
- return;
- const y = Ai(m, (Q) => y2(Q, r) ? Q : void 0);
- let x = [], N = [];
- for (const Q of y) {
- const [ye, ...de] = j(Q);
- x = wr(x, ye), N = Fn(N, de);
- }
- return Qi(x, N);
- function j(Q) {
- const ye = Ai(Q.declarations, W), de = a && Z6(r, a), Ze = Uv(Q, l);
- if (a && Q.flags & qd(l) && ty(
- Q,
- a,
- 1920,
- /*useOnlyExternalAliasing*/
- !1
- ))
- return wr(Qi(Qi([Q], ye), de), Ze);
- const ct = !(Q.flags & qd(l)) && Q.flags & 788968 && bo(Q).flags & 524288 && l === 111551 ? Ml(a, (Gt) => El(Gt, (sr) => {
- if (sr.flags & qd(l) && nn(sr) === bo(Q))
- return sr;
- })) : void 0;
- let mt = ct ? [ct, ...ye, Q] : [...ye, Q];
- return mt = wr(mt, Ze), mt = Fn(mt, de), mt;
- }
- function W(Q) {
- return f && h2(Q, f);
- }
- }
- function Uv(r, a) {
- const l = !!Nr(r.declarations) && xa(r.declarations);
- if (a & 111551 && l && l.parent && ii(l.parent) && (Ks(l) && l === l.parent.initializer || Qu(l) && l === l.parent.type))
- return Tn(l.parent);
- }
- function h2(r, a) {
- const l = ry(r), f = l && l.exports && l.exports.get(
- "export="
- /* ExportEquals */
- );
- return f && nd(f, a) ? l : void 0;
- }
- function y2(r, a) {
- if (r === Cf(a))
- return a;
- const l = r.exports && r.exports.get(
- "export="
- /* ExportEquals */
- );
- if (l && nd(l, a))
- return r;
- const f = n_(r), m = f.get(a.escapedName);
- return m && nd(m, a) ? m : El(f, (y) => {
- if (nd(y, a))
- return y;
- });
- }
- function nd(r, a) {
- if (Ra(Mc(Ra(r))) === Ra(Mc(Ra(a))))
- return r;
- }
- function _f(r) {
- return Ra(r && (r.flags & 1048576) !== 0 && r.exportSymbol || r);
- }
- function ff(r, a) {
- return !!(r.flags & 111551 || r.flags & 2097152 && Pu(r, !a) & 111551);
- }
- function Vd(r) {
- var a;
- const l = new c(Br, r);
- return u++, l.id = u, (a = rn) == null || a.recordType(l), l;
- }
- function id(r, a) {
- const l = Vd(r);
- return l.symbol = a, l;
- }
- function rT(r) {
- return new c(Br, r);
- }
- function ol(r, a, l = 0, f) {
- Ck(a, f);
- const m = Vd(r);
- return m.intrinsicName = a, m.debugIntrinsicName = f, m.objectFlags = l | 524288 | 2097152 | 33554432 | 16777216, m;
- }
- function Ck(r, a) {
- const l = `${r},${a ?? ""}`;
- Ke.has(l) && E.fail(`Duplicate intrinsic type name ${r}${a ? ` (${a})` : ""}; you may need to pass a name to createIntrinsicType.`), Ke.add(l);
- }
- function k(r, a) {
- const l = id(524288, a);
- return l.objectFlags = r, l.members = void 0, l.properties = void 0, l.callSignatures = void 0, l.constructSignatures = void 0, l.indexInfos = void 0, l;
- }
- function ce() {
- return Qn(as(Lre.keys(), S_));
- }
- function pt(r) {
- return id(262144, r);
- }
- function Yt(r) {
- return r.charCodeAt(0) === 95 && r.charCodeAt(1) === 95 && r.charCodeAt(2) !== 95 && r.charCodeAt(2) !== 64 && r.charCodeAt(2) !== 35;
- }
- function ai(r) {
- let a;
- return r.forEach((l, f) => {
- qi(l, f) && (a || (a = [])).push(l);
- }), a || Ue;
- }
- function qi(r, a) {
- return !Yt(a) && ff(r);
- }
- function Ki(r) {
- const a = ai(r), l = vG(r);
- return l ? Qi(a, [l]) : a;
- }
- function Hi(r, a, l, f, m) {
- const y = r;
- return y.members = a, y.properties = Ue, y.callSignatures = l, y.constructSignatures = f, y.indexInfos = m, a !== I && (y.properties = ai(a)), y;
- }
- function Li(r, a, l, f, m) {
- return Hi(k(16, r), a, l, f, m);
- }
- function Wu(r) {
- if (r.constructSignatures.length === 0) return r;
- if (r.objectTypeWithoutAbstractConstructSignatures) return r.objectTypeWithoutAbstractConstructSignatures;
- const a = Ln(r.constructSignatures, (f) => !(f.flags & 4));
- if (r.constructSignatures === a) return r;
- const l = Li(
- r.symbol,
- r.members,
- r.callSignatures,
- ut(a) ? a : Ue,
- r.indexInfos
- );
- return r.objectTypeWithoutAbstractConstructSignatures = l, l.objectTypeWithoutAbstractConstructSignatures = l, l;
- }
- function Ml(r, a) {
- let l;
- for (let f = r; f; f = f.parent) {
- if (tg(f) && f.locals && !g0(f) && (l = a(
- f.locals,
- /*ignoreQualification*/
- void 0,
- /*isLocalNameLookup*/
- !0,
- f
- )))
- return l;
- switch (f.kind) {
- case 307:
- if (!X_(f))
- break;
- case 267:
- const m = Tn(f);
- if (l = a(
- m?.exports || I,
- /*ignoreQualification*/
- void 0,
- /*isLocalNameLookup*/
- !0,
- f
- ))
- return l;
- break;
- case 263:
- case 231:
- case 264:
- let y;
- if ((Tn(f).members || I).forEach((x, N) => {
- x.flags & 788968 && (y || (y = Js())).set(N, x);
- }), y && (l = a(
- y,
- /*ignoreQualification*/
- void 0,
- /*isLocalNameLookup*/
- !1,
- f
- )))
- return l;
- break;
- }
- }
- return a(
- Te,
- /*ignoreQualification*/
- void 0,
- /*isLocalNameLookup*/
- !0
- );
- }
- function qd(r) {
- return r === 111551 ? 111551 : 1920;
- }
- function ty(r, a, l, f, m = /* @__PURE__ */ new Map()) {
- if (!(r && !v2(r)))
- return;
- const y = Bi(r), x = y.accessibleChainCache || (y.accessibleChainCache = /* @__PURE__ */ new Map()), N = Ml(a, (sr, Xr, tn, pr) => pr), j = `${f ? 0 : 1}|${N && Ma(N)}|${l}`;
- if (x.has(j))
- return x.get(j);
- const W = na(r);
- let Q = m.get(W);
- Q || m.set(W, Q = []);
- const ye = Ml(a, de);
- return x.set(j, ye), ye;
- function de(sr, Xr, tn) {
- if (!tp(Q, sr))
- return;
- const pr = mt(sr, Xr, tn);
- return Q.pop(), pr;
- }
- function Ze(sr, Xr) {
- return !pf(sr, a, Xr) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too
- !!ty(sr.parent, a, qd(Xr), f, m);
- }
- function ct(sr, Xr, tn) {
- return (r === (Xr || sr) || Ra(r) === Ra(Xr || sr)) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table)
- // and if symbolFromSymbolTable or alias resolution matches the symbol,
- // check the symbol can be qualified, it is only then this symbol is accessible
- !ut(sr.declarations, h1) && (tn || Ze(Ra(sr), l));
- }
- function mt(sr, Xr, tn) {
- return ct(
- sr.get(r.escapedName),
- /*resolvedAliasSymbol*/
- void 0,
- Xr
- ) ? [r] : El(sr, (er) => {
- if (er.flags & 2097152 && er.escapedName !== "export=" && er.escapedName !== "default" && !(n5(er) && a && il(Tr(a))) && (!f || ut(er.declarations, Z1)) && (!tn || !ut(er.declarations, MZ)) && (Xr || !Jo(
- er,
- 281
- /* ExportSpecifier */
- ))) {
- const gn = Zl(er), Un = Gt(er, gn, Xr);
- if (Un)
- return Un;
- }
- if (er.escapedName === r.escapedName && er.exportSymbol && ct(
- Ra(er.exportSymbol),
- /*resolvedAliasSymbol*/
- void 0,
- Xr
- ))
- return [r];
- }) || (sr === Te ? Gt(fe, fe, Xr) : void 0);
- }
- function Gt(sr, Xr, tn) {
- if (ct(sr, Xr, tn))
- return [sr];
- const pr = n_(Xr), er = pr && de(
- pr,
- /*ignoreQualification*/
- !0
- );
- if (er && Ze(sr, qd(l)))
- return [sr].concat(er);
- }
- }
- function pf(r, a, l) {
- let f = !1;
- return Ml(a, (m) => {
- let y = Ra(m.get(r.escapedName));
- if (!y)
- return !1;
- if (y === r)
- return !0;
- const x = y.flags & 2097152 && !Jo(
- y,
- 281
- /* ExportSpecifier */
- );
- return y = x ? Zl(y) : y, (x ? Pu(y) : y.flags) & l ? (f = !0, !0) : !1;
- }), f;
- }
- function v2(r) {
- if (r.declarations && r.declarations.length) {
- for (const a of r.declarations)
- switch (a.kind) {
- case 172:
- case 174:
- case 177:
- case 178:
- continue;
- default:
- return !1;
- }
- return !0;
- }
- return !1;
- }
- function Vv(r, a) {
- return _h(
- r,
- a,
- 788968,
- /*shouldComputeAliasesToMakeVisible*/
- !1,
- /*allowModules*/
- !0
- ).accessibility === 0;
- }
- function b2(r, a) {
- return _h(
- r,
- a,
- 111551,
- /*shouldComputeAliasesToMakeVisible*/
- !1,
- /*allowModules*/
- !0
- ).accessibility === 0;
- }
- function Ek(r, a, l) {
- return _h(
- r,
- a,
- l,
- /*shouldComputeAliasesToMakeVisible*/
- !1,
- /*allowModules*/
- !1
- ).accessibility === 0;
- }
- function nT(r, a, l, f, m, y) {
- if (!Nr(r)) return;
- let x, N = !1;
- for (const j of r) {
- const W = ty(
- j,
- a,
- f,
- /*useOnlyExternalAliasing*/
- !1
- );
- if (W) {
- x = j;
- const de = yP(W[0], m);
- if (de)
- return de;
- }
- if (y && ut(j.declarations, h1)) {
- if (m) {
- N = !0;
- continue;
- }
- return {
- accessibility: 0
- /* Accessible */
- };
- }
- const Q = kk(j, a, f), ye = nT(Q, a, l, l === j ? qd(f) : f, m, y);
- if (ye)
- return ye;
- }
- if (N)
- return {
- accessibility: 0
- /* Accessible */
- };
- if (x)
- return {
- accessibility: 1,
- errorSymbolName: Ji(l, a, f),
- errorModuleName: x !== l ? Ji(
- x,
- a,
- 1920
- /* Namespace */
- ) : void 0
- };
- }
- function Hd(r, a, l, f) {
- return _h(
- r,
- a,
- l,
- f,
- /*allowModules*/
- !0
- );
- }
- function _h(r, a, l, f, m) {
- if (r && a) {
- const y = nT([r], a, r, l, f, m);
- if (y)
- return y;
- const x = ir(r.declarations, ry);
- if (x) {
- const N = ry(a);
- if (x !== N)
- return {
- accessibility: 2,
- errorSymbolName: Ji(r, a, l),
- errorModuleName: Ji(x),
- errorNode: cn(a) ? a : void 0
- };
- }
- return {
- accessibility: 1,
- errorSymbolName: Ji(r, a, l)
- };
- }
- return {
- accessibility: 0
- /* Accessible */
- };
- }
- function ry(r) {
- const a = or(r, Dk);
- return a && Tn(a);
- }
- function Dk(r) {
- return Fu(r) || r.kind === 307 && X_(r);
- }
- function h1(r) {
- return l7(r) || r.kind === 307 && X_(r);
- }
- function yP(r, a) {
- let l;
- if (!Mi(Ln(
- r.declarations,
- (y) => y.kind !== 80
- /* Identifier */
- ), f))
- return;
- return { accessibility: 0, aliasesToMakeVisible: l };
- function f(y) {
- var x, N;
- if (!yd(y)) {
- const j = Eu(y);
- if (j && !Gn(
- j,
- 32
- /* Export */
- ) && // import clause without export
- yd(j.parent))
- return m(y, j);
- if (ii(y) && yc(y.parent.parent) && !Gn(
- y.parent.parent,
- 32
- /* Export */
- ) && // unexported variable statement
- yd(y.parent.parent.parent))
- return m(y, y.parent.parent);
- if (u7(y) && !Gn(
- y,
- 32
- /* Export */
- ) && yd(y.parent))
- return m(y, y);
- if (va(y)) {
- if (r.flags & 2097152 && cn(y) && ((x = y.parent) != null && x.parent) && ii(y.parent.parent) && ((N = y.parent.parent.parent) != null && N.parent) && yc(y.parent.parent.parent.parent) && !Gn(
- y.parent.parent.parent.parent,
- 32
- /* Export */
- ) && y.parent.parent.parent.parent.parent && yd(y.parent.parent.parent.parent.parent))
- return m(y, y.parent.parent.parent.parent);
- if (r.flags & 2) {
- const W = or(y, yc);
- return Gn(
- W,
- 32
- /* Export */
- ) ? !0 : yd(W.parent) ? m(y, W) : !1;
- }
- }
- return !1;
- }
- return !0;
- }
- function m(y, x) {
- return a && (bn(y).isVisible = !0, l = bh(l, x)), !0;
- }
- }
- function aN(r) {
- let a;
- return r.parent.kind === 186 || r.parent.kind === 233 && !um(r.parent) || r.parent.kind === 167 || r.parent.kind === 182 && r.parent.parameterName === r ? a = 1160127 : r.kind === 166 || r.kind === 211 || r.parent.kind === 271 || r.parent.kind === 166 && r.parent.left === r || r.parent.kind === 211 && r.parent.expression === r || r.parent.kind === 212 && r.parent.expression === r ? a = 1920 : a = 788968, a;
- }
- function oN(r, a, l = !0) {
- const f = aN(r), m = E_(r), y = Nt(
- a,
- m.escapedText,
- f,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- return y && y.flags & 262144 && f & 788968 ? {
- accessibility: 0
- /* Accessible */
- } : !y && Ly(m) && Hd(
- Tn(Lu(
- m,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- )),
- m,
- f,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility === 0 ? {
- accessibility: 0
- /* Accessible */
- } : y ? yP(y, l) || {
- accessibility: 1,
- errorSymbolName: nc(m),
- errorNode: m
- } : {
- accessibility: 3,
- errorSymbolName: nc(m),
- errorNode: m
- };
- }
- function Ji(r, a, l, f = 4, m) {
- let y = 70221824, x = 0;
- f & 2 && (y |= 128), f & 1 && (y |= 512), f & 8 && (y |= 16384), f & 32 && (x |= 4), f & 16 && (x |= 1);
- const N = f & 4 ? me.symbolToNode : me.symbolToEntityName;
- return m ? j(m).getText() : dC(j);
- function j(W) {
- const Q = N(r, l, a, y, x), ye = a?.kind === 307 ? Ine() : $b(), de = a && Tr(a);
- return ye.writeNode(
- 4,
- Q,
- /*sourceFile*/
- de,
- W
- ), W;
- }
- }
- function qv(r, a, l = 0, f, m) {
- return m ? y(m).getText() : dC(y);
- function y(x) {
- let N;
- l & 262144 ? N = f === 1 ? 185 : 184 : N = f === 1 ? 180 : 179;
- const j = me.signatureToSignatureDeclaration(
- r,
- N,
- a,
- eE(l) | 70221824 | 512
- /* WriteTypeParametersInQualifiedName */
- ), W = kW(), Q = a && Tr(a);
- return W.writeNode(
- 4,
- j,
- /*sourceFile*/
- Q,
- EB(x)
- ), x;
- }
- }
- function Hr(r, a, l = 1064960, f = E3("")) {
- const m = O.noErrorTruncation || l & 1, y = me.typeToTypeNode(
- r,
- a,
- eE(l) | 70221824 | (m ? 1 : 0),
- /*internalFlags*/
- void 0
- );
- if (y === void 0) return E.fail("should always get typenode");
- const x = r !== Vt ? $b() : Nne(), N = a && Tr(a);
- x.writeNode(
- 4,
- y,
- /*sourceFile*/
- N,
- f
- );
- const j = f.getText(), W = m ? Ij * 2 : l4 * 2;
- return W && j && j.length >= W ? j.substr(0, W - 3) + "..." : j;
- }
- function vP(r, a) {
- let l = y1(r.symbol) ? Hr(r, r.symbol.valueDeclaration) : Hr(r), f = y1(a.symbol) ? Hr(a, a.symbol.valueDeclaration) : Hr(a);
- return l === f && (l = K6(r), f = K6(a)), [l, f];
- }
- function K6(r) {
- return Hr(
- r,
- /*enclosingDeclaration*/
- void 0,
- 64
- /* UseFullyQualifiedType */
- );
- }
- function y1(r) {
- return r && !!r.valueDeclaration && _t(r.valueDeclaration) && !Kf(r.valueDeclaration);
- }
- function eE(r = 0) {
- return r & 848330095;
- }
- function cN(r) {
- return !!r.symbol && !!(r.symbol.flags & 32) && (r === b_(r.symbol) || !!(r.flags & 524288) && !!(wn(r) & 16777216));
- }
- function bP(r) {
- return Ci(r);
- }
- function SL() {
- return {
- typeToTypeNode: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => Q(Ee, Yr)),
- typePredicateToTypePredicateNode: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => Oo(Ee, Yr)),
- expressionOrTypeToTypeNode: (Ee, pe, Ut, vr, hn, Yr, Qr) => N(vr, hn, Yr, Qr, (gi) => l(gi, Ee, pe, Ut)),
- serializeTypeForDeclaration: (Ee, pe, Ut, vr, hn, Yr, Qr) => N(vr, hn, Yr, Qr, (gi) => sb(gi, Ee, pe, Ut)),
- serializeReturnTypeForSignature: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => cr(Yr, Ee)),
- indexInfoToIndexSignatureDeclaration: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => Xr(
- Ee,
- Yr,
- /*typeNode*/
- void 0
- )),
- signatureToSignatureDeclaration: (Ee, pe, Ut, vr, hn, Yr) => N(Ut, vr, hn, Yr, (Qr) => tn(Ee, pe, Qr)),
- symbolToEntityName: (Ee, pe, Ut, vr, hn, Yr) => N(Ut, vr, hn, Yr, (Qr) => Sc(
- Ee,
- Qr,
- pe,
- /*expectsIdentifier*/
- !1
- )),
- symbolToExpression: (Ee, pe, Ut, vr, hn, Yr) => N(Ut, vr, hn, Yr, (Qr) => mo(Ee, Qr, pe)),
- symbolToTypeParameterDeclarations: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => wi(Ee, Yr)),
- symbolToParameterDeclaration: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => sc(Ee, Yr)),
- typeParameterToDeclaration: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => js(Ee, Yr)),
- symbolTableToDeclarationStatements: (Ee, pe, Ut, vr, hn) => N(pe, Ut, vr, hn, (Yr) => So(Ee, Yr)),
- symbolToNode: (Ee, pe, Ut, vr, hn, Yr) => N(Ut, vr, hn, Yr, (Qr) => x(Ee, Qr, pe))
- };
- function r(Ee, pe, Ut) {
- const vr = bP(pe);
- if (!Ee.mapper) return vr;
- const hn = zi(vr, Ee.mapper);
- return Ut && hn !== vr ? void 0 : hn;
- }
- function a(Ee, pe, Ut) {
- if ((!fo(pe) || !(pe.flags & 16) || !Ee.enclosingFile || Ee.enclosingFile !== Tr(Ho(pe))) && (pe = A.cloneNode(pe)), pe === Ut || !Ut)
- return pe;
- let vr = pe.original;
- for (; vr && vr !== Ut; )
- vr = vr.original;
- return vr || kn(pe, Ut), Ee.enclosingFile && Ee.enclosingFile === Tr(Ho(Ut)) ? lt(pe, Ut) : pe;
- }
- function l(Ee, pe, Ut, vr) {
- const hn = j(Ee);
- pe && !(Ee.internalFlags & 2) && ve.serializeTypeOfExpression(pe, Ee, vr), Ee.internalFlags |= 2;
- const Yr = f(Ee, pe, Ut, vr);
- return hn(), Yr;
- }
- function f(Ee, pe, Ut, vr) {
- if (pe) {
- const hn = $1(pe) ? pe.type : xS(pe) ? mD(pe) : void 0;
- if (hn && !xd(hn)) {
- const Yr = m(Ee, hn, Ut, pe.parent, vr);
- if (Yr)
- return Yr;
- }
- }
- return vr && (Ut = N1(Ut)), Q(Ut, Ee);
- }
- function m(Ee, pe, Ut, vr, hn) {
- const Yr = Ut;
- hn && (Ut = N1(Ut, !Ii(vr)));
- const Qr = y(Ee, pe, Ut, vr);
- if (Qr)
- return hn && O3e(Ut) && !Pp(r(Ee, pe), (gi) => !!(gi.flags & 32768)) ? A.createUnionTypeNode([Qr, A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- )]) : Qr;
- if (hn && Yr !== Ut) {
- const gi = y(Ee, pe, Yr, vr);
- if (gi)
- return A.createUnionTypeNode([gi, A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- )]);
- }
- }
- function y(Ee, pe, Ut, vr = Ee.enclosingDeclaration, hn = r(
- Ee,
- pe,
- /*noMappedTypes*/
- !0
- )) {
- if (hn && Pt(vr, Ut, hn) && $P(pe, Ut)) {
- const Yr = ua(Ee, pe);
- if (Yr)
- return Yr;
- }
- }
- function x(Ee, pe, Ut) {
- if (pe.internalFlags & 1) {
- if (Ee.valueDeclaration) {
- const hn = os(Ee.valueDeclaration);
- if (hn && ma(hn)) return hn;
- }
- const vr = Bi(Ee).nameType;
- if (vr && vr.flags & 9216)
- return pe.enclosingDeclaration = vr.symbol.valueDeclaration, A.createComputedPropertyName(mo(vr.symbol, pe, Ut));
- }
- return mo(Ee, pe, Ut);
- }
- function N(Ee, pe, Ut, vr, hn) {
- const Yr = vr?.trackSymbol ? vr.moduleResolverHost : (Ut || 0) & 4 ? pMe(e) : void 0, Qr = {
- enclosingDeclaration: Ee,
- enclosingFile: Ee && Tr(Ee),
- flags: pe || 0,
- internalFlags: Ut || 0,
- tracker: void 0,
- encounteredError: !1,
- reportedDiagnostic: !1,
- visitedTypes: void 0,
- symbolDepth: void 0,
- inferTypeParameters: void 0,
- approximateLength: 0,
- trackedSymbols: void 0,
- bundled: !!O.outFile && !!Ee && X_(Tr(Ee)),
- truncating: !1,
- usedSymbolNames: void 0,
- remappedSymbolNames: void 0,
- remappedSymbolReferences: void 0,
- reverseMappedStack: void 0,
- mustCreateTypeParameterSymbolList: !0,
- typeParameterSymbolList: void 0,
- mustCreateTypeParametersNamesLookups: !0,
- typeParameterNames: void 0,
- typeParameterNamesByText: void 0,
- typeParameterNamesByTextNextNameCount: void 0,
- mapper: void 0
- };
- Qr.tracker = new Rre(Qr, vr, Yr);
- const gi = hn(Qr);
- return Qr.truncating && Qr.flags & 1 && Qr.tracker.reportTruncationError(), Qr.encounteredError ? void 0 : gi;
- }
- function j(Ee) {
- const pe = Ee.flags, Ut = Ee.internalFlags;
- return vr;
- function vr() {
- Ee.flags = pe, Ee.internalFlags = Ut;
- }
- }
- function W(Ee) {
- return Ee.truncating ? Ee.truncating : Ee.truncating = Ee.approximateLength > (Ee.flags & 1 ? Ij : l4);
- }
- function Q(Ee, pe) {
- const Ut = j(pe), vr = ye(Ee, pe);
- return Ut(), vr;
- }
- function ye(Ee, pe) {
- var Ut, vr;
- i && i.throwIfCancellationRequested && i.throwIfCancellationRequested();
- const hn = pe.flags & 8388608;
- if (pe.flags &= -8388609, !Ee) {
- if (!(pe.flags & 262144)) {
- pe.encounteredError = !0;
- return;
- }
- return pe.approximateLength += 3, A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- );
- }
- if (pe.flags & 536870912 || (Ee = Qd(Ee)), Ee.flags & 1)
- return Ee.aliasSymbol ? A.createTypeReferenceNode(Fo(Ee.aliasSymbol), Gt(Ee.aliasTypeArguments, pe)) : Ee === Vt ? Z4(A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ), 3, "unresolved") : (pe.approximateLength += 3, A.createKeywordTypeNode(
- Ee === vn ? 141 : 133
- /* AnyKeyword */
- ));
- if (Ee.flags & 2)
- return A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- );
- if (Ee.flags & 4)
- return pe.approximateLength += 6, A.createKeywordTypeNode(
- 154
- /* StringKeyword */
- );
- if (Ee.flags & 8)
- return pe.approximateLength += 6, A.createKeywordTypeNode(
- 150
- /* NumberKeyword */
- );
- if (Ee.flags & 64)
- return pe.approximateLength += 6, A.createKeywordTypeNode(
- 163
- /* BigIntKeyword */
- );
- if (Ee.flags & 16 && !Ee.aliasSymbol)
- return pe.approximateLength += 7, A.createKeywordTypeNode(
- 136
- /* BooleanKeyword */
- );
- if (Ee.flags & 1056) {
- if (Ee.symbol.flags & 8) {
- const St = Cf(Ee.symbol), ur = dc(
- St,
- pe,
- 788968
- /* Type */
- );
- if (bo(St) === Ee)
- return ur;
- const Zr = mc(Ee.symbol);
- return k_(
- Zr,
- 1
- /* ES5 */
- ) ? it(
- ur,
- A.createTypeReferenceNode(
- Zr,
- /*typeArguments*/
- void 0
- )
- ) : bm(ur) ? (ur.isTypeOf = !0, A.createIndexedAccessTypeNode(ur, A.createLiteralTypeNode(A.createStringLiteral(Zr)))) : vf(ur) ? A.createIndexedAccessTypeNode(A.createTypeQueryNode(ur.typeName), A.createLiteralTypeNode(A.createStringLiteral(Zr))) : E.fail("Unhandled type node kind returned from `symbolToTypeNode`.");
- }
- return dc(
- Ee.symbol,
- pe,
- 788968
- /* Type */
- );
- }
- if (Ee.flags & 128)
- return pe.approximateLength += Ee.value.length + 2, A.createLiteralTypeNode(an(
- A.createStringLiteral(Ee.value, !!(pe.flags & 268435456)),
- 16777216
- /* NoAsciiEscaping */
- ));
- if (Ee.flags & 256) {
- const St = Ee.value;
- return pe.approximateLength += ("" + St).length, A.createLiteralTypeNode(St < 0 ? A.createPrefixUnaryExpression(41, A.createNumericLiteral(-St)) : A.createNumericLiteral(St));
- }
- if (Ee.flags & 2048)
- return pe.approximateLength += Ib(Ee.value).length + 1, A.createLiteralTypeNode(A.createBigIntLiteral(Ee.value));
- if (Ee.flags & 512)
- return pe.approximateLength += Ee.intrinsicName.length, A.createLiteralTypeNode(Ee.intrinsicName === "true" ? A.createTrue() : A.createFalse());
- if (Ee.flags & 8192) {
- if (!(pe.flags & 1048576)) {
- if (b2(Ee.symbol, pe.enclosingDeclaration))
- return pe.approximateLength += 6, dc(
- Ee.symbol,
- pe,
- 111551
- /* Value */
- );
- pe.tracker.reportInaccessibleUniqueSymbolError && pe.tracker.reportInaccessibleUniqueSymbolError();
- }
- return pe.approximateLength += 13, A.createTypeOperatorNode(158, A.createKeywordTypeNode(
- 155
- /* SymbolKeyword */
- ));
- }
- if (Ee.flags & 16384)
- return pe.approximateLength += 4, A.createKeywordTypeNode(
- 116
- /* VoidKeyword */
- );
- if (Ee.flags & 32768)
- return pe.approximateLength += 9, A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- );
- if (Ee.flags & 65536)
- return pe.approximateLength += 4, A.createLiteralTypeNode(A.createNull());
- if (Ee.flags & 131072)
- return pe.approximateLength += 5, A.createKeywordTypeNode(
- 146
- /* NeverKeyword */
- );
- if (Ee.flags & 4096)
- return pe.approximateLength += 6, A.createKeywordTypeNode(
- 155
- /* SymbolKeyword */
- );
- if (Ee.flags & 67108864)
- return pe.approximateLength += 6, A.createKeywordTypeNode(
- 151
- /* ObjectKeyword */
- );
- if ($4(Ee))
- return pe.flags & 4194304 && (!pe.encounteredError && !(pe.flags & 32768) && (pe.encounteredError = !0), (vr = (Ut = pe.tracker).reportInaccessibleThisError) == null || vr.call(Ut)), pe.approximateLength += 4, A.createThisTypeNode();
- if (!hn && Ee.aliasSymbol && (pe.flags & 16384 || Vv(Ee.aliasSymbol, pe.enclosingDeclaration))) {
- const St = Gt(Ee.aliasTypeArguments, pe);
- return Yt(Ee.aliasSymbol.escapedName) && !(Ee.aliasSymbol.flags & 32) ? A.createTypeReferenceNode(A.createIdentifier(""), St) : Nr(St) === 1 && Ee.aliasSymbol === Et.symbol ? A.createArrayTypeNode(St[0]) : dc(Ee.aliasSymbol, pe, 788968, St);
- }
- const Yr = wn(Ee);
- if (Yr & 4)
- return E.assert(!!(Ee.flags & 524288)), Ee.node ? Ye(Ee, tr) : tr(Ee);
- if (Ee.flags & 262144 || Yr & 3) {
- if (Ee.flags & 262144 && ss(pe.inferTypeParameters, Ee)) {
- pe.approximateLength += mc(Ee.symbol).length + 6;
- let ur;
- const Zr = s_(Ee);
- if (Zr) {
- const nr = hwe(
- Ee,
- /*omitTypeReferences*/
- !0
- );
- nr && hh(Zr, nr) || (pe.approximateLength += 9, ur = Zr && Q(Zr, pe));
- }
- return A.createInferTypeNode(Jn(Ee, pe, ur));
- }
- if (pe.flags & 4 && Ee.flags & 262144) {
- const ur = Nl(Ee, pe);
- return pe.approximateLength += Nn(ur).length, A.createTypeReferenceNode(
- A.createIdentifier(Nn(ur)),
- /*typeArguments*/
- void 0
- );
- }
- if (Ee.symbol)
- return dc(
- Ee.symbol,
- pe,
- 788968
- /* Type */
- );
- const St = (Ee === ge || Ee === $) && D && D.symbol ? (Ee === $ ? "sub-" : "super-") + mc(D.symbol) : "?";
- return A.createTypeReferenceNode(
- A.createIdentifier(St),
- /*typeArguments*/
- void 0
- );
- }
- if (Ee.flags & 1048576 && Ee.origin && (Ee = Ee.origin), Ee.flags & 3145728) {
- const St = Ee.flags & 1048576 ? TL(Ee.types) : Ee.types;
- if (Nr(St) === 1)
- return Q(St[0], pe);
- const ur = Gt(
- St,
- pe,
- /*isBareList*/
- !0
- );
- if (ur && ur.length > 0)
- return Ee.flags & 1048576 ? A.createUnionTypeNode(ur) : A.createIntersectionTypeNode(ur);
- !pe.encounteredError && !(pe.flags & 262144) && (pe.encounteredError = !0);
- return;
- }
- if (Yr & 48)
- return E.assert(!!(Ee.flags & 524288)), Je(Ee);
- if (Ee.flags & 4194304) {
- const St = Ee.type;
- pe.approximateLength += 6;
- const ur = Q(St, pe);
- return A.createTypeOperatorNode(143, ur);
- }
- if (Ee.flags & 134217728) {
- const St = Ee.texts, ur = Ee.types, Zr = A.createTemplateHead(St[0]), nr = A.createNodeArray(
- lr(ur, (Gr, Rr) => A.createTemplateLiteralTypeSpan(
- Q(Gr, pe),
- (Rr < ur.length - 1 ? A.createTemplateMiddle : A.createTemplateTail)(St[Rr + 1])
- ))
- );
- return pe.approximateLength += 2, A.createTemplateLiteralType(Zr, nr);
- }
- if (Ee.flags & 268435456) {
- const St = Q(Ee.type, pe);
- return dc(Ee.symbol, pe, 788968, [St]);
- }
- if (Ee.flags & 8388608) {
- const St = Q(Ee.objectType, pe), ur = Q(Ee.indexType, pe);
- return pe.approximateLength += 2, A.createIndexedAccessTypeNode(St, ur);
- }
- if (Ee.flags & 16777216)
- return Ye(Ee, (St) => Qr(St));
- if (Ee.flags & 33554432) {
- const St = Q(Ee.baseType, pe), ur = fE(Ee) && tfe(
- "NoInfer",
- /*reportErrors*/
- !1
- );
- return ur ? dc(ur, pe, 788968, [St]) : St;
- }
- return E.fail("Should be unreachable.");
- function Qr(St) {
- const ur = Q(St.checkType, pe);
- if (pe.approximateLength += 15, pe.flags & 4 && St.root.isDistributive && !(St.checkType.flags & 262144)) {
- const Rn = pt(fa(262144, "T")), pi = Nl(Rn, pe), Yn = A.createTypeReferenceNode(pi);
- pe.approximateLength += 37;
- const ds = gT(St.root.checkType, Rn, St.mapper), ro = pe.inferTypeParameters;
- pe.inferTypeParameters = St.root.inferTypeParameters;
- const ru = Q(zi(St.root.extendsType, ds), pe);
- pe.inferTypeParameters = ro;
- const T_ = gi(zi(r(pe, St.root.node.trueType), ds)), cd = gi(zi(r(pe, St.root.node.falseType), ds));
- return A.createConditionalTypeNode(
- ur,
- A.createInferTypeNode(A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- A.cloneNode(Yn.typeName)
- )),
- A.createConditionalTypeNode(
- A.createTypeReferenceNode(A.cloneNode(pi)),
- Q(St.checkType, pe),
- A.createConditionalTypeNode(Yn, ru, T_, cd),
- A.createKeywordTypeNode(
- 146
- /* NeverKeyword */
- )
- ),
- A.createKeywordTypeNode(
- 146
- /* NeverKeyword */
- )
- );
- }
- const Zr = pe.inferTypeParameters;
- pe.inferTypeParameters = St.root.inferTypeParameters;
- const nr = Q(St.extendsType, pe);
- pe.inferTypeParameters = Zr;
- const Gr = gi(Qv(St)), Rr = gi(Yv(St));
- return A.createConditionalTypeNode(ur, nr, Gr, Rr);
- }
- function gi(St) {
- var ur, Zr, nr;
- return St.flags & 1048576 ? (ur = pe.visitedTypes) != null && ur.has(Rl(St)) ? (pe.flags & 131072 || (pe.encounteredError = !0, (nr = (Zr = pe.tracker) == null ? void 0 : Zr.reportCyclicStructureError) == null || nr.call(Zr)), de(pe)) : Ye(St, (Gr) => Q(Gr, pe)) : Q(St, pe);
- }
- function Xi(St) {
- return !!CN(St);
- }
- function ps(St) {
- return !!St.target && Xi(St.target) && !Xi(St);
- }
- function Ps(St) {
- var ur;
- E.assert(!!(St.flags & 524288));
- const Zr = St.declaration.readonlyToken ? A.createToken(St.declaration.readonlyToken.kind) : void 0, nr = St.declaration.questionToken ? A.createToken(St.declaration.questionToken.kind) : void 0;
- let Gr, Rr;
- const Rn = !cE(St) && !(x2(St).flags & 2) && pe.flags & 4 && !(Yf(St).flags & 262144 && ((ur = s_(Yf(St))) == null ? void 0 : ur.flags) & 4194304);
- if (cE(St)) {
- if (ps(St) && pe.flags & 4) {
- const T_ = pt(fa(262144, "T")), cd = Nl(T_, pe);
- Rr = A.createTypeReferenceNode(cd);
- }
- Gr = A.createTypeOperatorNode(143, Rr || Q(x2(St), pe));
- } else if (Rn) {
- const T_ = pt(fa(262144, "T")), cd = Nl(T_, pe);
- Rr = A.createTypeReferenceNode(cd), Gr = Rr;
- } else
- Gr = Q(Yf(St), pe);
- const pi = Jn($d(St), pe, Gr), Yn = St.declaration.nameType ? Q(ny(St), pe) : void 0, ds = Q(l0(r0(St), !!(xg(St) & 4)), pe), ro = A.createMappedTypeNode(
- Zr,
- pi,
- Yn,
- nr,
- ds,
- /*members*/
- void 0
- );
- pe.approximateLength += 10;
- const ru = an(
- ro,
- 1
- /* SingleLine */
- );
- if (ps(St) && pe.flags & 4) {
- const T_ = zi(s_(r(pe, St.declaration.typeParameter.constraint.type)) || M, St.mapper);
- return A.createConditionalTypeNode(
- Q(x2(St), pe),
- A.createInferTypeNode(A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- A.cloneNode(Rr.typeName),
- T_.flags & 2 ? void 0 : Q(T_, pe)
- )),
- ru,
- A.createKeywordTypeNode(
- 146
- /* NeverKeyword */
- )
- );
- } else if (Rn)
- return A.createConditionalTypeNode(
- Q(Yf(St), pe),
- A.createInferTypeNode(A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- A.cloneNode(Rr.typeName),
- A.createTypeOperatorNode(143, Q(x2(St), pe))
- )),
- ru,
- A.createKeywordTypeNode(
- 146
- /* NeverKeyword */
- )
- );
- return ru;
- }
- function Je(St) {
- var ur, Zr;
- const nr = St.id, Gr = St.symbol;
- if (Gr) {
- if (!!(wn(St) & 8388608)) {
- const ds = St.node;
- if (Lb(ds)) {
- const ro = y(pe, ds, St);
- if (ro)
- return ro;
- }
- return (ur = pe.visitedTypes) != null && ur.has(nr) ? de(pe) : Ye(St, kt);
- }
- const pi = cN(St) ? 788968 : 111551;
- if (qm(Gr.valueDeclaration))
- return dc(Gr, pe, pi);
- if (Gr.flags & 32 && !cG(Gr) && !(Gr.valueDeclaration && Zn(Gr.valueDeclaration) && pe.flags & 2048 && (!Xc(Gr.valueDeclaration) || Hd(
- Gr,
- pe.enclosingDeclaration,
- pi,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility !== 0)) || Gr.flags & 896 || Rr())
- return dc(Gr, pe, pi);
- if ((Zr = pe.visitedTypes) != null && Zr.has(nr)) {
- const Yn = xL(St);
- return Yn ? dc(
- Yn,
- pe,
- 788968
- /* Type */
- ) : de(pe);
- } else
- return Ye(St, kt);
- } else
- return kt(St);
- function Rr() {
- var Rn;
- const pi = !!(Gr.flags & 8192) && // typeof static method
- ut(Gr.declarations, (ds) => zs(ds)), Yn = !!(Gr.flags & 16) && (Gr.parent || // is exported function symbol
- ir(
- Gr.declarations,
- (ds) => ds.parent.kind === 307 || ds.parent.kind === 268
- /* ModuleBlock */
- ));
- if (pi || Yn)
- return (!!(pe.flags & 4096) || ((Rn = pe.visitedTypes) == null ? void 0 : Rn.has(nr))) && // it is type of the symbol uses itself recursively
- (!(pe.flags & 8) || b2(Gr, pe.enclosingDeclaration));
- }
- }
- function Ye(St, ur) {
- var Zr, nr, Gr;
- const Rr = St.id, Rn = wn(St) & 16 && St.symbol && St.symbol.flags & 32, pi = wn(St) & 4 && St.node ? "N" + Ma(St.node) : St.flags & 16777216 ? "N" + Ma(St.root.node) : St.symbol ? (Rn ? "+" : "") + na(St.symbol) : void 0;
- pe.visitedTypes || (pe.visitedTypes = /* @__PURE__ */ new Set()), pi && !pe.symbolDepth && (pe.symbolDepth = /* @__PURE__ */ new Map());
- const Yn = pe.enclosingDeclaration && bn(pe.enclosingDeclaration), ds = `${Rl(St)}|${pe.flags}|${pe.internalFlags}`;
- Yn && (Yn.serializedTypes || (Yn.serializedTypes = /* @__PURE__ */ new Map()));
- const ro = (Zr = Yn?.serializedTypes) == null ? void 0 : Zr.get(ds);
- if (ro)
- return (nr = ro.trackedSymbols) == null || nr.forEach(
- ([x_, L1, QP]) => pe.tracker.trackSymbol(
- x_,
- L1,
- QP
- )
- ), ro.truncating && (pe.truncating = !0), pe.approximateLength += ro.addedLength, fy(ro.node);
- let ru;
- if (pi) {
- if (ru = pe.symbolDepth.get(pi) || 0, ru > 10)
- return de(pe);
- pe.symbolDepth.set(pi, ru + 1);
- }
- pe.visitedTypes.add(Rr);
- const T_ = pe.trackedSymbols;
- pe.trackedSymbols = void 0;
- const cd = pe.approximateLength, ab = ur(St), tm = pe.approximateLength - cd;
- return !pe.reportedDiagnostic && !pe.encounteredError && ((Gr = Yn?.serializedTypes) == null || Gr.set(ds, {
- node: ab,
- truncating: pe.truncating,
- addedLength: tm,
- trackedSymbols: pe.trackedSymbols
- })), pe.visitedTypes.delete(Rr), pi && pe.symbolDepth.set(pi, ru), pe.trackedSymbols = T_, ab;
- function fy(x_) {
- return !fo(x_) && fs(x_) === x_ ? x_ : a(pe, A.cloneNode(br(
- x_,
- fy,
- /*context*/
- void 0,
- XP,
- fy
- )), x_);
- }
- function XP(x_, L1, QP, aI, oI) {
- return x_ && x_.length === 0 ? lt(A.createNodeArray(
- /*elements*/
- void 0,
- x_.hasTrailingComma
- ), x_) : Fr(x_, L1, QP, aI, oI);
- }
- }
- function kt(St) {
- if (R_(St) || St.containsError)
- return Ps(St);
- const ur = Xd(St);
- if (!ur.properties.length && !ur.indexInfos.length) {
- if (!ur.callSignatures.length && !ur.constructSignatures.length)
- return pe.approximateLength += 2, an(
- A.createTypeLiteralNode(
- /*members*/
- void 0
- ),
- 1
- /* SingleLine */
- );
- if (ur.callSignatures.length === 1 && !ur.constructSignatures.length) {
- const Rn = ur.callSignatures[0];
- return tn(Rn, 184, pe);
- }
- if (ur.constructSignatures.length === 1 && !ur.callSignatures.length) {
- const Rn = ur.constructSignatures[0];
- return tn(Rn, 185, pe);
- }
- }
- const Zr = Ln(ur.constructSignatures, (Rn) => !!(Rn.flags & 4));
- if (ut(Zr)) {
- const Rn = lr(Zr, (Yn) => _T(Yn));
- return ur.callSignatures.length + (ur.constructSignatures.length - Zr.length) + ur.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
- // the logic in `createTypeNodesFromResolvedType`.
- (pe.flags & 2048 ? py(ur.properties, (Yn) => !(Yn.flags & 4194304)) : Nr(ur.properties)) && Rn.push(Wu(ur)), Q(ia(Rn), pe);
- }
- const nr = j(pe);
- pe.flags |= 4194304;
- const Gr = Er(ur);
- nr();
- const Rr = A.createTypeLiteralNode(Gr);
- return pe.approximateLength += 2, an(
- Rr,
- pe.flags & 1024 ? 0 : 1
- /* SingleLine */
- ), Rr;
- }
- function tr(St) {
- let ur = Io(St);
- if (St.target === Et || St.target === Lr) {
- if (pe.flags & 2) {
- const Gr = Q(ur[0], pe);
- return A.createTypeReferenceNode(St.target === Et ? "Array" : "ReadonlyArray", [Gr]);
- }
- const Zr = Q(ur[0], pe), nr = A.createArrayTypeNode(Zr);
- return St.target === Et ? nr : A.createTypeOperatorNode(148, nr);
- } else if (St.target.objectFlags & 8) {
- if (ur = qc(ur, (Zr, nr) => l0(Zr, !!(St.target.elementFlags[nr] & 2))), ur.length > 0) {
- const Zr = sy(St), nr = Gt(ur.slice(0, Zr), pe);
- if (nr) {
- const { labeledElementDeclarations: Gr } = St.target;
- for (let Rn = 0; Rn < nr.length; Rn++) {
- const pi = St.target.elementFlags[Rn], Yn = Gr?.[Rn];
- Yn ? nr[Rn] = A.createNamedTupleMember(
- pi & 12 ? A.createToken(
- 26
- /* DotDotDotToken */
- ) : void 0,
- A.createIdentifier(Ei(ade(Yn))),
- pi & 2 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- pi & 4 ? A.createArrayTypeNode(nr[Rn]) : nr[Rn]
- ) : nr[Rn] = pi & 12 ? A.createRestTypeNode(pi & 4 ? A.createArrayTypeNode(nr[Rn]) : nr[Rn]) : pi & 2 ? A.createOptionalTypeNode(nr[Rn]) : nr[Rn];
- }
- const Rr = an(
- A.createTupleTypeNode(nr),
- 1
- /* SingleLine */
- );
- return St.target.readonly ? A.createTypeOperatorNode(148, Rr) : Rr;
- }
- }
- if (pe.encounteredError || pe.flags & 524288) {
- const Zr = an(
- A.createTupleTypeNode([]),
- 1
- /* SingleLine */
- );
- return St.target.readonly ? A.createTypeOperatorNode(148, Zr) : Zr;
- }
- pe.encounteredError = !0;
- return;
- } else {
- if (pe.flags & 2048 && St.symbol.valueDeclaration && Zn(St.symbol.valueDeclaration) && !b2(St.symbol, pe.enclosingDeclaration))
- return Je(St);
- {
- const Zr = St.target.outerTypeParameters;
- let nr = 0, Gr;
- if (Zr) {
- const Yn = Zr.length;
- for (; nr < Yn; ) {
- const ds = nr, ro = ywe(Zr[nr]);
- do
- nr++;
- while (nr < Yn && ywe(Zr[nr]) === ro);
- if (!uR(Zr, ur, ds, nr)) {
- const ru = Gt(ur.slice(ds, nr), pe), T_ = j(pe);
- pe.flags |= 16;
- const cd = dc(ro, pe, 788968, ru);
- T_(), Gr = Gr ? it(Gr, cd) : cd;
- }
- }
- }
- let Rr;
- if (ur.length > 0) {
- let Yn = 0;
- if (St.target.typeParameters && (Yn = Math.min(St.target.typeParameters.length, ur.length), (Mm(St, EG(
- /*reportErrors*/
- !1
- )) || Mm(St, Rwe(
- /*reportErrors*/
- !1
- )) || Mm(St, zL(
- /*reportErrors*/
- !1
- )) || Mm(St, Mwe(
- /*reportErrors*/
- !1
- ))) && (!St.node || !vf(St.node) || !St.node.typeArguments || St.node.typeArguments.length < Yn)))
- for (; Yn > 0; ) {
- const ds = ur[Yn - 1], ro = St.target.typeParameters[Yn - 1], ru = C2(ro);
- if (!ru || !hh(ds, ru))
- break;
- Yn--;
- }
- Rr = Gt(ur.slice(nr, Yn), pe);
- }
- const Rn = j(pe);
- pe.flags |= 16;
- const pi = dc(St.symbol, pe, 788968, Rr);
- return Rn(), Gr ? it(Gr, pi) : pi;
- }
- }
- }
- function it(St, ur) {
- if (bm(St)) {
- let Zr = St.typeArguments, nr = St.qualifier;
- nr && (Oe(nr) ? Zr !== _S(nr) && (nr = D0(A.cloneNode(nr), Zr)) : Zr !== _S(nr.right) && (nr = A.updateQualifiedName(nr, nr.left, D0(A.cloneNode(nr.right), Zr)))), Zr = ur.typeArguments;
- const Gr = Dt(ur);
- for (const Rr of Gr)
- nr = nr ? A.createQualifiedName(nr, Rr) : Rr;
- return A.updateImportTypeNode(
- St,
- St.argument,
- St.attributes,
- nr,
- Zr,
- St.isTypeOf
- );
- } else {
- let Zr = St.typeArguments, nr = St.typeName;
- Oe(nr) ? Zr !== _S(nr) && (nr = D0(A.cloneNode(nr), Zr)) : Zr !== _S(nr.right) && (nr = A.updateQualifiedName(nr, nr.left, D0(A.cloneNode(nr.right), Zr))), Zr = ur.typeArguments;
- const Gr = Dt(ur);
- for (const Rr of Gr)
- nr = A.createQualifiedName(nr, Rr);
- return A.updateTypeReferenceNode(
- St,
- nr,
- Zr
- );
- }
- }
- function Dt(St) {
- let ur = St.typeName;
- const Zr = [];
- for (; !Oe(ur); )
- Zr.unshift(ur.right), ur = ur.left;
- return Zr.unshift(ur), Zr;
- }
- function Er(St) {
- if (W(pe))
- return [A.createPropertySignature(
- /*modifiers*/
- void 0,
- "...",
- /*questionToken*/
- void 0,
- /*type*/
- void 0
- )];
- const ur = [];
- for (const Gr of St.callSignatures)
- ur.push(tn(Gr, 179, pe));
- for (const Gr of St.constructSignatures)
- Gr.flags & 4 || ur.push(tn(Gr, 180, pe));
- for (const Gr of St.indexInfos)
- ur.push(Xr(Gr, pe, St.objectFlags & 1024 ? de(pe) : void 0));
- const Zr = St.properties;
- if (!Zr)
- return ur;
- let nr = 0;
- for (const Gr of Zr) {
- if (nr++, pe.flags & 2048) {
- if (Gr.flags & 4194304)
- continue;
- lp(Gr) & 6 && pe.tracker.reportPrivateInBaseOfClassExpression && pe.tracker.reportPrivateInBaseOfClassExpression(Ei(Gr.escapedName));
- }
- if (W(pe) && nr + 2 < Zr.length - 1) {
- ur.push(A.createPropertySignature(
- /*modifiers*/
- void 0,
- `... ${Zr.length - nr} more ...`,
- /*questionToken*/
- void 0,
- /*type*/
- void 0
- )), ct(Zr[Zr.length - 1], pe, ur);
- break;
- }
- ct(Gr, pe, ur);
- }
- return ur.length ? ur : void 0;
- }
- }
- function de(Ee) {
- return Ee.approximateLength += 3, Ee.flags & 1 ? A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ) : A.createTypeReferenceNode(
- A.createIdentifier("..."),
- /*typeArguments*/
- void 0
- );
- }
- function Ze(Ee, pe) {
- var Ut;
- return !!(gc(Ee) & 8192) && (ss(pe.reverseMappedStack, Ee) || ((Ut = pe.reverseMappedStack) == null ? void 0 : Ut[0]) && !(wn(_a(pe.reverseMappedStack).links.propertyType) & 16) || hn());
- function hn() {
- var Yr;
- if ((((Yr = pe.reverseMappedStack) == null ? void 0 : Yr.length) ?? 0) < 3)
- return !1;
- for (let Qr = 0; Qr < 3; Qr++)
- if (pe.reverseMappedStack[pe.reverseMappedStack.length - 1 - Qr].links.mappedType.symbol !== Ee.links.mappedType.symbol)
- return !1;
- return !0;
- }
- }
- function ct(Ee, pe, Ut) {
- var vr;
- const hn = !!(gc(Ee) & 8192), Yr = Ze(Ee, pe) ? xe : x1(Ee), Qr = pe.enclosingDeclaration;
- if (pe.enclosingDeclaration = void 0, pe.tracker.canTrackSymbol && mN(Ee.escapedName))
- if (Ee.declarations) {
- const kt = xa(Ee.declarations);
- if (PL(kt))
- if (dn(kt)) {
- const tr = os(kt);
- tr && ko(tr) && A3(tr.argumentExpression) && pc(tr.argumentExpression, Qr, pe);
- } else
- pc(kt.name.expression, Qr, pe);
- } else
- pe.tracker.reportNonSerializableProperty(Ji(Ee));
- pe.enclosingDeclaration = Ee.valueDeclaration || ((vr = Ee.declarations) == null ? void 0 : vr[0]) || Qr;
- const gi = jc(Ee, pe);
- if (pe.enclosingDeclaration = Qr, pe.approximateLength += mc(Ee).length + 1, Ee.flags & 98304) {
- const kt = T1(Ee);
- if (Yr !== kt && !H(Yr) && !H(kt)) {
- const tr = Jo(
- Ee,
- 177
- /* GetAccessor */
- ), it = Zf(tr);
- Ut.push(
- mt(
- pe,
- tn(it, 177, pe, { name: gi }),
- tr
- )
- );
- const Dt = Jo(
- Ee,
- 178
- /* SetAccessor */
- ), Er = Zf(Dt);
- Ut.push(
- mt(
- pe,
- tn(Er, 178, pe, { name: gi }),
- Dt
- )
- );
- return;
- }
- }
- const Xi = Ee.flags & 16777216 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0;
- if (Ee.flags & 8208 && !iy(Yr).length && !em(Ee)) {
- const kt = Ns(
- Vc(Yr, (tr) => !(tr.flags & 32768)),
- 0
- /* Call */
- );
- for (const tr of kt) {
- const it = tn(tr, 173, pe, { name: gi, questionToken: Xi });
- Ut.push(Ye(it));
- }
- if (kt.length || !Xi)
- return;
- }
- let ps;
- Ze(Ee, pe) ? ps = de(pe) : (hn && (pe.reverseMappedStack || (pe.reverseMappedStack = []), pe.reverseMappedStack.push(Ee)), ps = Yr ? sb(
- pe,
- /*declaration*/
- void 0,
- Yr,
- Ee
- ) : A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ), hn && pe.reverseMappedStack.pop());
- const Ps = em(Ee) ? [A.createToken(
- 148
- /* ReadonlyKeyword */
- )] : void 0;
- Ps && (pe.approximateLength += 9);
- const Je = A.createPropertySignature(
- Ps,
- gi,
- Xi,
- ps
- );
- Ut.push(Ye(Je));
- function Ye(kt) {
- var tr;
- const it = (tr = Ee.declarations) == null ? void 0 : tr.find(
- (Dt) => Dt.kind === 348
- /* JSDocPropertyTag */
- );
- if (it) {
- const Dt = Cw(it.comment);
- Dt && ov(kt, [{ kind: 3, text: `*
- * ` + Dt.replace(/\n/g, `
- * `) + `
- `, pos: -1, end: -1, hasTrailingNewLine: !0 }]);
- } else Ee.valueDeclaration && mt(pe, kt, Ee.valueDeclaration);
- return kt;
- }
- }
- function mt(Ee, pe, Ut) {
- return Ee.enclosingFile && Ee.enclosingFile === Tr(Ut) ? nl(pe, Ut) : pe;
- }
- function Gt(Ee, pe, Ut) {
- if (ut(Ee)) {
- if (W(pe))
- if (Ut) {
- if (Ee.length > 2)
- return [
- Q(Ee[0], pe),
- A.createTypeReferenceNode(
- `... ${Ee.length - 2} more ...`,
- /*typeArguments*/
- void 0
- ),
- Q(Ee[Ee.length - 1], pe)
- ];
- } else return [A.createTypeReferenceNode(
- "...",
- /*typeArguments*/
- void 0
- )];
- const hn = !(pe.flags & 64) ? Ip() : void 0, Yr = [];
- let Qr = 0;
- for (const gi of Ee) {
- if (Qr++, W(pe) && Qr + 2 < Ee.length - 1) {
- Yr.push(A.createTypeReferenceNode(
- `... ${Ee.length - Qr} more ...`,
- /*typeArguments*/
- void 0
- ));
- const ps = Q(Ee[Ee.length - 1], pe);
- ps && Yr.push(ps);
- break;
- }
- pe.approximateLength += 2;
- const Xi = Q(gi, pe);
- Xi && (Yr.push(Xi), hn && iee(Xi) && hn.add(Xi.typeName.escapedText, [gi, Yr.length - 1]));
- }
- if (hn) {
- const gi = j(pe);
- pe.flags |= 64, hn.forEach((Xi) => {
- if (!see(Xi, ([ps], [Ps]) => sr(ps, Ps)))
- for (const [ps, Ps] of Xi)
- Yr[Ps] = Q(ps, pe);
- }), gi();
- }
- return Yr;
- }
- }
- function sr(Ee, pe) {
- return Ee === pe || !!Ee.symbol && Ee.symbol === pe.symbol || !!Ee.aliasSymbol && Ee.aliasSymbol === pe.aliasSymbol;
- }
- function Xr(Ee, pe, Ut) {
- const vr = mZ(Ee) || "x", hn = Q(Ee.keyType, pe), Yr = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- vr,
- /*questionToken*/
- void 0,
- hn,
- /*initializer*/
- void 0
- );
- return Ut || (Ut = Q(Ee.type || xe, pe)), !Ee.type && !(pe.flags & 2097152) && (pe.encounteredError = !0), pe.approximateLength += vr.length + 4, A.createIndexSignature(
- Ee.isReadonly ? [A.createToken(
- 148
- /* ReadonlyKeyword */
- )] : void 0,
- [Yr],
- Ut
- );
- }
- function tn(Ee, pe, Ut, vr) {
- var hn;
- let Yr, Qr;
- const gi = qPe(
- Ee,
- /*skipUnionExpanding*/
- !0
- )[0], Xi = Un(Ut, Ee.declaration, gi, Ee.typeParameters, Ee.parameters, Ee.mapper);
- Ut.approximateLength += 3, Ut.flags & 32 && Ee.target && Ee.mapper && Ee.target.typeParameters ? Qr = Ee.target.typeParameters.map((it) => Q(zi(it, Ee.mapper), Ut)) : Yr = Ee.typeParameters && Ee.typeParameters.map((it) => js(it, Ut));
- const ps = j(Ut);
- Ut.flags &= -257;
- const Ps = (ut(gi, (it) => it !== gi[gi.length - 1] && !!(gc(it) & 32768)) ? Ee.parameters : gi).map((it) => sc(
- it,
- Ut,
- pe === 176
- /* Constructor */
- )), Je = Ut.flags & 33554432 ? void 0 : ci(Ee, Ut);
- Je && Ps.unshift(Je), ps();
- const Ye = cr(Ut, Ee);
- let kt = vr?.modifiers;
- if (pe === 185 && Ee.flags & 4) {
- const it = mm(kt);
- kt = A.createModifiersFromModifierFlags(
- it | 64
- /* Abstract */
- );
- }
- const tr = pe === 179 ? A.createCallSignature(Yr, Ps, Ye) : pe === 180 ? A.createConstructSignature(Yr, Ps, Ye) : pe === 173 ? A.createMethodSignature(kt, vr?.name ?? A.createIdentifier(""), vr?.questionToken, Yr, Ps, Ye) : pe === 174 ? A.createMethodDeclaration(
- kt,
- /*asteriskToken*/
- void 0,
- vr?.name ?? A.createIdentifier(""),
- /*questionToken*/
- void 0,
- Yr,
- Ps,
- Ye,
- /*body*/
- void 0
- ) : pe === 176 ? A.createConstructorDeclaration(
- kt,
- Ps,
- /*body*/
- void 0
- ) : pe === 177 ? A.createGetAccessorDeclaration(
- kt,
- vr?.name ?? A.createIdentifier(""),
- Ps,
- Ye,
- /*body*/
- void 0
- ) : pe === 178 ? A.createSetAccessorDeclaration(
- kt,
- vr?.name ?? A.createIdentifier(""),
- Ps,
- /*body*/
- void 0
- ) : pe === 181 ? A.createIndexSignature(kt, Ps, Ye) : pe === 317 ? A.createJSDocFunctionType(Ps, Ye) : pe === 184 ? A.createFunctionTypeNode(Yr, Ps, Ye ?? A.createTypeReferenceNode(A.createIdentifier(""))) : pe === 185 ? A.createConstructorTypeNode(kt, Yr, Ps, Ye ?? A.createTypeReferenceNode(A.createIdentifier(""))) : pe === 262 ? A.createFunctionDeclaration(
- kt,
- /*asteriskToken*/
- void 0,
- vr?.name ? Bs(vr.name, Oe) : A.createIdentifier(""),
- Yr,
- Ps,
- Ye,
- /*body*/
- void 0
- ) : pe === 218 ? A.createFunctionExpression(
- kt,
- /*asteriskToken*/
- void 0,
- vr?.name ? Bs(vr.name, Oe) : A.createIdentifier(""),
- Yr,
- Ps,
- Ye,
- A.createBlock([])
- ) : pe === 219 ? A.createArrowFunction(
- kt,
- Yr,
- Ps,
- Ye,
- /*equalsGreaterThanToken*/
- void 0,
- A.createBlock([])
- ) : E.assertNever(pe);
- if (Qr && (tr.typeArguments = A.createNodeArray(Qr)), ((hn = Ee.declaration) == null ? void 0 : hn.kind) === 323 && Ee.declaration.parent.kind === 339) {
- const it = nc(
- Ee.declaration.parent.parent,
- /*includeTrivia*/
- !0
- ).slice(2, -2).split(/\r\n|\n|\r/).map((Dt) => Dt.replace(/^\s+/, " ")).join(`
-`);
- Z4(
- tr,
- 3,
- it,
- /*hasTrailingNewLine*/
- !0
- );
- }
- return Xi?.(), tr;
- }
- function pr(Ee) {
- return ys(Ee) || Lh(Ee) || mS(Ee);
- }
- function er(Ee) {
- return ys(Ee) || Lh(Ee) ? Zf(Ee).typeParameters : Mb(Ee) ? bfe(Ee) : [T2(Tn(Ee.typeParameter))];
- }
- function gn(Ee) {
- return ys(Ee) || Lh(Ee) ? Zf(Ee).parameters : void 0;
- }
- function Un(Ee, pe, Ut, vr, hn, Yr) {
- const Qr = EE(Ee);
- let gi, Xi;
- const ps = Ee.enclosingDeclaration, Ps = Ee.mapper;
- if (Yr && (Ee.mapper = Yr), Ee.enclosingDeclaration && pe) {
- let Je = function(Ye, kt) {
- E.assert(Ee.enclosingDeclaration);
- let tr;
- bn(Ee.enclosingDeclaration).fakeScopeForSignatureDeclaration === Ye ? tr = Ee.enclosingDeclaration : Ee.enclosingDeclaration.parent && bn(Ee.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === Ye && (tr = Ee.enclosingDeclaration.parent), E.assertOptionalNode(tr, Cs);
- const it = tr?.locals ?? Js();
- let Dt, Er;
- if (kt((St, ur) => {
- if (tr) {
- const Zr = it.get(St);
- Zr ? Er = wr(Er, { name: St, oldSymbol: Zr }) : Dt = wr(Dt, St);
- }
- it.set(St, ur);
- }), tr)
- return function() {
- ir(Dt, (ur) => it.delete(ur)), ir(Er, (ur) => it.set(ur.name, ur.oldSymbol));
- };
- {
- const St = A.createBlock(Ue);
- bn(St).fakeScopeForSignatureDeclaration = Ye, St.locals = it, Aa(St, Ee.enclosingDeclaration), Ee.enclosingDeclaration = St;
- }
- };
- gi = ut(Ut) ? Je(
- "params",
- (Ye) => {
- if (Ut)
- for (let kt = 0; kt < Ut.length; kt++) {
- const tr = Ut[kt], it = hn?.[kt];
- hn && it !== tr ? (Ye(tr.escapedName, ze), it && Ye(it.escapedName, ze)) : ir(tr.declarations, (Dt) => {
- if (Ii(Dt) && As(Dt.name))
- return Er(Dt.name), !0;
- return;
- function Er(ur) {
- ir(ur.elements, (Zr) => {
- switch (Zr.kind) {
- case 232:
- return;
- case 208:
- return St(Zr);
- default:
- return E.assertNever(Zr);
- }
- });
- }
- function St(ur) {
- if (As(ur.name))
- return Er(ur.name);
- const Zr = Tn(ur);
- Ye(Zr.escapedName, Zr);
- }
- }) || Ye(tr.escapedName, tr);
- }
- }
- ) : void 0, Ee.flags & 4 && ut(vr) && (Xi = Je(
- "typeParams",
- (Ye) => {
- for (const kt of vr ?? Ue) {
- const tr = Nl(kt, Ee).escapedText;
- Ye(tr, kt.symbol);
- }
- }
- ));
- }
- return () => {
- gi?.(), Xi?.(), Qr(), Ee.enclosingDeclaration = ps, Ee.mapper = Ps;
- };
- }
- function ci(Ee, pe) {
- if (Ee.thisParameter)
- return sc(Ee.thisParameter, pe);
- if (Ee.declaration && cn(Ee.declaration)) {
- const Ut = MI(Ee.declaration);
- if (Ut && Ut.typeExpression)
- return A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "this",
- /*questionToken*/
- void 0,
- Q(r(pe, Ut.typeExpression), pe)
- );
- }
- }
- function Jn(Ee, pe, Ut) {
- const vr = j(pe);
- pe.flags &= -513;
- const hn = A.createModifiersFromModifierFlags(Bfe(Ee)), Yr = Nl(Ee, pe), Qr = C2(Ee), gi = Qr && Q(Qr, pe);
- return vr(), A.createTypeParameterDeclaration(hn, Yr, Ut, gi);
- }
- function Us(Ee, pe, Ut) {
- return pe && y(Ut, pe, Ee) || Q(Ee, Ut);
- }
- function js(Ee, pe, Ut = s_(Ee)) {
- const vr = Ut && Us(Ut, SG(Ee), pe);
- return Jn(Ee, pe, vr);
- }
- function Oo(Ee, pe) {
- const Ut = Ee.kind === 2 || Ee.kind === 3 ? A.createToken(
- 131
- /* AssertsKeyword */
- ) : void 0, vr = Ee.kind === 1 || Ee.kind === 3 ? an(
- A.createIdentifier(Ee.parameterName),
- 16777216
- /* NoAsciiEscaping */
- ) : A.createThisTypeNode(), hn = Ee.type && Q(Ee.type, pe);
- return A.createTypePredicateNode(Ut, vr, hn);
- }
- function ls(Ee) {
- const pe = Jo(
- Ee,
- 169
- /* Parameter */
- );
- if (pe)
- return pe;
- if (!Lg(Ee))
- return Jo(
- Ee,
- 341
- /* JSDocParameterTag */
- );
- }
- function sc(Ee, pe, Ut) {
- const vr = ls(Ee), hn = nn(Ee), Yr = sb(pe, vr, hn, Ee), Qr = !(pe.flags & 8192) && Ut && vr && Hp(vr) ? lr(fb(vr), A.cloneNode) : void 0, Xi = vr && rg(vr) || gc(Ee) & 32768 ? A.createToken(
- 26
- /* DotDotDotToken */
- ) : void 0, ps = Jl(Ee, vr, pe), Je = vr && ML(vr) || gc(Ee) & 16384 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0, Ye = A.createParameterDeclaration(
- Qr,
- Xi,
- ps,
- Je,
- Yr,
- /*initializer*/
- void 0
- );
- return pe.approximateLength += mc(Ee).length + 3, Ye;
- }
- function Jl(Ee, pe, Ut) {
- return pe && pe.name ? pe.name.kind === 80 ? an(
- A.cloneNode(pe.name),
- 16777216
- /* NoAsciiEscaping */
- ) : pe.name.kind === 166 ? an(
- A.cloneNode(pe.name.right),
- 16777216
- /* NoAsciiEscaping */
- ) : vr(pe.name) : mc(Ee);
- function vr(hn) {
- return Yr(hn);
- function Yr(Qr) {
- Ut.tracker.canTrackSymbol && ma(Qr) && dG(Qr) && pc(Qr.expression, Ut.enclosingDeclaration, Ut);
- let gi = br(
- Qr,
- Yr,
- /*context*/
- void 0,
- /*nodesVisitor*/
- void 0,
- Yr
- );
- return va(gi) && (gi = A.updateBindingElement(
- gi,
- gi.dotDotDotToken,
- gi.propertyName,
- gi.name,
- /*initializer*/
- void 0
- )), fo(gi) || (gi = A.cloneNode(gi)), an(
- gi,
- 16777217
- /* NoAsciiEscaping */
- );
- }
- }
- }
- function pc(Ee, pe, Ut) {
- if (!Ut.tracker.canTrackSymbol) return;
- const vr = E_(Ee), hn = Nt(
- vr,
- vr.escapedText,
- 1160127,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- hn && Ut.tracker.trackSymbol(
- hn,
- pe,
- 111551
- /* Value */
- );
- }
- function Pr(Ee, pe, Ut, vr) {
- return pe.tracker.trackSymbol(Ee, pe.enclosingDeclaration, Ut), Wr(Ee, pe, Ut, vr);
- }
- function Wr(Ee, pe, Ut, vr) {
- let hn;
- return !(Ee.flags & 262144) && (pe.enclosingDeclaration || pe.flags & 64) && !(pe.internalFlags & 4) ? (hn = E.checkDefined(Qr(
- Ee,
- Ut,
- /*endOfChain*/
- !0
- )), E.assert(hn && hn.length > 0)) : hn = [Ee], hn;
- function Qr(gi, Xi, ps) {
- let Ps = ty(gi, pe.enclosingDeclaration, Xi, !!(pe.flags & 128)), Je;
- if (!Ps || pf(Ps[0], pe.enclosingDeclaration, Ps.length === 1 ? Xi : qd(Xi))) {
- const kt = kk(Ps ? Ps[0] : gi, pe.enclosingDeclaration, Xi);
- if (Nr(kt)) {
- Je = kt.map(
- (Dt) => ut(Dt.declarations, h1) ? Zs(Dt, pe) : void 0
- );
- const tr = kt.map((Dt, Er) => Er);
- tr.sort(Ye);
- const it = tr.map((Dt) => kt[Dt]);
- for (const Dt of it) {
- const Er = Qr(
- Dt,
- qd(Xi),
- /*endOfChain*/
- !1
- );
- if (Er) {
- if (Dt.exports && Dt.exports.get(
- "export="
- /* ExportEquals */
- ) && nd(Dt.exports.get(
- "export="
- /* ExportEquals */
- ), gi)) {
- Ps = Er;
- break;
- }
- Ps = Er.concat(Ps || [y2(Dt, gi) || gi]);
- break;
- }
- }
- }
- }
- if (Ps)
- return Ps;
- if (
- // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
- ps || // If a parent symbol is an anonymous type, don't write it.
- !(gi.flags & 6144)
- )
- return !ps && !vr && ir(gi.declarations, h1) ? void 0 : [gi];
- function Ye(kt, tr) {
- const it = Je[kt], Dt = Je[tr];
- if (it && Dt) {
- const Er = If(Dt);
- return If(it) === Er ? WO(it) - WO(Dt) : Er ? -1 : 1;
- }
- return 0;
- }
- }
- }
- function wi(Ee, pe) {
- let Ut;
- return CE(Ee).flags & 524384 && (Ut = A.createNodeArray(lr(vd(Ee), (hn) => js(hn, pe)))), Ut;
- }
- function un(Ee, pe, Ut) {
- var vr;
- E.assert(Ee && 0 <= pe && pe < Ee.length);
- const hn = Ee[pe], Yr = na(hn);
- if ((vr = Ut.typeParameterSymbolList) != null && vr.has(Yr))
- return;
- Ut.mustCreateTypeParameterSymbolList && (Ut.mustCreateTypeParameterSymbolList = !1, Ut.typeParameterSymbolList = new Set(Ut.typeParameterSymbolList)), Ut.typeParameterSymbolList.add(Yr);
- let Qr;
- if (Ut.flags & 512 && pe < Ee.length - 1) {
- const gi = hn, Xi = Ee[pe + 1];
- if (gc(Xi) & 1) {
- const ps = E_e(
- gi.flags & 2097152 ? Zl(gi) : gi
- );
- Qr = Gt(lr(ps, (Ps) => ay(Ps, Xi.links.mapper)), Ut);
- } else
- Qr = wi(hn, Ut);
- }
- return Qr;
- }
- function is(Ee) {
- return Rb(Ee.objectType) ? is(Ee.objectType) : Ee;
- }
- function Zs(Ee, pe, Ut) {
- let vr = Jo(
- Ee,
- 307
- /* SourceFile */
- );
- if (!vr) {
- const Je = Tc(Ee.declarations, (Ye) => h2(Ye, Ee));
- Je && (vr = Jo(
- Je,
- 307
- /* SourceFile */
- ));
- }
- if (vr && vr.moduleName !== void 0)
- return vr.moduleName;
- if (!vr && Fre.test(Ee.escapedName))
- return Ee.escapedName.substring(1, Ee.escapedName.length - 1);
- if (!pe.enclosingFile || !pe.tracker.moduleResolverHost)
- return Fre.test(Ee.escapedName) ? Ee.escapedName.substring(1, Ee.escapedName.length - 1) : Tr(Vj(Ee)).fileName;
- const hn = Ho(pe.enclosingDeclaration), Yr = WZ(hn) ? xC(hn) : void 0, Qr = pe.enclosingFile, gi = Ut || Yr && e.getModeForUsageLocation(Qr, Yr) || Qr && e.getDefaultResolutionModeForFile(Qr), Xi = xD(Qr.path, gi), ps = Bi(Ee);
- let Ps = ps.specifierCache && ps.specifierCache.get(Xi);
- if (!Ps) {
- const Je = !!O.outFile, { moduleResolverHost: Ye } = pe.tracker, kt = Je ? { ...O, baseUrl: Ye.getCommonSourceDirectory() } : O;
- Ps = xa(Tye(
- Ee,
- Br,
- kt,
- Qr,
- Ye,
- {
- importModuleSpecifierPreference: Je ? "non-relative" : "project-relative",
- importModuleSpecifierEnding: Je ? "minimal" : gi === 99 ? "js" : void 0
- },
- { overrideImportMode: Ut }
- )), ps.specifierCache ?? (ps.specifierCache = /* @__PURE__ */ new Map()), ps.specifierCache.set(Xi, Ps);
- }
- return Ps;
- }
- function Fo(Ee) {
- const pe = A.createIdentifier(Ei(Ee.escapedName));
- return Ee.parent ? A.createQualifiedName(Fo(Ee.parent), pe) : pe;
- }
- function dc(Ee, pe, Ut, vr) {
- const hn = Pr(Ee, pe, Ut, !(pe.flags & 16384)), Yr = Ut === 111551;
- if (ut(hn[0].declarations, h1)) {
- const Xi = hn.length > 1 ? gi(hn, hn.length - 1, 1) : void 0, ps = vr || un(hn, 0, pe), Ps = Tr(Ho(pe.enclosingDeclaration)), Je = s7(hn[0]);
- let Ye, kt;
- if ((yu(O) === 3 || yu(O) === 99) && Je?.impliedNodeFormat === 99 && Je.impliedNodeFormat !== Ps?.impliedNodeFormat && (Ye = Zs(
- hn[0],
- pe,
- 99
- /* ESNext */
- ), kt = A.createImportAttributes(
- A.createNodeArray([
- A.createImportAttribute(
- A.createStringLiteral("resolution-mode"),
- A.createStringLiteral("import")
- )
- ])
- )), Ye || (Ye = Zs(hn[0], pe)), !(pe.flags & 67108864) && yu(O) !== 1 && Ye.includes("/node_modules/")) {
- const it = Ye;
- if (yu(O) === 3 || yu(O) === 99) {
- const Dt = Ps?.impliedNodeFormat === 99 ? 1 : 99;
- Ye = Zs(hn[0], pe, Dt), Ye.includes("/node_modules/") ? Ye = it : kt = A.createImportAttributes(
- A.createNodeArray([
- A.createImportAttribute(
- A.createStringLiteral("resolution-mode"),
- A.createStringLiteral(Dt === 99 ? "import" : "require")
- )
- ])
- );
- }
- kt || (pe.encounteredError = !0, pe.tracker.reportLikelyUnsafeImportRequiredError && pe.tracker.reportLikelyUnsafeImportRequiredError(it));
- }
- const tr = A.createLiteralTypeNode(A.createStringLiteral(Ye));
- if (pe.approximateLength += Ye.length + 10, !Xi || l_(Xi)) {
- if (Xi) {
- const it = Oe(Xi) ? Xi : Xi.right;
- D0(
- it,
- /*typeArguments*/
- void 0
- );
- }
- return A.createImportTypeNode(tr, kt, Xi, ps, Yr);
- } else {
- const it = is(Xi), Dt = it.objectType.typeName;
- return A.createIndexedAccessTypeNode(A.createImportTypeNode(tr, kt, Dt, ps, Yr), it.indexType);
- }
- }
- const Qr = gi(hn, hn.length - 1, 0);
- if (Rb(Qr))
- return Qr;
- if (Yr)
- return A.createTypeQueryNode(Qr);
- {
- const Xi = Oe(Qr) ? Qr : Qr.right, ps = _S(Xi);
- return D0(
- Xi,
- /*typeArguments*/
- void 0
- ), A.createTypeReferenceNode(Qr, ps);
- }
- function gi(Xi, ps, Ps) {
- const Je = ps === Xi.length - 1 ? vr : un(Xi, ps, pe), Ye = Xi[ps], kt = Xi[ps - 1];
- let tr;
- if (ps === 0)
- pe.flags |= 16777216, tr = v1(Ye, pe), pe.approximateLength += (tr ? tr.length : 0) + 1, pe.flags ^= 16777216;
- else if (kt && n_(kt)) {
- const Dt = n_(kt);
- El(Dt, (Er, St) => {
- if (nd(Er, Ye) && !mN(St) && St !== "export=")
- return tr = Ei(St), !0;
- });
- }
- if (tr === void 0) {
- const Dt = Tc(Ye.declarations, os);
- if (Dt && ma(Dt) && l_(Dt.expression)) {
- const Er = gi(Xi, ps - 1, Ps);
- return l_(Er) ? A.createIndexedAccessTypeNode(A.createParenthesizedType(A.createTypeQueryNode(Er)), A.createTypeQueryNode(Dt.expression)) : Er;
- }
- tr = v1(Ye, pe);
- }
- if (pe.approximateLength += tr.length + 1, !(pe.flags & 16) && kt && k1(kt) && k1(kt).get(Ye.escapedName) && nd(k1(kt).get(Ye.escapedName), Ye)) {
- const Dt = gi(Xi, ps - 1, Ps);
- return Rb(Dt) ? A.createIndexedAccessTypeNode(Dt, A.createLiteralTypeNode(A.createStringLiteral(tr))) : A.createIndexedAccessTypeNode(A.createTypeReferenceNode(Dt, Je), A.createLiteralTypeNode(A.createStringLiteral(tr)));
- }
- const it = an(
- A.createIdentifier(tr),
- 16777216
- /* NoAsciiEscaping */
- );
- if (Je && D0(it, A.createNodeArray(Je)), it.symbol = Ye, ps > Ps) {
- const Dt = gi(Xi, ps - 1, Ps);
- return l_(Dt) ? A.createQualifiedName(Dt, it) : E.fail("Impossible construct - an export of an indexed access cannot be reachable");
- }
- return it;
- }
- }
- function Ta(Ee, pe, Ut) {
- const vr = Nt(
- pe.enclosingDeclaration,
- Ee,
- 788968,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- return vr && vr.flags & 262144 ? vr !== Ut.symbol : !1;
- }
- function Nl(Ee, pe) {
- var Ut, vr, hn, Yr;
- if (pe.flags & 4 && pe.typeParameterNames) {
- const Xi = pe.typeParameterNames.get(Rl(Ee));
- if (Xi)
- return Xi;
- }
- let Qr = Sc(
- Ee.symbol,
- pe,
- 788968,
- /*expectsIdentifier*/
- !0
- );
- if (!(Qr.kind & 80))
- return A.createIdentifier("(Missing type parameter)");
- const gi = (vr = (Ut = Ee.symbol) == null ? void 0 : Ut.declarations) == null ? void 0 : vr[0];
- if (gi && zo(gi) && (Qr = a(pe, Qr, gi.name)), pe.flags & 4) {
- const Xi = Qr.escapedText;
- let ps = ((hn = pe.typeParameterNamesByTextNextNameCount) == null ? void 0 : hn.get(Xi)) || 0, Ps = Xi;
- for (; (Yr = pe.typeParameterNamesByText) != null && Yr.has(Ps) || Ta(Ps, pe, Ee); )
- ps++, Ps = `${Xi}_${ps}`;
- if (Ps !== Xi) {
- const Je = _S(Qr);
- Qr = A.createIdentifier(Ps), D0(Qr, Je);
- }
- pe.mustCreateTypeParametersNamesLookups && (pe.mustCreateTypeParametersNamesLookups = !1, pe.typeParameterNames = new Map(pe.typeParameterNames), pe.typeParameterNamesByTextNextNameCount = new Map(pe.typeParameterNamesByTextNextNameCount), pe.typeParameterNamesByText = new Set(pe.typeParameterNamesByText)), pe.typeParameterNamesByTextNextNameCount.set(Xi, ps), pe.typeParameterNames.set(Rl(Ee), Qr), pe.typeParameterNamesByText.add(Ps);
- }
- return Qr;
- }
- function Sc(Ee, pe, Ut, vr) {
- const hn = Pr(Ee, pe, Ut);
- return vr && hn.length !== 1 && !pe.encounteredError && !(pe.flags & 65536) && (pe.encounteredError = !0), Yr(hn, hn.length - 1);
- function Yr(Qr, gi) {
- const Xi = un(Qr, gi, pe), ps = Qr[gi];
- gi === 0 && (pe.flags |= 16777216);
- const Ps = v1(ps, pe);
- gi === 0 && (pe.flags ^= 16777216);
- const Je = an(
- A.createIdentifier(Ps),
- 16777216
- /* NoAsciiEscaping */
- );
- return Xi && D0(Je, A.createNodeArray(Xi)), Je.symbol = ps, gi > 0 ? A.createQualifiedName(Yr(Qr, gi - 1), Je) : Je;
- }
- }
- function mo(Ee, pe, Ut) {
- const vr = Pr(Ee, pe, Ut);
- return hn(vr, vr.length - 1);
- function hn(Yr, Qr) {
- const gi = un(Yr, Qr, pe), Xi = Yr[Qr];
- Qr === 0 && (pe.flags |= 16777216);
- let ps = v1(Xi, pe);
- Qr === 0 && (pe.flags ^= 16777216);
- let Ps = ps.charCodeAt(0);
- if (n3(Ps) && ut(Xi.declarations, h1))
- return A.createStringLiteral(Zs(Xi, pe));
- if (Qr === 0 || dJ(ps, B)) {
- const Je = an(
- A.createIdentifier(ps),
- 16777216
- /* NoAsciiEscaping */
- );
- return gi && D0(Je, A.createNodeArray(gi)), Je.symbol = Xi, Qr > 0 ? A.createPropertyAccessExpression(hn(Yr, Qr - 1), Je) : Je;
- } else {
- Ps === 91 && (ps = ps.substring(1, ps.length - 1), Ps = ps.charCodeAt(0));
- let Je;
- if (n3(Ps) && !(Xi.flags & 8) ? Je = A.createStringLiteral(
- ap(ps).replace(/\\./g, (Ye) => Ye.substring(1)),
- Ps === 39
- /* singleQuote */
- ) : "" + +ps === ps && (Je = A.createNumericLiteral(+ps)), !Je) {
- const Ye = an(
- A.createIdentifier(ps),
- 16777216
- /* NoAsciiEscaping */
- );
- gi && D0(Ye, A.createNodeArray(gi)), Ye.symbol = Xi, Je = Ye;
- }
- return A.createElementAccessExpression(hn(Yr, Qr - 1), Je);
- }
- }
- }
- function ep(Ee) {
- const pe = os(Ee);
- return pe ? ma(pe) ? !!(Gi(pe.expression).flags & 402653316) : ko(pe) ? !!(Gi(pe.argumentExpression).flags & 402653316) : oa(pe) : !1;
- }
- function Ac(Ee) {
- const pe = os(Ee);
- return !!(pe && oa(pe) && (pe.singleQuote || !fo(pe) && Ui(nc(
- pe,
- /*includeTrivia*/
- !1
- ), "'")));
- }
- function jc(Ee, pe) {
- const Ut = !!Nr(Ee.declarations) && Mi(Ee.declarations, ep), vr = !!Nr(Ee.declarations) && Mi(Ee.declarations, Ac), hn = !!(Ee.flags & 8192), Yr = _y(Ee, pe, vr, Ut, hn);
- if (Yr)
- return Yr;
- const Qr = Ei(Ee.escapedName);
- return w5(Qr, pa(O), vr, Ut, hn);
- }
- function _y(Ee, pe, Ut, vr, hn) {
- const Yr = Bi(Ee).nameType;
- if (Yr) {
- if (Yr.flags & 384) {
- const Qr = "" + Yr.value;
- return !k_(Qr, pa(O)) && (vr || !qg(Qr)) ? A.createStringLiteral(Qr, !!Ut) : qg(Qr) && Ui(Qr, "-") ? A.createComputedPropertyName(A.createPrefixUnaryExpression(41, A.createNumericLiteral(-Qr))) : w5(Qr, pa(O), Ut, vr, hn);
- }
- if (Yr.flags & 8192)
- return A.createComputedPropertyName(mo(
- Yr.symbol,
- pe,
- 111551
- /* Value */
- ));
- }
- }
- function EE(Ee) {
- const pe = Ee.mustCreateTypeParameterSymbolList, Ut = Ee.mustCreateTypeParametersNamesLookups;
- Ee.mustCreateTypeParameterSymbolList = !0, Ee.mustCreateTypeParametersNamesLookups = !0;
- const vr = Ee.typeParameterNames, hn = Ee.typeParameterNamesByText, Yr = Ee.typeParameterNamesByTextNextNameCount, Qr = Ee.typeParameterSymbolList;
- return () => {
- Ee.typeParameterNames = vr, Ee.typeParameterNamesByText = hn, Ee.typeParameterNamesByTextNextNameCount = Yr, Ee.typeParameterSymbolList = Qr, Ee.mustCreateTypeParameterSymbolList = pe, Ee.mustCreateTypeParametersNamesLookups = Ut;
- };
- }
- function GP(Ee, pe) {
- return Ee.declarations && On(Ee.declarations, (Ut) => !!rX(Ut) && (!pe || !!or(Ut, (vr) => vr === pe)));
- }
- function $P(Ee, pe) {
- if (!(wn(pe) & 4) || !vf(Ee)) return !0;
- jL(Ee);
- const Ut = bn(Ee).resolvedSymbol, vr = Ut && bo(Ut);
- return !vr || vr !== pe.target ? !0 : Nr(Ee.typeArguments) >= Bm(pe.target.typeParameters);
- }
- function Df(Ee) {
- for (; bn(Ee).fakeScopeForSignatureDeclaration; )
- Ee = Ee.parent;
- return Ee;
- }
- function sb(Ee, pe, Ut, vr) {
- var hn, Yr;
- const Qr = pe && (Ii(pe) || dp(pe)) && tX(pe, Ee.enclosingDeclaration), gi = Ee.enclosingDeclaration, Xi = j(Ee);
- if (pe && hee(pe) && !(Ee.internalFlags & 2) && ve.serializeTypeOfDeclaration(pe, Ee), Ee.internalFlags |= 2, gi && (!H(Ut) || Ee.internalFlags & 8)) {
- const Ye = pe && rX(pe) ? pe : GP(vr);
- if (Ye && !no(Ye) && !Lf(Ye)) {
- const kt = rX(Ye), tr = Qr || !!(vr.flags & 4 && vr.flags & 16777216 && WC(Ye) && ((hn = vr.links) != null && hn.mappedType) && O3e(Ut)), it = !Px(kt) && m(Ee, kt, Ut, Ye, tr);
- if (it)
- return Xi(), it;
- }
- }
- Ut.flags & 8192 && Ut.symbol === vr && (!Ee.enclosingDeclaration || ut(vr.declarations, (Ye) => Tr(Ye) === Tr(Ee.enclosingDeclaration))) && (Ee.flags |= 1048576);
- const ps = pe ?? vr.valueDeclaration ?? ((Yr = vr.declarations) == null ? void 0 : Yr[0]), Ps = ps && _ut(ps) ? HIe(ps) : void 0, Je = l(Ee, Ps, Ut, Qr);
- return Xi(), Je;
- }
- function Pt(Ee, pe, Ut) {
- return Ut === pe ? !0 : Ee && (Ii(Ee) || m_(Ee) || cs(Ee)) && Ee.questionToken ? ad(
- pe,
- 524288
- /* NEUndefined */
- ) === Ut : !1;
- }
- function cr(Ee, pe) {
- const Ut = Ee.flags & 256, vr = j(Ee);
- Ut && (Ee.flags &= -257);
- let hn;
- const Yr = Ha(pe);
- return Yr && !(Ut && Wa(Yr)) ? (pe.declaration && !(Ee.internalFlags & 2) && ve.serializeReturnTypeForSignature(pe.declaration, Ee), Ee.internalFlags |= 2, hn = Or(Ee, pe)) : Ut || (hn = A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )), vr(), hn;
- }
- function Or(Ee, pe) {
- const Ut = Cp(pe), vr = Ha(pe);
- if (Ee.enclosingDeclaration && (!H(vr) || Ee.internalFlags & 8) && pe.declaration && !fo(pe.declaration)) {
- const Yr = Sut(pe.declaration);
- if (Yr) {
- const Qr = m(Ee, Yr, vr, Ee.enclosingDeclaration);
- if (Qr)
- return Qr;
- }
- }
- if (Ut)
- return Oo(Ut, Ee);
- const hn = pe.declaration && HIe(pe.declaration);
- return l(Ee, hn, vr);
- }
- function Ur(Ee, pe) {
- let Ut = !1;
- const vr = E_(Ee);
- if (cn(Ee) && (iS(vr) || jg(vr.parent) || Xu(vr.parent) && sB(vr.parent.left) && iS(vr.parent.right)))
- return Ut = !0, { introducesError: Ut, node: Ee };
- const hn = aN(Ee);
- let Yr;
- if (Ly(vr))
- return Yr = Tn(Lu(
- vr,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- )), Hd(
- Yr,
- vr,
- hn,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility !== 0 && (Ut = !0, pe.tracker.reportInaccessibleThisError()), { introducesError: Ut, node: Qr(Ee) };
- if (Yr = Yo(
- vr,
- hn,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0
- ), pe.enclosingDeclaration && !(Yr && Yr.flags & 262144)) {
- Yr = _f(Yr);
- const gi = Yo(
- vr,
- hn,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- pe.enclosingDeclaration
- );
- if (
- // Check for unusable parameters symbols
- gi === ze || // If the symbol is not found, but was not found in the original scope either we probably have an error, don't reuse the node
- gi === void 0 && Yr !== void 0 || // If the symbol is found both in declaration scope and in current scope then it shoudl point to the same reference
- gi && Yr && !nd(_f(gi), Yr)
- )
- return gi !== ze && pe.tracker.reportInferenceFallback(Ee), Ut = !0, { introducesError: Ut, node: Ee, sym: Yr };
- Yr = gi;
- }
- if (Yr)
- return Yr.flags & 1 && Yr.valueDeclaration && (iv(Yr.valueDeclaration) || dp(Yr.valueDeclaration)) ? { introducesError: Ut, node: Qr(Ee) } : (!(Yr.flags & 262144) && // Type parameters are visible in the current context if they are are resolvable
- !og(Ee) && Hd(
- Yr,
- pe.enclosingDeclaration,
- hn,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility !== 0 ? (pe.tracker.reportInferenceFallback(Ee), Ut = !0) : pe.tracker.trackSymbol(Yr, pe.enclosingDeclaration, hn), { introducesError: Ut, node: Qr(Ee) });
- return { introducesError: Ut, node: Ee };
- function Qr(gi) {
- if (gi === vr) {
- const ps = bo(Yr), Ps = Yr.flags & 262144 ? Nl(ps, pe) : A.cloneNode(gi);
- return Ps.symbol = Yr, a(pe, an(
- Ps,
- 16777216
- /* NoAsciiEscaping */
- ), gi);
- }
- const Xi = br(
- gi,
- (ps) => Qr(ps),
- /*context*/
- void 0
- );
- return Xi !== gi && a(pe, Xi, gi), Xi;
- }
- }
- function xn(Ee, pe, Ut, vr) {
- const hn = Ut ? 111551 : 788968, Yr = Yo(
- pe,
- hn,
- /*ignoreErrors*/
- !0
- );
- if (!Yr) return;
- const Qr = Yr.flags & 2097152 ? Zl(Yr) : Yr;
- if (Hd(
- Yr,
- Ee.enclosingDeclaration,
- hn,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility === 0)
- return dc(Qr, Ee, hn, vr);
- }
- function Kn(Ee, pe) {
- if (cn(pe) && h0(pe)) {
- m3e(pe);
- const Ut = bn(pe).resolvedSymbol;
- return !Ut || !// The import type resolved using jsdoc fallback logic
- (!pe.isTypeOf && !(Ut.flags & 788968) || // The import type had type arguments autofilled by js fallback logic
- !(Nr(pe.typeArguments) >= Bm(vd(Ut))));
- }
- if (HC(pe))
- return Ee.mapper === void 0 ? !0 : !!r(
- Ee,
- pe,
- /*noMappedTypes*/
- !0
- );
- if (vf(pe)) {
- if (xd(pe)) return !1;
- const Ut = jL(pe), vr = bn(pe).resolvedSymbol;
- if (!vr) return !1;
- if (vr.flags & 262144) {
- const hn = bo(vr);
- if (Ee.mapper && ay(hn, Ee.mapper) !== hn)
- return !1;
- }
- if (e3(pe))
- return $P(pe, Ut) && !Ewe(pe) && vr.flags & 788968;
- }
- if (cv(pe) && pe.operator === 158 && pe.type.kind === 155) {
- const Ut = Ee.enclosingDeclaration && Df(Ee.enclosingDeclaration);
- return !!or(pe, (vr) => vr === Ut);
- }
- return !0;
- }
- function ea(Ee, pe) {
- const Ut = r(Ee, pe);
- return Q(Ut, Ee);
- }
- function ua(Ee, pe) {
- i && i.throwIfCancellationRequested && i.throwIfCancellationRequested();
- let Ut = !1;
- const { finalizeBoundary: vr, startRecoveryScope: hn } = gi(), Yr = Ge(pe, Qr, fi);
- if (!vr())
- return;
- return Ee.approximateLength += pe.end - pe.pos, Yr;
- function Qr(it) {
- if (Ut) return it;
- const Dt = hn(), Er = pr(it) ? Xi(it) : void 0, St = tr(it);
- return Er?.(), Ut ? fi(it) && !Px(it) ? (Dt(), ea(Ee, it)) : it : St ? a(Ee, St, it) : void 0;
- }
- function gi() {
- let it, Dt;
- const Er = Ee.tracker, St = Ee.trackedSymbols;
- Ee.trackedSymbols = void 0;
- const ur = Ee.encounteredError;
- return Ee.tracker = new Rre(Ee, {
- ...Er.inner,
- reportCyclicStructureError() {
- Zr(() => Er.reportCyclicStructureError());
- },
- reportInaccessibleThisError() {
- Zr(() => Er.reportInaccessibleThisError());
- },
- reportInaccessibleUniqueSymbolError() {
- Zr(() => Er.reportInaccessibleUniqueSymbolError());
- },
- reportLikelyUnsafeImportRequiredError(Rr) {
- Zr(() => Er.reportLikelyUnsafeImportRequiredError(Rr));
- },
- reportNonSerializableProperty(Rr) {
- Zr(() => Er.reportNonSerializableProperty(Rr));
- },
- trackSymbol(Rr, Rn, pi) {
- return (it ?? (it = [])).push([Rr, Rn, pi]), !1;
- },
- moduleResolverHost: Ee.tracker.moduleResolverHost
- }, Ee.tracker.moduleResolverHost), {
- startRecoveryScope: nr,
- finalizeBoundary: Gr
- };
- function Zr(Rr) {
- Ut = !0, (Dt ?? (Dt = [])).push(Rr);
- }
- function nr() {
- const Rr = it?.length ?? 0, Rn = Dt?.length ?? 0;
- return () => {
- Ut = !1, it && (it.length = Rr), Dt && (Dt.length = Rn);
- };
- }
- function Gr() {
- return Ee.tracker = Er, Ee.trackedSymbols = St, Ee.encounteredError = ur, Dt?.forEach((Rr) => Rr()), Ut ? !1 : (it?.forEach(
- ([Rr, Rn, pi]) => Ee.tracker.trackSymbol(
- Rr,
- Rn,
- pi
- )
- ), !0);
- }
- }
- function Xi(it) {
- return Un(Ee, it, gn(it), er(it));
- }
- function ps(it) {
- const Dt = b4(it);
- switch (Dt.kind) {
- case 183:
- return kt(Dt);
- case 186:
- return Ye(Dt);
- case 199:
- return Ps(Dt);
- case 198:
- const Er = Dt;
- if (Er.operator === 143)
- return Je(Er);
- }
- return Ge(it, Qr, fi);
- }
- function Ps(it) {
- const Dt = ps(it.objectType);
- if (Dt !== void 0)
- return A.updateIndexedAccessTypeNode(it, Dt, Ge(it.indexType, Qr, fi));
- }
- function Je(it) {
- E.assertEqual(
- it.operator,
- 143
- /* KeyOfKeyword */
- );
- const Dt = ps(it.type);
- if (Dt !== void 0)
- return A.updateTypeOperatorNode(it, Dt);
- }
- function Ye(it) {
- const { introducesError: Dt, node: Er } = Ur(it.exprName, Ee);
- if (!Dt)
- return A.updateTypeQueryNode(
- it,
- Er,
- Fr(it.typeArguments, Qr, fi)
- );
- const St = xn(
- Ee,
- it.exprName,
- /*isTypeOf*/
- !0
- );
- if (St)
- return a(Ee, St, it.exprName);
- }
- function kt(it) {
- if (Kn(Ee, it)) {
- const { introducesError: Dt, node: Er } = Ur(it.typeName, Ee), St = Fr(it.typeArguments, Qr, fi);
- if (Dt) {
- const ur = xn(
- Ee,
- it.typeName,
- /*isTypeOf*/
- !1,
- St
- );
- if (ur)
- return a(Ee, ur, it.typeName);
- } else {
- const ur = A.updateTypeReferenceNode(
- it,
- Er,
- St
- );
- return a(Ee, ur, it);
- }
- }
- }
- function tr(it) {
- if (pv(it))
- return Ge(it.type, Qr, fi);
- if (nte(it) || it.kind === 319)
- return A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- );
- if (ite(it))
- return A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- );
- if (QC(it))
- return A.createUnionTypeNode([Ge(it.type, Qr, fi), A.createLiteralTypeNode(A.createNull())]);
- if (BJ(it))
- return A.createUnionTypeNode([Ge(it.type, Qr, fi), A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- )]);
- if (eO(it))
- return Ge(it.type, Qr);
- if (tO(it))
- return A.createArrayTypeNode(Ge(it.type, Qr, fi));
- if (bS(it))
- return A.createTypeLiteralNode(lr(it.jsDocPropertyTags, (nr) => {
- const Gr = Ge(Oe(nr.name) ? nr.name : nr.name.right, Qr, Oe), Rr = Rc(r(Ee, it), Gr.escapedText), Rn = Rr && nr.typeExpression && r(Ee, nr.typeExpression.type) !== Rr ? Q(Rr, Ee) : void 0;
- return A.createPropertySignature(
- /*modifiers*/
- void 0,
- Gr,
- nr.isBracketed || nr.typeExpression && BJ(nr.typeExpression.type) ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- Rn || nr.typeExpression && Ge(nr.typeExpression.type, Qr, fi) || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- );
- }));
- if (vf(it) && Oe(it.typeName) && it.typeName.escapedText === "")
- return kn(A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ), it);
- if ((Oh(it) || vf(it)) && P7(it))
- return A.createTypeLiteralNode([A.createIndexSignature(
- /*modifiers*/
- void 0,
- [A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "x",
- /*questionToken*/
- void 0,
- Ge(it.typeArguments[0], Qr, fi)
- )],
- Ge(it.typeArguments[1], Qr, fi)
- )]);
- if (YC(it))
- if (CC(it)) {
- let nr;
- return A.createConstructorTypeNode(
- /*modifiers*/
- void 0,
- Fr(it.typeParameters, Qr, zo),
- Ai(it.parameters, (Gr, Rr) => Gr.name && Oe(Gr.name) && Gr.name.escapedText === "new" ? (nr = Gr.type, void 0) : A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- St(Gr),
- a(Ee, A.createIdentifier(ur(Gr, Rr)), Gr),
- A.cloneNode(Gr.questionToken),
- Ge(Gr.type, Qr, fi),
- /*initializer*/
- void 0
- )),
- Ge(nr || it.type, Qr, fi) || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- );
- } else
- return A.createFunctionTypeNode(
- Fr(it.typeParameters, Qr, zo),
- lr(it.parameters, (nr, Gr) => A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- St(nr),
- a(Ee, A.createIdentifier(ur(nr, Gr)), nr),
- A.cloneNode(nr.questionToken),
- Ge(nr.type, Qr, fi),
- /*initializer*/
- void 0
- )),
- Ge(it.type, Qr, fi) || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- );
- if (HC(it))
- return Kn(Ee, it) || (Ut = !0), it;
- if (zo(it))
- return A.updateTypeParameterDeclaration(
- it,
- Fr(it.modifiers, Qr, ra),
- a(Ee, Nl(bo(Tn(it)), Ee), it),
- Ge(it.constraint, Qr, fi),
- Ge(it.default, Qr, fi)
- );
- if (Rb(it)) {
- const nr = Ps(it);
- return nr || (Ut = !0, it);
- }
- if (vf(it)) {
- const nr = kt(it);
- return nr || (Ut = !0, it);
- }
- if (h0(it)) {
- const nr = bn(it).resolvedSymbol;
- return e3(it) && nr && // The import type resolved using jsdoc fallback logic
- (!it.isTypeOf && !(nr.flags & 788968) || // The import type had type arguments autofilled by js fallback logic
- !(Nr(it.typeArguments) >= Bm(vd(nr)))) ? a(Ee, Q(r(Ee, it), Ee), it) : A.updateImportTypeNode(
- it,
- A.updateLiteralTypeNode(it.argument, Zr(it, it.argument.literal)),
- Ge(it.attributes, Qr, hS),
- Ge(it.qualifier, Qr, l_),
- Fr(it.typeArguments, Qr, fi),
- it.isTypeOf
- );
- }
- if (Vl(it) && it.name.kind === 167 && !dG(it.name)) {
- if (!Dh(it))
- return Dt(it, Qr);
- if (!(Ee.internalFlags & 8 && yo(it.name.expression) && Wm(it.name).flags & 1))
- return;
- }
- if (ys(it) && !it.type || cs(it) && !it.type && !it.initializer || m_(it) && !it.type && !it.initializer || Ii(it) && !it.type && !it.initializer) {
- let nr = Dt(it, Qr);
- return nr === it && (nr = a(Ee, A.cloneNode(it), it)), nr.type = A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ), Ii(it) && (nr.modifiers = void 0), nr;
- }
- if (Lb(it)) {
- const nr = Ye(it);
- return nr || (Ut = !0, it);
- }
- if (ma(it) && yo(it.expression)) {
- const { node: nr, introducesError: Gr } = Ur(it.expression, Ee);
- if (Gr) {
- const Rr = J_(Vde(it.expression)), Rn = Q(Rr, Ee);
- let pi;
- if (P0(Rn))
- pi = Rn.literal;
- else {
- const Yn = kIe(it.expression), ds = typeof Yn.value == "string" ? A.createStringLiteral(
- Yn.value,
- /*isSingleQuote*/
- void 0
- ) : typeof Yn.value == "number" ? A.createNumericLiteral(
- Yn.value,
- /*numericLiteralFlags*/
- 0
- ) : void 0;
- if (!ds)
- return bm(Rn) && pc(it.expression, Ee.enclosingDeclaration, Ee), it;
- pi = ds;
- }
- return pi.kind === 11 && k_(pi.text, pa(O)) ? A.createIdentifier(pi.text) : pi.kind === 9 && !pi.text.startsWith("-") ? pi : A.updateComputedPropertyName(it, pi);
- } else
- return A.updateComputedPropertyName(it, nr);
- }
- if (Px(it)) {
- let nr;
- if (Oe(it.parameterName)) {
- const { node: Gr, introducesError: Rr } = Ur(it.parameterName, Ee);
- Ut = Ut || Rr, nr = Gr;
- } else
- nr = A.cloneNode(it.parameterName);
- return A.updateTypePredicateNode(it, A.cloneNode(it.assertsModifier), nr, Ge(it.type, Qr, fi));
- }
- if (wx(it) || Qu(it) || mS(it)) {
- const nr = Dt(it, Qr), Gr = a(Ee, nr === it ? A.cloneNode(it) : nr, it), Rr = ya(Gr);
- return an(Gr, Rr | (Ee.flags & 1024 && Qu(it) ? 0 : 1)), Gr;
- }
- if (oa(it) && Ee.flags & 268435456 && !it.singleQuote) {
- const nr = A.cloneNode(it);
- return nr.singleQuote = !0, nr;
- }
- if (Mb(it)) {
- const nr = Ge(it.checkType, Qr, fi), Gr = Xi(it), Rr = Ge(it.extendsType, Qr, fi), Rn = Ge(it.trueType, Qr, fi);
- Gr();
- const pi = Ge(it.falseType, Qr, fi);
- return A.updateConditionalTypeNode(
- it,
- nr,
- Rr,
- Rn,
- pi
- );
- }
- if (cv(it)) {
- if (it.operator === 158 && it.type.kind === 155) {
- if (!Kn(Ee, it))
- return Ut = !0, it;
- } else if (it.operator === 143) {
- const nr = Je(it);
- return nr || (Ut = !0, it);
- }
- }
- return Dt(it, Qr);
- function Dt(nr, Gr) {
- const Rr = !Ee.enclosingFile || Ee.enclosingFile !== Tr(nr);
- return br(
- nr,
- Gr,
- /*context*/
- void 0,
- Rr ? Er : void 0
- );
- }
- function Er(nr, Gr, Rr, Rn, pi) {
- let Yn = Fr(nr, Gr, Rr, Rn, pi);
- return Yn && (Yn.pos !== -1 || Yn.end !== -1) && (Yn === nr && (Yn = A.createNodeArray(nr.slice(), nr.hasTrailingComma)), wd(Yn, -1, -1)), Yn;
- }
- function St(nr) {
- return nr.dotDotDotToken || (nr.type && tO(nr.type) ? A.createToken(
- 26
- /* DotDotDotToken */
- ) : void 0);
- }
- function ur(nr, Gr) {
- return nr.name && Oe(nr.name) && nr.name.escapedText === "this" ? "this" : St(nr) ? "args" : `arg${Gr}`;
- }
- function Zr(nr, Gr) {
- if (Ee.bundled || Ee.enclosingFile !== Tr(Gr)) {
- let Rr = Gr.text;
- const Rn = bn(it).resolvedSymbol, pi = nr.isTypeOf ? 111551 : 788968, Yn = Rn && Hd(
- Rn,
- Ee.enclosingDeclaration,
- pi,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility === 0 && Pr(
- Rn,
- Ee,
- pi,
- /*yieldModuleSymbol*/
- !0
- )[0];
- if (Yn && fC(Yn))
- Rr = Zs(Yn, Ee);
- else {
- const ds = Qde(nr);
- ds && (Rr = Zs(ds.symbol, Ee));
- }
- if (Rr.includes("/node_modules/") && (Ee.encounteredError = !0, Ee.tracker.reportLikelyUnsafeImportRequiredError && Ee.tracker.reportLikelyUnsafeImportRequiredError(Rr)), Rr !== Gr.text)
- return kn(A.createStringLiteral(Rr), Gr);
- }
- return Ge(Gr, Qr, oa);
- }
- }
- }
- function So(Ee, pe) {
- var Ut;
- const vr = u7e(
- A.createPropertyDeclaration,
- 174,
- /*useAccessors*/
- !0
- ), hn = u7e(
- (xt, In, li, ni) => A.createPropertySignature(xt, In, li, ni),
- 173,
- /*useAccessors*/
- !1
- ), Yr = pe.enclosingDeclaration;
- let Qr = [];
- const gi = /* @__PURE__ */ new Set(), Xi = [], ps = pe;
- pe = {
- ...ps,
- usedSymbolNames: new Set(ps.usedSymbolNames),
- remappedSymbolNames: /* @__PURE__ */ new Map(),
- remappedSymbolReferences: new Map((Ut = ps.remappedSymbolReferences) == null ? void 0 : Ut.entries()),
- tracker: void 0
- };
- const Ps = {
- ...ps.tracker.inner,
- trackSymbol: (xt, In, li) => {
- var ni, Hn;
- if ((ni = pe.remappedSymbolNames) != null && ni.has(na(xt))) return !1;
- if (Hd(
- xt,
- In,
- li,
- /*shouldComputeAliasesToMakeVisible*/
- !1
- ).accessibility === 0) {
- const Xs = Wr(xt, pe, li);
- if (!(xt.flags & 4)) {
- const Is = Xs[0], ws = Tr(ps.enclosingDeclaration);
- ut(Is.declarations, (Ga) => Tr(Ga) === ws) && Rn(Is);
- }
- } else if ((Hn = ps.tracker.inner) != null && Hn.trackSymbol)
- return ps.tracker.inner.trackSymbol(xt, In, li);
- return !1;
- }
- };
- pe.tracker = new Rre(pe, Ps, ps.tracker.moduleResolverHost), El(Ee, (xt, In) => {
- const li = Ei(In);
- wg(xt, li);
- });
- let Je = !pe.bundled;
- const Ye = Ee.get(
- "export="
- /* ExportEquals */
- );
- return Ye && Ee.size > 1 && Ye.flags & 2098688 && (Ee = Js(), Ee.set("export=", Ye)), nr(Ee), St(Qr);
- function kt(xt) {
- return !!xt && xt.kind === 80;
- }
- function tr(xt) {
- return yc(xt) ? Ln(lr(xt.declarationList.declarations, os), kt) : Ln([os(xt)], kt);
- }
- function it(xt) {
- const In = On(xt, wo), li = ac(xt, zc);
- let ni = li !== -1 ? xt[li] : void 0;
- if (ni && In && In.isExportEquals && Oe(In.expression) && Oe(ni.name) && Nn(ni.name) === Nn(In.expression) && ni.body && Sm(ni.body)) {
- const Hn = Ln(xt, (Is) => !!(Mu(Is) & 32)), Qa = ni.name;
- let Xs = ni.body;
- if (Nr(Hn) && (ni = A.updateModuleDeclaration(
- ni,
- ni.modifiers,
- ni.name,
- Xs = A.updateModuleBlock(
- Xs,
- A.createNodeArray([
- ...ni.body.statements,
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports(lr(ta(Hn, (Is) => tr(Is)), (Is) => A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- /*propertyName*/
- void 0,
- Is
- ))),
- /*moduleSpecifier*/
- void 0
- )
- ])
- )
- ), xt = [...xt.slice(0, li), ni, ...xt.slice(li + 1)]), !On(xt, (Is) => Is !== ni && xw(Is, Qa))) {
- Qr = [];
- const Is = !ut(Xs.statements, (ws) => Gn(
- ws,
- 32
- /* Export */
- ) || wo(ws) || Nc(ws));
- ir(Xs.statements, (ws) => {
- Yn(
- ws,
- Is ? 32 : 0
- /* None */
- );
- }), xt = [...Ln(xt, (ws) => ws !== ni && ws !== In), ...Qr];
- }
- }
- return xt;
- }
- function Dt(xt) {
- const In = Ln(xt, (ni) => Nc(ni) && !ni.moduleSpecifier && !!ni.exportClause && pp(ni.exportClause));
- Nr(In) > 1 && (xt = [
- ...Ln(xt, (Hn) => !Nc(Hn) || !!Hn.moduleSpecifier || !Hn.exportClause),
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports(ta(In, (Hn) => Bs(Hn.exportClause, pp).elements)),
- /*moduleSpecifier*/
- void 0
- )
- ]);
- const li = Ln(xt, (ni) => Nc(ni) && !!ni.moduleSpecifier && !!ni.exportClause && pp(ni.exportClause));
- if (Nr(li) > 1) {
- const ni = Zk(li, (Hn) => oa(Hn.moduleSpecifier) ? ">" + Hn.moduleSpecifier.text : ">");
- if (ni.length !== li.length)
- for (const Hn of ni)
- Hn.length > 1 && (xt = [
- ...Ln(xt, (Qa) => !Hn.includes(Qa)),
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports(ta(Hn, (Qa) => Bs(Qa.exportClause, pp).elements)),
- Hn[0].moduleSpecifier
- )
- ]);
- }
- return xt;
- }
- function Er(xt) {
- const In = ac(xt, (li) => Nc(li) && !li.moduleSpecifier && !li.attributes && !!li.exportClause && pp(li.exportClause));
- if (In >= 0) {
- const li = xt[In], ni = Ai(li.exportClause.elements, (Hn) => {
- if (!Hn.propertyName && Hn.name.kind !== 11) {
- const Qa = Hn.name, Xs = _I(xt), Is = Ln(Xs, (ws) => xw(xt[ws], Qa));
- if (Nr(Is) && Mi(Is, (ws) => U3(xt[ws]))) {
- for (const ws of Is)
- xt[ws] = ur(xt[ws]);
- return;
- }
- }
- return Hn;
- });
- Nr(ni) ? xt[In] = A.updateExportDeclaration(
- li,
- li.modifiers,
- li.isTypeOnly,
- A.updateNamedExports(
- li.exportClause,
- ni
- ),
- li.moduleSpecifier,
- li.attributes
- ) : Ty(xt, In);
- }
- return xt;
- }
- function St(xt) {
- return xt = it(xt), xt = Dt(xt), xt = Er(xt), Yr && (Si(Yr) && X_(Yr) || zc(Yr)) && (!ut(xt, Ow) || !zY(xt) && ut(xt, HI)) && xt.push(aA(A)), xt;
- }
- function ur(xt) {
- const In = (Mu(xt) | 32) & -129;
- return A.replaceModifiers(xt, In);
- }
- function Zr(xt) {
- const In = Mu(xt) & -33;
- return A.replaceModifiers(xt, In);
- }
- function nr(xt, In, li) {
- In || Xi.push(/* @__PURE__ */ new Map()), xt.forEach((ni) => {
- Gr(
- ni,
- /*isPrivate*/
- !1,
- !!li
- );
- }), In || (Xi[Xi.length - 1].forEach((ni) => {
- Gr(
- ni,
- /*isPrivate*/
- !0,
- !!li
- );
- }), Xi.pop());
- }
- function Gr(xt, In, li) {
- qa(nn(xt));
- const ni = Ra(xt);
- if (gi.has(na(ni)))
- return;
- if (gi.add(na(ni)), !In || Nr(xt.declarations) && ut(xt.declarations, (Qa) => !!or(Qa, (Xs) => Xs === Yr))) {
- const Qa = EE(pe);
- Rr(xt, In, li), Qa();
- }
- }
- function Rr(xt, In, li, ni = xt.escapedName) {
- var Hn, Qa, Xs, Is, ws, Ga;
- const To = Ei(ni), o_ = ni === "default";
- if (In && !(pe.flags & 131072) && ix(To) && !o_) {
- pe.encounteredError = !0;
- return;
- }
- let mu = o_ && !!(xt.flags & -113 || xt.flags & 16 && Nr(qa(nn(xt)))) && !(xt.flags & 2097152), nu = !mu && !In && ix(To) && !o_;
- (mu || nu) && (In = !0);
- const Po = (In ? 0 : 32) | (o_ && !mu ? 2048 : 0), iu = xt.flags & 1536 && xt.flags & 7 && ni !== "export=", wp = iu && rme(nn(xt), xt);
- if ((xt.flags & 8208 || wp) && tm(nn(xt), xt, wg(xt, To), Po), xt.flags & 524288 && ds(xt, To, Po), xt.flags & 98311 && ni !== "export=" && !(xt.flags & 4194304) && !(xt.flags & 32) && !(xt.flags & 8192) && !wp)
- if (li)
- ZM(xt) && (nu = !1, mu = !1);
- else {
- const Il = nn(xt), mf = wg(xt, To);
- if (Il.symbol && Il.symbol !== xt && Il.symbol.flags & 16 && ut(Il.symbol.declarations, Wy) && ((Hn = Il.symbol.members) != null && Hn.size || (Qa = Il.symbol.exports) != null && Qa.size))
- pe.remappedSymbolReferences || (pe.remappedSymbolReferences = /* @__PURE__ */ new Map()), pe.remappedSymbolReferences.set(na(Il.symbol), xt), Rr(Il.symbol, In, li, ni), pe.remappedSymbolReferences.delete(na(Il.symbol));
- else if (!(xt.flags & 16) && rme(Il, xt))
- tm(Il, xt, mf, Po);
- else {
- const Qk = xt.flags & 2 ? zk(xt) ? 2 : 1 : (Xs = xt.parent) != null && Xs.valueDeclaration && Si((Is = xt.parent) == null ? void 0 : Is.valueDeclaration) ? 2 : void 0, Gm = mu || !(xt.flags & 4) ? mf : KM(mf, xt);
- let M1 = xt.declarations && On(xt.declarations, (cI) => ii(cI));
- M1 && Fl(M1.parent) && M1.parent.declarations.length === 1 && (M1 = M1.parent.parent);
- const R1 = (ws = xt.declarations) == null ? void 0 : ws.find(Cn);
- if (R1 && dn(R1.parent) && Oe(R1.parent.right) && ((Ga = Il.symbol) != null && Ga.valueDeclaration) && Si(Il.symbol.valueDeclaration)) {
- const cI = mf === R1.parent.right.escapedText ? void 0 : R1.parent.right;
- Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- cI,
- mf
- )])
- ),
- 0
- /* None */
- ), pe.tracker.trackSymbol(
- Il.symbol,
- pe.enclosingDeclaration,
- 111551
- /* Value */
- );
- } else {
- const cI = a(
- pe,
- A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList([
- A.createVariableDeclaration(
- Gm,
- /*exclamationToken*/
- void 0,
- sb(
- pe,
- /*declaration*/
- void 0,
- Il,
- xt
- )
- )
- ], Qk)
- ),
- M1
- );
- Yn(cI, Gm !== mf ? Po & -33 : Po), Gm !== mf && !In && (Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- Gm,
- mf
- )])
- ),
- 0
- /* None */
- ), nu = !1, mu = !1);
- }
- }
- }
- if (xt.flags & 384 && ab(xt, To, Po), xt.flags & 32 && (xt.flags & 4 && xt.valueDeclaration && dn(xt.valueDeclaration.parent) && $c(xt.valueDeclaration.parent.right) ? oI(xt, wg(xt, To), Po) : QP(xt, wg(xt, To), Po)), (xt.flags & 1536 && (!iu || T_(xt)) || wp) && cd(xt, To, Po), xt.flags & 64 && !(xt.flags & 32) && ro(xt, To, Po), xt.flags & 2097152 && oI(xt, wg(xt, To), Po), xt.flags & 4 && xt.escapedName === "export=" && ZM(xt), xt.flags & 8388608 && xt.declarations)
- for (const Il of xt.declarations) {
- const mf = v_(Il, Il.moduleSpecifier);
- mf && Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- Il.isTypeOnly,
- /*exportClause*/
- void 0,
- A.createStringLiteral(Zs(mf, pe))
- ),
- 0
- /* None */
- );
- }
- mu ? Yn(
- A.createExportAssignment(
- /*modifiers*/
- void 0,
- /*isExportEquals*/
- !1,
- A.createIdentifier(wg(xt, To))
- ),
- 0
- /* None */
- ) : nu && Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- wg(xt, To),
- To
- )])
- ),
- 0
- /* None */
- );
- }
- function Rn(xt) {
- if (ut(xt.declarations, iv)) return;
- E.assertIsDefined(Xi[Xi.length - 1]), KM(Ei(xt.escapedName), xt);
- const In = !!(xt.flags & 2097152) && !ut(xt.declarations, (li) => !!or(li, Nc) || ug(li) || gl(li) && !Fh(li.moduleReference));
- Xi[In ? 0 : Xi.length - 1].set(na(xt), xt);
- }
- function pi(xt) {
- return Si(xt) && (X_(xt) || Rp(xt)) || Fu(xt) && !ig(xt);
- }
- function Yn(xt, In) {
- if (Hp(xt)) {
- let li = 0;
- const ni = pe.enclosingDeclaration && (Bp(pe.enclosingDeclaration) ? Tr(pe.enclosingDeclaration) : pe.enclosingDeclaration);
- In & 32 && ni && (pi(ni) || zc(ni)) && U3(xt) && (li |= 32), Je && !(li & 32) && (!ni || !(ni.flags & 33554432)) && (Bb(xt) || yc(xt) || Ec(xt) || Xc(xt) || zc(xt)) && (li |= 128), In & 2048 && (Xc(xt) || Xl(xt) || Ec(xt)) && (li |= 2048), li && (xt = A.replaceModifiers(xt, li | Mu(xt)));
- }
- Qr.push(xt);
- }
- function ds(xt, In, li) {
- var ni;
- const Hn = OPe(xt), Qa = Bi(xt).typeParameters, Xs = lr(Qa, (mu) => js(mu, pe)), Is = (ni = xt.declarations) == null ? void 0 : ni.find(Bp), ws = Cw(Is ? Is.comment || Is.parent.comment : void 0), Ga = j(pe);
- pe.flags |= 8388608;
- const To = pe.enclosingDeclaration;
- pe.enclosingDeclaration = Is;
- const o_ = Is && Is.typeExpression && pv(Is.typeExpression) && y(
- pe,
- Is.typeExpression.type,
- Hn,
- /*host*/
- void 0
- ) || Q(Hn, pe);
- Yn(
- ov(
- A.createTypeAliasDeclaration(
- /*modifiers*/
- void 0,
- wg(xt, In),
- Xs,
- o_
- ),
- ws ? [{ kind: 3, text: `*
- * ` + ws.replace(/\n/g, `
- * `) + `
- `, pos: -1, end: -1, hasTrailingNewLine: !0 }] : []
- ),
- li
- ), Ga(), pe.enclosingDeclaration = To;
- }
- function ro(xt, In, li) {
- const ni = b_(xt), Hn = vd(xt), Qa = lr(Hn, (nu) => js(nu, pe)), Xs = No(ni), Is = Nr(Xs) ? ia(Xs) : void 0, ws = ta(qa(ni), (nu) => b_t(nu, Is)), Ga = nme(
- 0,
- ni,
- Is,
- 179
- /* CallSignature */
- ), To = nme(
- 1,
- ni,
- Is,
- 180
- /* ConstructSignature */
- ), o_ = _7e(ni, Is), mu = Nr(Xs) ? [A.createHeritageClause(96, Ai(Xs, (nu) => ime(
- nu,
- 111551
- /* Value */
- )))] : void 0;
- Yn(
- A.createInterfaceDeclaration(
- /*modifiers*/
- void 0,
- wg(xt, In),
- Qa,
- mu,
- [...o_, ...To, ...Ga, ...ws]
- ),
- li
- );
- }
- function ru(xt) {
- let In = as(n_(xt).values());
- const li = Ra(xt);
- if (li !== xt) {
- const ni = new Set(In);
- for (const Hn of n_(li).values())
- Pu(Mc(Hn)) & 111551 || ni.add(Hn);
- In = as(ni);
- }
- return Ln(In, (ni) => x_(ni) && k_(
- ni.escapedName,
- 99
- /* ESNext */
- ));
- }
- function T_(xt) {
- return Mi(ru(xt), (In) => !(Pu(Mc(In)) & 111551));
- }
- function cd(xt, In, li) {
- const ni = ru(xt), Hn = nw(ni, (Is) => Is.parent && Is.parent === xt ? "real" : "merged"), Qa = Hn.get("real") || Ue, Xs = Hn.get("merged") || Ue;
- if (Nr(Qa)) {
- const Is = wg(xt, In);
- XP(Qa, Is, li, !!(xt.flags & 67108880));
- }
- if (Nr(Xs)) {
- const Is = Tr(pe.enclosingDeclaration), ws = wg(xt, In), Ga = A.createModuleBlock([A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports(Ai(Ln(
- Xs,
- (To) => To.escapedName !== "export="
- /* ExportEquals */
- ), (To) => {
- var o_, mu;
- const nu = Ei(To.escapedName), Po = wg(To, nu), iu = To.declarations && Du(To);
- if (Is && (iu ? Is !== Tr(iu) : !ut(To.declarations, (mf) => Tr(mf) === Is))) {
- (mu = (o_ = pe.tracker) == null ? void 0 : o_.reportNonlocalAugmentation) == null || mu.call(o_, Is, xt, To);
- return;
- }
- const wp = iu && p1(
- iu,
- /*dontRecursivelyResolve*/
- !0
- );
- Rn(wp || To);
- const Il = wp ? wg(wp, Ei(wp.escapedName)) : Po;
- return A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- nu === Il ? void 0 : Il,
- nu
- );
- }))
- )]);
- Yn(
- A.createModuleDeclaration(
- /*modifiers*/
- void 0,
- A.createIdentifier(ws),
- Ga,
- 32
- /* Namespace */
- ),
- 0
- /* None */
- );
- }
- }
- function ab(xt, In, li) {
- Yn(
- A.createEnumDeclaration(
- A.createModifiersFromModifierFlags(dde(xt) ? 4096 : 0),
- wg(xt, In),
- lr(Ln(qa(nn(xt)), (ni) => !!(ni.flags & 8)), (ni) => {
- const Hn = ni.declarations && ni.declarations[0] && A0(ni.declarations[0]) ? Gde(ni.declarations[0]) : void 0;
- return A.createEnumMember(
- Ei(ni.escapedName),
- Hn === void 0 ? void 0 : typeof Hn == "string" ? A.createStringLiteral(Hn) : A.createNumericLiteral(Hn)
- );
- })
- ),
- li
- );
- }
- function tm(xt, In, li, ni) {
- const Hn = Ns(
- xt,
- 0
- /* Call */
- );
- for (const Qa of Hn) {
- const Xs = tn(Qa, 262, pe, { name: A.createIdentifier(li) });
- Yn(a(pe, Xs, fy(Qa)), ni);
- }
- if (!(In.flags & 1536 && In.exports && In.exports.size)) {
- const Qa = Ln(qa(xt), x_);
- XP(
- Qa,
- li,
- ni,
- /*suppressNewPrivateContext*/
- !0
- );
- }
- }
- function fy(xt) {
- if (xt.declaration && xt.declaration.parent) {
- if (dn(xt.declaration.parent) && Cc(xt.declaration.parent) === 5)
- return xt.declaration.parent;
- if (ii(xt.declaration.parent) && xt.declaration.parent.parent)
- return xt.declaration.parent.parent;
- }
- return xt.declaration;
- }
- function XP(xt, In, li, ni) {
- if (Nr(xt)) {
- const Qa = nw(xt, (Po) => !Nr(Po.declarations) || ut(Po.declarations, (iu) => Tr(iu) === Tr(pe.enclosingDeclaration)) ? "local" : "remote").get("local") || Ue;
- let Xs = gv.createModuleDeclaration(
- /*modifiers*/
- void 0,
- A.createIdentifier(In),
- A.createModuleBlock([]),
- 32
- /* Namespace */
- );
- Aa(Xs, Yr), Xs.locals = Js(xt), Xs.symbol = xt[0].parent;
- const Is = Qr;
- Qr = [];
- const ws = Je;
- Je = !1;
- const Ga = { ...pe, enclosingDeclaration: Xs }, To = pe;
- pe = Ga, nr(
- Js(Qa),
- ni,
- /*propertyAsAlias*/
- !0
- ), pe = To, Je = ws;
- const o_ = Qr;
- Qr = Is;
- const mu = lr(o_, (Po) => wo(Po) && !Po.isExportEquals && Oe(Po.expression) ? A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- Po.expression,
- A.createIdentifier(
- "default"
- /* Default */
- )
- )])
- ) : Po), nu = Mi(mu, (Po) => Gn(
- Po,
- 32
- /* Export */
- )) ? lr(mu, Zr) : mu;
- Xs = A.updateModuleDeclaration(
- Xs,
- Xs.modifiers,
- Xs.name,
- A.createModuleBlock(nu)
- ), Yn(Xs, li);
- }
- }
- function x_(xt) {
- return !!(xt.flags & 2887656) || !(xt.flags & 4194304 || xt.escapedName === "prototype" || xt.valueDeclaration && zs(xt.valueDeclaration) && Zn(xt.valueDeclaration.parent));
- }
- function L1(xt) {
- const In = Ai(xt, (li) => {
- const ni = pe.enclosingDeclaration;
- pe.enclosingDeclaration = li;
- let Hn = li.expression;
- if (yo(Hn)) {
- if (Oe(Hn) && Nn(Hn) === "")
- return Qa(
- /*result*/
- void 0
- );
- let Xs;
- if ({ introducesError: Xs, node: Hn } = Ur(Hn, pe), Xs)
- return Qa(
- /*result*/
- void 0
- );
- }
- return Qa(A.createExpressionWithTypeArguments(
- Hn,
- lr(li.typeArguments, (Xs) => y(pe, Xs, r(pe, Xs)) || Q(r(pe, Xs), pe))
- ));
- function Qa(Xs) {
- return pe.enclosingDeclaration = ni, Xs;
- }
- });
- if (In.length === xt.length)
- return In;
- }
- function QP(xt, In, li) {
- var ni, Hn;
- const Qa = (ni = xt.declarations) == null ? void 0 : ni.find(Zn), Xs = pe.enclosingDeclaration;
- pe.enclosingDeclaration = Qa || Xs;
- const Is = vd(xt), ws = lr(Is, ($m) => js($m, pe)), Ga = df(b_(xt)), To = No(Ga), o_ = Qa && DC(Qa), mu = o_ && L1(o_) || Ai(Fa(Ga), T_t), nu = nn(xt), Po = !!((Hn = nu.symbol) != null && Hn.valueDeclaration) && Zn(nu.symbol.valueDeclaration), iu = Po ? oi(nu) : xe, wp = [
- ...Nr(To) ? [A.createHeritageClause(96, lr(To, ($m) => S_t($m, iu, In)))] : [],
- ...Nr(mu) ? [A.createHeritageClause(119, mu)] : []
- ], Il = nlt(Ga, To, qa(Ga)), mf = Ln(Il, ($m) => {
- const YP = $m.valueDeclaration;
- return !!YP && !(Vl(YP) && Di(YP.name));
- }), Gm = ut(Il, ($m) => {
- const YP = $m.valueDeclaration;
- return !!YP && Vl(YP) && Di(YP.name);
- }) ? [A.createPropertyDeclaration(
- /*modifiers*/
- void 0,
- A.createPrivateIdentifier("#private"),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- )] : Ue, M1 = ta(mf, ($m) => vr(
- $m,
- /*isStatic*/
- !1,
- To[0]
- )), R1 = ta(
- Ln(qa(nu), ($m) => !($m.flags & 4194304) && $m.escapedName !== "prototype" && !x_($m)),
- ($m) => vr(
- $m,
- /*isStatic*/
- !0,
- iu
- )
- ), x_t = !Po && !!xt.valueDeclaration && cn(xt.valueDeclaration) && !ut(Ns(
- nu,
- 1
- /* Construct */
- )) ? [A.createConstructorDeclaration(
- A.createModifiersFromModifierFlags(
- 2
- /* Private */
- ),
- [],
- /*body*/
- void 0
- )] : nme(
- 1,
- nu,
- iu,
- 176
- /* Constructor */
- ), k_t = _7e(Ga, To[0]);
- pe.enclosingDeclaration = Xs, Yn(
- a(
- pe,
- A.createClassDeclaration(
- /*modifiers*/
- void 0,
- In,
- ws,
- wp,
- [...k_t, ...R1, ...x_t, ...M1, ...Gm]
- ),
- xt.declarations && Ln(xt.declarations, ($m) => Xc($m) || $c($m))[0]
- ),
- li
- );
- }
- function aI(xt) {
- return Tc(xt, (In) => {
- if (Zu(In) || vu(In))
- return Fy(In.propertyName || In.name);
- if (dn(In) || wo(In)) {
- const li = wo(In) ? In.expression : In.right;
- if (Cn(li))
- return Nn(li.name);
- }
- if (kf(In)) {
- const li = os(In);
- if (li && Oe(li))
- return Nn(li);
- }
- });
- }
- function oI(xt, In, li) {
- var ni, Hn, Qa, Xs, Is;
- const ws = Du(xt);
- if (!ws) return E.fail();
- const Ga = Ra(p1(
- ws,
- /*dontRecursivelyResolve*/
- !0
- ));
- if (!Ga)
- return;
- let To = Jw(Ga) && aI(xt.declarations) || Ei(Ga.escapedName);
- To === "export=" && ae && (To = "default");
- const o_ = wg(Ga, To);
- switch (Rn(Ga), ws.kind) {
- case 208:
- if (((Hn = (ni = ws.parent) == null ? void 0 : ni.parent) == null ? void 0 : Hn.kind) === 260) {
- const Po = Zs(Ga.parent || Ga, pe), { propertyName: iu } = ws;
- Yn(
- A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- A.createNamedImports([A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- iu && Oe(iu) ? A.createIdentifier(Nn(iu)) : void 0,
- A.createIdentifier(In)
- )])
- ),
- A.createStringLiteral(Po),
- /*attributes*/
- void 0
- ),
- 0
- /* None */
- );
- break;
- }
- E.failBadSyntaxKind(((Qa = ws.parent) == null ? void 0 : Qa.parent) || ws, "Unhandled binding element grandparent kind in declaration serialization");
- break;
- case 304:
- ((Is = (Xs = ws.parent) == null ? void 0 : Xs.parent) == null ? void 0 : Is.kind) === 226 && wT(
- Ei(xt.escapedName),
- o_
- );
- break;
- case 260:
- if (Cn(ws.initializer)) {
- const Po = ws.initializer, iu = A.createUniqueName(In), wp = Zs(Ga.parent || Ga, pe);
- Yn(
- A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- iu,
- A.createExternalModuleReference(A.createStringLiteral(wp))
- ),
- 0
- /* None */
- ), Yn(
- A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createIdentifier(In),
- A.createQualifiedName(iu, Po.name)
- ),
- li
- );
- break;
- }
- case 271:
- if (Ga.escapedName === "export=" && ut(Ga.declarations, (Po) => Si(Po) && Rp(Po))) {
- ZM(xt);
- break;
- }
- const mu = !(Ga.flags & 512) && !ii(ws);
- Yn(
- A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createIdentifier(In),
- mu ? Sc(
- Ga,
- pe,
- -1,
- /*expectsIdentifier*/
- !1
- ) : A.createExternalModuleReference(A.createStringLiteral(Zs(Ga, pe)))
- ),
- mu ? li : 0
- /* None */
- );
- break;
- case 270:
- Yn(
- A.createNamespaceExportDeclaration(Nn(ws.name)),
- 0
- /* None */
- );
- break;
- case 273: {
- const Po = Zs(Ga.parent || Ga, pe), iu = pe.bundled ? A.createStringLiteral(Po) : ws.parent.moduleSpecifier, wp = ic(ws.parent) ? ws.parent.attributes : void 0, Il = Cm(ws.parent);
- Yn(
- A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- Il,
- A.createIdentifier(In),
- /*namedBindings*/
- void 0
- ),
- iu,
- wp
- ),
- 0
- /* None */
- );
- break;
- }
- case 274: {
- const Po = Zs(Ga.parent || Ga, pe), iu = pe.bundled ? A.createStringLiteral(Po) : ws.parent.parent.moduleSpecifier, wp = Cm(ws.parent.parent);
- Yn(
- A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- wp,
- /*name*/
- void 0,
- A.createNamespaceImport(A.createIdentifier(In))
- ),
- iu,
- ws.parent.attributes
- ),
- 0
- /* None */
- );
- break;
- }
- case 280:
- Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamespaceExport(A.createIdentifier(In)),
- A.createStringLiteral(Zs(Ga, pe))
- ),
- 0
- /* None */
- );
- break;
- case 276: {
- const Po = Zs(Ga.parent || Ga, pe), iu = pe.bundled ? A.createStringLiteral(Po) : ws.parent.parent.parent.moduleSpecifier, wp = Cm(ws.parent.parent.parent);
- Yn(
- A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- wp,
- /*name*/
- void 0,
- A.createNamedImports([
- A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- In !== To ? A.createIdentifier(To) : void 0,
- A.createIdentifier(In)
- )
- ])
- ),
- iu,
- ws.parent.parent.parent.attributes
- ),
- 0
- /* None */
- );
- break;
- }
- case 281:
- const nu = ws.parent.parent.moduleSpecifier;
- if (nu) {
- const Po = ws.propertyName;
- Po && ng(Po) && (To = "default");
- }
- wT(
- Ei(xt.escapedName),
- nu ? To : o_,
- nu && Xa(nu) ? A.createStringLiteral(nu.text) : void 0
- );
- break;
- case 277:
- ZM(xt);
- break;
- case 226:
- case 211:
- case 212:
- xt.escapedName === "default" || xt.escapedName === "export=" ? ZM(xt) : wT(In, o_);
- break;
- default:
- return E.failBadSyntaxKind(ws, "Unhandled alias declaration kind in symbol serializer!");
- }
- }
- function wT(xt, In, li) {
- Yn(
- A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- xt !== In ? In : void 0,
- xt
- )]),
- li
- ),
- 0
- /* None */
- );
- }
- function ZM(xt) {
- var In;
- if (xt.flags & 4194304)
- return !1;
- const li = Ei(xt.escapedName), ni = li === "export=", Qa = ni || li === "default", Xs = xt.declarations && Du(xt), Is = Xs && p1(
- Xs,
- /*dontRecursivelyResolve*/
- !0
- );
- if (Is && Nr(Is.declarations) && ut(Is.declarations, (ws) => Tr(ws) === Tr(Yr))) {
- const ws = Xs && (wo(Xs) || dn(Xs) ? dB(Xs) : QZ(Xs)), Ga = ws && yo(ws) ? ylt(ws) : void 0, To = Ga && Yo(
- Ga,
- -1,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- Yr
- );
- (To || Is) && Rn(To || Is);
- const o_ = pe.tracker.disableTrackSymbol;
- if (pe.tracker.disableTrackSymbol = !0, Qa)
- Qr.push(A.createExportAssignment(
- /*modifiers*/
- void 0,
- ni,
- mo(
- Is,
- pe,
- -1
- /* All */
- )
- ));
- else if (Ga === ws && Ga)
- wT(li, Nn(Ga));
- else if (ws && $c(ws))
- wT(li, wg(Is, mc(Is)));
- else {
- const mu = KM(li, xt);
- Yn(
- A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createIdentifier(mu),
- Sc(
- Is,
- pe,
- -1,
- /*expectsIdentifier*/
- !1
- )
- ),
- 0
- /* None */
- ), wT(li, mu);
- }
- return pe.tracker.disableTrackSymbol = o_, !0;
- } else {
- const ws = KM(li, xt), Ga = J_(nn(Ra(xt)));
- if (rme(Ga, xt))
- tm(
- Ga,
- xt,
- ws,
- Qa ? 0 : 32
- /* Export */
- );
- else {
- const To = ((In = pe.enclosingDeclaration) == null ? void 0 : In.kind) === 267 && (!(xt.flags & 98304) || xt.flags & 65536) ? 1 : 2, o_ = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList([
- A.createVariableDeclaration(
- ws,
- /*exclamationToken*/
- void 0,
- sb(
- pe,
- /*declaration*/
- void 0,
- Ga,
- xt
- )
- )
- ], To)
- );
- Yn(
- o_,
- Is && Is.flags & 4 && Is.escapedName === "export=" ? 128 : li === ws ? 32 : 0
- /* None */
- );
- }
- return Qa ? (Qr.push(A.createExportAssignment(
- /*modifiers*/
- void 0,
- ni,
- A.createIdentifier(ws)
- )), !0) : li !== ws ? (wT(li, ws), !0) : !1;
- }
- }
- function rme(xt, In) {
- var li;
- const ni = Tr(pe.enclosingDeclaration);
- return wn(xt) & 48 && !ut((li = xt.symbol) == null ? void 0 : li.declarations, fi) && // If the type comes straight from a type node, we shouldn't try to break it up
- !Nr(wu(xt)) && !cN(xt) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
- !!(Nr(Ln(qa(xt), x_)) || Nr(Ns(
- xt,
- 0
- /* Call */
- ))) && !Nr(Ns(
- xt,
- 1
- /* Construct */
- )) && // TODO: could probably serialize as function + ns + class, now that that's OK
- !GP(In, Yr) && !(xt.symbol && ut(xt.symbol.declarations, (Hn) => Tr(Hn) !== ni)) && !ut(qa(xt), (Hn) => mN(Hn.escapedName)) && !ut(qa(xt), (Hn) => ut(Hn.declarations, (Qa) => Tr(Qa) !== ni)) && Mi(qa(xt), (Hn) => k_(mc(Hn), B) ? Hn.flags & 98304 ? x1(Hn) === T1(Hn) : !0 : !1);
- }
- function u7e(xt, In, li) {
- return function(Hn, Qa, Xs) {
- var Is, ws, Ga, To, o_;
- const mu = lp(Hn), nu = !!(mu & 2);
- if (Qa && Hn.flags & 2887656)
- return [];
- if (Hn.flags & 4194304 || Hn.escapedName === "constructor" || Xs && Gs(Xs, Hn.escapedName) && em(Gs(Xs, Hn.escapedName)) === em(Hn) && (Hn.flags & 16777216) === (Gs(Xs, Hn.escapedName).flags & 16777216) && hh(nn(Hn), Rc(Xs, Hn.escapedName)))
- return [];
- const Po = mu & -1025 | (Qa ? 256 : 0), iu = jc(Hn, pe), wp = (Is = Hn.declarations) == null ? void 0 : Is.find(Nf(cs, Ay, ii, m_, dn, Cn));
- if (Hn.flags & 98304 && li) {
- const Il = [];
- if (Hn.flags & 65536) {
- const mf = Hn.declarations && ir(Hn.declarations, (Gm) => {
- if (Gm.kind === 178)
- return Gm;
- if (Fs(Gm) && sS(Gm))
- return ir(Gm.arguments[2].properties, (M1) => {
- const R1 = os(M1);
- if (R1 && Oe(R1) && Nn(R1) === "set")
- return M1;
- });
- });
- E.assert(!!mf);
- const Qk = no(mf) ? Zf(mf).parameters[0] : void 0;
- Il.push(a(
- pe,
- A.createSetAccessorDeclaration(
- A.createModifiersFromModifierFlags(Po),
- iu,
- [A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Qk ? Jl(Qk, ls(Qk), pe) : "value",
- /*questionToken*/
- void 0,
- nu ? void 0 : sb(
- pe,
- /*declaration*/
- void 0,
- T1(Hn),
- Hn
- )
- )],
- /*body*/
- void 0
- ),
- ((ws = Hn.declarations) == null ? void 0 : ws.find(om)) || wp
- ));
- }
- if (Hn.flags & 32768) {
- const mf = mu & 2;
- Il.push(a(
- pe,
- A.createGetAccessorDeclaration(
- A.createModifiersFromModifierFlags(Po),
- iu,
- [],
- mf ? void 0 : sb(
- pe,
- /*declaration*/
- void 0,
- nn(Hn),
- Hn
- ),
- /*body*/
- void 0
- ),
- ((Ga = Hn.declarations) == null ? void 0 : Ga.find(d0)) || wp
- ));
- }
- return Il;
- } else if (Hn.flags & 98311)
- return a(
- pe,
- xt(
- A.createModifiersFromModifierFlags((em(Hn) ? 8 : 0) | Po),
- iu,
- Hn.flags & 16777216 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- nu ? void 0 : sb(
- pe,
- /*declaration*/
- void 0,
- T1(Hn),
- Hn
- ),
- // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
- // interface members can't have initializers, however class members _can_
- /*initializer*/
- void 0
- ),
- ((To = Hn.declarations) == null ? void 0 : To.find(Nf(cs, ii))) || wp
- );
- if (Hn.flags & 8208) {
- const Il = nn(Hn), mf = Ns(
- Il,
- 0
- /* Call */
- );
- if (Po & 2)
- return a(
- pe,
- xt(
- A.createModifiersFromModifierFlags((em(Hn) ? 8 : 0) | Po),
- iu,
- Hn.flags & 16777216 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ),
- ((o_ = Hn.declarations) == null ? void 0 : o_.find(no)) || mf[0] && mf[0].declaration || Hn.declarations && Hn.declarations[0]
- );
- const Qk = [];
- for (const Gm of mf) {
- const M1 = tn(
- Gm,
- In,
- pe,
- {
- name: iu,
- questionToken: Hn.flags & 16777216 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- modifiers: Po ? A.createModifiersFromModifierFlags(Po) : void 0
- }
- ), R1 = Gm.declaration && c3(Gm.declaration.parent) ? Gm.declaration.parent : Gm.declaration;
- Qk.push(a(pe, M1, R1));
- }
- return Qk;
- }
- return E.fail(`Unhandled class member kind! ${Hn.__debugFlags || Hn.flags}`);
- };
- }
- function b_t(xt, In) {
- return hn(
- xt,
- /*isStatic*/
- !1,
- In
- );
- }
- function nme(xt, In, li, ni) {
- const Hn = Ns(In, xt);
- if (xt === 1) {
- if (!li && Mi(Hn, (Is) => Nr(Is.parameters) === 0))
- return [];
- if (li) {
- const Is = Ns(
- li,
- 1
- /* Construct */
- );
- if (!Nr(Is) && Mi(Hn, (ws) => Nr(ws.parameters) === 0))
- return [];
- if (Is.length === Hn.length) {
- let ws = !1;
- for (let Ga = 0; Ga < Is.length; Ga++)
- if (!rM(
- Hn[Ga],
- Is[Ga],
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !0,
- DN
- )) {
- ws = !0;
- break;
- }
- if (!ws)
- return [];
- }
- }
- let Xs = 0;
- for (const Is of Hn)
- Is.declaration && (Xs |= ox(
- Is.declaration,
- 6
- /* Protected */
- ));
- if (Xs)
- return [a(
- pe,
- A.createConstructorDeclaration(
- A.createModifiersFromModifierFlags(Xs),
- /*parameters*/
- [],
- /*body*/
- void 0
- ),
- Hn[0].declaration
- )];
- }
- const Qa = [];
- for (const Xs of Hn) {
- const Is = tn(Xs, ni, pe);
- Qa.push(a(pe, Is, Xs.declaration));
- }
- return Qa;
- }
- function _7e(xt, In) {
- const li = [];
- for (const ni of wu(xt)) {
- if (In) {
- const Hn = dh(In, ni.keyType);
- if (Hn && hh(ni.type, Hn.type))
- continue;
- }
- li.push(Xr(
- ni,
- pe,
- /*typeNode*/
- void 0
- ));
- }
- return li;
- }
- function S_t(xt, In, li) {
- const ni = ime(
- xt,
- 111551
- /* Value */
- );
- if (ni)
- return ni;
- const Hn = KM(`${li}_base`), Qa = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- Hn,
- /*exclamationToken*/
- void 0,
- Q(In, pe)
- )
- ],
- 2
- /* Const */
- )
- );
- return Yn(
- Qa,
- 0
- /* None */
- ), A.createExpressionWithTypeArguments(
- A.createIdentifier(Hn),
- /*typeArguments*/
- void 0
- );
- }
- function ime(xt, In) {
- let li, ni;
- if (xt.target && Ek(xt.target.symbol, Yr, In) ? (li = lr(Io(xt), (Hn) => Q(Hn, pe)), ni = mo(
- xt.target.symbol,
- pe,
- 788968
- /* Type */
- )) : xt.symbol && Ek(xt.symbol, Yr, In) && (ni = mo(
- xt.symbol,
- pe,
- 788968
- /* Type */
- )), ni)
- return A.createExpressionWithTypeArguments(ni, li);
- }
- function T_t(xt) {
- const In = ime(
- xt,
- 788968
- /* Type */
- );
- if (In)
- return In;
- if (xt.symbol)
- return A.createExpressionWithTypeArguments(
- mo(
- xt.symbol,
- pe,
- 788968
- /* Type */
- ),
- /*typeArguments*/
- void 0
- );
- }
- function KM(xt, In) {
- var li, ni;
- const Hn = In ? na(In) : void 0;
- if (Hn && pe.remappedSymbolNames.has(Hn))
- return pe.remappedSymbolNames.get(Hn);
- In && (xt = f7e(In, xt));
- let Qa = 0;
- const Xs = xt;
- for (; (li = pe.usedSymbolNames) != null && li.has(xt); )
- Qa++, xt = `${Xs}_${Qa}`;
- return (ni = pe.usedSymbolNames) == null || ni.add(xt), Hn && pe.remappedSymbolNames.set(Hn, xt), xt;
- }
- function f7e(xt, In) {
- if (In === "default" || In === "__class" || In === "__function") {
- const li = j(pe);
- pe.flags |= 16777216;
- const ni = v1(xt, pe);
- li(), In = ni.length > 0 && n3(ni.charCodeAt(0)) ? ap(ni) : ni;
- }
- return In === "default" ? In = "_default" : In === "export=" && (In = "_exports"), In = k_(In, B) && !ix(In) ? In : "_" + In.replace(/[^a-z0-9]/gi, "_"), In;
- }
- function wg(xt, In) {
- const li = na(xt);
- return pe.remappedSymbolNames.has(li) ? pe.remappedSymbolNames.get(li) : (In = f7e(xt, In), pe.remappedSymbolNames.set(li, In), In);
- }
- }
- }
- function Lm(r, a, l = 16384, f) {
- return f ? m(f).getText() : dC(m);
- function m(y) {
- const x = eE(l) | 70221824 | 512, N = me.typePredicateToTypePredicateNode(r, a, x), j = $b(), W = a && Tr(a);
- return j.writeNode(
- 4,
- N,
- /*sourceFile*/
- W,
- y
- ), y;
- }
- }
- function TL(r) {
- const a = [];
- let l = 0;
- for (let f = 0; f < r.length; f++) {
- const m = r[f];
- if (l |= m.flags, !(m.flags & 98304)) {
- if (m.flags & 1568) {
- const y = m.flags & 512 ? wt : pG(m);
- if (y.flags & 1048576) {
- const x = y.types.length;
- if (f + x <= r.length && Vu(r[f + x - 1]) === Vu(y.types[x - 1])) {
- a.push(y), f += x - 1;
- continue;
- }
- }
- }
- a.push(m);
- }
- }
- return l & 65536 && a.push(ht), l & 32768 && a.push(Ae), a || r;
- }
- function SP(r) {
- return r === 2 ? "private" : r === 4 ? "protected" : "public";
- }
- function xL(r) {
- if (r.symbol && r.symbol.flags & 2048 && r.symbol.declarations) {
- const a = m3(r.symbol.declarations[0].parent);
- if (Vp(a))
- return Tn(a);
- }
- }
- function iT(r) {
- return r && r.parent && r.parent.kind === 268 && yb(r.parent.parent);
- }
- function sT(r) {
- return r.kind === 307 || Fu(r);
- }
- function lN(r, a) {
- const l = Bi(r).nameType;
- if (l) {
- if (l.flags & 384) {
- const f = "" + l.value;
- return !k_(f, pa(O)) && !qg(f) ? `"${cg(
- f,
- 34
- /* doubleQuote */
- )}"` : qg(f) && Ui(f, "-") ? `[${f}]` : f;
- }
- if (l.flags & 8192)
- return `[${v1(l.symbol, a)}]`;
- }
- }
- function v1(r, a) {
- var l;
- if ((l = a?.remappedSymbolReferences) != null && l.has(na(r)) && (r = a.remappedSymbolReferences.get(na(r))), a && r.escapedName === "default" && !(a.flags & 16384) && // If it's not the first part of an entity name, it must print as `default`
- (!(a.flags & 16777216) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
- !r.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
- a.enclosingDeclaration && or(r.declarations[0], sT) !== or(a.enclosingDeclaration, sT)))
- return "default";
- if (r.declarations && r.declarations.length) {
- let m = Tc(r.declarations, (x) => os(x) ? x : void 0);
- const y = m && os(m);
- if (m && y) {
- if (Fs(m) && sS(m))
- return mc(r);
- if (ma(y) && !(gc(r) & 4096)) {
- const x = Bi(r).nameType;
- if (x && x.flags & 384) {
- const N = lN(r, a);
- if (N !== void 0)
- return N;
- }
- }
- return _o(y);
- }
- if (m || (m = r.declarations[0]), m.parent && m.parent.kind === 260)
- return _o(m.parent.name);
- switch (m.kind) {
- case 231:
- case 218:
- case 219:
- return a && !a.encounteredError && !(a.flags & 131072) && (a.encounteredError = !0), m.kind === 231 ? "(Anonymous class)" : "(Anonymous function)";
- }
- }
- const f = lN(r, a);
- return f !== void 0 ? f : mc(r);
- }
- function yd(r) {
- if (r) {
- const l = bn(r);
- return l.isVisible === void 0 && (l.isVisible = !!a()), l.isVisible;
- }
- return !1;
- function a() {
- switch (r.kind) {
- case 338:
- case 346:
- case 340:
- return !!(r.parent && r.parent.parent && r.parent.parent.parent && Si(r.parent.parent.parent));
- case 208:
- return yd(r.parent.parent);
- case 260:
- if (As(r.name) && !r.name.elements.length)
- return !1;
- case 267:
- case 263:
- case 264:
- case 265:
- case 262:
- case 266:
- case 271:
- if (yb(r))
- return !0;
- const l = aT(r);
- return !(aX(r) & 32) && !(r.kind !== 271 && l.kind !== 307 && l.flags & 33554432) ? g0(l) : yd(l);
- case 172:
- case 171:
- case 177:
- case 178:
- case 174:
- case 173:
- if (Z_(
- r,
- 6
- /* Protected */
- ))
- return !1;
- case 176:
- case 180:
- case 179:
- case 181:
- case 169:
- case 268:
- case 184:
- case 185:
- case 187:
- case 183:
- case 188:
- case 189:
- case 192:
- case 193:
- case 196:
- case 202:
- return yd(r.parent);
- case 273:
- case 274:
- case 276:
- return !1;
- case 168:
- case 307:
- case 270:
- return !0;
- case 277:
- return !1;
- default:
- return !1;
- }
- }
- }
- function tE(r, a) {
- let l;
- r.kind !== 11 && r.parent && r.parent.kind === 277 ? l = Nt(
- r,
- r,
- 2998271,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- ) : r.parent.kind === 281 && (l = yg(
- r.parent,
- 2998271
- /* Alias */
- ));
- let f, m;
- return l && (m = /* @__PURE__ */ new Set(), m.add(na(l)), y(l.declarations)), f;
- function y(x) {
- ir(x, (N) => {
- const j = Eu(N) || N;
- if (a ? bn(N).isVisible = !0 : (f = f || [], tp(f, j)), nS(N)) {
- const W = N.moduleReference, Q = E_(W), ye = Nt(
- N,
- Q.escapedText,
- 901119,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- ye && m && Xm(m, na(ye)) && y(ye.declarations);
- }
- });
- }
- }
- function vg(r, a) {
- const l = b1(r, a);
- if (l >= 0) {
- const { length: f } = fr;
- for (let m = l; m < f; m++)
- qr[m] = !1;
- return !1;
- }
- return fr.push(r), qr.push(
- /*items*/
- !0
- ), kr.push(a), !0;
- }
- function b1(r, a) {
- for (let l = fr.length - 1; l >= Dn; l--) {
- if (uN(fr[l], kr[l]))
- return -1;
- if (fr[l] === r && kr[l] === a)
- return l;
- }
- return -1;
- }
- function uN(r, a) {
- switch (a) {
- case 0:
- return !!Bi(r).type;
- case 2:
- return !!Bi(r).declaredType;
- case 1:
- return !!r.resolvedBaseConstructorType;
- case 3:
- return !!r.resolvedReturnType;
- case 4:
- return !!r.immediateBaseConstraint;
- case 5:
- return !!r.resolvedTypeArguments;
- case 6:
- return !!r.baseTypesResolved;
- case 7:
- return !!Bi(r).writeType;
- case 8:
- return bn(r).parameterInitializerContainsUndefined !== void 0;
- }
- return E.assertNever(a);
- }
- function bg() {
- return fr.pop(), kr.pop(), qr.pop();
- }
- function aT(r) {
- return or(pm(r), (a) => {
- switch (a.kind) {
- case 260:
- case 261:
- case 276:
- case 275:
- case 274:
- case 273:
- return !1;
- default:
- return !0;
- }
- }).parent;
- }
- function _N(r) {
- const a = bo(Cf(r));
- return a.typeParameters ? n0(a, lr(a.typeParameters, (l) => xe)) : a;
- }
- function Rc(r, a) {
- const l = Gs(r, a);
- return l ? nn(l) : void 0;
- }
- function Pk(r, a) {
- var l;
- let f;
- return Rc(r, a) || (f = (l = Nk(r, a)) == null ? void 0 : l.type) && cl(
- f,
- /*isProperty*/
- !0,
- /*isOptional*/
- !0
- );
- }
- function Wa(r) {
- return r && (r.flags & 1) !== 0;
- }
- function H(r) {
- return r === He || !!(r.flags & 1 && r.aliasSymbol);
- }
- function ke(r, a) {
- if (a !== 0)
- return Xf(
- r,
- /*includeOptionality*/
- !1,
- a
- );
- const l = Tn(r);
- return l && Bi(l).type || Xf(
- r,
- /*includeOptionality*/
- !1,
- a
- );
- }
- function We(r, a, l) {
- if (r = Vc(r, (j) => !(j.flags & 98304)), r.flags & 131072)
- return xs;
- if (r.flags & 1048576)
- return Xo(r, (j) => We(j, a, l));
- let f = Qn(lr(a, i0));
- const m = [], y = [];
- for (const j of qa(r)) {
- const W = Ok(
- j,
- 8576
- /* StringOrNumberLiteralOrUnique */
- );
- !$s(W, f) && !(lp(j) & 6) && AG(j) ? m.push(j) : y.push(W);
- }
- if (dT(r) || mT(f)) {
- if (y.length && (f = Qn([f, ...y])), f.flags & 131072)
- return r;
- const j = pet();
- return j ? _E(j, [r, f]) : He;
- }
- const x = Js();
- for (const j of m)
- x.set(j.escapedName, xfe(
- j,
- /*readonly*/
- !1
- ));
- const N = Li(l, x, Ue, Ue, wu(r));
- return N.objectFlags |= 4194304, N;
- }
- function gt(r) {
- return !!(r.flags & 465829888) && bc(
- Kl(r) || M,
- 32768
- /* Undefined */
- );
- }
- function Rt(r) {
- const a = Pp(r, gt) ? Xo(r, (l) => l.flags & 465829888 ? kg(l) : l) : r;
- return ad(
- a,
- 524288
- /* NEUndefined */
- );
- }
- function gr(r, a) {
- const l = jn(r);
- return l ? _0(l, a) : a;
- }
- function jn(r) {
- const a = Pi(r);
- if (a && f3(a) && a.flowNode) {
- const l = ui(r);
- if (l) {
- const f = lt(gv.createStringLiteral(l), r), m = __(a) ? a : gv.createParenthesizedExpression(a), y = lt(gv.createElementAccessExpression(m, f), r);
- return Aa(f, y), Aa(y, r), m !== a && Aa(m, y), y.flowNode = a.flowNode, y;
- }
- }
- }
- function Pi(r) {
- const a = r.parent.parent;
- switch (a.kind) {
- case 208:
- case 303:
- return jn(a);
- case 209:
- return jn(r.parent);
- case 260:
- return a.initializer;
- case 226:
- return a.right;
- }
- }
- function ui(r) {
- const a = r.parent;
- return r.kind === 208 && a.kind === 206 ? _i(r.propertyName || r.name) : r.kind === 303 || r.kind === 304 ? _i(r.name) : "" + a.elements.indexOf(r);
- }
- function _i(r) {
- const a = i0(r);
- return a.flags & 384 ? "" + a.value : void 0;
- }
- function Wi(r) {
- const a = r.dotDotDotToken ? 32 : 0, l = ke(r.parent.parent, a);
- return l && Ka(
- r,
- l,
- /*noTupleBoundsCheck*/
- !1
- );
- }
- function Ka(r, a, l) {
- if (Wa(a))
- return a;
- const f = r.parent;
- ee && r.flags & 33554432 && iv(r) ? a = c0(a) : ee && f.parent.initializer && !Zd(
- TAe(f.parent.initializer),
- 65536
- /* EQUndefined */
- ) && (a = ad(
- a,
- 524288
- /* NEUndefined */
- ));
- const m = 32 | (l || Uk(r) ? 16 : 0);
- let y;
- if (f.kind === 206)
- if (r.dotDotDotToken) {
- if (a = Qd(a), a.flags & 2 || !bM(a))
- return je(r, p.Rest_types_may_only_be_created_from_object_types), He;
- const x = [];
- for (const N of f.elements)
- N.dotDotDotToken || x.push(N.propertyName || N.name);
- y = We(a, x, r.symbol);
- } else {
- const x = r.propertyName || r.name, N = i0(x), j = j_(a, N, m, x);
- y = gr(r, j);
- }
- else {
- const x = uy(65 | (r.dotDotDotToken ? 0 : 128), a, Ae, f), N = f.elements.indexOf(r);
- if (r.dotDotDotToken) {
- const j = Xo(a, (W) => W.flags & 58982400 ? kg(W) : W);
- y = z_(j, ha) ? Xo(j, (W) => NP(W, N)) : du(x);
- } else if (oy(a)) {
- const j = bd(N), W = D1(a, j, m, r.name) || He;
- y = gr(r, W);
- } else
- y = x;
- }
- return r.initializer ? Gc(JT(r)) ? ee && !Zd(
- BP(
- r,
- 0
- /* Normal */
- ),
- 16777216
- /* IsUndefined */
- ) ? Rt(y) : y : yde(r, Qn(
- [Rt(y), BP(
- r,
- 0
- /* Normal */
- )],
- 2
- /* Subtype */
- )) : y;
- }
- function eo(r) {
- const a = q1(r);
- if (a)
- return Ci(a);
- }
- function wa(r) {
- const a = Ba(
- r,
- /*excludeJSDocTypeAssertions*/
- !0
- );
- return a.kind === 106 || a.kind === 80 && Nu(a) === we;
- }
- function xp(r) {
- const a = Ba(
- r,
- /*excludeJSDocTypeAssertions*/
- !0
- );
- return a.kind === 209 && a.elements.length === 0;
- }
- function cl(r, a = !1, l = !0) {
- return ee && l ? N1(r, a) : r;
- }
- function Xf(r, a, l) {
- if (ii(r) && r.parent.parent.kind === 249) {
- const x = Jm(jpe(Gi(
- r.parent.parent.expression,
- /*checkMode*/
- l
- )));
- return x.flags & 4456448 ? n3e(x) : Ie;
- }
- if (ii(r) && r.parent.parent.kind === 250) {
- const x = r.parent.parent;
- return qM(x) || xe;
- }
- if (As(r.parent))
- return Wi(r);
- const f = cs(r) && !dm(r) || m_(r) || ate(r), m = a && WC(r), y = Qf(r);
- if (zj(r))
- return y ? Wa(y) || y === M ? y : He : J ? M : xe;
- if (y)
- return cl(y, f, m);
- if ((ie || cn(r)) && ii(r) && !As(r.name) && !(aX(r) & 32) && !(r.flags & 33554432)) {
- if (!(J2(r) & 6) && (!r.initializer || wa(r.initializer)))
- return at;
- if (r.initializer && xp(r.initializer))
- return Va;
- }
- if (Ii(r)) {
- if (!r.symbol)
- return;
- const x = r.parent;
- if (x.kind === 178 && oE(x)) {
- const W = Jo(
- Tn(r.parent),
- 177
- /* GetAccessor */
- );
- if (W) {
- const Q = Zf(W), ye = Kde(x);
- return ye && r === ye ? (E.assert(!ye.type), nn(Q.thisParameter)) : Ha(Q);
- }
- }
- const N = FKe(x, r);
- if (N) return N;
- const j = r.symbol.escapedName === "this" ? xpe(x) : ZAe(r);
- if (j)
- return cl(
- j,
- /*isProperty*/
- !1,
- m
- );
- }
- if (K2(r) && r.initializer) {
- if (cn(r) && !Ii(r)) {
- const N = TP(r, Tn(r), y4(r));
- if (N)
- return N;
- }
- const x = yde(r, BP(r, l));
- return cl(x, f, m);
- }
- if (cs(r) && (ie || cn(r)))
- if (tl(r)) {
- const x = Ln(r.parent.members, oc), N = x.length ? Oa(r.symbol, x) : Mu(r) & 128 ? WG(r.symbol) : void 0;
- return N && cl(
- N,
- /*isProperty*/
- !0,
- m
- );
- } else {
- const x = H3(r.parent), N = x ? Kc(r.symbol, x) : Mu(r) & 128 ? WG(r.symbol) : void 0;
- return N && cl(
- N,
- /*isProperty*/
- !0,
- m
- );
- }
- if (km(r))
- return nt;
- if (As(r.name))
- return Lt(
- r.name,
- /*includePatternInType*/
- !1,
- /*reportErrors*/
- !0
- );
- }
- function e0(r) {
- if (r.valueDeclaration && dn(r.valueDeclaration)) {
- const a = Bi(r);
- return a.isConstructorDeclaredProperty === void 0 && (a.isConstructorDeclaredProperty = !1, a.isConstructorDeclaredProperty = !!S1(r) && Mi(r.declarations, (l) => dn(l) && p$(l) && (l.left.kind !== 212 || Of(l.left.argumentExpression)) && !Ef(
- /*declaredType*/
- void 0,
- l,
- r,
- l
- ))), a.isConstructorDeclaredProperty;
- }
- return !1;
- }
- function fh(r) {
- const a = r.valueDeclaration;
- return a && cs(a) && !Gc(a) && !a.initializer && (ie || cn(a));
- }
- function S1(r) {
- if (r.declarations)
- for (const a of r.declarations) {
- const l = Lu(
- a,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (l && (l.kind === 176 || qm(l)))
- return l;
- }
- }
- function kL(r) {
- const a = Tr(r.declarations[0]), l = Ei(r.escapedName), f = r.declarations.every((y) => cn(y) && xo(y) && jg(y.expression)), m = f ? A.createPropertyAccessExpression(A.createPropertyAccessExpression(A.createIdentifier("module"), A.createIdentifier("exports")), l) : A.createPropertyAccessExpression(A.createIdentifier("exports"), l);
- return f && Aa(m.expression.expression, m.expression), Aa(m.expression, m), Aa(m, a), m.flowNode = a.endFlowNode, _0(m, at, Ae);
- }
- function Oa(r, a) {
- const l = Ui(r.escapedName, "__#") ? A.createPrivateIdentifier(r.escapedName.split("@")[1]) : Ei(r.escapedName);
- for (const f of a) {
- const m = A.createPropertyAccessExpression(A.createThis(), l);
- Aa(m.expression, m), Aa(m, f), m.flowNode = f.returnFlowNode;
- const y = t0(m, r);
- if (ie && (y === at || y === Va) && je(r.valueDeclaration, p.Member_0_implicitly_has_an_1_type, Ji(r), Hr(y)), !z_(y, xM))
- return tI(y);
- }
- }
- function Kc(r, a) {
- const l = Ui(r.escapedName, "__#") ? A.createPrivateIdentifier(r.escapedName.split("@")[1]) : Ei(r.escapedName), f = A.createPropertyAccessExpression(A.createThis(), l);
- Aa(f.expression, f), Aa(f, a), f.flowNode = a.returnFlowNode;
- const m = t0(f, r);
- return ie && (m === at || m === Va) && je(r.valueDeclaration, p.Member_0_implicitly_has_an_1_type, Ji(r), Hr(m)), z_(m, xM) ? void 0 : tI(m);
- }
- function t0(r, a) {
- const l = a?.valueDeclaration && (!fh(a) || Mu(a.valueDeclaration) & 128) && WG(a) || Ae;
- return _0(r, at, l);
- }
- function S2(r, a) {
- const l = ZT(r.valueDeclaration);
- if (l) {
- const N = cn(l) ? V1(l) : void 0;
- return N && N.typeExpression ? Ci(N.typeExpression) : r.valueDeclaration && TP(r.valueDeclaration, r, l) || eb(wc(l));
- }
- let f, m = !1, y = !1;
- if (e0(r) && (f = Kc(r, S1(r))), !f) {
- let N;
- if (r.declarations) {
- let j;
- for (const W of r.declarations) {
- const Q = dn(W) || Fs(W) ? W : xo(W) ? dn(W.parent) ? W.parent : W : void 0;
- if (!Q)
- continue;
- const ye = xo(Q) ? o3(Q) : Cc(Q);
- (ye === 4 || dn(Q) && p$(Q, ye)) && (v(Q) ? m = !0 : y = !0), Fs(Q) || (j = Ef(j, Q, r, W)), j || (N || (N = [])).push(dn(Q) || Fs(Q) ? Hv(r, a, Q, ye) : Ht);
- }
- f = j;
- }
- if (!f) {
- if (!Nr(N))
- return He;
- let j = m && r.declarations ? w(N, r.declarations) : void 0;
- if (y) {
- const Q = WG(r);
- Q && ((j || (j = [])).push(Q), m = !0);
- }
- const W = ut(j, (Q) => !!(Q.flags & -98305)) ? j : N;
- f = Qn(W);
- }
- }
- const x = J_(cl(
- f,
- /*isProperty*/
- !1,
- y && !m
- ));
- return r.valueDeclaration && cn(r.valueDeclaration) && Vc(x, (N) => !!(N.flags & -98305)) === Ht ? (tb(r.valueDeclaration, xe), xe) : x;
- }
- function TP(r, a, l) {
- var f, m;
- if (!cn(r) || !l || !Ks(l) || l.properties.length)
- return;
- const y = Js();
- for (; dn(r) || Cn(r); ) {
- const j = i_(r);
- (f = j?.exports) != null && f.size && rd(y, j.exports), r = dn(r) ? r.parent : r.parent.parent;
- }
- const x = i_(r);
- (m = x?.exports) != null && m.size && rd(y, x.exports);
- const N = Li(a, y, Ue, Ue, Ue);
- return N.objectFlags |= 4096, N;
- }
- function Ef(r, a, l, f) {
- var m;
- const y = Gc(a.parent);
- if (y) {
- const x = J_(Ci(y));
- if (r)
- !H(r) && !H(x) && !hh(r, x) && tIe(
- /*firstDeclaration*/
- void 0,
- r,
- f,
- x
- );
- else return x;
- }
- if ((m = l.parent) != null && m.valueDeclaration) {
- const x = g2(l.parent);
- if (x.valueDeclaration) {
- const N = Gc(x.valueDeclaration);
- if (N) {
- const j = Gs(Ci(N), l.escapedName);
- if (j)
- return x1(j);
- }
- }
- }
- return r;
- }
- function Hv(r, a, l, f) {
- if (Fs(l)) {
- if (a)
- return nn(a);
- const x = wc(l.arguments[2]), N = Rc(x, "value");
- if (N)
- return N;
- const j = Rc(x, "get");
- if (j) {
- const Q = ET(j);
- if (Q)
- return Ha(Q);
- }
- const W = Rc(x, "set");
- if (W) {
- const Q = ET(W);
- if (Q)
- return ode(Q);
- }
- return xe;
- }
- if (on(l.left, l.right))
- return xe;
- const m = f === 1 && (Cn(l.left) || ko(l.left)) && (jg(l.left.expression) || Oe(l.left.expression) && iS(l.left.expression)), y = a ? nn(a) : m ? Vu(wc(l.right)) : eb(wc(l.right));
- if (y.flags & 524288 && f === 2 && r.escapedName === "export=") {
- const x = Xd(y), N = Js();
- t7(x.members, N);
- const j = N.size;
- a && !a.exports && (a.exports = Js()), (a || r).exports.forEach((Q, ye) => {
- var de;
- const Ze = N.get(ye);
- if (Ze && Ze !== Q && !(Q.flags & 2097152))
- if (Q.flags & 111551 && Ze.flags & 111551) {
- if (Q.valueDeclaration && Ze.valueDeclaration && Tr(Q.valueDeclaration) !== Tr(Ze.valueDeclaration)) {
- const mt = Ei(Q.escapedName), Gt = ((de = Wn(Ze.valueDeclaration, Vl)) == null ? void 0 : de.name) || Ze.valueDeclaration;
- Rs(
- je(Q.valueDeclaration, p.Duplicate_identifier_0, mt),
- Kr(Gt, p._0_was_also_declared_here, mt)
- ), Rs(
- je(Gt, p.Duplicate_identifier_0, mt),
- Kr(Q.valueDeclaration, p._0_was_also_declared_here, mt)
- );
- }
- const ct = fa(Q.flags | Ze.flags, ye);
- ct.links.type = Qn([nn(Q), nn(Ze)]), ct.valueDeclaration = Ze.valueDeclaration, ct.declarations = Qi(Ze.declarations, Q.declarations), N.set(ye, ct);
- } else
- N.set(ye, Wd(Q, Ze));
- else
- N.set(ye, Q);
- });
- const W = Li(
- j !== N.size ? void 0 : x.symbol,
- // Only set the type's symbol if it looks to be the same as the original type
- N,
- x.callSignatures,
- x.constructSignatures,
- x.indexInfos
- );
- if (j === N.size && (y.aliasSymbol && (W.aliasSymbol = y.aliasSymbol, W.aliasTypeArguments = y.aliasTypeArguments), wn(y) & 4)) {
- W.aliasSymbol = y.symbol;
- const Q = Io(y);
- W.aliasTypeArguments = Nr(Q) ? Q : void 0;
- }
- return W.objectFlags |= RL([y]) | wn(y) & 20608, W.symbol && W.symbol.flags & 32 && y === b_(W.symbol) && (W.objectFlags |= 16777216), W;
- }
- return VG(y) ? (tb(l, so), so) : y;
- }
- function on(r, a) {
- return Cn(r) && r.expression.kind === 110 && jx(a, (l) => jl(r, l));
- }
- function v(r) {
- const a = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- return a.kind === 176 || a.kind === 262 || a.kind === 218 && !c3(a.parent);
- }
- function w(r, a) {
- return E.assert(r.length === a.length), r.filter((l, f) => {
- const m = a[f], y = dn(m) ? m : dn(m.parent) ? m.parent : void 0;
- return y && v(y);
- });
- }
- function R(r, a, l) {
- if (r.initializer) {
- const f = As(r.name) ? Lt(
- r.name,
- /*includePatternInType*/
- !0,
- /*reportErrors*/
- !1
- ) : M;
- return cl(DNe(r, BP(r, 0, f)));
- }
- return As(r.name) ? Lt(r.name, a, l) : (l && !Sg(r) && tb(r, xe), a ? Zt : xe);
- }
- function se(r, a, l) {
- const f = Js();
- let m, y = 131200;
- ir(r.elements, (N) => {
- const j = N.propertyName || N.name;
- if (N.dotDotDotToken) {
- m = Cg(
- Ie,
- xe,
- /*isReadonly*/
- !1
- );
- return;
- }
- const W = i0(j);
- if (!up(W)) {
- y |= 512;
- return;
- }
- const Q = _p(W), ye = 4 | (N.initializer ? 16777216 : 0), de = fa(ye, Q);
- de.links.type = R(N, a, l), de.links.bindingElement = N, f.set(de.escapedName, de);
- });
- const x = Li(
- /*symbol*/
- void 0,
- f,
- Ue,
- Ue,
- m ? [m] : Ue
- );
- return x.objectFlags |= y, a && (x.pattern = r, x.objectFlags |= 131072), x;
- }
- function Be(r, a, l) {
- const f = r.elements, m = Ro(f), y = m && m.kind === 208 && m.dotDotDotToken ? m : void 0;
- if (f.length === 0 || f.length === 1 && y)
- return B >= 2 ? zwe(xe) : so;
- const x = lr(f, (Q) => ml(Q) ? xe : R(Q, a, l)), N = uI(f, (Q) => !(Q === y || ml(Q) || Uk(Q)), f.length - 1) + 1, j = lr(
- f,
- (Q, ye) => Q === y ? 4 : ye >= N ? 2 : 1
- /* Required */
- );
- let W = Eg(x, j);
- return a && (W = vwe(W), W.pattern = r, W.objectFlags |= 131072), W;
- }
- function Lt(r, a = !1, l = !1) {
- a && rh.push(r);
- const f = r.kind === 206 ? se(r, a, l) : Be(r, a, l);
- return a && rh.pop(), f;
- }
- function pn(r, a) {
- return kp(Xf(
- r,
- /*includeOptionality*/
- !0,
- 0
- /* Normal */
- ), r, a);
- }
- function ts(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = fa(
- 4096,
- "__importAttributes"
- /* ImportAttributes */
- ), f = Js();
- ir(r.elements, (y) => {
- const x = fa(4, O5(y));
- x.parent = l, x.links.type = vlt(y), x.links.target = x, f.set(x.escapedName, x);
- });
- const m = Li(l, f, Ue, Ue, Ue);
- m.objectFlags |= 262272, a.resolvedType = m;
- }
- return a.resolvedType;
- }
- function ao(r) {
- const a = i_(r), l = ZKe(
- /*reportErrors*/
- !1
- );
- return l && a && a === l;
- }
- function kp(r, a, l) {
- return r ? (r.flags & 4096 && ao(a.parent) && (r = kfe(a)), l && ZG(a, r), r.flags & 8192 && (va(a) || !a.type) && r.symbol !== Tn(a) && (r = jt), J_(r)) : (r = Ii(a) && a.dotDotDotToken ? so : xe, l && (Sg(a) || tb(a, r)), r);
- }
- function Sg(r) {
- const a = pm(r), l = a.kind === 169 ? a.parent : a;
- return JM(l);
- }
- function Qf(r) {
- const a = Gc(r);
- if (a)
- return Ci(a);
- }
- function rE(r) {
- let a = r.valueDeclaration;
- return a ? (va(a) && (a = JT(a)), Ii(a) ? LG(a.parent) : !1) : !1;
- }
- function S_e(r) {
- const a = Bi(r);
- if (!a.type) {
- const l = aG(r);
- return !a.type && !rE(r) && (a.type = l), l;
- }
- return a.type;
- }
- function aG(r) {
- if (r.flags & 4194304)
- return _N(r);
- if (r === Qe)
- return xe;
- if (r.flags & 134217728 && r.valueDeclaration) {
- const f = Tn(Tr(r.valueDeclaration)), m = fa(f.flags, "exports");
- m.declarations = f.declarations ? f.declarations.slice() : [], m.parent = r, m.links.target = f, f.valueDeclaration && (m.valueDeclaration = f.valueDeclaration), f.members && (m.members = new Map(f.members)), f.exports && (m.exports = new Map(f.exports));
- const y = Js();
- return y.set("exports", m), Li(r, y, Ue, Ue, Ue);
- }
- E.assertIsDefined(r.valueDeclaration);
- const a = r.valueDeclaration;
- if (Si(a) && Rp(a))
- return a.statements.length ? J_(eb(Gi(a.statements[0].expression))) : xs;
- if (Ay(a))
- return fN(r);
- if (!vg(
- r,
- 0
- /* Type */
- ))
- return r.flags & 512 && !(r.flags & 67108864) ? kP(r) : nE(r);
- let l;
- if (a.kind === 277)
- l = kp(Qf(a) || wc(a.expression), a);
- else if (dn(a) || cn(a) && (Fs(a) || (Cn(a) || A7(a)) && dn(a.parent)))
- l = S2(r);
- else if (Cn(a) || ko(a) || Oe(a) || Xa(a) || d_(a) || Xc(a) || Ec(a) || hc(a) && !jp(a) || vm(a) || Si(a)) {
- if (r.flags & 9136)
- return kP(r);
- l = dn(a.parent) ? S2(r) : Qf(a) || xe;
- } else if (Qc(a))
- l = Qf(a) || PNe(a);
- else if (km(a))
- l = Qf(a) || u8e(a);
- else if (uu(a))
- l = Qf(a) || zP(
- a.name,
- 0
- /* Normal */
- );
- else if (jp(a))
- l = Qf(a) || wNe(
- a,
- 0
- /* Normal */
- );
- else if (Ii(a) || cs(a) || m_(a) || ii(a) || va(a) || r4(a))
- l = pn(
- a,
- /*reportErrors*/
- !0
- );
- else if (Bb(a))
- l = kP(r);
- else if (A0(a))
- l = uG(r);
- else
- return E.fail("Unhandled declaration kind! " + E.formatSyntaxKind(a.kind) + " for " + E.formatSymbol(r));
- return bg() ? l : r.flags & 512 && !(r.flags & 67108864) ? kP(r) : nE(r);
- }
- function oT(r) {
- if (r)
- switch (r.kind) {
- case 177:
- return Y_(r);
- case 178:
- return lK(r);
- case 172:
- return E.assert(dm(r)), Gc(r);
- }
- }
- function xP(r) {
- const a = oT(r);
- return a && Ci(a);
- }
- function T_e(r) {
- const a = Kde(r);
- return a && a.symbol;
- }
- function x_e(r) {
- return Xv(Zf(r));
- }
- function fN(r) {
- const a = Bi(r);
- if (!a.type) {
- if (!vg(
- r,
- 0
- /* Type */
- ))
- return He;
- const l = Jo(
- r,
- 177
- /* GetAccessor */
- ), f = Jo(
- r,
- 178
- /* SetAccessor */
- ), m = Wn(Jo(
- r,
- 172
- /* PropertyDeclaration */
- ), u_);
- let y = l && cn(l) && eo(l) || xP(l) || xP(f) || xP(m) || l && l.body && N$(l) || m && m.initializer && pn(
- m,
- /*reportErrors*/
- !0
- );
- y || (f && !JM(f) ? Im(ie, f, p.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, Ji(r)) : l && !JM(l) ? Im(ie, l, p.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, Ji(r)) : m && !JM(m) && Im(ie, m, p.Member_0_implicitly_has_an_1_type, Ji(r), "any"), y = xe), bg() || (oT(l) ? je(l, p._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, Ji(r)) : oT(f) || oT(m) ? je(f, p._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, Ji(r)) : l && ie && je(l, p._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, Ji(r)), y = xe), a.type ?? (a.type = y);
- }
- return a.type;
- }
- function oG(r) {
- const a = Bi(r);
- if (!a.writeType) {
- if (!vg(
- r,
- 7
- /* WriteType */
- ))
- return He;
- const l = Jo(
- r,
- 178
- /* SetAccessor */
- ) ?? Wn(Jo(
- r,
- 172
- /* PropertyDeclaration */
- ), u_);
- let f = xP(l);
- bg() || (oT(l) && je(l, p._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, Ji(r)), f = xe), a.writeType ?? (a.writeType = f || fN(r));
- }
- return a.writeType;
- }
- function cG(r) {
- const a = oi(b_(r));
- return a.flags & 8650752 ? a : a.flags & 2097152 ? On(a.types, (l) => !!(l.flags & 8650752)) : void 0;
- }
- function kP(r) {
- let a = Bi(r);
- const l = a;
- if (!a.type) {
- const f = r.valueDeclaration && w$(
- r.valueDeclaration,
- /*allowDeclaration*/
- !1
- );
- if (f) {
- const m = ede(r, f);
- m && (r = m, a = m.links);
- }
- l.type = a.type = lG(r);
- }
- return a.type;
- }
- function lG(r) {
- const a = r.valueDeclaration;
- if (r.flags & 1536 && Jw(r))
- return xe;
- if (a && (a.kind === 226 || xo(a) && a.parent.kind === 226))
- return S2(r);
- if (r.flags & 512 && a && Si(a) && a.commonJsModuleIndicator) {
- const f = M_(r);
- if (f !== r) {
- if (!vg(
- r,
- 0
- /* Type */
- ))
- return He;
- const m = Ra(r.exports.get(
- "export="
- /* ExportEquals */
- )), y = S2(m, m === f ? void 0 : f);
- return bg() ? y : nE(r);
- }
- }
- const l = k(16, r);
- if (r.flags & 32) {
- const f = cG(r);
- return f ? ia([l, f]) : l;
- } else
- return ee && r.flags & 16777216 ? N1(
- l,
- /*isProperty*/
- !0
- ) : l;
- }
- function uG(r) {
- const a = Bi(r);
- return a.type || (a.type = MPe(r));
- }
- function wk(r) {
- const a = Bi(r);
- if (!a.type) {
- if (!vg(
- r,
- 0
- /* Type */
- ))
- return He;
- const l = Zl(r), f = r.declarations && p1(
- Du(r),
- /*dontRecursivelyResolve*/
- !0
- ), m = Tc(f?.declarations, (y) => wo(y) ? Qf(y) : void 0);
- if (a.type ?? (a.type = f?.declarations && Q$(f.declarations) && r.declarations.length ? kL(f) : Q$(r.declarations) ? at : m || (Pu(l) & 111551 ? nn(l) : He)), !bg())
- return nE(f ?? r), a.type ?? (a.type = He);
- }
- return a.type;
- }
- function _G(r) {
- const a = Bi(r);
- return a.type || (a.type = zi(nn(a.target), a.mapper));
- }
- function k_e(r) {
- const a = Bi(r);
- return a.writeType || (a.writeType = zi(T1(a.target), a.mapper));
- }
- function nE(r) {
- const a = r.valueDeclaration;
- if (a) {
- if (Gc(a))
- return je(r.valueDeclaration, p._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, Ji(r)), He;
- ie && (a.kind !== 169 || a.initializer) && je(r.valueDeclaration, p._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, Ji(r));
- } else if (r.flags & 2097152) {
- const l = Du(r);
- l && je(l, p.Circular_definition_of_import_alias_0, Ji(r));
- }
- return xe;
- }
- function pN(r) {
- const a = Bi(r);
- return a.type || (E.assertIsDefined(a.deferralParent), E.assertIsDefined(a.deferralConstituents), a.type = a.deferralParent.flags & 1048576 ? Qn(a.deferralConstituents) : ia(a.deferralConstituents)), a.type;
- }
- function C_e(r) {
- const a = Bi(r);
- return !a.writeType && a.deferralWriteConstituents && (E.assertIsDefined(a.deferralParent), E.assertIsDefined(a.deferralConstituents), a.writeType = a.deferralParent.flags & 1048576 ? Qn(a.deferralWriteConstituents) : ia(a.deferralWriteConstituents)), a.writeType;
- }
- function T1(r) {
- const a = gc(r);
- return r.flags & 4 ? a & 2 ? a & 65536 ? C_e(r) || pN(r) : (
- // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
- r.links.writeType || r.links.type
- ) : l0(nn(r), !!(r.flags & 16777216)) : r.flags & 98304 ? a & 1 ? k_e(r) : oG(r) : nn(r);
- }
- function nn(r) {
- const a = gc(r);
- return a & 65536 ? pN(r) : a & 1 ? _G(r) : a & 262144 ? mKe(r) : a & 8192 ? Lrt(r) : r.flags & 7 ? S_e(r) : r.flags & 9136 ? kP(r) : r.flags & 8 ? uG(r) : r.flags & 98304 ? fN(r) : r.flags & 2097152 ? wk(r) : He;
- }
- function x1(r) {
- return l0(nn(r), !!(r.flags & 16777216));
- }
- function fG(r, a) {
- if (r === void 0 || !(wn(r) & 4))
- return !1;
- for (const l of a)
- if (r.target === l)
- return !0;
- return !1;
- }
- function Mm(r, a) {
- return r !== void 0 && a !== void 0 && (wn(r) & 4) !== 0 && r.target === a;
- }
- function cT(r) {
- return wn(r) & 4 ? r.target : r;
- }
- function iE(r, a) {
- return l(r);
- function l(f) {
- if (wn(f) & 7) {
- const m = cT(f);
- return m === a || ut(No(m), l);
- } else if (f.flags & 2097152)
- return ut(f.types, l);
- return !1;
- }
- }
- function CL(r, a) {
- for (const l of a)
- r = bh(r, T2(Tn(l)));
- return r;
- }
- function sE(r, a) {
- for (; ; ) {
- if (r = r.parent, r && dn(r)) {
- const f = Cc(r);
- if (f === 6 || f === 3) {
- const m = Tn(r.left);
- m && m.parent && !or(m.parent.valueDeclaration, (y) => r === y) && (r = m.parent.valueDeclaration);
- }
- }
- if (!r)
- return;
- const l = r.kind;
- switch (l) {
- case 263:
- case 231:
- case 264:
- case 179:
- case 180:
- case 173:
- case 184:
- case 185:
- case 317:
- case 262:
- case 174:
- case 218:
- case 219:
- case 265:
- case 345:
- case 346:
- case 340:
- case 338:
- case 200:
- case 194: {
- const m = sE(r, a);
- if ((l === 218 || l === 219 || jp(r)) && Kf(r)) {
- const N = el(Ns(
- nn(Tn(r)),
- 0
- /* Call */
- ));
- if (N && N.typeParameters)
- return [...m || Ue, ...N.typeParameters];
- }
- if (l === 200)
- return wr(m, T2(Tn(r.typeParameter)));
- if (l === 194)
- return Qi(m, bfe(r));
- const y = CL(m, Ey(r)), x = a && (l === 263 || l === 231 || l === 264 || qm(r)) && b_(Tn(r)).thisType;
- return x ? wr(y, x) : y;
- }
- case 341:
- const f = d3(r);
- f && (r = f.valueDeclaration);
- break;
- case 320: {
- const m = sE(r, a);
- return r.tags ? CL(m, ta(r.tags, (y) => qp(y) ? y.typeParameters : void 0)) : m;
- }
- }
- }
- }
- function EL(r) {
- var a;
- const l = r.flags & 32 || r.flags & 16 ? r.valueDeclaration : (a = r.declarations) == null ? void 0 : a.find((f) => {
- if (f.kind === 264)
- return !0;
- if (f.kind !== 260)
- return !1;
- const m = f.initializer;
- return !!m && (m.kind === 218 || m.kind === 219);
- });
- return E.assert(!!l, "Class was missing valueDeclaration -OR- non-class had no interface declarations"), sE(l);
- }
- function vd(r) {
- if (!r.declarations)
- return;
- let a;
- for (const l of r.declarations)
- (l.kind === 264 || l.kind === 263 || l.kind === 231 || qm(l) || _3(l)) && (a = CL(a, Ey(l)));
- return a;
- }
- function E_e(r) {
- return Qi(EL(r), vd(r));
- }
- function Gv(r) {
- const a = Ns(
- r,
- 1
- /* Construct */
- );
- if (a.length === 1) {
- const l = a[0];
- if (!l.typeParameters && l.parameters.length === 1 && Su(l)) {
- const f = IM(l.parameters[0]);
- return Wa(f) || iM(f) === xe;
- }
- }
- return !1;
- }
- function Cr(r) {
- if (Ns(
- r,
- 1
- /* Construct */
- ).length > 0)
- return !0;
- if (r.flags & 8650752) {
- const a = Kl(r);
- return !!a && Gv(a);
- }
- return !1;
- }
- function Pn(r) {
- const a = Ah(r.symbol);
- return a && _m(a);
- }
- function Mn(r, a, l) {
- const f = Nr(a), m = cn(l);
- return Ln(Ns(
- r,
- 1
- /* Construct */
- ), (y) => (m || f >= Bm(y.typeParameters)) && f <= Nr(y.typeParameters));
- }
- function mi(r, a, l) {
- const f = Mn(r, a, l), m = lr(a, Ci);
- return qc(f, (y) => ut(y.typeParameters) ? vN(y, m, cn(l)) : y);
- }
- function oi(r) {
- if (!r.resolvedBaseConstructorType) {
- const a = Ah(r.symbol), l = a && _m(a), f = Pn(r);
- if (!f)
- return r.resolvedBaseConstructorType = Ae;
- if (!vg(
- r,
- 1
- /* ResolvedBaseConstructorType */
- ))
- return He;
- const m = Gi(f.expression);
- if (l && f !== l && (E.assert(!l.typeArguments), Gi(l.expression)), m.flags & 2621440 && Xd(m), !bg())
- return je(r.symbol.valueDeclaration, p._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, Ji(r.symbol)), r.resolvedBaseConstructorType ?? (r.resolvedBaseConstructorType = He);
- if (!(m.flags & 1) && m !== Le && !Cr(m)) {
- const y = je(f.expression, p.Type_0_is_not_a_constructor_function_type, Hr(m));
- if (m.flags & 262144) {
- const x = PP(m);
- let N = M;
- if (x) {
- const j = Ns(
- x,
- 1
- /* Construct */
- );
- j[0] && (N = Ha(j[0]));
- }
- m.symbol.declarations && Rs(y, Kr(m.symbol.declarations[0], p.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, Ji(m.symbol), Hr(N)));
- }
- return r.resolvedBaseConstructorType ?? (r.resolvedBaseConstructorType = He);
- }
- r.resolvedBaseConstructorType ?? (r.resolvedBaseConstructorType = m);
- }
- return r.resolvedBaseConstructorType;
- }
- function Fa(r) {
- let a = Ue;
- if (r.symbol.declarations)
- for (const l of r.symbol.declarations) {
- const f = DC(l);
- if (f)
- for (const m of f) {
- const y = Ci(m);
- H(y) || (a === Ue ? a = [y] : a.push(y));
- }
- }
- return a;
- }
- function oo(r, a) {
- je(r, p.Type_0_recursively_references_itself_as_a_base_type, Hr(
- a,
- /*enclosingDeclaration*/
- void 0,
- 2
- /* WriteArrayAsGenericType */
- ));
- }
- function No(r) {
- if (!r.baseTypesResolved) {
- if (vg(
- r,
- 6
- /* ResolvedBaseTypes */
- ) && (r.objectFlags & 8 ? r.resolvedBaseTypes = [Tg(r)] : r.symbol.flags & 96 ? (r.symbol.flags & 32 && Rm(r), r.symbol.flags & 64 && dN(r)) : E.fail("type must be class or interface"), !bg() && r.symbol.declarations))
- for (const a of r.symbol.declarations)
- (a.kind === 263 || a.kind === 264) && oo(a, r);
- r.baseTypesResolved = !0;
- }
- return r.resolvedBaseTypes;
- }
- function Tg(r) {
- const a = qc(r.typeParameters, (l, f) => r.elementFlags[f] & 8 ? j_(l, At) : l);
- return du(Qn(a || Ue), r.readonly);
- }
- function Rm(r) {
- r.resolvedBaseTypes = Nj;
- const a = Uu(oi(r));
- if (!(a.flags & 2621441))
- return r.resolvedBaseTypes = Ue;
- const l = Pn(r);
- let f;
- const m = a.symbol ? bo(a.symbol) : void 0;
- if (a.symbol && a.symbol.flags & 32 && Gd(m))
- f = bwe(l, a.symbol);
- else if (a.flags & 1)
- f = a;
- else {
- const x = mi(a, l.typeArguments, l);
- if (!x.length)
- return je(l.expression, p.No_base_constructor_has_the_specified_number_of_type_arguments), r.resolvedBaseTypes = Ue;
- f = Ha(x[0]);
- }
- if (H(f))
- return r.resolvedBaseTypes = Ue;
- const y = Qd(f);
- if (!jm(y)) {
- const x = j_e(
- /*errorInfo*/
- void 0,
- f
- ), N = vs(x, p.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, Hr(y));
- return Da.add(Rg(Tr(l.expression), l.expression, N)), r.resolvedBaseTypes = Ue;
- }
- return r === y || iE(y, r) ? (je(r.symbol.valueDeclaration, p.Type_0_recursively_references_itself_as_a_base_type, Hr(
- r,
- /*enclosingDeclaration*/
- void 0,
- 2
- /* WriteArrayAsGenericType */
- )), r.resolvedBaseTypes = Ue) : (r.resolvedBaseTypes === Nj && (r.members = void 0), r.resolvedBaseTypes = [y]);
- }
- function Gd(r) {
- const a = r.outerTypeParameters;
- if (a) {
- const l = a.length - 1, f = Io(r);
- return a[l].symbol !== f[l].symbol;
- }
- return !0;
- }
- function jm(r) {
- if (r.flags & 262144) {
- const a = Kl(r);
- if (a)
- return jm(a);
- }
- return !!(r.flags & 67633153 && !R_(r) || r.flags & 2097152 && Mi(r.types, jm));
- }
- function dN(r) {
- if (r.resolvedBaseTypes = r.resolvedBaseTypes || Ue, r.symbol.declarations) {
- for (const a of r.symbol.declarations)
- if (a.kind === 264 && x4(a))
- for (const l of x4(a)) {
- const f = Qd(Ci(l));
- H(f) || (jm(f) ? r !== f && !iE(f, r) ? r.resolvedBaseTypes === Ue ? r.resolvedBaseTypes = [f] : r.resolvedBaseTypes.push(f) : oo(a, r) : je(l, p.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members));
- }
- }
- }
- function aE(r) {
- if (!r.declarations)
- return !0;
- for (const a of r.declarations)
- if (a.kind === 264) {
- if (a.flags & 256)
- return !1;
- const l = x4(a);
- if (l) {
- for (const f of l)
- if (yo(f.expression)) {
- const m = Yo(
- f.expression,
- 788968,
- /*ignoreErrors*/
- !0
- );
- if (!m || !(m.flags & 64) || b_(m).thisType)
- return !1;
- }
- }
- }
- return !0;
- }
- function b_(r) {
- let a = Bi(r);
- const l = a;
- if (!a.declaredType) {
- const f = r.flags & 32 ? 1 : 2, m = ede(r, r.valueDeclaration && Ust(r.valueDeclaration));
- m && (r = m, a = m.links);
- const y = l.declaredType = a.declaredType = k(f, r), x = EL(r), N = vd(r);
- (x || N || f === 1 || !aE(r)) && (y.objectFlags |= 4, y.typeParameters = Qi(x, N), y.outerTypeParameters = x, y.localTypeParameters = N, y.instantiations = /* @__PURE__ */ new Map(), y.instantiations.set(sd(y.typeParameters), y), y.target = y, y.resolvedTypeArguments = y.typeParameters, y.thisType = pt(r), y.thisType.isThisType = !0, y.thisType.constraint = y);
- }
- return a.declaredType;
- }
- function OPe(r) {
- var a;
- const l = Bi(r);
- if (!l.declaredType) {
- if (!vg(
- r,
- 2
- /* DeclaredType */
- ))
- return He;
- const f = E.checkDefined((a = r.declarations) == null ? void 0 : a.find(_3), "Type alias symbol with no valid declaration found"), m = Bp(f) ? f.typeExpression : f.type;
- let y = m ? Ci(m) : He;
- if (bg()) {
- const x = vd(r);
- x && (l.typeParameters = x, l.instantiations = /* @__PURE__ */ new Map(), l.instantiations.set(sd(x), y)), y === vn && r.escapedName === "BuiltinIteratorReturn" && (y = ife());
- } else
- y = He, f.kind === 340 ? je(f.typeExpression.type, p.Type_alias_0_circularly_references_itself, Ji(r)) : je(Vl(f) && f.name || f, p.Type_alias_0_circularly_references_itself, Ji(r));
- l.declaredType ?? (l.declaredType = y);
- }
- return l.declaredType;
- }
- function pG(r) {
- return r.flags & 1056 && r.symbol.flags & 8 ? bo(Cf(r.symbol)) : r;
- }
- function FPe(r) {
- const a = Bi(r);
- if (!a.declaredType) {
- const l = [];
- if (r.declarations) {
- for (const m of r.declarations)
- if (m.kind === 266) {
- for (const y of m.members)
- if (oE(y)) {
- const x = Tn(y), N = PT(y).value, j = Rk(
- N !== void 0 ? gtt(N, na(r), x) : LPe(x)
- );
- Bi(x).declaredType = j, l.push(Vu(j));
- }
- }
- }
- const f = l.length ? Qn(
- l,
- 1,
- r,
- /*aliasTypeArguments*/
- void 0
- ) : LPe(r);
- f.flags & 1048576 && (f.flags |= 1024, f.symbol = r), a.declaredType = f;
- }
- return a.declaredType;
- }
- function LPe(r) {
- const a = id(32, r), l = id(32, r);
- return a.regularType = a, a.freshType = l, l.regularType = a, l.freshType = l, a;
- }
- function MPe(r) {
- const a = Bi(r);
- if (!a.declaredType) {
- const l = FPe(Cf(r));
- a.declaredType || (a.declaredType = l);
- }
- return a.declaredType;
- }
- function T2(r) {
- const a = Bi(r);
- return a.declaredType || (a.declaredType = pt(r));
- }
- function HZe(r) {
- const a = Bi(r);
- return a.declaredType || (a.declaredType = bo(Zl(r)));
- }
- function bo(r) {
- return RPe(r) || He;
- }
- function RPe(r) {
- if (r.flags & 96)
- return b_(r);
- if (r.flags & 524288)
- return OPe(r);
- if (r.flags & 262144)
- return T2(r);
- if (r.flags & 384)
- return FPe(r);
- if (r.flags & 8)
- return MPe(r);
- if (r.flags & 2097152)
- return HZe(r);
- }
- function DL(r) {
- switch (r.kind) {
- case 133:
- case 159:
- case 154:
- case 150:
- case 163:
- case 136:
- case 155:
- case 151:
- case 116:
- case 157:
- case 146:
- case 201:
- return !0;
- case 188:
- return DL(r.elementType);
- case 183:
- return !r.typeArguments || r.typeArguments.every(DL);
- }
- return !1;
- }
- function GZe(r) {
- const a = oC(r);
- return !a || DL(a);
- }
- function jPe(r) {
- const a = Gc(r);
- return a ? DL(a) : !m0(r);
- }
- function $Ze(r) {
- const a = Y_(r), l = Ey(r);
- return (r.kind === 176 || !!a && DL(a)) && r.parameters.every(jPe) && l.every(GZe);
- }
- function XZe(r) {
- if (r.declarations && r.declarations.length === 1) {
- const a = r.declarations[0];
- if (a)
- switch (a.kind) {
- case 172:
- case 171:
- return jPe(a);
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- return $Ze(a);
- }
- }
- return !1;
- }
- function BPe(r, a, l) {
- const f = Js();
- for (const m of r)
- f.set(m.escapedName, l && XZe(m) ? m : Pfe(m, a));
- return f;
- }
- function JPe(r, a) {
- for (const l of a) {
- if (zPe(l))
- continue;
- const f = r.get(l.escapedName);
- (!f || f.valueDeclaration && dn(f.valueDeclaration) && !e0(f) && !IZ(f.valueDeclaration)) && (r.set(l.escapedName, l), r.set(l.escapedName, l));
- }
- }
- function zPe(r) {
- return !!r.valueDeclaration && Ou(r.valueDeclaration) && zs(r.valueDeclaration);
- }
- function D_e(r) {
- if (!r.declaredProperties) {
- const a = r.symbol, l = k1(a);
- r.declaredProperties = ai(l), r.declaredCallSignatures = Ue, r.declaredConstructSignatures = Ue, r.declaredIndexInfos = Ue, r.declaredCallSignatures = E2(l.get(
- "__call"
- /* Call */
- )), r.declaredConstructSignatures = E2(l.get(
- "__new"
- /* New */
- )), r.declaredIndexInfos = gwe(a);
- }
- return r;
- }
- function dG(r) {
- if (!ma(r) && !ko(r))
- return !1;
- const a = ma(r) ? r.expression : r.argumentExpression;
- return yo(a) && up(ma(r) ? Wm(r) : wc(a));
- }
- function mN(r) {
- return r.charCodeAt(0) === 95 && r.charCodeAt(1) === 95 && r.charCodeAt(2) === 64;
- }
- function PL(r) {
- const a = os(r);
- return !!a && dG(a);
- }
- function oE(r) {
- return !Dh(r) || PL(r);
- }
- function QZe(r) {
- return R7(r) && !dG(r);
- }
- function YZe(r, a, l) {
- E.assert(!!(gc(r) & 4096), "Expected a late-bound symbol."), r.flags |= l, Bi(a.symbol).lateSymbol = r, r.declarations ? a.symbol.isReplaceableByMethod || r.declarations.push(a) : r.declarations = [a], l & 111551 && (!r.valueDeclaration || r.valueDeclaration.kind !== a.kind) && (r.valueDeclaration = a);
- }
- function WPe(r, a, l, f) {
- E.assert(!!f.symbol, "The member is expected to have a symbol.");
- const m = bn(f);
- if (!m.resolvedSymbol) {
- m.resolvedSymbol = f.symbol;
- const y = dn(f) ? f.left : f.name, x = ko(y) ? wc(y.argumentExpression) : Wm(y);
- if (up(x)) {
- const N = _p(x), j = f.symbol.flags;
- let W = l.get(N);
- W || l.set(N, W = fa(
- 0,
- N,
- 4096
- /* Late */
- ));
- const Q = a && a.get(N);
- if (!(r.flags & 32) && W.flags & jv(j)) {
- const ye = Q ? Qi(Q.declarations, W.declarations) : W.declarations, de = !(x.flags & 8192) && Ei(N) || _o(y);
- ir(ye, (Ze) => je(os(Ze) || Ze, p.Property_0_was_also_declared_here, de)), je(y || f, p.Duplicate_property_0, de), W = fa(
- 0,
- N,
- 4096
- /* Late */
- );
- }
- return W.links.nameType = x, YZe(W, f, j), W.parent ? E.assert(W.parent === r, "Existing symbol parent should match new one") : W.parent = r, m.resolvedSymbol = W;
- }
- }
- return m.resolvedSymbol;
- }
- function P_e(r, a) {
- const l = Bi(r);
- if (!l[a]) {
- const f = a === "resolvedExports", m = f ? r.flags & 1536 ? Y6(r).exports : r.exports : r.members;
- l[a] = m || I;
- const y = Js();
- for (const j of r.declarations || Ue) {
- const W = xZ(j);
- if (W)
- for (const Q of W)
- f === tl(Q) && PL(Q) && WPe(r, m, y, Q);
- }
- const x = g2(r).assignmentDeclarationMembers;
- if (x) {
- const j = as(x.values());
- for (const W of j) {
- const Q = Cc(W), ye = Q === 3 || dn(W) && p$(W, Q) || Q === 9 || Q === 6;
- f === !ye && PL(W) && WPe(r, m, y, W);
- }
- }
- let N = l1(m, y);
- if (r.flags & 33554432 && l.cjsExportMerged && r.declarations)
- for (const j of r.declarations) {
- const W = Bi(j.symbol)[a];
- if (!N) {
- N = W;
- continue;
- }
- W && W.forEach((Q, ye) => {
- const de = N.get(ye);
- if (!de) N.set(ye, Q);
- else {
- if (de === Q) return;
- N.set(ye, Wd(de, Q));
- }
- });
- }
- l[a] = N || I;
- }
- return l[a];
- }
- function k1(r) {
- return r.flags & 6256 ? P_e(
- r,
- "resolvedMembers"
- /* resolvedMembers */
- ) : r.members || I;
- }
- function mG(r) {
- if (r.flags & 106500 && r.escapedName === "__computed") {
- const a = Bi(r);
- if (!a.lateSymbol && ut(r.declarations, PL)) {
- const l = Ra(r.parent);
- ut(r.declarations, tl) ? n_(l) : k1(l);
- }
- return a.lateSymbol || (a.lateSymbol = r);
- }
- return r;
- }
- function df(r, a, l) {
- if (wn(r) & 4) {
- const f = r.target, m = Io(r);
- return Nr(f.typeParameters) === Nr(m) ? n0(f, Qi(m, [a || f.thisType])) : r;
- } else if (r.flags & 2097152) {
- const f = qc(r.types, (m) => df(m, a, l));
- return f !== r.types ? ia(f) : r;
- }
- return l ? Uu(r) : r;
- }
- function UPe(r, a, l, f) {
- let m, y, x, N, j;
- uR(l, f, 0, l.length) ? (y = a.symbol ? k1(a.symbol) : Js(a.declaredProperties), x = a.declaredCallSignatures, N = a.declaredConstructSignatures, j = a.declaredIndexInfos) : (m = B_(l, f), y = BPe(
- a.declaredProperties,
- m,
- /*mappingThisOnly*/
- l.length === 1
- ), x = IG(a.declaredCallSignatures, m), N = IG(a.declaredConstructSignatures, m), j = b3e(a.declaredIndexInfos, m));
- const W = No(a);
- if (W.length) {
- if (a.symbol && y === k1(a.symbol)) {
- const ye = Js(a.declaredProperties), de = G_e(a.symbol);
- de && ye.set("__index", de), y = ye;
- }
- Hi(r, y, x, N, j);
- const Q = Ro(f);
- for (const ye of W) {
- const de = Q ? df(zi(ye, m), Q) : ye;
- JPe(y, qa(de)), x = Qi(x, Ns(
- de,
- 0
- /* Call */
- )), N = Qi(N, Ns(
- de,
- 1
- /* Construct */
- ));
- const Ze = de !== xe ? wu(de) : [Cg(
- Ie,
- xe,
- /*isReadonly*/
- !1
- )];
- j = Qi(j, Ln(Ze, (ct) => !B_e(j, ct.keyType)));
- }
- }
- Hi(r, y, x, N, j);
- }
- function ZZe(r) {
- UPe(r, D_e(r), Ue, Ue);
- }
- function KZe(r) {
- const a = D_e(r.target), l = Qi(a.typeParameters, [a.thisType]), f = Io(r), m = f.length === l.length ? f : Qi(f, [r]);
- UPe(r, a, l, m);
- }
- function ph(r, a, l, f, m, y, x, N) {
- const j = new _(Br, N);
- return j.declaration = r, j.typeParameters = a, j.parameters = f, j.thisParameter = l, j.resolvedReturnType = m, j.resolvedTypePredicate = y, j.minArgumentCount = x, j.resolvedMinArgumentCount = void 0, j.target = void 0, j.mapper = void 0, j.compositeSignatures = void 0, j.compositeKind = void 0, j;
- }
- function gN(r) {
- const a = ph(
- r.declaration,
- r.typeParameters,
- r.thisParameter,
- r.parameters,
- /*resolvedReturnType*/
- void 0,
- /*resolvedTypePredicate*/
- void 0,
- r.minArgumentCount,
- r.flags & 167
- /* PropagatingFlags */
- );
- return a.target = r.target, a.mapper = r.mapper, a.compositeSignatures = r.compositeSignatures, a.compositeKind = r.compositeKind, a;
- }
- function VPe(r, a) {
- const l = gN(r);
- return l.compositeSignatures = a, l.compositeKind = 1048576, l.target = void 0, l.mapper = void 0, l;
- }
- function eKe(r, a) {
- if ((r.flags & 24) === a)
- return r;
- r.optionalCallSignatureCache || (r.optionalCallSignatureCache = {});
- const l = a === 8 ? "inner" : "outer";
- return r.optionalCallSignatureCache[l] || (r.optionalCallSignatureCache[l] = tKe(r, a));
- }
- function tKe(r, a) {
- E.assert(a === 8 || a === 16, "An optional call signature can either be for an inner call chain or an outer call chain, but not both.");
- const l = gN(r);
- return l.flags |= a, l;
- }
- function qPe(r, a) {
- if (Su(r)) {
- const m = r.parameters.length - 1, y = r.parameters[m], x = nn(y);
- if (ha(x))
- return [l(x, m, y)];
- if (!a && x.flags & 1048576 && Mi(x.types, ha))
- return lr(x.types, (N) => l(N, m, y));
- }
- return [r.parameters];
- function l(m, y, x) {
- const N = Io(m), j = f(m, x), W = lr(N, (Q, ye) => {
- const de = j && j[ye] ? j[ye] : jP(r, y + ye, m), Ze = m.target.elementFlags[ye], ct = Ze & 12 ? 32768 : Ze & 2 ? 16384 : 0, mt = fa(1, de, ct);
- return mt.links.type = Ze & 4 ? du(Q) : Q, mt;
- });
- return Qi(r.parameters.slice(0, y), W);
- }
- function f(m, y) {
- const x = lr(m.target.labeledElementDeclarations, (N, j) => ade(N, j, m.target.elementFlags[j], y));
- if (x) {
- const N = [], j = /* @__PURE__ */ new Set();
- for (let Q = 0; Q < x.length; Q++) {
- const ye = x[Q];
- Xm(j, ye) || N.push(Q);
- }
- const W = /* @__PURE__ */ new Map();
- for (const Q of N) {
- let ye = W.get(x[Q]) ?? 1, de;
- for (; !Xm(j, de = `${x[Q]}_${ye}`); )
- ye++;
- x[Q] = de, W.set(x[Q], ye + 1);
- }
- }
- return x;
- }
- }
- function rKe(r) {
- const a = oi(r), l = Ns(
- a,
- 1
- /* Construct */
- ), f = Ah(r.symbol), m = !!f && Gn(
- f,
- 64
- /* Abstract */
- );
- if (l.length === 0)
- return [ph(
- /*declaration*/
- void 0,
- r.localTypeParameters,
- /*thisParameter*/
- void 0,
- Ue,
- r,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- m ? 4 : 0
- /* None */
- )];
- const y = Pn(r), x = cn(y), N = BL(y), j = Nr(N), W = [];
- for (const Q of l) {
- const ye = Bm(Q.typeParameters), de = Nr(Q.typeParameters);
- if (x || j >= ye && j <= de) {
- const Ze = de ? yG(Q, C1(N, Q.typeParameters, ye, x)) : gN(Q);
- Ze.typeParameters = r.localTypeParameters, Ze.resolvedReturnType = r, Ze.flags = m ? Ze.flags | 4 : Ze.flags & -5, W.push(Ze);
- }
- }
- return W;
- }
- function gG(r, a, l, f, m) {
- for (const y of r)
- if (rM(y, a, l, f, m, l ? Ltt : DN))
- return y;
- }
- function nKe(r, a, l) {
- if (a.typeParameters) {
- if (l > 0)
- return;
- for (let m = 1; m < r.length; m++)
- if (!gG(
- r[m],
- a,
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !1
- ))
- return;
- return [a];
- }
- let f;
- for (let m = 0; m < r.length; m++) {
- const y = m === l ? a : gG(
- r[m],
- a,
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !0
- ) || gG(
- r[m],
- a,
- /*partialMatch*/
- !0,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !0
- );
- if (!y)
- return;
- f = bh(f, y);
- }
- return f;
- }
- function w_e(r) {
- let a, l;
- for (let f = 0; f < r.length; f++) {
- if (r[f].length === 0) return Ue;
- r[f].length > 1 && (l = l === void 0 ? f : -1);
- for (const m of r[f])
- if (!a || !gG(
- a,
- m,
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !0
- )) {
- const y = nKe(r, m, f);
- if (y) {
- let x = m;
- if (y.length > 1) {
- let N = m.thisParameter;
- const j = ir(y, (W) => W.thisParameter);
- if (j) {
- const W = ia(Ai(y, (Q) => Q.thisParameter && nn(Q.thisParameter)));
- N = yT(j, W);
- }
- x = VPe(m, y), x.thisParameter = N;
- }
- (a || (a = [])).push(x);
- }
- }
- }
- if (!Nr(a) && l !== -1) {
- const f = r[l !== void 0 ? l : 0];
- let m = f.slice();
- for (const y of r)
- if (y !== f) {
- const x = y[0];
- if (E.assert(!!x, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"), m = x.typeParameters && ut(m, (N) => !!N.typeParameters && !HPe(x.typeParameters, N.typeParameters)) ? void 0 : lr(m, (N) => aKe(N, x)), !m)
- break;
- }
- a = m;
- }
- return a || Ue;
- }
- function HPe(r, a) {
- if (Nr(r) !== Nr(a))
- return !1;
- if (!r || !a)
- return !0;
- const l = B_(a, r);
- for (let f = 0; f < r.length; f++) {
- const m = r[f], y = a[f];
- if (m !== y && !hh(PP(m) || M, zi(PP(y) || M, l)))
- return !1;
- }
- return !0;
- }
- function iKe(r, a, l) {
- if (!r || !a)
- return r || a;
- const f = ia([nn(r), zi(nn(a), l)]);
- return yT(r, f);
- }
- function sKe(r, a, l) {
- const f = W_(r), m = W_(a), y = f >= m ? r : a, x = y === r ? a : r, N = y === r ? f : m, j = Pg(r) || Pg(a), W = j && !Pg(y), Q = new Array(N + (W ? 1 : 0));
- for (let ye = 0; ye < N; ye++) {
- let de = R2(y, ye);
- y === a && (de = zi(de, l));
- let Ze = R2(x, ye) || M;
- x === a && (Ze = zi(Ze, l));
- const ct = ia([de, Ze]), mt = j && !W && ye === N - 1, Gt = ye >= Hm(y) && ye >= Hm(x), sr = ye >= f ? void 0 : jP(r, ye), Xr = ye >= m ? void 0 : jP(a, ye), tn = sr === Xr ? sr : sr ? Xr ? void 0 : sr : Xr, pr = fa(
- 1 | (Gt && !mt ? 16777216 : 0),
- tn || `arg${ye}`,
- mt ? 32768 : Gt ? 16384 : 0
- );
- pr.links.type = mt ? du(ct) : ct, Q[ye] = pr;
- }
- if (W) {
- const ye = fa(
- 1,
- "args",
- 32768
- /* RestParameter */
- );
- ye.links.type = du(Kd(x, N)), x === a && (ye.links.type = zi(ye.links.type, l)), Q[N] = ye;
- }
- return Q;
- }
- function aKe(r, a) {
- const l = r.typeParameters || a.typeParameters;
- let f;
- r.typeParameters && a.typeParameters && (f = B_(a.typeParameters, r.typeParameters));
- const m = r.declaration, y = sKe(r, a, f), x = iKe(r.thisParameter, a.thisParameter, f), N = Math.max(r.minArgumentCount, a.minArgumentCount), j = ph(
- m,
- l,
- x,
- y,
- /*resolvedReturnType*/
- void 0,
- /*resolvedTypePredicate*/
- void 0,
- N,
- (r.flags | a.flags) & 167
- /* PropagatingFlags */
- );
- return j.compositeKind = 1048576, j.compositeSignatures = Qi(r.compositeKind !== 2097152 && r.compositeSignatures || [r], [a]), f ? j.mapper = r.compositeKind !== 2097152 && r.mapper && r.compositeSignatures ? I2(r.mapper, f) : f : r.compositeKind !== 2097152 && r.mapper && r.compositeSignatures && (j.mapper = r.mapper), j;
- }
- function GPe(r) {
- const a = wu(r[0]);
- if (a) {
- const l = [];
- for (const f of a) {
- const m = f.keyType;
- Mi(r, (y) => !!dh(y, m)) && l.push(Cg(m, Qn(lr(r, (y) => $v(y, m))), ut(r, (y) => dh(y, m).isReadonly)));
- }
- return l;
- }
- return Ue;
- }
- function oKe(r) {
- const a = w_e(lr(r.types, (m) => m === al ? [$t] : Ns(
- m,
- 0
- /* Call */
- ))), l = w_e(lr(r.types, (m) => Ns(
- m,
- 1
- /* Construct */
- ))), f = GPe(r.types);
- Hi(r, I, a, l, f);
- }
- function wL(r, a) {
- return r ? a ? ia([r, a]) : r : a;
- }
- function $Pe(r) {
- const a = py(r, (f) => Ns(
- f,
- 1
- /* Construct */
- ).length > 0), l = lr(r, Gv);
- if (a > 0 && a === py(l, (f) => f)) {
- const f = l.indexOf(
- /*searchElement*/
- !0
- );
- l[f] = !1;
- }
- return l;
- }
- function cKe(r, a, l, f) {
- const m = [];
- for (let y = 0; y < a.length; y++)
- y === f ? m.push(r) : l[y] && m.push(Ha(Ns(
- a[y],
- 1
- /* Construct */
- )[0]));
- return ia(m);
- }
- function lKe(r) {
- let a, l, f;
- const m = r.types, y = $Pe(m), x = py(y, (N) => N);
- for (let N = 0; N < m.length; N++) {
- const j = r.types[N];
- if (!y[N]) {
- let W = Ns(
- j,
- 1
- /* Construct */
- );
- W.length && x > 0 && (W = lr(W, (Q) => {
- const ye = gN(Q);
- return ye.resolvedReturnType = cKe(Ha(Q), m, y, N), ye;
- })), l = XPe(l, W);
- }
- a = XPe(a, Ns(
- j,
- 0
- /* Call */
- )), f = Hu(wu(j), (W, Q) => QPe(
- W,
- Q,
- /*union*/
- !1
- ), f);
- }
- Hi(r, I, a || Ue, l || Ue, f || Ue);
- }
- function XPe(r, a) {
- for (const l of a)
- (!r || Mi(r, (f) => !rM(
- f,
- l,
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !1,
- DN
- ))) && (r = wr(r, l));
- return r;
- }
- function QPe(r, a, l) {
- if (r)
- for (let f = 0; f < r.length; f++) {
- const m = r[f];
- if (m.keyType === a.keyType)
- return r[f] = Cg(m.keyType, l ? Qn([m.type, a.type]) : ia([m.type, a.type]), l ? m.isReadonly || a.isReadonly : m.isReadonly && a.isReadonly), r;
- }
- return wr(r, a);
- }
- function uKe(r) {
- if (r.target) {
- Hi(r, I, Ue, Ue, Ue);
- const x = BPe(
- iy(r.target),
- r.mapper,
- /*mappingThisOnly*/
- !1
- ), N = IG(Ns(
- r.target,
- 0
- /* Call */
- ), r.mapper), j = IG(Ns(
- r.target,
- 1
- /* Construct */
- ), r.mapper), W = b3e(wu(r.target), r.mapper);
- Hi(r, x, N, j, W);
- return;
- }
- const a = Ra(r.symbol);
- if (a.flags & 2048) {
- Hi(r, I, Ue, Ue, Ue);
- const x = k1(a), N = E2(x.get(
- "__call"
- /* Call */
- )), j = E2(x.get(
- "__new"
- /* New */
- )), W = gwe(a);
- Hi(r, x, N, j, W);
- return;
- }
- let l = n_(a), f;
- if (a === fe) {
- const x = /* @__PURE__ */ new Map();
- l.forEach((N) => {
- var j;
- !(N.flags & 418) && !(N.flags & 512 && ((j = N.declarations) != null && j.length) && Mi(N.declarations, Fu)) && x.set(N.escapedName, N);
- }), l = x;
- }
- let m;
- if (Hi(r, l, Ue, Ue, Ue), a.flags & 32) {
- const x = b_(a), N = oi(x);
- N.flags & 11272192 ? (l = Js(Ki(l)), JPe(l, qa(N))) : N === xe && (m = Cg(
- Ie,
- xe,
- /*isReadonly*/
- !1
- ));
- }
- const y = vG(l);
- if (y ? f = $_e(y) : (m && (f = wr(f, m)), a.flags & 384 && (bo(a).flags & 32 || ut(r.properties, (x) => !!(nn(x).flags & 296))) && (f = wr(f, ar))), Hi(r, l, Ue, Ue, f || Ue), a.flags & 8208 && (r.callSignatures = E2(a)), a.flags & 32) {
- const x = b_(a);
- let N = a.members ? E2(a.members.get(
- "__constructor"
- /* Constructor */
- )) : Ue;
- a.flags & 16 && (N = Fn(
- N.slice(),
- Ai(
- r.callSignatures,
- (j) => qm(j.declaration) ? ph(
- j.declaration,
- j.typeParameters,
- j.thisParameter,
- j.parameters,
- x,
- /*resolvedTypePredicate*/
- void 0,
- j.minArgumentCount,
- j.flags & 167
- /* PropagatingFlags */
- ) : void 0
- )
- )), N.length || (N = rKe(x)), r.constructSignatures = N;
- }
- }
- function _Ke(r, a, l) {
- return zi(r, B_([a.indexType, a.objectType], [bd(0), Eg([l])]));
- }
- function fKe(r) {
- const a = Yf(r.mappedType);
- if (!(a.flags & 1048576 || a.flags & 2097152))
- return;
- const l = a.flags & 1048576 ? a.origin : a;
- if (!l || !(l.flags & 2097152))
- return;
- const f = ia(l.types.filter((m) => m !== r.constraintType));
- return f !== Ht ? f : void 0;
- }
- function pKe(r) {
- const a = dh(r.source, Ie), l = xg(r.mappedType), f = !(l & 1), m = l & 4 ? 0 : 16777216, y = a ? [Cg(Ie, e$(a.type, r.mappedType, r.constraintType) || M, f && a.isReadonly)] : Ue, x = Js(), N = fKe(r);
- for (const j of qa(r.source)) {
- if (N) {
- const ye = Ok(
- j,
- 8576
- /* StringOrNumberLiteralOrUnique */
- );
- if (!$s(ye, N))
- continue;
- }
- const W = 8192 | (f && em(j) ? 8 : 0), Q = fa(4 | j.flags & m, j.escapedName, W);
- if (Q.declarations = j.declarations, Q.links.nameType = Bi(j).nameType, Q.links.propertyType = nn(j), r.constraintType.type.flags & 8388608 && r.constraintType.type.objectType.flags & 262144 && r.constraintType.type.indexType.flags & 262144) {
- const ye = r.constraintType.type.objectType, de = _Ke(r.mappedType, r.constraintType.type, ye);
- Q.links.mappedType = de, Q.links.constraintType = Jm(ye);
- } else
- Q.links.mappedType = r.mappedType, Q.links.constraintType = r.constraintType;
- x.set(j.escapedName, Q);
- }
- Hi(r, x, Ue, Ue, y);
- }
- function AL(r) {
- if (r.flags & 4194304) {
- const a = Uu(r.type);
- return A1(a) ? qwe(a) : Jm(a);
- }
- if (r.flags & 16777216) {
- if (r.root.isDistributive) {
- const a = r.checkType, l = AL(a);
- if (l !== a)
- return wfe(
- r,
- gT(r.root.checkType, l, r.mapper),
- /*forConstraint*/
- !1
- );
- }
- return r;
- }
- if (r.flags & 1048576)
- return Xo(
- r,
- AL,
- /*noReductions*/
- !0
- );
- if (r.flags & 2097152) {
- const a = r.types;
- return a.length === 2 && a[0].flags & 76 && a[1] === Yi ? r : ia(qc(r.types, AL));
- }
- return r;
- }
- function A_e(r) {
- return gc(r) & 4096;
- }
- function N_e(r, a, l, f) {
- for (const m of qa(r))
- f(Ok(m, a));
- if (r.flags & 1)
- f(Ie);
- else
- for (const m of wu(r))
- (!l || m.keyType.flags & 134217732) && f(m.keyType);
- }
- function dKe(r) {
- const a = Js();
- let l;
- Hi(r, I, Ue, Ue, Ue);
- const f = $d(r), m = Yf(r), y = r.target || r, x = ny(y), N = NL(y) !== 2, j = r0(y), W = Uu(x2(r)), Q = xg(r);
- cE(r) ? N_e(
- W,
- 8576,
- /*stringsOnly*/
- !1,
- de
- ) : TT(AL(m), de), Hi(r, a, Ue, Ue, l || Ue);
- function de(ct) {
- const mt = x ? zi(x, kN(r.mapper, f, ct)) : ct;
- TT(mt, (Gt) => Ze(ct, Gt));
- }
- function Ze(ct, mt) {
- if (up(mt)) {
- const Gt = _p(mt), sr = a.get(Gt);
- if (sr)
- sr.links.nameType = Qn([sr.links.nameType, mt]), sr.links.keyType = Qn([sr.links.keyType, ct]);
- else {
- const Xr = up(ct) ? Gs(W, _p(ct)) : void 0, tn = !!(Q & 4 || !(Q & 8) && Xr && Xr.flags & 16777216), pr = !!(Q & 1 || !(Q & 2) && Xr && em(Xr)), er = ee && !tn && Xr && Xr.flags & 16777216, gn = Xr ? A_e(Xr) : 0, Un = fa(4 | (tn ? 16777216 : 0), Gt, gn | 262144 | (pr ? 8 : 0) | (er ? 524288 : 0));
- Un.links.mappedType = r, Un.links.nameType = mt, Un.links.keyType = ct, Xr && (Un.links.syntheticOrigin = Xr, Un.declarations = N ? Xr.declarations : void 0), a.set(Gt, Un);
- }
- } else if (bG(mt) || mt.flags & 33) {
- const Gt = mt.flags & 5 ? Ie : mt.flags & 40 ? At : mt, sr = zi(j, kN(r.mapper, f, ct)), Xr = hN(W, mt), tn = !!(Q & 1 || !(Q & 2) && Xr?.isReadonly), pr = Cg(Gt, sr, tn);
- l = QPe(
- l,
- pr,
- /*union*/
- !0
- );
- }
- }
- }
- function mKe(r) {
- var a;
- if (!r.links.type) {
- const l = r.links.mappedType;
- if (!vg(
- r,
- 0
- /* Type */
- ))
- return l.containsError = !0, He;
- const f = r0(l.target || l), m = kN(l.mapper, $d(l), r.links.keyType), y = zi(f, m);
- let x = ee && r.flags & 16777216 && !bc(
- y,
- 49152
- /* Void */
- ) ? N1(
- y,
- /*isProperty*/
- !0
- ) : r.links.checkFlags & 524288 ? XG(y) : y;
- bg() || (je(C, p.Type_of_property_0_circularly_references_itself_in_mapped_type_1, Ji(r), Hr(l)), x = He), (a = r.links).type ?? (a.type = x);
- }
- return r.links.type;
- }
- function $d(r) {
- return r.typeParameter || (r.typeParameter = T2(Tn(r.declaration.typeParameter)));
- }
- function Yf(r) {
- return r.constraintType || (r.constraintType = s_($d(r)) || He);
- }
- function ny(r) {
- return r.declaration.nameType ? r.nameType || (r.nameType = zi(Ci(r.declaration.nameType), r.mapper)) : void 0;
- }
- function r0(r) {
- return r.templateType || (r.templateType = r.declaration.type ? zi(cl(
- Ci(r.declaration.type),
- /*isProperty*/
- !0,
- !!(xg(r) & 4)
- ), r.mapper) : He);
- }
- function YPe(r) {
- return oC(r.declaration.typeParameter);
- }
- function cE(r) {
- const a = YPe(r);
- return a.kind === 198 && a.operator === 143;
- }
- function x2(r) {
- if (!r.modifiersType)
- if (cE(r))
- r.modifiersType = zi(Ci(YPe(r).type), r.mapper);
- else {
- const a = yfe(r.declaration), l = Yf(a), f = l && l.flags & 262144 ? s_(l) : l;
- r.modifiersType = f && f.flags & 4194304 ? zi(f.type, r.mapper) : M;
- }
- return r.modifiersType;
- }
- function xg(r) {
- const a = r.declaration;
- return (a.readonlyToken ? a.readonlyToken.kind === 41 ? 2 : 1 : 0) | (a.questionToken ? a.questionToken.kind === 41 ? 8 : 4 : 0);
- }
- function ZPe(r) {
- const a = xg(r);
- return a & 8 ? -1 : a & 4 ? 1 : 0;
- }
- function CP(r) {
- if (wn(r) & 32)
- return ZPe(r) || CP(x2(r));
- if (r.flags & 2097152) {
- const a = CP(r.types[0]);
- return Mi(r.types, (l, f) => f === 0 || CP(l) === a) ? a : 0;
- }
- return 0;
- }
- function gKe(r) {
- return !!(wn(r) & 32 && xg(r) & 4);
- }
- function R_(r) {
- if (wn(r) & 32) {
- const a = Yf(r);
- if (mT(a))
- return !0;
- const l = ny(r);
- if (l && mT(zi(l, N2($d(r), a))))
- return !0;
- }
- return !1;
- }
- function NL(r) {
- const a = ny(r);
- return a ? $s(a, $d(r)) ? 1 : 2 : 0;
- }
- function Xd(r) {
- return r.members || (r.flags & 524288 ? r.objectFlags & 4 ? KZe(r) : r.objectFlags & 3 ? ZZe(r) : r.objectFlags & 1024 ? pKe(r) : r.objectFlags & 16 ? uKe(r) : r.objectFlags & 32 ? dKe(r) : E.fail("Unhandled object type " + E.formatObjectFlags(r.objectFlags)) : r.flags & 1048576 ? oKe(r) : r.flags & 2097152 ? lKe(r) : E.fail("Unhandled type " + E.formatTypeFlags(r.flags))), r;
- }
- function iy(r) {
- return r.flags & 524288 ? Xd(r).properties : Ue;
- }
- function k2(r, a) {
- if (r.flags & 524288) {
- const f = Xd(r).members.get(a);
- if (f && ff(f))
- return f;
- }
- }
- function IL(r) {
- if (!r.resolvedProperties) {
- const a = Js();
- for (const l of r.types) {
- for (const f of qa(l))
- if (!a.has(f.escapedName)) {
- const m = FL(
- r,
- f.escapedName,
- /*skipObjectFunctionPropertyAugment*/
- !!(r.flags & 2097152)
- );
- m && a.set(f.escapedName, m);
- }
- if (r.flags & 1048576 && wu(l).length === 0)
- break;
- }
- r.resolvedProperties = ai(a);
- }
- return r.resolvedProperties;
- }
- function qa(r) {
- return r = EP(r), r.flags & 3145728 ? IL(r) : iy(r);
- }
- function hKe(r, a) {
- r = EP(r), r.flags & 3670016 && Xd(r).members.forEach((l, f) => {
- qi(l, f) && a(l, f);
- });
- }
- function yKe(r, a) {
- return a.properties.some((f) => {
- const m = f.name && (Nd(f.name) ? S_(q3(f.name)) : i0(f.name)), y = m && up(m) ? _p(m) : void 0, x = y === void 0 ? void 0 : Rc(r, y);
- return !!x && AN(x) && !$s(Gk(f), x);
- });
- }
- function vKe(r) {
- const a = Qn(r);
- if (!(a.flags & 1048576))
- return qde(a);
- const l = Js();
- for (const f of r)
- for (const { escapedName: m } of qde(f))
- if (!l.has(m)) {
- const y = swe(a, m);
- y && l.set(m, y);
- }
- return as(l.values());
- }
- function lT(r) {
- return r.flags & 262144 ? s_(r) : r.flags & 8388608 ? SKe(r) : r.flags & 16777216 ? twe(r) : Kl(r);
- }
- function s_(r) {
- return OL(r) ? PP(r) : void 0;
- }
- function bKe(r, a) {
- const l = CN(r);
- return !!l && uT(l, a);
- }
- function uT(r, a = 0) {
- var l;
- return a < 5 && !!(r && (r.flags & 262144 && ut((l = r.symbol) == null ? void 0 : l.declarations, (f) => Gn(
- f,
- 4096
- /* Const */
- )) || r.flags & 3145728 && ut(r.types, (f) => uT(f, a)) || r.flags & 8388608 && uT(r.objectType, a + 1) || r.flags & 16777216 && uT(twe(r), a + 1) || r.flags & 33554432 && uT(r.baseType, a) || wn(r) & 32 && bKe(r, a) || A1(r) && ac(P2(r), (f, m) => !!(r.target.elementFlags[m] & 8) && uT(f, a)) >= 0));
- }
- function SKe(r) {
- return OL(r) ? TKe(r) : void 0;
- }
- function I_e(r) {
- const a = s0(
- r,
- /*writing*/
- !1
- );
- return a !== r ? a : lT(r);
- }
- function TKe(r) {
- if (M_e(r))
- return PG(r.objectType, r.indexType);
- const a = I_e(r.indexType);
- if (a && a !== r.indexType) {
- const f = D1(r.objectType, a, r.accessFlags);
- if (f)
- return f;
- }
- const l = I_e(r.objectType);
- if (l && l !== r.objectType)
- return D1(l, r.indexType, r.accessFlags);
- }
- function O_e(r) {
- if (!r.resolvedDefaultConstraint) {
- const a = _tt(r), l = Yv(r);
- r.resolvedDefaultConstraint = Wa(a) ? l : Wa(l) ? a : Qn([a, l]);
- }
- return r.resolvedDefaultConstraint;
- }
- function KPe(r) {
- if (r.resolvedConstraintOfDistributive !== void 0)
- return r.resolvedConstraintOfDistributive || void 0;
- if (r.root.isDistributive && r.restrictiveInstantiation !== r) {
- const a = s0(
- r.checkType,
- /*writing*/
- !1
- ), l = a === r.checkType ? lT(a) : a;
- if (l && l !== r.checkType) {
- const f = wfe(
- r,
- gT(r.root.checkType, l, r.mapper),
- /*forConstraint*/
- !0
- );
- if (!(f.flags & 131072))
- return r.resolvedConstraintOfDistributive = f, f;
- }
- }
- r.resolvedConstraintOfDistributive = !1;
- }
- function ewe(r) {
- return KPe(r) || O_e(r);
- }
- function twe(r) {
- return OL(r) ? ewe(r) : void 0;
- }
- function xKe(r, a) {
- let l, f = !1;
- for (const m of r)
- if (m.flags & 465829888) {
- let y = lT(m);
- for (; y && y.flags & 21233664; )
- y = lT(y);
- y && (l = wr(l, y), a && (l = wr(l, m)));
- } else (m.flags & 469892092 || Dg(m)) && (f = !0);
- if (l && (a || f)) {
- if (f)
- for (const m of r)
- (m.flags & 469892092 || Dg(m)) && (l = wr(l, m));
- return KL(
- ia(
- l,
- 2
- /* NoConstraintReduction */
- ),
- /*writing*/
- !1
- );
- }
- }
- function Kl(r) {
- if (r.flags & 464781312 || A1(r)) {
- const a = F_e(r);
- return a !== Bt && a !== to ? a : void 0;
- }
- return r.flags & 4194304 ? Ft : void 0;
- }
- function kg(r) {
- return Kl(r) || r;
- }
- function OL(r) {
- return F_e(r) !== to;
- }
- function F_e(r) {
- if (r.resolvedBaseConstraint)
- return r.resolvedBaseConstraint;
- const a = [];
- return r.resolvedBaseConstraint = l(r);
- function l(y) {
- if (!y.immediateBaseConstraint) {
- if (!vg(
- y,
- 4
- /* ImmediateBaseConstraint */
- ))
- return to;
- let x;
- const N = UG(y);
- if ((a.length < 10 || a.length < 50 && !ss(a, N)) && (a.push(N), x = m(s0(
- y,
- /*writing*/
- !1
- )), a.pop()), !bg()) {
- if (y.flags & 262144) {
- const j = SG(y);
- if (j) {
- const W = je(j, p.Type_parameter_0_has_a_circular_constraint, Hr(y));
- C && !kb(j, C) && !kb(C, j) && Rs(W, Kr(C, p.Circularity_originates_in_type_at_this_location));
- }
- }
- x = to;
- }
- y.immediateBaseConstraint ?? (y.immediateBaseConstraint = x || Bt);
- }
- return y.immediateBaseConstraint;
- }
- function f(y) {
- const x = l(y);
- return x !== Bt && x !== to ? x : void 0;
- }
- function m(y) {
- if (y.flags & 262144) {
- const x = PP(y);
- return y.isThisType || !x ? x : f(x);
- }
- if (y.flags & 3145728) {
- const x = y.types, N = [];
- let j = !1;
- for (const W of x) {
- const Q = f(W);
- Q ? (Q !== W && (j = !0), N.push(Q)) : j = !0;
- }
- return j ? y.flags & 1048576 && N.length === x.length ? Qn(N) : y.flags & 2097152 && N.length ? ia(N) : void 0 : y;
- }
- if (y.flags & 4194304)
- return Ft;
- if (y.flags & 134217728) {
- const x = y.types, N = Ai(x, f);
- return N.length === x.length ? fT(y.texts, N) : Ie;
- }
- if (y.flags & 268435456) {
- const x = f(y.type);
- return x && x !== y.type ? Fk(y.symbol, x) : Ie;
- }
- if (y.flags & 8388608) {
- if (M_e(y))
- return f(PG(y.objectType, y.indexType));
- const x = f(y.objectType), N = f(y.indexType), j = x && N && D1(x, N, y.accessFlags);
- return j && f(j);
- }
- if (y.flags & 16777216) {
- const x = ewe(y);
- return x && f(x);
- }
- if (y.flags & 33554432)
- return f(K_e(y));
- if (A1(y)) {
- const x = lr(P2(y), (N, j) => {
- const W = N.flags & 262144 && y.target.elementFlags[j] & 8 && f(N) || N;
- return W !== N && z_(W, (Q) => Kv(Q) && !A1(Q)) ? W : N;
- });
- return Eg(x, y.target.elementFlags, y.target.readonly, y.target.labeledElementDeclarations);
- }
- return y;
- }
- }
- function kKe(r, a) {
- if (r === a)
- return r.resolvedApparentType || (r.resolvedApparentType = df(
- r,
- a,
- /*needApparentType*/
- !0
- ));
- const l = `I${Rl(r)},${Rl(a)}`;
- return Jd(l) ?? V0(l, df(
- r,
- a,
- /*needApparentType*/
- !0
- ));
- }
- function L_e(r) {
- if (r.default)
- r.default === _u && (r.default = to);
- else if (r.target) {
- const a = L_e(r.target);
- r.default = a ? zi(a, r.mapper) : Bt;
- } else {
- r.default = _u;
- const a = r.symbol && ir(r.symbol.declarations, (f) => zo(f) && f.default), l = a ? Ci(a) : Bt;
- r.default === _u && (r.default = l);
- }
- return r.default;
- }
- function C2(r) {
- const a = L_e(r);
- return a !== Bt && a !== to ? a : void 0;
- }
- function CKe(r) {
- return L_e(r) !== to;
- }
- function rwe(r) {
- return !!(r.symbol && ir(r.symbol.declarations, (a) => zo(a) && a.default));
- }
- function nwe(r) {
- return r.resolvedApparentType || (r.resolvedApparentType = EKe(r));
- }
- function EKe(r) {
- const a = r.target ?? r, l = CN(a);
- if (l && !a.declaration.nameType) {
- const f = x2(r), m = R_(f) ? nwe(f) : Kl(f);
- if (m && z_(m, (y) => Kv(y) || iwe(y)))
- return zi(a, gT(l, m, r.mapper));
- }
- return r;
- }
- function iwe(r) {
- return !!(r.flags & 2097152) && Mi(r.types, Kv);
- }
- function M_e(r) {
- let a;
- return !!(r.flags & 8388608 && wn(a = r.objectType) & 32 && !R_(a) && mT(r.indexType) && !(xg(a) & 8) && !a.declaration.nameType);
- }
- function Uu(r) {
- const a = r.flags & 465829888 ? Kl(r) || M : r, l = wn(a);
- return l & 32 ? nwe(a) : l & 4 && a !== r ? df(a, r) : a.flags & 2097152 ? kKe(a, r) : a.flags & 402653316 ? $i : a.flags & 296 ? Sa : a.flags & 2112 ? det() : a.flags & 528 ? ka : a.flags & 12288 ? Fwe() : a.flags & 67108864 ? xs : a.flags & 4194304 ? Ft : a.flags & 2 && !ee ? xs : a;
- }
- function EP(r) {
- return Qd(Uu(Qd(r)));
- }
- function swe(r, a, l) {
- var f, m, y;
- let x, N, j;
- const W = r.flags & 1048576;
- let Q, ye = 4, de = W ? 0 : 8, Ze = !1;
- for (const Un of r.types) {
- const ci = Uu(Un);
- if (!(H(ci) || ci.flags & 131072)) {
- const Jn = Gs(ci, a, l), Us = Jn ? lp(Jn) : 0;
- if (Jn) {
- if (Jn.flags & 106500 && (Q ?? (Q = W ? 0 : 16777216), W ? Q |= Jn.flags & 16777216 : Q &= Jn.flags), !x)
- x = Jn;
- else if (Jn !== x)
- if ((CE(Jn) || Jn) === (CE(x) || x) && Jfe(
- x,
- Jn,
- (Oo, ls) => Oo === ls ? -1 : 0
- /* False */
- ) === -1)
- Ze = !!x.parent && !!Nr(vd(x.parent));
- else {
- N || (N = /* @__PURE__ */ new Map(), N.set(na(x), x));
- const Oo = na(Jn);
- N.has(Oo) || N.set(Oo, Jn);
- }
- W && em(Jn) ? de |= 8 : !W && !em(Jn) && (de &= -9), de |= (Us & 6 ? 0 : 256) | (Us & 4 ? 512 : 0) | (Us & 2 ? 1024 : 0) | (Us & 256 ? 2048 : 0), Mpe(Jn) || (ye = 2);
- } else if (W) {
- const js = !mN(a) && Nk(ci, a);
- js ? (de |= 32 | (js.isReadonly ? 8 : 0), j = wr(j, ha(ci) ? HG(ci) || Ae : js.type)) : cy(ci) && !(wn(ci) & 2097152) ? (de |= 32, j = wr(j, Ae)) : de |= 16;
- }
- }
- }
- if (!x || W && (N || de & 48) && de & 1536 && !(N && DKe(N.values())))
- return;
- if (!N && !(de & 16) && !j)
- if (Ze) {
- const Un = (f = Wn(x, Lg)) == null ? void 0 : f.links, ci = yT(x, Un?.type);
- return ci.parent = (y = (m = x.valueDeclaration) == null ? void 0 : m.symbol) == null ? void 0 : y.parent, ci.links.containingType = r, ci.links.mapper = Un?.mapper, ci.links.writeType = T1(x), ci;
- } else
- return x;
- const ct = N ? as(N.values()) : [x];
- let mt, Gt, sr;
- const Xr = [];
- let tn, pr, er = !1;
- for (const Un of ct) {
- pr ? Un.valueDeclaration && Un.valueDeclaration !== pr && (er = !0) : pr = Un.valueDeclaration, mt = Fn(mt, Un.declarations);
- const ci = nn(Un);
- Gt || (Gt = ci, sr = Bi(Un).nameType);
- const Jn = T1(Un);
- (tn || Jn !== ci) && (tn = wr(tn || Xr.slice(), Jn)), ci !== Gt && (de |= 64), (AN(ci) || pT(ci)) && (de |= 128), ci.flags & 131072 && ci !== Ic && (de |= 131072), Xr.push(ci);
- }
- Fn(Xr, j);
- const gn = fa(4 | (Q ?? 0), a, ye | de);
- return gn.links.containingType = r, !er && pr && (gn.valueDeclaration = pr, pr.symbol.parent && (gn.parent = pr.symbol.parent)), gn.declarations = mt, gn.links.nameType = sr, Xr.length > 2 ? (gn.links.checkFlags |= 65536, gn.links.deferralParent = r, gn.links.deferralConstituents = Xr, gn.links.deferralWriteConstituents = tn) : (gn.links.type = W ? Qn(Xr) : ia(Xr), tn && (gn.links.writeType = W ? Qn(tn) : ia(tn))), gn;
- }
- function awe(r, a, l) {
- var f, m, y;
- let x = l ? (f = r.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : f.get(a) : (m = r.propertyCache) == null ? void 0 : m.get(a);
- return x || (x = swe(r, a, l), x && ((l ? r.propertyCacheWithoutObjectFunctionPropertyAugment || (r.propertyCacheWithoutObjectFunctionPropertyAugment = Js()) : r.propertyCache || (r.propertyCache = Js())).set(a, x), l && !(gc(x) & 48) && !((y = r.propertyCache) != null && y.get(a)) && (r.propertyCache || (r.propertyCache = Js())).set(a, x))), x;
- }
- function DKe(r) {
- let a;
- for (const l of r) {
- if (!l.declarations)
- return;
- if (!a) {
- a = new Set(l.declarations);
- continue;
- }
- if (a.forEach((f) => {
- ss(l.declarations, f) || a.delete(f);
- }), a.size === 0)
- return;
- }
- return a;
- }
- function FL(r, a, l) {
- const f = awe(r, a, l);
- return f && !(gc(f) & 16) ? f : void 0;
- }
- function Qd(r) {
- return r.flags & 1048576 && r.objectFlags & 16777216 ? r.resolvedReducedType || (r.resolvedReducedType = PKe(r)) : r.flags & 2097152 ? (r.objectFlags & 16777216 || (r.objectFlags |= 16777216 | (ut(IL(r), wKe) ? 33554432 : 0)), r.objectFlags & 33554432 ? Ht : r) : r;
- }
- function PKe(r) {
- const a = qc(r.types, Qd);
- if (a === r.types)
- return r;
- const l = Qn(a);
- return l.flags & 1048576 && (l.resolvedReducedType = l), l;
- }
- function wKe(r) {
- return owe(r) || cwe(r);
- }
- function owe(r) {
- return !(r.flags & 16777216) && (gc(r) & 131264) === 192 && !!(nn(r).flags & 131072);
- }
- function cwe(r) {
- return !r.valueDeclaration && !!(gc(r) & 1024);
- }
- function R_e(r) {
- return !!(r.flags & 1048576 && r.objectFlags & 16777216 && ut(r.types, R_e) || r.flags & 2097152 && AKe(r));
- }
- function AKe(r) {
- const a = r.uniqueLiteralFilledInstantiation || (r.uniqueLiteralFilledInstantiation = zi(r, io));
- return Qd(a) !== a;
- }
- function j_e(r, a) {
- if (a.flags & 2097152 && wn(a) & 33554432) {
- const l = On(IL(a), owe);
- if (l)
- return vs(r, p.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, Hr(
- a,
- /*enclosingDeclaration*/
- void 0,
- 536870912
- /* NoTypeReduction */
- ), Ji(l));
- const f = On(IL(a), cwe);
- if (f)
- return vs(r, p.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, Hr(
- a,
- /*enclosingDeclaration*/
- void 0,
- 536870912
- /* NoTypeReduction */
- ), Ji(f));
- }
- return r;
- }
- function Gs(r, a, l, f) {
- var m, y;
- if (r = EP(r), r.flags & 524288) {
- const x = Xd(r), N = x.members.get(a);
- if (N && !f && ((m = r.symbol) == null ? void 0 : m.flags) & 512 && ((y = Bi(r.symbol).typeOnlyExportStarMap) != null && y.has(a)))
- return;
- if (N && ff(N, f))
- return N;
- if (l) return;
- const j = x === ba ? al : x.callSignatures.length ? hp : x.constructSignatures.length ? Pe : void 0;
- if (j) {
- const W = k2(j, a);
- if (W)
- return W;
- }
- return k2(Lc, a);
- }
- if (r.flags & 2097152) {
- const x = FL(
- r,
- a,
- /*skipObjectFunctionPropertyAugment*/
- !0
- );
- return x || (l ? void 0 : FL(r, a, l));
- }
- if (r.flags & 1048576)
- return FL(r, a, l);
- }
- function LL(r, a) {
- if (r.flags & 3670016) {
- const l = Xd(r);
- return a === 0 ? l.callSignatures : l.constructSignatures;
- }
- return Ue;
- }
- function Ns(r, a) {
- const l = LL(EP(r), a);
- if (a === 0 && !Nr(l) && r.flags & 1048576) {
- if (r.arrayFallbackSignatures)
- return r.arrayFallbackSignatures;
- let f;
- if (z_(r, (m) => {
- var y;
- return !!((y = m.symbol) != null && y.parent) && NKe(m.symbol.parent) && (f ? f === m.symbol.escapedName : (f = m.symbol.escapedName, !0));
- })) {
- const m = Xo(r, (x) => ay((lwe(x.symbol.parent) ? Lr : Et).typeParameters[0], x.mapper)), y = du(m, Pp(r, (x) => lwe(x.symbol.parent)));
- return r.arrayFallbackSignatures = Ns(Rc(y, f), a);
- }
- r.arrayFallbackSignatures = l;
- }
- return l;
- }
- function NKe(r) {
- return !r || !Et.symbol || !Lr.symbol ? !1 : !!nd(r, Et.symbol) || !!nd(r, Lr.symbol);
- }
- function lwe(r) {
- return !r || !Lr.symbol ? !1 : !!nd(r, Lr.symbol);
- }
- function B_e(r, a) {
- return On(r, (l) => l.keyType === a);
- }
- function J_e(r, a) {
- let l, f, m;
- for (const y of r)
- y.keyType === Ie ? l = y : Ak(a, y.keyType) && (f ? (m || (m = [f])).push(y) : f = y);
- return m ? Cg(M, ia(lr(m, (y) => y.type)), Hu(
- m,
- (y, x) => y && x.isReadonly,
- /*initial*/
- !0
- )) : f || (l && Ak(a, Ie) ? l : void 0);
- }
- function Ak(r, a) {
- return $s(r, a) || a === Ie && $s(r, At) || a === At && (r === Ts || !!(r.flags & 128) && qg(r.value));
- }
- function z_e(r) {
- return r.flags & 3670016 ? Xd(r).indexInfos : Ue;
- }
- function wu(r) {
- return z_e(EP(r));
- }
- function dh(r, a) {
- return B_e(wu(r), a);
- }
- function $v(r, a) {
- var l;
- return (l = dh(r, a)) == null ? void 0 : l.type;
- }
- function W_e(r, a) {
- return wu(r).filter((l) => Ak(a, l.keyType));
- }
- function hN(r, a) {
- return J_e(wu(r), a);
- }
- function Nk(r, a) {
- return hN(r, mN(a) ? jt : S_(Ei(a)));
- }
- function uwe(r) {
- var a;
- let l;
- for (const f of Ey(r))
- l = bh(l, T2(f.symbol));
- return l?.length ? l : Ec(r) ? (a = DP(r)) == null ? void 0 : a.typeParameters : void 0;
- }
- function U_e(r) {
- const a = [];
- return r.forEach((l, f) => {
- Yt(f) || a.push(l);
- }), a;
- }
- function _we(r, a) {
- if (Sl(r))
- return;
- const l = Al(
- Te,
- '"' + r + '"',
- 512
- /* ValueModule */
- );
- return l && a ? Ra(l) : l;
- }
- function V_e(r) {
- return tx(r) || V3(r) || Ii(r) && N5(r);
- }
- function ML(r) {
- if (V_e(r))
- return !0;
- if (!Ii(r))
- return !1;
- if (r.initializer) {
- const l = Zf(r.parent), f = r.parent.parameters.indexOf(r);
- return E.assert(f >= 0), f >= Hm(
- l,
- 3
- /* VoidIsNonOptional */
- );
- }
- const a = bb(r.parent);
- return a ? !r.type && !r.dotDotDotToken && r.parent.parameters.indexOf(r) >= D$(a).length : !1;
- }
- function IKe(r) {
- return cs(r) && !dm(r) && r.questionToken;
- }
- function yN(r, a, l, f) {
- return { kind: r, parameterName: a, parameterIndex: l, type: f };
- }
- function Bm(r) {
- let a = 0;
- if (r)
- for (let l = 0; l < r.length; l++)
- rwe(r[l]) || (a = l + 1);
- return a;
- }
- function C1(r, a, l, f) {
- const m = Nr(a);
- if (!m)
- return [];
- const y = Nr(r);
- if (f || y >= l && y <= m) {
- const x = r ? r.slice() : [];
- for (let j = y; j < m; j++)
- x[j] = He;
- const N = spe(f);
- for (let j = y; j < m; j++) {
- let W = C2(a[j]);
- f && W && (hh(W, M) || hh(W, xs)) && (W = xe), x[j] = W ? zi(W, B_(a, x)) : N;
- }
- return x.length = a.length, x;
- }
- return r && r.slice();
- }
- function Zf(r) {
- const a = bn(r);
- if (!a.resolvedSignature) {
- const l = [];
- let f = 0, m = 0, y, x = cn(r) ? MI(r) : void 0, N = !1;
- const j = bb(r), W = CC(r);
- !j && cn(r) && nx(r) && !TY(r) && !q1(r) && (f |= 32);
- for (let ct = W ? 1 : 0; ct < r.parameters.length; ct++) {
- const mt = r.parameters[ct];
- if (cn(mt) && HJ(mt)) {
- x = mt;
- continue;
- }
- let Gt = mt.symbol;
- const sr = dp(mt) ? mt.typeExpression && mt.typeExpression.type : mt.type;
- Gt && Gt.flags & 4 && !As(mt.name) && (Gt = Nt(
- mt,
- Gt.escapedName,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- )), ct === 0 && Gt.escapedName === "this" ? (N = !0, y = mt.symbol) : l.push(Gt), sr && sr.kind === 201 && (f |= 2), V_e(mt) || Ii(mt) && mt.initializer || rg(mt) || j && l.length > j.arguments.length && !sr || (m = l.length);
- }
- if ((r.kind === 177 || r.kind === 178) && oE(r) && (!N || !y)) {
- const ct = r.kind === 177 ? 178 : 177, mt = Jo(Tn(r), ct);
- mt && (y = T_e(mt));
- }
- x && x.typeExpression && (y = yT(fa(
- 1,
- "this"
- /* This */
- ), Ci(x.typeExpression)));
- const ye = Lh(r) ? tv(r) : r, de = ye && Qo(ye) ? b_(Ra(ye.parent.symbol)) : void 0, Ze = de ? de.localTypeParameters : uwe(r);
- (Aj(r) || cn(r) && OKe(r, l)) && (f |= 1), (VC(r) && Gn(
- r,
- 64
- /* Abstract */
- ) || Qo(r) && Gn(
- r.parent,
- 64
- /* Abstract */
- )) && (f |= 4), a.resolvedSignature = ph(
- r,
- Ze,
- y,
- l,
- /*resolvedReturnType*/
- void 0,
- /*resolvedTypePredicate*/
- void 0,
- m,
- f
- );
- }
- return a.resolvedSignature;
- }
- function OKe(r, a) {
- if (Lh(r) || !q_e(r))
- return !1;
- const l = Ro(r.parameters), f = l ? aC(l) : H1(r).filter(dp), m = Tc(f, (x) => x.typeExpression && tO(x.typeExpression.type) ? x.typeExpression.type : void 0), y = fa(
- 3,
- "args",
- 32768
- /* RestParameter */
- );
- return m ? y.links.type = du(Ci(m.type)) : (y.links.checkFlags |= 65536, y.links.deferralParent = Ht, y.links.deferralConstituents = [so], y.links.deferralWriteConstituents = [so]), m && a.pop(), a.push(y), !0;
- }
- function DP(r) {
- if (!(cn(r) && no(r))) return;
- const a = V1(r);
- return a?.typeExpression && ET(Ci(a.typeExpression));
- }
- function FKe(r, a) {
- const l = DP(r);
- if (!l) return;
- const f = r.parameters.indexOf(a);
- return a.dotDotDotToken ? OM(l, f) : Kd(l, f);
- }
- function LKe(r) {
- const a = DP(r);
- return a && Ha(a);
- }
- function q_e(r) {
- const a = bn(r);
- return a.containsArgumentsReference === void 0 && (a.flags & 512 ? a.containsArgumentsReference = !0 : a.containsArgumentsReference = l(r.body)), a.containsArgumentsReference;
- function l(f) {
- if (!f) return !1;
- switch (f.kind) {
- case 80:
- return f.escapedText === Me.escapedName && iI(f) === Me;
- case 172:
- case 174:
- case 177:
- case 178:
- return f.name.kind === 167 && l(f.name);
- case 211:
- case 212:
- return l(f.expression);
- case 303:
- return l(f.initializer);
- default:
- return !bB(f) && !um(f) && !!bs(f, l);
- }
- }
- }
- function E2(r) {
- if (!r || !r.declarations) return Ue;
- const a = [];
- for (let l = 0; l < r.declarations.length; l++) {
- const f = r.declarations[l];
- if (ys(f)) {
- if (l > 0 && f.body) {
- const m = r.declarations[l - 1];
- if (f.parent === m.parent && f.kind === m.kind && f.pos === m.end)
- continue;
- }
- if (cn(f) && f.jsDoc) {
- const m = uB(f);
- if (Nr(m)) {
- for (const y of m) {
- const x = y.typeExpression;
- x.type === void 0 && !Qo(f) && tb(x, xe), a.push(Zf(x));
- }
- continue;
- }
- }
- a.push(
- !Wy(f) && !jp(f) && DP(f) || Zf(f)
- );
- }
- }
- return a;
- }
- function fwe(r) {
- const a = v_(r, r);
- if (a) {
- const l = M_(a);
- if (l)
- return nn(l);
- }
- return xe;
- }
- function Xv(r) {
- if (r.thisParameter)
- return nn(r.thisParameter);
- }
- function Cp(r) {
- if (!r.resolvedTypePredicate) {
- if (r.target) {
- const a = Cp(r.target);
- r.resolvedTypePredicate = a ? Ctt(a, r.mapper) : rt;
- } else if (r.compositeSignatures)
- r.resolvedTypePredicate = Jet(r.compositeSignatures, r.compositeKind) || rt;
- else {
- const a = r.declaration && Y_(r.declaration);
- let l;
- if (!a) {
- const f = DP(r.declaration);
- f && r !== f && (l = Cp(f));
- }
- if (a || l)
- r.resolvedTypePredicate = a && Px(a) ? MKe(a, r) : l || rt;
- else if (r.declaration && no(r.declaration) && (!r.resolvedReturnType || r.resolvedReturnType.flags & 16) && W_(r) > 0) {
- const { declaration: f } = r;
- r.resolvedTypePredicate = rt, r.resolvedTypePredicate = Sat(f) || rt;
- } else
- r.resolvedTypePredicate = rt;
- }
- E.assert(!!r.resolvedTypePredicate);
- }
- return r.resolvedTypePredicate === rt ? void 0 : r.resolvedTypePredicate;
- }
- function MKe(r, a) {
- const l = r.parameterName, f = r.type && Ci(r.type);
- return l.kind === 197 ? yN(
- r.assertsModifier ? 2 : 0,
- /*parameterName*/
- void 0,
- /*parameterIndex*/
- void 0,
- f
- ) : yN(r.assertsModifier ? 3 : 1, l.escapedText, ac(a.parameters, (m) => m.escapedName === l.escapedText), f);
- }
- function pwe(r, a, l) {
- return a !== 2097152 ? Qn(r, l) : ia(r);
- }
- function Ha(r) {
- if (!r.resolvedReturnType) {
- if (!vg(
- r,
- 3
- /* ResolvedReturnType */
- ))
- return He;
- let a = r.target ? zi(Ha(r.target), r.mapper) : r.compositeSignatures ? zi(pwe(
- lr(r.compositeSignatures, Ha),
- r.compositeKind,
- 2
- /* Subtype */
- ), r.mapper) : lE(r.declaration) || (rc(r.declaration.body) ? xe : N$(r.declaration));
- if (r.flags & 8 ? a = Z3e(a) : r.flags & 16 && (a = N1(a)), !bg()) {
- if (r.declaration) {
- const l = Y_(r.declaration);
- if (l)
- je(l, p.Return_type_annotation_circularly_references_itself);
- else if (ie) {
- const f = r.declaration, m = os(f);
- m ? je(m, p._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, _o(m)) : je(f, p.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);
- }
- }
- a = xe;
- }
- r.resolvedReturnType ?? (r.resolvedReturnType = a);
- }
- return r.resolvedReturnType;
- }
- function lE(r) {
- if (r.kind === 176)
- return b_(Ra(r.parent.symbol));
- const a = Y_(r);
- if (Lh(r)) {
- const l = EC(r);
- if (l && Qo(l.parent) && !a)
- return b_(Ra(l.parent.parent.symbol));
- }
- if (CC(r))
- return Ci(r.parameters[0].type);
- if (a)
- return Ci(a);
- if (r.kind === 177 && oE(r)) {
- const l = cn(r) && eo(r);
- if (l)
- return l;
- const f = Jo(
- Tn(r),
- 178
- /* SetAccessor */
- ), m = xP(f);
- if (m)
- return m;
- }
- return LKe(r);
- }
- function hG(r) {
- return r.compositeSignatures && ut(r.compositeSignatures, hG) || !r.resolvedReturnType && b1(
- r,
- 3
- /* ResolvedReturnType */
- ) >= 0;
- }
- function RKe(r) {
- return dwe(r) || xe;
- }
- function dwe(r) {
- if (Su(r)) {
- const a = nn(r.parameters[r.parameters.length - 1]), l = ha(a) ? HG(a) : a;
- return l && $v(l, At);
- }
- }
- function vN(r, a, l, f) {
- const m = H_e(r, C1(a, r.typeParameters, Bm(r.typeParameters), l));
- if (f) {
- const y = j8e(Ha(m));
- if (y) {
- const x = gN(y);
- x.typeParameters = f;
- const N = gN(m);
- return N.resolvedReturnType = _T(x), N;
- }
- }
- return m;
- }
- function H_e(r, a) {
- const l = r.instantiations || (r.instantiations = /* @__PURE__ */ new Map()), f = sd(a);
- let m = l.get(f);
- return m || l.set(f, m = yG(r, a)), m;
- }
- function yG(r, a) {
- return jk(
- r,
- jKe(r, a),
- /*eraseTypeParameters*/
- !0
- );
- }
- function mwe(r) {
- return qc(r.typeParameters, (a) => a.mapper ? zi(a, a.mapper) : a);
- }
- function jKe(r, a) {
- return B_(mwe(r), a);
- }
- function bN(r) {
- return r.typeParameters ? r.erasedSignatureCache || (r.erasedSignatureCache = BKe(r)) : r;
- }
- function BKe(r) {
- return jk(
- r,
- S3e(r.typeParameters),
- /*eraseTypeParameters*/
- !0
- );
- }
- function JKe(r) {
- return r.typeParameters ? r.canonicalSignatureCache || (r.canonicalSignatureCache = zKe(r)) : r;
- }
- function zKe(r) {
- return vN(
- r,
- lr(r.typeParameters, (a) => a.target && !s_(a.target) ? a.target : a),
- cn(r.declaration)
- );
- }
- function WKe(r) {
- return r.typeParameters ? r.implementationSignatureCache || (r.implementationSignatureCache = UKe(r)) : r;
- }
- function UKe(r) {
- return r.typeParameters ? jk(r, B_([], [])) : r;
- }
- function VKe(r) {
- const a = r.typeParameters;
- if (a) {
- if (r.baseSignatureCache)
- return r.baseSignatureCache;
- const l = S3e(a), f = B_(a, lr(a, (y) => s_(y) || M));
- let m = lr(a, (y) => zi(y, f) || M);
- for (let y = 0; y < a.length - 1; y++)
- m = gh(m, f);
- return m = gh(m, l), r.baseSignatureCache = jk(
- r,
- B_(a, m),
- /*eraseTypeParameters*/
- !0
- );
- }
- return r;
- }
- function _T(r, a) {
- var l;
- if (!r.isolatedSignatureType) {
- const f = (l = r.declaration) == null ? void 0 : l.kind, m = f === void 0 || f === 176 || f === 180 || f === 185, y = k(134217744, fa(
- 16,
- "__function"
- /* Function */
- ));
- r.declaration && !fo(r.declaration) && (y.symbol.declarations = [r.declaration], y.symbol.valueDeclaration = r.declaration), a || (a = r.declaration && sE(
- r.declaration,
- /*includeThisTypes*/
- !0
- )), y.outerTypeParameters = a, y.members = I, y.properties = Ue, y.callSignatures = m ? Ue : [r], y.constructSignatures = m ? [r] : Ue, y.indexInfos = Ue, r.isolatedSignatureType = y;
- }
- return r.isolatedSignatureType;
- }
- function G_e(r) {
- return r.members ? vG(r.members) : void 0;
- }
- function vG(r) {
- return r.get(
- "__index"
- /* Index */
- );
- }
- function Cg(r, a, l, f) {
- return { keyType: r, type: a, isReadonly: l, declaration: f };
- }
- function gwe(r) {
- const a = G_e(r);
- return a ? $_e(a) : Ue;
- }
- function $_e(r) {
- if (r.declarations) {
- const a = [];
- for (const l of r.declarations)
- if (l.parameters.length === 1) {
- const f = l.parameters[0];
- f.type && TT(Ci(f.type), (m) => {
- bG(m) && !B_e(a, m) && a.push(Cg(m, l.type ? Ci(l.type) : xe, Z_(
- l,
- 8
- /* Readonly */
- ), l));
- });
- }
- return a;
- }
- return Ue;
- }
- function bG(r) {
- return !!(r.flags & 4108) || pT(r) || !!(r.flags & 2097152) && !Lk(r) && ut(r.types, bG);
- }
- function SG(r) {
- return Ai(Ln(r.symbol && r.symbol.declarations, zo), oC)[0];
- }
- function hwe(r, a) {
- var l;
- let f;
- if ((l = r.symbol) != null && l.declarations) {
- for (const m of r.symbol.declarations)
- if (m.parent.kind === 195) {
- const [y = m.parent, x] = $Z(m.parent.parent);
- if (x.kind === 183 && !a) {
- const N = x, j = xde(N);
- if (j) {
- const W = N.typeArguments.indexOf(y);
- if (W < j.length) {
- const Q = s_(j[W]);
- if (Q) {
- const ye = Efe(
- j,
- j.map((Ze, ct) => () => hot(N, j, ct))
- ), de = zi(Q, ye);
- de !== r && (f = wr(f, de));
- }
- }
- }
- } else if (x.kind === 169 && x.dotDotDotToken || x.kind === 191 || x.kind === 202 && x.dotDotDotToken)
- f = wr(f, du(M));
- else if (x.kind === 204)
- f = wr(f, Ie);
- else if (x.kind === 168 && x.parent.kind === 200)
- f = wr(f, Ft);
- else if (x.kind === 200 && x.type && Ba(x.type) === m.parent && x.parent.kind === 194 && x.parent.extendsType === x && x.parent.checkType.kind === 200 && x.parent.checkType.type) {
- const N = x.parent.checkType, j = Ci(N.type);
- f = wr(f, zi(j, N2(T2(Tn(N.typeParameter)), N.typeParameter.constraint ? Ci(N.typeParameter.constraint) : Ft)));
- }
- }
- }
- return f && ia(f);
- }
- function PP(r) {
- if (!r.constraint)
- if (r.target) {
- const a = s_(r.target);
- r.constraint = a ? zi(a, r.mapper) : Bt;
- } else {
- const a = SG(r);
- if (!a)
- r.constraint = hwe(r) || Bt;
- else {
- let l = Ci(a);
- l.flags & 1 && !H(l) && (l = a.parent.parent.kind === 200 ? Ft : M), r.constraint = l;
- }
- }
- return r.constraint === Bt ? void 0 : r.constraint;
- }
- function ywe(r) {
- const a = Jo(
- r.symbol,
- 168
- /* TypeParameter */
- ), l = qp(a.parent) ? I7(a.parent) : a.parent;
- return l && i_(l);
- }
- function sd(r) {
- let a = "";
- if (r) {
- const l = r.length;
- let f = 0;
- for (; f < l; ) {
- const m = r[f].id;
- let y = 1;
- for (; f + y < l && r[f + y].id === m + y; )
- y++;
- a.length && (a += ","), a += m, y > 1 && (a += ":" + y), f += y;
- }
- }
- return a;
- }
- function Ik(r, a) {
- return r ? `@${na(r)}` + (a ? `:${sd(a)}` : "") : "";
- }
- function RL(r, a) {
- let l = 0;
- for (const f of r)
- (a === void 0 || !(f.flags & a)) && (l |= wn(f));
- return l & 458752;
- }
- function uE(r, a) {
- return ut(a) && r === Vi ? M : n0(r, a);
- }
- function n0(r, a) {
- const l = sd(a);
- let f = r.instantiations.get(l);
- return f || (f = k(4, r.symbol), r.instantiations.set(l, f), f.objectFlags |= a ? RL(a) : 0, f.target = r, f.resolvedTypeArguments = a), f;
- }
- function vwe(r) {
- const a = id(r.flags, r.symbol);
- return a.objectFlags = r.objectFlags, a.target = r.target, a.resolvedTypeArguments = r.resolvedTypeArguments, a;
- }
- function X_e(r, a, l, f, m) {
- if (!f) {
- f = Mk(a);
- const x = dE(f);
- m = l ? gh(x, l) : x;
- }
- const y = k(4, r.symbol);
- return y.target = r, y.node = a, y.mapper = l, y.aliasSymbol = f, y.aliasTypeArguments = m, y;
- }
- function Io(r) {
- var a, l;
- if (!r.resolvedTypeArguments) {
- if (!vg(
- r,
- 5
- /* ResolvedTypeArguments */
- ))
- return Qi(r.target.outerTypeParameters, (a = r.target.localTypeParameters) == null ? void 0 : a.map(() => He)) || Ue;
- const f = r.node, m = f ? f.kind === 183 ? Qi(r.target.outerTypeParameters, R$(f, r.target.localTypeParameters)) : f.kind === 188 ? [Ci(f.elementType)] : lr(f.elements, Ci) : Ue;
- bg() ? r.resolvedTypeArguments ?? (r.resolvedTypeArguments = r.mapper ? gh(m, r.mapper) : m) : (r.resolvedTypeArguments ?? (r.resolvedTypeArguments = Qi(r.target.outerTypeParameters, ((l = r.target.localTypeParameters) == null ? void 0 : l.map(() => He)) || Ue)), je(
- r.node || C,
- r.target.symbol ? p.Type_arguments_for_0_circularly_reference_themselves : p.Tuple_type_arguments_circularly_reference_themselves,
- r.target.symbol && Ji(r.target.symbol)
- ));
- }
- return r.resolvedTypeArguments;
- }
- function sy(r) {
- return Nr(r.target.typeParameters);
- }
- function bwe(r, a) {
- const l = bo(Ra(a)), f = l.localTypeParameters;
- if (f) {
- const m = Nr(r.typeArguments), y = Bm(f), x = cn(r);
- if (!(!ie && x) && (m < y || m > f.length)) {
- const W = x && Oh(r) && !Mx(r.parent), Q = y === f.length ? W ? p.Expected_0_type_arguments_provide_these_with_an_extends_tag : p.Generic_type_0_requires_1_type_argument_s : W ? p.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : p.Generic_type_0_requires_between_1_and_2_type_arguments, ye = Hr(
- l,
- /*enclosingDeclaration*/
- void 0,
- 2
- /* WriteArrayAsGenericType */
- );
- if (je(r, Q, ye, y, f.length), !x)
- return He;
- }
- if (r.kind === 183 && Uwe(r, Nr(r.typeArguments) !== f.length))
- return X_e(
- l,
- r,
- /*mapper*/
- void 0
- );
- const j = Qi(l.outerTypeParameters, C1(BL(r), f, y, x));
- return n0(l, j);
- }
- return D2(r, a) ? l : He;
- }
- function _E(r, a, l, f) {
- const m = bo(r);
- if (m === vn) {
- const W = Yz.get(r.escapedName);
- if (W !== void 0 && a && a.length === 1)
- return W === 4 ? Q_e(a[0]) : Fk(r, a[0]);
- }
- const y = Bi(r), x = y.typeParameters, N = sd(a) + Ik(l, f);
- let j = y.instantiations.get(N);
- return j || y.instantiations.set(N, j = k3e(m, B_(x, C1(a, x, Bm(x), cn(r.valueDeclaration))), l, f)), j;
- }
- function qKe(r, a) {
- if (gc(a) & 1048576) {
- const m = BL(r), y = Ik(a, m);
- let x = Ve.get(y);
- return x || (x = ol(
- 1,
- "error",
- /*objectFlags*/
- void 0,
- `alias ${y}`
- ), x.aliasSymbol = a, x.aliasTypeArguments = m, Ve.set(y, x)), x;
- }
- const l = bo(a), f = Bi(a).typeParameters;
- if (f) {
- const m = Nr(r.typeArguments), y = Bm(f);
- if (m < y || m > f.length)
- return je(
- r,
- y === f.length ? p.Generic_type_0_requires_1_type_argument_s : p.Generic_type_0_requires_between_1_and_2_type_arguments,
- Ji(a),
- y,
- f.length
- ), He;
- const x = Mk(r);
- let N = x && (Swe(a) || !Swe(x)) ? x : void 0, j;
- if (N)
- j = dE(N);
- else if (ZI(r)) {
- const W = wP(
- r,
- 2097152,
- /*ignoreErrors*/
- !0
- );
- if (W && W !== ze) {
- const Q = Zl(W);
- Q && Q.flags & 524288 && (N = Q, j = BL(r) || (f ? [] : void 0));
- }
- }
- return _E(a, BL(r), N, j);
- }
- return D2(r, a) ? l : He;
- }
- function Swe(r) {
- var a;
- const l = (a = r.declarations) == null ? void 0 : a.find(_3);
- return !!(l && yf(l));
- }
- function HKe(r) {
- switch (r.kind) {
- case 183:
- return r.typeName;
- case 233:
- const a = r.expression;
- if (yo(a))
- return a;
- }
- }
- function Twe(r) {
- return r.parent ? `${Twe(r.parent)}.${r.escapedName}` : r.escapedName;
- }
- function TG(r) {
- const l = (r.kind === 166 ? r.right : r.kind === 211 ? r.name : r).escapedText;
- if (l) {
- const f = r.kind === 166 ? TG(r.left) : r.kind === 211 ? TG(r.expression) : void 0, m = f ? `${Twe(f)}.${l}` : l;
- let y = De.get(m);
- return y || (De.set(m, y = fa(
- 524288,
- l,
- 1048576
- /* Unresolved */
- )), y.parent = f, y.links.declaredType = Vt), y;
- }
- return ze;
- }
- function wP(r, a, l) {
- const f = HKe(r);
- if (!f)
- return ze;
- const m = Yo(f, a, l);
- return m && m !== ze ? m : l ? ze : TG(f);
- }
- function xG(r, a) {
- if (a === ze)
- return He;
- if (a = KS(a) || a, a.flags & 96)
- return bwe(r, a);
- if (a.flags & 524288)
- return qKe(r, a);
- const l = RPe(a);
- if (l)
- return D2(r, a) ? Vu(l) : He;
- if (a.flags & 111551 && kG(r)) {
- const f = GKe(r, a);
- return f || (wP(
- r,
- 788968
- /* Type */
- ), nn(a));
- }
- return He;
- }
- function GKe(r, a) {
- const l = bn(r);
- if (!l.resolvedJSDocType) {
- const f = nn(a);
- let m = f;
- if (a.valueDeclaration) {
- const y = r.kind === 205 && r.qualifier;
- f.symbol && f.symbol !== a && y && (m = xG(r, f.symbol));
- }
- l.resolvedJSDocType = m;
- }
- return l.resolvedJSDocType;
- }
- function Q_e(r) {
- return Y_e(r) ? xwe(r, M) : r;
- }
- function Y_e(r) {
- return !!(r.flags & 3145728 && ut(r.types, Y_e) || r.flags & 33554432 && !fE(r) && Y_e(r.baseType) || r.flags & 524288 && !Dg(r) || r.flags & 432275456 && !pT(r));
- }
- function fE(r) {
- return !!(r.flags & 33554432 && r.constraint.flags & 2);
- }
- function Z_e(r, a) {
- return a.flags & 3 || a === r || r.flags & 1 ? r : xwe(r, a);
- }
- function xwe(r, a) {
- const l = `${Rl(r)}>${Rl(a)}`, f = Ws.get(l);
- if (f)
- return f;
- const m = Vd(
- 33554432
- /* Substitution */
- );
- return m.baseType = r, m.constraint = a, Ws.set(l, m), m;
- }
- function K_e(r) {
- return fE(r) ? r.baseType : ia([r.constraint, r.baseType]);
- }
- function kwe(r) {
- return r.kind === 189 && r.elements.length === 1;
- }
- function Cwe(r, a, l) {
- return kwe(a) && kwe(l) ? Cwe(r, a.elements[0], l.elements[0]) : P1(Ci(a)) === P1(r) ? Ci(l) : void 0;
- }
- function $Ke(r, a) {
- let l, f = !0;
- for (; a && !bi(a) && a.kind !== 320; ) {
- const m = a.parent;
- if (m.kind === 169 && (f = !f), (f || r.flags & 8650752) && m.kind === 194 && a === m.trueType) {
- const y = Cwe(r, m.checkType, m.extendsType);
- y && (l = wr(l, y));
- } else if (r.flags & 262144 && m.kind === 200 && !m.nameType && a === m.type) {
- const y = Ci(m);
- if ($d(y) === P1(r)) {
- const x = CN(y);
- if (x) {
- const N = s_(x);
- N && z_(N, Kv) && (l = wr(l, Qn([At, Ts])));
- }
- }
- }
- a = m;
- }
- return l ? Z_e(r, ia(l)) : r;
- }
- function kG(r) {
- return !!(r.flags & 16777216) && (r.kind === 183 || r.kind === 205);
- }
- function D2(r, a) {
- return r.typeArguments ? (je(r, p.Type_0_is_not_generic, a ? Ji(a) : r.typeName ? _o(r.typeName) : Gz), !1) : !0;
- }
- function Ewe(r) {
- if (Oe(r.typeName)) {
- const a = r.typeArguments;
- switch (r.typeName.escapedText) {
- case "String":
- return D2(r), Ie;
- case "Number":
- return D2(r), At;
- case "Boolean":
- return D2(r), wt;
- case "Void":
- return D2(r), Xt;
- case "Undefined":
- return D2(r), Ae;
- case "Null":
- return D2(r), ht;
- case "Function":
- case "function":
- return D2(r), al;
- case "array":
- return (!a || !a.length) && !ie ? so : void 0;
- case "promise":
- return (!a || !a.length) && !ie ? LM(xe) : void 0;
- case "Object":
- if (a && a.length === 2) {
- if (P7(r)) {
- const l = Ci(a[0]), f = Ci(a[1]), m = l === Ie || l === At ? [Cg(
- l,
- f,
- /*isReadonly*/
- !1
- )] : Ue;
- return Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- m
- );
- }
- return xe;
- }
- return D2(r), ie ? void 0 : xe;
- }
- }
- }
- function XKe(r) {
- const a = Ci(r.type);
- return ee ? sM(
- a,
- 65536
- /* Null */
- ) : a;
- }
- function jL(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- if (xd(r) && $1(r.parent))
- return a.resolvedSymbol = ze, a.resolvedType = wc(r.parent.expression);
- let l, f;
- const m = 788968;
- kG(r) && (f = Ewe(r), f || (l = wP(
- r,
- m,
- /*ignoreErrors*/
- !0
- ), l === ze ? l = wP(
- r,
- m | 111551
- /* Value */
- ) : wP(r, m), f = xG(r, l))), f || (l = wP(r, m), f = xG(r, l)), a.resolvedSymbol = l, a.resolvedType = f;
- }
- return a.resolvedType;
- }
- function BL(r) {
- return lr(r.typeArguments, Ci);
- }
- function Dwe(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = iNe(r);
- a.resolvedType = Vu(J_(l));
- }
- return a.resolvedType;
- }
- function Pwe(r, a) {
- function l(m) {
- const y = m.declarations;
- if (y)
- for (const x of y)
- switch (x.kind) {
- case 263:
- case 264:
- case 266:
- return x;
- }
- }
- if (!r)
- return a ? Vi : xs;
- const f = bo(r);
- return f.flags & 524288 ? Nr(f.typeParameters) !== a ? (je(l(r), p.Global_type_0_must_have_1_type_parameter_s, mc(r), a), a ? Vi : xs) : f : (je(l(r), p.Global_type_0_must_be_a_class_or_interface_type, mc(r)), a ? Vi : xs);
- }
- function efe(r, a) {
- return pE(r, 111551, a ? p.Cannot_find_global_value_0 : void 0);
- }
- function tfe(r, a) {
- return pE(r, 788968, a ? p.Cannot_find_global_type_0 : void 0);
- }
- function CG(r, a, l) {
- const f = pE(r, 788968, l ? p.Cannot_find_global_type_0 : void 0);
- if (f && (bo(f), Nr(Bi(f).typeParameters) !== a)) {
- const m = f.declarations && On(f.declarations, Vp);
- je(m, p.Global_type_0_must_have_1_type_parameter_s, mc(f), a);
- return;
- }
- return f;
- }
- function pE(r, a, l) {
- return Nt(
- /*location*/
- void 0,
- r,
- a,
- l,
- /*isUse*/
- !1,
- /*excludeGlobals*/
- !1
- );
- }
- function fc(r, a, l) {
- const f = tfe(r, l);
- return f || l ? Pwe(f, a) : void 0;
- }
- function wwe(r, a) {
- let l;
- for (const f of r)
- l = wr(l, fc(
- f,
- a,
- /*reportErrors*/
- !1
- ));
- return l ?? Ue;
- }
- function QKe() {
- return Uf || (Uf = fc(
- "TypedPropertyDescriptor",
- /*arity*/
- 1,
- /*reportErrors*/
- !0
- ) || Vi);
- }
- function YKe() {
- return Ce || (Ce = fc(
- "TemplateStringsArray",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ) || xs);
- }
- function Awe() {
- return yt || (yt = fc(
- "ImportMeta",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ) || xs);
- }
- function Nwe() {
- if (!Mr) {
- const r = fa(0, "ImportMetaExpression"), a = Awe(), l = fa(
- 4,
- "meta",
- 8
- /* Readonly */
- );
- l.parent = r, l.links.type = a;
- const f = Js([l]);
- r.members = f, Mr = Li(r, f, Ue, Ue, Ue);
- }
- return Mr;
- }
- function Iwe(r) {
- return hi || (hi = fc(
- "ImportCallOptions",
- /*arity*/
- 0,
- r
- )) || xs;
- }
- function rfe(r) {
- return Es || (Es = fc(
- "ImportAttributes",
- /*arity*/
- 0,
- r
- )) || xs;
- }
- function Owe(r) {
- return Xp || (Xp = efe("Symbol", r));
- }
- function ZKe(r) {
- return A_ || (A_ = tfe("SymbolConstructor", r));
- }
- function Fwe() {
- return Sf || (Sf = fc(
- "Symbol",
- /*arity*/
- 0,
- /*reportErrors*/
- !1
- )) || xs;
- }
- function JL(r) {
- return yp || (yp = fc(
- "Promise",
- /*arity*/
- 1,
- r
- )) || Vi;
- }
- function Lwe(r) {
- return Yg || (Yg = fc(
- "PromiseLike",
- /*arity*/
- 1,
- r
- )) || Vi;
- }
- function nfe(r) {
- return Qp || (Qp = efe("Promise", r));
- }
- function KKe(r) {
- return y_ || (y_ = fc(
- "PromiseConstructorLike",
- /*arity*/
- 0,
- r
- )) || xs;
- }
- function zL(r) {
- return It || (It = fc(
- "AsyncIterable",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function eet(r) {
- return Mt || (Mt = fc(
- "AsyncIterator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function Mwe(r) {
- return Sr || (Sr = fc(
- "AsyncIterableIterator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function tet() {
- return En ?? (En = wwe(["ReadableStreamAsyncIterator"], 1));
- }
- function ret(r) {
- return si || (si = fc(
- "AsyncIteratorObject",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function net(r) {
- return L || (L = fc(
- "AsyncGenerator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function EG(r) {
- return vl || (vl = fc(
- "Iterable",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function iet(r) {
- return Uh || (Uh = fc(
- "Iterator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function Rwe(r) {
- return r_ || (r_ = fc(
- "IterableIterator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function ife() {
- return ne ? Ae : xe;
- }
- function set() {
- return Vr ?? (Vr = wwe(["ArrayIterator", "MapIterator", "SetIterator", "StringIterator"], 1));
- }
- function aet(r) {
- return Zg || (Zg = fc(
- "IteratorObject",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function oet(r) {
- return Vf || (Vf = fc(
- "Generator",
- /*arity*/
- 3,
- r
- )) || Vi;
- }
- function cet(r) {
- return Y || (Y = fc(
- "IteratorYieldResult",
- /*arity*/
- 1,
- r
- )) || Vi;
- }
- function uet(r) {
- return st || (st = fc(
- "IteratorReturnResult",
- /*arity*/
- 1,
- r
- )) || Vi;
- }
- function jwe(r) {
- return ns || (ns = fc(
- "Disposable",
- /*arity*/
- 0,
- r
- )) || xs;
- }
- function _et(r) {
- return Ds || (Ds = fc(
- "AsyncDisposable",
- /*arity*/
- 0,
- r
- )) || xs;
- }
- function Bwe(r, a = 0) {
- const l = pE(
- r,
- 788968,
- /*diagnostic*/
- void 0
- );
- return l && Pwe(l, a);
- }
- function fet() {
- return Pa || (Pa = CG(
- "Extract",
- /*arity*/
- 2,
- /*reportErrors*/
- !0
- ) || ze), Pa === ze ? void 0 : Pa;
- }
- function pet() {
- return ga || (ga = CG(
- "Omit",
- /*arity*/
- 2,
- /*reportErrors*/
- !0
- ) || ze), ga === ze ? void 0 : ga;
- }
- function sfe(r) {
- return $o || ($o = CG(
- "Awaited",
- /*arity*/
- 1,
- r
- ) || (r ? ze : void 0)), $o === ze ? void 0 : $o;
- }
- function det() {
- return vp || (vp = fc(
- "BigInt",
- /*arity*/
- 0,
- /*reportErrors*/
- !1
- )) || xs;
- }
- function met(r) {
- return Kg ?? (Kg = fc(
- "ClassDecoratorContext",
- /*arity*/
- 1,
- r
- )) ?? Vi;
- }
- function get(r) {
- return J0 ?? (J0 = fc(
- "ClassMethodDecoratorContext",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function het(r) {
- return eh ?? (eh = fc(
- "ClassGetterDecoratorContext",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function yet(r) {
- return bp ?? (bp = fc(
- "ClassSetterDecoratorContext",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function vet(r) {
- return Sp ?? (Sp = fc(
- "ClassAccessorDecoratorContext",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function bet(r) {
- return Mo ?? (Mo = fc(
- "ClassAccessorDecoratorTarget",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function Tet(r) {
- return Tf ?? (Tf = fc(
- "ClassAccessorDecoratorResult",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function xet(r) {
- return N_ ?? (N_ = fc(
- "ClassFieldDecoratorContext",
- /*arity*/
- 2,
- r
- )) ?? Vi;
- }
- function ket() {
- return dd || (dd = efe(
- "NaN",
- /*reportErrors*/
- !1
- ));
- }
- function Cet() {
- return jd || (jd = CG(
- "Record",
- /*arity*/
- 2,
- /*reportErrors*/
- !0
- ) || ze), jd === ze ? void 0 : jd;
- }
- function AP(r, a) {
- return r !== Vi ? n0(r, a) : xs;
- }
- function Jwe(r) {
- return AP(QKe(), [r]);
- }
- function zwe(r) {
- return AP(EG(
- /*reportErrors*/
- !0
- ), [r, Xt, Ae]);
- }
- function du(r, a) {
- return AP(a ? Lr : Et, [r]);
- }
- function afe(r) {
- switch (r.kind) {
- case 190:
- return 2;
- case 191:
- return Wwe(r);
- case 202:
- return r.questionToken ? 2 : r.dotDotDotToken ? Wwe(r) : 1;
- default:
- return 1;
- }
- }
- function Wwe(r) {
- return GL(r.type) ? 4 : 8;
- }
- function Eet(r) {
- const a = wet(r.parent);
- if (GL(r))
- return a ? Lr : Et;
- const f = lr(r.elements, afe);
- return ofe(f, a, lr(r.elements, Det));
- }
- function Det(r) {
- return qC(r) || Ii(r) ? r : void 0;
- }
- function Uwe(r, a) {
- return !!Mk(r) || Vwe(r) && (r.kind === 188 ? E1(r.elementType) : r.kind === 189 ? ut(r.elements, E1) : a || ut(r.typeArguments, E1));
- }
- function Vwe(r) {
- const a = r.parent;
- switch (a.kind) {
- case 196:
- case 202:
- case 183:
- case 192:
- case 193:
- case 199:
- case 194:
- case 198:
- case 188:
- case 189:
- return Vwe(a);
- case 265:
- return !0;
- }
- return !1;
- }
- function E1(r) {
- switch (r.kind) {
- case 183:
- return kG(r) || !!(wP(
- r,
- 788968
- /* Type */
- ).flags & 524288);
- case 186:
- return !0;
- case 198:
- return r.operator !== 158 && E1(r.type);
- case 196:
- case 190:
- case 202:
- case 316:
- case 314:
- case 315:
- case 309:
- return E1(r.type);
- case 191:
- return r.type.kind !== 188 || E1(r.type.elementType);
- case 192:
- case 193:
- return ut(r.types, E1);
- case 199:
- return E1(r.objectType) || E1(r.indexType);
- case 194:
- return E1(r.checkType) || E1(r.extendsType) || E1(r.trueType) || E1(r.falseType);
- }
- return !1;
- }
- function Pet(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Eet(r);
- if (l === Vi)
- a.resolvedType = xs;
- else if (!(r.kind === 189 && ut(r.elements, (f) => !!(afe(f) & 8))) && Uwe(r))
- a.resolvedType = r.kind === 189 && r.elements.length === 0 ? l : X_e(
- l,
- r,
- /*mapper*/
- void 0
- );
- else {
- const f = r.kind === 188 ? [Ci(r.elementType)] : lr(r.elements, Ci);
- a.resolvedType = cfe(l, f);
- }
- }
- return a.resolvedType;
- }
- function wet(r) {
- return cv(r) && r.operator === 148;
- }
- function Eg(r, a, l = !1, f = []) {
- const m = ofe(a || lr(
- r,
- (y) => 1
- /* Required */
- ), l, f);
- return m === Vi ? xs : r.length ? cfe(m, r) : m;
- }
- function ofe(r, a, l) {
- if (r.length === 1 && r[0] & 4)
- return a ? Lr : Et;
- const f = lr(r, (y) => y & 1 ? "#" : y & 2 ? "?" : y & 4 ? "." : "*").join() + (a ? "R" : "") + (ut(l, (y) => !!y) ? "," + lr(l, (y) => y ? Ma(y) : "_").join(",") : "");
- let m = ei.get(f);
- return m || ei.set(f, m = Aet(r, a, l)), m;
- }
- function Aet(r, a, l) {
- const f = r.length, m = py(r, (ye) => !!(ye & 9));
- let y;
- const x = [];
- let N = 0;
- if (f) {
- y = new Array(f);
- for (let ye = 0; ye < f; ye++) {
- const de = y[ye] = pt(), Ze = r[ye];
- if (N |= Ze, !(N & 12)) {
- const ct = fa(4 | (Ze & 2 ? 16777216 : 0), "" + ye, a ? 8 : 0);
- ct.links.tupleLabelDeclaration = l?.[ye], ct.links.type = de, x.push(ct);
- }
- }
- }
- const j = x.length, W = fa(4, "length", a ? 8 : 0);
- if (N & 12)
- W.links.type = At;
- else {
- const ye = [];
- for (let de = m; de <= f; de++) ye.push(bd(de));
- W.links.type = Qn(ye);
- }
- x.push(W);
- const Q = k(
- 12
- /* Reference */
- );
- return Q.typeParameters = y, Q.outerTypeParameters = void 0, Q.localTypeParameters = y, Q.instantiations = /* @__PURE__ */ new Map(), Q.instantiations.set(sd(Q.typeParameters), Q), Q.target = Q, Q.resolvedTypeArguments = Q.typeParameters, Q.thisType = pt(), Q.thisType.isThisType = !0, Q.thisType.constraint = Q, Q.declaredProperties = x, Q.declaredCallSignatures = Ue, Q.declaredConstructSignatures = Ue, Q.declaredIndexInfos = Ue, Q.elementFlags = r, Q.minLength = m, Q.fixedLength = j, Q.hasRestElement = !!(N & 12), Q.combinedFlags = N, Q.readonly = a, Q.labeledElementDeclarations = l, Q;
- }
- function cfe(r, a) {
- return r.objectFlags & 8 ? lfe(r, a) : n0(r, a);
- }
- function lfe(r, a) {
- var l, f, m, y;
- if (!(r.combinedFlags & 14))
- return n0(r, a);
- if (r.combinedFlags & 8) {
- const ct = ac(a, (mt, Gt) => !!(r.elementFlags[Gt] & 8 && mt.flags & 1179648));
- if (ct >= 0)
- return UL(lr(a, (mt, Gt) => r.elementFlags[Gt] & 8 ? mt : M)) ? Xo(a[ct], (mt) => lfe(r, pR(a, ct, mt))) : He;
- }
- const x = [], N = [], j = [];
- let W = -1, Q = -1, ye = -1;
- for (let ct = 0; ct < a.length; ct++) {
- const mt = a[ct], Gt = r.elementFlags[ct];
- if (Gt & 8)
- if (mt.flags & 1)
- Ze(mt, 4, (l = r.labeledElementDeclarations) == null ? void 0 : l[ct]);
- else if (mt.flags & 58982400 || R_(mt))
- Ze(mt, 8, (f = r.labeledElementDeclarations) == null ? void 0 : f[ct]);
- else if (ha(mt)) {
- const sr = P2(mt);
- if (sr.length + x.length >= 1e4)
- return je(
- C,
- um(C) ? p.Type_produces_a_tuple_type_that_is_too_large_to_represent : p.Expression_produces_a_tuple_type_that_is_too_large_to_represent
- ), He;
- ir(sr, (Xr, tn) => {
- var pr;
- return Ze(Xr, mt.target.elementFlags[tn], (pr = mt.target.labeledElementDeclarations) == null ? void 0 : pr[tn]);
- });
- } else
- Ze(oy(mt) && $v(mt, At) || He, 4, (m = r.labeledElementDeclarations) == null ? void 0 : m[ct]);
- else
- Ze(mt, Gt, (y = r.labeledElementDeclarations) == null ? void 0 : y[ct]);
- }
- for (let ct = 0; ct < W; ct++)
- N[ct] & 2 && (N[ct] = 1);
- Q >= 0 && Q < ye && (x[Q] = Qn(qc(x.slice(Q, ye + 1), (ct, mt) => N[Q + mt] & 8 ? j_(ct, At) : ct)), x.splice(Q + 1, ye - Q), N.splice(Q + 1, ye - Q), j.splice(Q + 1, ye - Q));
- const de = ofe(N, r.readonly, j);
- return de === Vi ? xs : N.length ? n0(de, x) : de;
- function Ze(ct, mt, Gt) {
- mt & 1 && (W = N.length), mt & 4 && Q < 0 && (Q = N.length), mt & 6 && (ye = N.length), x.push(mt & 2 ? cl(
- ct,
- /*isProperty*/
- !0
- ) : ct), N.push(mt), j.push(Gt);
- }
- }
- function NP(r, a, l = 0) {
- const f = r.target, m = sy(r) - l;
- return a > f.fixedLength ? grt(r) || Eg(Ue) : Eg(
- Io(r).slice(a, m),
- f.elementFlags.slice(a, m),
- /*readonly*/
- !1,
- f.labeledElementDeclarations && f.labeledElementDeclarations.slice(a, m)
- );
- }
- function qwe(r) {
- return Qn(wr(hX(r.target.fixedLength, (a) => S_("" + a)), Jm(r.target.readonly ? Lr : Et)));
- }
- function Net(r, a) {
- const l = ac(r.elementFlags, (f) => !(f & a));
- return l >= 0 ? l : r.elementFlags.length;
- }
- function SN(r, a) {
- return r.elementFlags.length - uI(r.elementFlags, (l) => !(l & a)) - 1;
- }
- function ufe(r) {
- return r.fixedLength + SN(
- r,
- 3
- /* Fixed */
- );
- }
- function P2(r) {
- const a = Io(r), l = sy(r);
- return a.length === l ? a : a.slice(0, l);
- }
- function Iet(r) {
- return cl(
- Ci(r.type),
- /*isProperty*/
- !0
- );
- }
- function Rl(r) {
- return r.id;
- }
- function mh(r, a) {
- return hy(r, a, Rl, ho) >= 0;
- }
- function WL(r, a) {
- const l = hy(r, a, Rl, ho);
- return l < 0 ? (r.splice(~l, 0, a), !0) : !1;
- }
- function Oet(r, a, l) {
- const f = l.flags;
- if (!(f & 131072))
- if (a |= f & 473694207, f & 465829888 && (a |= 33554432), f & 2097152 && wn(l) & 67108864 && (a |= 536870912), l === $e && (a |= 8388608), H(l) && (a |= 1073741824), !ee && f & 98304)
- wn(l) & 65536 || (a |= 4194304);
- else {
- const m = r.length, y = m && l.id > r[m - 1].id ? ~m : hy(r, l, Rl, ho);
- y < 0 && r.splice(~y, 0, l);
- }
- return a;
- }
- function Hwe(r, a, l) {
- let f;
- for (const m of l)
- m !== f && (a = m.flags & 1048576 ? Hwe(r, a | (Bet(m) ? 1048576 : 0), m.types) : Oet(r, a, m), f = m);
- return a;
- }
- function Fet(r, a) {
- var l;
- if (r.length < 2)
- return r;
- const f = sd(r), m = Hs.get(f);
- if (m)
- return m;
- const y = a && ut(r, (W) => !!(W.flags & 524288) && !R_(W) && Ofe(Xd(W))), x = r.length;
- let N = x, j = 0;
- for (; N > 0; ) {
- N--;
- const W = r[N];
- if (y || W.flags & 469499904) {
- if (W.flags & 262144 && kg(W).flags & 1048576) {
- zm(W, Qn(lr(r, (de) => de === W ? Ht : de)), Hf) && Ty(r, N);
- continue;
- }
- const Q = W.flags & 61603840 ? On(qa(W), (de) => Yd(nn(de))) : void 0, ye = Q && Vu(nn(Q));
- for (const de of r)
- if (W !== de) {
- if (j === 1e5 && j / (x - N) * x > 1e6) {
- (l = rn) == null || l.instant(rn.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: r.map((ct) => ct.id) }), je(C, p.Expression_produces_a_union_type_that_is_too_complex_to_represent);
- return;
- }
- if (j++, Q && de.flags & 61603840) {
- const Ze = Rc(de, Q.escapedName);
- if (Ze && Yd(Ze) && Vu(Ze) !== ye)
- continue;
- }
- if (zm(W, de, Hf) && (!(wn(cT(W)) & 1) || !(wn(cT(de)) & 1) || Zv(W, de))) {
- Ty(r, N);
- break;
- }
- }
- }
- }
- return Hs.set(f, r), r;
- }
- function Let(r, a, l) {
- let f = r.length;
- for (; f > 0; ) {
- f--;
- const m = r[f], y = m.flags;
- (y & 402653312 && a & 4 || y & 256 && a & 8 || y & 2048 && a & 64 || y & 8192 && a & 4096 || l && y & 32768 && a & 16384 || A2(m) && mh(r, m.regularType)) && Ty(r, f);
- }
- }
- function Met(r) {
- const a = Ln(r, pT);
- if (a.length) {
- let l = r.length;
- for (; l > 0; ) {
- l--;
- const f = r[l];
- f.flags & 128 && ut(a, (m) => Ret(f, m)) && Ty(r, l);
- }
- }
- }
- function Ret(r, a) {
- return a.flags & 134217728 ? r$(r, a) : t$(r, a);
- }
- function jet(r) {
- const a = [];
- for (const l of r)
- if (l.flags & 2097152 && wn(l) & 67108864) {
- const f = l.types[0].flags & 8650752 ? 0 : 1;
- tp(a, l.types[f]);
- }
- for (const l of a) {
- const f = [];
- for (const y of r)
- if (y.flags & 2097152 && wn(y) & 67108864) {
- const x = y.types[0].flags & 8650752 ? 0 : 1;
- y.types[x] === l && WL(f, y.types[1 - x]);
- }
- const m = Kl(l);
- if (z_(m, (y) => mh(f, y))) {
- let y = r.length;
- for (; y > 0; ) {
- y--;
- const x = r[y];
- if (x.flags & 2097152 && wn(x) & 67108864) {
- const N = x.types[0].flags & 8650752 ? 0 : 1;
- x.types[N] === l && mh(f, x.types[1 - N]) && Ty(r, y);
- }
- }
- WL(r, l);
- }
- }
- }
- function Bet(r) {
- return !!(r.flags & 1048576 && (r.aliasSymbol || r.origin));
- }
- function Gwe(r, a) {
- for (const l of a)
- if (l.flags & 1048576) {
- const f = l.origin;
- l.aliasSymbol || f && !(f.flags & 1048576) ? tp(r, l) : f && f.flags & 1048576 && Gwe(r, f.types);
- }
- }
- function _fe(r, a) {
- const l = rT(r);
- return l.types = a, l;
- }
- function Qn(r, a = 1, l, f, m) {
- if (r.length === 0)
- return Ht;
- if (r.length === 1)
- return r[0];
- if (r.length === 2 && !m && (r[0].flags & 1048576 || r[1].flags & 1048576)) {
- const y = a === 0 ? "N" : a === 2 ? "S" : "L", x = r[0].id < r[1].id ? 0 : 1, N = r[x].id + y + r[1 - x].id + Ik(l, f);
- let j = Jr.get(N);
- return j || (j = $we(
- r,
- a,
- l,
- f,
- /*origin*/
- void 0
- ), Jr.set(N, j)), j;
- }
- return $we(r, a, l, f, m);
- }
- function $we(r, a, l, f, m) {
- let y = [];
- const x = Hwe(y, 0, r);
- if (a !== 0) {
- if (x & 3)
- return x & 1 ? x & 8388608 ? $e : x & 1073741824 ? He : xe : M;
- if (x & 32768 && y.length >= 2 && y[0] === Ae && y[1] === U && Ty(y, 1), (x & 402664352 || x & 16384 && x & 32768) && Let(y, x, !!(a & 2)), x & 128 && x & 402653184 && Met(y), x & 536870912 && jet(y), a === 2 && (y = Fet(y, !!(x & 524288)), !y))
- return He;
- if (y.length === 0)
- return x & 65536 ? x & 4194304 ? ht : Le : x & 32768 ? x & 4194304 ? Ae : dt : Ht;
- }
- if (!m && x & 1048576) {
- const j = [];
- Gwe(j, r);
- const W = [];
- for (const ye of y)
- ut(j, (de) => mh(de.types, ye)) || W.push(ye);
- if (!l && j.length === 1 && W.length === 0)
- return j[0];
- if (Hu(j, (ye, de) => ye + de.types.length, 0) + W.length === y.length) {
- for (const ye of j)
- WL(W, ye);
- m = _fe(1048576, W);
- }
- }
- const N = (x & 36323331 ? 0 : 32768) | (x & 2097152 ? 16777216 : 0);
- return pfe(y, N, l, f, m);
- }
- function Jet(r, a) {
- let l;
- const f = [];
- for (const y of r) {
- const x = Cp(y);
- if (x) {
- if (x.kind !== 0 && x.kind !== 1 || l && !ffe(l, x))
- return;
- l = x, f.push(x.type);
- } else {
- const N = a !== 2097152 ? Ha(y) : void 0;
- if (N !== yr && N !== $r)
- return;
- }
- }
- if (!l)
- return;
- const m = pwe(f, a);
- return yN(l.kind, l.parameterName, l.parameterIndex, m);
- }
- function ffe(r, a) {
- return r.kind === a.kind && r.parameterIndex === a.parameterIndex;
- }
- function pfe(r, a, l, f, m) {
- if (r.length === 0)
- return Ht;
- if (r.length === 1)
- return r[0];
- const x = (m ? m.flags & 1048576 ? `|${sd(m.types)}` : m.flags & 2097152 ? `&${sd(m.types)}` : `#${m.type.id}|${sd(r)}` : sd(r)) + Ik(l, f);
- let N = Ri.get(x);
- return N || (N = Vd(
- 1048576
- /* Union */
- ), N.objectFlags = a | RL(
- r,
- /*excludeKinds*/
- 98304
- /* Nullable */
- ), N.types = r, N.origin = m, N.aliasSymbol = l, N.aliasTypeArguments = f, r.length === 2 && r[0].flags & 512 && r[1].flags & 512 && (N.flags |= 16, N.intrinsicName = "boolean"), Ri.set(x, N)), N;
- }
- function zet(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Mk(r);
- a.resolvedType = Qn(lr(r.types, Ci), 1, l, dE(l));
- }
- return a.resolvedType;
- }
- function Wet(r, a, l) {
- const f = l.flags;
- return f & 2097152 ? Xwe(r, a, l.types) : (Dg(l) ? a & 16777216 || (a |= 16777216, r.set(l.id.toString(), l)) : (f & 3 ? (l === $e && (a |= 8388608), H(l) && (a |= 1073741824)) : (ee || !(f & 98304)) && (l === U && (a |= 262144, l = Ae), r.has(l.id.toString()) || (l.flags & 109472 && a & 109472 && (a |= 67108864), r.set(l.id.toString(), l))), a |= f & 473694207), a);
- }
- function Xwe(r, a, l) {
- for (const f of l)
- a = Wet(r, a, Vu(f));
- return a;
- }
- function Uet(r, a) {
- let l = r.length;
- for (; l > 0; ) {
- l--;
- const f = r[l];
- (f.flags & 4 && a & 402653312 || f.flags & 8 && a & 256 || f.flags & 64 && a & 2048 || f.flags & 4096 && a & 8192 || f.flags & 16384 && a & 32768 || Dg(f) && a & 470302716) && Ty(r, l);
- }
- }
- function Vet(r, a) {
- for (const l of r)
- if (!mh(l.types, a)) {
- if (a === U)
- return mh(l.types, Ae);
- if (a === Ae)
- return mh(l.types, U);
- const f = a.flags & 128 ? Ie : a.flags & 288 ? At : a.flags & 2048 ? Dr : a.flags & 8192 ? jt : void 0;
- if (!f || !mh(l.types, f))
- return !1;
- }
- return !0;
- }
- function qet(r) {
- let a = r.length;
- const l = Ln(r, (f) => !!(f.flags & 128));
- for (; a > 0; ) {
- a--;
- const f = r[a];
- if (f.flags & 402653184) {
- for (const m of l)
- if (O2(m, f)) {
- Ty(r, a);
- break;
- } else if (pT(f))
- return !0;
- }
- }
- return !1;
- }
- function Qwe(r, a) {
- for (let l = 0; l < r.length; l++)
- r[l] = Vc(r[l], (f) => !(f.flags & a));
- }
- function Het(r) {
- let a;
- const l = ac(r, (x) => !!(wn(x) & 32768));
- if (l < 0)
- return !1;
- let f = l + 1;
- for (; f < r.length; ) {
- const x = r[f];
- wn(x) & 32768 ? ((a || (a = [r[l]])).push(x), Ty(r, f)) : f++;
- }
- if (!a)
- return !1;
- const m = [], y = [];
- for (const x of a)
- for (const N of x.types)
- if (WL(m, N) && Vet(a, N)) {
- if (N === Ae && y.length && y[0] === U)
- continue;
- if (N === U && y.length && y[0] === Ae) {
- y[0] = U;
- continue;
- }
- WL(y, N);
- }
- return r[l] = pfe(
- y,
- 32768
- /* PrimitiveUnion */
- ), !0;
- }
- function Get(r, a, l, f) {
- const m = Vd(
- 2097152
- /* Intersection */
- );
- return m.objectFlags = a | RL(
- r,
- /*excludeKinds*/
- 98304
- /* Nullable */
- ), m.types = r, m.aliasSymbol = l, m.aliasTypeArguments = f, m;
- }
- function ia(r, a = 0, l, f) {
- const m = /* @__PURE__ */ new Map(), y = Xwe(m, 0, r), x = as(m.values());
- let N = 0;
- if (y & 131072)
- return ss(x, en) ? en : Ht;
- if (ee && y & 98304 && y & 84410368 || y & 67108864 && y & 402783228 || y & 402653316 && y & 67238776 || y & 296 && y & 469891796 || y & 2112 && y & 469889980 || y & 12288 && y & 469879804 || y & 49152 && y & 469842940 || y & 402653184 && y & 128 && qet(x))
- return Ht;
- if (y & 1)
- return y & 8388608 ? $e : y & 1073741824 ? He : xe;
- if (!ee && y & 98304)
- return y & 16777216 ? Ht : y & 32768 ? Ae : ht;
- if ((y & 4 && y & 402653312 || y & 8 && y & 256 || y & 64 && y & 2048 || y & 4096 && y & 8192 || y & 16384 && y & 32768 || y & 16777216 && y & 470302716) && (a & 1 || Uet(x, y)), y & 262144 && (x[x.indexOf(Ae)] = U), x.length === 0)
- return M;
- if (x.length === 1)
- return x[0];
- if (x.length === 2 && !(a & 2)) {
- const Q = x[0].flags & 8650752 ? 0 : 1, ye = x[Q], de = x[1 - Q];
- if (ye.flags & 8650752 && (de.flags & 469893116 && !o3e(de) || y & 16777216)) {
- const Ze = Kl(ye);
- if (Ze && z_(Ze, (ct) => !!(ct.flags & 469893116) || Dg(ct))) {
- if (QL(Ze, de))
- return ye;
- if (!(Ze.flags & 1048576 && Pp(Ze, (ct) => QL(ct, de))) && !QL(de, Ze))
- return Ht;
- N = 67108864;
- }
- }
- }
- const j = sd(x) + (a & 2 ? "*" : Ik(l, f));
- let W = ji.get(j);
- if (!W) {
- if (y & 1048576)
- if (Het(x))
- W = ia(x, a, l, f);
- else if (Mi(x, (Q) => !!(Q.flags & 1048576 && Q.types[0].flags & 32768))) {
- const Q = ut(x, IN) ? U : Ae;
- Qwe(
- x,
- 32768
- /* Undefined */
- ), W = Qn([ia(x, a), Q], 1, l, f);
- } else if (Mi(x, (Q) => !!(Q.flags & 1048576 && (Q.types[0].flags & 65536 || Q.types[1].flags & 65536))))
- Qwe(
- x,
- 65536
- /* Null */
- ), W = Qn([ia(x, a), ht], 1, l, f);
- else if (x.length >= 3 && r.length > 2) {
- const Q = Math.floor(x.length / 2);
- W = ia([ia(x.slice(0, Q), a), ia(x.slice(Q), a)], a, l, f);
- } else {
- if (!UL(x))
- return He;
- const Q = $et(x, a), ye = ut(Q, (de) => !!(de.flags & 2097152)) && dfe(Q) > dfe(x) ? _fe(2097152, x) : void 0;
- W = Qn(Q, 1, l, f, ye);
- }
- else
- W = Get(x, N, l, f);
- ji.set(j, W);
- }
- return W;
- }
- function Ywe(r) {
- return Hu(r, (a, l) => l.flags & 1048576 ? a * l.types.length : l.flags & 131072 ? 0 : a, 1);
- }
- function UL(r) {
- var a;
- const l = Ywe(r);
- return l >= 1e5 ? ((a = rn) == null || a.instant(rn.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: r.map((f) => f.id), size: l }), je(C, p.Expression_produces_a_union_type_that_is_too_complex_to_represent), !1) : !0;
- }
- function $et(r, a) {
- const l = Ywe(r), f = [];
- for (let m = 0; m < l; m++) {
- const y = r.slice();
- let x = m;
- for (let j = r.length - 1; j >= 0; j--)
- if (r[j].flags & 1048576) {
- const W = r[j].types, Q = W.length;
- y[j] = W[x % Q], x = Math.floor(x / Q);
- }
- const N = ia(y, a);
- N.flags & 131072 || f.push(N);
- }
- return f;
- }
- function Zwe(r) {
- return !(r.flags & 3145728) || r.aliasSymbol ? 1 : r.flags & 1048576 && r.origin ? Zwe(r.origin) : dfe(r.types);
- }
- function dfe(r) {
- return Hu(r, (a, l) => a + Zwe(l), 0);
- }
- function Xet(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Mk(r), f = lr(r.types, Ci), m = f.length === 2 ? f.indexOf(Yi) : -1, y = m >= 0 ? f[1 - m] : M, x = !!(y.flags & 76 || y.flags & 134217728 && pT(y));
- a.resolvedType = ia(f, x ? 1 : 0, l, dE(l));
- }
- return a.resolvedType;
- }
- function Kwe(r, a) {
- const l = Vd(
- 4194304
- /* Index */
- );
- return l.type = r, l.indexFlags = a, l;
- }
- function Qet(r) {
- const a = rT(
- 4194304
- /* Index */
- );
- return a.type = r, a;
- }
- function e3e(r, a) {
- return a & 1 ? r.resolvedStringIndexType || (r.resolvedStringIndexType = Kwe(
- r,
- 1
- /* StringsOnly */
- )) : r.resolvedIndexType || (r.resolvedIndexType = Kwe(
- r,
- 0
- /* None */
- ));
- }
- function t3e(r, a) {
- const l = $d(r), f = Yf(r), m = ny(r.target || r);
- if (!m && !(a & 2))
- return f;
- const y = [];
- if (mT(f)) {
- if (cE(r))
- return e3e(r, a);
- TT(f, N);
- } else if (cE(r)) {
- const j = Uu(x2(r));
- N_e(j, 8576, !!(a & 1), N);
- } else
- TT(AL(f), N);
- const x = a & 2 ? Vc(Qn(y), (j) => !(j.flags & 5)) : Qn(y);
- if (x.flags & 1048576 && f.flags & 1048576 && sd(x.types) === sd(f.types))
- return f;
- return x;
- function N(j) {
- const W = m ? zi(m, kN(r.mapper, l, j)) : j;
- y.push(W === Ie ? hr : W);
- }
- }
- function Yet(r) {
- const a = $d(r);
- return l(ny(r) || a);
- function l(f) {
- return f.flags & 470810623 ? !0 : f.flags & 16777216 ? f.root.isDistributive && f.checkType === a : f.flags & 137363456 ? Mi(f.types, l) : f.flags & 8388608 ? l(f.objectType) && l(f.indexType) : f.flags & 33554432 ? l(f.baseType) && l(f.constraint) : f.flags & 268435456 ? l(f.type) : !1;
- }
- }
- function i0(r) {
- if (Di(r))
- return Ht;
- if (d_(r))
- return Vu(Gi(r));
- if (ma(r))
- return Vu(Wm(r));
- const a = oS(r);
- return a !== void 0 ? S_(Ei(a)) : _t(r) ? Vu(Gi(r)) : Ht;
- }
- function Ok(r, a, l) {
- if (l || !(lp(r) & 6)) {
- let f = Bi(mG(r)).nameType;
- if (!f) {
- const m = os(r.valueDeclaration);
- f = r.escapedName === "default" ? S_("default") : m && i0(m) || (b3(r) ? void 0 : S_(mc(r)));
- }
- if (f && f.flags & a)
- return f;
- }
- return Ht;
- }
- function r3e(r, a) {
- return !!(r.flags & a || r.flags & 2097152 && ut(r.types, (l) => r3e(l, a)));
- }
- function Zet(r, a, l) {
- const f = l && (wn(r) & 7 || r.aliasSymbol) ? Qet(r) : void 0, m = lr(qa(r), (x) => Ok(x, a)), y = lr(wu(r), (x) => x !== ar && r3e(x.keyType, a) ? x.keyType === Ie && a & 8 ? hr : x.keyType : Ht);
- return Qn(
- Qi(m, y),
- 1,
- /*aliasSymbol*/
- void 0,
- /*aliasTypeArguments*/
- void 0,
- f
- );
- }
- function mfe(r, a = 0) {
- return !!(r.flags & 58982400 || A1(r) || R_(r) && (!Yet(r) || NL(r) === 2) || r.flags & 1048576 && !(a & 4) && R_e(r) || r.flags & 2097152 && bc(
- r,
- 465829888
- /* Instantiable */
- ) && ut(r.types, Dg));
- }
- function Jm(r, a = 0) {
- return r = Qd(r), fE(r) ? Q_e(Jm(r.baseType, a)) : mfe(r, a) ? e3e(r, a) : r.flags & 1048576 ? ia(lr(r.types, (l) => Jm(l, a))) : r.flags & 2097152 ? Qn(lr(r.types, (l) => Jm(l, a))) : wn(r) & 32 ? t3e(r, a) : r === $e ? $e : r.flags & 2 ? Ht : r.flags & 131073 ? Ft : Zet(
- r,
- (a & 2 ? 128 : 402653316) | (a & 1 ? 0 : 12584),
- a === 0
- /* None */
- );
- }
- function n3e(r) {
- const a = fet();
- return a ? _E(a, [r, Ie]) : Ie;
- }
- function Ket(r) {
- const a = n3e(Jm(r));
- return a.flags & 131072 ? Ie : a;
- }
- function ett(r) {
- const a = bn(r);
- if (!a.resolvedType)
- switch (r.operator) {
- case 143:
- a.resolvedType = Jm(Ci(r.type));
- break;
- case 158:
- a.resolvedType = r.type.kind === 155 ? kfe(m3(r.parent)) : He;
- break;
- case 148:
- a.resolvedType = Ci(r.type);
- break;
- default:
- E.assertNever(r.operator);
- }
- return a.resolvedType;
- }
- function ttt(r) {
- const a = bn(r);
- return a.resolvedType || (a.resolvedType = fT(
- [r.head.text, ...lr(r.templateSpans, (l) => l.literal.text)],
- lr(r.templateSpans, (l) => Ci(l.type))
- )), a.resolvedType;
- }
- function fT(r, a) {
- const l = ac(a, (W) => !!(W.flags & 1179648));
- if (l >= 0)
- return UL(a) ? Xo(a[l], (W) => fT(r, pR(a, l, W))) : He;
- if (ss(a, $e))
- return $e;
- const f = [], m = [];
- let y = r[0];
- if (!j(r, a))
- return Ie;
- if (f.length === 0)
- return S_(y);
- if (m.push(y), Mi(m, (W) => W === "")) {
- if (Mi(f, (W) => !!(W.flags & 4)))
- return Ie;
- if (f.length === 1 && pT(f[0]))
- return f[0];
- }
- const x = `${sd(f)}|${lr(m, (W) => W.length).join(",")}|${m.join("")}`;
- let N = qn.get(x);
- return N || qn.set(x, N = ntt(m, f)), N;
- function j(W, Q) {
- for (let ye = 0; ye < Q.length; ye++) {
- const de = Q[ye];
- if (de.flags & 101248)
- y += rtt(de) || "", y += W[ye + 1];
- else if (de.flags & 134217728) {
- if (y += de.texts[0], !j(de.texts, de.types)) return !1;
- y += W[ye + 1];
- } else if (mT(de) || VL(de))
- f.push(de), m.push(y), y = W[ye + 1];
- else
- return !1;
- }
- return !0;
- }
- }
- function rtt(r) {
- return r.flags & 128 ? r.value : r.flags & 256 ? "" + r.value : r.flags & 2048 ? Ib(r.value) : r.flags & 98816 ? r.intrinsicName : void 0;
- }
- function ntt(r, a) {
- const l = Vd(
- 134217728
- /* TemplateLiteral */
- );
- return l.texts = r, l.types = a, l;
- }
- function Fk(r, a) {
- return a.flags & 1179648 ? Xo(a, (l) => Fk(r, l)) : a.flags & 128 ? S_(i3e(r, a.value)) : a.flags & 134217728 ? fT(...itt(r, a.texts, a.types)) : (
- // Mapping> === Mapping
- a.flags & 268435456 && r === a.symbol ? a : a.flags & 268435461 || mT(a) ? s3e(r, a) : (
- // This handles Mapping<`${number}`> and Mapping<`${bigint}`>
- VL(a) ? s3e(r, fT(["", ""], [a])) : a
- )
- );
- }
- function i3e(r, a) {
- switch (Yz.get(r.escapedName)) {
- case 0:
- return a.toUpperCase();
- case 1:
- return a.toLowerCase();
- case 2:
- return a.charAt(0).toUpperCase() + a.slice(1);
- case 3:
- return a.charAt(0).toLowerCase() + a.slice(1);
- }
- return a;
- }
- function itt(r, a, l) {
- switch (Yz.get(r.escapedName)) {
- case 0:
- return [a.map((f) => f.toUpperCase()), l.map((f) => Fk(r, f))];
- case 1:
- return [a.map((f) => f.toLowerCase()), l.map((f) => Fk(r, f))];
- case 2:
- return [a[0] === "" ? a : [a[0].charAt(0).toUpperCase() + a[0].slice(1), ...a.slice(1)], a[0] === "" ? [Fk(r, l[0]), ...l.slice(1)] : l];
- case 3:
- return [a[0] === "" ? a : [a[0].charAt(0).toLowerCase() + a[0].slice(1), ...a.slice(1)], a[0] === "" ? [Fk(r, l[0]), ...l.slice(1)] : l];
- }
- return [a, l];
- }
- function s3e(r, a) {
- const l = `${na(r)},${Rl(a)}`;
- let f = Oi.get(l);
- return f || Oi.set(l, f = stt(r, a)), f;
- }
- function stt(r, a) {
- const l = id(268435456, r);
- return l.type = a, l;
- }
- function att(r, a, l, f, m) {
- const y = Vd(
- 8388608
- /* IndexedAccess */
- );
- return y.objectType = r, y.indexType = a, y.accessFlags = l, y.aliasSymbol = f, y.aliasTypeArguments = m, y;
- }
- function TN(r) {
- if (ie)
- return !1;
- if (wn(r) & 4096)
- return !0;
- if (r.flags & 1048576)
- return Mi(r.types, TN);
- if (r.flags & 2097152)
- return ut(r.types, TN);
- if (r.flags & 465829888) {
- const a = F_e(r);
- return a !== r && TN(a);
- }
- return !1;
- }
- function DG(r, a) {
- return up(r) ? _p(r) : a && Bc(a) ? (
- // late bound names are handled in the first branch, so here we only need to handle normal names
- oS(a)
- ) : void 0;
- }
- function gfe(r, a) {
- if (a.flags & 8208) {
- const l = or(r.parent, (f) => !xo(f)) || r.parent;
- return mb(l) ? am(l) && Oe(r) && mAe(l, r) : Mi(a.declarations, (f) => !ys(f) || q0(f));
- }
- return !0;
- }
- function a3e(r, a, l, f, m, y) {
- const x = m && m.kind === 212 ? m : void 0, N = m && Di(m) ? void 0 : DG(l, m);
- if (N !== void 0) {
- if (y & 256)
- return rb(a, N) || xe;
- const W = Gs(a, N);
- if (W) {
- if (y & 64 && m && W.declarations && $h(W) && gfe(m, W)) {
- const ye = x?.argumentExpression ?? (Rb(m) ? m.indexType : m);
- Xh(ye, W.declarations, N);
- }
- if (x) {
- if (EM(W, x, I8e(x.expression, a.symbol)), vNe(x, W, rv(x))) {
- je(x.argumentExpression, p.Cannot_assign_to_0_because_it_is_a_read_only_property, Ji(W));
- return;
- }
- if (y & 8 && (bn(m).resolvedSymbol = W), k8e(x, W))
- return at;
- }
- const Q = y & 4 ? T1(W) : nn(W);
- return x && rv(x) !== 1 ? _0(x, Q) : m && Rb(m) && IN(Q) ? Qn([Q, Ae]) : Q;
- }
- if (z_(a, ha) && qg(N)) {
- const Q = +N;
- if (m && z_(a, (ye) => !(ye.target.combinedFlags & 12)) && !(y & 16)) {
- const ye = hfe(m);
- if (ha(a)) {
- if (Q < 0)
- return je(ye, p.A_tuple_type_cannot_be_indexed_with_a_negative_value), Ae;
- je(ye, p.Tuple_type_0_of_length_1_has_no_element_at_index_2, Hr(a), sy(a), Ei(N));
- } else
- je(ye, p.Property_0_does_not_exist_on_type_1, Ei(N), Hr(a));
- }
- if (Q >= 0)
- return j(dh(a, At)), X3e(a, Q, y & 1 ? U : void 0);
- }
- }
- if (!(l.flags & 98304) && eu(
- l,
- 402665900
- /* ESSymbolLike */
- )) {
- if (a.flags & 131073)
- return a;
- const W = hN(a, l) || dh(a, Ie);
- if (W) {
- if (y & 2 && W.keyType !== At) {
- x && (y & 4 ? je(x, p.Type_0_is_generic_and_can_only_be_indexed_for_reading, Hr(r)) : je(x, p.Type_0_cannot_be_used_to_index_type_1, Hr(l), Hr(r)));
- return;
- }
- if (m && W.keyType === Ie && !eu(
- l,
- 12
- /* Number */
- )) {
- const Q = hfe(m);
- return je(Q, p.Type_0_cannot_be_used_as_an_index_type, Hr(l)), y & 1 ? Qn([W.type, U]) : W.type;
- }
- return j(W), y & 1 && !(a.symbol && a.symbol.flags & 384 && l.symbol && l.flags & 1024 && Cf(l.symbol) === a.symbol) ? Qn([W.type, U]) : W.type;
- }
- if (l.flags & 131072)
- return Ht;
- if (TN(a))
- return xe;
- if (x && !F$(a)) {
- if (cy(a)) {
- if (ie && l.flags & 384)
- return Da.add(Kr(x, p.Property_0_does_not_exist_on_type_1, l.value, Hr(a))), Ae;
- if (l.flags & 12) {
- const Q = lr(a.properties, (ye) => nn(ye));
- return Qn(wr(Q, Ae));
- }
- }
- if (a.symbol === fe && N !== void 0 && fe.exports.has(N) && fe.exports.get(N).flags & 418)
- je(x, p.Property_0_does_not_exist_on_type_1, Ei(N), Hr(a));
- else if (ie && !(y & 128))
- if (N !== void 0 && D8e(N, a)) {
- const Q = Hr(a);
- je(x, p.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, N, Q, Q + "[" + nc(x.argumentExpression) + "]");
- } else if ($v(a, At))
- je(x.argumentExpression, p.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
- else {
- let Q;
- if (N !== void 0 && (Q = A8e(N, a)))
- Q !== void 0 && je(x.argumentExpression, p.Property_0_does_not_exist_on_type_1_Did_you_mean_2, N, Hr(a), Q);
- else {
- const ye = cst(a, x, l);
- if (ye !== void 0)
- je(x, p.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, Hr(a), ye);
- else {
- let de;
- if (l.flags & 1024)
- de = vs(
- /*details*/
- void 0,
- p.Property_0_does_not_exist_on_type_1,
- "[" + Hr(l) + "]",
- Hr(a)
- );
- else if (l.flags & 8192) {
- const Ze = K0(l.symbol, x);
- de = vs(
- /*details*/
- void 0,
- p.Property_0_does_not_exist_on_type_1,
- "[" + Ze + "]",
- Hr(a)
- );
- } else l.flags & 128 || l.flags & 256 ? de = vs(
- /*details*/
- void 0,
- p.Property_0_does_not_exist_on_type_1,
- l.value,
- Hr(a)
- ) : l.flags & 12 && (de = vs(
- /*details*/
- void 0,
- p.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,
- Hr(l),
- Hr(a)
- ));
- de = vs(
- de,
- p.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,
- Hr(f),
- Hr(a)
- ), Da.add(Rg(Tr(x), x, de));
- }
- }
- }
- return;
- }
- }
- if (y & 16 && cy(a))
- return Ae;
- if (TN(a))
- return xe;
- if (m) {
- const W = hfe(m);
- if (W.kind !== 10 && l.flags & 384)
- je(W, p.Property_0_does_not_exist_on_type_1, "" + l.value, Hr(a));
- else if (l.flags & 12)
- je(W, p.Type_0_has_no_matching_index_signature_for_type_1, Hr(a), Hr(l));
- else {
- const Q = W.kind === 10 ? "bigint" : Hr(l);
- je(W, p.Type_0_cannot_be_used_as_an_index_type, Q);
- }
- }
- if (Wa(l))
- return l;
- return;
- function j(W) {
- W && W.isReadonly && x && (b0(x) || fB(x)) && je(x, p.Index_signature_in_type_0_only_permits_reading, Hr(a));
- }
- }
- function hfe(r) {
- return r.kind === 212 ? r.argumentExpression : r.kind === 199 ? r.indexType : r.kind === 167 ? r.expression : r;
- }
- function VL(r) {
- if (r.flags & 2097152) {
- let a = !1;
- for (const l of r.types)
- if (l.flags & 101248 || VL(l))
- a = !0;
- else if (!(l.flags & 524288))
- return !1;
- return a;
- }
- return !!(r.flags & 77) || pT(r);
- }
- function pT(r) {
- return !!(r.flags & 134217728) && Mi(r.types, VL) || !!(r.flags & 268435456) && VL(r.type);
- }
- function o3e(r) {
- return !!(r.flags & 402653184) && !pT(r);
- }
- function Lk(r) {
- return !!xN(r);
- }
- function dT(r) {
- return !!(xN(r) & 4194304);
- }
- function mT(r) {
- return !!(xN(r) & 8388608);
- }
- function xN(r) {
- return r.flags & 3145728 ? (r.objectFlags & 2097152 || (r.objectFlags |= 2097152 | Hu(r.types, (a, l) => a | xN(l), 0)), r.objectFlags & 12582912) : r.flags & 33554432 ? (r.objectFlags & 2097152 || (r.objectFlags |= 2097152 | xN(r.baseType) | xN(r.constraint)), r.objectFlags & 12582912) : (r.flags & 58982400 || R_(r) || A1(r) ? 4194304 : 0) | (r.flags & 63176704 || o3e(r) ? 8388608 : 0);
- }
- function s0(r, a) {
- return r.flags & 8388608 ? ctt(r, a) : r.flags & 16777216 ? ltt(r, a) : r;
- }
- function c3e(r, a, l) {
- if (r.flags & 1048576 || r.flags & 2097152 && !mfe(r)) {
- const f = lr(r.types, (m) => s0(j_(m, a), l));
- return r.flags & 2097152 || l ? ia(f) : Qn(f);
- }
- }
- function ott(r, a, l) {
- if (a.flags & 1048576) {
- const f = lr(a.types, (m) => s0(j_(r, m), l));
- return l ? ia(f) : Qn(f);
- }
- }
- function ctt(r, a) {
- const l = a ? "simplifiedForWriting" : "simplifiedForReading";
- if (r[l])
- return r[l] === to ? r : r[l];
- r[l] = to;
- const f = s0(r.objectType, a), m = s0(r.indexType, a), y = ott(f, m, a);
- if (y)
- return r[l] = y;
- if (!(m.flags & 465829888)) {
- const x = c3e(f, m, a);
- if (x)
- return r[l] = x;
- }
- if (A1(f) && m.flags & 296) {
- const x = FP(
- f,
- m.flags & 8 ? 0 : f.target.fixedLength,
- /*endSkipCount*/
- 0,
- a
- );
- if (x)
- return r[l] = x;
- }
- return R_(f) && NL(f) !== 2 ? r[l] = Xo(PG(f, r.indexType), (x) => s0(x, a)) : r[l] = r;
- }
- function ltt(r, a) {
- const l = r.checkType, f = r.extendsType, m = Qv(r), y = Yv(r);
- if (y.flags & 131072 && P1(m) === P1(l)) {
- if (l.flags & 1 || $s(hT(l), hT(f)))
- return s0(m, a);
- if (l3e(l, f))
- return Ht;
- } else if (m.flags & 131072 && P1(y) === P1(l)) {
- if (!(l.flags & 1) && $s(hT(l), hT(f)))
- return Ht;
- if (l.flags & 1 || l3e(l, f))
- return s0(y, a);
- }
- return r;
- }
- function l3e(r, a) {
- return !!(Qn([wL(r, a), Ht]).flags & 131072);
- }
- function PG(r, a) {
- const l = B_([$d(r)], [a]), f = I2(r.mapper, l), m = zi(r0(r.target || r), f), y = ZPe(r) > 0 || (Lk(r) ? CP(x2(r)) > 0 : utt(r, a));
- return cl(
- m,
- /*isProperty*/
- !0,
- y
- );
- }
- function utt(r, a) {
- const l = Kl(a);
- return !!l && ut(qa(r), (f) => !!(f.flags & 16777216) && $s(Ok(
- f,
- 8576
- /* StringOrNumberLiteralOrUnique */
- ), l));
- }
- function j_(r, a, l = 0, f, m, y) {
- return D1(r, a, l, f, m, y) || (f ? He : M);
- }
- function u3e(r, a) {
- return z_(r, (l) => {
- if (l.flags & 384) {
- const f = _p(l);
- if (qg(f)) {
- const m = +f;
- return m >= 0 && m < a;
- }
- }
- return !1;
- });
- }
- function D1(r, a, l = 0, f, m, y) {
- if (r === $e || a === $e)
- return $e;
- if (r = Qd(r), F3e(r) && !(a.flags & 98304) && eu(
- a,
- 12
- /* Number */
- ) && (a = Ie), O.noUncheckedIndexedAccess && l & 32 && (l |= 1), mT(a) || (f && f.kind !== 199 ? A1(r) && !u3e(a, ufe(r.target)) : dT(r) && !(ha(r) && u3e(a, ufe(r.target))) || R_e(r))) {
- if (r.flags & 3)
- return r;
- const N = l & 1, j = r.id + "," + a.id + "," + N + Ik(m, y);
- let W = ti.get(j);
- return W || ti.set(j, W = att(r, a, N, m, y)), W;
- }
- const x = EP(r);
- if (a.flags & 1048576 && !(a.flags & 16)) {
- const N = [];
- let j = !1;
- for (const W of a.types) {
- const Q = a3e(r, x, W, a, f, l | (j ? 128 : 0));
- if (Q)
- N.push(Q);
- else if (f)
- j = !0;
- else
- return;
- }
- return j ? void 0 : l & 4 ? ia(N, 0, m, y) : Qn(N, 1, m, y);
- }
- return a3e(
- r,
- x,
- a,
- a,
- f,
- l | 8 | 64
- /* ReportDeprecated */
- );
- }
- function _3e(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Ci(r.objectType), f = Ci(r.indexType), m = Mk(r);
- a.resolvedType = j_(l, f, 0, r, m, dE(m));
- }
- return a.resolvedType;
- }
- function yfe(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = k(32, r.symbol);
- l.declaration = r, l.aliasSymbol = Mk(r), l.aliasTypeArguments = dE(l.aliasSymbol), a.resolvedType = l, Yf(l);
- }
- return a.resolvedType;
- }
- function P1(r) {
- return r.flags & 33554432 ? P1(r.baseType) : r.flags & 8388608 && (r.objectType.flags & 33554432 || r.indexType.flags & 33554432) ? j_(P1(r.objectType), P1(r.indexType)) : r;
- }
- function f3e(r) {
- return wx(r) && Nr(r.elements) > 0 && !ut(r.elements, (a) => G5(a) || $5(a) || qC(a) && !!(a.questionToken || a.dotDotDotToken));
- }
- function p3e(r, a) {
- return Lk(r) || a && ha(r) && ut(P2(r), Lk);
- }
- function vfe(r, a, l, f, m) {
- let y, x, N = 0;
- for (; ; ) {
- if (N === 1e3)
- return je(C, p.Type_instantiation_is_excessively_deep_and_possibly_infinite), He;
- const W = zi(P1(r.checkType), a), Q = zi(r.extendsType, a);
- if (W === He || Q === He)
- return He;
- if (W === $e || Q === $e)
- return $e;
- const ye = b4(r.node.checkType), de = b4(r.node.extendsType), Ze = f3e(ye) && f3e(de) && Nr(ye.elements) === Nr(de.elements), ct = p3e(W, Ze);
- let mt;
- if (r.inferTypeParameters) {
- const sr = FN(
- r.inferTypeParameters,
- /*signature*/
- void 0,
- 0
- /* None */
- );
- a && (sr.nonFixingMapper = I2(sr.nonFixingMapper, a)), ct || u0(
- sr.inferences,
- W,
- Q,
- 1536
- /* AlwaysStrict */
- ), mt = a ? I2(sr.mapper, a) : sr.mapper;
- }
- const Gt = mt ? zi(r.extendsType, mt) : Q;
- if (!ct && !p3e(Gt, Ze)) {
- if (!(Gt.flags & 3) && (W.flags & 1 || !$s(EN(W), EN(Gt)))) {
- (W.flags & 1 || l && !(Gt.flags & 131072) && Pp(EN(Gt), (Xr) => $s(Xr, EN(W)))) && (x || (x = [])).push(zi(Ci(r.node.trueType), mt || a));
- const sr = Ci(r.node.falseType);
- if (sr.flags & 16777216) {
- const Xr = sr.root;
- if (Xr.node.parent === r.node && (!Xr.isDistributive || Xr.checkType === r.checkType)) {
- r = Xr;
- continue;
- }
- if (j(sr, a))
- continue;
- }
- y = zi(sr, a);
- break;
- }
- if (Gt.flags & 3 || $s(hT(W), hT(Gt))) {
- const sr = Ci(r.node.trueType), Xr = mt || a;
- if (j(sr, Xr))
- continue;
- y = zi(sr, Xr);
- break;
- }
- }
- y = Vd(
- 16777216
- /* Conditional */
- ), y.root = r, y.checkType = zi(r.checkType, a), y.extendsType = zi(r.extendsType, a), y.mapper = a, y.combinedMapper = mt, y.aliasSymbol = f || r.aliasSymbol, y.aliasTypeArguments = f ? m : gh(r.aliasTypeArguments, a);
- break;
- }
- return x ? Qn(wr(x, y)) : y;
- function j(W, Q) {
- if (W.flags & 16777216 && Q) {
- const ye = W.root;
- if (ye.outerTypeParameters) {
- const de = I2(W.mapper, Q), Ze = lr(ye.outerTypeParameters, (Gt) => ay(Gt, de)), ct = B_(ye.outerTypeParameters, Ze), mt = ye.isDistributive ? ay(ye.checkType, ct) : void 0;
- if (!mt || mt === ye.checkType || !(mt.flags & 1179648))
- return r = ye, a = ct, f = void 0, m = void 0, ye.aliasSymbol && N++, !0;
- }
- }
- return !1;
- }
- }
- function Qv(r) {
- return r.resolvedTrueType || (r.resolvedTrueType = zi(Ci(r.root.node.trueType), r.mapper));
- }
- function Yv(r) {
- return r.resolvedFalseType || (r.resolvedFalseType = zi(Ci(r.root.node.falseType), r.mapper));
- }
- function _tt(r) {
- return r.resolvedInferredTrueType || (r.resolvedInferredTrueType = r.combinedMapper ? zi(Ci(r.root.node.trueType), r.combinedMapper) : Qv(r));
- }
- function bfe(r) {
- let a;
- return r.locals && r.locals.forEach((l) => {
- l.flags & 262144 && (a = wr(a, bo(l)));
- }), a;
- }
- function ftt(r) {
- return r.isDistributive && (XL(r.checkType, r.node.trueType) || XL(r.checkType, r.node.falseType));
- }
- function ptt(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Ci(r.checkType), f = Mk(r), m = dE(f), y = sE(
- r,
- /*includeThisTypes*/
- !0
- ), x = m ? y : Ln(y, (j) => XL(j, r)), N = {
- node: r,
- checkType: l,
- extendsType: Ci(r.extendsType),
- isDistributive: !!(l.flags & 262144),
- inferTypeParameters: bfe(r),
- outerTypeParameters: x,
- instantiations: void 0,
- aliasSymbol: f,
- aliasTypeArguments: m
- };
- a.resolvedType = vfe(
- N,
- /*mapper*/
- void 0,
- /*forConstraint*/
- !1
- ), x && (N.instantiations = /* @__PURE__ */ new Map(), N.instantiations.set(sd(x), a.resolvedType));
- }
- return a.resolvedType;
- }
- function dtt(r) {
- const a = bn(r);
- return a.resolvedType || (a.resolvedType = T2(Tn(r.typeParameter))), a.resolvedType;
- }
- function d3e(r) {
- return Oe(r) ? [r] : wr(d3e(r.left), r.right);
- }
- function m3e(r) {
- var a;
- const l = bn(r);
- if (!l.resolvedType) {
- if (!h0(r))
- return je(r.argument, p.String_literal_expected), l.resolvedSymbol = ze, l.resolvedType = He;
- const f = r.isTypeOf ? 111551 : r.flags & 16777216 ? 900095 : 788968, m = v_(r, r.argument.literal);
- if (!m)
- return l.resolvedSymbol = ze, l.resolvedType = He;
- const y = !!((a = m.exports) != null && a.get(
- "export="
- /* ExportEquals */
- )), x = M_(
- m,
- /*dontResolveAlias*/
- !1
- );
- if (rc(r.qualifier))
- if (x.flags & f)
- l.resolvedType = g3e(r, l, x, f);
- else {
- const N = f === 111551 ? p.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : p.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;
- je(r, N, r.argument.literal.text), l.resolvedSymbol = ze, l.resolvedType = He;
- }
- else {
- const N = d3e(r.qualifier);
- let j = x, W;
- for (; W = N.shift(); ) {
- const Q = N.length ? 1920 : f, ye = Ra(Mc(j)), de = r.isTypeOf || cn(r) && y ? Gs(
- nn(ye),
- W.escapedText,
- /*skipObjectFunctionPropertyAugment*/
- !1,
- /*includeTypeOnlyMembers*/
- !0
- ) : void 0, ct = (r.isTypeOf ? void 0 : Al(n_(ye), W.escapedText, Q)) ?? de;
- if (!ct)
- return je(W, p.Namespace_0_has_no_exported_member_1, K0(j), _o(W)), l.resolvedType = He;
- bn(W).resolvedSymbol = ct, bn(W.parent).resolvedSymbol = ct, j = ct;
- }
- l.resolvedType = g3e(r, l, j, f);
- }
- }
- return l.resolvedType;
- }
- function g3e(r, a, l, f) {
- const m = Mc(l);
- return a.resolvedSymbol = m, f === 111551 ? sNe(nn(l), r) : xG(r, m);
- }
- function h3e(r) {
- const a = bn(r);
- if (!a.resolvedType) {
- const l = Mk(r);
- if (k1(r.symbol).size === 0 && !l)
- a.resolvedType = Yi;
- else {
- let f = k(16, r.symbol);
- f.aliasSymbol = l, f.aliasTypeArguments = dE(l), bS(r) && r.isArrayType && (f = du(f)), a.resolvedType = f;
- }
- }
- return a.resolvedType;
- }
- function Mk(r) {
- let a = r.parent;
- for (; dS(a) || pv(a) || cv(a) && a.operator === 148; )
- a = a.parent;
- return _3(a) ? Tn(a) : void 0;
- }
- function dE(r) {
- return r ? vd(r) : void 0;
- }
- function wG(r) {
- return !!(r.flags & 524288) && !R_(r);
- }
- function Sfe(r) {
- return a0(r) || !!(r.flags & 474058748);
- }
- function Tfe(r, a) {
- if (!(r.flags & 1048576))
- return r;
- if (Mi(r.types, Sfe))
- return On(r.types, a0) || xs;
- const l = On(r.types, (y) => !Sfe(y));
- if (!l || On(r.types, (y) => y !== l && !Sfe(y)))
- return r;
- return m(l);
- function m(y) {
- const x = Js();
- for (const j of qa(y))
- if (!(lp(j) & 6)) {
- if (AG(j)) {
- const W = j.flags & 65536 && !(j.flags & 32768), ye = fa(16777220, j.escapedName, A_e(j) | (a ? 8 : 0));
- ye.links.type = W ? Ae : cl(
- nn(j),
- /*isProperty*/
- !0
- ), ye.declarations = j.declarations, ye.links.nameType = Bi(j).nameType, ye.links.syntheticOrigin = j, x.set(j.escapedName, ye);
- }
- }
- const N = Li(y.symbol, x, Ue, Ue, wu(y));
- return N.objectFlags |= 131200, N;
- }
- }
- function w2(r, a, l, f, m) {
- if (r.flags & 1 || a.flags & 1)
- return xe;
- if (r.flags & 2 || a.flags & 2)
- return M;
- if (r.flags & 131072)
- return a;
- if (a.flags & 131072)
- return r;
- if (r = Tfe(r, m), r.flags & 1048576)
- return UL([r, a]) ? Xo(r, (W) => w2(W, a, l, f, m)) : He;
- if (a = Tfe(a, m), a.flags & 1048576)
- return UL([r, a]) ? Xo(a, (W) => w2(r, W, l, f, m)) : He;
- if (a.flags & 473960444)
- return r;
- if (dT(r) || dT(a)) {
- if (a0(r))
- return a;
- if (r.flags & 2097152) {
- const W = r.types, Q = W[W.length - 1];
- if (wG(Q) && wG(a))
- return ia(Qi(W.slice(0, W.length - 1), [w2(Q, a, l, f, m)]));
- }
- return ia([r, a]);
- }
- const y = Js(), x = /* @__PURE__ */ new Set(), N = r === xs ? wu(a) : GPe([r, a]);
- for (const W of qa(a))
- lp(W) & 6 ? x.add(W.escapedName) : AG(W) && y.set(W.escapedName, xfe(W, m));
- for (const W of qa(r))
- if (!(x.has(W.escapedName) || !AG(W)))
- if (y.has(W.escapedName)) {
- const Q = y.get(W.escapedName), ye = nn(Q);
- if (Q.flags & 16777216) {
- const de = Qi(W.declarations, Q.declarations), Ze = 4 | W.flags & 16777216, ct = fa(Ze, W.escapedName), mt = nn(W), Gt = XG(mt), sr = XG(ye);
- ct.links.type = Gt === sr ? mt : Qn(
- [mt, sr],
- 2
- /* Subtype */
- ), ct.links.leftSpread = W, ct.links.rightSpread = Q, ct.declarations = de, ct.links.nameType = Bi(W).nameType, y.set(W.escapedName, ct);
- }
- } else
- y.set(W.escapedName, xfe(W, m));
- const j = Li(l, y, Ue, Ue, qc(N, (W) => mtt(W, m)));
- return j.objectFlags |= 2228352 | f, j;
- }
- function AG(r) {
- var a;
- return !ut(r.declarations, Ou) && (!(r.flags & 106496) || !((a = r.declarations) != null && a.some((l) => Zn(l.parent))));
- }
- function xfe(r, a) {
- const l = r.flags & 65536 && !(r.flags & 32768);
- if (!l && a === em(r))
- return r;
- const f = 4 | r.flags & 16777216, m = fa(f, r.escapedName, A_e(r) | (a ? 8 : 0));
- return m.links.type = l ? Ae : nn(r), m.declarations = r.declarations, m.links.nameType = Bi(r).nameType, m.links.syntheticOrigin = r, m;
- }
- function mtt(r, a) {
- return r.isReadonly !== a ? Cg(r.keyType, r.type, a, r.declaration) : r;
- }
- function qL(r, a, l, f) {
- const m = id(r, l);
- return m.value = a, m.regularType = f || m, m;
- }
- function Rk(r) {
- if (r.flags & 2976) {
- if (!r.freshType) {
- const a = qL(r.flags, r.value, r.symbol, r);
- a.freshType = a, r.freshType = a;
- }
- return r.freshType;
- }
- return r;
- }
- function Vu(r) {
- return r.flags & 2976 ? r.regularType : r.flags & 1048576 ? r.regularType || (r.regularType = Xo(r, Vu)) : r;
- }
- function A2(r) {
- return !!(r.flags & 2976) && r.freshType === r;
- }
- function S_(r) {
- let a;
- return Fe.get(r) || (Fe.set(r, a = qL(128, r)), a);
- }
- function bd(r) {
- let a;
- return Ot.get(r) || (Ot.set(r, a = qL(256, r)), a);
- }
- function HL(r) {
- let a;
- const l = Ib(r);
- return Ar.get(l) || (Ar.set(l, a = qL(2048, r)), a);
- }
- function gtt(r, a, l) {
- let f;
- const m = `${a}${typeof r == "string" ? "@" : "#"}${r}`, y = 1024 | (typeof r == "string" ? 128 : 256);
- return mn.get(m) || (mn.set(m, f = qL(y, r, l)), f);
- }
- function htt(r) {
- if (r.literal.kind === 106)
- return ht;
- const a = bn(r);
- return a.resolvedType || (a.resolvedType = Vu(Gi(r.literal))), a.resolvedType;
- }
- function ytt(r) {
- const a = id(8192, r);
- return a.escapedName = `__@${a.symbol.escapedName}@${na(a.symbol)}`, a;
- }
- function kfe(r) {
- if (cn(r) && pv(r)) {
- const a = xb(r);
- a && (r = rx(a) || a);
- }
- if (EZ(r)) {
- const a = g7(r) ? i_(r.left) : i_(r);
- if (a) {
- const l = Bi(a);
- return l.uniqueESSymbolType || (l.uniqueESSymbolType = ytt(a));
- }
- }
- return jt;
- }
- function vtt(r) {
- const a = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- ), l = a && a.parent;
- if (l && (Zn(l) || l.kind === 264) && !zs(a) && (!Qo(a) || kb(r, a.body)))
- return b_(Tn(l)).thisType;
- if (l && Ks(l) && dn(l.parent) && Cc(l.parent) === 6)
- return b_(i_(l.parent.left).parent).thisType;
- const f = r.flags & 16777216 ? ev(r) : void 0;
- return f && vo(f) && dn(f.parent) && Cc(f.parent) === 3 ? b_(i_(f.parent.left).parent).thisType : qm(a) && kb(r, a.body) ? b_(Tn(a)).thisType : (je(r, p.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface), He);
- }
- function Cfe(r) {
- const a = bn(r);
- return a.resolvedType || (a.resolvedType = vtt(r)), a.resolvedType;
- }
- function y3e(r) {
- return Ci(GL(r.type) || r.type);
- }
- function GL(r) {
- switch (r.kind) {
- case 196:
- return GL(r.type);
- case 189:
- if (r.elements.length === 1 && (r = r.elements[0], r.kind === 191 || r.kind === 202 && r.dotDotDotToken))
- return GL(r.type);
- break;
- case 188:
- return r.elementType;
- }
- }
- function btt(r) {
- const a = bn(r);
- return a.resolvedType || (a.resolvedType = r.dotDotDotToken ? y3e(r) : cl(
- Ci(r.type),
- /*isProperty*/
- !0,
- !!r.questionToken
- ));
- }
- function Ci(r) {
- return $Ke(v3e(r), r);
- }
- function v3e(r) {
- switch (r.kind) {
- case 133:
- case 312:
- case 313:
- return xe;
- case 159:
- return M;
- case 154:
- return Ie;
- case 150:
- return At;
- case 163:
- return Dr;
- case 136:
- return wt;
- case 155:
- return jt;
- case 116:
- return Xt;
- case 157:
- return Ae;
- case 106:
- return ht;
- case 146:
- return Ht;
- case 151:
- return r.flags & 524288 && !ie ? xe : Kt;
- case 141:
- return vn;
- case 197:
- case 110:
- return Cfe(r);
- case 201:
- return htt(r);
- case 183:
- return jL(r);
- case 182:
- return r.assertsModifier ? Xt : wt;
- case 233:
- return jL(r);
- case 186:
- return Dwe(r);
- case 188:
- case 189:
- return Pet(r);
- case 190:
- return Iet(r);
- case 192:
- return zet(r);
- case 193:
- return Xet(r);
- case 314:
- return XKe(r);
- case 316:
- return cl(Ci(r.type));
- case 202:
- return btt(r);
- case 196:
- case 315:
- case 309:
- return Ci(r.type);
- case 191:
- return y3e(r);
- case 318:
- return wlt(r);
- case 184:
- case 185:
- case 187:
- case 322:
- case 317:
- case 323:
- return h3e(r);
- case 198:
- return ett(r);
- case 199:
- return _3e(r);
- case 200:
- return yfe(r);
- case 194:
- return ptt(r);
- case 195:
- return dtt(r);
- case 203:
- return ttt(r);
- case 205:
- return m3e(r);
- case 80:
- case 166:
- case 211:
- const a = od(r);
- return a ? bo(a) : He;
- default:
- return He;
- }
- }
- function NG(r, a, l) {
- if (r && r.length)
- for (let f = 0; f < r.length; f++) {
- const m = r[f], y = l(m, a);
- if (m !== y) {
- const x = f === 0 ? [] : r.slice(0, f);
- for (x.push(y), f++; f < r.length; f++)
- x.push(l(r[f], a));
- return x;
- }
- }
- return r;
- }
- function gh(r, a) {
- return NG(r, a, zi);
- }
- function IG(r, a) {
- return NG(r, a, jk);
- }
- function b3e(r, a) {
- return NG(r, a, Ott);
- }
- function B_(r, a) {
- return r.length === 1 ? N2(r[0], a ? a[0] : xe) : Stt(r, a);
- }
- function ay(r, a) {
- switch (a.kind) {
- case 0:
- return r === a.source ? a.target : r;
- case 1: {
- const f = a.sources, m = a.targets;
- for (let y = 0; y < f.length; y++)
- if (r === f[y])
- return m ? m[y] : xe;
- return r;
- }
- case 2: {
- const f = a.sources, m = a.targets;
- for (let y = 0; y < f.length; y++)
- if (r === f[y])
- return m[y]();
- return r;
- }
- case 3:
- return a.func(r);
- case 4:
- case 5:
- const l = ay(r, a.mapper1);
- return l !== r && a.kind === 4 ? zi(l, a.mapper2) : ay(l, a.mapper2);
- }
- }
- function N2(r, a) {
- return E.attachDebugPrototypeIfDebug({ kind: 0, source: r, target: a });
- }
- function Stt(r, a) {
- return E.attachDebugPrototypeIfDebug({ kind: 1, sources: r, targets: a });
- }
- function $L(r, a) {
- return E.attachDebugPrototypeIfDebug({ kind: 3, func: r, debugInfo: E.isDebugging ? a : void 0 });
- }
- function Efe(r, a) {
- return E.attachDebugPrototypeIfDebug({ kind: 2, sources: r, targets: a });
- }
- function OG(r, a, l) {
- return E.attachDebugPrototypeIfDebug({ kind: r, mapper1: a, mapper2: l });
- }
- function S3e(r) {
- return B_(
- r,
- /*targets*/
- void 0
- );
- }
- function Ttt(r, a) {
- const l = r.inferences.slice(a);
- return B_(lr(l, (f) => f.typeParameter), lr(l, () => M));
- }
- function I2(r, a) {
- return r ? OG(4, r, a) : a;
- }
- function xtt(r, a) {
- return r ? OG(5, r, a) : a;
- }
- function gT(r, a, l) {
- return l ? OG(5, N2(r, a), l) : N2(r, a);
- }
- function kN(r, a, l) {
- return r ? OG(5, r, N2(a, l)) : N2(a, l);
- }
- function ktt(r) {
- return !r.constraint && !SG(r) || r.constraint === Bt ? r : r.restrictiveInstantiation || (r.restrictiveInstantiation = pt(r.symbol), r.restrictiveInstantiation.constraint = Bt, r.restrictiveInstantiation);
- }
- function Dfe(r) {
- const a = pt(r.symbol);
- return a.target = r, a;
- }
- function Ctt(r, a) {
- return yN(r.kind, r.parameterName, r.parameterIndex, zi(r.type, a));
- }
- function jk(r, a, l) {
- let f;
- if (r.typeParameters && !l) {
- f = lr(r.typeParameters, Dfe), a = I2(B_(r.typeParameters, f), a);
- for (const y of f)
- y.mapper = a;
- }
- const m = ph(
- r.declaration,
- f,
- r.thisParameter && Pfe(r.thisParameter, a),
- NG(r.parameters, a, Pfe),
- /*resolvedReturnType*/
- void 0,
- /*resolvedTypePredicate*/
- void 0,
- r.minArgumentCount,
- r.flags & 167
- /* PropagatingFlags */
- );
- return m.target = r, m.mapper = a, m;
- }
- function Pfe(r, a) {
- const l = Bi(r);
- if (l.type && !I1(l.type) && (!(r.flags & 65536) || l.writeType && !I1(l.writeType)))
- return r;
- gc(r) & 1 && (r = l.target, a = I2(l.mapper, a));
- const f = fa(r.flags, r.escapedName, 1 | gc(r) & 53256);
- return f.declarations = r.declarations, f.parent = r.parent, f.links.target = r, f.links.mapper = a, r.valueDeclaration && (f.valueDeclaration = r.valueDeclaration), l.nameType && (f.links.nameType = l.nameType), f;
- }
- function Ett(r, a, l, f) {
- const m = r.objectFlags & 4 || r.objectFlags & 8388608 ? r.node : r.symbol.declarations[0], y = bn(m), x = r.objectFlags & 4 ? y.resolvedType : r.objectFlags & 64 ? r.target : r;
- let N = r.objectFlags & 134217728 ? r.outerTypeParameters : y.outerTypeParameters;
- if (!N) {
- let j = sE(
- m,
- /*includeThisTypes*/
- !0
- );
- if (qm(m)) {
- const Q = uwe(m);
- j = Fn(j, Q);
- }
- N = j || Ue;
- const W = r.objectFlags & 8388612 ? [m] : r.symbol.declarations;
- N = (x.objectFlags & 8388612 || x.symbol.flags & 8192 || x.symbol.flags & 2048) && !x.aliasTypeArguments ? Ln(N, (Q) => ut(W, (ye) => XL(Q, ye))) : N, y.outerTypeParameters = N;
- }
- if (N.length) {
- const j = I2(r.mapper, a), W = lr(N, (ct) => ay(ct, j)), Q = l || r.aliasSymbol, ye = l ? f : gh(r.aliasTypeArguments, a), de = (r.objectFlags & 134217728 ? "S" : "") + sd(W) + Ik(Q, ye);
- x.instantiations || (x.instantiations = /* @__PURE__ */ new Map(), x.instantiations.set(sd(N) + Ik(x.aliasSymbol, x.aliasTypeArguments), x));
- let Ze = x.instantiations.get(de);
- if (!Ze) {
- if (r.objectFlags & 134217728)
- return Ze = FG(r, a), x.instantiations.set(de, Ze), Ze;
- const ct = B_(N, W);
- Ze = x.objectFlags & 4 ? X_e(r.target, r.node, ct, Q, ye) : x.objectFlags & 32 ? Ptt(x, ct, Q, ye) : FG(x, ct, Q, ye), x.instantiations.set(de, Ze);
- const mt = wn(Ze);
- if (Ze.flags & 3899393 && !(mt & 524288)) {
- const Gt = ut(W, I1);
- wn(Ze) & 524288 || (mt & 52 ? Ze.objectFlags |= 524288 | (Gt ? 1048576 : 0) : Ze.objectFlags |= Gt ? 0 : 524288);
- }
- }
- return Ze;
- }
- return r;
- }
- function Dtt(r) {
- return !(r.parent.kind === 183 && r.parent.typeArguments && r === r.parent.typeName || r.parent.kind === 205 && r.parent.typeArguments && r === r.parent.qualifier);
- }
- function XL(r, a) {
- if (r.symbol && r.symbol.declarations && r.symbol.declarations.length === 1) {
- const f = r.symbol.declarations[0].parent;
- for (let m = a; m !== f; m = m.parent)
- if (!m || m.kind === 241 || m.kind === 194 && bs(m.extendsType, l))
- return !0;
- return l(a);
- }
- return !0;
- function l(f) {
- switch (f.kind) {
- case 197:
- return !!r.isThisType;
- case 80:
- return !r.isThisType && um(f) && Dtt(f) && v3e(f) === r;
- case 186:
- const m = f.exprName, y = E_(m);
- if (!Ly(y)) {
- const x = Nu(y), N = r.symbol.declarations[0], j = N.kind === 168 ? N.parent : (
- // Type parameter is a regular type parameter, e.g. foo
- r.isThisType ? N : (
- // Type parameter is the this type, and its declaration is the class declaration.
- void 0
- )
- );
- if (x.declarations && j)
- return ut(x.declarations, (W) => kb(W, j)) || ut(f.typeArguments, l);
- }
- return !0;
- case 174:
- case 173:
- return !f.type && !!f.body || ut(f.typeParameters, l) || ut(f.parameters, l) || !!f.type && l(f.type);
- }
- return !!bs(f, l);
- }
- }
- function CN(r) {
- const a = Yf(r);
- if (a.flags & 4194304) {
- const l = P1(a.type);
- if (l.flags & 262144)
- return l;
- }
- }
- function Ptt(r, a, l, f) {
- const m = CN(r);
- if (m) {
- const x = zi(m, a);
- if (m !== x)
- return EAe(Qd(x), y, l, f);
- }
- return zi(Yf(r), a) === $e ? $e : FG(r, a, l, f);
- function y(x) {
- if (x.flags & 61603843 && x !== $e && !H(x)) {
- if (!r.declaration.nameType) {
- let N;
- if (Dp(x) || x.flags & 1 && b1(
- m,
- 4
- /* ImmediateBaseConstraint */
- ) < 0 && (N = s_(m)) && z_(N, Kv))
- return Att(x, r, gT(m, x, a));
- if (ha(x))
- return wtt(x, r, m, a);
- if (iwe(x))
- return ia(lr(x.types, y));
- }
- return FG(r, gT(m, x, a));
- }
- return x;
- }
- }
- function T3e(r, a) {
- return a & 1 ? !0 : a & 2 ? !1 : r;
- }
- function wtt(r, a, l, f) {
- const m = r.target.elementFlags, y = r.target.fixedLength, x = y ? gT(l, r, f) : f, N = lr(P2(r), (ye, de) => {
- const Ze = m[de];
- return de < y ? x3e(a, S_("" + de), !!(Ze & 2), x) : Ze & 8 ? zi(a, gT(l, ye, f)) : iM(zi(a, gT(l, du(ye), f))) ?? M;
- }), j = xg(a), W = j & 4 ? lr(m, (ye) => ye & 1 ? 2 : ye) : j & 8 ? lr(m, (ye) => ye & 2 ? 1 : ye) : m, Q = T3e(r.target.readonly, xg(a));
- return ss(N, He) ? He : Eg(N, W, Q, r.target.labeledElementDeclarations);
- }
- function Att(r, a, l) {
- const f = x3e(
- a,
- At,
- /*isOptional*/
- !0,
- l
- );
- return H(f) ? He : du(f, T3e(IP(r), xg(a)));
- }
- function x3e(r, a, l, f) {
- const m = kN(f, $d(r), a), y = zi(r0(r.target || r), m), x = xg(r);
- return ee && x & 4 && !bc(
- y,
- 49152
- /* Void */
- ) ? N1(
- y,
- /*isProperty*/
- !0
- ) : ee && x & 8 && l ? ad(
- y,
- 524288
- /* NEUndefined */
- ) : y;
- }
- function FG(r, a, l, f) {
- E.assert(r.symbol, "anonymous type must have symbol to be instantiated");
- const m = k(r.objectFlags & -1572865 | 64, r.symbol);
- if (r.objectFlags & 32) {
- m.declaration = r.declaration;
- const y = $d(r), x = Dfe(y);
- m.typeParameter = x, a = I2(N2(y, x), a), x.mapper = a;
- }
- return r.objectFlags & 8388608 && (m.node = r.node), r.objectFlags & 134217728 && (m.outerTypeParameters = r.outerTypeParameters), m.target = r, m.mapper = a, m.aliasSymbol = l || r.aliasSymbol, m.aliasTypeArguments = l ? f : gh(r.aliasTypeArguments, a), m.objectFlags |= m.aliasTypeArguments ? RL(m.aliasTypeArguments) : 0, m;
- }
- function wfe(r, a, l, f, m) {
- const y = r.root;
- if (y.outerTypeParameters) {
- const x = lr(y.outerTypeParameters, (W) => ay(W, a)), N = (l ? "C" : "") + sd(x) + Ik(f, m);
- let j = y.instantiations.get(N);
- if (!j) {
- const W = B_(y.outerTypeParameters, x), Q = y.checkType, ye = y.isDistributive ? Qd(ay(Q, W)) : void 0;
- j = ye && Q !== ye && ye.flags & 1179648 ? EAe(ye, (de) => vfe(y, gT(Q, de, W), l), f, m) : vfe(y, W, l, f, m), y.instantiations.set(N, j);
- }
- return j;
- }
- return r;
- }
- function zi(r, a) {
- return r && a ? k3e(
- r,
- a,
- /*aliasSymbol*/
- void 0,
- /*aliasTypeArguments*/
- void 0
- ) : r;
- }
- function k3e(r, a, l, f) {
- var m;
- if (!I1(r))
- return r;
- if (S === 100 || h >= 5e6)
- return (m = rn) == null || m.instant(rn.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: r.id, instantiationDepth: S, instantiationCount: h }), je(C, p.Type_instantiation_is_excessively_deep_and_possibly_infinite), He;
- g++, h++, S++;
- const y = Ntt(r, a, l, f);
- return S--, y;
- }
- function Ntt(r, a, l, f) {
- const m = r.flags;
- if (m & 262144)
- return ay(r, a);
- if (m & 524288) {
- const y = r.objectFlags;
- if (y & 52) {
- if (y & 4 && !r.node) {
- const x = r.resolvedTypeArguments, N = gh(x, a);
- return N !== x ? cfe(r.target, N) : r;
- }
- return y & 1024 ? Itt(r, a) : Ett(r, a, l, f);
- }
- return r;
- }
- if (m & 3145728) {
- const y = r.flags & 1048576 ? r.origin : void 0, x = y && y.flags & 3145728 ? y.types : r.types, N = gh(x, a);
- if (N === x && l === r.aliasSymbol)
- return r;
- const j = l || r.aliasSymbol, W = l ? f : gh(r.aliasTypeArguments, a);
- return m & 2097152 || y && y.flags & 2097152 ? ia(N, 0, j, W) : Qn(N, 1, j, W);
- }
- if (m & 4194304)
- return Jm(zi(r.type, a));
- if (m & 134217728)
- return fT(r.texts, gh(r.types, a));
- if (m & 268435456)
- return Fk(r.symbol, zi(r.type, a));
- if (m & 8388608) {
- const y = l || r.aliasSymbol, x = l ? f : gh(r.aliasTypeArguments, a);
- return j_(
- zi(r.objectType, a),
- zi(r.indexType, a),
- r.accessFlags,
- /*accessNode*/
- void 0,
- y,
- x
- );
- }
- if (m & 16777216)
- return wfe(
- r,
- I2(r.mapper, a),
- /*forConstraint*/
- !1,
- l,
- f
- );
- if (m & 33554432) {
- const y = zi(r.baseType, a);
- if (fE(r))
- return Q_e(y);
- const x = zi(r.constraint, a);
- return y.flags & 8650752 && Lk(x) ? Z_e(y, x) : x.flags & 3 || $s(hT(y), hT(x)) ? y : y.flags & 8650752 ? Z_e(y, x) : ia([x, y]);
- }
- return r;
- }
- function Itt(r, a) {
- const l = zi(r.mappedType, a);
- if (!(wn(l) & 32))
- return r;
- const f = zi(r.constraintType, a);
- if (!(f.flags & 4194304))
- return r;
- const m = nAe(
- zi(r.source, a),
- l,
- f
- );
- return m || r;
- }
- function EN(r) {
- return r.flags & 402915327 ? r : r.permissiveInstantiation || (r.permissiveInstantiation = zi(r, lc));
- }
- function hT(r) {
- return r.flags & 402915327 ? r : (r.restrictiveInstantiation || (r.restrictiveInstantiation = zi(r, Ua), r.restrictiveInstantiation.restrictiveInstantiation = r.restrictiveInstantiation), r.restrictiveInstantiation);
- }
- function Ott(r, a) {
- return Cg(r.keyType, zi(r.type, a), r.isReadonly, r.declaration);
- }
- function Kf(r) {
- switch (E.assert(r.kind !== 174 || jp(r)), r.kind) {
- case 218:
- case 219:
- case 174:
- case 262:
- return C3e(r);
- case 210:
- return ut(r.properties, Kf);
- case 209:
- return ut(r.elements, Kf);
- case 227:
- return Kf(r.whenTrue) || Kf(r.whenFalse);
- case 226:
- return (r.operatorToken.kind === 57 || r.operatorToken.kind === 61) && (Kf(r.left) || Kf(r.right));
- case 303:
- return Kf(r.initializer);
- case 217:
- return Kf(r.expression);
- case 292:
- return ut(r.properties, Kf) || xm(r.parent) && ut(r.parent.parent.children, Kf);
- case 291: {
- const { initializer: a } = r;
- return !!a && Kf(a);
- }
- case 294: {
- const { expression: a } = r;
- return !!a && Kf(a);
- }
- }
- return !1;
- }
- function C3e(r) {
- return P5(r) || Ftt(r);
- }
- function Ftt(r) {
- return r.typeParameters || Y_(r) || !r.body ? !1 : r.body.kind !== 241 ? Kf(r.body) : !!y0(r.body, (a) => !!a.expression && Kf(a.expression));
- }
- function LG(r) {
- return (Wy(r) || jp(r)) && C3e(r);
- }
- function E3e(r) {
- if (r.flags & 524288) {
- const a = Xd(r);
- if (a.constructSignatures.length || a.callSignatures.length) {
- const l = k(16, r.symbol);
- return l.members = a.members, l.properties = a.properties, l.callSignatures = Ue, l.constructSignatures = Ue, l.indexInfos = Ue, l;
- }
- } else if (r.flags & 2097152)
- return ia(lr(r.types, E3e));
- return r;
- }
- function hh(r, a) {
- return zm(r, a, I_);
- }
- function DN(r, a) {
- return zm(r, a, I_) ? -1 : 0;
- }
- function Afe(r, a) {
- return zm(r, a, lf) ? -1 : 0;
- }
- function Ltt(r, a) {
- return zm(r, a, sh) ? -1 : 0;
- }
- function O2(r, a) {
- return zm(r, a, sh);
- }
- function QL(r, a) {
- return zm(r, a, Hf);
- }
- function $s(r, a) {
- return zm(r, a, lf);
- }
- function Zv(r, a) {
- return r.flags & 1048576 ? Mi(r.types, (l) => Zv(l, a)) : a.flags & 1048576 ? ut(a.types, (l) => Zv(r, l)) : r.flags & 2097152 ? ut(r.types, (l) => Zv(l, a)) : r.flags & 58982400 ? Zv(Kl(r) || M, a) : Dg(a) ? !!(r.flags & 67633152) : a === Lc ? !!(r.flags & 67633152) && !Dg(r) : a === al ? !!(r.flags & 524288) && upe(r) : iE(r, cT(a)) || Dp(a) && !IP(a) && Zv(r, Lr);
- }
- function MG(r, a) {
- return zm(r, a, uf);
- }
- function YL(r, a) {
- return MG(r, a) || MG(a, r);
- }
- function Au(r, a, l, f, m, y) {
- return Ep(r, a, lf, l, f, m, y);
- }
- function w1(r, a, l, f, m, y) {
- return Nfe(
- r,
- a,
- lf,
- l,
- f,
- m,
- y,
- /*errorOutputContainer*/
- void 0
- );
- }
- function Nfe(r, a, l, f, m, y, x, N) {
- return zm(r, a, l) ? !0 : !f || !PN(m, r, a, l, y, x, N) ? Ep(r, a, l, f, y, x, N) : !1;
- }
- function D3e(r) {
- return !!(r.flags & 16777216 || r.flags & 2097152 && ut(r.types, D3e));
- }
- function PN(r, a, l, f, m, y, x) {
- if (!r || D3e(l)) return !1;
- if (!Ep(
- a,
- l,
- f,
- /*errorNode*/
- void 0
- ) && Mtt(r, a, l, f, m, y, x))
- return !0;
- switch (r.kind) {
- case 234:
- if (!yJ(r))
- break;
- case 294:
- case 217:
- return PN(r.expression, a, l, f, m, y, x);
- case 226:
- switch (r.operatorToken.kind) {
- case 64:
- case 28:
- return PN(r.right, a, l, f, m, y, x);
- }
- break;
- case 210:
- return Vtt(r, a, l, f, y, x);
- case 209:
- return Wtt(r, a, l, f, y, x);
- case 292:
- return ztt(r, a, l, f, y, x);
- case 219:
- return Rtt(r, a, l, f, y, x);
- }
- return !1;
- }
- function Mtt(r, a, l, f, m, y, x) {
- const N = Ns(
- a,
- 0
- /* Call */
- ), j = Ns(
- a,
- 1
- /* Construct */
- );
- for (const W of [j, N])
- if (ut(W, (Q) => {
- const ye = Ha(Q);
- return !(ye.flags & 131073) && Ep(
- ye,
- l,
- f,
- /*errorNode*/
- void 0
- );
- })) {
- const Q = x || {};
- Au(a, l, r, m, y, Q);
- const ye = Q.errors[Q.errors.length - 1];
- return Rs(
- ye,
- Kr(
- r,
- W === j ? p.Did_you_mean_to_use_new_with_this_expression : p.Did_you_mean_to_call_this_expression
- )
- ), !0;
- }
- return !1;
- }
- function Rtt(r, a, l, f, m, y) {
- if (Cs(r.body) || ut(r.parameters, YI))
- return !1;
- const x = ET(a);
- if (!x)
- return !1;
- const N = Ns(
- l,
- 0
- /* Call */
- );
- if (!Nr(N))
- return !1;
- const j = r.body, W = Ha(x), Q = Qn(lr(N, Ha));
- if (!Ep(
- W,
- Q,
- f,
- /*errorNode*/
- void 0
- )) {
- const ye = j && PN(
- j,
- W,
- Q,
- f,
- /*headMessage*/
- void 0,
- m,
- y
- );
- if (ye)
- return ye;
- const de = y || {};
- if (Ep(
- W,
- Q,
- f,
- j,
- /*headMessage*/
- void 0,
- m,
- de
- ), de.errors)
- return l.symbol && Nr(l.symbol.declarations) && Rs(
- de.errors[de.errors.length - 1],
- Kr(
- l.symbol.declarations[0],
- p.The_expected_type_comes_from_the_return_type_of_this_signature
- )
- ), !(Jc(r) & 2) && !Rc(W, "then") && Ep(
- LM(W),
- Q,
- f,
- /*errorNode*/
- void 0
- ) && Rs(
- de.errors[de.errors.length - 1],
- Kr(
- r,
- p.Did_you_mean_to_mark_this_function_as_async
- )
- ), !0;
- }
- return !1;
- }
- function P3e(r, a, l) {
- const f = D1(a, l);
- if (f)
- return f;
- if (a.flags & 1048576) {
- const m = R3e(r, a);
- if (m)
- return D1(m, l);
- }
- }
- function w3e(r, a) {
- vM(
- r,
- a,
- /*isCache*/
- !1
- );
- const l = zP(
- r,
- 1
- /* Contextual */
- );
- return BN(), l;
- }
- function ZL(r, a, l, f, m, y) {
- let x = !1;
- for (const N of r) {
- const { errorNode: j, innerExpression: W, nameType: Q, errorMessage: ye } = N;
- let de = P3e(a, l, Q);
- if (!de || de.flags & 8388608) continue;
- let Ze = D1(a, Q);
- if (!Ze) continue;
- const ct = DG(
- Q,
- /*accessNode*/
- void 0
- );
- if (!Ep(
- Ze,
- de,
- f,
- /*errorNode*/
- void 0
- )) {
- const mt = W && PN(
- W,
- Ze,
- de,
- f,
- /*headMessage*/
- void 0,
- m,
- y
- );
- if (x = !0, !mt) {
- const Gt = y || {}, sr = W ? w3e(W, Ze) : Ze;
- if (oe && jG(sr, de)) {
- const Xr = Kr(j, p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, Hr(sr), Hr(de));
- Da.add(Xr), Gt.errors = [Xr];
- } else {
- const Xr = !!(ct && (Gs(l, ct) || ze).flags & 16777216), tn = !!(ct && (Gs(a, ct) || ze).flags & 16777216);
- de = l0(de, Xr), Ze = l0(Ze, Xr && tn), Ep(sr, de, f, j, ye, m, Gt) && sr !== Ze && Ep(Ze, de, f, j, ye, m, Gt);
- }
- if (Gt.errors) {
- const Xr = Gt.errors[Gt.errors.length - 1], tn = up(Q) ? _p(Q) : void 0, pr = tn !== void 0 ? Gs(l, tn) : void 0;
- let er = !1;
- if (!pr) {
- const gn = hN(l, Q);
- gn && gn.declaration && !Tr(gn.declaration).hasNoDefaultLib && (er = !0, Rs(Xr, Kr(gn.declaration, p.The_expected_type_comes_from_this_index_signature)));
- }
- if (!er && (pr && Nr(pr.declarations) || l.symbol && Nr(l.symbol.declarations))) {
- const gn = pr && Nr(pr.declarations) ? pr.declarations[0] : l.symbol.declarations[0];
- Tr(gn).hasNoDefaultLib || Rs(
- Xr,
- Kr(
- gn,
- p.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,
- tn && !(Q.flags & 8192) ? Ei(tn) : Hr(Q),
- Hr(l)
- )
- );
- }
- }
- }
- }
- }
- return x;
- }
- function jtt(r, a, l, f, m, y) {
- const x = Vc(l, qG), N = Vc(l, (Q) => !qG(Q)), j = N !== Ht ? Ode(
- 13,
- 0,
- N,
- /*errorNode*/
- void 0
- ) : void 0;
- let W = !1;
- for (let Q = r.next(); !Q.done; Q = r.next()) {
- const { errorNode: ye, innerExpression: de, nameType: Ze, errorMessage: ct } = Q.value;
- let mt = j;
- const Gt = x !== Ht ? P3e(a, x, Ze) : void 0;
- if (Gt && !(Gt.flags & 8388608) && (mt = j ? Qn([j, Gt]) : Gt), !mt) continue;
- let sr = D1(a, Ze);
- if (!sr) continue;
- const Xr = DG(
- Ze,
- /*accessNode*/
- void 0
- );
- if (!Ep(
- sr,
- mt,
- f,
- /*errorNode*/
- void 0
- )) {
- const tn = de && PN(
- de,
- sr,
- mt,
- f,
- /*headMessage*/
- void 0,
- m,
- y
- );
- if (W = !0, !tn) {
- const pr = y || {}, er = de ? w3e(de, sr) : sr;
- if (oe && jG(er, mt)) {
- const gn = Kr(ye, p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, Hr(er), Hr(mt));
- Da.add(gn), pr.errors = [gn];
- } else {
- const gn = !!(Xr && (Gs(x, Xr) || ze).flags & 16777216), Un = !!(Xr && (Gs(a, Xr) || ze).flags & 16777216);
- mt = l0(mt, gn), sr = l0(sr, gn && Un), Ep(er, mt, f, ye, ct, m, pr) && er !== sr && Ep(sr, mt, f, ye, ct, m, pr);
- }
- }
- }
- }
- return W;
- }
- function* Btt(r) {
- if (Nr(r.properties))
- for (const a of r.properties)
- Lx(a) || Ipe(q3(a.name)) || (yield { errorNode: a.name, innerExpression: a.initializer, nameType: S_(q3(a.name)) });
- }
- function* Jtt(r, a) {
- if (!Nr(r.children)) return;
- let l = 0;
- for (let f = 0; f < r.children.length; f++) {
- const m = r.children[f], y = bd(f - l), x = A3e(m, y, a);
- x ? yield x : l++;
- }
- }
- function A3e(r, a, l) {
- switch (r.kind) {
- case 294:
- return { errorNode: r, innerExpression: r.expression, nameType: a };
- case 12:
- if (r.containsOnlyTriviaWhiteSpaces)
- break;
- return { errorNode: r, innerExpression: void 0, nameType: a, errorMessage: l() };
- case 284:
- case 285:
- case 288:
- return { errorNode: r, innerExpression: r, nameType: a };
- default:
- return E.assertNever(r, "Found invalid jsx child");
- }
- }
- function ztt(r, a, l, f, m, y) {
- let x = ZL(Btt(r), a, l, f, m, y), N;
- if (xm(r.parent) && Gg(r.parent.parent)) {
- const W = r.parent.parent, Q = SM(kT(r)), ye = Q === void 0 ? "children" : Ei(Q), de = S_(ye), Ze = j_(l, de), ct = wC(W.children);
- if (!Nr(ct))
- return x;
- const mt = Nr(ct) > 1;
- let Gt, sr;
- if (EG(
- /*reportErrors*/
- !1
- ) !== Vi) {
- const tn = zwe(xe);
- Gt = Vc(Ze, (pr) => $s(pr, tn)), sr = Vc(Ze, (pr) => !$s(pr, tn));
- } else
- Gt = Vc(Ze, qG), sr = Vc(Ze, (tn) => !qG(tn));
- if (mt) {
- if (Gt !== Ht) {
- const tn = Eg(y$(
- W,
- 0
- /* Normal */
- )), pr = Jtt(W, j);
- x = jtt(pr, tn, Gt, f, m, y) || x;
- } else if (!zm(j_(a, de), Ze, f)) {
- x = !0;
- const tn = je(
- W.openingElement.tagName,
- p.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,
- ye,
- Hr(Ze)
- );
- y && y.skipLogging && (y.errors || (y.errors = [])).push(tn);
- }
- } else if (sr !== Ht) {
- const tn = ct[0], pr = A3e(tn, de, j);
- pr && (x = ZL(
- function* () {
- yield pr;
- }(),
- a,
- l,
- f,
- m,
- y
- ) || x);
- } else if (!zm(j_(a, de), Ze, f)) {
- x = !0;
- const tn = je(
- W.openingElement.tagName,
- p.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,
- ye,
- Hr(Ze)
- );
- y && y.skipLogging && (y.errors || (y.errors = [])).push(tn);
- }
- }
- return x;
- function j() {
- if (!N) {
- const W = nc(r.parent.tagName), Q = SM(kT(r)), ye = Q === void 0 ? "children" : Ei(Q), de = j_(l, S_(ye)), Ze = p._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;
- N = { ...Ze, key: "!!ALREADY FORMATTED!!", message: dx(Ze, W, ye, Hr(de)) };
- }
- return N;
- }
- }
- function* N3e(r, a) {
- const l = Nr(r.elements);
- if (l)
- for (let f = 0; f < l; f++) {
- if (OP(a) && !Gs(a, "" + f)) continue;
- const m = r.elements[f];
- if (ml(m)) continue;
- const y = bd(f), x = E$(m);
- yield { errorNode: x, innerExpression: x, nameType: y };
- }
- }
- function Wtt(r, a, l, f, m, y) {
- if (l.flags & 402915324) return !1;
- if (OP(a))
- return ZL(N3e(r, l), a, l, f, m, y);
- vM(
- r,
- l,
- /*isCache*/
- !1
- );
- const x = o8e(
- r,
- 1,
- /*forceTuple*/
- !0
- );
- return BN(), OP(x) ? ZL(N3e(r, l), x, l, f, m, y) : !1;
- }
- function* Utt(r) {
- if (Nr(r.properties))
- for (const a of r.properties) {
- if ($g(a)) continue;
- const l = Ok(
- Tn(a),
- 8576
- /* StringOrNumberLiteralOrUnique */
- );
- if (!(!l || l.flags & 131072))
- switch (a.kind) {
- case 178:
- case 177:
- case 174:
- case 304:
- yield { errorNode: a.name, innerExpression: void 0, nameType: l };
- break;
- case 303:
- yield { errorNode: a.name, innerExpression: a.initializer, nameType: l, errorMessage: Ww(a.name) ? p.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 };
- break;
- default:
- E.assertNever(a);
- }
- }
- }
- function Vtt(r, a, l, f, m, y) {
- return l.flags & 402915324 ? !1 : ZL(Utt(r), a, l, f, m, y);
- }
- function I3e(r, a, l, f, m) {
- return Ep(r, a, uf, l, f, m);
- }
- function qtt(r, a, l) {
- return Ife(
- r,
- a,
- 4,
- /*reportErrors*/
- !1,
- /*errorReporter*/
- void 0,
- /*incompatibleErrorReporter*/
- void 0,
- Afe,
- /*reportUnreliableMarkers*/
- void 0
- ) !== 0;
- }
- function RG(r) {
- if (!r.typeParameters && (!r.thisParameter || Wa(IM(r.thisParameter))) && r.parameters.length === 1 && Su(r)) {
- const a = IM(r.parameters[0]);
- return !!((Dp(a) ? Io(a)[0] : a).flags & 131073 && Ha(r).flags & 3);
- }
- return !1;
- }
- function Ife(r, a, l, f, m, y, x, N) {
- if (r === a || !(l & 16 && RG(r)) && RG(a))
- return -1;
- if (l & 16 && RG(r) && !RG(a))
- return 0;
- const j = W_(a);
- if (!Pg(a) && (l & 8 ? Pg(r) || W_(r) > j : Hm(r) > j))
- return f && !(l & 8) && m(p.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, Hm(r), j), 0;
- r.typeParameters && r.typeParameters !== a.typeParameters && (a = JKe(a), r = B8e(
- r,
- a,
- /*inferenceContext*/
- void 0,
- x
- ));
- const Q = W_(r), ye = VN(r), de = VN(a);
- (ye || de) && zi(ye || de, N);
- const Ze = a.declaration ? a.declaration.kind : 0, ct = !(l & 3) && G && Ze !== 174 && Ze !== 173 && Ze !== 176;
- let mt = -1;
- const Gt = Xv(r);
- if (Gt && Gt !== Xt) {
- const tn = Xv(a);
- if (tn) {
- const pr = !ct && x(
- Gt,
- tn,
- /*reportErrors*/
- !1
- ) || x(tn, Gt, f);
- if (!pr)
- return f && m(p.The_this_types_of_each_signature_are_incompatible), 0;
- mt &= pr;
- }
- }
- const sr = ye || de ? Math.min(Q, j) : Math.max(Q, j), Xr = ye || de ? sr - 1 : -1;
- for (let tn = 0; tn < sr; tn++) {
- const pr = tn === Xr ? lNe(r, tn) : R2(r, tn), er = tn === Xr ? lNe(a, tn) : R2(a, tn);
- if (pr && er && (pr !== er || l & 8)) {
- const gn = l & 3 || R8e(r, tn) ? void 0 : ET(c0(pr)), Un = l & 3 || R8e(a, tn) ? void 0 : ET(c0(er));
- let Jn = gn && Un && !Cp(gn) && !Cp(Un) && gE(
- pr,
- 50331648
- /* IsUndefinedOrNull */
- ) === gE(
- er,
- 50331648
- /* IsUndefinedOrNull */
- ) ? Ife(Un, gn, l & 8 | (ct ? 2 : 1), f, m, y, x, N) : !(l & 3) && !ct && x(
- pr,
- er,
- /*reportErrors*/
- !1
- ) || x(er, pr, f);
- if (Jn && l & 8 && tn >= Hm(r) && tn < Hm(a) && x(
- pr,
- er,
- /*reportErrors*/
- !1
- ) && (Jn = 0), !Jn)
- return f && m(p.Types_of_parameters_0_and_1_are_incompatible, Ei(jP(r, tn)), Ei(jP(a, tn))), 0;
- mt &= Jn;
- }
- }
- if (!(l & 4)) {
- const tn = hG(a) ? xe : a.declaration && qm(a.declaration) ? b_(Ra(a.declaration.symbol)) : Ha(a);
- if (tn === Xt || tn === xe)
- return mt;
- const pr = hG(r) ? xe : r.declaration && qm(r.declaration) ? b_(Ra(r.declaration.symbol)) : Ha(r), er = Cp(a);
- if (er) {
- const gn = Cp(r);
- if (gn)
- mt &= Htt(gn, er, f, m, x);
- else if (PZ(er) || wZ(er))
- return f && m(p.Signature_0_must_be_a_type_predicate, qv(r)), 0;
- } else
- mt &= l & 1 && x(
- tn,
- pr,
- /*reportErrors*/
- !1
- ) || x(pr, tn, f), !mt && f && y && y(pr, tn);
- }
- return mt;
- }
- function Htt(r, a, l, f, m) {
- if (r.kind !== a.kind)
- return l && (f(p.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard), f(p.Type_predicate_0_is_not_assignable_to_1, Lm(r), Lm(a))), 0;
- if ((r.kind === 1 || r.kind === 3) && r.parameterIndex !== a.parameterIndex)
- return l && (f(p.Parameter_0_is_not_in_the_same_position_as_parameter_1, r.parameterName, a.parameterName), f(p.Type_predicate_0_is_not_assignable_to_1, Lm(r), Lm(a))), 0;
- const y = r.type === a.type ? -1 : r.type && a.type ? m(r.type, a.type, l) : 0;
- return y === 0 && l && f(p.Type_predicate_0_is_not_assignable_to_1, Lm(r), Lm(a)), y;
- }
- function Gtt(r, a) {
- const l = bN(r), f = bN(a), m = Ha(l), y = Ha(f);
- return y === Xt || zm(y, m, lf) || zm(m, y, lf) ? qtt(
- l,
- f
- ) : !1;
- }
- function Ofe(r) {
- return r !== ba && r.properties.length === 0 && r.callSignatures.length === 0 && r.constructSignatures.length === 0 && r.indexInfos.length === 0;
- }
- function a0(r) {
- return r.flags & 524288 ? !R_(r) && Ofe(Xd(r)) : r.flags & 67108864 ? !0 : r.flags & 1048576 ? ut(r.types, a0) : r.flags & 2097152 ? Mi(r.types, a0) : !1;
- }
- function Dg(r) {
- return !!(wn(r) & 16 && (r.members && Ofe(r) || r.symbol && r.symbol.flags & 2048 && k1(r.symbol).size === 0));
- }
- function $tt(r) {
- if (ee && r.flags & 1048576) {
- if (!(r.objectFlags & 33554432)) {
- const a = r.types;
- r.objectFlags |= 33554432 | (a.length >= 3 && a[0].flags & 32768 && a[1].flags & 65536 && ut(a, Dg) ? 67108864 : 0);
- }
- return !!(r.objectFlags & 67108864);
- }
- return !1;
- }
- function mE(r) {
- return !!((r.flags & 1048576 ? r.types[0] : r).flags & 32768);
- }
- function O3e(r) {
- const a = r.flags & 1048576 ? r.types[0] : r;
- return !!(a.flags & 32768) && a !== U;
- }
- function F3e(r) {
- return r.flags & 524288 && !R_(r) && qa(r).length === 0 && wu(r).length === 1 && !!dh(r, Ie) || r.flags & 3145728 && Mi(r.types, F3e) || !1;
- }
- function Ffe(r, a, l) {
- const f = r.flags & 8 ? Cf(r) : r, m = a.flags & 8 ? Cf(a) : a;
- if (f === m)
- return !0;
- if (f.escapedName !== m.escapedName || !(f.flags & 256) || !(m.flags & 256))
- return !1;
- const y = na(f) + "," + na(m), x = c1.get(y);
- if (x !== void 0 && !(x & 2 && l))
- return !!(x & 1);
- const N = nn(m);
- for (const j of qa(nn(f)))
- if (j.flags & 8) {
- const W = Gs(N, j.escapedName);
- if (!W || !(W.flags & 8))
- return l && l(p.Property_0_is_missing_in_type_1, mc(j), Hr(
- bo(m),
- /*enclosingDeclaration*/
- void 0,
- 64
- /* UseFullyQualifiedType */
- )), c1.set(
- y,
- 2
- /* Failed */
- ), !1;
- const Q = PT(Jo(
- j,
- 306
- /* EnumMember */
- )).value, ye = PT(Jo(
- W,
- 306
- /* EnumMember */
- )).value;
- if (Q !== ye) {
- const de = typeof Q == "string", Ze = typeof ye == "string";
- if (Q !== void 0 && ye !== void 0) {
- if (l) {
- const ct = de ? `"${cg(Q)}"` : Q, mt = Ze ? `"${cg(ye)}"` : ye;
- l(p.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, mc(m), mc(W), mt, ct);
- }
- return c1.set(
- y,
- 2
- /* Failed */
- ), !1;
- }
- if (de || Ze) {
- if (l) {
- const ct = Q ?? ye;
- E.assert(typeof ct == "string");
- const mt = `"${cg(ct)}"`;
- l(p.One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value, mc(m), mc(W), mt);
- }
- return c1.set(
- y,
- 2
- /* Failed */
- ), !1;
- }
- }
- }
- return c1.set(
- y,
- 1
- /* Succeeded */
- ), !0;
- }
- function wN(r, a, l, f) {
- const m = r.flags, y = a.flags;
- return y & 1 || m & 131072 || r === $e || y & 2 && !(l === Hf && m & 1) ? !0 : y & 131072 ? !1 : !!(m & 402653316 && y & 4 || m & 128 && m & 1024 && y & 128 && !(y & 1024) && r.value === a.value || m & 296 && y & 8 || m & 256 && m & 1024 && y & 256 && !(y & 1024) && r.value === a.value || m & 2112 && y & 64 || m & 528 && y & 16 || m & 12288 && y & 4096 || m & 32 && y & 32 && r.symbol.escapedName === a.symbol.escapedName && Ffe(r.symbol, a.symbol, f) || m & 1024 && y & 1024 && (m & 1048576 && y & 1048576 && Ffe(r.symbol, a.symbol, f) || m & 2944 && y & 2944 && r.value === a.value && Ffe(r.symbol, a.symbol, f)) || m & 32768 && (!ee && !(y & 3145728) || y & 49152) || m & 65536 && (!ee && !(y & 3145728) || y & 65536) || m & 524288 && y & 67108864 && !(l === Hf && Dg(r) && !(wn(r) & 8192)) || (l === lf || l === uf) && (m & 1 || m & 8 && (y & 32 || y & 256 && y & 1024) || m & 256 && !(m & 1024) && (y & 32 || y & 256 && y & 1024 && r.value === a.value) || $tt(a)));
- }
- function zm(r, a, l) {
- if (A2(r) && (r = r.regularType), A2(a) && (a = a.regularType), r === a)
- return !0;
- if (l !== I_) {
- if (l === uf && !(a.flags & 131072) && wN(a, r, l) || wN(r, a, l))
- return !0;
- } else if (!((r.flags | a.flags) & 61865984)) {
- if (r.flags !== a.flags) return !1;
- if (r.flags & 67358815) return !0;
- }
- if (r.flags & 524288 && a.flags & 524288) {
- const f = l.get(zG(
- r,
- a,
- 0,
- l,
- /*ignoreConstraints*/
- !1
- ));
- if (f !== void 0)
- return !!(f & 1);
- }
- return r.flags & 469499904 || a.flags & 469499904 ? Ep(
- r,
- a,
- l,
- /*errorNode*/
- void 0
- ) : !1;
- }
- function L3e(r, a) {
- return wn(r) & 2048 && Ipe(a.escapedName);
- }
- function KL(r, a) {
- for (; ; ) {
- const l = A2(r) ? r.regularType : A1(r) ? Ytt(r, a) : wn(r) & 4 ? r.node ? n0(r.target, Io(r)) : Wfe(r) || r : r.flags & 3145728 ? Xtt(r, a) : r.flags & 33554432 ? a ? r.baseType : K_e(r) : r.flags & 25165824 ? s0(r, a) : r;
- if (l === r) return l;
- r = l;
- }
- }
- function Xtt(r, a) {
- const l = Qd(r);
- if (l !== r)
- return l;
- if (r.flags & 2097152 && Qtt(r)) {
- const f = qc(r.types, (m) => KL(m, a));
- if (f !== r.types)
- return ia(f);
- }
- return r;
- }
- function Qtt(r) {
- let a = !1, l = !1;
- for (const f of r.types)
- if (a || (a = !!(f.flags & 465829888)), l || (l = !!(f.flags & 98304) || Dg(f)), a && l) return !0;
- return !1;
- }
- function Ytt(r, a) {
- const l = P2(r), f = qc(l, (m) => m.flags & 25165824 ? s0(m, a) : m);
- return l !== f ? lfe(r.target, f) : r;
- }
- function Ep(r, a, l, f, m, y, x) {
- var N;
- let j, W, Q, ye, de, Ze, ct = 0, mt = 0, Gt = 0, sr = 0, Xr = !1, tn = 0, pr = 0, er, gn, Un = 16e6 - l.size >> 3;
- E.assert(l !== I_ || !f, "no error reporting in identity checking");
- const ci = un(
- r,
- a,
- 3,
- /*reportErrors*/
- !!f,
- m
- );
- if (gn && Oo(), Xr) {
- const Je = zG(
- r,
- a,
- /*intersectionState*/
- 0,
- l,
- /*ignoreConstraints*/
- !1
- );
- l.set(Je, 2 | (Un <= 0 ? 32 : 64)), (N = rn) == null || N.instant(rn.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: r.id, targetId: a.id, depth: mt, targetDepth: Gt });
- const Ye = Un <= 0 ? p.Excessive_complexity_comparing_types_0_and_1 : p.Excessive_stack_depth_comparing_types_0_and_1, kt = je(f || C, Ye, Hr(r), Hr(a));
- x && (x.errors || (x.errors = [])).push(kt);
- } else if (j) {
- if (y) {
- const kt = y();
- kt && (MK(kt, j), j = kt);
- }
- let Je;
- if (m && f && !ci && r.symbol) {
- const kt = Bi(r.symbol);
- if (kt.originatingImport && !hf(kt.originatingImport) && Ep(
- nn(kt.target),
- a,
- l,
- /*errorNode*/
- void 0
- )) {
- const it = Kr(kt.originatingImport, p.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);
- Je = wr(Je, it);
- }
- }
- const Ye = Rg(Tr(f), f, j, Je);
- W && Rs(Ye, ...W), x && (x.errors || (x.errors = [])).push(Ye), (!x || !x.skipLogging) && Da.add(Ye);
- }
- return f && x && x.skipLogging && ci === 0 && E.assert(!!x.errors, "missed opportunity to interact with error."), ci !== 0;
- function Jn(Je) {
- j = Je.errorInfo, er = Je.lastSkippedInfo, gn = Je.incompatibleStack, tn = Je.overrideNextErrorInfo, pr = Je.skipParentCounter, W = Je.relatedInfo;
- }
- function Us() {
- return {
- errorInfo: j,
- lastSkippedInfo: er,
- incompatibleStack: gn?.slice(),
- overrideNextErrorInfo: tn,
- skipParentCounter: pr,
- relatedInfo: W?.slice()
- };
- }
- function js(Je, ...Ye) {
- tn++, er = void 0, (gn || (gn = [])).push([Je, ...Ye]);
- }
- function Oo() {
- const Je = gn || [];
- gn = void 0;
- const Ye = er;
- if (er = void 0, Je.length === 1) {
- ls(...Je[0]), Ye && pc(
- /*message*/
- void 0,
- ...Ye
- );
- return;
- }
- let kt = "";
- const tr = [];
- for (; Je.length; ) {
- const [it, ...Dt] = Je.pop();
- switch (it.code) {
- case p.Types_of_property_0_are_incompatible.code: {
- kt.indexOf("new ") === 0 && (kt = `(${kt})`);
- const Er = "" + Dt[0];
- kt.length === 0 ? kt = `${Er}` : k_(Er, pa(O)) ? kt = `${kt}.${Er}` : Er[0] === "[" && Er[Er.length - 1] === "]" ? kt = `${kt}${Er}` : kt = `${kt}[${Er}]`;
- break;
- }
- case p.Call_signature_return_types_0_and_1_are_incompatible.code:
- case p.Construct_signature_return_types_0_and_1_are_incompatible.code:
- case p.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:
- case p.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: {
- if (kt.length === 0) {
- let Er = it;
- it.code === p.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? Er = p.Call_signature_return_types_0_and_1_are_incompatible : it.code === p.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code && (Er = p.Construct_signature_return_types_0_and_1_are_incompatible), tr.unshift([Er, Dt[0], Dt[1]]);
- } else {
- const Er = it.code === p.Construct_signature_return_types_0_and_1_are_incompatible.code || it.code === p.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "new " : "", St = it.code === p.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code || it.code === p.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "" : "...";
- kt = `${Er}${kt}(${St})`;
- }
- break;
- }
- case p.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code: {
- tr.unshift([p.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, Dt[0], Dt[1]]);
- break;
- }
- case p.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code: {
- tr.unshift([p.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, Dt[0], Dt[1], Dt[2]]);
- break;
- }
- default:
- return E.fail(`Unhandled Diagnostic: ${it.code}`);
- }
- }
- kt ? ls(
- kt[kt.length - 1] === ")" ? p.The_types_returned_by_0_are_incompatible_between_these_types : p.The_types_of_0_are_incompatible_between_these_types,
- kt
- ) : tr.shift();
- for (const [it, ...Dt] of tr) {
- const Er = it.elidedInCompatabilityPyramid;
- it.elidedInCompatabilityPyramid = !1, ls(it, ...Dt), it.elidedInCompatabilityPyramid = Er;
- }
- Ye && pc(
- /*message*/
- void 0,
- ...Ye
- );
- }
- function ls(Je, ...Ye) {
- E.assert(!!f), gn && Oo(), !Je.elidedInCompatabilityPyramid && (pr === 0 ? j = vs(j, Je, ...Ye) : pr--);
- }
- function sc(Je, ...Ye) {
- ls(Je, ...Ye), pr++;
- }
- function Jl(Je) {
- E.assert(!!j), W ? W.push(Je) : W = [Je];
- }
- function pc(Je, Ye, kt) {
- gn && Oo();
- const [tr, it] = vP(Ye, kt);
- let Dt = Ye, Er = tr;
- if (AN(Ye) && !Lfe(kt) && (Dt = o0(Ye), E.assert(!$s(Dt, kt), "generalized source shouldn't be assignable"), Er = K6(Dt)), (kt.flags & 8388608 && !(Ye.flags & 8388608) ? kt.objectType.flags : kt.flags) & 262144 && kt !== ge && kt !== $) {
- const ur = Kl(kt);
- let Zr;
- ur && ($s(Dt, ur) || (Zr = $s(Ye, ur))) ? ls(
- p._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,
- Zr ? tr : Er,
- it,
- Hr(ur)
- ) : (j = void 0, ls(
- p._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,
- it,
- Er
- ));
- }
- if (Je)
- Je === p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1 && oe && M3e(Ye, kt).length && (Je = p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);
- else if (l === uf)
- Je = p.Type_0_is_not_comparable_to_type_1;
- else if (tr === it)
- Je = p.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;
- else if (oe && M3e(Ye, kt).length)
- Je = p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
- else {
- if (Ye.flags & 128 && kt.flags & 1048576) {
- const ur = lst(Ye, kt);
- if (ur) {
- ls(p.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, Er, it, Hr(ur));
- return;
- }
- }
- Je = p.Type_0_is_not_assignable_to_type_1;
- }
- ls(Je, Er, it);
- }
- function Pr(Je, Ye) {
- const kt = y1(Je.symbol) ? Hr(Je, Je.symbol.valueDeclaration) : Hr(Je), tr = y1(Ye.symbol) ? Hr(Ye, Ye.symbol.valueDeclaration) : Hr(Ye);
- ($i === Je && Ie === Ye || Sa === Je && At === Ye || ka === Je && wt === Ye || Fwe() === Je && jt === Ye) && ls(p._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, tr, kt);
- }
- function Wr(Je, Ye, kt) {
- return ha(Je) ? Je.target.readonly && nM(Ye) ? (kt && ls(p.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, Hr(Je), Hr(Ye)), !1) : Kv(Ye) : IP(Je) && nM(Ye) ? (kt && ls(p.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, Hr(Je), Hr(Ye)), !1) : ha(Ye) ? Dp(Je) : !0;
- }
- function wi(Je, Ye, kt) {
- return un(Je, Ye, 3, kt);
- }
- function un(Je, Ye, kt = 3, tr = !1, it, Dt = 0) {
- if (Je === Ye) return -1;
- if (Je.flags & 524288 && Ye.flags & 402784252)
- return l === uf && !(Ye.flags & 131072) && wN(Ye, Je, l) || wN(Je, Ye, l, tr ? ls : void 0) ? -1 : (tr && is(Je, Ye, Je, Ye, it), 0);
- const Er = KL(
- Je,
- /*writing*/
- !1
- );
- let St = KL(
- Ye,
- /*writing*/
- !0
- );
- if (Er === St) return -1;
- if (l === I_)
- return Er.flags !== St.flags ? 0 : Er.flags & 67358815 ? -1 : (Zs(Er, St), GP(
- Er,
- St,
- /*reportErrors*/
- !1,
- 0,
- kt
- ));
- if (Er.flags & 262144 && lT(Er) === St)
- return -1;
- if (Er.flags & 470302716 && St.flags & 1048576) {
- const ur = St.types, Zr = ur.length === 2 && ur[0].flags & 98304 ? ur[1] : ur.length === 3 && ur[0].flags & 98304 && ur[1].flags & 98304 ? ur[2] : void 0;
- if (Zr && !(Zr.flags & 98304) && (St = KL(
- Zr,
- /*writing*/
- !0
- ), Er === St))
- return -1;
- }
- if (l === uf && !(St.flags & 131072) && wN(St, Er, l) || wN(Er, St, l, tr ? ls : void 0)) return -1;
- if (Er.flags & 469499904 || St.flags & 469499904) {
- if (!(Dt & 2) && cy(Er) && wn(Er) & 8192 && dc(Er, St, tr))
- return tr && pc(it, Er, Ye.aliasSymbol ? Ye : St), 0;
- const Zr = (l !== uf || Yd(Er)) && !(Dt & 2) && Er.flags & 405405692 && Er !== Lc && St.flags & 2621440 && Rfe(St) && (qa(Er).length > 0 || K$(Er)), nr = !!(wn(Er) & 2048);
- if (Zr && !Ktt(Er, St, nr)) {
- if (tr) {
- const Rn = Hr(Je.aliasSymbol ? Je : Er), pi = Hr(Ye.aliasSymbol ? Ye : St), Yn = Ns(
- Er,
- 0
- /* Call */
- ), ds = Ns(
- Er,
- 1
- /* Construct */
- );
- Yn.length > 0 && un(
- Ha(Yn[0]),
- St,
- 1,
- /*reportErrors*/
- !1
- ) || ds.length > 0 && un(
- Ha(ds[0]),
- St,
- 1,
- /*reportErrors*/
- !1
- ) ? ls(p.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, Rn, pi) : ls(p.Type_0_has_no_properties_in_common_with_type_1, Rn, pi);
- }
- return 0;
- }
- Zs(Er, St);
- const Rr = Er.flags & 1048576 && Er.types.length < 4 && !(St.flags & 1048576) || St.flags & 1048576 && St.types.length < 4 && !(Er.flags & 469499904) ? Nl(Er, St, tr, Dt) : GP(Er, St, tr, Dt, kt);
- if (Rr)
- return Rr;
- }
- return tr && is(Je, Ye, Er, St, it), 0;
- }
- function is(Je, Ye, kt, tr, it) {
- var Dt, Er;
- const St = !!Wfe(Je), ur = !!Wfe(Ye);
- kt = Je.aliasSymbol || St ? Je : kt, tr = Ye.aliasSymbol || ur ? Ye : tr;
- let Zr = tn > 0;
- if (Zr && tn--, kt.flags & 524288 && tr.flags & 524288) {
- const nr = j;
- Wr(
- kt,
- tr,
- /*reportErrors*/
- !0
- ), j !== nr && (Zr = !!j);
- }
- if (kt.flags & 524288 && tr.flags & 402784252)
- Pr(kt, tr);
- else if (kt.symbol && kt.flags & 524288 && Lc === kt)
- ls(p.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- else if (wn(kt) & 2048 && tr.flags & 2097152) {
- const nr = tr.types, Gr = M2(jf.IntrinsicAttributes, f), Rr = M2(jf.IntrinsicClassAttributes, f);
- if (!H(Gr) && !H(Rr) && (ss(nr, Gr) || ss(nr, Rr)))
- return;
- } else
- j = j_e(j, Ye);
- if (!it && Zr) {
- const nr = Us();
- pc(it, kt, tr);
- let Gr;
- j && j !== nr.errorInfo && (Gr = { code: j.code, messageText: j.messageText }), Jn(nr), Gr && j && (j.canonicalHead = Gr), er = [kt, tr];
- return;
- }
- if (pc(it, kt, tr), kt.flags & 262144 && ((Er = (Dt = kt.symbol) == null ? void 0 : Dt.declarations) != null && Er[0]) && !lT(kt)) {
- const nr = Dfe(kt);
- if (nr.constraint = zi(tr, N2(kt, nr)), OL(nr)) {
- const Gr = Hr(tr, kt.symbol.declarations[0]);
- Jl(Kr(kt.symbol.declarations[0], p.This_type_parameter_might_need_an_extends_0_constraint, Gr));
- }
- }
- }
- function Zs(Je, Ye) {
- if (rn && Je.flags & 3145728 && Ye.flags & 3145728) {
- const kt = Je, tr = Ye;
- if (kt.objectFlags & tr.objectFlags & 32768)
- return;
- const it = kt.types.length, Dt = tr.types.length;
- it * Dt > 1e6 && rn.instant(rn.Phase.CheckTypes, "traceUnionsOrIntersectionsTooLarge_DepthLimit", {
- sourceId: Je.id,
- sourceSize: it,
- targetId: Ye.id,
- targetSize: Dt,
- pos: f?.pos,
- end: f?.end
- });
- }
- }
- function Fo(Je, Ye) {
- return Qn(Hu(
- Je,
- (tr, it) => {
- var Dt;
- it = Uu(it);
- const Er = it.flags & 3145728 ? FL(it, Ye) : k2(it, Ye), St = Er && nn(Er) || ((Dt = Nk(it, Ye)) == null ? void 0 : Dt.type) || Ae;
- return wr(tr, St);
- },
- /*initial*/
- void 0
- ) || Ue);
- }
- function dc(Je, Ye, kt) {
- var tr;
- if (!zN(Ye) || !ie && wn(Ye) & 4096)
- return !1;
- const it = !!(wn(Je) & 2048);
- if ((l === lf || l === uf) && (MP(Lc, Ye) || !it && a0(Ye)))
- return !1;
- let Dt = Ye, Er;
- Ye.flags & 1048576 && (Dt = l7e(Je, Ye, un) || h_t(Ye), Er = Dt.flags & 1048576 ? Dt.types : [Dt]);
- for (const St of qa(Je))
- if (Ta(St, Je.symbol) && !L3e(Je, St)) {
- if (!b$(Dt, St.escapedName, it)) {
- if (kt) {
- const ur = Vc(Dt, zN);
- if (!f) return E.fail();
- if (Wb(f) || ou(f) || ou(f.parent)) {
- St.valueDeclaration && km(St.valueDeclaration) && Tr(f) === Tr(St.valueDeclaration.name) && (f = St.valueDeclaration.name);
- const Zr = Ji(St), nr = w8e(Zr, ur), Gr = nr ? Ji(nr) : void 0;
- Gr ? ls(p.Property_0_does_not_exist_on_type_1_Did_you_mean_2, Zr, Hr(ur), Gr) : ls(p.Property_0_does_not_exist_on_type_1, Zr, Hr(ur));
- } else {
- const Zr = ((tr = Je.symbol) == null ? void 0 : tr.declarations) && el(Je.symbol.declarations);
- let nr;
- if (St.valueDeclaration && or(St.valueDeclaration, (Gr) => Gr === Zr) && Tr(Zr) === Tr(f)) {
- const Gr = St.valueDeclaration;
- E.assertNode(Gr, kh);
- const Rr = Gr.name;
- f = Rr, Oe(Rr) && (nr = A8e(Rr, ur));
- }
- nr !== void 0 ? sc(p.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, Ji(St), Hr(ur), nr) : sc(p.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, Ji(St), Hr(ur));
- }
- }
- return !0;
- }
- if (Er && !un(nn(St), Fo(Er, St.escapedName), 3, kt))
- return kt && js(p.Types_of_property_0_are_incompatible, Ji(St)), !0;
- }
- return !1;
- }
- function Ta(Je, Ye) {
- return Je.valueDeclaration && Ye.valueDeclaration && Je.valueDeclaration.parent === Ye.valueDeclaration;
- }
- function Nl(Je, Ye, kt, tr) {
- if (Je.flags & 1048576) {
- if (Ye.flags & 1048576) {
- const it = Je.origin;
- if (it && it.flags & 2097152 && Ye.aliasSymbol && ss(it.types, Ye))
- return -1;
- const Dt = Ye.origin;
- if (Dt && Dt.flags & 1048576 && Je.aliasSymbol && ss(Dt.types, Je))
- return -1;
- }
- return l === uf ? Ac(Je, Ye, kt && !(Je.flags & 402784252), tr) : _y(Je, Ye, kt && !(Je.flags & 402784252), tr);
- }
- if (Ye.flags & 1048576)
- return mo(ON(Je), Ye, kt && !(Je.flags & 402784252) && !(Ye.flags & 402784252), tr);
- if (Ye.flags & 2097152)
- return ep(
- Je,
- Ye,
- kt,
- 2
- /* Target */
- );
- if (l === uf && Ye.flags & 402784252) {
- const it = qc(Je.types, (Dt) => Dt.flags & 465829888 ? Kl(Dt) || M : Dt);
- if (it !== Je.types) {
- if (Je = ia(it), Je.flags & 131072)
- return 0;
- if (!(Je.flags & 2097152))
- return un(
- Je,
- Ye,
- 1,
- /*reportErrors*/
- !1
- ) || un(
- Ye,
- Je,
- 1,
- /*reportErrors*/
- !1
- );
- }
- }
- return Ac(
- Je,
- Ye,
- /*reportErrors*/
- !1,
- 1
- /* Source */
- );
- }
- function Sc(Je, Ye) {
- let kt = -1;
- const tr = Je.types;
- for (const it of tr) {
- const Dt = mo(
- it,
- Ye,
- /*reportErrors*/
- !1,
- 0
- /* None */
- );
- if (!Dt)
- return 0;
- kt &= Dt;
- }
- return kt;
- }
- function mo(Je, Ye, kt, tr) {
- const it = Ye.types;
- if (Ye.flags & 1048576) {
- if (mh(it, Je))
- return -1;
- if (l !== uf && wn(Ye) & 32768 && !(Je.flags & 1024) && (Je.flags & 2688 || (l === sh || l === Hf) && Je.flags & 256)) {
- const Er = Je === Je.regularType ? Je.freshType : Je.regularType, St = Je.flags & 128 ? Ie : Je.flags & 256 ? At : Je.flags & 2048 ? Dr : void 0;
- return St && mh(it, St) || Er && mh(it, Er) ? -1 : 0;
- }
- const Dt = pAe(Ye, Je);
- if (Dt) {
- const Er = un(
- Je,
- Dt,
- 2,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- );
- if (Er)
- return Er;
- }
- }
- for (const Dt of it) {
- const Er = un(
- Je,
- Dt,
- 2,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- );
- if (Er)
- return Er;
- }
- if (kt) {
- const Dt = R3e(Je, Ye, un);
- Dt && un(
- Je,
- Dt,
- 2,
- /*reportErrors*/
- !0,
- /*headMessage*/
- void 0,
- tr
- );
- }
- return 0;
- }
- function ep(Je, Ye, kt, tr) {
- let it = -1;
- const Dt = Ye.types;
- for (const Er of Dt) {
- const St = un(
- Je,
- Er,
- 2,
- kt,
- /*headMessage*/
- void 0,
- tr
- );
- if (!St)
- return 0;
- it &= St;
- }
- return it;
- }
- function Ac(Je, Ye, kt, tr) {
- const it = Je.types;
- if (Je.flags & 1048576 && mh(it, Ye))
- return -1;
- const Dt = it.length;
- for (let Er = 0; Er < Dt; Er++) {
- const St = un(
- it[Er],
- Ye,
- 1,
- kt && Er === Dt - 1,
- /*headMessage*/
- void 0,
- tr
- );
- if (St)
- return St;
- }
- return 0;
- }
- function jc(Je, Ye) {
- return Je.flags & 1048576 && Ye.flags & 1048576 && !(Je.types[0].flags & 32768) && Ye.types[0].flags & 32768 ? RP(
- Ye,
- -32769
- /* Undefined */
- ) : Ye;
- }
- function _y(Je, Ye, kt, tr) {
- let it = -1;
- const Dt = Je.types, Er = jc(Je, Ye);
- for (let St = 0; St < Dt.length; St++) {
- const ur = Dt[St];
- if (Er.flags & 1048576 && Dt.length >= Er.types.length && Dt.length % Er.types.length === 0) {
- const nr = un(
- ur,
- Er.types[St % Er.types.length],
- 3,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- );
- if (nr) {
- it &= nr;
- continue;
- }
- }
- const Zr = un(
- ur,
- Ye,
- 1,
- kt,
- /*headMessage*/
- void 0,
- tr
- );
- if (!Zr)
- return 0;
- it &= Zr;
- }
- return it;
- }
- function EE(Je = Ue, Ye = Ue, kt = Ue, tr, it) {
- if (Je.length !== Ye.length && l === I_)
- return 0;
- const Dt = Je.length <= Ye.length ? Je.length : Ye.length;
- let Er = -1;
- for (let St = 0; St < Dt; St++) {
- const ur = St < kt.length ? kt[St] : 1, Zr = ur & 7;
- if (Zr !== 4) {
- const nr = Je[St], Gr = Ye[St];
- let Rr = -1;
- if (ur & 8 ? Rr = l === I_ ? un(
- nr,
- Gr,
- 3,
- /*reportErrors*/
- !1
- ) : DN(nr, Gr) : Zr === 1 ? Rr = un(
- nr,
- Gr,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- ) : Zr === 2 ? Rr = un(
- Gr,
- nr,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- ) : Zr === 3 ? (Rr = un(
- Gr,
- nr,
- 3,
- /*reportErrors*/
- !1
- ), Rr || (Rr = un(
- nr,
- Gr,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- ))) : (Rr = un(
- nr,
- Gr,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- ), Rr && (Rr &= un(
- Gr,
- nr,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- ))), !Rr)
- return 0;
- Er &= Rr;
- }
- }
- return Er;
- }
- function GP(Je, Ye, kt, tr, it) {
- var Dt, Er, St;
- if (Xr)
- return 0;
- const ur = zG(
- Je,
- Ye,
- tr,
- l,
- /*ignoreConstraints*/
- !1
- ), Zr = l.get(ur);
- if (Zr !== void 0 && !(kt && Zr & 2 && !(Zr & 96))) {
- if (vi) {
- const ds = Zr & 24;
- ds & 8 && zi(Je, Ll), ds & 16 && zi(Je, ca);
- }
- if (kt && Zr & 96) {
- const ds = Zr & 32 ? p.Excessive_complexity_comparing_types_0_and_1 : p.Excessive_stack_depth_comparing_types_0_and_1;
- ls(ds, Hr(Je), Hr(Ye)), tn++;
- }
- return Zr & 1 ? -1 : 0;
- }
- if (Un <= 0)
- return Xr = !0, 0;
- if (!Q)
- Q = [], ye = /* @__PURE__ */ new Set(), de = [], Ze = [];
- else {
- if (ye.has(ur))
- return 3;
- const ds = ur.startsWith("*") ? zG(
- Je,
- Ye,
- tr,
- l,
- /*ignoreConstraints*/
- !0
- ) : void 0;
- if (ds && ye.has(ds))
- return 3;
- if (mt === 100 || Gt === 100)
- return Xr = !0, 0;
- }
- const nr = ct;
- Q[ct] = ur, ye.add(ur), ct++;
- const Gr = sr;
- it & 1 && (de[mt] = Je, mt++, !(sr & 1) && Jk(Je, de, mt) && (sr |= 1)), it & 2 && (Ze[Gt] = Ye, Gt++, !(sr & 2) && Jk(Ye, Ze, Gt) && (sr |= 2));
- let Rr, Rn = 0;
- vi && (Rr = vi, vi = (ds) => (Rn |= ds ? 16 : 8, Rr(ds)));
- let pi;
- return sr === 3 ? ((Dt = rn) == null || Dt.instant(rn.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", {
- sourceId: Je.id,
- sourceIdStack: de.map((ds) => ds.id),
- targetId: Ye.id,
- targetIdStack: Ze.map((ds) => ds.id),
- depth: mt,
- targetDepth: Gt
- }), pi = 3) : ((Er = rn) == null || Er.push(rn.Phase.CheckTypes, "structuredTypeRelatedTo", { sourceId: Je.id, targetId: Ye.id }), pi = $P(Je, Ye, kt, tr), (St = rn) == null || St.pop()), vi && (vi = Rr), it & 1 && mt--, it & 2 && Gt--, sr = Gr, pi ? (pi === -1 || mt === 0 && Gt === 0) && Yn(
- pi === -1 || pi === 3
- ) : (l.set(ur, 2 | Rn), Un--, Yn(
- /*markAllAsSucceeded*/
- !1
- )), pi;
- function Yn(ds) {
- for (let ro = nr; ro < ct; ro++)
- ye.delete(Q[ro]), ds && (l.set(Q[ro], 1 | Rn), Un--);
- ct = nr;
- }
- }
- function $P(Je, Ye, kt, tr) {
- const it = Us();
- let Dt = sb(Je, Ye, kt, tr, it);
- if (l !== I_) {
- if (!Dt && (Je.flags & 2097152 || Je.flags & 262144 && Ye.flags & 1048576)) {
- const Er = xKe(Je.flags & 2097152 ? Je.types : [Je], !!(Ye.flags & 1048576));
- Er && z_(Er, (St) => St !== Je) && (Dt = un(
- Er,
- Ye,
- 1,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- ));
- }
- Dt && !(tr & 2) && Ye.flags & 2097152 && !dT(Ye) && Je.flags & 2621440 ? (Dt &= ea(
- Je,
- Ye,
- kt,
- /*excludedProperties*/
- void 0,
- /*optionalsOnly*/
- !1,
- 0
- /* None */
- ), Dt && cy(Je) && wn(Je) & 8192 && (Dt &= gi(
- Je,
- Ye,
- /*sourceIsPrimitive*/
- !1,
- kt,
- 0
- /* None */
- ))) : Dt && wG(Ye) && !Kv(Ye) && Je.flags & 2097152 && Uu(Je).flags & 3670016 && !ut(Je.types, (Er) => Er === Ye || !!(wn(Er) & 262144)) && (Dt &= ea(
- Je,
- Ye,
- kt,
- /*excludedProperties*/
- void 0,
- /*optionalsOnly*/
- !0,
- tr
- ));
- }
- return Dt && Jn(it), Dt;
- }
- function Df(Je, Ye) {
- const kt = Uu(x2(Ye)), tr = [];
- return N_e(
- kt,
- 8576,
- /*stringsOnly*/
- !1,
- (it) => void tr.push(zi(Je, kN(Ye.mapper, $d(Ye), it)))
- ), Qn(tr);
- }
- function sb(Je, Ye, kt, tr, it) {
- let Dt, Er, St = !1, ur = Je.flags;
- const Zr = Ye.flags;
- if (l === I_) {
- if (ur & 3145728) {
- let Rr = Sc(Je, Ye);
- return Rr && (Rr &= Sc(Ye, Je)), Rr;
- }
- if (ur & 4194304)
- return un(
- Je.type,
- Ye.type,
- 3,
- /*reportErrors*/
- !1
- );
- if (ur & 8388608 && (Dt = un(
- Je.objectType,
- Ye.objectType,
- 3,
- /*reportErrors*/
- !1
- )) && (Dt &= un(
- Je.indexType,
- Ye.indexType,
- 3,
- /*reportErrors*/
- !1
- )) || ur & 16777216 && Je.root.isDistributive === Ye.root.isDistributive && (Dt = un(
- Je.checkType,
- Ye.checkType,
- 3,
- /*reportErrors*/
- !1
- )) && (Dt &= un(
- Je.extendsType,
- Ye.extendsType,
- 3,
- /*reportErrors*/
- !1
- )) && (Dt &= un(
- Qv(Je),
- Qv(Ye),
- 3,
- /*reportErrors*/
- !1
- )) && (Dt &= un(
- Yv(Je),
- Yv(Ye),
- 3,
- /*reportErrors*/
- !1
- )) || ur & 33554432 && (Dt = un(
- Je.baseType,
- Ye.baseType,
- 3,
- /*reportErrors*/
- !1
- )) && (Dt &= un(
- Je.constraint,
- Ye.constraint,
- 3,
- /*reportErrors*/
- !1
- )))
- return Dt;
- if (!(ur & 524288))
- return 0;
- } else if (ur & 3145728 || Zr & 3145728) {
- if (Dt = Nl(Je, Ye, kt, tr))
- return Dt;
- if (!(ur & 465829888 || ur & 524288 && Zr & 1048576 || ur & 2097152 && Zr & 467402752))
- return 0;
- }
- if (ur & 17301504 && Je.aliasSymbol && Je.aliasTypeArguments && Je.aliasSymbol === Ye.aliasSymbol && !(BG(Je) || BG(Ye))) {
- const Rr = j3e(Je.aliasSymbol);
- if (Rr === Ue)
- return 1;
- const Rn = Bi(Je.aliasSymbol).typeParameters, pi = Bm(Rn), Yn = C1(Je.aliasTypeArguments, Rn, pi, cn(Je.aliasSymbol.valueDeclaration)), ds = C1(Ye.aliasTypeArguments, Rn, pi, cn(Je.aliasSymbol.valueDeclaration)), ro = Gr(Yn, ds, Rr, tr);
- if (ro !== void 0)
- return ro;
- }
- if ($3e(Je) && !Je.target.readonly && (Dt = un(
- Io(Je)[0],
- Ye,
- 1
- /* Source */
- )) || $3e(Ye) && (Ye.target.readonly || nM(Kl(Je) || Je)) && (Dt = un(
- Je,
- Io(Ye)[0],
- 2
- /* Target */
- )))
- return Dt;
- if (Zr & 262144) {
- if (wn(Je) & 32 && !Je.declaration.nameType && un(
- Jm(Ye),
- Yf(Je),
- 3
- /* Both */
- ) && !(xg(Je) & 4)) {
- const Rr = r0(Je), Rn = j_(Ye, $d(Je));
- if (Dt = un(Rr, Rn, 3, kt))
- return Dt;
- }
- if (l === uf && ur & 262144) {
- let Rr = s_(Je);
- if (Rr)
- for (; Rr && Pp(Rr, (Rn) => !!(Rn.flags & 262144)); ) {
- if (Dt = un(
- Rr,
- Ye,
- 1,
- /*reportErrors*/
- !1
- ))
- return Dt;
- Rr = s_(Rr);
- }
- return 0;
- }
- } else if (Zr & 4194304) {
- const Rr = Ye.type;
- if (ur & 4194304 && (Dt = un(
- Rr,
- Je.type,
- 3,
- /*reportErrors*/
- !1
- )))
- return Dt;
- if (ha(Rr)) {
- if (Dt = un(Je, qwe(Rr), 2, kt))
- return Dt;
- } else {
- const Rn = I_e(Rr);
- if (Rn) {
- if (un(Je, Jm(
- Rn,
- Ye.indexFlags | 4
- /* NoReducibleCheck */
- ), 2, kt) === -1)
- return -1;
- } else if (R_(Rr)) {
- const pi = ny(Rr), Yn = Yf(Rr);
- let ds;
- if (pi && cE(Rr)) {
- const ro = Df(pi, Rr);
- ds = Qn([ro, pi]);
- } else
- ds = pi || Yn;
- if (un(Je, ds, 2, kt) === -1)
- return -1;
- }
- }
- } else if (Zr & 8388608) {
- if (ur & 8388608) {
- if ((Dt = un(Je.objectType, Ye.objectType, 3, kt)) && (Dt &= un(Je.indexType, Ye.indexType, 3, kt)), Dt)
- return Dt;
- kt && (Er = j);
- }
- if (l === lf || l === uf) {
- const Rr = Ye.objectType, Rn = Ye.indexType, pi = Kl(Rr) || Rr, Yn = Kl(Rn) || Rn;
- if (!dT(pi) && !mT(Yn)) {
- const ds = 4 | (pi !== Rr ? 2 : 0), ro = D1(pi, Yn, ds);
- if (ro) {
- if (kt && Er && Jn(it), Dt = un(
- Je,
- ro,
- 2,
- kt,
- /*headMessage*/
- void 0,
- tr
- ))
- return Dt;
- kt && Er && j && (j = nr([Er]) <= nr([j]) ? Er : j);
- }
- }
- }
- kt && (Er = void 0);
- } else if (R_(Ye) && l !== I_) {
- const Rr = !!Ye.declaration.nameType, Rn = r0(Ye), pi = xg(Ye);
- if (!(pi & 8)) {
- if (!Rr && Rn.flags & 8388608 && Rn.objectType === Je && Rn.indexType === $d(Ye))
- return -1;
- if (!R_(Je)) {
- const Yn = Rr ? ny(Ye) : Yf(Ye), ds = Jm(
- Je,
- 2
- /* NoIndexSignatures */
- ), ro = pi & 4, ru = ro ? wL(Yn, ds) : void 0;
- if (ro ? !(ru.flags & 131072) : un(
- Yn,
- ds,
- 3
- /* Both */
- )) {
- const T_ = r0(Ye), cd = $d(Ye), ab = RP(
- T_,
- -98305
- /* Nullable */
- );
- if (!Rr && ab.flags & 8388608 && ab.indexType === cd) {
- if (Dt = un(Je, ab.objectType, 2, kt))
- return Dt;
- } else {
- const tm = Rr ? ru || Yn : ru ? ia([ru, cd]) : cd, fy = j_(Je, tm);
- if (Dt = un(fy, T_, 3, kt))
- return Dt;
- }
- }
- Er = j, Jn(it);
- }
- }
- } else if (Zr & 16777216) {
- if (Jk(Ye, Ze, Gt, 10))
- return 3;
- const Rr = Ye;
- if (!Rr.root.inferTypeParameters && !ftt(Rr.root) && !(Je.flags & 16777216 && Je.root === Rr.root)) {
- const Rn = !$s(EN(Rr.checkType), EN(Rr.extendsType)), pi = !Rn && $s(hT(Rr.checkType), hT(Rr.extendsType));
- if ((Dt = Rn ? -1 : un(
- Je,
- Qv(Rr),
- 2,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- )) && (Dt &= pi ? -1 : un(
- Je,
- Yv(Rr),
- 2,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- ), Dt))
- return Dt;
- }
- } else if (Zr & 134217728) {
- if (ur & 134217728) {
- if (l === uf)
- return Brt(Je, Ye) ? 0 : -1;
- zi(Je, ca);
- }
- if (r$(Je, Ye))
- return -1;
- } else if (Ye.flags & 268435456 && !(Je.flags & 268435456) && t$(Je, Ye))
- return -1;
- if (ur & 8650752) {
- if (!(ur & 8388608 && Zr & 8388608)) {
- const Rr = lT(Je) || M;
- if (Dt = un(
- Rr,
- Ye,
- 1,
- /*reportErrors*/
- !1,
- /*headMessage*/
- void 0,
- tr
- ))
- return Dt;
- if (Dt = un(
- df(Rr, Je),
- Ye,
- 1,
- kt && Rr !== M && !(Zr & ur & 262144),
- /*headMessage*/
- void 0,
- tr
- ))
- return Dt;
- if (M_e(Je)) {
- const Rn = lT(Je.indexType);
- if (Rn && (Dt = un(j_(Je.objectType, Rn), Ye, 1, kt)))
- return Dt;
- }
- }
- } else if (ur & 4194304) {
- const Rr = mfe(Je.type, Je.indexFlags) && wn(Je.type) & 32;
- if (Dt = un(Ft, Ye, 1, kt && !Rr))
- return Dt;
- if (Rr) {
- const Rn = Je.type, pi = ny(Rn), Yn = pi && cE(Rn) ? Df(pi, Rn) : pi || Yf(Rn);
- if (Dt = un(Yn, Ye, 1, kt))
- return Dt;
- }
- } else if (ur & 134217728 && !(Zr & 524288)) {
- if (!(Zr & 134217728)) {
- const Rr = Kl(Je);
- if (Rr && Rr !== Je && (Dt = un(Rr, Ye, 1, kt)))
- return Dt;
- }
- } else if (ur & 268435456)
- if (Zr & 268435456) {
- if (Je.symbol !== Ye.symbol)
- return 0;
- if (Dt = un(Je.type, Ye.type, 3, kt))
- return Dt;
- } else {
- const Rr = Kl(Je);
- if (Rr && (Dt = un(Rr, Ye, 1, kt)))
- return Dt;
- }
- else if (ur & 16777216) {
- if (Jk(Je, de, mt, 10))
- return 3;
- if (Zr & 16777216) {
- const pi = Je.root.inferTypeParameters;
- let Yn = Je.extendsType, ds;
- if (pi) {
- const ro = FN(
- pi,
- /*signature*/
- void 0,
- 0,
- wi
- );
- u0(
- ro.inferences,
- Ye.extendsType,
- Yn,
- 1536
- /* AlwaysStrict */
- ), Yn = zi(Yn, ro.mapper), ds = ro.mapper;
- }
- if (hh(Yn, Ye.extendsType) && (un(
- Je.checkType,
- Ye.checkType,
- 3
- /* Both */
- ) || un(
- Ye.checkType,
- Je.checkType,
- 3
- /* Both */
- )) && ((Dt = un(zi(Qv(Je), ds), Qv(Ye), 3, kt)) && (Dt &= un(Yv(Je), Yv(Ye), 3, kt)), Dt))
- return Dt;
- }
- const Rr = O_e(Je);
- if (Rr && (Dt = un(Rr, Ye, 1, kt)))
- return Dt;
- const Rn = !(Zr & 16777216) && OL(Je) ? KPe(Je) : void 0;
- if (Rn && (Jn(it), Dt = un(Rn, Ye, 1, kt)))
- return Dt;
- } else {
- if (l !== sh && l !== Hf && gKe(Ye) && a0(Je))
- return -1;
- if (R_(Ye))
- return R_(Je) && (Dt = Pt(Je, Ye, kt)) ? Dt : 0;
- const Rr = !!(ur & 402784252);
- if (l !== I_)
- Je = Uu(Je), ur = Je.flags;
- else if (R_(Je))
- return 0;
- if (wn(Je) & 4 && wn(Ye) & 4 && Je.target === Ye.target && !ha(Je) && !(BG(Je) || BG(Ye))) {
- if (VG(Je))
- return -1;
- const Rn = jfe(Je.target);
- if (Rn === Ue)
- return 1;
- const pi = Gr(Io(Je), Io(Ye), Rn, tr);
- if (pi !== void 0)
- return pi;
- } else {
- if (IP(Ye) ? z_(Je, Kv) : Dp(Ye) && z_(Je, (Rn) => ha(Rn) && !Rn.target.readonly))
- return l !== I_ ? un($v(Je, At) || xe, $v(Ye, At) || xe, 3, kt) : 0;
- if (A1(Je) && ha(Ye) && !A1(Ye)) {
- const Rn = kg(Je);
- if (Rn !== Je)
- return un(Rn, Ye, 1, kt);
- } else if ((l === sh || l === Hf) && a0(Ye) && wn(Ye) & 8192 && !a0(Je))
- return 0;
- }
- if (ur & 2621440 && Zr & 524288) {
- const Rn = kt && j === it.errorInfo && !Rr;
- if (Dt = ea(
- Je,
- Ye,
- Rn,
- /*excludedProperties*/
- void 0,
- /*optionalsOnly*/
- !1,
- tr
- ), Dt && (Dt &= So(Je, Ye, 0, Rn, tr), Dt && (Dt &= So(Je, Ye, 1, Rn, tr), Dt && (Dt &= gi(Je, Ye, Rr, Rn, tr)))), St && Dt)
- j = Er || j || it.errorInfo;
- else if (Dt)
- return Dt;
- }
- if (ur & 2621440 && Zr & 1048576) {
- const Rn = RP(
- Ye,
- 36175872
- /* Substitution */
- );
- if (Rn.flags & 1048576) {
- const pi = cr(Je, Rn);
- if (pi)
- return pi;
- }
- }
- }
- return 0;
- function nr(Rr) {
- return Rr ? Hu(Rr, (Rn, pi) => Rn + 1 + nr(pi.next), 0) : 0;
- }
- function Gr(Rr, Rn, pi, Yn) {
- if (Dt = EE(Rr, Rn, pi, kt, Yn))
- return Dt;
- if (ut(pi, (ro) => !!(ro & 24))) {
- Er = void 0, Jn(it);
- return;
- }
- const ds = Rn && ert(Rn, pi);
- if (St = !ds, pi !== Ue && !ds) {
- if (St && !(kt && ut(
- pi,
- (ro) => (ro & 7) === 0
- /* Invariant */
- )))
- return 0;
- Er = j, Jn(it);
- }
- }
- }
- function Pt(Je, Ye, kt) {
- if (l === uf || (l === I_ ? xg(Je) === xg(Ye) : CP(Je) <= CP(Ye))) {
- let it;
- const Dt = Yf(Ye), Er = zi(Yf(Je), CP(Je) < 0 ? Ll : ca);
- if (it = un(Dt, Er, 3, kt)) {
- const St = B_([$d(Je)], [$d(Ye)]);
- if (zi(ny(Je), St) === zi(ny(Ye), St))
- return it & un(zi(r0(Je), St), r0(Ye), 3, kt);
- }
- }
- return 0;
- }
- function cr(Je, Ye) {
- var kt;
- const tr = qa(Je), it = fAe(tr, Ye);
- if (!it) return 0;
- let Dt = 1;
- for (const Gr of it)
- if (Dt *= dnt(x1(Gr)), Dt > 25)
- return (kt = rn) == null || kt.instant(rn.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: Je.id, targetId: Ye.id, numCombinations: Dt }), 0;
- const Er = new Array(it.length), St = /* @__PURE__ */ new Set();
- for (let Gr = 0; Gr < it.length; Gr++) {
- const Rr = it[Gr], Rn = x1(Rr);
- Er[Gr] = Rn.flags & 1048576 ? Rn.types : [Rn], St.add(Rr.escapedName);
- }
- const ur = wX(Er), Zr = [];
- for (const Gr of ur) {
- let Rr = !1;
- e:
- for (const Rn of Ye.types) {
- for (let pi = 0; pi < it.length; pi++) {
- const Yn = it[pi], ds = Gs(Rn, Yn.escapedName);
- if (!ds) continue e;
- if (Yn === ds) continue;
- if (!xn(
- Je,
- Ye,
- Yn,
- ds,
- (ru) => Gr[pi],
- /*reportErrors*/
- !1,
- 0,
- /*skipOptional*/
- ee || l === uf
- ))
- continue e;
- }
- tp(Zr, Rn, by), Rr = !0;
- }
- if (!Rr)
- return 0;
- }
- let nr = -1;
- for (const Gr of Zr)
- if (nr &= ea(
- Je,
- Gr,
- /*reportErrors*/
- !1,
- St,
- /*optionalsOnly*/
- !1,
- 0
- /* None */
- ), nr && (nr &= So(
- Je,
- Gr,
- 0,
- /*reportErrors*/
- !1,
- 0
- /* None */
- ), nr && (nr &= So(
- Je,
- Gr,
- 1,
- /*reportErrors*/
- !1,
- 0
- /* None */
- ), nr && !(ha(Je) && ha(Gr)) && (nr &= gi(
- Je,
- Gr,
- /*sourceIsPrimitive*/
- !1,
- /*reportErrors*/
- !1,
- 0
- /* None */
- )))), !nr)
- return nr;
- return nr;
- }
- function Or(Je, Ye) {
- if (!Ye || Je.length === 0) return Je;
- let kt;
- for (let tr = 0; tr < Je.length; tr++)
- Ye.has(Je[tr].escapedName) ? kt || (kt = Je.slice(0, tr)) : kt && kt.push(Je[tr]);
- return kt || Je;
- }
- function Ur(Je, Ye, kt, tr, it) {
- const Dt = ee && !!(gc(Ye) & 48), Er = cl(
- x1(Ye),
- /*isProperty*/
- !1,
- Dt
- ), St = kt(Je);
- return un(
- St,
- Er,
- 3,
- tr,
- /*headMessage*/
- void 0,
- it
- );
- }
- function xn(Je, Ye, kt, tr, it, Dt, Er, St) {
- const ur = lp(kt), Zr = lp(tr);
- if (ur & 2 || Zr & 2) {
- if (kt.valueDeclaration !== tr.valueDeclaration)
- return Dt && (ur & 2 && Zr & 2 ? ls(p.Types_have_separate_declarations_of_a_private_property_0, Ji(tr)) : ls(p.Property_0_is_private_in_type_1_but_not_in_type_2, Ji(tr), Hr(ur & 2 ? Je : Ye), Hr(ur & 2 ? Ye : Je))), 0;
- } else if (Zr & 4) {
- if (!srt(kt, tr))
- return Dt && ls(p.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, Ji(tr), Hr(Bk(kt) || Je), Hr(Bk(tr) || Ye)), 0;
- } else if (ur & 4)
- return Dt && ls(p.Property_0_is_protected_in_type_1_but_public_in_type_2, Ji(tr), Hr(Je), Hr(Ye)), 0;
- if (l === Hf && em(kt) && !em(tr))
- return 0;
- const nr = Ur(kt, tr, it, Dt, Er);
- return nr ? !St && kt.flags & 16777216 && tr.flags & 106500 && !(tr.flags & 16777216) ? (Dt && ls(p.Property_0_is_optional_in_type_1_but_required_in_type_2, Ji(tr), Hr(Je), Hr(Ye)), 0) : nr : (Dt && js(p.Types_of_property_0_are_incompatible, Ji(tr)), 0);
- }
- function Kn(Je, Ye, kt, tr) {
- let it = !1;
- if (kt.valueDeclaration && Vl(kt.valueDeclaration) && Di(kt.valueDeclaration.name) && Je.symbol && Je.symbol.flags & 32) {
- const Er = kt.valueDeclaration.name.escapedText, St = v3(Je.symbol, Er);
- if (St && Gs(Je, St)) {
- const ur = A.getDeclarationName(Je.symbol.valueDeclaration), Zr = A.getDeclarationName(Ye.symbol.valueDeclaration);
- ls(
- p.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2,
- Tp(Er),
- Tp(ur.escapedText === "" ? Gz : ur),
- Tp(Zr.escapedText === "" ? Gz : Zr)
- );
- return;
- }
- }
- const Dt = as(epe(
- Je,
- Ye,
- tr,
- /*matchDiscriminantProperties*/
- !1
- ));
- if ((!m || m.code !== p.Class_0_incorrectly_implements_interface_1.code && m.code !== p.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code) && (it = !0), Dt.length === 1) {
- const Er = Ji(
- kt,
- /*enclosingDeclaration*/
- void 0,
- 0,
- 20
- /* WriteComputedProps */
- );
- ls(p.Property_0_is_missing_in_type_1_but_required_in_type_2, Er, ...vP(Je, Ye)), Nr(kt.declarations) && Jl(Kr(kt.declarations[0], p._0_is_declared_here, Er)), it && j && tn++;
- } else Wr(
- Je,
- Ye,
- /*reportErrors*/
- !1
- ) && (Dt.length > 5 ? ls(p.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, Hr(Je), Hr(Ye), lr(Dt.slice(0, 4), (Er) => Ji(Er)).join(", "), Dt.length - 4) : ls(p.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, Hr(Je), Hr(Ye), lr(Dt, (Er) => Ji(Er)).join(", ")), it && j && tn++);
- }
- function ea(Je, Ye, kt, tr, it, Dt) {
- if (l === I_)
- return ua(Je, Ye, tr);
- let Er = -1;
- if (ha(Ye)) {
- if (Kv(Je)) {
- if (!Ye.target.readonly && (IP(Je) || ha(Je) && Je.target.readonly))
- return 0;
- const Gr = sy(Je), Rr = sy(Ye), Rn = ha(Je) ? Je.target.combinedFlags & 4 : 4, pi = !!(Ye.target.combinedFlags & 12), Yn = ha(Je) ? Je.target.minLength : 0, ds = Ye.target.minLength;
- if (!Rn && Gr < ds)
- return kt && ls(p.Source_has_0_element_s_but_target_requires_1, Gr, ds), 0;
- if (!pi && Rr < Yn)
- return kt && ls(p.Source_has_0_element_s_but_target_allows_only_1, Yn, Rr), 0;
- if (!pi && (Rn || Rr < Gr))
- return kt && (Yn < ds ? ls(p.Target_requires_0_element_s_but_source_may_have_fewer, ds) : ls(p.Target_allows_only_0_element_s_but_source_may_have_more, Rr)), 0;
- const ro = Io(Je), ru = Io(Ye), T_ = Net(
- Ye.target,
- 11
- /* NonRest */
- ), cd = SN(
- Ye.target,
- 11
- /* NonRest */
- );
- let ab = !!tr;
- for (let tm = 0; tm < Gr; tm++) {
- const fy = ha(Je) ? Je.target.elementFlags[tm] : 4, XP = Gr - 1 - tm, x_ = pi && tm >= T_ ? Rr - 1 - Math.min(XP, cd) : tm, L1 = Ye.target.elementFlags[x_];
- if (L1 & 8 && !(fy & 8))
- return kt && ls(p.Source_provides_no_match_for_variadic_element_at_position_0_in_target, x_), 0;
- if (fy & 8 && !(L1 & 12))
- return kt && ls(p.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, tm, x_), 0;
- if (L1 & 1 && !(fy & 1))
- return kt && ls(p.Source_provides_no_match_for_required_element_at_position_0_in_target, x_), 0;
- if (ab && ((fy & 12 || L1 & 12) && (ab = !1), ab && tr?.has("" + tm)))
- continue;
- const QP = l0(ro[tm], !!(fy & L1 & 2)), aI = ru[x_], oI = fy & 8 && L1 & 4 ? du(aI) : l0(aI, !!(L1 & 2)), wT = un(
- QP,
- oI,
- 3,
- kt,
- /*headMessage*/
- void 0,
- Dt
- );
- if (!wT)
- return kt && (Rr > 1 || Gr > 1) && (pi && tm >= T_ && XP >= cd && T_ !== Gr - cd - 1 ? js(p.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, T_, Gr - cd - 1, x_) : js(p.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, tm, x_)), 0;
- Er &= wT;
- }
- return Er;
- }
- if (Ye.target.combinedFlags & 12)
- return 0;
- }
- const St = (l === sh || l === Hf) && !cy(Je) && !VG(Je) && !ha(Je), ur = tpe(
- Je,
- Ye,
- St,
- /*matchDiscriminantProperties*/
- !1
- );
- if (ur)
- return kt && Ee(Je, Ye) && Kn(Je, Ye, ur, St), 0;
- if (cy(Ye)) {
- for (const Gr of Or(qa(Je), tr))
- if (!k2(Ye, Gr.escapedName) && !(nn(Gr).flags & 32768))
- return kt && ls(p.Property_0_does_not_exist_on_type_1, Ji(Gr), Hr(Ye)), 0;
- }
- const Zr = qa(Ye), nr = ha(Je) && ha(Ye);
- for (const Gr of Or(Zr, tr)) {
- const Rr = Gr.escapedName;
- if (!(Gr.flags & 4194304) && (!nr || qg(Rr) || Rr === "length") && (!it || Gr.flags & 16777216)) {
- const Rn = Gs(Je, Rr);
- if (Rn && Rn !== Gr) {
- const pi = xn(Je, Ye, Rn, Gr, x1, kt, Dt, l === uf);
- if (!pi)
- return 0;
- Er &= pi;
- }
- }
- }
- return Er;
- }
- function ua(Je, Ye, kt) {
- if (!(Je.flags & 524288 && Ye.flags & 524288))
- return 0;
- const tr = Or(iy(Je), kt), it = Or(iy(Ye), kt);
- if (tr.length !== it.length)
- return 0;
- let Dt = -1;
- for (const Er of tr) {
- const St = k2(Ye, Er.escapedName);
- if (!St)
- return 0;
- const ur = Jfe(Er, St, un);
- if (!ur)
- return 0;
- Dt &= ur;
- }
- return Dt;
- }
- function So(Je, Ye, kt, tr, it) {
- var Dt, Er;
- if (l === I_)
- return hn(Je, Ye, kt);
- if (Ye === ba || Je === ba)
- return -1;
- const St = Je.symbol && qm(Je.symbol.valueDeclaration), ur = Ye.symbol && qm(Ye.symbol.valueDeclaration), Zr = Ns(
- Je,
- St && kt === 1 ? 0 : kt
- ), nr = Ns(
- Ye,
- ur && kt === 1 ? 0 : kt
- );
- if (kt === 1 && Zr.length && nr.length) {
- const Yn = !!(Zr[0].flags & 4), ds = !!(nr[0].flags & 4);
- if (Yn && !ds)
- return tr && ls(p.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type), 0;
- if (!Ps(Zr[0], nr[0], tr))
- return 0;
- }
- let Gr = -1;
- const Rr = kt === 1 ? Ut : pe, Rn = wn(Je), pi = wn(Ye);
- if (Rn & 64 && pi & 64 && Je.symbol === Ye.symbol || Rn & 4 && pi & 4 && Je.target === Ye.target) {
- E.assertEqual(Zr.length, nr.length);
- for (let Yn = 0; Yn < nr.length; Yn++) {
- const ds = vr(
- Zr[Yn],
- nr[Yn],
- /*erase*/
- !0,
- tr,
- it,
- Rr(Zr[Yn], nr[Yn])
- );
- if (!ds)
- return 0;
- Gr &= ds;
- }
- } else if (Zr.length === 1 && nr.length === 1) {
- const Yn = l === uf, ds = xa(Zr), ro = xa(nr);
- if (Gr = vr(ds, ro, Yn, tr, it, Rr(ds, ro)), !Gr && tr && kt === 1 && Rn & pi && (((Dt = ro.declaration) == null ? void 0 : Dt.kind) === 176 || ((Er = ds.declaration) == null ? void 0 : Er.kind) === 176)) {
- const ru = (T_) => qv(
- T_,
- /*enclosingDeclaration*/
- void 0,
- 262144,
- kt
- );
- return ls(p.Type_0_is_not_assignable_to_type_1, ru(ds), ru(ro)), ls(p.Types_of_construct_signatures_are_incompatible), Gr;
- }
- } else
- e:
- for (const Yn of nr) {
- const ds = Us();
- let ro = tr;
- for (const ru of Zr) {
- const T_ = vr(
- ru,
- Yn,
- /*erase*/
- !0,
- ro,
- it,
- Rr(ru, Yn)
- );
- if (T_) {
- Gr &= T_, Jn(ds);
- continue e;
- }
- ro = !1;
- }
- return ro && ls(p.Type_0_provides_no_match_for_the_signature_1, Hr(Je), qv(
- Yn,
- /*enclosingDeclaration*/
- void 0,
- /*flags*/
- void 0,
- kt
- )), 0;
- }
- return Gr;
- }
- function Ee(Je, Ye) {
- const kt = LL(
- Je,
- 0
- /* Call */
- ), tr = LL(
- Je,
- 1
- /* Construct */
- ), it = iy(Je);
- return (kt.length || tr.length) && !it.length ? !!(Ns(
- Ye,
- 0
- /* Call */
- ).length && kt.length || Ns(
- Ye,
- 1
- /* Construct */
- ).length && tr.length) : !0;
- }
- function pe(Je, Ye) {
- return Je.parameters.length === 0 && Ye.parameters.length === 0 ? (kt, tr) => js(p.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, Hr(kt), Hr(tr)) : (kt, tr) => js(p.Call_signature_return_types_0_and_1_are_incompatible, Hr(kt), Hr(tr));
- }
- function Ut(Je, Ye) {
- return Je.parameters.length === 0 && Ye.parameters.length === 0 ? (kt, tr) => js(p.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, Hr(kt), Hr(tr)) : (kt, tr) => js(p.Construct_signature_return_types_0_and_1_are_incompatible, Hr(kt), Hr(tr));
- }
- function vr(Je, Ye, kt, tr, it, Dt) {
- const Er = l === sh ? 16 : l === Hf ? 24 : 0;
- return Ife(kt ? bN(Je) : Je, kt ? bN(Ye) : Ye, Er, tr, ls, Dt, St, ca);
- function St(ur, Zr, nr) {
- return un(
- ur,
- Zr,
- 3,
- nr,
- /*headMessage*/
- void 0,
- it
- );
- }
- }
- function hn(Je, Ye, kt) {
- const tr = Ns(Je, kt), it = Ns(Ye, kt);
- if (tr.length !== it.length)
- return 0;
- let Dt = -1;
- for (let Er = 0; Er < tr.length; Er++) {
- const St = rM(
- tr[Er],
- it[Er],
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !1,
- /*ignoreReturnTypes*/
- !1,
- un
- );
- if (!St)
- return 0;
- Dt &= St;
- }
- return Dt;
- }
- function Yr(Je, Ye, kt, tr) {
- let it = -1;
- const Dt = Ye.keyType, Er = Je.flags & 2097152 ? IL(Je) : iy(Je);
- for (const St of Er)
- if (!L3e(Je, St) && Ak(Ok(
- St,
- 8576
- /* StringOrNumberLiteralOrUnique */
- ), Dt)) {
- const ur = x1(St), Zr = oe || ur.flags & 32768 || Dt === At || !(St.flags & 16777216) ? ur : ad(
- ur,
- 524288
- /* NEUndefined */
- ), nr = un(
- Zr,
- Ye.type,
- 3,
- kt,
- /*headMessage*/
- void 0,
- tr
- );
- if (!nr)
- return kt && ls(p.Property_0_is_incompatible_with_index_signature, Ji(St)), 0;
- it &= nr;
- }
- for (const St of wu(Je))
- if (Ak(St.keyType, Dt)) {
- const ur = Qr(St, Ye, kt, tr);
- if (!ur)
- return 0;
- it &= ur;
- }
- return it;
- }
- function Qr(Je, Ye, kt, tr) {
- const it = un(
- Je.type,
- Ye.type,
- 3,
- kt,
- /*headMessage*/
- void 0,
- tr
- );
- return !it && kt && (Je.keyType === Ye.keyType ? ls(p._0_index_signatures_are_incompatible, Hr(Je.keyType)) : ls(p._0_and_1_index_signatures_are_incompatible, Hr(Je.keyType), Hr(Ye.keyType))), it;
- }
- function gi(Je, Ye, kt, tr, it) {
- if (l === I_)
- return ps(Je, Ye);
- const Dt = wu(Ye), Er = ut(Dt, (ur) => ur.keyType === Ie);
- let St = -1;
- for (const ur of Dt) {
- const Zr = l !== Hf && !kt && Er && ur.type.flags & 1 ? -1 : R_(Je) && Er ? un(r0(Je), ur.type, 3, tr) : Xi(Je, ur, tr, it);
- if (!Zr)
- return 0;
- St &= Zr;
- }
- return St;
- }
- function Xi(Je, Ye, kt, tr) {
- const it = hN(Je, Ye.keyType);
- return it ? Qr(it, Ye, kt, tr) : !(tr & 1) && (l !== Hf || wn(Je) & 8192) && QG(Je) ? Yr(Je, Ye, kt, tr) : (kt && ls(p.Index_signature_for_type_0_is_missing_in_type_1, Hr(Ye.keyType), Hr(Je)), 0);
- }
- function ps(Je, Ye) {
- const kt = wu(Je), tr = wu(Ye);
- if (kt.length !== tr.length)
- return 0;
- for (const it of tr) {
- const Dt = dh(Je, it.keyType);
- if (!(Dt && un(
- Dt.type,
- it.type,
- 3
- /* Both */
- ) && Dt.isReadonly === it.isReadonly))
- return 0;
- }
- return -1;
- }
- function Ps(Je, Ye, kt) {
- if (!Je.declaration || !Ye.declaration)
- return !0;
- const tr = ox(
- Je.declaration,
- 6
- /* NonPublicAccessibilityModifier */
- ), it = ox(
- Ye.declaration,
- 6
- /* NonPublicAccessibilityModifier */
- );
- return it === 2 || it === 4 && tr !== 2 || it !== 4 && !tr ? !0 : (kt && ls(p.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type, SP(tr), SP(it)), !1);
- }
- }
- function Lfe(r) {
- if (r.flags & 16)
- return !1;
- if (r.flags & 3145728)
- return !!ir(r.types, Lfe);
- if (r.flags & 465829888) {
- const a = lT(r);
- if (a && a !== r)
- return Lfe(a);
- }
- return Yd(r) || !!(r.flags & 134217728) || !!(r.flags & 268435456);
- }
- function M3e(r, a) {
- return ha(r) && ha(a) ? Ue : qa(a).filter((l) => jG(Rc(r, l.escapedName), nn(l)));
- }
- function jG(r, a) {
- return !!r && !!a && bc(
- r,
- 32768
- /* Undefined */
- ) && !!IN(a);
- }
- function Ztt(r) {
- return qa(r).filter((a) => IN(nn(a)));
- }
- function R3e(r, a, l = Afe) {
- return l7e(r, a, l) || p_t(r, a) || d_t(r, a) || m_t(r, a) || g_t(r, a);
- }
- function Mfe(r, a, l) {
- const f = r.types, m = f.map(
- (x) => x.flags & 402784252 ? 0 : -1
- /* True */
- );
- for (const [x, N] of a) {
- let j = !1;
- for (let W = 0; W < f.length; W++)
- if (m[W]) {
- const Q = Pk(f[W], N);
- Q && Pp(x(), (ye) => !!l(ye, Q)) ? j = !0 : m[W] = 3;
- }
- for (let W = 0; W < f.length; W++)
- m[W] === 3 && (m[W] = j ? 0 : -1);
- }
- const y = ss(
- m,
- 0
- /* False */
- ) ? Qn(
- f.filter((x, N) => m[N]),
- 0
- /* None */
- ) : r;
- return y.flags & 131072 ? r : y;
- }
- function Rfe(r) {
- if (r.flags & 524288) {
- const a = Xd(r);
- return a.callSignatures.length === 0 && a.constructSignatures.length === 0 && a.indexInfos.length === 0 && a.properties.length > 0 && Mi(a.properties, (l) => !!(l.flags & 16777216));
- }
- return r.flags & 33554432 ? Rfe(r.baseType) : r.flags & 2097152 ? Mi(r.types, Rfe) : !1;
- }
- function Ktt(r, a, l) {
- for (const f of qa(r))
- if (b$(a, f.escapedName, l))
- return !0;
- return !1;
- }
- function jfe(r) {
- return r === Et || r === Lr || r.objectFlags & 8 ? F : B3e(r.symbol, r.typeParameters);
- }
- function j3e(r) {
- return B3e(r, Bi(r).typeParameters);
- }
- function B3e(r, a = Ue) {
- var l, f;
- const m = Bi(r);
- if (!m.variances) {
- (l = rn) == null || l.push(rn.Phase.CheckTypes, "getVariancesWorker", { arity: a.length, id: Rl(bo(r)) });
- const y = di, x = Dn;
- di || (di = !0, Dn = fr.length), m.variances = Ue;
- const N = [];
- for (const j of a) {
- const W = Bfe(j);
- let Q = W & 16384 ? W & 8192 ? 0 : 1 : W & 8192 ? 2 : void 0;
- if (Q === void 0) {
- let ye = !1, de = !1;
- const Ze = vi;
- vi = (Gt) => Gt ? de = !0 : ye = !0;
- const ct = eM(r, j, Wc), mt = eM(r, j, of);
- Q = ($s(mt, ct) ? 1 : 0) | ($s(ct, mt) ? 2 : 0), Q === 3 && $s(eM(r, j, Ao), ct) && (Q = 4), vi = Ze, (ye || de) && (ye && (Q |= 8), de && (Q |= 16));
- }
- N.push(Q);
- }
- y || (di = !1, Dn = x), m.variances = N, (f = rn) == null || f.pop({ variances: N.map(E.formatVariance) });
- }
- return m.variances;
- }
- function eM(r, a, l) {
- const f = N2(a, l), m = bo(r);
- if (H(m))
- return m;
- const y = r.flags & 524288 ? _E(r, gh(Bi(r).typeParameters, f)) : n0(m, gh(m.typeParameters, f));
- return te.add(Rl(y)), y;
- }
- function BG(r) {
- return te.has(Rl(r));
- }
- function Bfe(r) {
- var a;
- return Hu(
- (a = r.symbol) == null ? void 0 : a.declarations,
- (l, f) => l | Mu(f),
- 0
- /* None */
- ) & 28672;
- }
- function ert(r, a) {
- for (let l = 0; l < a.length; l++)
- if ((a[l] & 7) === 1 && r[l].flags & 16384)
- return !0;
- return !1;
- }
- function trt(r) {
- return r.flags & 262144 && !s_(r);
- }
- function rrt(r) {
- return !!(wn(r) & 4) && !r.node;
- }
- function JG(r) {
- return rrt(r) && ut(Io(r), (a) => !!(a.flags & 262144) || JG(a));
- }
- function nrt(r, a, l, f) {
- const m = [];
- let y = "";
- const x = j(r, 0), N = j(a, 0);
- return `${y}${x},${N}${l}`;
- function j(W, Q = 0) {
- let ye = "" + W.target.id;
- for (const de of Io(W)) {
- if (de.flags & 262144) {
- if (f || trt(de)) {
- let Ze = m.indexOf(de);
- Ze < 0 && (Ze = m.length, m.push(de)), ye += "=" + Ze;
- continue;
- }
- y = "*";
- } else if (Q < 4 && JG(de)) {
- ye += "<" + j(de, Q + 1) + ">";
- continue;
- }
- ye += "-" + de.id;
- }
- return ye;
- }
- }
- function zG(r, a, l, f, m) {
- if (f === I_ && r.id > a.id) {
- const x = r;
- r = a, a = x;
- }
- const y = l ? ":" + l : "";
- return JG(r) && JG(a) ? nrt(r, a, y, m) : `${r.id},${a.id}${y}`;
- }
- function tM(r, a) {
- if (gc(r) & 6) {
- for (const l of r.links.containingType.types) {
- const f = Gs(l, r.escapedName), m = f && tM(f, a);
- if (m)
- return m;
- }
- return;
- }
- return a(r);
- }
- function Bk(r) {
- return r.parent && r.parent.flags & 32 ? bo(Cf(r)) : void 0;
- }
- function WG(r) {
- const a = Bk(r), l = a && No(a)[0];
- return l && Rc(l, r.escapedName);
- }
- function irt(r, a) {
- return tM(r, (l) => {
- const f = Bk(l);
- return f ? iE(f, a) : !1;
- });
- }
- function srt(r, a) {
- return !tM(a, (l) => lp(l) & 4 ? !irt(r, Bk(l)) : !1);
- }
- function J3e(r, a, l) {
- return tM(a, (f) => lp(f, l) & 4 ? !iE(r, Bk(f)) : !1) ? void 0 : r;
- }
- function Jk(r, a, l, f = 3) {
- if (l >= f) {
- if ((wn(r) & 96) === 96 && (r = z3e(r)), r.flags & 2097152)
- return ut(r.types, (N) => Jk(N, a, l, f));
- const m = UG(r);
- let y = 0, x = 0;
- for (let N = 0; N < l; N++) {
- const j = a[N];
- if (W3e(j, m)) {
- if (j.id >= x && (y++, y >= f))
- return !0;
- x = j.id;
- }
- }
- }
- return !1;
- }
- function z3e(r) {
- let a;
- for (; (wn(r) & 96) === 96 && (a = x2(r)) && (a.symbol || a.flags & 2097152 && ut(a.types, (l) => !!l.symbol)); )
- r = a;
- return r;
- }
- function W3e(r, a) {
- return (wn(r) & 96) === 96 && (r = z3e(r)), r.flags & 2097152 ? ut(r.types, (l) => W3e(l, a)) : UG(r) === a;
- }
- function UG(r) {
- if (r.flags & 524288 && !npe(r)) {
- if (wn(r) & 4 && r.node)
- return r.node;
- if (r.symbol && !(wn(r) & 16 && r.symbol.flags & 32))
- return r.symbol;
- if (ha(r))
- return r.target;
- }
- if (r.flags & 262144)
- return r.symbol;
- if (r.flags & 8388608) {
- do
- r = r.objectType;
- while (r.flags & 8388608);
- return r;
- }
- return r.flags & 16777216 ? r.root : r;
- }
- function art(r, a) {
- return Jfe(r, a, DN) !== 0;
- }
- function Jfe(r, a, l) {
- if (r === a)
- return -1;
- const f = lp(r) & 6, m = lp(a) & 6;
- if (f !== m)
- return 0;
- if (f) {
- if (CE(r) !== CE(a))
- return 0;
- } else if ((r.flags & 16777216) !== (a.flags & 16777216))
- return 0;
- return em(r) !== em(a) ? 0 : l(nn(r), nn(a));
- }
- function ort(r, a, l) {
- const f = W_(r), m = W_(a), y = Hm(r), x = Hm(a), N = Pg(r), j = Pg(a);
- return !!(f === m && y === x && N === j || l && y <= x);
- }
- function rM(r, a, l, f, m, y) {
- if (r === a)
- return -1;
- if (!ort(r, a, l) || Nr(r.typeParameters) !== Nr(a.typeParameters))
- return 0;
- if (a.typeParameters) {
- const j = B_(r.typeParameters, a.typeParameters);
- for (let W = 0; W < a.typeParameters.length; W++) {
- const Q = r.typeParameters[W], ye = a.typeParameters[W];
- if (!(Q === ye || y(zi(PP(Q), j) || M, PP(ye) || M) && y(zi(C2(Q), j) || M, C2(ye) || M)))
- return 0;
- }
- r = jk(
- r,
- j,
- /*eraseTypeParameters*/
- !0
- );
- }
- let x = -1;
- if (!f) {
- const j = Xv(r);
- if (j) {
- const W = Xv(a);
- if (W) {
- const Q = y(j, W);
- if (!Q)
- return 0;
- x &= Q;
- }
- }
- }
- const N = W_(a);
- for (let j = 0; j < N; j++) {
- const W = Kd(r, j), Q = Kd(a, j), ye = y(Q, W);
- if (!ye)
- return 0;
- x &= ye;
- }
- if (!m) {
- const j = Cp(r), W = Cp(a);
- x &= j || W ? crt(j, W, y) : y(Ha(r), Ha(a));
- }
- return x;
- }
- function crt(r, a, l) {
- return r && a && ffe(r, a) ? r.type === a.type ? -1 : r.type && a.type ? l(r.type, a.type) : 0 : 0;
- }
- function lrt(r) {
- let a;
- for (const l of r)
- if (!(l.flags & 131072)) {
- const f = o0(l);
- if (a ?? (a = f), f === l || f !== a)
- return !1;
- }
- return !0;
- }
- function U3e(r) {
- return Hu(r, (a, l) => a | (l.flags & 1048576 ? U3e(l.types) : l.flags), 0);
- }
- function urt(r) {
- if (r.length === 1)
- return r[0];
- const a = ee ? qc(r, (f) => Vc(f, (m) => !(m.flags & 98304))) : r, l = lrt(a) ? Qn(a) : Hu(a, (f, m) => O2(f, m) ? m : f);
- return a === r ? l : sM(
- l,
- U3e(r) & 98304
- /* Nullable */
- );
- }
- function _rt(r) {
- return Hu(r, (a, l) => O2(l, a) ? l : a);
- }
- function Dp(r) {
- return !!(wn(r) & 4) && (r.target === Et || r.target === Lr);
- }
- function IP(r) {
- return !!(wn(r) & 4) && r.target === Lr;
- }
- function Kv(r) {
- return Dp(r) || ha(r);
- }
- function nM(r) {
- return Dp(r) && !IP(r) || ha(r) && !r.target.readonly;
- }
- function iM(r) {
- return Dp(r) ? Io(r)[0] : void 0;
- }
- function oy(r) {
- return Dp(r) || !(r.flags & 98304) && $s(r, Uc);
- }
- function zfe(r) {
- return nM(r) || !(r.flags & 98305) && $s(r, so);
- }
- function Wfe(r) {
- if (!(wn(r) & 4) || !(wn(r.target) & 3))
- return;
- if (wn(r) & 33554432)
- return wn(r) & 67108864 ? r.cachedEquivalentBaseType : void 0;
- r.objectFlags |= 33554432;
- const a = r.target;
- if (wn(a) & 1) {
- const m = Pn(a);
- if (m && m.expression.kind !== 80 && m.expression.kind !== 211)
- return;
- }
- const l = No(a);
- if (l.length !== 1 || k1(r.symbol).size)
- return;
- let f = Nr(a.typeParameters) ? zi(l[0], B_(a.typeParameters, Io(r).slice(0, a.typeParameters.length))) : l[0];
- return Nr(Io(r)) > Nr(a.typeParameters) && (f = df(f, _a(Io(r)))), r.objectFlags |= 67108864, r.cachedEquivalentBaseType = f;
- }
- function V3e(r) {
- return ee ? r === zt : r === dt;
- }
- function VG(r) {
- const a = iM(r);
- return !!a && V3e(a);
- }
- function OP(r) {
- let a;
- return ha(r) || !!Gs(r, "0") || oy(r) && !!(a = Rc(r, "length")) && z_(a, (l) => !!(l.flags & 256));
- }
- function qG(r) {
- return oy(r) || OP(r);
- }
- function q3e(r, a) {
- const l = Rc(r, "" + a);
- if (l)
- return l;
- if (z_(r, ha))
- return X3e(r, a, O.noUncheckedIndexedAccess ? Ae : void 0);
- }
- function frt(r) {
- return !(r.flags & 240544);
- }
- function Yd(r) {
- return !!(r.flags & 109472);
- }
- function H3e(r) {
- const a = kg(r);
- return a.flags & 2097152 ? ut(a.types, Yd) : Yd(a);
- }
- function prt(r) {
- return r.flags & 2097152 && On(r.types, Yd) || r;
- }
- function AN(r) {
- return r.flags & 16 ? !0 : r.flags & 1048576 ? r.flags & 1024 ? !0 : Mi(r.types, Yd) : Yd(r);
- }
- function o0(r) {
- return r.flags & 1056 ? pG(r) : r.flags & 402653312 ? Ie : r.flags & 256 ? At : r.flags & 2048 ? Dr : r.flags & 512 ? wt : r.flags & 1048576 ? drt(r) : r;
- }
- function drt(r) {
- const a = `B${Rl(r)}`;
- return Jd(a) ?? V0(a, Xo(r, o0));
- }
- function Ufe(r) {
- return r.flags & 402653312 ? Ie : r.flags & 288 ? At : r.flags & 2048 ? Dr : r.flags & 512 ? wt : r.flags & 1048576 ? Xo(r, Ufe) : r;
- }
- function eb(r) {
- return r.flags & 1056 && A2(r) ? pG(r) : r.flags & 128 && A2(r) ? Ie : r.flags & 256 && A2(r) ? At : r.flags & 2048 && A2(r) ? Dr : r.flags & 512 && A2(r) ? wt : r.flags & 1048576 ? Xo(r, eb) : r;
- }
- function G3e(r) {
- return r.flags & 8192 ? jt : r.flags & 1048576 ? Xo(r, G3e) : r;
- }
- function Vfe(r, a) {
- return L$(r, a) || (r = G3e(eb(r))), Vu(r);
- }
- function mrt(r, a, l) {
- if (r && Yd(r)) {
- const f = a ? l ? QN(a) : a : void 0;
- r = Vfe(r, f);
- }
- return r;
- }
- function qfe(r, a, l, f) {
- if (r && Yd(r)) {
- const m = a ? j2(l, a, f) : void 0;
- r = Vfe(r, m);
- }
- return r;
- }
- function ha(r) {
- return !!(wn(r) & 4 && r.target.objectFlags & 8);
- }
- function A1(r) {
- return ha(r) && !!(r.target.combinedFlags & 8);
- }
- function $3e(r) {
- return A1(r) && r.target.elementFlags.length === 1;
- }
- function HG(r) {
- return FP(r, r.target.fixedLength);
- }
- function X3e(r, a, l) {
- return Xo(r, (f) => {
- const m = f, y = HG(m);
- return y ? l && a >= ufe(m.target) ? Qn([y, l]) : y : Ae;
- });
- }
- function grt(r) {
- const a = HG(r);
- return a && du(a);
- }
- function FP(r, a, l = 0, f = !1, m = !1) {
- const y = sy(r) - l;
- if (a < y) {
- const x = Io(r), N = [];
- for (let j = a; j < y; j++) {
- const W = x[j];
- N.push(r.target.elementFlags[j] & 8 ? j_(W, At) : W);
- }
- return f ? ia(N) : Qn(
- N,
- m ? 0 : 1
- /* Literal */
- );
- }
- }
- function hrt(r, a) {
- return sy(r) === sy(a) && Mi(r.target.elementFlags, (l, f) => (l & 12) === (a.target.elementFlags[f] & 12));
- }
- function Q3e({ value: r }) {
- return r.base10Value === "0";
- }
- function Y3e(r) {
- return Vc(r, (a) => Zd(
- a,
- 4194304
- /* Truthy */
- ));
- }
- function yrt(r) {
- return Xo(r, vrt);
- }
- function vrt(r) {
- return r.flags & 4 ? qe : r.flags & 8 ? vt : r.flags & 64 ? qt : r === $r || r === yr || r.flags & 114691 || r.flags & 128 && r.value === "" || r.flags & 256 && r.value === 0 || r.flags & 2048 && Q3e(r) ? r : Ht;
- }
- function sM(r, a) {
- const l = a & ~r.flags & 98304;
- return l === 0 ? r : Qn(l === 32768 ? [r, Ae] : l === 65536 ? [r, ht] : [r, Ae, ht]);
- }
- function N1(r, a = !1) {
- E.assert(ee);
- const l = a ? be : Ae;
- return r === l || r.flags & 1048576 && r.types[0] === l ? r : Qn([r, l]);
- }
- function brt(r) {
- return cf || (cf = pE(
- "NonNullable",
- 524288,
- /*diagnostic*/
- void 0
- ) || ze), cf !== ze ? _E(cf, [r]) : ia([r, xs]);
- }
- function c0(r) {
- return ee ? ST(
- r,
- 2097152
- /* NEUndefinedOrNull */
- ) : r;
- }
- function Z3e(r) {
- return ee ? Qn([r, Z]) : r;
- }
- function GG(r) {
- return ee ? i$(r, Z) : r;
- }
- function $G(r, a, l) {
- return l ? e4(a) ? N1(r) : Z3e(r) : r;
- }
- function NN(r, a) {
- return JI(a) ? c0(r) : hu(a) ? GG(r) : r;
- }
- function l0(r, a) {
- return oe && a ? i$(r, U) : r;
- }
- function IN(r) {
- return r === U || !!(r.flags & 1048576) && r.types[0] === U;
- }
- function XG(r) {
- return oe ? i$(r, U) : ad(
- r,
- 524288
- /* NEUndefined */
- );
- }
- function Srt(r, a) {
- return (r.flags & 524) !== 0 && (a.flags & 28) !== 0;
- }
- function QG(r) {
- const a = wn(r);
- return r.flags & 2097152 ? Mi(r.types, QG) : !!(r.symbol && r.symbol.flags & 7040 && !(r.symbol.flags & 32) && !K$(r)) || !!(a & 4194304) || !!(a & 1024 && QG(r.source));
- }
- function yT(r, a) {
- const l = fa(
- r.flags,
- r.escapedName,
- gc(r) & 8
- /* Readonly */
- );
- l.declarations = r.declarations, l.parent = r.parent, l.links.type = a, l.links.target = r, r.valueDeclaration && (l.valueDeclaration = r.valueDeclaration);
- const f = Bi(r).nameType;
- return f && (l.links.nameType = f), l;
- }
- function Trt(r, a) {
- const l = Js();
- for (const f of iy(r)) {
- const m = nn(f), y = a(m);
- l.set(f.escapedName, y === m ? f : yT(f, y));
- }
- return l;
- }
- function ON(r) {
- if (!(cy(r) && wn(r) & 8192))
- return r;
- const a = r.regularType;
- if (a)
- return a;
- const l = r, f = Trt(r, ON), m = Li(l.symbol, f, l.callSignatures, l.constructSignatures, l.indexInfos);
- return m.flags = l.flags, m.objectFlags |= l.objectFlags & -8193, r.regularType = m, m;
- }
- function K3e(r, a, l) {
- return { parent: r, propertyName: a, siblings: l, resolvedProperties: void 0 };
- }
- function eAe(r) {
- if (!r.siblings) {
- const a = [];
- for (const l of eAe(r.parent))
- if (cy(l)) {
- const f = k2(l, r.propertyName);
- f && TT(nn(f), (m) => {
- a.push(m);
- });
- }
- r.siblings = a;
- }
- return r.siblings;
- }
- function xrt(r) {
- if (!r.resolvedProperties) {
- const a = /* @__PURE__ */ new Map();
- for (const l of eAe(r))
- if (cy(l) && !(wn(l) & 2097152))
- for (const f of qa(l))
- a.set(f.escapedName, f);
- r.resolvedProperties = as(a.values());
- }
- return r.resolvedProperties;
- }
- function krt(r, a) {
- if (!(r.flags & 4))
- return r;
- const l = nn(r), f = a && K3e(
- a,
- r.escapedName,
- /*siblings*/
- void 0
- ), m = Hfe(l, f);
- return m === l ? r : yT(r, m);
- }
- function Crt(r) {
- const a = Tt.get(r.escapedName);
- if (a)
- return a;
- const l = yT(r, be);
- return l.flags |= 16777216, Tt.set(r.escapedName, l), l;
- }
- function Ert(r, a) {
- const l = Js();
- for (const m of iy(r))
- l.set(m.escapedName, krt(m, a));
- if (a)
- for (const m of xrt(a))
- l.has(m.escapedName) || l.set(m.escapedName, Crt(m));
- const f = Li(r.symbol, l, Ue, Ue, qc(wu(r), (m) => Cg(m.keyType, J_(m.type), m.isReadonly)));
- return f.objectFlags |= wn(r) & 266240, f;
- }
- function J_(r) {
- return Hfe(
- r,
- /*context*/
- void 0
- );
- }
- function Hfe(r, a) {
- if (wn(r) & 196608) {
- if (a === void 0 && r.widened)
- return r.widened;
- let l;
- if (r.flags & 98305)
- l = xe;
- else if (cy(r))
- l = Ert(r, a);
- else if (r.flags & 1048576) {
- const f = a || K3e(
- /*parent*/
- void 0,
- /*propertyName*/
- void 0,
- r.types
- ), m = qc(r.types, (y) => y.flags & 98304 ? y : Hfe(y, f));
- l = Qn(
- m,
- ut(m, a0) ? 2 : 1
- /* Literal */
- );
- } else r.flags & 2097152 ? l = ia(qc(r.types, J_)) : Kv(r) && (l = n0(r.target, qc(Io(r), J_)));
- return l && a === void 0 && (r.widened = l), l || r;
- }
- return r;
- }
- function YG(r) {
- var a;
- let l = !1;
- if (wn(r) & 65536) {
- if (r.flags & 1048576)
- if (ut(r.types, a0))
- l = !0;
- else
- for (const f of r.types)
- l || (l = YG(f));
- else if (Kv(r))
- for (const f of Io(r))
- l || (l = YG(f));
- else if (cy(r))
- for (const f of iy(r)) {
- const m = nn(f);
- if (wn(m) & 65536 && (l = YG(m), !l)) {
- const y = (a = f.declarations) == null ? void 0 : a.find((x) => {
- var N;
- return ((N = x.symbol.valueDeclaration) == null ? void 0 : N.parent) === r.symbol.valueDeclaration;
- });
- y && (je(y, p.Object_literal_s_property_0_implicitly_has_an_1_type, Ji(f), Hr(J_(m))), l = !0);
- }
- }
- }
- return l;
- }
- function tb(r, a, l) {
- const f = Hr(J_(a));
- if (cn(r) && !W4(Tr(r), O))
- return;
- let m;
- switch (r.kind) {
- case 226:
- case 172:
- case 171:
- m = ie ? p.Member_0_implicitly_has_an_1_type : p.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
- break;
- case 169:
- const y = r;
- if (Oe(y.name)) {
- const x = G2(y.name);
- if ((Dx(y.parent) || vm(y.parent) || lg(y.parent)) && y.parent.parameters.includes(y) && (Nt(
- y,
- y.name.escapedText,
- 788968,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- ) || x && HB(x))) {
- const N = "arg" + y.parent.parameters.indexOf(y), j = _o(y.name) + (y.dotDotDotToken ? "[]" : "");
- Im(ie, r, p.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, N, j);
- return;
- }
- }
- m = r.dotDotDotToken ? ie ? p.Rest_parameter_0_implicitly_has_an_any_type : p.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : ie ? p.Parameter_0_implicitly_has_an_1_type : p.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
- break;
- case 208:
- if (m = p.Binding_element_0_implicitly_has_an_1_type, !ie)
- return;
- break;
- case 317:
- je(r, p.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, f);
- return;
- case 323:
- ie && ZC(r.parent) && je(r.parent.tagName, p.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, f);
- return;
- case 262:
- case 174:
- case 173:
- case 177:
- case 178:
- case 218:
- case 219:
- if (ie && !r.name) {
- l === 3 ? je(r, p.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, f) : je(r, p.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, f);
- return;
- }
- m = ie ? l === 3 ? p._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : p._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type : p._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;
- break;
- case 200:
- ie && je(r, p.Mapped_object_type_implicitly_has_an_any_template_type);
- return;
- default:
- m = ie ? p.Variable_0_implicitly_has_an_1_type : p.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
- }
- Im(ie, r, m, _o(os(r)), f);
- }
- function ZG(r, a, l) {
- n(() => {
- ie && wn(a) & 65536 && (!l || !Ape(r)) && (YG(a) || tb(r, a, l));
- });
- }
- function Gfe(r, a, l) {
- const f = W_(r), m = W_(a), y = UN(r), x = UN(a), N = x ? m - 1 : m, j = y ? N : Math.min(f, N), W = Xv(r);
- if (W) {
- const Q = Xv(a);
- Q && l(W, Q);
- }
- for (let Q = 0; Q < j; Q++)
- l(Kd(r, Q), Kd(a, Q));
- x && l(OM(
- r,
- j,
- /*readonly*/
- uT(x) && !Pp(x, zfe)
- ), x);
- }
- function $fe(r, a, l) {
- const f = Cp(a);
- if (f) {
- const y = Cp(r);
- if (y && ffe(y, f) && y.type && f.type) {
- l(y.type, f.type);
- return;
- }
- }
- const m = Ha(a);
- I1(m) && l(Ha(r), m);
- }
- function FN(r, a, l, f) {
- return Xfe(r.map(Yfe), a, l, f || Afe);
- }
- function Drt(r, a = 0) {
- return r && Xfe(lr(r.inferences, tAe), r.signature, r.flags | a, r.compareTypes);
- }
- function Xfe(r, a, l, f) {
- const m = {
- inferences: r,
- signature: a,
- flags: l,
- compareTypes: f,
- mapper: Ll,
- // initialize to a noop mapper so the context object is available, but the underlying object shape is right upon construction
- nonFixingMapper: Ll
- };
- return m.mapper = Prt(m), m.nonFixingMapper = wrt(m), m;
- }
- function Prt(r) {
- return Efe(
- lr(r.inferences, (a) => a.typeParameter),
- lr(r.inferences, (a, l) => () => (a.isFixed || (Art(r), KG(r.inferences), a.isFixed = !0), ipe(r, l)))
- );
- }
- function wrt(r) {
- return Efe(
- lr(r.inferences, (a) => a.typeParameter),
- lr(r.inferences, (a, l) => () => ipe(r, l))
- );
- }
- function KG(r) {
- for (const a of r)
- a.isFixed || (a.inferredType = void 0);
- }
- function Qfe(r, a, l) {
- (r.intraExpressionInferenceSites ?? (r.intraExpressionInferenceSites = [])).push({ node: a, type: l });
- }
- function Art(r) {
- if (r.intraExpressionInferenceSites) {
- for (const { node: a, type: l } of r.intraExpressionInferenceSites) {
- const f = a.kind === 174 ? r8e(
- a,
- 2
- /* NoConstraints */
- ) : a_(
- a,
- 2
- /* NoConstraints */
- );
- f && u0(r.inferences, l, f);
- }
- r.intraExpressionInferenceSites = void 0;
- }
- }
- function Yfe(r) {
- return {
- typeParameter: r,
- candidates: void 0,
- contraCandidates: void 0,
- inferredType: void 0,
- priority: void 0,
- topLevel: !0,
- isFixed: !1,
- impliedArity: void 0
- };
- }
- function tAe(r) {
- return {
- typeParameter: r.typeParameter,
- candidates: r.candidates && r.candidates.slice(),
- contraCandidates: r.contraCandidates && r.contraCandidates.slice(),
- inferredType: r.inferredType,
- priority: r.priority,
- topLevel: r.topLevel,
- isFixed: r.isFixed,
- impliedArity: r.impliedArity
- };
- }
- function Nrt(r) {
- const a = Ln(r.inferences, kE);
- return a.length ? Xfe(lr(a, tAe), r.signature, r.flags, r.compareTypes) : void 0;
- }
- function Zfe(r) {
- return r && r.mapper;
- }
- function I1(r) {
- const a = wn(r);
- if (a & 524288)
- return !!(a & 1048576);
- const l = !!(r.flags & 465829888 || r.flags & 524288 && !rAe(r) && (a & 4 && (r.node || ut(Io(r), I1)) || a & 134217728 && Nr(r.outerTypeParameters) || a & 16 && r.symbol && r.symbol.flags & 14384 && r.symbol.declarations || a & 12583968) || r.flags & 3145728 && !(r.flags & 1024) && !rAe(r) && ut(r.types, I1));
- return r.flags & 3899393 && (r.objectFlags |= 524288 | (l ? 1048576 : 0)), l;
- }
- function rAe(r) {
- if (r.aliasSymbol && !r.aliasTypeArguments) {
- const a = Jo(
- r.aliasSymbol,
- 265
- /* TypeAliasDeclaration */
- );
- return !!(a && or(a.parent, (l) => l.kind === 307 ? !0 : l.kind === 267 ? !1 : "quit"));
- }
- return !1;
- }
- function LN(r, a, l = 0) {
- return !!(r === a || r.flags & 3145728 && ut(r.types, (f) => LN(f, a, l)) || l < 3 && r.flags & 16777216 && (LN(Qv(r), a, l + 1) || LN(Yv(r), a, l + 1)));
- }
- function Irt(r, a) {
- const l = Cp(r);
- return l ? !!l.type && LN(l.type, a) : LN(Ha(r), a);
- }
- function Ort(r) {
- const a = Js();
- TT(r, (f) => {
- if (!(f.flags & 128))
- return;
- const m = tc(f.value), y = fa(4, m);
- y.links.type = xe, f.symbol && (y.declarations = f.symbol.declarations, y.valueDeclaration = f.symbol.valueDeclaration), a.set(m, y);
- });
- const l = r.flags & 4 ? [Cg(
- Ie,
- xs,
- /*isReadonly*/
- !1
- )] : Ue;
- return Li(
- /*symbol*/
- void 0,
- a,
- Ue,
- Ue,
- l
- );
- }
- function nAe(r, a, l) {
- const f = r.id + "," + a.id + "," + l.id;
- if (Fc.has(f))
- return Fc.get(f);
- const m = Frt(r, a, l);
- return Fc.set(f, m), m;
- }
- function Kfe(r) {
- return !(wn(r) & 262144) || cy(r) && ut(qa(r), (a) => Kfe(nn(a))) || ha(r) && ut(P2(r), Kfe);
- }
- function Frt(r, a, l) {
- if (!(dh(r, Ie) || qa(r).length !== 0 && Kfe(r)))
- return;
- if (Dp(r)) {
- const m = e$(Io(r)[0], a, l);
- return m ? du(m, IP(r)) : void 0;
- }
- if (ha(r)) {
- const m = lr(P2(r), (x) => e$(x, a, l));
- if (!Mi(m, (x) => !!x))
- return;
- const y = xg(a) & 4 ? qc(r.target.elementFlags, (x) => x & 2 ? 1 : x) : r.target.elementFlags;
- return Eg(m, y, r.target.readonly, r.target.labeledElementDeclarations);
- }
- const f = k(
- 1040,
- /*symbol*/
- void 0
- );
- return f.source = r, f.mappedType = a, f.constraintType = l, f;
- }
- function Lrt(r) {
- const a = Bi(r);
- return a.type || (a.type = e$(r.links.propertyType, r.links.mappedType, r.links.constraintType) || M), a.type;
- }
- function Mrt(r, a, l) {
- const f = j_(l.type, $d(a)), m = r0(a), y = Yfe(f);
- return u0([y], r, m), iAe(y) || M;
- }
- function e$(r, a, l) {
- const f = r.id + "," + a.id + "," + l.id;
- if (Oc.has(f))
- return Oc.get(f) || M;
- o1.push(r), jS.push(a);
- const m = Fv;
- Jk(r, o1, o1.length, 2) && (Fv |= 1), Jk(a, jS, jS.length, 2) && (Fv |= 2);
- let y;
- return Fv !== 3 && (y = Mrt(r, a, l)), o1.pop(), jS.pop(), Fv = m, Oc.set(f, y), y;
- }
- function* epe(r, a, l, f) {
- const m = qa(a);
- for (const y of m)
- if (!zPe(y) && (l || !(y.flags & 16777216 || gc(y) & 48))) {
- const x = Gs(r, y.escapedName);
- if (!x)
- yield y;
- else if (f) {
- const N = nn(y);
- if (N.flags & 109472) {
- const j = nn(x);
- j.flags & 1 || Vu(j) === Vu(N) || (yield y);
- }
- }
- }
- }
- function tpe(r, a, l, f) {
- return rw(epe(r, a, l, f));
- }
- function Rrt(r, a) {
- return !(a.target.combinedFlags & 8) && a.target.minLength > r.target.minLength || !(a.target.combinedFlags & 12) && (!!(r.target.combinedFlags & 12) || a.target.fixedLength < r.target.fixedLength);
- }
- function jrt(r, a) {
- return ha(r) && ha(a) ? Rrt(r, a) : !!tpe(
- r,
- a,
- /*requireOptionalProperties*/
- !1,
- /*matchDiscriminantProperties*/
- !0
- ) && !!tpe(
- a,
- r,
- /*requireOptionalProperties*/
- !1,
- /*matchDiscriminantProperties*/
- !1
- );
- }
- function iAe(r) {
- return r.candidates ? Qn(
- r.candidates,
- 2
- /* Subtype */
- ) : r.contraCandidates ? ia(r.contraCandidates) : void 0;
- }
- function rpe(r) {
- return !!bn(r).skipDirectInference;
- }
- function sAe(r) {
- return !!(r.symbol && ut(r.symbol.declarations, rpe));
- }
- function Brt(r, a) {
- const l = r.texts[0], f = a.texts[0], m = r.texts[r.texts.length - 1], y = a.texts[a.texts.length - 1], x = Math.min(l.length, f.length), N = Math.min(m.length, y.length);
- return l.slice(0, x) !== f.slice(0, x) || m.slice(m.length - N) !== y.slice(y.length - N);
- }
- function aAe(r, a) {
- if (r === "") return !1;
- const l = +r;
- return isFinite(l) && (!a || "" + l === r);
- }
- function Jrt(r) {
- return HL(_J(r));
- }
- function t$(r, a) {
- if (a.flags & 1)
- return !0;
- if (a.flags & 134217732)
- return $s(r, a);
- if (a.flags & 268435456) {
- const l = [];
- for (; a.flags & 268435456; )
- l.unshift(a.symbol), a = a.type;
- return Hu(l, (m, y) => Fk(y, m), r) === r && t$(r, a);
- }
- return !1;
- }
- function oAe(r, a) {
- if (a.flags & 2097152)
- return Mi(a.types, (l) => l === Yi || oAe(r, l));
- if (a.flags & 4 || $s(r, a))
- return !0;
- if (r.flags & 128) {
- const l = r.value;
- return !!(a.flags & 8 && aAe(
- l,
- /*roundTripOnly*/
- !1
- ) || a.flags & 64 && D5(
- l,
- /*roundTripOnly*/
- !1
- ) || a.flags & 98816 && l === a.intrinsicName || a.flags & 268435456 && t$(S_(l), a) || a.flags & 134217728 && r$(r, a));
- }
- if (r.flags & 134217728) {
- const l = r.texts;
- return l.length === 2 && l[0] === "" && l[1] === "" && $s(r.types[0], a);
- }
- return !1;
- }
- function cAe(r, a) {
- return r.flags & 128 ? lAe([r.value], Ue, a) : r.flags & 134217728 ? Af(r.texts, a.texts) ? lr(r.types, (l, f) => $s(kg(l), kg(a.types[f])) ? l : zrt(l)) : lAe(r.texts, r.types, a) : void 0;
- }
- function r$(r, a) {
- const l = cAe(r, a);
- return !!l && Mi(l, (f, m) => oAe(f, a.types[m]));
- }
- function zrt(r) {
- return r.flags & 402653317 ? r : fT(["", ""], [r]);
- }
- function lAe(r, a, l) {
- const f = r.length - 1, m = r[0], y = r[f], x = l.texts, N = x.length - 1, j = x[0], W = x[N];
- if (f === 0 && m.length < j.length + W.length || !m.startsWith(j) || !y.endsWith(W)) return;
- const Q = y.slice(0, y.length - W.length), ye = [];
- let de = 0, Ze = j.length;
- for (let Gt = 1; Gt < N; Gt++) {
- const sr = x[Gt];
- if (sr.length > 0) {
- let Xr = de, tn = Ze;
- for (; tn = ct(Xr).indexOf(sr, tn), !(tn >= 0); ) {
- if (Xr++, Xr === r.length) return;
- tn = 0;
- }
- mt(Xr, tn), Ze += sr.length;
- } else if (Ze < ct(de).length)
- mt(de, Ze + 1);
- else if (de < f)
- mt(de + 1, 0);
- else
- return;
- }
- return mt(f, ct(f).length), ye;
- function ct(Gt) {
- return Gt < f ? r[Gt] : Q;
- }
- function mt(Gt, sr) {
- const Xr = Gt === de ? S_(ct(Gt).slice(Ze, sr)) : fT(
- [r[de].slice(Ze), ...r.slice(de + 1, Gt), ct(Gt).slice(0, sr)],
- a.slice(de, Gt)
- );
- ye.push(Xr), de = Gt, Ze = sr;
- }
- }
- function Wrt(r, a) {
- return ha(a) && q3e(a, 0) === j_(r, bd(0)) && !Rc(a, "1");
- }
- function u0(r, a, l, f = 0, m = !1) {
- let y = !1, x, N = 2048, j, W, Q, ye = 0;
- de(a, l);
- function de(Pr, Wr) {
- if (!(!I1(Wr) || fE(Wr))) {
- if (Pr === $e || Pr === bt) {
- const wi = x;
- x = Pr, de(Wr, Wr), x = wi;
- return;
- }
- if (Pr.aliasSymbol && Pr.aliasSymbol === Wr.aliasSymbol) {
- if (Pr.aliasTypeArguments) {
- const wi = Bi(Pr.aliasSymbol).typeParameters, un = Bm(wi), is = C1(Pr.aliasTypeArguments, wi, un, cn(Pr.aliasSymbol.valueDeclaration)), Zs = C1(Wr.aliasTypeArguments, wi, un, cn(Pr.aliasSymbol.valueDeclaration));
- Xr(is, Zs, j3e(Pr.aliasSymbol));
- }
- return;
- }
- if (Pr === Wr && Pr.flags & 3145728) {
- for (const wi of Pr.types)
- de(wi, wi);
- return;
- }
- if (Wr.flags & 1048576) {
- const [wi, un] = sr(Pr.flags & 1048576 ? Pr.types : [Pr], Wr.types, Urt), [is, Zs] = sr(wi, un, Vrt);
- if (Zs.length === 0)
- return;
- if (Wr = Qn(Zs), is.length === 0) {
- Ze(
- Pr,
- Wr,
- 1
- /* NakedTypeVariable */
- );
- return;
- }
- Pr = Qn(is);
- } else if (Wr.flags & 2097152 && !Mi(Wr.types, wG) && !(Pr.flags & 1048576)) {
- const [wi, un] = sr(Pr.flags & 2097152 ? Pr.types : [Pr], Wr.types, hh);
- if (wi.length === 0 || un.length === 0)
- return;
- Pr = ia(wi), Wr = ia(un);
- }
- if (Wr.flags & 41943040) {
- if (fE(Wr))
- return;
- Wr = P1(Wr);
- }
- if (Wr.flags & 8650752) {
- if (sAe(Pr))
- return;
- const wi = er(Wr);
- if (wi) {
- if (wn(Pr) & 262144 || Pr === Zt)
- return;
- if (!wi.isFixed) {
- const is = x || Pr;
- if (is === bt)
- return;
- if ((wi.priority === void 0 || f < wi.priority) && (wi.candidates = void 0, wi.contraCandidates = void 0, wi.topLevel = !0, wi.priority = f), f === wi.priority) {
- if (Wrt(wi.typeParameter, is))
- return;
- m && !y ? ss(wi.contraCandidates, is) || (wi.contraCandidates = wr(wi.contraCandidates, is), KG(r)) : ss(wi.candidates, is) || (wi.candidates = wr(wi.candidates, is), KG(r));
- }
- !(f & 128) && Wr.flags & 262144 && wi.topLevel && !LN(l, Wr) && (wi.topLevel = !1, KG(r));
- }
- N = Math.min(N, f);
- return;
- }
- const un = s0(
- Wr,
- /*writing*/
- !1
- );
- if (un !== Wr)
- de(Pr, un);
- else if (Wr.flags & 8388608) {
- const is = s0(
- Wr.indexType,
- /*writing*/
- !1
- );
- if (is.flags & 465829888) {
- const Zs = c3e(
- s0(
- Wr.objectType,
- /*writing*/
- !1
- ),
- is,
- /*writing*/
- !1
- );
- Zs && Zs !== Wr && de(Pr, Zs);
- }
- }
- }
- if (wn(Pr) & 4 && wn(Wr) & 4 && (Pr.target === Wr.target || Dp(Pr) && Dp(Wr)) && !(Pr.node && Wr.node))
- Xr(Io(Pr), Io(Wr), jfe(Pr.target));
- else if (Pr.flags & 4194304 && Wr.flags & 4194304)
- tn(Pr.type, Wr.type);
- else if ((AN(Pr) || Pr.flags & 4) && Wr.flags & 4194304) {
- const wi = Ort(Pr);
- ct(
- wi,
- Wr.type,
- 256
- /* LiteralKeyof */
- );
- } else if (Pr.flags & 8388608 && Wr.flags & 8388608)
- de(Pr.objectType, Wr.objectType), de(Pr.indexType, Wr.indexType);
- else if (Pr.flags & 268435456 && Wr.flags & 268435456)
- Pr.symbol === Wr.symbol && de(Pr.type, Wr.type);
- else if (Pr.flags & 33554432)
- de(Pr.baseType, Wr), Ze(
- K_e(Pr),
- Wr,
- 4
- /* SubstituteSource */
- );
- else if (Wr.flags & 16777216)
- Gt(Pr, Wr, Jn);
- else if (Wr.flags & 3145728)
- Un(Pr, Wr.types, Wr.flags);
- else if (Pr.flags & 1048576) {
- const wi = Pr.types;
- for (const un of wi)
- de(un, Wr);
- } else if (Wr.flags & 134217728)
- Us(Pr, Wr);
- else {
- if (Pr = Qd(Pr), R_(Pr) && R_(Wr) && Gt(Pr, Wr, js), !(f & 512 && Pr.flags & 467927040)) {
- const wi = Uu(Pr);
- if (wi !== Pr && !(wi.flags & 2621440))
- return de(wi, Wr);
- Pr = wi;
- }
- Pr.flags & 2621440 && Gt(Pr, Wr, Oo);
- }
- }
- }
- function Ze(Pr, Wr, wi) {
- const un = f;
- f |= wi, de(Pr, Wr), f = un;
- }
- function ct(Pr, Wr, wi) {
- const un = f;
- f |= wi, tn(Pr, Wr), f = un;
- }
- function mt(Pr, Wr, wi, un) {
- const is = f;
- f |= un, Un(Pr, Wr, wi), f = is;
- }
- function Gt(Pr, Wr, wi) {
- const un = Pr.id + "," + Wr.id, is = j && j.get(un);
- if (is !== void 0) {
- N = Math.min(N, is);
- return;
- }
- (j || (j = /* @__PURE__ */ new Map())).set(
- un,
- -1
- /* Circularity */
- );
- const Zs = N;
- N = 2048;
- const Fo = ye;
- (W ?? (W = [])).push(Pr), (Q ?? (Q = [])).push(Wr), Jk(Pr, W, W.length, 2) && (ye |= 1), Jk(Wr, Q, Q.length, 2) && (ye |= 2), ye !== 3 ? wi(Pr, Wr) : N = -1, Q.pop(), W.pop(), ye = Fo, j.set(un, N), N = Math.min(N, Zs);
- }
- function sr(Pr, Wr, wi) {
- let un, is;
- for (const Zs of Wr)
- for (const Fo of Pr)
- wi(Fo, Zs) && (de(Fo, Zs), un = bh(un, Fo), is = bh(is, Zs));
- return [
- un ? Ln(Pr, (Zs) => !ss(un, Zs)) : Pr,
- is ? Ln(Wr, (Zs) => !ss(is, Zs)) : Wr
- ];
- }
- function Xr(Pr, Wr, wi) {
- const un = Pr.length < Wr.length ? Pr.length : Wr.length;
- for (let is = 0; is < un; is++)
- is < wi.length && (wi[is] & 7) === 2 ? tn(Pr[is], Wr[is]) : de(Pr[is], Wr[is]);
- }
- function tn(Pr, Wr) {
- m = !m, de(Pr, Wr), m = !m;
- }
- function pr(Pr, Wr) {
- G || f & 1024 ? tn(Pr, Wr) : de(Pr, Wr);
- }
- function er(Pr) {
- if (Pr.flags & 8650752) {
- for (const Wr of r)
- if (Pr === Wr.typeParameter)
- return Wr;
- }
- }
- function gn(Pr) {
- let Wr;
- for (const wi of Pr) {
- const un = wi.flags & 2097152 && On(wi.types, (is) => !!er(is));
- if (!un || Wr && un !== Wr)
- return;
- Wr = un;
- }
- return Wr;
- }
- function Un(Pr, Wr, wi) {
- let un = 0;
- if (wi & 1048576) {
- let is;
- const Zs = Pr.flags & 1048576 ? Pr.types : [Pr], Fo = new Array(Zs.length);
- let dc = !1;
- for (const Ta of Wr)
- if (er(Ta))
- is = Ta, un++;
- else
- for (let Nl = 0; Nl < Zs.length; Nl++) {
- const Sc = N;
- N = 2048, de(Zs[Nl], Ta), N === f && (Fo[Nl] = !0), dc = dc || N === -1, N = Math.min(N, Sc);
- }
- if (un === 0) {
- const Ta = gn(Wr);
- Ta && Ze(
- Pr,
- Ta,
- 1
- /* NakedTypeVariable */
- );
- return;
- }
- if (un === 1 && !dc) {
- const Ta = ta(Zs, (Nl, Sc) => Fo[Sc] ? void 0 : Nl);
- if (Ta.length) {
- de(Qn(Ta), is);
- return;
- }
- }
- } else
- for (const is of Wr)
- er(is) ? un++ : de(Pr, is);
- if (wi & 2097152 ? un === 1 : un > 0)
- for (const is of Wr)
- er(is) && Ze(
- Pr,
- is,
- 1
- /* NakedTypeVariable */
- );
- }
- function ci(Pr, Wr, wi) {
- if (wi.flags & 1048576 || wi.flags & 2097152) {
- let un = !1;
- for (const is of wi.types)
- un = ci(Pr, Wr, is) || un;
- return un;
- }
- if (wi.flags & 4194304) {
- const un = er(wi.type);
- if (un && !un.isFixed && !sAe(Pr)) {
- const is = nAe(Pr, Wr, wi);
- is && Ze(
- is,
- un.typeParameter,
- wn(Pr) & 262144 ? 16 : 8
- /* HomomorphicMappedType */
- );
- }
- return !0;
- }
- if (wi.flags & 262144) {
- Ze(
- Jm(
- Pr,
- /*indexFlags*/
- Pr.pattern ? 2 : 0
- /* None */
- ),
- wi,
- 32
- /* MappedTypeConstraint */
- );
- const un = lT(wi);
- if (un && ci(Pr, Wr, un))
- return !0;
- const is = lr(qa(Pr), nn), Zs = lr(wu(Pr), (Fo) => Fo !== ar ? Fo.type : Ht);
- return de(Qn(Qi(is, Zs)), r0(Wr)), !0;
- }
- return !1;
- }
- function Jn(Pr, Wr) {
- if (Pr.flags & 16777216)
- de(Pr.checkType, Wr.checkType), de(Pr.extendsType, Wr.extendsType), de(Qv(Pr), Qv(Wr)), de(Yv(Pr), Yv(Wr));
- else {
- const wi = [Qv(Wr), Yv(Wr)];
- mt(Pr, wi, Wr.flags, m ? 64 : 0);
- }
- }
- function Us(Pr, Wr) {
- const wi = cAe(Pr, Wr), un = Wr.types;
- if (wi || Mi(Wr.texts, (is) => is.length === 0))
- for (let is = 0; is < un.length; is++) {
- const Zs = wi ? wi[is] : Ht, Fo = un[is];
- if (Zs.flags & 128 && Fo.flags & 8650752) {
- const dc = er(Fo), Ta = dc ? Kl(dc.typeParameter) : void 0;
- if (Ta && !Wa(Ta)) {
- const Nl = Ta.flags & 1048576 ? Ta.types : [Ta];
- let Sc = Hu(Nl, (mo, ep) => mo | ep.flags, 0);
- if (!(Sc & 4)) {
- const mo = Zs.value;
- Sc & 296 && !aAe(
- mo,
- /*roundTripOnly*/
- !0
- ) && (Sc &= -297), Sc & 2112 && !D5(
- mo,
- /*roundTripOnly*/
- !0
- ) && (Sc &= -2113);
- const ep = Hu(Nl, (Ac, jc) => jc.flags & Sc ? Ac.flags & 4 ? Ac : jc.flags & 4 ? Zs : Ac.flags & 134217728 ? Ac : jc.flags & 134217728 && r$(Zs, jc) ? Zs : Ac.flags & 268435456 ? Ac : jc.flags & 268435456 && mo === i3e(jc.symbol, mo) ? Zs : Ac.flags & 128 ? Ac : jc.flags & 128 && jc.value === mo ? jc : Ac.flags & 8 ? Ac : jc.flags & 8 ? bd(+mo) : Ac.flags & 32 ? Ac : jc.flags & 32 ? bd(+mo) : Ac.flags & 256 ? Ac : jc.flags & 256 && jc.value === +mo ? jc : Ac.flags & 64 ? Ac : jc.flags & 64 ? Jrt(mo) : Ac.flags & 2048 ? Ac : jc.flags & 2048 && Ib(jc.value) === mo ? jc : Ac.flags & 16 ? Ac : jc.flags & 16 ? mo === "true" ? nt : mo === "false" ? yr : wt : Ac.flags & 512 ? Ac : jc.flags & 512 && jc.intrinsicName === mo ? jc : Ac.flags & 32768 ? Ac : jc.flags & 32768 && jc.intrinsicName === mo ? jc : Ac.flags & 65536 ? Ac : jc.flags & 65536 && jc.intrinsicName === mo ? jc : Ac : Ac, Ht);
- if (!(ep.flags & 131072)) {
- de(ep, Fo);
- continue;
- }
- }
- }
- }
- de(Zs, Fo);
- }
- }
- function js(Pr, Wr) {
- de(Yf(Pr), Yf(Wr)), de(r0(Pr), r0(Wr));
- const wi = ny(Pr), un = ny(Wr);
- wi && un && de(wi, un);
- }
- function Oo(Pr, Wr) {
- var wi, un;
- if (wn(Pr) & 4 && wn(Wr) & 4 && (Pr.target === Wr.target || Dp(Pr) && Dp(Wr))) {
- Xr(Io(Pr), Io(Wr), jfe(Pr.target));
- return;
- }
- if (R_(Pr) && R_(Wr) && js(Pr, Wr), wn(Wr) & 32 && !Wr.declaration.nameType) {
- const is = Yf(Wr);
- if (ci(Pr, Wr, is))
- return;
- }
- if (!jrt(Pr, Wr)) {
- if (Kv(Pr)) {
- if (ha(Wr)) {
- const is = sy(Pr), Zs = sy(Wr), Fo = Io(Wr), dc = Wr.target.elementFlags;
- if (ha(Pr) && hrt(Pr, Wr)) {
- for (let Sc = 0; Sc < Zs; Sc++)
- de(Io(Pr)[Sc], Fo[Sc]);
- return;
- }
- const Ta = ha(Pr) ? Math.min(Pr.target.fixedLength, Wr.target.fixedLength) : 0, Nl = Math.min(ha(Pr) ? SN(
- Pr.target,
- 3
- /* Fixed */
- ) : 0, Wr.target.combinedFlags & 12 ? SN(
- Wr.target,
- 3
- /* Fixed */
- ) : 0);
- for (let Sc = 0; Sc < Ta; Sc++)
- de(Io(Pr)[Sc], Fo[Sc]);
- if (!ha(Pr) || is - Ta - Nl === 1 && Pr.target.elementFlags[Ta] & 4) {
- const Sc = Io(Pr)[Ta];
- for (let mo = Ta; mo < Zs - Nl; mo++)
- de(dc[mo] & 8 ? du(Sc) : Sc, Fo[mo]);
- } else {
- const Sc = Zs - Ta - Nl;
- if (Sc === 2) {
- if (dc[Ta] & dc[Ta + 1] & 8) {
- const mo = er(Fo[Ta]);
- mo && mo.impliedArity !== void 0 && (de(NP(Pr, Ta, Nl + is - mo.impliedArity), Fo[Ta]), de(NP(Pr, Ta + mo.impliedArity, Nl), Fo[Ta + 1]));
- } else if (dc[Ta] & 8 && dc[Ta + 1] & 4) {
- const mo = (wi = er(Fo[Ta])) == null ? void 0 : wi.typeParameter, ep = mo && Kl(mo);
- if (ep && ha(ep) && !(ep.target.combinedFlags & 12)) {
- const Ac = ep.target.fixedLength;
- de(NP(Pr, Ta, is - (Ta + Ac)), Fo[Ta]), de(FP(Pr, Ta + Ac, Nl), Fo[Ta + 1]);
- }
- } else if (dc[Ta] & 4 && dc[Ta + 1] & 8) {
- const mo = (un = er(Fo[Ta + 1])) == null ? void 0 : un.typeParameter, ep = mo && Kl(mo);
- if (ep && ha(ep) && !(ep.target.combinedFlags & 12)) {
- const Ac = ep.target.fixedLength, jc = is - SN(
- Wr.target,
- 3
- /* Fixed */
- ), _y = jc - Ac, EE = Eg(
- Io(Pr).slice(_y, jc),
- Pr.target.elementFlags.slice(_y, jc),
- /*readonly*/
- !1,
- Pr.target.labeledElementDeclarations && Pr.target.labeledElementDeclarations.slice(_y, jc)
- );
- de(FP(Pr, Ta, Nl + Ac), Fo[Ta]), de(EE, Fo[Ta + 1]);
- }
- }
- } else if (Sc === 1 && dc[Ta] & 8) {
- const mo = Wr.target.elementFlags[Zs - 1] & 2, ep = NP(Pr, Ta, Nl);
- Ze(ep, Fo[Ta], mo ? 2 : 0);
- } else if (Sc === 1 && dc[Ta] & 4) {
- const mo = FP(Pr, Ta, Nl);
- mo && de(mo, Fo[Ta]);
- }
- }
- for (let Sc = 0; Sc < Nl; Sc++)
- de(Io(Pr)[is - Sc - 1], Fo[Zs - Sc - 1]);
- return;
- }
- if (Dp(Wr)) {
- pc(Pr, Wr);
- return;
- }
- }
- ls(Pr, Wr), sc(
- Pr,
- Wr,
- 0
- /* Call */
- ), sc(
- Pr,
- Wr,
- 1
- /* Construct */
- ), pc(Pr, Wr);
- }
- }
- function ls(Pr, Wr) {
- const wi = iy(Wr);
- for (const un of wi) {
- const is = Gs(Pr, un.escapedName);
- is && !ut(is.declarations, rpe) && de(
- l0(nn(is), !!(is.flags & 16777216)),
- l0(nn(un), !!(un.flags & 16777216))
- );
- }
- }
- function sc(Pr, Wr, wi) {
- const un = Ns(Pr, wi), is = un.length;
- if (is > 0) {
- const Zs = Ns(Wr, wi), Fo = Zs.length;
- for (let dc = 0; dc < Fo; dc++) {
- const Ta = Math.max(is - Fo + dc, 0);
- Jl(VKe(un[Ta]), bN(Zs[dc]));
- }
- }
- }
- function Jl(Pr, Wr) {
- if (!(Pr.flags & 64)) {
- const wi = y, un = Wr.declaration ? Wr.declaration.kind : 0;
- y = y || un === 174 || un === 173 || un === 176, Gfe(Pr, Wr, pr), y = wi;
- }
- $fe(Pr, Wr, de);
- }
- function pc(Pr, Wr) {
- const wi = wn(Pr) & wn(Wr) & 32 ? 8 : 0, un = wu(Wr);
- if (QG(Pr))
- for (const is of un) {
- const Zs = [];
- for (const Fo of qa(Pr))
- if (Ak(Ok(
- Fo,
- 8576
- /* StringOrNumberLiteralOrUnique */
- ), is.keyType)) {
- const dc = nn(Fo);
- Zs.push(Fo.flags & 16777216 ? XG(dc) : dc);
- }
- for (const Fo of wu(Pr))
- Ak(Fo.keyType, is.keyType) && Zs.push(Fo.type);
- Zs.length && Ze(Qn(Zs), is.type, wi);
- }
- for (const is of un) {
- const Zs = hN(Pr, is.keyType);
- Zs && Ze(Zs.type, is.type, wi);
- }
- }
- }
- function Urt(r, a) {
- return a === U ? r === a : hh(r, a) || !!(a.flags & 4 && r.flags & 128 || a.flags & 8 && r.flags & 256);
- }
- function Vrt(r, a) {
- return !!(r.flags & 524288 && a.flags & 524288 && r.symbol && r.symbol === a.symbol || r.aliasSymbol && r.aliasTypeArguments && r.aliasSymbol === a.aliasSymbol);
- }
- function qrt(r) {
- const a = s_(r);
- return !!a && bc(
- a.flags & 16777216 ? O_e(a) : a,
- 406978556
- /* StringMapping */
- );
- }
- function cy(r) {
- return !!(wn(r) & 128);
- }
- function npe(r) {
- return !!(wn(r) & 16512);
- }
- function Hrt(r) {
- if (r.length > 1) {
- const a = Ln(r, npe);
- if (a.length) {
- const l = Qn(
- a,
- 2
- /* Subtype */
- );
- return Qi(Ln(r, (f) => !npe(f)), [l]);
- }
- }
- return r;
- }
- function Grt(r) {
- return r.priority & 416 ? ia(r.contraCandidates) : _rt(r.contraCandidates);
- }
- function $rt(r, a) {
- const l = Hrt(r.candidates), f = qrt(r.typeParameter) || uT(r.typeParameter), m = !f && r.topLevel && (r.isFixed || !Irt(a, r.typeParameter)), y = f ? qc(l, Vu) : m ? qc(l, eb) : l, x = r.priority & 416 ? Qn(
- y,
- 2
- /* Subtype */
- ) : urt(y);
- return J_(x);
- }
- function ipe(r, a) {
- const l = r.inferences[a];
- if (!l.inferredType) {
- let f, m;
- if (r.signature) {
- const x = l.candidates ? $rt(l, r.signature) : void 0, N = l.contraCandidates ? Grt(l) : void 0;
- if (x || N) {
- const j = x && (!N || !(x.flags & 131073) && ut(l.contraCandidates, (W) => $s(x, W)) && Mi(r.inferences, (W) => W !== l && s_(W.typeParameter) !== l.typeParameter || Mi(W.candidates, (Q) => $s(Q, x))));
- f = j ? x : N, m = j ? N : x;
- } else if (r.flags & 1)
- f = en;
- else {
- const j = C2(l.typeParameter);
- j && (f = zi(j, xtt(Ttt(r, a), r.nonFixingMapper)));
- }
- } else
- f = iAe(l);
- l.inferredType = f || spe(!!(r.flags & 2));
- const y = s_(l.typeParameter);
- if (y) {
- const x = zi(y, r.nonFixingMapper);
- (!f || !r.compareTypes(f, df(x, f))) && (l.inferredType = m && r.compareTypes(m, df(x, m)) ? m : x);
- }
- }
- return l.inferredType;
- }
- function spe(r) {
- return r ? xe : M;
- }
- function ape(r) {
- const a = [];
- for (let l = 0; l < r.inferences.length; l++)
- a.push(ipe(r, l));
- return a;
- }
- function uAe(r) {
- switch (r.escapedText) {
- case "document":
- case "console":
- return p.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;
- case "$":
- return O.types ? p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig : p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;
- case "describe":
- case "suite":
- case "it":
- case "test":
- return O.types ? p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig : p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;
- case "process":
- case "require":
- case "Buffer":
- case "module":
- return O.types ? p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
- case "Bun":
- return O.types ? p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
- case "Map":
- case "Set":
- case "Promise":
- case "Symbol":
- case "WeakMap":
- case "WeakSet":
- case "Iterator":
- case "AsyncIterator":
- case "SharedArrayBuffer":
- case "Atomics":
- case "AsyncIterable":
- case "AsyncIterableIterator":
- case "AsyncGenerator":
- case "AsyncGeneratorFunction":
- case "BigInt":
- case "Reflect":
- case "BigInt64Array":
- case "BigUint64Array":
- return p.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;
- case "await":
- if (Fs(r.parent))
- return p.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
- default:
- return r.parent.kind === 304 ? p.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer : p.Cannot_find_name_0;
- }
- }
- function Nu(r) {
- const a = bn(r);
- return a.resolvedSymbol || (a.resolvedSymbol = !rc(r) && Nt(
- r,
- r,
- 1160127,
- uAe(r),
- !r5(r),
- /*excludeGlobals*/
- !1
- ) || ze), a.resolvedSymbol;
- }
- function ope(r) {
- return !!(r.flags & 33554432 || or(r, (a) => Xl(a) || Vp(a) || Qu(a)));
- }
- function aM(r, a, l, f) {
- switch (r.kind) {
- case 80:
- if (!Pb(r)) {
- const x = Nu(r);
- return x !== ze ? `${f ? Ma(f) : "-1"}|${Rl(a)}|${Rl(l)}|${na(x)}` : void 0;
- }
- case 110:
- return `0|${f ? Ma(f) : "-1"}|${Rl(a)}|${Rl(l)}`;
- case 235:
- case 217:
- return aM(r.expression, a, l, f);
- case 166:
- const m = aM(r.left, a, l, f);
- return m && `${m}.${r.right.escapedText}`;
- case 211:
- case 212:
- const y = vT(r);
- if (y !== void 0) {
- const x = aM(r.expression, a, l, f);
- return x && `${x}.${y}`;
- }
- if (ko(r) && Oe(r.argumentExpression)) {
- const x = Nu(r.argumentExpression);
- if (zk(x) || jN(x) && !mM(x)) {
- const N = aM(r.expression, a, l, f);
- return N && `${N}.@${na(x)}`;
- }
- }
- break;
- case 206:
- case 207:
- case 262:
- case 218:
- case 219:
- case 174:
- return `${Ma(r)}#${Rl(a)}`;
- }
- }
- function jl(r, a) {
- switch (a.kind) {
- case 217:
- case 235:
- return jl(r, a.expression);
- case 226:
- return Dl(a) && jl(r, a.left) || dn(a) && a.operatorToken.kind === 28 && jl(r, a.right);
- }
- switch (r.kind) {
- case 236:
- return a.kind === 236 && r.keywordToken === a.keywordToken && r.name.escapedText === a.name.escapedText;
- case 80:
- case 81:
- return Pb(r) ? a.kind === 110 : a.kind === 80 && Nu(r) === Nu(a) || (ii(a) || va(a)) && _f(Nu(r)) === Tn(a);
- case 110:
- return a.kind === 110;
- case 108:
- return a.kind === 108;
- case 235:
- case 217:
- return jl(r.expression, a);
- case 211:
- case 212:
- const l = vT(r);
- if (l !== void 0) {
- const f = xo(a) ? vT(a) : void 0;
- if (f !== void 0)
- return f === l && jl(r.expression, a.expression);
- }
- if (ko(r) && ko(a) && Oe(r.argumentExpression) && Oe(a.argumentExpression)) {
- const f = Nu(r.argumentExpression);
- if (f === Nu(a.argumentExpression) && (zk(f) || jN(f) && !mM(f)))
- return jl(r.expression, a.expression);
- }
- break;
- case 166:
- return xo(a) && r.right.escapedText === vT(a) && jl(r.left, a.expression);
- case 226:
- return dn(r) && r.operatorToken.kind === 28 && jl(r.right, a);
- }
- return !1;
- }
- function vT(r) {
- if (Cn(r))
- return r.name.escapedText;
- if (ko(r))
- return Xrt(r);
- if (va(r)) {
- const a = ui(r);
- return a ? tc(a) : void 0;
- }
- if (Ii(r))
- return "" + r.parent.parameters.indexOf(r);
- }
- function cpe(r) {
- return r.flags & 8192 ? r.escapedName : r.flags & 384 ? tc("" + r.value) : void 0;
- }
- function Xrt(r) {
- return Of(r.argumentExpression) ? tc(r.argumentExpression.text) : yo(r.argumentExpression) ? Qrt(r.argumentExpression) : void 0;
- }
- function Qrt(r) {
- const a = Yo(
- r,
- 111551,
- /*ignoreErrors*/
- !0
- );
- if (!a || !(zk(a) || a.flags & 8)) return;
- const l = a.valueDeclaration;
- if (l === void 0) return;
- const f = Qf(l);
- if (f) {
- const m = cpe(f);
- if (m !== void 0)
- return m;
- }
- if (K2(l) && $0(l, r)) {
- const m = i3(l);
- if (m) {
- const y = As(l.parent) ? Wi(l) : tu(m);
- return y && cpe(y);
- }
- if (A0(l))
- return QT(l.name);
- }
- }
- function _Ae(r, a) {
- for (; xo(r); )
- if (r = r.expression, jl(r, a))
- return !0;
- return !1;
- }
- function bT(r, a) {
- for (; hu(r); )
- if (r = r.expression, jl(r, a))
- return !0;
- return !1;
- }
- function LP(r, a) {
- if (r && r.flags & 1048576) {
- const l = awe(r, a);
- if (l && gc(l) & 2)
- return l.links.isDiscriminantProperty === void 0 && (l.links.isDiscriminantProperty = (l.links.checkFlags & 192) === 192 && !Lk(nn(l))), !!l.links.isDiscriminantProperty;
- }
- return !1;
- }
- function fAe(r, a) {
- let l;
- for (const f of r)
- if (LP(a, f.escapedName)) {
- if (l) {
- l.push(f);
- continue;
- }
- l = [f];
- }
- return l;
- }
- function Yrt(r, a) {
- const l = /* @__PURE__ */ new Map();
- let f = 0;
- for (const m of r)
- if (m.flags & 61603840) {
- const y = Rc(m, a);
- if (y) {
- if (!AN(y))
- return;
- let x = !1;
- TT(y, (N) => {
- const j = Rl(Vu(N)), W = l.get(j);
- W ? W !== M && (l.set(j, M), x = !0) : l.set(j, m);
- }), x || f++;
- }
- }
- return f >= 10 && f * 2 >= r.length ? l : void 0;
- }
- function oM(r) {
- const a = r.types;
- if (!(a.length < 10 || wn(r) & 32768 || py(a, (l) => !!(l.flags & 59506688)) < 10)) {
- if (r.keyPropertyName === void 0) {
- const l = ir(a, (m) => m.flags & 59506688 ? ir(qa(m), (y) => Yd(nn(y)) ? y.escapedName : void 0) : void 0), f = l && Yrt(a, l);
- r.keyPropertyName = f ? l : "", r.constituentMap = f;
- }
- return r.keyPropertyName.length ? r.keyPropertyName : void 0;
- }
- }
- function cM(r, a) {
- var l;
- const f = (l = r.constituentMap) == null ? void 0 : l.get(Rl(Vu(a)));
- return f !== M ? f : void 0;
- }
- function pAe(r, a) {
- const l = oM(r), f = l && Rc(a, l);
- return f && cM(r, f);
- }
- function Zrt(r, a) {
- const l = oM(r), f = l && On(a.properties, (y) => y.symbol && y.kind === 303 && y.symbol.escapedName === l && yM(y.initializer)), m = f && BM(f.initializer);
- return m && cM(r, m);
- }
- function dAe(r, a) {
- return jl(r, a) || _Ae(r, a);
- }
- function mAe(r, a) {
- if (r.arguments) {
- for (const l of r.arguments)
- if (dAe(a, l) || bT(l, a))
- return !0;
- }
- return !!(r.expression.kind === 211 && dAe(a, r.expression.expression));
- }
- function lpe(r) {
- return r.id <= 0 && (r.id = Mye, Mye++), r.id;
- }
- function Krt(r, a) {
- if (!(r.flags & 1048576))
- return $s(r, a);
- for (const l of r.types)
- if ($s(l, a))
- return !0;
- return !1;
- }
- function ent(r, a) {
- if (r === a)
- return r;
- if (a.flags & 131072)
- return a;
- const l = `A${Rl(r)},${Rl(a)}`;
- return Jd(l) ?? V0(l, tnt(r, a));
- }
- function tnt(r, a) {
- const l = Vc(r, (m) => Krt(a, m)), f = a.flags & 512 && A2(a) ? Xo(l, Rk) : l;
- return $s(a, f) ? f : r;
- }
- function upe(r) {
- if (wn(r) & 256)
- return !1;
- const a = Xd(r);
- return !!(a.callSignatures.length || a.constructSignatures.length || a.members.get("bind") && O2(r, al));
- }
- function gE(r, a) {
- return _pe(r, a) & a;
- }
- function Zd(r, a) {
- return gE(r, a) !== 0;
- }
- function _pe(r, a) {
- r.flags & 467927040 && (r = Kl(r) || M);
- const l = r.flags;
- if (l & 268435460)
- return ee ? 16317953 : 16776705;
- if (l & 134217856) {
- const f = l & 128 && r.value === "";
- return ee ? f ? 12123649 : 7929345 : f ? 12582401 : 16776705;
- }
- if (l & 40)
- return ee ? 16317698 : 16776450;
- if (l & 256) {
- const f = r.value === 0;
- return ee ? f ? 12123394 : 7929090 : f ? 12582146 : 16776450;
- }
- if (l & 64)
- return ee ? 16317188 : 16775940;
- if (l & 2048) {
- const f = Q3e(r);
- return ee ? f ? 12122884 : 7928580 : f ? 12581636 : 16775940;
- }
- return l & 16 ? ee ? 16316168 : 16774920 : l & 528 ? ee ? r === yr || r === $r ? 12121864 : 7927560 : r === yr || r === $r ? 12580616 : 16774920 : l & 524288 ? a & (ee ? 83427327 : 83886079) ? wn(r) & 16 && a0(r) ? ee ? 83427327 : 83886079 : upe(r) ? ee ? 7880640 : 16728e3 : ee ? 7888800 : 16736160 : 0 : l & 16384 ? 9830144 : l & 32768 ? 26607360 : l & 65536 ? 42917664 : l & 12288 ? ee ? 7925520 : 16772880 : l & 67108864 ? ee ? 7888800 : 16736160 : l & 131072 ? 0 : l & 1048576 ? Hu(
- r.types,
- (f, m) => f | _pe(m, a),
- 0
- /* None */
- ) : l & 2097152 ? rnt(r, a) : 83886079;
- }
- function rnt(r, a) {
- const l = bc(
- r,
- 402784252
- /* Primitive */
- );
- let f = 0, m = 134217727;
- for (const y of r.types)
- if (!(l && y.flags & 524288)) {
- const x = _pe(y, a);
- f |= x, m &= x;
- }
- return f & 8256 | m & 134209471;
- }
- function ad(r, a) {
- return Vc(r, (l) => Zd(l, a));
- }
- function ST(r, a) {
- const l = hAe(ad(ee && r.flags & 2 ? Ia : r, a));
- if (ee)
- switch (a) {
- case 524288:
- return gAe(l, 65536, 131072, 33554432, ht);
- case 1048576:
- return gAe(l, 131072, 65536, 16777216, Ae);
- case 2097152:
- case 4194304:
- return Xo(l, (f) => Zd(
- f,
- 262144
- /* EQUndefinedOrNull */
- ) ? brt(f) : f);
- }
- return l;
- }
- function gAe(r, a, l, f, m) {
- const y = gE(
- r,
- 50528256
- /* IsNull */
- );
- if (!(y & a))
- return r;
- const x = Qn([xs, m]);
- return Xo(r, (N) => Zd(N, a) ? ia([N, !(y & f) && Zd(N, l) ? x : xs]) : N);
- }
- function hAe(r) {
- return r === Ia ? M : r;
- }
- function fpe(r, a) {
- return a ? Qn([Rt(r), tu(a)]) : r;
- }
- function yAe(r, a) {
- var l;
- const f = i0(a);
- if (!up(f)) return He;
- const m = _p(f);
- return Rc(r, m) || MN((l = Nk(r, m)) == null ? void 0 : l.type) || He;
- }
- function vAe(r, a) {
- return z_(r, OP) && q3e(r, a) || MN(uy(
- 65,
- r,
- Ae,
- /*errorNode*/
- void 0
- )) || He;
- }
- function MN(r) {
- return r && (O.noUncheckedIndexedAccess ? Qn([r, U]) : r);
- }
- function bAe(r) {
- return du(uy(
- 65,
- r,
- Ae,
- /*errorNode*/
- void 0
- ) || He);
- }
- function nnt(r) {
- return r.parent.kind === 209 && ppe(r.parent) || r.parent.kind === 303 && ppe(r.parent.parent) ? fpe(lM(r), r.right) : tu(r.right);
- }
- function ppe(r) {
- return r.parent.kind === 226 && r.parent.left === r || r.parent.kind === 250 && r.parent.initializer === r;
- }
- function int(r, a) {
- return vAe(lM(r), r.elements.indexOf(a));
- }
- function snt(r) {
- return bAe(lM(r.parent));
- }
- function SAe(r) {
- return yAe(lM(r.parent), r.name);
- }
- function ant(r) {
- return fpe(SAe(r), r.objectAssignmentInitializer);
- }
- function lM(r) {
- const { parent: a } = r;
- switch (a.kind) {
- case 249:
- return Ie;
- case 250:
- return qM(a) || He;
- case 226:
- return nnt(a);
- case 220:
- return Ae;
- case 209:
- return int(a, r);
- case 230:
- return snt(a);
- case 303:
- return SAe(a);
- case 304:
- return ant(a);
- }
- return He;
- }
- function ont(r) {
- const a = r.parent, l = xAe(a.parent), f = a.kind === 206 ? yAe(l, r.propertyName || r.name) : r.dotDotDotToken ? bAe(l) : vAe(l, a.elements.indexOf(r));
- return fpe(f, r.initializer);
- }
- function TAe(r) {
- return bn(r).resolvedType || tu(r);
- }
- function cnt(r) {
- return r.initializer ? TAe(r.initializer) : r.parent.parent.kind === 249 ? Ie : r.parent.parent.kind === 250 && qM(r.parent.parent) || He;
- }
- function xAe(r) {
- return r.kind === 260 ? cnt(r) : ont(r);
- }
- function lnt(r) {
- return r.kind === 260 && r.initializer && xp(r.initializer) || r.kind !== 208 && r.parent.kind === 226 && xp(r.parent.right);
- }
- function F2(r) {
- switch (r.kind) {
- case 217:
- return F2(r.expression);
- case 226:
- switch (r.operatorToken.kind) {
- case 64:
- case 76:
- case 77:
- case 78:
- return F2(r.left);
- case 28:
- return F2(r.right);
- }
- }
- return r;
- }
- function kAe(r) {
- const { parent: a } = r;
- return a.kind === 217 || a.kind === 226 && a.operatorToken.kind === 64 && a.left === r || a.kind === 226 && a.operatorToken.kind === 28 && a.right === r ? kAe(a) : r;
- }
- function unt(r) {
- return r.kind === 296 ? Vu(tu(r.expression)) : Ht;
- }
- function n$(r) {
- const a = bn(r);
- if (!a.switchTypes) {
- a.switchTypes = [];
- for (const l of r.caseBlock.clauses)
- a.switchTypes.push(unt(l));
- }
- return a.switchTypes;
- }
- function CAe(r) {
- if (ut(r.caseBlock.clauses, (l) => l.kind === 296 && !Xa(l.expression)))
- return;
- const a = [];
- for (const l of r.caseBlock.clauses) {
- const f = l.kind === 296 ? l.expression.text : void 0;
- a.push(f && !ss(a, f) ? f : void 0);
- }
- return a;
- }
- function _nt(r, a) {
- return r.flags & 1048576 ? !ir(r.types, (l) => !ss(a, l)) : ss(a, r);
- }
- function MP(r, a) {
- return !!(r === a || r.flags & 131072 || a.flags & 1048576 && fnt(r, a));
- }
- function fnt(r, a) {
- if (r.flags & 1048576) {
- for (const l of r.types)
- if (!mh(a.types, l))
- return !1;
- return !0;
- }
- return r.flags & 1056 && pG(r) === a ? !0 : mh(a.types, r);
- }
- function TT(r, a) {
- return r.flags & 1048576 ? ir(r.types, a) : a(r);
- }
- function Pp(r, a) {
- return r.flags & 1048576 ? ut(r.types, a) : a(r);
- }
- function z_(r, a) {
- return r.flags & 1048576 ? Mi(r.types, a) : a(r);
- }
- function pnt(r, a) {
- return r.flags & 3145728 ? Mi(r.types, a) : a(r);
- }
- function Vc(r, a) {
- if (r.flags & 1048576) {
- const l = r.types, f = Ln(l, a);
- if (f === l)
- return r;
- const m = r.origin;
- let y;
- if (m && m.flags & 1048576) {
- const x = m.types, N = Ln(x, (j) => !!(j.flags & 1048576) || a(j));
- if (x.length - N.length === l.length - f.length) {
- if (N.length === 1)
- return N[0];
- y = _fe(1048576, N);
- }
- }
- return pfe(
- f,
- r.objectFlags & 16809984,
- /*aliasSymbol*/
- void 0,
- /*aliasTypeArguments*/
- void 0,
- y
- );
- }
- return r.flags & 131072 || a(r) ? r : Ht;
- }
- function i$(r, a) {
- return Vc(r, (l) => l !== a);
- }
- function dnt(r) {
- return r.flags & 1048576 ? r.types.length : 1;
- }
- function Xo(r, a, l) {
- if (r.flags & 131072)
- return r;
- if (!(r.flags & 1048576))
- return a(r);
- const f = r.origin, m = f && f.flags & 1048576 ? f.types : r.types;
- let y, x = !1;
- for (const N of m) {
- const j = N.flags & 1048576 ? Xo(N, a, l) : a(N);
- x || (x = N !== j), j && (y ? y.push(j) : y = [j]);
- }
- return x ? y && Qn(
- y,
- l ? 0 : 1
- /* Literal */
- ) : r;
- }
- function EAe(r, a, l, f) {
- return r.flags & 1048576 && l ? Qn(lr(r.types, a), 1, l, f) : Xo(r, a);
- }
- function RP(r, a) {
- return Vc(r, (l) => (l.flags & a) !== 0);
- }
- function DAe(r, a) {
- return bc(
- r,
- 134217804
- /* BigInt */
- ) && bc(
- a,
- 402655616
- /* BigIntLiteral */
- ) ? Xo(r, (l) => l.flags & 4 ? RP(
- a,
- 402653316
- /* StringMapping */
- ) : pT(l) && !bc(
- a,
- 402653188
- /* StringMapping */
- ) ? RP(
- a,
- 128
- /* StringLiteral */
- ) : l.flags & 8 ? RP(
- a,
- 264
- /* NumberLiteral */
- ) : l.flags & 64 ? RP(
- a,
- 2112
- /* BigIntLiteral */
- ) : l) : r;
- }
- function hE(r) {
- return r.flags === 0;
- }
- function xT(r) {
- return r.flags === 0 ? r.type : r;
- }
- function yE(r, a) {
- return a ? { flags: 0, type: r.flags & 131072 ? en : r } : r;
- }
- function mnt(r) {
- const a = k(
- 256
- /* EvolvingArray */
- );
- return a.elementType = r, a;
- }
- function dpe(r) {
- return Xe[r.id] || (Xe[r.id] = mnt(r));
- }
- function PAe(r, a) {
- const l = ON(o0(BM(a)));
- return MP(l, r.elementType) ? r : dpe(Qn([r.elementType, l]));
- }
- function gnt(r) {
- return r.flags & 131072 ? Va : du(
- r.flags & 1048576 ? Qn(
- r.types,
- 2
- /* Subtype */
- ) : r
- );
- }
- function hnt(r) {
- return r.finalArrayType || (r.finalArrayType = gnt(r.elementType));
- }
- function uM(r) {
- return wn(r) & 256 ? hnt(r) : r;
- }
- function ynt(r) {
- return wn(r) & 256 ? r.elementType : Ht;
- }
- function vnt(r) {
- let a = !1;
- for (const l of r)
- if (!(l.flags & 131072)) {
- if (!(wn(l) & 256))
- return !1;
- a = !0;
- }
- return a;
- }
- function wAe(r) {
- const a = kAe(r), l = a.parent, f = Cn(l) && (l.name.escapedText === "length" || l.parent.kind === 213 && Oe(l.name) && vB(l.name)), m = l.kind === 212 && l.expression === a && l.parent.kind === 226 && l.parent.operatorToken.kind === 64 && l.parent.left === l && !b0(l.parent) && eu(
- tu(l.argumentExpression),
- 296
- /* NumberLike */
- );
- return f || m;
- }
- function bnt(r) {
- return (ii(r) || cs(r) || m_(r) || Ii(r)) && !!(Gc(r) || cn(r) && m0(r) && r.initializer && Wy(r.initializer) && Y_(r.initializer));
- }
- function s$(r, a) {
- if (r = Mc(r), r.flags & 8752)
- return nn(r);
- if (r.flags & 7) {
- if (gc(r) & 262144) {
- const f = r.links.syntheticOrigin;
- if (f && s$(f))
- return nn(r);
- }
- const l = r.valueDeclaration;
- if (l) {
- if (bnt(l))
- return nn(r);
- if (ii(l) && l.parent.parent.kind === 250) {
- const f = l.parent.parent, m = _M(
- f.expression,
- /*diagnostic*/
- void 0
- );
- if (m) {
- const y = f.awaitModifier ? 15 : 13;
- return uy(
- y,
- m,
- Ae,
- /*errorNode*/
- void 0
- );
- }
- }
- a && Rs(a, Kr(l, p._0_needs_an_explicit_type_annotation, Ji(r)));
- }
- }
- }
- function _M(r, a) {
- if (!(r.flags & 67108864))
- switch (r.kind) {
- case 80:
- const l = _f(Nu(r));
- return s$(l, a);
- case 110:
- return znt(r);
- case 108:
- return _$(r);
- case 211: {
- const f = _M(r.expression, a);
- if (f) {
- const m = r.name;
- let y;
- if (Di(m)) {
- if (!f.symbol)
- return;
- y = Gs(f, v3(f.symbol, m.escapedText));
- } else
- y = Gs(f, m.escapedText);
- return y && s$(y, a);
- }
- return;
- }
- case 217:
- return _M(r.expression, a);
- }
- }
- function fM(r) {
- const a = bn(r);
- let l = a.effectsSignature;
- if (l === void 0) {
- let f;
- if (dn(r)) {
- const x = bE(r.right);
- f = mde(x);
- } else r.parent.kind === 244 ? f = _M(
- r.expression,
- /*diagnostic*/
- void 0
- ) : r.expression.kind !== 108 && (hu(r) ? f = Um(
- NN(Gi(r.expression), r.expression),
- r.expression
- ) : f = bE(r.expression));
- const m = Ns(
- f && Uu(f) || M,
- 0
- /* Call */
- ), y = m.length === 1 && !m[0].typeParameters ? m[0] : ut(m, AAe) ? TE(r) : void 0;
- l = a.effectsSignature = y && AAe(y) ? y : $t;
- }
- return l === $t ? void 0 : l;
- }
- function AAe(r) {
- return !!(Cp(r) || r.declaration && (lE(r.declaration) || M).flags & 131072);
- }
- function Snt(r, a) {
- if (r.kind === 1 || r.kind === 3)
- return a.arguments[r.parameterIndex];
- const l = Ba(a.expression);
- return xo(l) ? Ba(l.expression) : void 0;
- }
- function Tnt(r) {
- const a = or(r, Tj), l = Tr(r), f = cm(l, a.statements.pos);
- Da.add(fl(l, f.start, f.length, p.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis));
- }
- function pM(r) {
- const a = a$(
- r,
- /*noCacheCheck*/
- !1
- );
- return Zp = r, Nv = a, a;
- }
- function dM(r) {
- const a = Ba(
- r,
- /*excludeJSDocTypeAssertions*/
- !0
- );
- return a.kind === 97 || a.kind === 226 && (a.operatorToken.kind === 56 && (dM(a.left) || dM(a.right)) || a.operatorToken.kind === 57 && dM(a.left) && dM(a.right));
- }
- function a$(r, a) {
- for (; ; ) {
- if (r === Zp)
- return Nv;
- const l = r.flags;
- if (l & 4096) {
- if (!a) {
- const f = lpe(r), m = i1[f];
- return m !== void 0 ? m : i1[f] = a$(
- r,
- /*noCacheCheck*/
- !0
- );
- }
- a = !1;
- }
- if (l & 368)
- r = r.antecedent;
- else if (l & 512) {
- const f = fM(r.node);
- if (f) {
- const m = Cp(f);
- if (m && m.kind === 3 && !m.type) {
- const y = r.node.arguments[m.parameterIndex];
- if (y && dM(y))
- return !1;
- }
- if (Ha(f).flags & 131072)
- return !1;
- }
- r = r.antecedent;
- } else {
- if (l & 4)
- return ut(r.antecedent, (f) => a$(
- f,
- /*noCacheCheck*/
- !1
- ));
- if (l & 8) {
- const f = r.antecedent;
- if (f === void 0 || f.length === 0)
- return !1;
- r = f[0];
- } else if (l & 128) {
- const f = r.node;
- if (f.clauseStart === f.clauseEnd && gNe(f.switchStatement))
- return !1;
- r = r.antecedent;
- } else if (l & 1024) {
- Zp = void 0;
- const f = r.node.target, m = f.antecedent;
- f.antecedent = r.node.antecedents;
- const y = a$(
- r.antecedent,
- /*noCacheCheck*/
- !1
- );
- return f.antecedent = m, y;
- } else
- return !(l & 1);
- }
- }
- }
- function o$(r, a) {
- for (; ; ) {
- const l = r.flags;
- if (l & 4096) {
- if (!a) {
- const f = lpe(r), m = nh[f];
- return m !== void 0 ? m : nh[f] = o$(
- r,
- /*noCacheCheck*/
- !0
- );
- }
- a = !1;
- }
- if (l & 496)
- r = r.antecedent;
- else if (l & 512) {
- if (r.node.expression.kind === 108)
- return !0;
- r = r.antecedent;
- } else {
- if (l & 4)
- return Mi(r.antecedent, (f) => o$(
- f,
- /*noCacheCheck*/
- !1
- ));
- if (l & 8)
- r = r.antecedent[0];
- else if (l & 1024) {
- const f = r.node.target, m = f.antecedent;
- f.antecedent = r.node.antecedents;
- const y = o$(
- r.antecedent,
- /*noCacheCheck*/
- !1
- );
- return f.antecedent = m, y;
- } else
- return !!(l & 1);
- }
- }
- }
- function mpe(r) {
- switch (r.kind) {
- case 110:
- return !0;
- case 80:
- if (!Pb(r)) {
- const l = Nu(r);
- return zk(l) || jN(l) && !mM(l) || !!l.valueDeclaration && vo(l.valueDeclaration);
- }
- break;
- case 211:
- case 212:
- return mpe(r.expression) && em(bn(r).resolvedSymbol || ze);
- case 206:
- case 207:
- const a = pm(r.parent);
- return Ii(a) || lee(a) ? !gpe(a) : ii(a) && sI(a);
- }
- return !1;
- }
- function _0(r, a, l = a, f, m = ((y) => (y = Wn(r, f3)) == null ? void 0 : y.flowNode)()) {
- let y, x = !1, N = 0;
- if (Vh)
- return He;
- if (!m)
- return a;
- z0++;
- const j = dg, W = xT(de(m));
- dg = j;
- const Q = wn(W) & 256 && wAe(r) ? Va : uM(W);
- if (Q === mr || r.parent && r.parent.kind === 235 && !(Q.flags & 131072) && ad(
- Q,
- 2097152
- /* NEUndefinedOrNull */
- ).flags & 131072)
- return a;
- return Q;
- function ye() {
- return x ? y : (x = !0, y = aM(r, a, l, f));
- }
- function de(Pt) {
- var cr;
- if (N === 2e3)
- return (cr = rn) == null || cr.instant(rn.Phase.CheckTypes, "getTypeAtFlowNode_DepthLimit", { flowId: Pt.id }), Vh = !0, Tnt(r), He;
- N++;
- let Or;
- for (; ; ) {
- const Ur = Pt.flags;
- if (Ur & 4096) {
- for (let Kn = j; Kn < dg; Kn++)
- if (zu[Kn] === Pt)
- return N--, o2[Kn];
- Or = Pt;
- }
- let xn;
- if (Ur & 16) {
- if (xn = ct(Pt), !xn) {
- Pt = Pt.antecedent;
- continue;
- }
- } else if (Ur & 512) {
- if (xn = Gt(Pt), !xn) {
- Pt = Pt.antecedent;
- continue;
- }
- } else if (Ur & 96)
- xn = Xr(Pt);
- else if (Ur & 128)
- xn = tn(Pt);
- else if (Ur & 12) {
- if (Pt.antecedent.length === 1) {
- Pt = Pt.antecedent[0];
- continue;
- }
- xn = Ur & 4 ? pr(Pt) : er(Pt);
- } else if (Ur & 256) {
- if (xn = sr(Pt), !xn) {
- Pt = Pt.antecedent;
- continue;
- }
- } else if (Ur & 1024) {
- const Kn = Pt.node.target, ea = Kn.antecedent;
- Kn.antecedent = Pt.node.antecedents, xn = de(Pt.antecedent), Kn.antecedent = ea;
- } else if (Ur & 2) {
- const Kn = Pt.node;
- if (Kn && Kn !== f && r.kind !== 211 && r.kind !== 212 && !(r.kind === 110 && Kn.kind !== 219)) {
- Pt = Kn.flowNode;
- continue;
- }
- xn = l;
- } else
- xn = tI(a);
- return Or && (zu[dg] = Or, o2[dg] = xn, dg++), N--, xn;
- }
- }
- function Ze(Pt) {
- const cr = Pt.node;
- return hpe(
- cr.kind === 260 || cr.kind === 208 ? xAe(cr) : lM(cr),
- r
- );
- }
- function ct(Pt) {
- const cr = Pt.node;
- if (jl(r, cr)) {
- if (!pM(Pt))
- return mr;
- if (rv(cr) === 2) {
- const Ur = de(Pt.antecedent);
- return yE(o0(xT(Ur)), hE(Ur));
- }
- if (a === at || a === Va) {
- if (lnt(cr))
- return dpe(Ht);
- const Ur = eb(Ze(Pt));
- return $s(Ur, a) ? Ur : so;
- }
- const Or = _B(cr) ? o0(a) : a;
- return Or.flags & 1048576 ? ent(Or, Ze(Pt)) : Or;
- }
- if (_Ae(r, cr)) {
- if (!pM(Pt))
- return mr;
- if (ii(cr) && (cn(cr) || sI(cr))) {
- const Or = y4(cr);
- if (Or && (Or.kind === 218 || Or.kind === 219))
- return de(Pt.antecedent);
- }
- return a;
- }
- if (ii(cr) && cr.parent.parent.kind === 249 && (jl(r, cr.parent.parent.expression) || bT(cr.parent.parent.expression, r)))
- return jpe(uM(xT(de(Pt.antecedent))));
- }
- function mt(Pt, cr) {
- const Or = Ba(
- cr,
- /*excludeJSDocTypeAssertions*/
- !0
- );
- if (Or.kind === 97)
- return mr;
- if (Or.kind === 226) {
- if (Or.operatorToken.kind === 56)
- return mt(mt(Pt, Or.left), Or.right);
- if (Or.operatorToken.kind === 57)
- return Qn([mt(Pt, Or.left), mt(Pt, Or.right)]);
- }
- return Df(
- Pt,
- Or,
- /*assumeTrue*/
- !0
- );
- }
- function Gt(Pt) {
- const cr = fM(Pt.node);
- if (cr) {
- const Or = Cp(cr);
- if (Or && (Or.kind === 2 || Or.kind === 3)) {
- const Ur = de(Pt.antecedent), xn = uM(xT(Ur)), Kn = Or.type ? $P(
- xn,
- Or,
- Pt.node,
- /*assumeTrue*/
- !0
- ) : Or.kind === 3 && Or.parameterIndex >= 0 && Or.parameterIndex < Pt.node.arguments.length ? mt(xn, Pt.node.arguments[Or.parameterIndex]) : xn;
- return Kn === xn ? Ur : yE(Kn, hE(Ur));
- }
- if (Ha(cr).flags & 131072)
- return mr;
- }
- }
- function sr(Pt) {
- if (a === at || a === Va) {
- const cr = Pt.node, Or = cr.kind === 213 ? cr.expression.expression : cr.left.expression;
- if (jl(r, F2(Or))) {
- const Ur = de(Pt.antecedent), xn = xT(Ur);
- if (wn(xn) & 256) {
- let Kn = xn;
- if (cr.kind === 213)
- for (const ea of cr.arguments)
- Kn = PAe(Kn, ea);
- else {
- const ea = BM(cr.left.argumentExpression);
- eu(
- ea,
- 296
- /* NumberLike */
- ) && (Kn = PAe(Kn, cr.right));
- }
- return Kn === xn ? Ur : yE(Kn, hE(Ur));
- }
- return Ur;
- }
- }
- }
- function Xr(Pt) {
- const cr = de(Pt.antecedent), Or = xT(cr);
- if (Or.flags & 131072)
- return cr;
- const Ur = (Pt.flags & 32) !== 0, xn = uM(Or), Kn = Df(xn, Pt.node, Ur);
- return Kn === xn ? cr : yE(Kn, hE(cr));
- }
- function tn(Pt) {
- const cr = Ba(Pt.node.switchStatement.expression), Or = de(Pt.antecedent);
- let Ur = xT(Or);
- if (jl(r, cr))
- Ur = Fo(Ur, Pt.node);
- else if (cr.kind === 221 && jl(r, cr.expression))
- Ur = Nl(Ur, Pt.node);
- else if (cr.kind === 112)
- Ur = Sc(Ur, Pt.node);
- else {
- ee && (bT(cr, r) ? Ur = Zs(Ur, Pt.node, (Kn) => !(Kn.flags & 163840)) : cr.kind === 221 && bT(cr.expression, r) && (Ur = Zs(Ur, Pt.node, (Kn) => !(Kn.flags & 131072 || Kn.flags & 128 && Kn.value === "undefined"))));
- const xn = ci(cr, Ur);
- xn && (Ur = js(Ur, xn, Pt.node));
- }
- return yE(Ur, hE(Or));
- }
- function pr(Pt) {
- const cr = [];
- let Or = !1, Ur = !1, xn;
- for (const Kn of Pt.antecedent) {
- if (!xn && Kn.flags & 128 && Kn.node.clauseStart === Kn.node.clauseEnd) {
- xn = Kn;
- continue;
- }
- const ea = de(Kn), ua = xT(ea);
- if (ua === a && a === l)
- return ua;
- tp(cr, ua), MP(ua, l) || (Or = !0), hE(ea) && (Ur = !0);
- }
- if (xn) {
- const Kn = de(xn), ea = xT(Kn);
- if (!(ea.flags & 131072) && !ss(cr, ea) && !gNe(xn.node.switchStatement)) {
- if (ea === a && a === l)
- return ea;
- cr.push(ea), MP(ea, l) || (Or = !0), hE(Kn) && (Ur = !0);
- }
- }
- return yE(gn(
- cr,
- Or ? 2 : 1
- /* Literal */
- ), Ur);
- }
- function er(Pt) {
- const cr = lpe(Pt), Or = Bu[cr] || (Bu[cr] = /* @__PURE__ */ new Map()), Ur = ye();
- if (!Ur)
- return a;
- const xn = Or.get(Ur);
- if (xn)
- return xn;
- for (let Ee = th; Ee < Yp; Ee++)
- if (ed[Ee] === Pt && Ju[Ee] === Ur && td[Ee].length)
- return yE(
- gn(
- td[Ee],
- 1
- /* Literal */
- ),
- /*incomplete*/
- !0
- );
- const Kn = [];
- let ea = !1, ua;
- for (const Ee of Pt.antecedent) {
- let pe;
- if (!ua)
- pe = ua = de(Ee);
- else {
- ed[Yp] = Pt, Ju[Yp] = Ur, td[Yp] = Kn, Yp++;
- const vr = qf;
- qf = void 0, pe = de(Ee), qf = vr, Yp--;
- const hn = Or.get(Ur);
- if (hn)
- return hn;
- }
- const Ut = xT(pe);
- if (tp(Kn, Ut), MP(Ut, l) || (ea = !0), Ut === a)
- break;
- }
- const So = gn(
- Kn,
- ea ? 2 : 1
- /* Literal */
- );
- return hE(ua) ? yE(
- So,
- /*incomplete*/
- !0
- ) : (Or.set(Ur, So), So);
- }
- function gn(Pt, cr) {
- if (vnt(Pt))
- return dpe(Qn(lr(Pt, ynt)));
- const Or = hAe(Qn(qc(Pt, uM), cr));
- return Or !== a && Or.flags & a.flags & 1048576 && Af(Or.types, a.types) ? a : Or;
- }
- function Un(Pt) {
- if (As(r) || Wy(r) || jp(r)) {
- if (Oe(Pt)) {
- const Or = Nu(Pt).valueDeclaration;
- if (Or && (va(Or) || Ii(Or)) && r === Or.parent && !Or.initializer && !Or.dotDotDotToken)
- return Or;
- }
- } else if (xo(Pt)) {
- if (jl(r, Pt.expression))
- return Pt;
- } else if (Oe(Pt)) {
- const cr = Nu(Pt);
- if (zk(cr)) {
- const Or = cr.valueDeclaration;
- if (ii(Or) && !Or.type && Or.initializer && xo(Or.initializer) && jl(r, Or.initializer.expression))
- return Or.initializer;
- if (va(Or) && !Or.initializer) {
- const Ur = Or.parent.parent;
- if (ii(Ur) && !Ur.type && Ur.initializer && (Oe(Ur.initializer) || xo(Ur.initializer)) && jl(r, Ur.initializer))
- return Or;
- }
- }
- }
- }
- function ci(Pt, cr) {
- if (a.flags & 1048576 || cr.flags & 1048576) {
- const Or = Un(Pt);
- if (Or) {
- const Ur = vT(Or);
- if (Ur) {
- const xn = a.flags & 1048576 && MP(cr, a) ? a : cr;
- if (LP(xn, Ur))
- return Or;
- }
- }
- }
- }
- function Jn(Pt, cr, Or) {
- const Ur = vT(cr);
- if (Ur === void 0)
- return Pt;
- const xn = hu(cr), Kn = ee && (xn || _ee(cr)) && bc(
- Pt,
- 98304
- /* Nullable */
- );
- let ea = Rc(Kn ? ad(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ) : Pt, Ur);
- if (!ea)
- return Pt;
- ea = Kn && xn ? N1(ea) : ea;
- const ua = Or(ea);
- return Vc(Pt, (So) => {
- const Ee = Pk(So, Ur) || M;
- return !(Ee.flags & 131072) && !(ua.flags & 131072) && YL(ua, Ee);
- });
- }
- function Us(Pt, cr, Or, Ur, xn) {
- if ((Or === 37 || Or === 38) && Pt.flags & 1048576) {
- const Kn = oM(Pt);
- if (Kn && Kn === vT(cr)) {
- const ea = cM(Pt, tu(Ur));
- if (ea)
- return Or === (xn ? 37 : 38) ? ea : Yd(Rc(ea, Kn) || M) ? i$(Pt, ea) : Pt;
- }
- }
- return Jn(Pt, cr, (Kn) => wi(Kn, Or, Ur, xn));
- }
- function js(Pt, cr, Or) {
- if (Or.clauseStart < Or.clauseEnd && Pt.flags & 1048576 && oM(Pt) === vT(cr)) {
- const Ur = n$(Or.switchStatement).slice(Or.clauseStart, Or.clauseEnd), xn = Qn(lr(Ur, (Kn) => cM(Pt, Kn) || M));
- if (xn !== M)
- return xn;
- }
- return Jn(Pt, cr, (Ur) => Fo(Ur, Or));
- }
- function Oo(Pt, cr, Or) {
- if (jl(r, cr))
- return ST(
- Pt,
- Or ? 4194304 : 8388608
- /* Falsy */
- );
- ee && Or && bT(cr, r) && (Pt = ST(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ));
- const Ur = ci(cr, Pt);
- return Ur ? Jn(Pt, Ur, (xn) => ad(
- xn,
- Or ? 4194304 : 8388608
- /* Falsy */
- )) : Pt;
- }
- function ls(Pt, cr, Or) {
- const Ur = Gs(Pt, cr);
- return Ur ? !!(Ur.flags & 16777216 || gc(Ur) & 48) || Or : !!Nk(Pt, cr) || !Or;
- }
- function sc(Pt, cr, Or) {
- const Ur = _p(cr);
- if (Pp(Pt, (Kn) => ls(
- Kn,
- Ur,
- /*assumeTrue*/
- !0
- )))
- return Vc(Pt, (Kn) => ls(Kn, Ur, Or));
- if (Or) {
- const Kn = Cet();
- if (Kn)
- return ia([Pt, _E(Kn, [cr, M])]);
- }
- return Pt;
- }
- function Jl(Pt, cr, Or, Ur, xn) {
- return xn = xn !== (Or.kind === 112) != (Ur !== 38 && Ur !== 36), Df(Pt, cr, xn);
- }
- function pc(Pt, cr, Or) {
- switch (cr.operatorToken.kind) {
- case 64:
- case 76:
- case 77:
- case 78:
- return Oo(Df(Pt, cr.right, Or), cr.left, Or);
- case 35:
- case 36:
- case 37:
- case 38:
- const Ur = cr.operatorToken.kind, xn = F2(cr.left), Kn = F2(cr.right);
- if (xn.kind === 221 && Xa(Kn))
- return un(Pt, xn, Ur, Kn, Or);
- if (Kn.kind === 221 && Xa(xn))
- return un(Pt, Kn, Ur, xn, Or);
- if (jl(r, xn))
- return wi(Pt, Ur, Kn, Or);
- if (jl(r, Kn))
- return wi(Pt, Ur, xn, Or);
- ee && (bT(xn, r) ? Pt = Wr(Pt, Ur, Kn, Or) : bT(Kn, r) && (Pt = Wr(Pt, Ur, xn, Or)));
- const ea = ci(xn, Pt);
- if (ea)
- return Us(Pt, ea, Ur, Kn, Or);
- const ua = ci(Kn, Pt);
- if (ua)
- return Us(Pt, ua, Ur, xn, Or);
- if (mo(xn))
- return ep(Pt, Ur, Kn, Or);
- if (mo(Kn))
- return ep(Pt, Ur, xn, Or);
- if (a4(Kn) && !xo(xn))
- return Jl(Pt, xn, Kn, Ur, Or);
- if (a4(xn) && !xo(Kn))
- return Jl(Pt, Kn, xn, Ur, Or);
- break;
- case 104:
- return Ac(Pt, cr, Or);
- case 103:
- if (Di(cr.left))
- return Pr(Pt, cr, Or);
- const So = F2(cr.right);
- if (IN(Pt) && xo(r) && jl(r.expression, So)) {
- const Ee = tu(cr.left);
- if (up(Ee) && vT(r) === _p(Ee))
- return ad(
- Pt,
- Or ? 524288 : 65536
- /* EQUndefined */
- );
- }
- if (jl(r, So)) {
- const Ee = tu(cr.left);
- if (up(Ee))
- return sc(Pt, Ee, Or);
- }
- break;
- case 28:
- return Df(Pt, cr.right, Or);
- case 56:
- return Or ? Df(
- Df(
- Pt,
- cr.left,
- /*assumeTrue*/
- !0
- ),
- cr.right,
- /*assumeTrue*/
- !0
- ) : Qn([Df(
- Pt,
- cr.left,
- /*assumeTrue*/
- !1
- ), Df(
- Pt,
- cr.right,
- /*assumeTrue*/
- !1
- )]);
- case 57:
- return Or ? Qn([Df(
- Pt,
- cr.left,
- /*assumeTrue*/
- !0
- ), Df(
- Pt,
- cr.right,
- /*assumeTrue*/
- !0
- )]) : Df(
- Df(
- Pt,
- cr.left,
- /*assumeTrue*/
- !1
- ),
- cr.right,
- /*assumeTrue*/
- !1
- );
- }
- return Pt;
- }
- function Pr(Pt, cr, Or) {
- const Ur = F2(cr.right);
- if (!jl(r, Ur))
- return Pt;
- E.assertNode(cr.left, Di);
- const xn = T$(cr.left);
- if (xn === void 0)
- return Pt;
- const Kn = xn.parent, ea = tl(E.checkDefined(xn.valueDeclaration, "should always have a declaration")) ? nn(Kn) : bo(Kn);
- return _y(
- Pt,
- ea,
- Or,
- /*checkDerived*/
- !0
- );
- }
- function Wr(Pt, cr, Or, Ur) {
- const xn = cr === 35 || cr === 37, Kn = cr === 35 || cr === 36 ? 98304 : 32768, ea = tu(Or);
- return xn !== Ur && z_(ea, (So) => !!(So.flags & Kn)) || xn === Ur && z_(ea, (So) => !(So.flags & (3 | Kn))) ? ST(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ) : Pt;
- }
- function wi(Pt, cr, Or, Ur) {
- if (Pt.flags & 1)
- return Pt;
- (cr === 36 || cr === 38) && (Ur = !Ur);
- const xn = tu(Or), Kn = cr === 35 || cr === 36;
- if (xn.flags & 98304) {
- if (!ee)
- return Pt;
- const ea = Kn ? Ur ? 262144 : 2097152 : xn.flags & 65536 ? Ur ? 131072 : 1048576 : Ur ? 65536 : 524288;
- return ST(Pt, ea);
- }
- if (Ur) {
- if (!Kn && (Pt.flags & 2 || Pp(Pt, Dg))) {
- if (xn.flags & 469893116 || Dg(xn))
- return xn;
- if (xn.flags & 524288)
- return Kt;
- }
- const ea = Vc(Pt, (ua) => YL(ua, xn) || Kn && Srt(ua, xn));
- return DAe(ea, xn);
- }
- return Yd(xn) ? Vc(Pt, (ea) => !(H3e(ea) && YL(ea, xn))) : Pt;
- }
- function un(Pt, cr, Or, Ur, xn) {
- (Or === 36 || Or === 38) && (xn = !xn);
- const Kn = F2(cr.expression);
- if (!jl(r, Kn)) {
- ee && bT(Kn, r) && xn === (Ur.text !== "undefined") && (Pt = ST(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ));
- const ea = ci(Kn, Pt);
- return ea ? Jn(Pt, ea, (ua) => is(ua, Ur, xn)) : Pt;
- }
- return is(Pt, Ur, xn);
- }
- function is(Pt, cr, Or) {
- return Or ? dc(Pt, cr.text) : ST(
- Pt,
- Lre.get(cr.text) || 32768
- /* TypeofNEHostObject */
- );
- }
- function Zs(Pt, { switchStatement: cr, clauseStart: Or, clauseEnd: Ur }, xn) {
- return Or !== Ur && Mi(n$(cr).slice(Or, Ur), xn) ? ad(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ) : Pt;
- }
- function Fo(Pt, { switchStatement: cr, clauseStart: Or, clauseEnd: Ur }) {
- const xn = n$(cr);
- if (!xn.length)
- return Pt;
- const Kn = xn.slice(Or, Ur), ea = Or === Ur || ss(Kn, Ht);
- if (Pt.flags & 2 && !ea) {
- let pe;
- for (let Ut = 0; Ut < Kn.length; Ut += 1) {
- const vr = Kn[Ut];
- if (vr.flags & 469893116)
- pe !== void 0 && pe.push(vr);
- else if (vr.flags & 524288)
- pe === void 0 && (pe = Kn.slice(0, Ut)), pe.push(Kt);
- else
- return Pt;
- }
- return Qn(pe === void 0 ? Kn : pe);
- }
- const ua = Qn(Kn), So = ua.flags & 131072 ? Ht : DAe(Vc(Pt, (pe) => YL(ua, pe)), ua);
- if (!ea)
- return So;
- const Ee = Vc(Pt, (pe) => !(H3e(pe) && ss(xn, pe.flags & 32768 ? Ae : Vu(prt(pe)))));
- return So.flags & 131072 ? Ee : Qn([So, Ee]);
- }
- function dc(Pt, cr) {
- switch (cr) {
- case "string":
- return Ta(
- Pt,
- Ie,
- 1
- /* TypeofEQString */
- );
- case "number":
- return Ta(
- Pt,
- At,
- 2
- /* TypeofEQNumber */
- );
- case "bigint":
- return Ta(
- Pt,
- Dr,
- 4
- /* TypeofEQBigInt */
- );
- case "boolean":
- return Ta(
- Pt,
- wt,
- 8
- /* TypeofEQBoolean */
- );
- case "symbol":
- return Ta(
- Pt,
- jt,
- 16
- /* TypeofEQSymbol */
- );
- case "object":
- return Pt.flags & 1 ? Pt : Qn([Ta(
- Pt,
- Kt,
- 32
- /* TypeofEQObject */
- ), Ta(
- Pt,
- ht,
- 131072
- /* EQNull */
- )]);
- case "function":
- return Pt.flags & 1 ? Pt : Ta(
- Pt,
- al,
- 64
- /* TypeofEQFunction */
- );
- case "undefined":
- return Ta(
- Pt,
- Ae,
- 65536
- /* EQUndefined */
- );
- }
- return Ta(
- Pt,
- Kt,
- 128
- /* TypeofEQHostObject */
- );
- }
- function Ta(Pt, cr, Or) {
- return Xo(Pt, (Ur) => (
- // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
- // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
- // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
- // but are classified as "function" according to `typeof`.
- zm(Ur, cr, Hf) ? Zd(Ur, Or) ? Ur : Ht : (
- // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
- // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
- O2(cr, Ur) ? cr : (
- // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
- // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
- // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
- Zd(Ur, Or) ? ia([Ur, cr]) : Ht
- )
- )
- ));
- }
- function Nl(Pt, { switchStatement: cr, clauseStart: Or, clauseEnd: Ur }) {
- const xn = CAe(cr);
- if (!xn)
- return Pt;
- const Kn = ac(
- cr.caseBlock.clauses,
- (So) => So.kind === 297
- /* DefaultClause */
- );
- if (Or === Ur || Kn >= Or && Kn < Ur) {
- const So = mNe(Or, Ur, xn);
- return Vc(Pt, (Ee) => gE(Ee, So) === So);
- }
- const ua = xn.slice(Or, Ur);
- return Qn(lr(ua, (So) => So ? dc(Pt, So) : Ht));
- }
- function Sc(Pt, { switchStatement: cr, clauseStart: Or, clauseEnd: Ur }) {
- const xn = ac(
- cr.caseBlock.clauses,
- (ua) => ua.kind === 297
- /* DefaultClause */
- ), Kn = Or === Ur || xn >= Or && xn < Ur;
- for (let ua = 0; ua < Or; ua++) {
- const So = cr.caseBlock.clauses[ua];
- So.kind === 296 && (Pt = Df(
- Pt,
- So.expression,
- /*assumeTrue*/
- !1
- ));
- }
- if (Kn) {
- for (let ua = Ur; ua < cr.caseBlock.clauses.length; ua++) {
- const So = cr.caseBlock.clauses[ua];
- So.kind === 296 && (Pt = Df(
- Pt,
- So.expression,
- /*assumeTrue*/
- !1
- ));
- }
- return Pt;
- }
- const ea = cr.caseBlock.clauses.slice(Or, Ur);
- return Qn(lr(ea, (ua) => ua.kind === 296 ? Df(
- Pt,
- ua.expression,
- /*assumeTrue*/
- !0
- ) : Ht));
- }
- function mo(Pt) {
- return (Cn(Pt) && Nn(Pt.name) === "constructor" || ko(Pt) && Xa(Pt.argumentExpression) && Pt.argumentExpression.text === "constructor") && jl(r, Pt.expression);
- }
- function ep(Pt, cr, Or, Ur) {
- if (Ur ? cr !== 35 && cr !== 37 : cr !== 36 && cr !== 38)
- return Pt;
- const xn = tu(Or);
- if (!$de(xn) && !Cr(xn))
- return Pt;
- const Kn = Gs(xn, "prototype");
- if (!Kn)
- return Pt;
- const ea = nn(Kn), ua = Wa(ea) ? void 0 : ea;
- if (!ua || ua === Lc || ua === al)
- return Pt;
- if (Wa(Pt))
- return ua;
- return Vc(Pt, (Ee) => So(Ee, ua));
- function So(Ee, pe) {
- return Ee.flags & 524288 && wn(Ee) & 1 || pe.flags & 524288 && wn(pe) & 1 ? Ee.symbol === pe.symbol : O2(Ee, pe);
- }
- }
- function Ac(Pt, cr, Or) {
- const Ur = F2(cr.left);
- if (!jl(r, Ur))
- return Or && ee && bT(Ur, r) ? ST(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ) : Pt;
- const xn = cr.right, Kn = tu(xn);
- if (!Zv(Kn, Lc))
- return Pt;
- const ea = fM(cr), ua = ea && Cp(ea);
- if (ua && ua.kind === 1 && ua.parameterIndex === 0)
- return _y(
- Pt,
- ua.type,
- Or,
- /*checkDerived*/
- !0
- );
- if (!Zv(Kn, al))
- return Pt;
- const So = Xo(Kn, jc);
- return Wa(Pt) && (So === Lc || So === al) || !Or && !(So.flags & 524288 && !Dg(So)) ? Pt : _y(
- Pt,
- So,
- Or,
- /*checkDerived*/
- !0
- );
- }
- function jc(Pt) {
- const cr = Rc(Pt, "prototype");
- if (cr && !Wa(cr))
- return cr;
- const Or = Ns(
- Pt,
- 1
- /* Construct */
- );
- return Or.length ? Qn(lr(Or, (Ur) => Ha(bN(Ur)))) : xs;
- }
- function _y(Pt, cr, Or, Ur) {
- const xn = Pt.flags & 1048576 ? `N${Rl(Pt)},${Rl(cr)},${(Or ? 1 : 0) | (Ur ? 2 : 0)}` : void 0;
- return Jd(xn) ?? V0(xn, EE(Pt, cr, Or, Ur));
- }
- function EE(Pt, cr, Or, Ur) {
- if (!Or) {
- if (Pt === cr)
- return Ht;
- if (Ur)
- return Vc(Pt, (So) => !Zv(So, cr));
- const ua = _y(
- Pt,
- cr,
- /*assumeTrue*/
- !0,
- /*checkDerived*/
- !1
- );
- return Vc(Pt, (So) => !MP(So, ua));
- }
- if (Pt.flags & 3 || Pt === cr)
- return cr;
- const xn = Ur ? Zv : O2, Kn = Pt.flags & 1048576 ? oM(Pt) : void 0, ea = Xo(cr, (ua) => {
- const So = Kn && Rc(ua, Kn), Ee = So && cM(Pt, So), pe = Xo(
- Ee || Pt,
- Ur ? (Ut) => Zv(Ut, ua) ? Ut : Zv(ua, Ut) ? ua : Ht : (Ut) => QL(Ut, ua) ? Ut : QL(ua, Ut) ? ua : O2(Ut, ua) ? Ut : O2(ua, Ut) ? ua : Ht
- );
- return pe.flags & 131072 ? Xo(Pt, (Ut) => bc(
- Ut,
- 465829888
- /* Instantiable */
- ) && xn(ua, Kl(Ut) || M) ? ia([Ut, ua]) : Ht) : pe;
- });
- return ea.flags & 131072 ? O2(cr, Pt) ? cr : $s(Pt, cr) ? Pt : $s(cr, Pt) ? cr : ia([Pt, cr]) : ea;
- }
- function GP(Pt, cr, Or) {
- if (mAe(cr, r)) {
- const Ur = Or || !$2(cr) ? fM(cr) : void 0, xn = Ur && Cp(Ur);
- if (xn && (xn.kind === 0 || xn.kind === 1))
- return $P(Pt, xn, cr, Or);
- }
- if (IN(Pt) && xo(r) && Cn(cr.expression)) {
- const Ur = cr.expression;
- if (jl(r.expression, F2(Ur.expression)) && Oe(Ur.name) && Ur.name.escapedText === "hasOwnProperty" && cr.arguments.length === 1) {
- const xn = cr.arguments[0];
- if (Xa(xn) && vT(r) === tc(xn.text))
- return ad(
- Pt,
- Or ? 524288 : 65536
- /* EQUndefined */
- );
- }
- }
- return Pt;
- }
- function $P(Pt, cr, Or, Ur) {
- if (cr.type && !(Wa(Pt) && (cr.type === Lc || cr.type === al))) {
- const xn = Snt(cr, Or);
- if (xn) {
- if (jl(r, xn))
- return _y(
- Pt,
- cr.type,
- Ur,
- /*checkDerived*/
- !1
- );
- ee && bT(xn, r) && (Ur && !Zd(
- cr.type,
- 65536
- /* EQUndefined */
- ) || !Ur && z_(cr.type, xM)) && (Pt = ST(
- Pt,
- 2097152
- /* NEUndefinedOrNull */
- ));
- const Kn = ci(xn, Pt);
- if (Kn)
- return Jn(Pt, Kn, (ea) => _y(
- ea,
- cr.type,
- Ur,
- /*checkDerived*/
- !1
- ));
- }
- }
- return Pt;
- }
- function Df(Pt, cr, Or) {
- if (JI(cr) || dn(cr.parent) && (cr.parent.operatorToken.kind === 61 || cr.parent.operatorToken.kind === 78) && cr.parent.left === cr)
- return sb(Pt, cr, Or);
- switch (cr.kind) {
- case 80:
- if (!jl(r, cr) && T < 5) {
- const Ur = Nu(cr);
- if (zk(Ur)) {
- const xn = Ur.valueDeclaration;
- if (xn && ii(xn) && !xn.type && xn.initializer && mpe(r)) {
- T++;
- const Kn = Df(Pt, xn.initializer, Or);
- return T--, Kn;
- }
- }
- }
- case 110:
- case 108:
- case 211:
- case 212:
- return Oo(Pt, cr, Or);
- case 213:
- return GP(Pt, cr, Or);
- case 217:
- case 235:
- return Df(Pt, cr.expression, Or);
- case 226:
- return pc(Pt, cr, Or);
- case 224:
- if (cr.operator === 54)
- return Df(Pt, cr.operand, !Or);
- break;
- }
- return Pt;
- }
- function sb(Pt, cr, Or) {
- if (jl(r, cr))
- return ST(
- Pt,
- Or ? 2097152 : 262144
- /* EQUndefinedOrNull */
- );
- const Ur = ci(cr, Pt);
- return Ur ? Jn(Pt, Ur, (xn) => ad(
- xn,
- Or ? 2097152 : 262144
- /* EQUndefinedOrNull */
- )) : Pt;
- }
- }
- function xnt(r, a) {
- if (r = _f(r), (a.kind === 80 || a.kind === 81) && (A4(a) && (a = a.parent), Ed(a) && (!b0(a) || ux(a)))) {
- const l = GG(
- ux(a) && a.kind === 211 ? S$(
- a,
- /*checkMode*/
- void 0,
- /*writeOnly*/
- !0
- ) : tu(a)
- );
- if (_f(bn(a).resolvedSymbol) === r)
- return l;
- }
- return og(a) && om(a.parent) && oT(a.parent) ? oG(a.parent.symbol) : RB(a) && ux(a.parent) ? T1(r) : x1(r);
- }
- function RN(r) {
- return or(
- r.parent,
- (a) => ys(a) && !bb(a) || a.kind === 268 || a.kind === 307 || a.kind === 172
- /* PropertyDeclaration */
- );
- }
- function mM(r) {
- return !NAe(
- r,
- /*location*/
- void 0
- );
- }
- function NAe(r, a) {
- const l = or(r.valueDeclaration, c$);
- if (!l)
- return !1;
- const f = bn(l);
- return f.flags & 131072 || (f.flags |= 131072, knt(l) || OAe(l)), !r.lastAssignmentPos || a && r.lastAssignmentPos < a.pos;
- }
- function gpe(r) {
- return E.assert(ii(r) || Ii(r)), IAe(r.name);
- }
- function IAe(r) {
- return r.kind === 80 ? mM(Tn(r.parent)) : ut(r.elements, (a) => a.kind !== 232 && IAe(a.name));
- }
- function knt(r) {
- return !!or(r.parent, (a) => c$(a) && !!(bn(a).flags & 131072));
- }
- function c$(r) {
- return no(r) || Si(r);
- }
- function OAe(r) {
- switch (r.kind) {
- case 80:
- if (b0(r)) {
- const f = Nu(r);
- if (jN(f) && f.lastAssignmentPos !== Number.MAX_VALUE) {
- const m = or(r, c$), y = or(f.valueDeclaration, c$);
- f.lastAssignmentPos = m === y ? Cnt(r, f.valueDeclaration) : Number.MAX_VALUE;
- }
- }
- return;
- case 281:
- const a = r.parent.parent, l = r.propertyName || r.name;
- if (!r.isTypeOnly && !a.isTypeOnly && !a.moduleSpecifier && l.kind !== 11) {
- const f = Yo(
- l,
- 111551,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0
- );
- f && jN(f) && (f.lastAssignmentPos = Number.MAX_VALUE);
- }
- return;
- case 264:
- case 265:
- case 266:
- return;
- }
- fi(r) || bs(r, OAe);
- }
- function Cnt(r, a) {
- let l = r.pos;
- for (; r && r.pos > a.pos; ) {
- switch (r.kind) {
- case 243:
- case 244:
- case 245:
- case 246:
- case 247:
- case 248:
- case 249:
- case 250:
- case 254:
- case 255:
- case 258:
- case 263:
- l = r.end;
- }
- r = r.parent;
- }
- return l;
- }
- function zk(r) {
- return r.flags & 3 && (Lpe(r) & 6) !== 0;
- }
- function jN(r) {
- const a = r.valueDeclaration && pm(r.valueDeclaration);
- return !!a && (Ii(a) || ii(a) && (Ub(a.parent) || Ent(a)));
- }
- function Ent(r) {
- return !!(r.parent.flags & 1) && !(U1(r) & 32 || r.parent.parent.kind === 243 && g0(r.parent.parent.parent));
- }
- function Dnt(r) {
- const a = bn(r);
- if (a.parameterInitializerContainsUndefined === void 0) {
- if (!vg(
- r,
- 8
- /* ParameterInitializerContainsUndefined */
- ))
- return nE(r.symbol), !0;
- const l = !!Zd(
- BP(
- r,
- 0
- /* Normal */
- ),
- 16777216
- /* IsUndefined */
- );
- if (!bg())
- return nE(r.symbol), !0;
- a.parameterInitializerContainsUndefined ?? (a.parameterInitializerContainsUndefined = l);
- }
- return a.parameterInitializerContainsUndefined;
- }
- function Pnt(r, a) {
- return ee && a.kind === 169 && a.initializer && Zd(
- r,
- 16777216
- /* IsUndefined */
- ) && !Dnt(a) ? ad(
- r,
- 524288
- /* NEUndefined */
- ) : r;
- }
- function wnt(r, a) {
- const l = a.parent;
- return l.kind === 211 || l.kind === 166 || l.kind === 213 && l.expression === a || l.kind === 214 && l.expression === a || l.kind === 212 && l.expression === a && !(Pp(r, LAe) && mT(tu(l.argumentExpression)));
- }
- function FAe(r) {
- return r.flags & 2097152 ? ut(r.types, FAe) : !!(r.flags & 465829888 && kg(r).flags & 1146880);
- }
- function LAe(r) {
- return r.flags & 2097152 ? ut(r.types, LAe) : !!(r.flags & 465829888 && !bc(
- kg(r),
- 98304
- /* Nullable */
- ));
- }
- function Ant(r, a) {
- const l = (Oe(r) || Cn(r) || ko(r)) && !((xm(r.parent) || yS(r.parent)) && r.parent.tagName === r) && (a && a & 32 ? a_(
- r,
- 8
- /* SkipBindingPatterns */
- ) : a_(
- r,
- /*contextFlags*/
- void 0
- ));
- return l && !Lk(l);
- }
- function hpe(r, a, l) {
- return fE(r) && (r = r.baseType), !(l && l & 2) && Pp(r, FAe) && (wnt(r, a) || Ant(a, l)) ? Xo(r, kg) : r;
- }
- function MAe(r) {
- return !!or(r, (a) => {
- const l = a.parent;
- return l === void 0 ? "quit" : wo(l) ? l.expression === a && yo(a) : vu(l) ? l.name === a || l.propertyName === a : !1;
- });
- }
- function Wk(r, a, l, f) {
- if (Re && !(r.flags & 33554432 && !m_(r) && !cs(r)))
- switch (a) {
- case 1:
- return l$(r);
- case 2:
- return RAe(r, l, f);
- case 3:
- return jAe(r);
- case 4:
- return ype(r);
- case 5:
- return BAe(r);
- case 6:
- return JAe(r);
- case 7:
- return zAe(r);
- case 8:
- return WAe(r);
- case 0: {
- if (Oe(r) && (Ed(r) || uu(r.parent) || gl(r.parent) && r.parent.moduleReference === r) && HAe(r)) {
- if (Iw(r.parent) && (Cn(r.parent) ? r.parent.expression : r.parent.left) !== r)
- return;
- l$(r);
- return;
- }
- if (Iw(r)) {
- let m = r;
- for (; Iw(m); ) {
- if (um(m)) return;
- m = m.parent;
- }
- return RAe(r);
- }
- return wo(r) ? jAe(r) : ou(r) || vS(r) ? ype(r) : gl(r) ? nS(r) || H$(r) ? JAe(r) : void 0 : vu(r) ? zAe(r) : ((no(r) || vm(r)) && BAe(r), !O.emitDecoratorMetadata || !Vb(r) || !Ff(r) || !r.modifiers || !Zw(X, r, r.parent, r.parent.parent) ? void 0 : WAe(r));
- }
- default:
- E.assertNever(a, `Unhandled reference hint: ${a}`);
- }
- }
- function l$(r) {
- const a = Nu(r);
- a && a !== Me && a !== ze && !Pb(r) && gM(a, r);
- }
- function RAe(r, a, l) {
- const f = Cn(r) ? r.expression : r.left;
- if (Ly(f) || !Oe(f))
- return;
- const m = Nu(f);
- if (!m || m === ze)
- return;
- if (Wp(O) || jy(O) && MAe(r)) {
- gM(m, r);
- return;
- }
- const y = l || wc(f);
- if (Wa(y) || y === en) {
- gM(m, r);
- return;
- }
- let x = a;
- if (!x && !l) {
- const N = Cn(r) ? r.name : r.right, j = Di(N) && kM(N.escapedText, N), W = rv(r), Q = Uu(W !== 0 || Bpe(r) ? J_(y) : y);
- x = Di(N) ? j && x$(Q, j) || void 0 : Gs(Q, N.escapedText);
- }
- x && (nI(x) || x.flags & 8 && r.parent.kind === 306) || gM(m, r);
- }
- function jAe(r) {
- if (Oe(r.expression)) {
- const a = r.expression, l = _f(Yo(
- a,
- -1,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- r
- ));
- l && gM(l, a);
- }
- }
- function ype(r) {
- if (!Ope(r)) {
- const a = Da && O.jsx === 2 ? p.Cannot_find_name_0 : void 0, l = gg(r), f = ou(r) ? r.tagName : r;
- let m;
- if (vS(r) && l === "null" || (m = Nt(
- f,
- l,
- 111551,
- a,
- /*isUse*/
- !0
- )), m && (m.isReferenced = -1, Re && m.flags & 2097152 && !Fm(m) && u$(m)), vS(r)) {
- const y = Tr(r), x = fk(y);
- x && Nt(
- f,
- x,
- 111551,
- a,
- /*isUse*/
- !0
- );
- }
- }
- }
- function BAe(r) {
- if (B < 2 && Jc(r) & 2) {
- const a = Y_(r);
- Nnt(a);
- }
- }
- function JAe(r) {
- Gn(
- r,
- 32
- /* Export */
- ) && UAe(r);
- }
- function zAe(r) {
- if (!r.parent.parent.moduleSpecifier && !r.isTypeOnly && !r.parent.parent.isTypeOnly) {
- const a = r.propertyName || r.name;
- if (a.kind === 11)
- return;
- const l = Nt(
- a,
- a.escapedText,
- 2998271,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- if (!(l && (l === we || l === fe || l.declarations && g0(aT(l.declarations[0]))))) {
- const f = l && (l.flags & 2097152 ? Zl(l) : l);
- (!f || Pu(f) & 111551) && (UAe(r), l$(a));
- }
- return;
- }
- }
- function WAe(r) {
- if (O.emitDecoratorMetadata) {
- const a = On(r.modifiers, dl);
- if (!a)
- return;
- switch (bl(
- a,
- 16
- /* Metadata */
- ), r.kind) {
- case 263:
- const l = Bg(r);
- if (l)
- for (const x of l.parameters)
- vE(J$(x));
- break;
- case 177:
- case 178:
- const f = r.kind === 177 ? 178 : 177, m = Jo(Tn(r), f);
- vE(oT(r) || m && oT(m));
- break;
- case 174:
- for (const x of r.parameters)
- vE(J$(x));
- vE(Y_(r));
- break;
- case 172:
- vE(Gc(r));
- break;
- case 169:
- vE(J$(r));
- const y = r.parent;
- for (const x of y.parameters)
- vE(J$(x));
- vE(Y_(y));
- break;
- }
- }
- }
- function gM(r, a) {
- if (Re && f2(
- r,
- /*excludes*/
- 111551
- /* Value */
- ) && !ax(a)) {
- const l = Zl(r);
- Pu(
- r,
- /*excludeTypeOnlyMeanings*/
- !0
- ) & 1160127 && (Wp(O) || jy(O) && MAe(a) || !nI(_f(l))) && u$(r);
- }
- }
- function u$(r) {
- E.assert(Re);
- const a = Bi(r);
- if (!a.referenced) {
- a.referenced = !0;
- const l = Du(r);
- if (!l) return E.fail();
- if (nS(l) && Pu(Mc(r)) & 111551) {
- const f = E_(l.moduleReference);
- l$(f);
- }
- }
- }
- function UAe(r) {
- const a = Tn(r), l = Zl(a);
- l && (l === ze || Pu(
- a,
- /*excludeTypeOnlyMeanings*/
- !0
- ) & 111551 && !nI(l)) && u$(a);
- }
- function VAe(r, a) {
- if (!r) return;
- const l = E_(r), f = (r.kind === 80 ? 788968 : 1920) | 2097152, m = Nt(
- l,
- l.escapedText,
- f,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- if (m && m.flags & 2097152) {
- if (Re && ff(m) && !nI(Zl(m)) && !Fm(m))
- u$(m);
- else if (a && Wp(O) && Ru(O) >= 5 && !ff(m) && !ut(m.declarations, Py)) {
- const y = je(r, p.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled), x = On(m.declarations || Ue, kf);
- x && Rs(y, Kr(x, p._0_was_imported_here, Nn(l)));
- }
- }
- }
- function Nnt(r) {
- VAe(
- r && Yw(r),
- /*forDecoratorMetadata*/
- !1
- );
- }
- function vE(r) {
- const a = Ede(r);
- a && l_(a) && VAe(
- a,
- /*forDecoratorMetadata*/
- !0
- );
- }
- function Int(r, a) {
- var l;
- const f = nn(r), m = r.valueDeclaration;
- if (m) {
- if (va(m) && !m.initializer && !m.dotDotDotToken && m.parent.elements.length >= 2) {
- const y = m.parent.parent, x = pm(y);
- if (x.kind === 260 && J2(x) & 6 || x.kind === 169) {
- const N = bn(y);
- if (!(N.flags & 4194304)) {
- N.flags |= 4194304;
- const j = ke(
- y,
- 0
- /* Normal */
- ), W = j && Xo(j, kg);
- if (N.flags &= -4194305, W && W.flags & 1048576 && !(x.kind === 169 && gpe(x))) {
- const Q = m.parent, ye = _0(
- Q,
- W,
- W,
- /*flowContainer*/
- void 0,
- a.flowNode
- );
- return ye.flags & 131072 ? Ht : Ka(
- m,
- ye,
- /*noTupleBoundsCheck*/
- !0
- );
- }
- }
- }
- }
- if (Ii(m) && !m.type && !m.initializer && !m.dotDotDotToken) {
- const y = m.parent;
- if (y.parameters.length >= 2 && LG(y)) {
- const x = JN(y);
- if (x && x.parameters.length === 1 && Su(x)) {
- const N = EP(zi(nn(x.parameters[0]), (l = L2(y)) == null ? void 0 : l.nonFixingMapper));
- if (N.flags & 1048576 && z_(N, ha) && !ut(y.parameters, gpe)) {
- const j = _0(
- y,
- N,
- N,
- /*flowContainer*/
- void 0,
- a.flowNode
- ), W = y.parameters.indexOf(m) - (Eb(y) ? 1 : 0);
- return j_(j, bd(W));
- }
- }
- }
- }
- }
- return f;
- }
- function qAe(r, a) {
- if (Pb(r)) return;
- if (a === Me) {
- if (Wpe(r)) {
- je(r, p.arguments_cannot_be_referenced_in_property_initializers);
- return;
- }
- let y = yf(r);
- if (y)
- for (B < 2 && (y.kind === 219 ? je(r, p.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression) : Gn(
- y,
- 1024
- /* Async */
- ) && je(r, p.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method)), bn(y).flags |= 512; y && Co(y); )
- y = yf(y), y && (bn(y).flags |= 512);
- return;
- }
- const l = _f(a), f = Bde(l, r);
- $h(f) && gfe(r, f) && f.declarations && Xh(r, f.declarations, r.escapedText);
- const m = l.valueDeclaration;
- if (m && l.flags & 32 && Zn(m) && m.name !== r) {
- let y = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- for (; y.kind !== 307 && y.parent !== m; )
- y = Lu(
- y,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- y.kind !== 307 && (bn(m).flags |= 262144, bn(y).flags |= 262144, bn(r).flags |= 536870912);
- }
- Rnt(r, a);
- }
- function Ont(r, a) {
- if (Pb(r))
- return hM(r);
- const l = Nu(r);
- if (l === ze)
- return He;
- if (qAe(r, l), l === Me)
- return Wpe(r) ? He : nn(l);
- HAe(r) && Wk(
- r,
- 1
- /* Identifier */
- );
- const f = _f(l);
- let m = f.valueDeclaration;
- if (m && m.kind === 208 && ss(rh, m.parent) && or(r, (tn) => tn === m.parent))
- return Zt;
- let y = Int(f, r);
- const x = rv(r);
- if (x) {
- if (!(f.flags & 3) && !(cn(r) && f.flags & 512)) {
- const tn = f.flags & 384 ? p.Cannot_assign_to_0_because_it_is_an_enum : f.flags & 32 ? p.Cannot_assign_to_0_because_it_is_a_class : f.flags & 1536 ? p.Cannot_assign_to_0_because_it_is_a_namespace : f.flags & 16 ? p.Cannot_assign_to_0_because_it_is_a_function : f.flags & 2097152 ? p.Cannot_assign_to_0_because_it_is_an_import : p.Cannot_assign_to_0_because_it_is_not_a_variable;
- return je(r, tn, Ji(l)), He;
- }
- if (em(f))
- return f.flags & 3 ? je(r, p.Cannot_assign_to_0_because_it_is_a_constant, Ji(l)) : je(r, p.Cannot_assign_to_0_because_it_is_a_read_only_property, Ji(l)), He;
- }
- const N = f.flags & 2097152;
- if (f.flags & 3) {
- if (x === 1)
- return _B(r) ? o0(y) : y;
- } else if (N)
- m = Du(l);
- else
- return y;
- if (!m)
- return y;
- y = hpe(y, r, a);
- const j = pm(m).kind === 169, W = RN(m);
- let Q = RN(r);
- const ye = Q !== W, de = r.parent && r.parent.parent && $g(r.parent) && ppe(r.parent.parent), Ze = l.flags & 134217728, ct = y === at || y === Va, mt = ct && r.parent.kind === 235;
- for (; Q !== W && (Q.kind === 218 || Q.kind === 219 || h7(Q)) && (zk(f) && y !== Va || jN(f) && NAe(f, r)); )
- Q = RN(Q);
- const Gt = j || N || ye || de || Ze || Fnt(r, m) || y !== at && y !== Va && (!ee || (y.flags & 16387) !== 0 || ax(r) || ope(r) || r.parent.kind === 281) || r.parent.kind === 235 || m.kind === 260 && m.exclamationToken || m.flags & 33554432, sr = mt ? Ae : Gt ? j ? Pnt(y, m) : y : ct ? Ae : N1(y), Xr = mt ? c0(_0(r, y, sr, Q)) : _0(r, y, sr, Q);
- if (!wAe(r) && (y === at || y === Va)) {
- if (Xr === at || Xr === Va)
- return ie && (je(os(m), p.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, Ji(l), Hr(Xr)), je(r, p.Variable_0_implicitly_has_an_1_type, Ji(l), Hr(Xr))), tI(Xr);
- } else if (!Gt && !mE(y) && mE(Xr))
- return je(r, p.Variable_0_is_used_before_being_assigned, Ji(l)), y;
- return x ? o0(Xr) : Xr;
- }
- function Fnt(r, a) {
- if (va(a)) {
- const l = or(r, va);
- return l && pm(l) === pm(a);
- }
- }
- function HAe(r) {
- var a;
- const l = r.parent;
- if (l) {
- if (Cn(l) && l.expression === r || vu(l) && l.isTypeOnly)
- return !1;
- const f = (a = l.parent) == null ? void 0 : a.parent;
- if (f && Nc(f) && f.isTypeOnly)
- return !1;
- }
- return !0;
- }
- function Lnt(r, a) {
- return !!or(r, (l) => l === a ? "quit" : ys(l) || l.parent && cs(l.parent) && !tl(l.parent) && l.parent.initializer === l);
- }
- function Mnt(r, a) {
- return or(r, (l) => l === a ? "quit" : l === a.initializer || l === a.condition || l === a.incrementor || l === a.statement);
- }
- function vpe(r) {
- return or(r, (a) => !a || bB(a) ? "quit" : Ny(
- a,
- /*lookInLabeledStatements*/
- !1
- ));
- }
- function Rnt(r, a) {
- if (B >= 2 || !(a.flags & 34) || !a.valueDeclaration || Si(a.valueDeclaration) || a.valueDeclaration.parent.kind === 299)
- return;
- const l = Cd(a.valueDeclaration), f = Lnt(r, l), m = vpe(l);
- if (m) {
- if (f) {
- let y = !0;
- if (fv(l)) {
- const x = nv(
- a.valueDeclaration,
- 261
- /* VariableDeclarationList */
- );
- if (x && x.parent === l) {
- const N = Mnt(r.parent, l);
- if (N) {
- const j = bn(N);
- j.flags |= 8192;
- const W = j.capturedBlockScopeBindings || (j.capturedBlockScopeBindings = []);
- tp(W, a), N === l.initializer && (y = !1);
- }
- }
- }
- y && (bn(m).flags |= 4096);
- }
- if (fv(l)) {
- const y = nv(
- a.valueDeclaration,
- 261
- /* VariableDeclarationList */
- );
- y && y.parent === l && Bnt(r, l) && (bn(a.valueDeclaration).flags |= 65536);
- }
- bn(a.valueDeclaration).flags |= 32768;
- }
- f && (bn(a.valueDeclaration).flags |= 16384);
- }
- function jnt(r, a) {
- const l = bn(r);
- return !!l && ss(l.capturedBlockScopeBindings, Tn(a));
- }
- function Bnt(r, a) {
- let l = r;
- for (; l.parent.kind === 217; )
- l = l.parent;
- let f = !1;
- if (b0(l))
- f = !0;
- else if (l.parent.kind === 224 || l.parent.kind === 225) {
- const m = l.parent;
- f = m.operator === 46 || m.operator === 47;
- }
- return f ? !!or(l, (m) => m === a ? "quit" : m === a.statement) : !1;
- }
- function bpe(r, a) {
- if (bn(r).flags |= 2, a.kind === 172 || a.kind === 176) {
- const l = a.parent;
- bn(l).flags |= 4;
- } else
- bn(a).flags |= 4;
- }
- function GAe(r) {
- return rS(r) ? r : ys(r) ? void 0 : bs(r, GAe);
- }
- function Spe(r) {
- const a = Tn(r), l = bo(a);
- return oi(l) === Le;
- }
- function $Ae(r, a, l) {
- const f = a.parent;
- Cb(f) && !Spe(f) && f3(r) && r.flowNode && !o$(
- r.flowNode,
- /*noCacheCheck*/
- !1
- ) && je(r, l);
- }
- function Jnt(r, a) {
- cs(a) && tl(a) && X && a.initializer && vw(a.initializer, r.pos) && Ff(a.parent) && je(r, p.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class);
- }
- function hM(r) {
- const a = ax(r);
- let l = Lu(
- r,
- /*includeArrowFunctions*/
- !0,
- /*includeClassComputedPropertyName*/
- !0
- ), f = !1, m = !1;
- for (l.kind === 176 && $Ae(r, l, p.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); ; ) {
- if (l.kind === 219 && (l = Lu(
- l,
- /*includeArrowFunctions*/
- !1,
- !m
- ), f = !0), l.kind === 167) {
- l = Lu(
- l,
- !f,
- /*includeClassComputedPropertyName*/
- !1
- ), m = !0;
- continue;
- }
- break;
- }
- if (Jnt(r, l), m)
- je(r, p.this_cannot_be_referenced_in_a_computed_property_name);
- else
- switch (l.kind) {
- case 267:
- je(r, p.this_cannot_be_referenced_in_a_module_or_namespace_body);
- break;
- case 266:
- je(r, p.this_cannot_be_referenced_in_current_location);
- break;
- }
- !a && f && B < 2 && bpe(r, l);
- const y = Tpe(
- r,
- /*includeGlobalThis*/
- !0,
- l
- );
- if (Se) {
- const x = nn(fe);
- if (y === x && f)
- je(r, p.The_containing_arrow_function_captures_the_global_value_of_this);
- else if (!y) {
- const N = je(r, p.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
- if (!Si(l)) {
- const j = Tpe(l);
- j && j !== x && Rs(N, Kr(l, p.An_outer_value_of_this_is_shadowed_by_this_container));
- }
- }
- }
- return y || xe;
- }
- function Tpe(r, a = !0, l = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- )) {
- const f = cn(r);
- if (ys(l) && (!Cpe(r) || Eb(l))) {
- let m = x_e(l) || f && Unt(l);
- if (!m) {
- const y = Wnt(l);
- if (f && y) {
- const x = Gi(y).symbol;
- x && x.members && x.flags & 16 && (m = bo(x).thisType);
- } else qm(l) && (m = bo(Ra(l.symbol)).thisType);
- m || (m = xpe(l));
- }
- if (m)
- return _0(r, m);
- }
- if (Zn(l.parent)) {
- const m = Tn(l.parent), y = zs(l) ? nn(m) : bo(m).thisType;
- return _0(r, y);
- }
- if (Si(l))
- if (l.commonJsModuleIndicator) {
- const m = Tn(l);
- return m && nn(m);
- } else {
- if (l.externalModuleIndicator)
- return Ae;
- if (a)
- return nn(fe);
- }
- }
- function znt(r) {
- const a = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (ys(a)) {
- const l = Zf(a);
- if (l.thisParameter)
- return s$(l.thisParameter);
- }
- if (Zn(a.parent)) {
- const l = Tn(a.parent);
- return zs(a) ? nn(l) : bo(l).thisType;
- }
- }
- function Wnt(r) {
- if (r.kind === 218 && dn(r.parent) && Cc(r.parent) === 3)
- return r.parent.left.expression.expression;
- if (r.kind === 174 && r.parent.kind === 210 && dn(r.parent.parent) && Cc(r.parent.parent) === 6)
- return r.parent.parent.left.expression;
- if (r.kind === 218 && r.parent.kind === 303 && r.parent.parent.kind === 210 && dn(r.parent.parent.parent) && Cc(r.parent.parent.parent) === 6)
- return r.parent.parent.parent.left.expression;
- if (r.kind === 218 && Qc(r.parent) && Oe(r.parent.name) && (r.parent.name.escapedText === "value" || r.parent.name.escapedText === "get" || r.parent.name.escapedText === "set") && Ks(r.parent.parent) && Fs(r.parent.parent.parent) && r.parent.parent.parent.arguments[2] === r.parent.parent && Cc(r.parent.parent.parent) === 9)
- return r.parent.parent.parent.arguments[0].expression;
- if (hc(r) && Oe(r.name) && (r.name.escapedText === "value" || r.name.escapedText === "get" || r.name.escapedText === "set") && Ks(r.parent) && Fs(r.parent.parent) && r.parent.parent.arguments[2] === r.parent && Cc(r.parent.parent) === 9)
- return r.parent.parent.arguments[0].expression;
- }
- function Unt(r) {
- const a = MI(r);
- if (a && a.typeExpression)
- return Ci(a.typeExpression);
- const l = DP(r);
- if (l)
- return Xv(l);
- }
- function Vnt(r, a) {
- return !!or(r, (l) => no(l) ? "quit" : l.kind === 169 && l.parent === a);
- }
- function _$(r) {
- const a = r.parent.kind === 213 && r.parent.expression === r, l = Xw(
- r,
- /*stopOnFunctions*/
- !0
- );
- let f = l, m = !1, y = !1;
- if (!a) {
- for (; f && f.kind === 219; )
- Gn(
- f,
- 1024
- /* Async */
- ) && (y = !0), f = Xw(
- f,
- /*stopOnFunctions*/
- !0
- ), m = B < 2;
- f && Gn(
- f,
- 1024
- /* Async */
- ) && (y = !0);
- }
- let x = 0;
- if (!f || !Q(f)) {
- const ye = or(
- r,
- (de) => de === f ? "quit" : de.kind === 167
- /* ComputedPropertyName */
- );
- return ye && ye.kind === 167 ? je(r, p.super_cannot_be_referenced_in_a_computed_property_name) : a ? je(r, p.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors) : !f || !f.parent || !(Zn(f.parent) || f.parent.kind === 210) ? je(r, p.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions) : je(r, p.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class), He;
- }
- if (!a && l.kind === 176 && $Ae(r, f, p.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class), zs(f) || a ? (x = 32, !a && B >= 2 && B <= 8 && (cs(f) || oc(f)) && dZ(r.parent, (ye) => {
- (!Si(ye) || X_(ye)) && (bn(ye).flags |= 2097152);
- })) : x = 16, bn(r).flags |= x, f.kind === 174 && y && (C_(r.parent) && b0(r.parent) ? bn(f).flags |= 256 : bn(f).flags |= 128), m && bpe(r.parent, f), f.parent.kind === 210)
- return B < 2 ? (je(r, p.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher), He) : xe;
- const N = f.parent;
- if (!Cb(N))
- return je(r, p.super_can_only_be_referenced_in_a_derived_class), He;
- if (Spe(N))
- return a ? He : Le;
- const j = bo(Tn(N)), W = j && No(j)[0];
- if (!W)
- return He;
- if (f.kind === 176 && Vnt(r, f))
- return je(r, p.super_cannot_be_referenced_in_constructor_arguments), He;
- return x === 32 ? oi(j) : df(W, j.thisType);
- function Q(ye) {
- return a ? ye.kind === 176 : Zn(ye.parent) || ye.parent.kind === 210 ? zs(ye) ? ye.kind === 174 || ye.kind === 173 || ye.kind === 177 || ye.kind === 178 || ye.kind === 172 || ye.kind === 175 : ye.kind === 174 || ye.kind === 173 || ye.kind === 177 || ye.kind === 178 || ye.kind === 172 || ye.kind === 171 || ye.kind === 176 : !1;
- }
- }
- function XAe(r) {
- return (r.kind === 174 || r.kind === 177 || r.kind === 178) && r.parent.kind === 210 ? r.parent : r.kind === 218 && r.parent.kind === 303 ? r.parent.parent : void 0;
- }
- function QAe(r) {
- return wn(r) & 4 && r.target === yl ? Io(r)[0] : void 0;
- }
- function qnt(r) {
- return Xo(r, (a) => a.flags & 2097152 ? ir(a.types, QAe) : QAe(a));
- }
- function YAe(r, a) {
- let l = r, f = a;
- for (; f; ) {
- const m = qnt(f);
- if (m)
- return m;
- if (l.parent.kind !== 303)
- break;
- l = l.parent.parent, f = nb(
- l,
- /*contextFlags*/
- void 0
- );
- }
- }
- function xpe(r) {
- if (r.kind === 219)
- return;
- if (LG(r)) {
- const l = JN(r);
- if (l) {
- const f = l.thisParameter;
- if (f)
- return nn(f);
- }
- }
- const a = cn(r);
- if (Se || a) {
- const l = XAe(r);
- if (l) {
- const m = nb(
- l,
- /*contextFlags*/
- void 0
- ), y = YAe(l, m);
- return y ? zi(y, Zfe(L2(l))) : J_(m ? c0(m) : wc(l));
- }
- const f = ag(r.parent);
- if (Dl(f)) {
- const m = f.left;
- if (xo(m)) {
- const { expression: y } = m;
- if (a && Oe(y)) {
- const x = Tr(f);
- if (x.commonJsModuleIndicator && Nu(y) === x.symbol)
- return;
- }
- return J_(wc(y));
- }
- }
- }
- }
- function ZAe(r) {
- const a = r.parent;
- if (!LG(a))
- return;
- const l = bb(a);
- if (l && l.arguments) {
- const m = D$(l), y = a.parameters.indexOf(r);
- if (r.dotDotDotToken)
- return Qpe(
- m,
- y,
- m.length,
- xe,
- /*context*/
- void 0,
- 0
- /* Normal */
- );
- const x = bn(l), N = x.resolvedSignature;
- x.resolvedSignature = Ct;
- const j = y < m.length ? eb(Gi(m[y])) : r.initializer ? void 0 : dt;
- return x.resolvedSignature = N, j;
- }
- const f = JN(a);
- if (f) {
- const m = a.parameters.indexOf(r) - (Eb(a) ? 1 : 0);
- return r.dotDotDotToken && Ro(a.parameters) === r ? OM(f, m) : R2(f, m);
- }
- }
- function kpe(r, a) {
- const l = Gc(r) || (cn(r) ? I5(r) : void 0);
- if (l)
- return Ci(l);
- switch (r.kind) {
- case 169:
- return ZAe(r);
- case 208:
- return Hnt(r, a);
- case 172:
- if (zs(r))
- return Gnt(r, a);
- }
- }
- function Hnt(r, a) {
- const l = r.parent.parent, f = r.propertyName || r.name, m = kpe(l, a) || l.kind !== 208 && l.initializer && BP(
- l,
- r.dotDotDotToken ? 32 : 0
- /* Normal */
- );
- if (!m || As(f) || Ww(f)) return;
- if (l.name.kind === 207) {
- const x = mC(r.parent.elements, r);
- return x < 0 ? void 0 : Ppe(m, x);
- }
- const y = i0(f);
- if (up(y)) {
- const x = _p(y);
- return Rc(m, x);
- }
- }
- function Gnt(r, a) {
- const l = _t(r.parent) && a_(r.parent, a);
- if (l)
- return rb(l, Tn(r).escapedName);
- }
- function $nt(r, a) {
- const l = r.parent;
- if (m0(l) && r === l.initializer) {
- const f = kpe(l, a);
- if (f)
- return f;
- if (!(a & 8) && As(l.name) && l.name.elements.length > 0)
- return Lt(
- l.name,
- /*includePatternInType*/
- !0,
- /*reportErrors*/
- !1
- );
- }
- }
- function Xnt(r, a) {
- const l = yf(r);
- if (l) {
- let f = f$(l, a);
- if (f) {
- const m = Jc(l);
- if (m & 1) {
- const y = (m & 2) !== 0;
- f.flags & 1048576 && (f = Vc(f, (N) => !!j2(1, N, y)));
- const x = j2(1, f, (m & 2) !== 0);
- if (!x)
- return;
- f = x;
- }
- if (m & 2) {
- const y = Xo(f, ly);
- return y && Qn([y, pNe(y)]);
- }
- return f;
- }
- }
- }
- function Qnt(r, a) {
- const l = a_(r, a);
- if (l) {
- const f = ly(l);
- return f && Qn([f, pNe(f)]);
- }
- }
- function Ynt(r, a) {
- const l = yf(r);
- if (l) {
- const f = Jc(l);
- let m = f$(l, a);
- if (m) {
- const y = (f & 2) !== 0;
- if (!r.asteriskToken && m.flags & 1048576 && (m = Vc(m, (x) => !!j2(1, x, y))), r.asteriskToken) {
- const x = Rde(m, y), N = x?.yieldType ?? en, j = a_(r, a) ?? en, W = x?.nextType ?? M, Q = I$(
- N,
- j,
- W,
- /*isAsyncGenerator*/
- !1
- );
- if (y) {
- const ye = I$(
- N,
- j,
- W,
- /*isAsyncGenerator*/
- !0
- );
- return Qn([Q, ye]);
- }
- return Q;
- }
- return j2(0, m, y);
- }
- }
- }
- function Cpe(r) {
- let a = !1;
- for (; r.parent && !ys(r.parent); ) {
- if (Ii(r.parent) && (a || r.parent.initializer === r))
- return !0;
- va(r.parent) && r.parent.initializer === r && (a = !0), r = r.parent;
- }
- return !1;
- }
- function KAe(r, a) {
- const l = !!(Jc(a) & 2), f = f$(
- a,
- /*contextFlags*/
- void 0
- );
- if (f)
- return j2(r, f, l) || void 0;
- }
- function f$(r, a) {
- const l = lE(r);
- if (l)
- return l;
- const f = Ape(r);
- if (f && !hG(f)) {
- const y = Ha(f), x = Jc(r);
- return x & 1 ? Vc(y, (N) => !!(N.flags & 58998787) || Sde(
- N,
- x,
- /*errorNode*/
- void 0
- )) : x & 2 ? Vc(y, (N) => !!(N.flags & 58998787) || !!WP(N)) : y;
- }
- const m = bb(r);
- if (m)
- return a_(m, a);
- }
- function e8e(r, a) {
- const f = D$(r).indexOf(a);
- return f === -1 ? void 0 : Epe(r, f);
- }
- function Epe(r, a) {
- if (hf(r))
- return a === 0 ? Ie : a === 1 ? Iwe(
- /*reportErrors*/
- !1
- ) : xe;
- const l = bn(r).resolvedSignature === zr ? zr : TE(r);
- if (ou(r) && a === 0)
- return g$(l, r);
- const f = l.parameters.length - 1;
- return Su(l) && a >= f ? j_(
- nn(l.parameters[f]),
- bd(a - f),
- 256
- /* Contextual */
- ) : Kd(l, a);
- }
- function Znt(r) {
- const a = ude(r);
- return a ? _T(a) : void 0;
- }
- function Knt(r, a) {
- if (r.parent.kind === 215)
- return e8e(r.parent, a);
- }
- function eit(r, a) {
- const l = r.parent, { left: f, operatorToken: m, right: y } = l;
- switch (m.kind) {
- case 64:
- case 77:
- case 76:
- case 78:
- return r === y ? rit(l) : void 0;
- case 57:
- case 61:
- const x = a_(l, a);
- return r === y && (x && x.pattern || !x && !jZ(l)) ? tu(f) : x;
- case 56:
- case 28:
- return r === y ? a_(l, a) : void 0;
- default:
- return;
- }
- }
- function tit(r) {
- if (kd(r) && r.symbol)
- return r.symbol;
- if (Oe(r))
- return Nu(r);
- if (Cn(r)) {
- const l = tu(r.expression);
- return Di(r.name) ? a(l, r.name) : Gs(l, r.name.escapedText);
- }
- if (ko(r)) {
- const l = wc(r.argumentExpression);
- if (!up(l))
- return;
- const f = tu(r.expression);
- return Gs(f, _p(l));
- }
- return;
- function a(l, f) {
- const m = kM(f.escapedText, f);
- return m && x$(l, m);
- }
- }
- function rit(r) {
- var a, l;
- const f = Cc(r);
- switch (f) {
- case 0:
- case 4:
- const m = tit(r.left), y = m && m.valueDeclaration;
- if (y && (cs(y) || m_(y))) {
- const j = Gc(y);
- return j && zi(Ci(j), Bi(m).mapper) || (cs(y) ? y.initializer && tu(r.left) : void 0);
- }
- return f === 0 ? tu(r.left) : t8e(r);
- case 5:
- if (p$(r, f))
- return t8e(r);
- if (!kd(r.left) || !r.left.symbol)
- return tu(r.left);
- {
- const j = r.left.symbol.valueDeclaration;
- if (!j)
- return;
- const W = Bs(r.left, xo), Q = Gc(j);
- if (Q)
- return Ci(Q);
- if (Oe(W.expression)) {
- const ye = W.expression, de = Nt(
- ye,
- ye.escapedText,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- if (de) {
- const Ze = de.valueDeclaration && Gc(de.valueDeclaration);
- if (Ze) {
- const ct = Eh(W);
- if (ct !== void 0)
- return rb(Ci(Ze), ct);
- }
- return;
- }
- }
- return cn(j) || j === r.left ? void 0 : tu(r.left);
- }
- case 1:
- case 6:
- case 3:
- case 2:
- let x;
- f !== 2 && (x = kd(r.left) ? (a = r.left.symbol) == null ? void 0 : a.valueDeclaration : void 0), x || (x = (l = r.symbol) == null ? void 0 : l.valueDeclaration);
- const N = x && Gc(x);
- return N ? Ci(N) : void 0;
- case 7:
- case 8:
- case 9:
- return E.fail("Does not apply");
- default:
- return E.assertNever(f);
- }
- }
- function p$(r, a = Cc(r)) {
- if (a === 4)
- return !0;
- if (!cn(r) || a !== 5 || !Oe(r.left.expression))
- return !1;
- const l = r.left.expression.escapedText, f = Nt(
- r.left,
- l,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0,
- /*excludeGlobals*/
- !0
- );
- return T7(f?.valueDeclaration);
- }
- function t8e(r) {
- if (!r.symbol) return tu(r.left);
- if (r.symbol.valueDeclaration) {
- const m = Gc(r.symbol.valueDeclaration);
- if (m) {
- const y = Ci(m);
- if (y)
- return y;
- }
- }
- const a = Bs(r.left, xo);
- if (!jp(Lu(
- a.expression,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- )))
- return;
- const l = hM(a.expression), f = Eh(a);
- return f !== void 0 && rb(l, f) || void 0;
- }
- function nit(r) {
- return !!(gc(r) & 262144 && !r.links.type && b1(
- r,
- 0
- /* Type */
- ) >= 0);
- }
- function rb(r, a, l) {
- return Xo(
- r,
- (f) => {
- var m;
- if (R_(f) && NL(f) !== 2) {
- const y = Yf(f), x = Kl(y) || y, N = l || S_(Ei(a));
- if ($s(N, x))
- return PG(f, N);
- } else if (f.flags & 3670016) {
- const y = Gs(f, a);
- if (y)
- return nit(y) ? void 0 : l0(nn(y), !!(y.flags & 16777216));
- if (ha(f) && qg(a) && +a >= 0) {
- const x = FP(
- f,
- f.target.fixedLength,
- /*endSkipCount*/
- 0,
- /*writing*/
- !1,
- /*noReductions*/
- !0
- );
- if (x)
- return x;
- }
- return (m = J_e(z_e(f), l || S_(Ei(a)))) == null ? void 0 : m.type;
- }
- },
- /*noReductions*/
- !0
- );
- }
- function r8e(r, a) {
- if (E.assert(jp(r)), !(r.flags & 67108864))
- return Dpe(r, a);
- }
- function Dpe(r, a) {
- const l = r.parent, f = Qc(r) && kpe(r, a);
- if (f)
- return f;
- const m = nb(l, a);
- if (m) {
- if (oE(r)) {
- const y = Tn(r);
- return rb(m, y.escapedName, Bi(y).nameType);
- }
- if (Dh(r)) {
- const y = os(r);
- if (y && ma(y)) {
- const x = Gi(y.expression), N = up(x) && rb(m, _p(x));
- if (N)
- return N;
- }
- }
- if (r.name) {
- const y = i0(r.name);
- return Xo(
- m,
- (x) => {
- var N;
- return (N = J_e(z_e(x), y)) == null ? void 0 : N.type;
- },
- /*noReductions*/
- !0
- );
- }
- }
- }
- function iit(r) {
- let a, l;
- for (let f = 0; f < r.length; f++)
- fp(r[f]) && (a ?? (a = f), l = f);
- return { first: a, last: l };
- }
- function Ppe(r, a, l, f, m) {
- return r && Xo(
- r,
- (y) => {
- if (ha(y)) {
- if ((f === void 0 || a < f) && a < y.target.fixedLength)
- return l0(Io(y)[a], !!y.target.elementFlags[a]);
- const x = l !== void 0 && (m === void 0 || a > m) ? l - a : 0, N = x > 0 && y.target.combinedFlags & 12 ? SN(
- y.target,
- 3
- /* Fixed */
- ) : 0;
- return x > 0 && x <= N ? Io(y)[sy(y) - x] : FP(
- y,
- f === void 0 ? y.target.fixedLength : Math.min(y.target.fixedLength, f),
- l === void 0 || m === void 0 ? N : Math.min(N, l - m),
- /*writing*/
- !1,
- /*noReductions*/
- !0
- );
- }
- return (!f || a < f) && rb(y, "" + a) || Ide(
- 1,
- y,
- Ae,
- /*errorNode*/
- void 0,
- /*checkAssignability*/
- !1
- );
- },
- /*noReductions*/
- !0
- );
- }
- function sit(r, a) {
- const l = r.parent;
- return r === l.whenTrue || r === l.whenFalse ? a_(l, a) : void 0;
- }
- function ait(r, a, l) {
- const f = nb(r.openingElement.attributes, l), m = SM(kT(r));
- if (!(f && !Wa(f) && m && m !== ""))
- return;
- const y = wC(r.children), x = y.indexOf(a), N = rb(f, m);
- return N && (y.length === 1 ? N : Xo(
- N,
- (j) => oy(j) ? j_(j, bd(x)) : j,
- /*noReductions*/
- !0
- ));
- }
- function oit(r, a) {
- const l = r.parent;
- return $I(l) ? a_(r, a) : Gg(l) ? ait(l, r, a) : void 0;
- }
- function n8e(r, a) {
- if (km(r)) {
- const l = nb(r.parent, a);
- return !l || Wa(l) ? void 0 : rb(l, X4(r.name));
- } else
- return a_(r.parent, a);
- }
- function yM(r) {
- switch (r.kind) {
- case 11:
- case 9:
- case 10:
- case 15:
- case 228:
- case 112:
- case 97:
- case 106:
- case 80:
- case 157:
- return !0;
- case 211:
- case 217:
- return yM(r.expression);
- case 294:
- return !r.expression || yM(r.expression);
- }
- return !1;
- }
- function cit(r, a) {
- const l = `D${Ma(r)},${Rl(a)}`;
- return Jd(l) ?? V0(
- l,
- Zrt(a, r) ?? Mfe(
- a,
- Qi(
- lr(
- Ln(r.properties, (f) => f.symbol ? f.kind === 303 ? yM(f.initializer) && LP(a, f.symbol.escapedName) : f.kind === 304 ? LP(a, f.symbol.escapedName) : !1 : !1),
- (f) => [() => BM(f.kind === 303 ? f.initializer : f.name), f.symbol.escapedName]
- ),
- lr(
- Ln(qa(a), (f) => {
- var m;
- return !!(f.flags & 16777216) && !!((m = r?.symbol) != null && m.members) && !r.symbol.members.has(f.escapedName) && LP(a, f.escapedName);
- }),
- (f) => [() => Ae, f.escapedName]
- )
- ),
- $s
- )
- );
- }
- function lit(r, a) {
- const l = `D${Ma(r)},${Rl(a)}`, f = Jd(l);
- if (f) return f;
- const m = SM(kT(r));
- return V0(
- l,
- Mfe(
- a,
- Qi(
- lr(
- Ln(r.properties, (y) => !!y.symbol && y.kind === 291 && LP(a, y.symbol.escapedName) && (!y.initializer || yM(y.initializer))),
- (y) => [y.initializer ? () => BM(y.initializer) : () => nt, y.symbol.escapedName]
- ),
- lr(
- Ln(qa(a), (y) => {
- var x;
- if (!(y.flags & 16777216) || !((x = r?.symbol) != null && x.members))
- return !1;
- const N = r.parent.parent;
- return y.escapedName === m && Gg(N) && wC(N.children).length ? !1 : !r.symbol.members.has(y.escapedName) && LP(a, y.escapedName);
- }),
- (y) => [() => Ae, y.escapedName]
- )
- ),
- $s
- )
- );
- }
- function nb(r, a) {
- const l = jp(r) ? r8e(r, a) : a_(r, a), f = d$(l, r, a);
- if (f && !(a && a & 2 && f.flags & 8650752)) {
- const m = Xo(
- f,
- // When obtaining apparent type of *contextual* type we don't want to get apparent type of mapped types.
- // That would evaluate mapped types with array or tuple type constraints too eagerly
- // and thus it would prevent `getTypeOfPropertyOfContextualType` from obtaining per-position contextual type for elements of array literal expressions.
- // Apparent type of other mapped types is already the mapped type itself so we can just avoid calling `getApparentType` here for all mapped types.
- (y) => wn(y) & 32 ? y : Uu(y),
- /*noReductions*/
- !0
- );
- return m.flags & 1048576 && Ks(r) ? cit(r, m) : m.flags & 1048576 && Wb(r) ? lit(r, m) : m;
- }
- }
- function d$(r, a, l) {
- if (r && bc(
- r,
- 465829888
- /* Instantiable */
- )) {
- const f = L2(a);
- if (f && l & 1 && ut(f.inferences, Yat))
- return m$(r, f.nonFixingMapper);
- if (f?.returnMapper) {
- const m = m$(r, f.returnMapper);
- return m.flags & 1048576 && mh(m.types, $r) && mh(m.types, ot) ? Vc(m, (y) => y !== $r && y !== ot) : m;
- }
- }
- return r;
- }
- function m$(r, a) {
- return r.flags & 465829888 ? zi(r, a) : r.flags & 1048576 ? Qn(
- lr(r.types, (l) => m$(l, a)),
- 0
- /* None */
- ) : r.flags & 2097152 ? ia(lr(r.types, (l) => m$(l, a))) : r;
- }
- function a_(r, a) {
- var l;
- if (r.flags & 67108864)
- return;
- const f = s8e(
- r,
- /*includeCaches*/
- !a
- );
- if (f >= 0)
- return qh[f];
- const { parent: m } = r;
- switch (m.kind) {
- case 260:
- case 169:
- case 172:
- case 171:
- case 208:
- return $nt(r, a);
- case 219:
- case 253:
- return Xnt(r, a);
- case 229:
- return Ynt(m, a);
- case 223:
- return Qnt(m, a);
- case 213:
- case 214:
- return e8e(m, r);
- case 170:
- return Znt(m);
- case 216:
- case 234:
- return xd(m.type) ? a_(m, a) : Ci(m.type);
- case 226:
- return eit(r, a);
- case 303:
- case 304:
- return Dpe(m, a);
- case 305:
- return a_(m.parent, a);
- case 209: {
- const y = m, x = nb(y, a), N = mC(y.elements, r), j = (l = bn(y)).spreadIndices ?? (l.spreadIndices = iit(y.elements));
- return Ppe(x, N, y.elements.length, j.first, j.last);
- }
- case 227:
- return sit(r, a);
- case 239:
- return E.assert(
- m.parent.kind === 228
- /* TemplateExpression */
- ), Knt(m.parent, r);
- case 217: {
- if (cn(m)) {
- if (mJ(m))
- return Ci(gJ(m));
- const y = V1(m);
- if (y && !xd(y.typeExpression.type))
- return Ci(y.typeExpression.type);
- }
- return a_(m, a);
- }
- case 235:
- return a_(m, a);
- case 238:
- return Ci(m.type);
- case 277:
- return Qf(m);
- case 294:
- return oit(m, a);
- case 291:
- case 293:
- return n8e(m, a);
- case 286:
- case 285:
- return pit(m, a);
- case 301:
- return fit(m);
- }
- }
- function i8e(r) {
- vM(
- r,
- a_(
- r,
- /*contextFlags*/
- void 0
- ),
- /*isCache*/
- !0
- );
- }
- function vM(r, a, l) {
- Kp[mg] = r, qh[mg] = a, Iv[mg] = l, mg++;
- }
- function BN() {
- mg--;
- }
- function s8e(r, a) {
- for (let l = mg - 1; l >= 0; l--)
- if (r === Kp[l] && (a || !Iv[l]))
- return l;
- return -1;
- }
- function uit(r, a) {
- Ov[Ne] = r, n1[Ne] = a, Ne++;
- }
- function _it() {
- Ne--;
- }
- function L2(r) {
- for (let a = Ne - 1; a >= 0; a--)
- if (kb(r, Ov[a]))
- return n1[a];
- }
- function fit(r) {
- return rb(rfe(
- /*reportErrors*/
- !1
- ), O5(r));
- }
- function pit(r, a) {
- if (xm(r) && a !== 4) {
- const l = s8e(
- r.parent,
- /*includeCaches*/
- !a
- );
- if (l >= 0)
- return qh[l];
- }
- return Epe(r, 0);
- }
- function g$(r, a) {
- return W8e(a) !== 0 ? dit(r, a) : hit(r, a);
- }
- function dit(r, a) {
- let l = cde(r, M);
- l = a8e(a, kT(a), l);
- const f = M2(jf.IntrinsicAttributes, a);
- return H(f) || (l = wL(f, l)), l;
- }
- function mit(r, a) {
- if (r.compositeSignatures) {
- const f = [];
- for (const m of r.compositeSignatures) {
- const y = Ha(m);
- if (Wa(y))
- return y;
- const x = Rc(y, a);
- if (!x)
- return;
- f.push(x);
- }
- return ia(f);
- }
- const l = Ha(r);
- return Wa(l) ? l : Rc(l, a);
- }
- function git(r) {
- if (Vk(r.tagName)) {
- const l = m8e(r), f = P$(r, l);
- return _T(f);
- }
- const a = wc(r.tagName);
- if (a.flags & 128) {
- const l = d8e(a, r);
- if (!l)
- return He;
- const f = P$(r, l);
- return _T(f);
- }
- return a;
- }
- function a8e(r, a, l) {
- const f = Bit(a);
- if (f) {
- const m = git(r), y = y8e(f, cn(r), m, l);
- if (y)
- return y;
- }
- return l;
- }
- function hit(r, a) {
- const l = kT(a), f = zit(l);
- let m = f === void 0 ? cde(r, M) : f === "" ? Ha(r) : mit(r, f);
- if (!m)
- return f && Nr(a.attributes.properties) && je(a, p.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, Ei(f)), M;
- if (m = a8e(a, l, m), Wa(m))
- return m;
- {
- let y = m;
- const x = M2(jf.IntrinsicClassAttributes, a);
- if (!H(x)) {
- const j = vd(x.symbol), W = Ha(r);
- let Q;
- if (j) {
- const ye = C1([W], j, Bm(j), cn(a));
- Q = zi(x, B_(j, ye));
- } else Q = x;
- y = wL(Q, y);
- }
- const N = M2(jf.IntrinsicAttributes, a);
- return H(N) || (y = wL(N, y)), y;
- }
- }
- function yit(r) {
- return cu(O, "noImplicitAny") ? Hu(
- r,
- (a, l) => a === l || !a ? a : HPe(a.typeParameters, l.typeParameters) ? Sit(a, l) : void 0
- ) : void 0;
- }
- function vit(r, a, l) {
- if (!r || !a)
- return r || a;
- const f = Qn([nn(r), zi(nn(a), l)]);
- return yT(r, f);
- }
- function bit(r, a, l) {
- const f = W_(r), m = W_(a), y = f >= m ? r : a, x = y === r ? a : r, N = y === r ? f : m, j = Pg(r) || Pg(a), W = j && !Pg(y), Q = new Array(N + (W ? 1 : 0));
- for (let ye = 0; ye < N; ye++) {
- let de = R2(y, ye);
- y === a && (de = zi(de, l));
- let Ze = R2(x, ye) || M;
- x === a && (Ze = zi(Ze, l));
- const ct = Qn([de, Ze]), mt = j && !W && ye === N - 1, Gt = ye >= Hm(y) && ye >= Hm(x), sr = ye >= f ? void 0 : jP(r, ye), Xr = ye >= m ? void 0 : jP(a, ye), tn = sr === Xr ? sr : sr ? Xr ? void 0 : sr : Xr, pr = fa(
- 1 | (Gt && !mt ? 16777216 : 0),
- tn || `arg${ye}`
- );
- pr.links.type = mt ? du(ct) : ct, Q[ye] = pr;
- }
- if (W) {
- const ye = fa(1, "args");
- ye.links.type = du(Kd(x, N)), x === a && (ye.links.type = zi(ye.links.type, l)), Q[N] = ye;
- }
- return Q;
- }
- function Sit(r, a) {
- const l = r.typeParameters || a.typeParameters;
- let f;
- r.typeParameters && a.typeParameters && (f = B_(a.typeParameters, r.typeParameters));
- const m = r.declaration, y = bit(r, a, f), x = vit(r.thisParameter, a.thisParameter, f), N = Math.max(r.minArgumentCount, a.minArgumentCount), j = ph(
- m,
- l,
- x,
- y,
- /*resolvedReturnType*/
- void 0,
- /*resolvedTypePredicate*/
- void 0,
- N,
- (r.flags | a.flags) & 167
- /* PropagatingFlags */
- );
- return j.compositeKind = 2097152, j.compositeSignatures = Qi(r.compositeKind === 2097152 && r.compositeSignatures || [r], [a]), f && (j.mapper = r.compositeKind === 2097152 && r.mapper && r.compositeSignatures ? I2(r.mapper, f) : f), j;
- }
- function wpe(r, a) {
- const l = Ns(
- r,
- 0
- /* Call */
- ), f = Ln(l, (m) => !Tit(m, a));
- return f.length === 1 ? f[0] : yit(f);
- }
- function Tit(r, a) {
- let l = 0;
- for (; l < a.parameters.length; l++) {
- const f = a.parameters[l];
- if (f.initializer || f.questionToken || f.dotDotDotToken || N5(f))
- break;
- }
- return a.parameters.length && Db(a.parameters[0]) && l--, !Pg(r) && W_(r) < l;
- }
- function Ape(r) {
- return Wy(r) || jp(r) ? JN(r) : void 0;
- }
- function JN(r) {
- E.assert(r.kind !== 174 || jp(r));
- const a = DP(r);
- if (a)
- return a;
- const l = nb(
- r,
- 1
- /* Signature */
- );
- if (!l)
- return;
- if (!(l.flags & 1048576))
- return wpe(l, r);
- let f;
- const m = l.types;
- for (const y of m) {
- const x = wpe(y, r);
- if (x)
- if (!f)
- f = [x];
- else if (rM(
- f[0],
- x,
- /*partialMatch*/
- !1,
- /*ignoreThisTypes*/
- !0,
- /*ignoreReturnTypes*/
- !0,
- DN
- ))
- f.push(x);
- else
- return;
- }
- if (f)
- return f.length === 1 ? f[0] : VPe(f[0], f);
- }
- function xit(r) {
- const a = Tr(r);
- if (!F1(a) && !r.isUnterminated) {
- let l;
- s ?? (s = Og(
- 99,
- /*skipTrivia*/
- !0
- )), s.setScriptTarget(a.languageVersion), s.setLanguageVariant(a.languageVariant), s.setOnError((f, m, y) => {
- const x = s.getTokenEnd();
- if (f.category === 3 && l && x === l.start && m === l.length) {
- const N = fx(a.fileName, a.text, x, m, f, y);
- Rs(l, N);
- } else (!l || x !== l.start) && (l = fl(a, x, m, f, y), Da.add(l));
- }), s.setText(a.text, r.pos, r.end - r.pos);
- try {
- return s.scan(), E.assert(s.reScanSlashToken(
- /*reportErrors*/
- !0
- ) === 14, "Expected scanner to rescan RegularExpressionLiteral"), !!l;
- } finally {
- s.setText(""), s.setOnError(
- /*onError*/
- void 0
- );
- }
- }
- return !1;
- }
- function kit(r) {
- const a = bn(r);
- return a.flags & 1 || (a.flags |= 1, n(() => xit(r))), Pc;
- }
- function Cit(r, a) {
- B < 2 && bl(
- r,
- O.downlevelIteration ? 1536 : 1024
- /* SpreadArray */
- );
- const l = Gi(r.expression, a);
- return uy(33, l, Ae, r.expression);
- }
- function Eit(r) {
- return r.isSpread ? j_(r.type, At) : r.type;
- }
- function Uk(r) {
- return r.kind === 208 && !!r.initializer || r.kind === 303 && Uk(r.initializer) || r.kind === 304 && !!r.objectAssignmentInitializer || r.kind === 226 && r.operatorToken.kind === 64;
- }
- function Dit(r) {
- const a = ag(r.parent);
- return fp(a) && am(a.parent);
- }
- function o8e(r, a, l) {
- const f = r.elements, m = f.length, y = [], x = [];
- i8e(r);
- const N = b0(r), j = JP(r), W = nb(
- r,
- /*contextFlags*/
- void 0
- ), Q = Dit(r) || !!W && Pp(W, (de) => OP(de) || R_(de) && !de.nameType && !!CN(de.target || de));
- let ye = !1;
- for (let de = 0; de < m; de++) {
- const Ze = f[de];
- if (Ze.kind === 230) {
- B < 2 && bl(
- Ze,
- O.downlevelIteration ? 1536 : 1024
- /* SpreadArray */
- );
- const ct = Gi(Ze.expression, a, l);
- if (oy(ct))
- y.push(ct), x.push(
- 8
- /* Variadic */
- );
- else if (N) {
- const mt = $v(ct, At) || Ide(
- 65,
- ct,
- Ae,
- /*errorNode*/
- void 0,
- /*checkAssignability*/
- !1
- ) || M;
- y.push(mt), x.push(
- 4
- /* Rest */
- );
- } else
- y.push(uy(33, ct, Ae, Ze.expression)), x.push(
- 4
- /* Rest */
- );
- } else if (oe && Ze.kind === 232)
- ye = !0, y.push(be), x.push(
- 2
- /* Optional */
- );
- else {
- const ct = zP(Ze, a, l);
- if (y.push(cl(
- ct,
- /*isProperty*/
- !0,
- ye
- )), x.push(
- ye ? 2 : 1
- /* Required */
- ), Q && a && a & 2 && !(a & 4) && Kf(Ze)) {
- const mt = L2(r);
- E.assert(mt), Qfe(mt, Ze, ct);
- }
- }
- }
- return BN(), N ? Eg(y, x) : c8e(l || j || Q ? Eg(
- y,
- x,
- /*readonly*/
- j && !(W && Pp(W, zfe))
- ) : du(
- y.length ? Qn(
- qc(y, (de, Ze) => x[Ze] & 8 ? D1(de, At) || xe : de),
- 2
- /* Subtype */
- ) : ee ? zt : dt,
- j
- ));
- }
- function c8e(r) {
- if (!(wn(r) & 4))
- return r;
- let a = r.literalType;
- return a || (a = r.literalType = vwe(r), a.objectFlags |= 147456), a;
- }
- function Pit(r) {
- switch (r.kind) {
- case 167:
- return wit(r);
- case 80:
- return qg(r.escapedText);
- case 9:
- case 11:
- return qg(r.text);
- default:
- return !1;
- }
- }
- function wit(r) {
- return eu(
- Wm(r),
- 296
- /* NumberLike */
- );
- }
- function Wm(r) {
- const a = bn(r.expression);
- if (!a.resolvedType) {
- if ((Qu(r.parent.parent) || Zn(r.parent.parent) || Xl(r.parent.parent)) && dn(r.expression) && r.expression.operatorToken.kind === 103 && r.parent.kind !== 177 && r.parent.kind !== 178)
- return a.resolvedType = He;
- if (a.resolvedType = Gi(r.expression), cs(r.parent) && !tl(r.parent) && $c(r.parent.parent)) {
- const l = Cd(r.parent.parent), f = vpe(l);
- f && (bn(f).flags |= 4096, bn(r).flags |= 32768, bn(r.parent.parent).flags |= 32768);
- }
- (a.resolvedType.flags & 98304 || !eu(
- a.resolvedType,
- 402665900
- /* ESSymbolLike */
- ) && !$s(a.resolvedType, Ft)) && je(r, p.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
- }
- return a.resolvedType;
- }
- function Ait(r) {
- var a;
- const l = (a = r.declarations) == null ? void 0 : a[0];
- return qg(r.escapedName) || l && Vl(l) && Pit(l.name);
- }
- function l8e(r) {
- var a;
- const l = (a = r.declarations) == null ? void 0 : a[0];
- return b3(r) || l && Vl(l) && ma(l.name) && eu(
- Wm(l.name),
- 4096
- /* ESSymbol */
- );
- }
- function Npe(r, a, l, f) {
- const m = [];
- for (let x = a; x < l.length; x++) {
- const N = l[x];
- (f === Ie && !l8e(N) || f === At && Ait(N) || f === jt && l8e(N)) && m.push(nn(l[x]));
- }
- const y = m.length ? Qn(
- m,
- 2
- /* Subtype */
- ) : Ae;
- return Cg(f, y, JP(r));
- }
- function h$(r) {
- E.assert((r.flags & 2097152) !== 0, "Should only get Alias here.");
- const a = Bi(r);
- if (!a.immediateTarget) {
- const l = Du(r);
- if (!l) return E.fail();
- a.immediateTarget = p1(
- l,
- /*dontRecursivelyResolve*/
- !0
- );
- }
- return a.immediateTarget;
- }
- function Nit(r, a = 0) {
- const l = b0(r);
- Wut(r, l);
- const f = ee ? Js() : void 0;
- let m = Js(), y = [], x = xs;
- i8e(r);
- const N = nb(
- r,
- /*contextFlags*/
- void 0
- ), j = N && N.pattern && (N.pattern.kind === 206 || N.pattern.kind === 210), W = JP(r), Q = W ? 8 : 0, ye = cn(r) && !E7(r), de = ye ? pj(r) : void 0, Ze = !N && ye && !de;
- let ct = 8192, mt = !1, Gt = !1, sr = !1, Xr = !1;
- for (const er of r.properties)
- er.name && ma(er.name) && Wm(er.name);
- let tn = 0;
- for (const er of r.properties) {
- let gn = Tn(er);
- const Un = er.name && er.name.kind === 167 ? Wm(er.name) : void 0;
- if (er.kind === 303 || er.kind === 304 || jp(er)) {
- let ci = er.kind === 303 ? PNe(er, a) : (
- // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
- // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
- // we don't want to say "could not find 'a'".
- er.kind === 304 ? zP(!l && er.objectAssignmentInitializer ? er.objectAssignmentInitializer : er.name, a) : wNe(er, a)
- );
- if (ye) {
- const js = eo(er);
- js ? (Au(ci, js, er), ci = js) : de && de.typeExpression && Au(ci, Ci(de.typeExpression), er);
- }
- ct |= wn(ci) & 458752;
- const Jn = Un && up(Un) ? Un : void 0, Us = Jn ? fa(
- 4 | gn.flags,
- _p(Jn),
- Q | 4096
- /* Late */
- ) : fa(4 | gn.flags, gn.escapedName, Q);
- if (Jn && (Us.links.nameType = Jn), l && Uk(er))
- Us.flags |= 16777216;
- else if (j && !(wn(N) & 512)) {
- const js = Gs(N, gn.escapedName);
- js ? Us.flags |= js.flags & 16777216 : dh(N, Ie) || je(er.name, p.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, Ji(gn), Hr(N));
- }
- if (Us.declarations = gn.declarations, Us.parent = gn.parent, gn.valueDeclaration && (Us.valueDeclaration = gn.valueDeclaration), Us.links.type = ci, Us.links.target = gn, gn = Us, f?.set(Us.escapedName, Us), N && a & 2 && !(a & 4) && (er.kind === 303 || er.kind === 174) && Kf(er)) {
- const js = L2(r);
- E.assert(js);
- const Oo = er.kind === 303 ? er.initializer : er;
- Qfe(js, Oo, ci);
- }
- } else if (er.kind === 305) {
- B < 2 && bl(
- er,
- 2
- /* Assign */
- ), y.length > 0 && (x = w2(x, pr(), r.symbol, ct, W), y = [], m = Js(), Gt = !1, sr = !1, Xr = !1);
- const ci = Qd(Gi(
- er.expression,
- a & 2
- /* Inferential */
- ));
- if (bM(ci)) {
- const Jn = Tfe(ci, W);
- if (f && _8e(Jn, f, er), tn = y.length, H(x))
- continue;
- x = w2(x, Jn, r.symbol, ct, W);
- } else
- je(er, p.Spread_types_may_only_be_created_from_object_types), x = He;
- continue;
- } else
- E.assert(
- er.kind === 177 || er.kind === 178
- /* SetAccessor */
- ), Hk(er);
- Un && !(Un.flags & 8576) ? $s(Un, Ft) && ($s(Un, At) ? sr = !0 : $s(Un, jt) ? Xr = !0 : Gt = !0, l && (mt = !0)) : m.set(gn.escapedName, gn), y.push(gn);
- }
- if (BN(), H(x))
- return He;
- if (x !== xs)
- return y.length > 0 && (x = w2(x, pr(), r.symbol, ct, W), y = [], m = Js(), Gt = !1, sr = !1), Xo(x, (er) => er === xs ? pr() : er);
- return pr();
- function pr() {
- const er = [];
- Gt && er.push(Npe(r, tn, y, Ie)), sr && er.push(Npe(r, tn, y, At)), Xr && er.push(Npe(r, tn, y, jt));
- const gn = Li(r.symbol, m, Ue, Ue, er);
- return gn.objectFlags |= ct | 128 | 131072, Ze && (gn.objectFlags |= 4096), mt && (gn.objectFlags |= 512), l && (gn.pattern = r), gn;
- }
- }
- function bM(r) {
- const a = Y3e(Xo(r, kg));
- return !!(a.flags & 126615553 || a.flags & 3145728 && Mi(a.types, bM));
- }
- function Iit(r) {
- Fpe(r);
- }
- function Oit(r, a) {
- return Hk(r), TM(r) || xe;
- }
- function Fit(r) {
- Fpe(r.openingElement), Vk(r.closingElement.tagName) ? v$(r.closingElement) : Gi(r.closingElement.tagName), y$(r);
- }
- function Lit(r, a) {
- return Hk(r), TM(r) || xe;
- }
- function Mit(r) {
- Fpe(r.openingFragment);
- const a = Tr(r);
- return p5(O) && (O.jsxFactory || a.pragmas.has("jsx")) && !O.jsxFragmentFactory && !a.pragmas.has("jsxfrag") && je(
- r,
- O.jsxFactory ? p.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : p.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments
- ), y$(r), TM(r) || xe;
- }
- function Ipe(r) {
- return r.includes("-");
- }
- function Vk(r) {
- return Oe(r) && AC(r.escapedText) || Nd(r);
- }
- function u8e(r, a) {
- return r.initializer ? zP(r.initializer, a) : nt;
- }
- function Rit(r, a = 0) {
- const l = r.attributes, f = a_(
- l,
- 0
- /* None */
- ), m = ee ? Js() : void 0;
- let y = Js(), x = Cu, N = !1, j, W = !1, Q = 2048;
- const ye = SM(kT(r));
- for (const ct of l.properties) {
- const mt = ct.symbol;
- if (km(ct)) {
- const Gt = u8e(ct, a);
- Q |= wn(Gt) & 458752;
- const sr = fa(4 | mt.flags, mt.escapedName);
- if (sr.declarations = mt.declarations, sr.parent = mt.parent, mt.valueDeclaration && (sr.valueDeclaration = mt.valueDeclaration), sr.links.type = Gt, sr.links.target = mt, y.set(sr.escapedName, sr), m?.set(sr.escapedName, sr), X4(ct.name) === ye && (W = !0), f) {
- const Xr = Gs(f, mt.escapedName);
- Xr && Xr.declarations && $h(Xr) && Oe(ct.name) && Xh(ct.name, Xr.declarations, ct.name.escapedText);
- }
- if (f && a & 2 && !(a & 4) && Kf(ct)) {
- const Xr = L2(l);
- E.assert(Xr);
- const tn = ct.initializer.expression;
- Qfe(Xr, tn, Gt);
- }
- } else {
- E.assert(
- ct.kind === 293
- /* JsxSpreadAttribute */
- ), y.size > 0 && (x = w2(
- x,
- Ze(),
- l.symbol,
- Q,
- /*readonly*/
- !1
- ), y = Js());
- const Gt = Qd(Gi(
- ct.expression,
- a & 2
- /* Inferential */
- ));
- Wa(Gt) && (N = !0), bM(Gt) ? (x = w2(
- x,
- Gt,
- l.symbol,
- Q,
- /*readonly*/
- !1
- ), m && _8e(Gt, m, ct)) : (je(ct.expression, p.Spread_types_may_only_be_created_from_object_types), j = j ? ia([j, Gt]) : Gt);
- }
- }
- N || y.size > 0 && (x = w2(
- x,
- Ze(),
- l.symbol,
- Q,
- /*readonly*/
- !1
- ));
- const de = r.parent.kind === 284 ? r.parent : void 0;
- if (de && de.openingElement === r && wC(de.children).length > 0) {
- const ct = y$(de, a);
- if (!N && ye && ye !== "") {
- W && je(l, p._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, Ei(ye));
- const mt = nb(
- r.attributes,
- /*contextFlags*/
- void 0
- ), Gt = mt && rb(mt, ye), sr = fa(4, ye);
- sr.links.type = ct.length === 1 ? ct[0] : Gt && Pp(Gt, OP) ? Eg(ct) : du(Qn(ct)), sr.valueDeclaration = A.createPropertySignature(
- /*modifiers*/
- void 0,
- Ei(ye),
- /*questionToken*/
- void 0,
- /*type*/
- void 0
- ), Aa(sr.valueDeclaration, l), sr.valueDeclaration.symbol = sr;
- const Xr = Js();
- Xr.set(ye, sr), x = w2(
- x,
- Li(l.symbol, Xr, Ue, Ue, Ue),
- l.symbol,
- Q,
- /*readonly*/
- !1
- );
- }
- }
- if (N)
- return xe;
- if (j && x !== Cu)
- return ia([j, x]);
- return j || (x === Cu ? Ze() : x);
- function Ze() {
- Q |= 8192;
- const ct = Li(l.symbol, y, Ue, Ue, Ue);
- return ct.objectFlags |= Q | 128 | 131072, ct;
- }
- }
- function y$(r, a) {
- const l = [];
- for (const f of r.children)
- if (f.kind === 12)
- f.containsOnlyTriviaWhiteSpaces || l.push(Ie);
- else {
- if (f.kind === 294 && !f.expression)
- continue;
- l.push(zP(f, a));
- }
- return l;
- }
- function _8e(r, a, l) {
- for (const f of qa(r))
- if (!(f.flags & 16777216)) {
- const m = a.get(f.escapedName);
- if (m) {
- const y = je(m.valueDeclaration, p._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, Ei(m.escapedName));
- Rs(y, Kr(l, p.This_spread_always_overwrites_this_property));
- }
- }
- }
- function jit(r, a) {
- return Rit(r.parent, a);
- }
- function M2(r, a) {
- const l = kT(a), f = l && n_(l), m = f && Al(
- f,
- r,
- 788968
- /* Type */
- );
- return m ? bo(m) : He;
- }
- function v$(r) {
- const a = bn(r);
- if (!a.resolvedSymbol) {
- const l = M2(jf.IntrinsicElements, r);
- if (H(l))
- return ie && je(r, p.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, Ei(jf.IntrinsicElements)), a.resolvedSymbol = ze;
- {
- if (!Oe(r.tagName) && !Nd(r.tagName)) return E.fail();
- const f = Nd(r.tagName) ? yx(r.tagName) : r.tagName.escapedText, m = Gs(l, f);
- if (m)
- return a.jsxFlags |= 1, a.resolvedSymbol = m;
- const y = MIe(l, S_(Ei(f)));
- return y ? (a.jsxFlags |= 2, a.resolvedSymbol = y) : Pk(l, f) ? (a.jsxFlags |= 2, a.resolvedSymbol = l.symbol) : (je(r, p.Property_0_does_not_exist_on_type_1, hJ(r.tagName), "JSX." + jf.IntrinsicElements), a.resolvedSymbol = ze);
- }
- }
- return a.resolvedSymbol;
- }
- function Ope(r) {
- const a = r && Tr(r), l = a && bn(a);
- if (l && l.jsxImplicitImportContainer === !1)
- return;
- if (l && l.jsxImplicitImportContainer)
- return l.jsxImplicitImportContainer;
- const f = m5(d5(O, a), O);
- if (!f)
- return;
- const y = yu(O) === 1 ? p.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : p.Cannot_find_module_0_or_its_corresponding_type_declarations, x = y_t(a, f), N = Sk(x || r, f, y, r), j = N && N !== ze ? Ra(Mc(N)) : void 0;
- return l && (l.jsxImplicitImportContainer = j || !1), j;
- }
- function kT(r) {
- const a = r && bn(r);
- if (a && a.jsxNamespace)
- return a.jsxNamespace;
- if (!a || a.jsxNamespace !== !1) {
- let f = Ope(r);
- if (!f || f === ze) {
- const m = gg(r);
- f = Nt(
- r,
- m,
- 1920,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- }
- if (f) {
- const m = Mc(Al(
- n_(Mc(f)),
- jf.JSX,
- 1920
- /* Namespace */
- ));
- if (m && m !== ze)
- return a && (a.jsxNamespace = m), m;
- }
- a && (a.jsxNamespace = !1);
- }
- const l = Mc(pE(
- jf.JSX,
- 1920,
- /*diagnostic*/
- void 0
- ));
- if (l !== ze)
- return l;
- }
- function f8e(r, a) {
- const l = a && Al(
- a.exports,
- r,
- 788968
- /* Type */
- ), f = l && bo(l), m = f && qa(f);
- if (m) {
- if (m.length === 0)
- return "";
- if (m.length === 1)
- return m[0].escapedName;
- m.length > 1 && l.declarations && je(l.declarations[0], p.The_global_type_JSX_0_may_not_have_more_than_one_property, Ei(r));
- }
- }
- function Bit(r) {
- return r && Al(
- r.exports,
- jf.LibraryManagedAttributes,
- 788968
- /* Type */
- );
- }
- function Jit(r) {
- return r && Al(
- r.exports,
- jf.ElementType,
- 788968
- /* Type */
- );
- }
- function zit(r) {
- return f8e(jf.ElementAttributesPropertyNameContainer, r);
- }
- function SM(r) {
- return f8e(jf.ElementChildrenAttributeNameContainer, r);
- }
- function p8e(r, a) {
- if (r.flags & 4)
- return [Ct];
- if (r.flags & 128) {
- const m = d8e(r, a);
- return m ? [P$(a, m)] : (je(a, p.Property_0_does_not_exist_on_type_1, r.value, "JSX." + jf.IntrinsicElements), Ue);
- }
- const l = Uu(r);
- let f = Ns(
- l,
- 1
- /* Construct */
- );
- return f.length === 0 && (f = Ns(
- l,
- 0
- /* Call */
- )), f.length === 0 && l.flags & 1048576 && (f = w_e(lr(l.types, (m) => p8e(m, a)))), f;
- }
- function d8e(r, a) {
- const l = M2(jf.IntrinsicElements, a);
- if (!H(l)) {
- const f = r.value, m = Gs(l, tc(f));
- if (m)
- return nn(m);
- const y = $v(l, Ie);
- return y || void 0;
- }
- return xe;
- }
- function Wit(r, a, l) {
- if (r === 1) {
- const m = h8e(l);
- m && Ep(a, m, lf, l.tagName, p.Its_return_type_0_is_not_a_valid_JSX_element, f);
- } else if (r === 0) {
- const m = g8e(l);
- m && Ep(a, m, lf, l.tagName, p.Its_instance_type_0_is_not_a_valid_JSX_element, f);
- } else {
- const m = h8e(l), y = g8e(l);
- if (!m || !y)
- return;
- const x = Qn([m, y]);
- Ep(a, x, lf, l.tagName, p.Its_element_type_0_is_not_a_valid_JSX_element, f);
- }
- function f() {
- const m = nc(l.tagName);
- return vs(
- /*details*/
- void 0,
- p._0_cannot_be_used_as_a_JSX_component,
- m
- );
- }
- }
- function m8e(r) {
- var a;
- E.assert(Vk(r.tagName));
- const l = bn(r);
- if (!l.resolvedJsxElementAttributesType) {
- const f = v$(r);
- if (l.jsxFlags & 1)
- return l.resolvedJsxElementAttributesType = nn(f) || He;
- if (l.jsxFlags & 2) {
- const m = Nd(r.tagName) ? yx(r.tagName) : r.tagName.escapedText;
- return l.resolvedJsxElementAttributesType = ((a = Nk(M2(jf.IntrinsicElements, r), m)) == null ? void 0 : a.type) || He;
- } else
- return l.resolvedJsxElementAttributesType = He;
- }
- return l.resolvedJsxElementAttributesType;
- }
- function g8e(r) {
- const a = M2(jf.ElementClass, r);
- if (!H(a))
- return a;
- }
- function TM(r) {
- return M2(jf.Element, r);
- }
- function h8e(r) {
- const a = TM(r);
- if (a)
- return Qn([a, ht]);
- }
- function Uit(r) {
- const a = kT(r);
- if (!a) return;
- const l = Jit(a);
- if (!l) return;
- const f = y8e(l, cn(r));
- if (!(!f || H(f)))
- return f;
- }
- function y8e(r, a, ...l) {
- const f = bo(r);
- if (r.flags & 524288) {
- const m = Bi(r).typeParameters;
- if (Nr(m) >= l.length) {
- const y = C1(l, m, l.length, a);
- return Nr(y) === 0 ? f : _E(r, y);
- }
- }
- if (Nr(f.typeParameters) >= l.length) {
- const m = C1(l, f.typeParameters, l.length, a);
- return n0(f, m);
- }
- }
- function Vit(r) {
- const a = M2(jf.IntrinsicElements, r);
- return a ? qa(a) : Ue;
- }
- function qit(r) {
- (O.jsx || 0) === 0 && je(r, p.Cannot_use_JSX_unless_the_jsx_flag_is_provided), TM(r) === void 0 && ie && je(r, p.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist);
- }
- function Fpe(r) {
- const a = ou(r);
- if (a && Uut(r), qit(r), ype(r), a) {
- const l = r, f = TE(l);
- A$(f, r);
- const m = Uit(l);
- if (m !== void 0) {
- const y = l.tagName, x = Vk(y) ? S_(hJ(y)) : Gi(y);
- Ep(x, m, lf, y, p.Its_type_0_is_not_a_valid_JSX_element_type, () => {
- const N = nc(y);
- return vs(
- /*details*/
- void 0,
- p._0_cannot_be_used_as_a_JSX_component,
- N
- );
- });
- } else
- Wit(W8e(l), Ha(f), l);
- }
- }
- function b$(r, a, l) {
- if (r.flags & 524288 && (k2(r, a) || Nk(r, a) || mN(a) && dh(r, Ie) || l && Ipe(a)))
- return !0;
- if (r.flags & 33554432)
- return b$(r.baseType, a, l);
- if (r.flags & 3145728 && zN(r)) {
- for (const f of r.types)
- if (b$(f, a, l))
- return !0;
- }
- return !1;
- }
- function zN(r) {
- return !!(r.flags & 524288 && !(wn(r) & 512) || r.flags & 67108864 || r.flags & 33554432 && zN(r.baseType) || r.flags & 1048576 && ut(r.types, zN) || r.flags & 2097152 && Mi(r.types, zN));
- }
- function Hit(r, a) {
- if (qut(r), r.expression) {
- const l = Gi(r.expression, a);
- return r.dotDotDotToken && l !== xe && !Dp(l) && je(r, p.JSX_spread_child_must_be_an_array_type), l;
- } else
- return He;
- }
- function Lpe(r) {
- return r.valueDeclaration ? J2(r.valueDeclaration) : 0;
- }
- function Mpe(r) {
- if (r.flags & 8192 || gc(r) & 4)
- return !0;
- if (cn(r.valueDeclaration)) {
- const a = r.valueDeclaration.parent;
- return a && dn(a) && Cc(a) === 3;
- }
- }
- function Rpe(r, a, l, f, m, y = !0) {
- const x = y ? r.kind === 166 ? r.right : r.kind === 205 ? r : r.kind === 208 && r.propertyName ? r.propertyName : r.name : void 0;
- return v8e(r, a, l, f, m, x);
- }
- function v8e(r, a, l, f, m, y) {
- var x;
- const N = lp(m, l);
- if (a) {
- if (B < 2 && b8e(m))
- return y && je(y, p.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword), !1;
- if (N & 64)
- return y && je(y, p.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, Ji(m), Hr(Bk(m))), !1;
- if (!(N & 256) && ((x = m.declarations) != null && x.some(LY)))
- return y && je(y, p.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, Ji(m)), !1;
- }
- if (N & 64 && b8e(m) && (Qw(r) || LZ(r) || Mf(r.parent) && T7(r.parent.parent))) {
- const W = Ah(Cf(m));
- if (W && Blt(r))
- return y && je(y, p.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, Ji(m), Jp(W.name)), !1;
- }
- if (!(N & 6))
- return !0;
- if (N & 2) {
- const W = Ah(Cf(m));
- return Ude(r, W) ? !0 : (y && je(y, p.Property_0_is_private_and_only_accessible_within_class_1, Ji(m), Hr(Bk(m))), !1);
- }
- if (a)
- return !0;
- let j = FIe(r, (W) => {
- const Q = bo(Tn(W));
- return J3e(Q, m, l);
- });
- return !j && (j = Git(r), j = j && J3e(j, m, l), N & 256 || !j) ? (y && je(y, p.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, Ji(m), Hr(Bk(m) || f)), !1) : N & 256 ? !0 : (f.flags & 262144 && (f = f.isThisType ? s_(f) : Kl(f)), !f || !iE(f, j) ? (y && je(y, p.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, Ji(m), Hr(j), Hr(f)), !1) : !0);
- }
- function Git(r) {
- const a = $it(r);
- let l = a?.type && Ci(a.type);
- if (l)
- l.flags & 262144 && (l = s_(l));
- else {
- const f = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- ys(f) && (l = xpe(f));
- }
- if (l && wn(l) & 7)
- return cT(l);
- }
- function $it(r) {
- const a = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- return a && ys(a) ? Eb(a) : void 0;
- }
- function b8e(r) {
- return !!tM(r, (a) => !(a.flags & 8192));
- }
- function bE(r) {
- return Um(Gi(r), r);
- }
- function xM(r) {
- return Zd(
- r,
- 50331648
- /* IsUndefinedOrNull */
- );
- }
- function jpe(r) {
- return xM(r) ? c0(r) : r;
- }
- function Xit(r, a) {
- const l = yo(r) ? $_(r) : void 0;
- if (r.kind === 106) {
- je(r, p.The_value_0_cannot_be_used_here, "null");
- return;
- }
- if (l !== void 0 && l.length < 100) {
- if (Oe(r) && l === "undefined") {
- je(r, p.The_value_0_cannot_be_used_here, "undefined");
- return;
- }
- je(
- r,
- a & 16777216 ? a & 33554432 ? p._0_is_possibly_null_or_undefined : p._0_is_possibly_undefined : p._0_is_possibly_null,
- l
- );
- } else
- je(
- r,
- a & 16777216 ? a & 33554432 ? p.Object_is_possibly_null_or_undefined : p.Object_is_possibly_undefined : p.Object_is_possibly_null
- );
- }
- function Qit(r, a) {
- je(
- r,
- a & 16777216 ? a & 33554432 ? p.Cannot_invoke_an_object_which_is_possibly_null_or_undefined : p.Cannot_invoke_an_object_which_is_possibly_undefined : p.Cannot_invoke_an_object_which_is_possibly_null
- );
- }
- function S8e(r, a, l) {
- if (ee && r.flags & 2) {
- if (yo(a)) {
- const m = $_(a);
- if (m.length < 100)
- return je(a, p._0_is_of_type_unknown, m), He;
- }
- return je(a, p.Object_is_of_type_unknown), He;
- }
- const f = gE(
- r,
- 50331648
- /* IsUndefinedOrNull */
- );
- if (f & 50331648) {
- l(a, f);
- const m = c0(r);
- return m.flags & 229376 ? He : m;
- }
- return r;
- }
- function Um(r, a) {
- return S8e(r, a, Xit);
- }
- function T8e(r, a) {
- const l = Um(r, a);
- if (l.flags & 16384) {
- if (yo(a)) {
- const f = $_(a);
- if (Oe(a) && f === "undefined")
- return je(a, p.The_value_0_cannot_be_used_here, f), l;
- if (f.length < 100)
- return je(a, p._0_is_possibly_undefined, f), l;
- }
- je(a, p.Object_is_possibly_undefined);
- }
- return l;
- }
- function S$(r, a, l) {
- return r.flags & 64 ? Yit(r, a) : Jpe(r, r.expression, bE(r.expression), r.name, a, l);
- }
- function Yit(r, a) {
- const l = Gi(r.expression), f = NN(l, r.expression);
- return $G(Jpe(r, r.expression, Um(f, r.expression), r.name, a), r, f !== l);
- }
- function x8e(r, a) {
- const l = C7(r) && Ly(r.left) ? Um(hM(r.left), r.left) : bE(r.left);
- return Jpe(r, r.left, l, r.right, a);
- }
- function Bpe(r) {
- for (; r.parent.kind === 217; )
- r = r.parent;
- return am(r.parent) && r.parent.expression === r;
- }
- function kM(r, a) {
- for (let l = b7(a); l; l = Ol(l)) {
- const { symbol: f } = l, m = v3(f, r), y = f.members && f.members.get(m) || f.exports && f.exports.get(m);
- if (y)
- return y;
- }
- }
- function Zit(r) {
- if (!Ol(r))
- return dr(r, p.Private_identifiers_are_not_allowed_outside_class_bodies);
- if (!Z5(r.parent)) {
- if (!Ed(r))
- return dr(r, p.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
- const a = dn(r.parent) && r.parent.operatorToken.kind === 103;
- if (!T$(r) && !a)
- return dr(r, p.Cannot_find_name_0, Nn(r));
- }
- return !1;
- }
- function Kit(r) {
- Zit(r);
- const a = T$(r);
- return a && EM(
- a,
- /*nodeForCheckWriteOnly*/
- void 0,
- /*isSelfTypeAccess*/
- !1
- ), xe;
- }
- function T$(r) {
- if (!Ed(r))
- return;
- const a = bn(r);
- return a.resolvedSymbol === void 0 && (a.resolvedSymbol = kM(r.escapedText, r)), a.resolvedSymbol;
- }
- function x$(r, a) {
- return Gs(r, a.escapedName);
- }
- function est(r, a, l) {
- let f;
- const m = qa(r);
- m && ir(m, (x) => {
- const N = x.valueDeclaration;
- if (N && Vl(N) && Di(N.name) && N.name.escapedText === a.escapedText)
- return f = x, !0;
- });
- const y = Tp(a);
- if (f) {
- const x = E.checkDefined(f.valueDeclaration), N = E.checkDefined(Ol(x));
- if (l?.valueDeclaration) {
- const j = l.valueDeclaration, W = Ol(j);
- if (E.assert(!!W), or(W, (Q) => N === Q)) {
- const Q = je(
- a,
- p.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,
- y,
- Hr(r)
- );
- return Rs(
- Q,
- Kr(
- j,
- p.The_shadowing_declaration_of_0_is_defined_here,
- y
- ),
- Kr(
- x,
- p.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,
- y
- )
- ), !0;
- }
- }
- return je(
- a,
- p.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,
- y,
- Tp(N.name || Gz)
- ), !0;
- }
- return !1;
- }
- function k8e(r, a) {
- return (e0(a) || Qw(r) && fh(a)) && Lu(
- r,
- /*includeArrowFunctions*/
- !0,
- /*includeClassComputedPropertyName*/
- !1
- ) === S1(a);
- }
- function Jpe(r, a, l, f, m, y) {
- const x = bn(a).resolvedSymbol, N = rv(r), j = Uu(N !== 0 || Bpe(r) ? J_(l) : l), W = Wa(j) || j === en;
- let Q;
- if (Di(f)) {
- (B < 9 || B < 99 || !q) && (N !== 0 && bl(
- r,
- 1048576
- /* ClassPrivateFieldSet */
- ), N !== 1 && bl(
- r,
- 524288
- /* ClassPrivateFieldGet */
- ));
- const de = kM(f.escapedText, f);
- if (N && de && de.valueDeclaration && hc(de.valueDeclaration) && dr(f, p.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, Nn(f)), W) {
- if (de)
- return H(j) ? He : j;
- if (b7(f) === void 0)
- return dr(f, p.Private_identifiers_are_not_allowed_outside_class_bodies), xe;
- }
- if (Q = de && x$(l, de), Q === void 0) {
- if (est(l, f, de))
- return He;
- const Ze = b7(f);
- Ze && u4(Tr(Ze), O.checkJs) && dr(f, p.Private_field_0_must_be_declared_in_an_enclosing_class, Nn(f));
- } else
- Q.flags & 65536 && !(Q.flags & 32768) && N !== 1 && je(r, p.Private_accessor_was_defined_without_a_getter);
- } else {
- if (W)
- return Oe(a) && x && Wk(
- r,
- 2,
- /*propSymbol*/
- void 0,
- l
- ), H(j) ? He : j;
- Q = Gs(
- j,
- f.escapedText,
- /*skipObjectFunctionPropertyAugment*/
- F$(j),
- /*includeTypeOnlyMembers*/
- r.kind === 166
- /* QualifiedName */
- );
- }
- Wk(r, 2, Q, l);
- let ye;
- if (Q) {
- const de = Bde(Q, f);
- if ($h(de) && gfe(r, de) && de.declarations && Xh(f, de.declarations, f.escapedText), tst(Q, r, f), EM(Q, r, I8e(a, x)), bn(r).resolvedSymbol = Q, Rpe(r, a.kind === 108, ux(r), j, Q), vNe(r, Q, N))
- return je(f, p.Cannot_assign_to_0_because_it_is_a_read_only_property, Nn(f)), He;
- ye = k8e(r, Q) ? at : y || r5(r) ? T1(Q) : nn(Q);
- } else {
- const de = !Di(f) && (N === 0 || !dT(l) || $4(l)) ? Nk(j, f.escapedText) : void 0;
- if (!(de && de.type)) {
- const Ze = zpe(
- r,
- l.symbol,
- /*excludeClasses*/
- !0
- );
- return !Ze && TN(l) ? xe : l.symbol === fe ? (fe.exports.has(f.escapedText) && fe.exports.get(f.escapedText).flags & 418 ? je(f, p.Property_0_does_not_exist_on_type_1, Ei(f.escapedText), Hr(l)) : ie && je(f, p.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, Hr(l)), xe) : (f.escapedText && !WS(r) && E8e(f, $4(l) ? j : l, Ze), He);
- }
- de.isReadonly && (b0(r) || fB(r)) && je(r, p.Index_signature_in_type_0_only_permits_reading, Hr(j)), ye = de.type, O.noUncheckedIndexedAccess && rv(r) !== 1 && (ye = Qn([ye, U])), O.noPropertyAccessFromIndexSignature && Cn(r) && je(f, p.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, Ei(f.escapedText)), de.declaration && q0(de.declaration) && Xh(f, [de.declaration], f.escapedText);
- }
- return C8e(r, Q, ye, f, m);
- }
- function zpe(r, a, l) {
- var f;
- const m = Tr(r);
- if (m && O.checkJs === void 0 && m.checkJsDirective === void 0 && (m.scriptKind === 1 || m.scriptKind === 2)) {
- const y = ir(a?.declarations, Tr), x = !a?.valueDeclaration || !Zn(a.valueDeclaration) || ((f = a.valueDeclaration.heritageClauses) == null ? void 0 : f.length) || v0(
- /*useLegacyDecorators*/
- !1,
- a.valueDeclaration
- );
- return !(m !== y && y && g0(y)) && !(l && a && a.flags & 32 && x) && !(r && l && Cn(r) && r.expression.kind === 110 && x);
- }
- return !1;
- }
- function C8e(r, a, l, f, m) {
- const y = rv(r);
- if (y === 1)
- return l0(l, !!(a && a.flags & 16777216));
- if (a && !(a.flags & 98311) && !(a.flags & 8192 && l.flags & 1048576) && !Q$(a.declarations))
- return l;
- if (l === at)
- return t0(r, a);
- l = hpe(l, r, m);
- let x = !1;
- if (ee && re && xo(r) && r.expression.kind === 110) {
- const j = a && a.valueDeclaration;
- if (j && SIe(j) && !zs(j)) {
- const W = RN(r);
- W.kind === 176 && W.parent === j.parent && !(j.flags & 33554432) && (x = !0);
- }
- } else ee && a && a.valueDeclaration && Cn(a.valueDeclaration) && o3(a.valueDeclaration) && RN(r) === RN(a.valueDeclaration) && (x = !0);
- const N = _0(r, l, x ? N1(l) : l);
- return x && !mE(l) && mE(N) ? (je(f, p.Property_0_is_used_before_being_assigned, Ji(a)), l) : y ? o0(N) : N;
- }
- function tst(r, a, l) {
- const { valueDeclaration: f } = r;
- if (!f || Tr(a).isDeclarationFile)
- return;
- let m;
- const y = Nn(l);
- Wpe(a) && !IKe(f) && !(xo(a) && xo(a.expression)) && !$0(f, l) && !(hc(f) && aX(f) & 256) && (q || !rst(r)) ? m = je(l, p.Property_0_is_used_before_its_initialization, y) : f.kind === 263 && a.parent.kind !== 183 && !(f.flags & 33554432) && !$0(f, l) && (m = je(l, p.Class_0_used_before_its_declaration, y)), m && Rs(m, Kr(f, p._0_is_declared_here, y));
- }
- function Wpe(r) {
- return !!or(r, (a) => {
- switch (a.kind) {
- case 172:
- return !0;
- case 303:
- case 174:
- case 177:
- case 178:
- case 305:
- case 167:
- case 239:
- case 294:
- case 291:
- case 292:
- case 293:
- case 286:
- case 233:
- case 298:
- return !1;
- case 219:
- case 244:
- return Cs(a.parent) && oc(a.parent.parent) ? !0 : "quit";
- default:
- return Ed(a) ? !1 : "quit";
- }
- });
- }
- function rst(r) {
- if (!(r.parent.flags & 32))
- return !1;
- let a = nn(r.parent);
- for (; ; ) {
- if (a = a.symbol && nst(a), !a)
- return !1;
- const l = Gs(a, r.escapedName);
- if (l && l.valueDeclaration)
- return !0;
- }
- }
- function nst(r) {
- const a = No(r);
- if (a.length !== 0)
- return ia(a);
- }
- function E8e(r, a, l) {
- let f, m;
- if (!Di(r) && a.flags & 1048576 && !(a.flags & 402784252)) {
- for (const x of a.types)
- if (!Gs(x, r.escapedText) && !Nk(x, r.escapedText)) {
- f = vs(f, p.Property_0_does_not_exist_on_type_1, _o(r), Hr(x));
- break;
- }
- }
- if (D8e(r.escapedText, a)) {
- const x = _o(r), N = Hr(a);
- f = vs(f, p.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, x, N, N + "." + x);
- } else {
- const x = QN(a);
- if (x && Gs(x, r.escapedText))
- f = vs(f, p.Property_0_does_not_exist_on_type_1, _o(r), Hr(a)), m = Kr(r, p.Did_you_forget_to_use_await);
- else {
- const N = _o(r), j = Hr(a), W = ast(N, a);
- if (W !== void 0)
- f = vs(f, p.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, N, j, W);
- else {
- const Q = Upe(r, a);
- if (Q !== void 0) {
- const ye = mc(Q), de = l ? p.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : p.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
- f = vs(f, de, N, j, ye), m = Q.valueDeclaration && Kr(Q.valueDeclaration, p._0_is_declared_here, ye);
- } else {
- const ye = ist(a) ? p.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom : p.Property_0_does_not_exist_on_type_1;
- f = vs(j_e(f, a), ye, N, j);
- }
- }
- }
- }
- const y = Rg(Tr(r), r, f);
- m && Rs(y, m), zd(!l || f.code !== p.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, y);
- }
- function ist(r) {
- return O.lib && !O.lib.includes("dom") && pnt(r, (a) => a.symbol && /^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(Ei(a.symbol.escapedName))) && a0(r);
- }
- function D8e(r, a) {
- const l = a.symbol && Gs(nn(a.symbol), r);
- return l !== void 0 && !!l.valueDeclaration && zs(l.valueDeclaration);
- }
- function sst(r) {
- const a = Tp(r), f = Bj().get(a);
- return f && _R(f.keys());
- }
- function ast(r, a) {
- const l = Uu(a).symbol;
- if (!l)
- return;
- const f = mc(l), y = Bj().get(f);
- if (y) {
- for (const [x, N] of y)
- if (ss(N, r))
- return x;
- }
- }
- function P8e(r, a) {
- return CM(
- r,
- qa(a),
- 106500
- /* ClassMember */
- );
- }
- function Upe(r, a) {
- let l = qa(a);
- if (typeof r != "string") {
- const f = r.parent;
- Cn(f) && (l = Ln(l, (m) => O8e(f, a, m))), r = Nn(r);
- }
- return CM(
- r,
- l,
- 111551
- /* Value */
- );
- }
- function w8e(r, a) {
- const l = _s(r) ? r : Nn(r), f = qa(a);
- return (l === "for" ? On(f, (y) => mc(y) === "htmlFor") : l === "class" ? On(f, (y) => mc(y) === "className") : void 0) ?? CM(
- l,
- f,
- 111551
- /* Value */
- );
- }
- function A8e(r, a) {
- const l = Upe(r, a);
- return l && mc(l);
- }
- function ost(r, a, l) {
- const f = Al(r, a, l);
- if (f) return f;
- let m;
- return r === Te ? m = Ai(
- ["string", "number", "boolean", "object", "bigint", "symbol"],
- (x) => r.has(x.charAt(0).toUpperCase() + x.slice(1)) ? fa(524288, x) : void 0
- ).concat(as(r.values())) : m = as(r.values()), CM(Ei(a), m, l);
- }
- function N8e(r, a, l) {
- return E.assert(a !== void 0, "outername should always be defined"), Qt(
- r,
- a,
- l,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1,
- /*excludeGlobals*/
- !1
- );
- }
- function Vpe(r, a) {
- return a.exports && CM(
- Nn(r),
- g1(a),
- 2623475
- /* ModuleMember */
- );
- }
- function cst(r, a, l) {
- function f(x) {
- const N = k2(r, x);
- if (N) {
- const j = ET(nn(N));
- return !!j && Hm(j) >= 1 && $s(l, Kd(j, 0));
- }
- return !1;
- }
- const m = b0(a) ? "set" : "get";
- if (!f(m))
- return;
- let y = N3(a.expression);
- return y === void 0 ? y = m : y += "." + m, y;
- }
- function lst(r, a) {
- const l = a.types.filter((f) => !!(f.flags & 128));
- return _b(r.value, l, (f) => f.value);
- }
- function CM(r, a, l) {
- return _b(r, a, f);
- function f(m) {
- const y = mc(m);
- if (!Ui(y, '"')) {
- if (m.flags & l)
- return y;
- if (m.flags & 2097152) {
- const x = X6(m);
- if (x && x.flags & l)
- return y;
- }
- }
- }
- }
- function EM(r, a, l) {
- const f = r && r.flags & 106500 && r.valueDeclaration;
- if (!f)
- return;
- const m = Z_(
- f,
- 2
- /* Private */
- ), y = r.valueDeclaration && Vl(r.valueDeclaration) && Di(r.valueDeclaration.name);
- if (!(!m && !y) && !(a && r5(a) && !(r.flags & 65536))) {
- if (l) {
- const x = or(a, no);
- if (x && x.symbol === r)
- return;
- }
- (gc(r) & 1 ? Bi(r).target : r).isReferenced = -1;
- }
- }
- function I8e(r, a) {
- return r.kind === 110 || !!a && yo(r) && a === Nu(E_(r));
- }
- function ust(r, a) {
- switch (r.kind) {
- case 211:
- return qpe(r, r.expression.kind === 108, a, J_(Gi(r.expression)));
- case 166:
- return qpe(
- r,
- /*isSuper*/
- !1,
- a,
- J_(Gi(r.left))
- );
- case 205:
- return qpe(
- r,
- /*isSuper*/
- !1,
- a,
- Ci(r)
- );
- }
- }
- function O8e(r, a, l) {
- return Hpe(
- r,
- r.kind === 211 && r.expression.kind === 108,
- /*isWrite*/
- !1,
- a,
- l
- );
- }
- function qpe(r, a, l, f) {
- if (Wa(f))
- return !0;
- const m = Gs(f, l);
- return !!m && Hpe(
- r,
- a,
- /*isWrite*/
- !1,
- f,
- m
- );
- }
- function Hpe(r, a, l, f, m) {
- if (Wa(f))
- return !0;
- if (m.valueDeclaration && Ou(m.valueDeclaration)) {
- const y = Ol(m.valueDeclaration);
- return !hu(r) && !!or(r, (x) => x === y);
- }
- return v8e(r, a, l, f, m);
- }
- function _st(r) {
- const a = r.initializer;
- if (a.kind === 261) {
- const l = a.declarations[0];
- if (l && !As(l.name))
- return Tn(l);
- } else if (a.kind === 80)
- return Nu(a);
- }
- function fst(r) {
- return wu(r).length === 1 && !!dh(r, At);
- }
- function pst(r) {
- const a = Ba(r);
- if (a.kind === 80) {
- const l = Nu(a);
- if (l.flags & 3) {
- let f = r, m = r.parent;
- for (; m; ) {
- if (m.kind === 249 && f === m.statement && _st(m) === l && fst(tu(m.expression)))
- return !0;
- f = m, m = m.parent;
- }
- }
- }
- return !1;
- }
- function dst(r, a) {
- return r.flags & 64 ? mst(r, a) : F8e(r, bE(r.expression), a);
- }
- function mst(r, a) {
- const l = Gi(r.expression), f = NN(l, r.expression);
- return $G(F8e(r, Um(f, r.expression), a), r, f !== l);
- }
- function F8e(r, a, l) {
- const f = rv(r) !== 0 || Bpe(r) ? J_(a) : a, m = r.argumentExpression, y = Gi(m);
- if (H(f) || f === en)
- return f;
- if (F$(f) && !Xa(m))
- return je(m, p.A_const_enum_member_can_only_be_accessed_using_a_string_literal), He;
- const x = pst(m) ? At : y, N = rv(r);
- let j;
- N === 0 ? j = 32 : (j = 4 | (dT(f) && !$4(f) ? 2 : 0), N === 2 && (j |= 32));
- const W = D1(f, x, j, r) || He;
- return WNe(C8e(r, bn(r).resolvedSymbol, W, m, l), r);
- }
- function L8e(r) {
- return am(r) || lv(r) || ou(r);
- }
- function CT(r) {
- return L8e(r) && ir(r.typeArguments, la), r.kind === 215 ? Gi(r.template) : ou(r) ? Gi(r.attributes) : dn(r) ? Gi(r.left) : am(r) && ir(r.arguments, (a) => {
- Gi(a);
- }), Ct;
- }
- function Vm(r) {
- return CT(r), $t;
- }
- function gst(r, a, l) {
- let f, m, y = 0, x, N = -1, j;
- E.assert(!a.length);
- for (const W of r) {
- const Q = W.declaration && Tn(W.declaration), ye = W.declaration && W.declaration.parent;
- !m || Q === m ? f && ye === f ? x = x + 1 : (f = ye, x = y) : (x = y = a.length, f = ye), m = Q, zye(W) ? (N++, j = N, y++) : j = x, a.splice(j, 0, l ? eKe(W, l) : W);
- }
- }
- function k$(r) {
- return !!r && (r.kind === 230 || r.kind === 237 && r.isSpread);
- }
- function Gpe(r) {
- return ac(r, k$);
- }
- function M8e(r) {
- return !!(r.flags & 16384);
- }
- function hst(r) {
- return !!(r.flags & 49155);
- }
- function C$(r, a, l, f = !1) {
- let m, y = !1, x = W_(l), N = Hm(l);
- if (r.kind === 215)
- if (m = a.length, r.template.kind === 228) {
- const j = _a(r.template.templateSpans);
- y = rc(j.literal) || !!j.literal.isUnterminated;
- } else {
- const j = r.template;
- E.assert(
- j.kind === 15
- /* NoSubstitutionTemplateLiteral */
- ), y = !!j.isUnterminated;
- }
- else if (r.kind === 170)
- m = V8e(r, l);
- else if (r.kind === 226)
- m = 1;
- else if (ou(r)) {
- if (y = r.attributes.end === r.end, y)
- return !0;
- m = N === 0 ? a.length : 1, x = a.length === 0 ? x : 1, N = Math.min(N, 1);
- } else if (r.arguments) {
- m = f ? a.length + 1 : a.length, y = r.arguments.end === r.end;
- const j = Gpe(a);
- if (j >= 0)
- return j >= Hm(l) && (Pg(l) || j < W_(l));
- } else
- return E.assert(
- r.kind === 214
- /* NewExpression */
- ), Hm(l) === 0;
- if (!Pg(l) && m > x)
- return !1;
- if (y || m >= N)
- return !0;
- for (let j = m; j < N; j++) {
- const W = Kd(l, j);
- if (Vc(W, cn(r) && !ee ? hst : M8e).flags & 131072)
- return !1;
- }
- return !0;
- }
- function $pe(r, a) {
- const l = Nr(r.typeParameters), f = Bm(r.typeParameters);
- return !ut(a) || a.length >= f && a.length <= l;
- }
- function R8e(r, a) {
- let l;
- return !!(r.target && (l = R2(r.target, a)) && Lk(l));
- }
- function ET(r) {
- return WN(
- r,
- 0,
- /*allowMembers*/
- !1
- );
- }
- function j8e(r) {
- return WN(
- r,
- 0,
- /*allowMembers*/
- !1
- ) || WN(
- r,
- 1,
- /*allowMembers*/
- !1
- );
- }
- function WN(r, a, l) {
- if (r.flags & 524288) {
- const f = Xd(r);
- if (l || f.properties.length === 0 && f.indexInfos.length === 0) {
- if (a === 0 && f.callSignatures.length === 1 && f.constructSignatures.length === 0)
- return f.callSignatures[0];
- if (a === 1 && f.constructSignatures.length === 1 && f.callSignatures.length === 0)
- return f.constructSignatures[0];
- }
- }
- }
- function B8e(r, a, l, f) {
- const m = FN(mwe(r), r, 0, f), y = UN(a), x = l && (y && y.flags & 262144 ? l.nonFixingMapper : l.mapper), N = x ? jk(a, x) : a;
- return Gfe(N, r, (j, W) => {
- u0(m.inferences, j, W);
- }), l || $fe(a, r, (j, W) => {
- u0(
- m.inferences,
- j,
- W,
- 128
- /* ReturnType */
- );
- }), vN(r, ape(m), cn(a.declaration));
- }
- function yst(r, a, l, f) {
- const m = g$(a, r), y = xE(r.attributes, m, f, l);
- return u0(f.inferences, y, m), ape(f);
- }
- function J8e(r) {
- if (!r)
- return Xt;
- const a = Gi(r);
- return vK(r) ? a : KE(r.parent) ? c0(a) : hu(r.parent) ? GG(a) : a;
- }
- function Xpe(r, a, l, f, m) {
- if (ou(r))
- return yst(r, a, f, m);
- if (r.kind !== 170 && r.kind !== 226) {
- const j = Mi(a.typeParameters, (Q) => !!C2(Q)), W = a_(
- r,
- j ? 8 : 0
- /* None */
- );
- if (W) {
- const Q = Ha(a);
- if (I1(Q)) {
- const ye = L2(r);
- if (!(!j && a_(
- r,
- 8
- /* SkipBindingPatterns */
- ) !== W)) {
- const mt = Zfe(Drt(
- ye,
- 1
- /* NoDefault */
- )), Gt = zi(W, mt), sr = ET(Gt), Xr = sr && sr.typeParameters ? _T(H_e(sr, sr.typeParameters)) : Gt;
- u0(
- m.inferences,
- Xr,
- Q,
- 128
- /* ReturnType */
- );
- }
- const Ze = FN(a.typeParameters, a, m.flags), ct = zi(W, ye && ye.returnMapper);
- u0(Ze.inferences, ct, Q), m.returnMapper = ut(Ze.inferences, kE) ? Zfe(Nrt(Ze)) : void 0;
- }
- }
- }
- const y = VN(a), x = y ? Math.min(W_(a) - 1, l.length) : l.length;
- if (y && y.flags & 262144) {
- const j = On(m.inferences, (W) => W.typeParameter === y);
- j && (j.impliedArity = ac(l, k$, x) < 0 ? l.length - x : void 0);
- }
- const N = Xv(a);
- if (N && I1(N)) {
- const j = U8e(r);
- u0(m.inferences, J8e(j), N);
- }
- for (let j = 0; j < x; j++) {
- const W = l[j];
- if (W.kind !== 232) {
- const Q = Kd(a, j);
- if (I1(Q)) {
- const ye = xE(W, Q, m, f);
- u0(m.inferences, ye, Q);
- }
- }
- }
- if (y && I1(y)) {
- const j = Qpe(l, x, l.length, y, m, f);
- u0(m.inferences, j, y);
- }
- return ape(m);
- }
- function z8e(r) {
- return r.flags & 1048576 ? Xo(r, z8e) : r.flags & 1 || nM(Kl(r) || r) ? r : ha(r) ? Eg(
- P2(r),
- r.target.elementFlags,
- /*readonly*/
- !1,
- r.target.labeledElementDeclarations
- ) : Eg([r], [
- 8
- /* Variadic */
- ]);
- }
- function Qpe(r, a, l, f, m, y) {
- const x = uT(f);
- if (a >= l - 1) {
- const Q = r[l - 1];
- if (k$(Q)) {
- const ye = Q.kind === 237 ? Q.type : xE(Q.expression, f, m, y);
- return oy(ye) ? z8e(ye) : du(uy(33, ye, Ae, Q.kind === 230 ? Q.expression : Q), x);
- }
- }
- const N = [], j = [], W = [];
- for (let Q = a; Q < l; Q++) {
- const ye = r[Q];
- if (k$(ye)) {
- const de = ye.kind === 237 ? ye.type : Gi(ye.expression);
- oy(de) ? (N.push(de), j.push(
- 8
- /* Variadic */
- )) : (N.push(uy(33, de, Ae, ye.kind === 230 ? ye.expression : ye)), j.push(
- 4
- /* Rest */
- ));
- } else {
- const de = ha(f) ? Ppe(f, Q - a, l - a) || M : j_(
- f,
- bd(Q - a),
- 256
- /* Contextual */
- ), Ze = xE(ye, de, m, y), ct = x || bc(
- de,
- 406978556
- /* StringMapping */
- );
- N.push(ct ? Vu(Ze) : eb(Ze)), j.push(
- 1
- /* Required */
- );
- }
- ye.kind === 237 && ye.tupleNameSource ? W.push(ye.tupleNameSource) : W.push(void 0);
- }
- return Eg(N, j, x && !Pp(f, zfe), W);
- }
- function Ype(r, a, l, f) {
- const m = cn(r.declaration), y = r.typeParameters, x = C1(lr(a, Ci), y, Bm(y), m);
- let N;
- for (let j = 0; j < a.length; j++) {
- E.assert(y[j] !== void 0, "Should not call checkTypeArguments with too many type arguments");
- const W = s_(y[j]);
- if (W) {
- const Q = l && f ? () => vs(
- /*details*/
- void 0,
- p.Type_0_does_not_satisfy_the_constraint_1
- ) : void 0, ye = f || p.Type_0_does_not_satisfy_the_constraint_1;
- N || (N = B_(y, x));
- const de = x[j];
- if (!Au(
- de,
- df(zi(W, N), de),
- l ? a[j] : void 0,
- ye,
- Q
- ))
- return;
- }
- }
- return x;
- }
- function W8e(r) {
- if (Vk(r.tagName))
- return 2;
- const a = Uu(Gi(r.tagName));
- return Nr(Ns(
- a,
- 1
- /* Construct */
- )) ? 0 : Nr(Ns(
- a,
- 0
- /* Call */
- )) ? 1 : 2;
- }
- function vst(r, a, l, f, m, y, x) {
- const N = g$(a, r), j = xE(
- r.attributes,
- N,
- /*inferenceContext*/
- void 0,
- f
- ), W = f & 4 ? ON(j) : j;
- return Q() && Nfe(
- W,
- N,
- l,
- m ? r.tagName : void 0,
- r.attributes,
- /*headMessage*/
- void 0,
- y,
- x
- );
- function Q() {
- var ye;
- if (Ope(r))
- return !0;
- const de = (xm(r) || yS(r)) && !(Vk(r.tagName) || Nd(r.tagName)) ? Gi(r.tagName) : void 0;
- if (!de)
- return !0;
- const Ze = Ns(
- de,
- 0
- /* Call */
- );
- if (!Nr(Ze))
- return !0;
- const ct = $Ie(r);
- if (!ct)
- return !0;
- const mt = Yo(
- ct,
- 111551,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !1,
- r
- );
- if (!mt)
- return !0;
- const Gt = nn(mt), sr = Ns(
- Gt,
- 0
- /* Call */
- );
- if (!Nr(sr))
- return !0;
- let Xr = !1, tn = 0;
- for (const er of sr) {
- const gn = Kd(er, 0), Un = Ns(
- gn,
- 0
- /* Call */
- );
- if (Nr(Un))
- for (const ci of Un) {
- if (Xr = !0, Pg(ci))
- return !0;
- const Jn = W_(ci);
- Jn > tn && (tn = Jn);
- }
- }
- if (!Xr)
- return !0;
- let pr = 1 / 0;
- for (const er of Ze) {
- const gn = Hm(er);
- gn < pr && (pr = gn);
- }
- if (pr <= tn)
- return !0;
- if (m) {
- const er = Kr(r.tagName, p.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, $_(r.tagName), pr, $_(ct), tn), gn = (ye = od(r.tagName)) == null ? void 0 : ye.valueDeclaration;
- gn && Rs(er, Kr(gn, p._0_is_declared_here, $_(r.tagName))), x && x.skipLogging && (x.errors || (x.errors = [])).push(er), x.skipLogging || Da.add(er);
- }
- return !1;
- }
- }
- function E$(r) {
- return r = Ba(r), Y5(r) ? Ba(r.expression) : r;
- }
- function DM(r, a, l, f, m, y, x, N) {
- const j = { errors: void 0, skipLogging: !0 };
- if (ou(r))
- return vst(r, l, f, m, y, x, j) ? void 0 : (E.assert(!y || !!j.errors, "jsx should have errors when reporting errors"), j.errors || Ue);
- const W = Xv(l);
- if (W && W !== Xt && !(jb(r) || Fs(r) && C_(r.expression))) {
- const ct = U8e(r), mt = J8e(ct), Gt = y ? ct || r : void 0, sr = p.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
- if (!Ep(mt, W, f, Gt, sr, x, j))
- return E.assert(!y || !!j.errors, "this parameter should have errors when reporting errors"), j.errors || Ue;
- }
- const Q = p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ye = VN(l), de = ye ? Math.min(W_(l) - 1, a.length) : a.length;
- for (let ct = 0; ct < de; ct++) {
- const mt = a[ct];
- if (mt.kind !== 232) {
- const Gt = Kd(l, ct), sr = xE(
- mt,
- Gt,
- /*inferenceContext*/
- void 0,
- m
- ), Xr = m & 4 ? ON(sr) : sr, tn = N ? zi(Xr, N.nonFixingMapper) : Xr, pr = E$(mt);
- if (!Nfe(tn, Gt, f, y ? pr : void 0, pr, Q, x, j))
- return E.assert(!y || !!j.errors, "parameter should have errors when reporting errors"), Ze(mt, tn, Gt), j.errors || Ue;
- }
- }
- if (ye) {
- const ct = Qpe(
- a,
- de,
- a.length,
- ye,
- /*context*/
- void 0,
- m
- ), mt = a.length - de, Gt = y ? mt === 0 ? r : mt === 1 ? E$(a[de]) : wd(PM(r, ct), a[de].pos, a[a.length - 1].end) : void 0;
- if (!Ep(
- ct,
- ye,
- f,
- Gt,
- Q,
- /*containingMessageChain*/
- void 0,
- j
- ))
- return E.assert(!y || !!j.errors, "rest parameter should have errors when reporting errors"), Ze(Gt, ct, ye), j.errors || Ue;
- }
- return;
- function Ze(ct, mt, Gt) {
- if (ct && y && j.errors && j.errors.length) {
- if (WP(Gt))
- return;
- const sr = WP(mt);
- sr && zm(sr, Gt, f) && Rs(j.errors[0], Kr(ct, p.Did_you_forget_to_use_await));
- }
- }
- }
- function U8e(r) {
- if (r.kind === 226)
- return r.right;
- const a = r.kind === 213 ? r.expression : r.kind === 215 ? r.tag : r.kind === 170 && !X ? r.expression : void 0;
- if (a) {
- const l = Dc(a);
- if (xo(l))
- return l.expression;
- }
- }
- function PM(r, a, l, f) {
- const m = gv.createSyntheticExpression(a, l, f);
- return lt(m, r), Aa(m, r), m;
- }
- function D$(r) {
- if (r.kind === 215) {
- const f = r.template, m = [PM(f, YKe())];
- return f.kind === 228 && ir(f.templateSpans, (y) => {
- m.push(y.expression);
- }), m;
- }
- if (r.kind === 170)
- return bst(r);
- if (r.kind === 226)
- return [r.left];
- if (ou(r))
- return r.attributes.properties.length > 0 || xm(r) && r.parent.children.length > 0 ? [r.attributes] : Ue;
- const a = r.arguments || Ue, l = Gpe(a);
- if (l >= 0) {
- const f = a.slice(0, l);
- for (let m = l; m < a.length; m++) {
- const y = a[m], x = y.kind === 230 && (Yp ? Gi(y.expression) : wc(y.expression));
- x && ha(x) ? ir(P2(x), (N, j) => {
- var W;
- const Q = x.target.elementFlags[j], ye = PM(y, Q & 4 ? du(N) : N, !!(Q & 12), (W = x.target.labeledElementDeclarations) == null ? void 0 : W[j]);
- f.push(ye);
- }) : f.push(y);
- }
- return f;
- }
- return a;
- }
- function bst(r) {
- const a = r.expression, l = ude(r);
- if (l) {
- const f = [];
- for (const m of l.parameters) {
- const y = nn(m);
- f.push(PM(a, y));
- }
- return f;
- }
- return E.fail();
- }
- function V8e(r, a) {
- return O.experimentalDecorators ? Sst(r, a) : (
- // Allow the runtime to oversupply arguments to an ES decorator as long as there's at least one parameter.
- Math.min(Math.max(W_(a), 1), 2)
- );
- }
- function Sst(r, a) {
- switch (r.parent.kind) {
- case 263:
- case 231:
- return 1;
- case 172:
- return dm(r.parent) ? 3 : 2;
- case 174:
- case 177:
- case 178:
- return a.parameters.length <= 2 ? 2 : 3;
- case 169:
- return 3;
- default:
- return E.fail();
- }
- }
- function q8e(r) {
- const a = Tr(r), { start: l, length: f } = tS(a, Cn(r.expression) ? r.expression.name : r.expression);
- return { start: l, length: f, sourceFile: a };
- }
- function wM(r, a, ...l) {
- if (Fs(r)) {
- const { sourceFile: f, start: m, length: y } = q8e(r);
- return "message" in a ? fl(f, m, y, a, ...l) : Qj(f, a);
- } else
- return "message" in a ? Kr(r, a, ...l) : Rg(Tr(r), r, a);
- }
- function Tst(r) {
- return am(r) ? Cn(r.expression) ? r.expression.name : r.expression : lv(r) ? Cn(r.tag) ? r.tag.name : r.tag : ou(r) ? r.tagName : r;
- }
- function xst(r) {
- if (!Fs(r) || !Oe(r.expression)) return !1;
- const a = Nt(
- r.expression,
- r.expression.escapedText,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- ), l = a?.valueDeclaration;
- if (!l || !Ii(l) || !Wy(l.parent) || !jb(l.parent.parent) || !Oe(l.parent.parent.expression))
- return !1;
- const f = nfe(
- /*reportErrors*/
- !1
- );
- return f ? od(
- l.parent.parent.expression,
- /*ignoreErrors*/
- !0
- ) === f : !1;
- }
- function H8e(r, a, l, f) {
- var m;
- const y = Gpe(l);
- if (y > -1)
- return Kr(l[y], p.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);
- let x = Number.POSITIVE_INFINITY, N = Number.NEGATIVE_INFINITY, j = Number.NEGATIVE_INFINITY, W = Number.POSITIVE_INFINITY, Q;
- for (const mt of a) {
- const Gt = Hm(mt), sr = W_(mt);
- Gt < x && (x = Gt, Q = mt), N = Math.max(N, sr), Gt < l.length && Gt > j && (j = Gt), l.length < sr && sr < W && (W = sr);
- }
- const ye = ut(a, Pg), de = ye ? x : x < N ? x + "-" + N : x, Ze = !ye && de === 1 && l.length === 0 && xst(r);
- if (Ze && cn(r))
- return wM(r, p.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments);
- const ct = dl(r) ? ye ? p.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : p.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : ye ? p.Expected_at_least_0_arguments_but_got_1 : Ze ? p.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : p.Expected_0_arguments_but_got_1;
- if (x < l.length && l.length < N) {
- if (f) {
- let mt = vs(
- /*details*/
- void 0,
- p.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments,
- l.length,
- j,
- W
- );
- return mt = vs(mt, f), wM(r, mt);
- }
- return wM(r, p.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, l.length, j, W);
- } else if (l.length < x) {
- let mt;
- if (f) {
- let sr = vs(
- /*details*/
- void 0,
- ct,
- de,
- l.length
- );
- sr = vs(sr, f), mt = wM(r, sr);
- } else
- mt = wM(r, ct, de, l.length);
- const Gt = (m = Q?.declaration) == null ? void 0 : m.parameters[Q.thisParameter ? l.length + 1 : l.length];
- if (Gt) {
- const sr = As(Gt.name) ? [p.An_argument_matching_this_binding_pattern_was_not_provided] : rg(Gt) ? [p.Arguments_for_the_rest_parameter_0_were_not_provided, Nn(E_(Gt.name))] : [p.An_argument_for_0_was_not_provided, Gt.name ? Nn(E_(Gt.name)) : l.length], Xr = Kr(Gt, ...sr);
- return Rs(mt, Xr);
- }
- return mt;
- } else {
- const mt = A.createNodeArray(l.slice(N)), Gt = xa(mt).pos;
- let sr = _a(mt).end;
- if (sr === Gt && sr++, wd(mt, Gt, sr), f) {
- let Xr = vs(
- /*details*/
- void 0,
- ct,
- de,
- l.length
- );
- return Xr = vs(Xr, f), Uw(Tr(r), mt, Xr);
- }
- return gC(Tr(r), mt, ct, de, l.length);
- }
- }
- function kst(r, a, l, f) {
- const m = l.length;
- if (a.length === 1) {
- const N = a[0], j = Bm(N.typeParameters), W = Nr(N.typeParameters);
- if (f) {
- let Q = vs(
- /*details*/
- void 0,
- p.Expected_0_type_arguments_but_got_1,
- j < W ? j + "-" + W : j,
- m
- );
- return Q = vs(Q, f), Uw(Tr(r), l, Q);
- }
- return gC(Tr(r), l, p.Expected_0_type_arguments_but_got_1, j < W ? j + "-" + W : j, m);
- }
- let y = -1 / 0, x = 1 / 0;
- for (const N of a) {
- const j = Bm(N.typeParameters), W = Nr(N.typeParameters);
- j > m ? x = Math.min(x, j) : W < m && (y = Math.max(y, W));
- }
- if (y !== -1 / 0 && x !== 1 / 0) {
- if (f) {
- let N = vs(
- /*details*/
- void 0,
- p.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments,
- m,
- y,
- x
- );
- return N = vs(N, f), Uw(Tr(r), l, N);
- }
- return gC(Tr(r), l, p.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, m, y, x);
- }
- if (f) {
- let N = vs(
- /*details*/
- void 0,
- p.Expected_0_type_arguments_but_got_1,
- y === -1 / 0 ? x : y,
- m
- );
- return N = vs(N, f), Uw(Tr(r), l, N);
- }
- return gC(Tr(r), l, p.Expected_0_type_arguments_but_got_1, y === -1 / 0 ? x : y, m);
- }
- function SE(r, a, l, f, m, y) {
- const x = r.kind === 215, N = r.kind === 170, j = ou(r), W = r.kind === 226, Q = !P && !l;
- let ye;
- !N && !W && !rS(r) && (ye = r.typeArguments, (x || j || r.expression.kind !== 108) && ir(ye, la));
- const de = l || [];
- gst(a, de, m), E.assert(de.length, "Revert #54442 and add a testcase with whatever triggered this");
- const Ze = D$(r), ct = de.length === 1 && !de[0].typeParameters;
- let mt = !N && !ct && ut(Ze, Kf) ? 4 : 0, Gt, sr, Xr, tn;
- const pr = !!(f & 16) && r.kind === 213 && r.arguments.hasTrailingComma;
- if (de.length > 1 && (tn = gn(de, sh, ct, pr)), tn || (tn = gn(de, lf, ct, pr)), tn)
- return tn;
- if (tn = Cst(r, de, Ze, !!l, f), bn(r).resolvedSignature = tn, Q)
- if (!y && W && (y = p.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method), Gt)
- if (Gt.length === 1 || Gt.length > 3) {
- const Un = Gt[Gt.length - 1];
- let ci;
- Gt.length > 3 && (ci = vs(ci, p.The_last_overload_gave_the_following_error), ci = vs(ci, p.No_overload_matches_this_call)), y && (ci = vs(ci, y));
- const Jn = DM(
- r,
- Ze,
- Un,
- lf,
- 0,
- /*reportErrors*/
- !0,
- () => ci,
- /*inferenceContext*/
- void 0
- );
- if (Jn)
- for (const Us of Jn)
- Un.declaration && Gt.length > 3 && Rs(Us, Kr(Un.declaration, p.The_last_overload_is_declared_here)), er(Un, Us), Da.add(Us);
- else
- E.fail("No error for last overload signature");
- } else {
- const Un = [];
- let ci = 0, Jn = Number.MAX_VALUE, Us = 0, js = 0;
- for (const pc of Gt) {
- const Wr = DM(
- r,
- Ze,
- pc,
- lf,
- 0,
- /*reportErrors*/
- !0,
- () => vs(
- /*details*/
- void 0,
- p.Overload_0_of_1_2_gave_the_following_error,
- js + 1,
- de.length,
- qv(pc)
- ),
- /*inferenceContext*/
- void 0
- );
- Wr ? (Wr.length <= Jn && (Jn = Wr.length, Us = js), ci = Math.max(ci, Wr.length), Un.push(Wr)) : E.fail("No error for 3 or fewer overload signatures"), js++;
- }
- const Oo = ci > 1 ? Un[Us] : Np(Un);
- E.assert(Oo.length > 0, "No errors reported for 3 or fewer overload signatures");
- let ls = vs(
- lr(Oo, hZ),
- p.No_overload_matches_this_call
- );
- y && (ls = vs(ls, y));
- const sc = [...ta(Oo, (pc) => pc.relatedInformation)];
- let Jl;
- if (Mi(Oo, (pc) => pc.start === Oo[0].start && pc.length === Oo[0].length && pc.file === Oo[0].file)) {
- const { file: pc, start: Pr, length: Wr } = Oo[0];
- Jl = { file: pc, start: Pr, length: Wr, code: ls.code, category: ls.category, messageText: ls, relatedInformation: sc };
- } else
- Jl = Rg(Tr(r), Tst(r), ls, sc);
- er(Gt[0], Jl), Da.add(Jl);
- }
- else if (sr)
- Da.add(H8e(r, [sr], Ze, y));
- else if (Xr)
- Ype(
- Xr,
- r.typeArguments,
- /*reportErrors*/
- !0,
- y
- );
- else {
- const Un = Ln(a, (ci) => $pe(ci, ye));
- Un.length === 0 ? Da.add(kst(r, a, ye, y)) : Da.add(H8e(r, Un, Ze, y));
- }
- return tn;
- function er(Un, ci) {
- var Jn, Us;
- const js = Gt, Oo = sr, ls = Xr, sc = ((Us = (Jn = Un.declaration) == null ? void 0 : Jn.symbol) == null ? void 0 : Us.declarations) || Ue, pc = sc.length > 1 ? On(sc, (Pr) => no(Pr) && Mp(Pr.body)) : void 0;
- if (pc) {
- const Pr = Zf(pc), Wr = !Pr.typeParameters;
- gn([Pr], lf, Wr) && Rs(ci, Kr(pc, p.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));
- }
- Gt = js, sr = Oo, Xr = ls;
- }
- function gn(Un, ci, Jn, Us = !1) {
- var js, Oo;
- if (Gt = void 0, sr = void 0, Xr = void 0, Jn) {
- const ls = Un[0];
- if (ut(ye) || !C$(r, Ze, ls, Us))
- return;
- if (DM(
- r,
- Ze,
- ls,
- ci,
- 0,
- /*reportErrors*/
- !1,
- /*containingMessageChain*/
- void 0,
- /*inferenceContext*/
- void 0
- )) {
- Gt = [ls];
- return;
- }
- return ls;
- }
- for (let ls = 0; ls < Un.length; ls++) {
- let sc = Un[ls];
- if (!$pe(sc, ye) || !C$(r, Ze, sc, Us))
- continue;
- let Jl, pc;
- if (sc.typeParameters) {
- const Wr = ((Oo = (js = sc.typeParameters[0].symbol.declarations) == null ? void 0 : js[0]) == null ? void 0 : Oo.parent) || (sc.declaration && Qo(sc.declaration) ? sc.declaration.parent : sc.declaration);
- Wr && or(r, (un) => un === Wr) && (sc = WKe(sc));
- let wi;
- if (ut(ye)) {
- if (wi = Ype(
- sc,
- ye,
- /*reportErrors*/
- !1
- ), !wi) {
- Xr = sc;
- continue;
- }
- } else
- pc = FN(
- sc.typeParameters,
- sc,
- /*flags*/
- cn(r) ? 2 : 0
- /* None */
- ), wi = gh(Xpe(r, sc, Ze, mt | 8, pc), pc.nonFixingMapper), mt |= pc.flags & 4 ? 8 : 0;
- if (Jl = vN(sc, wi, cn(sc.declaration), pc && pc.inferredTypeParameters), VN(sc) && !C$(r, Ze, Jl, Us)) {
- sr = Jl;
- continue;
- }
- } else
- Jl = sc;
- if (DM(
- r,
- Ze,
- Jl,
- ci,
- mt,
- /*reportErrors*/
- !1,
- /*containingMessageChain*/
- void 0,
- pc
- )) {
- (Gt || (Gt = [])).push(Jl);
- continue;
- }
- if (mt) {
- if (mt = 0, pc) {
- const Pr = gh(Xpe(r, sc, Ze, mt, pc), pc.mapper);
- if (Jl = vN(sc, Pr, cn(sc.declaration), pc.inferredTypeParameters), VN(sc) && !C$(r, Ze, Jl, Us)) {
- sr = Jl;
- continue;
- }
- }
- if (DM(
- r,
- Ze,
- Jl,
- ci,
- mt,
- /*reportErrors*/
- !1,
- /*containingMessageChain*/
- void 0,
- pc
- )) {
- (Gt || (Gt = [])).push(Jl);
- continue;
- }
- }
- return Un[ls] = Jl, Jl;
- }
- }
- }
- function Cst(r, a, l, f, m) {
- return E.assert(a.length > 0), Hk(r), f || a.length === 1 || a.some((y) => !!y.typeParameters) ? Pst(r, a, l, m) : Est(a);
- }
- function Est(r) {
- const a = Ai(r, (j) => j.thisParameter);
- let l;
- a.length && (l = G8e(a, a.map(IM)));
- const { min: f, max: m } = tee(r, Dst), y = [];
- for (let j = 0; j < m; j++) {
- const W = Ai(r, (Q) => Su(Q) ? j < Q.parameters.length - 1 ? Q.parameters[j] : _a(Q.parameters) : j < Q.parameters.length ? Q.parameters[j] : void 0);
- E.assert(W.length !== 0), y.push(G8e(W, Ai(r, (Q) => R2(Q, j))));
- }
- const x = Ai(r, (j) => Su(j) ? _a(j.parameters) : void 0);
- let N = 128;
- if (x.length !== 0) {
- const j = du(Qn(
- Ai(r, dwe),
- 2
- /* Subtype */
- ));
- y.push($8e(x, j)), N |= 1;
- }
- return r.some(zye) && (N |= 2), ph(
- r[0].declaration,
- /*typeParameters*/
- void 0,
- // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`.
- l,
- y,
- /*resolvedReturnType*/
- ia(r.map(Ha)),
- /*resolvedTypePredicate*/
- void 0,
- f,
- N
- );
- }
- function Dst(r) {
- const a = r.parameters.length;
- return Su(r) ? a - 1 : a;
- }
- function G8e(r, a) {
- return $8e(r, Qn(
- a,
- 2
- /* Subtype */
- ));
- }
- function $8e(r, a) {
- return yT(xa(r), a);
- }
- function Pst(r, a, l, f) {
- const m = Nst(a, ft === void 0 ? l.length : ft), y = a[m], { typeParameters: x } = y;
- if (!x)
- return y;
- const N = L8e(r) ? r.typeArguments : void 0, j = N ? yG(y, wst(N, x, cn(r))) : Ast(r, x, y, l, f);
- return a[m] = j, j;
- }
- function wst(r, a, l) {
- const f = r.map(Gk);
- for (; f.length > a.length; )
- f.pop();
- for (; f.length < a.length; )
- f.push(C2(a[f.length]) || s_(a[f.length]) || spe(l));
- return f;
- }
- function Ast(r, a, l, f, m) {
- const y = FN(
- a,
- l,
- /*flags*/
- cn(r) ? 2 : 0
- /* None */
- ), x = Xpe(r, l, f, m | 4 | 8, y);
- return yG(l, x);
- }
- function Nst(r, a) {
- let l = -1, f = -1;
- for (let m = 0; m < r.length; m++) {
- const y = r[m], x = W_(y);
- if (Pg(y) || x >= a)
- return m;
- x > f && (f = x, l = m);
- }
- return l;
- }
- function Ist(r, a, l) {
- if (r.expression.kind === 108) {
- const j = _$(r.expression);
- if (Wa(j)) {
- for (const W of r.arguments)
- Gi(W);
- return Ct;
- }
- if (!H(j)) {
- const W = _m(Ol(r));
- if (W) {
- const Q = mi(j, W.typeArguments, W);
- return SE(
- r,
- Q,
- a,
- l,
- 0
- /* None */
- );
- }
- }
- return CT(r);
- }
- let f, m = Gi(r.expression);
- if ($2(r)) {
- const j = NN(m, r.expression);
- f = j === m ? 0 : e4(r) ? 16 : 8, m = j;
- } else
- f = 0;
- if (m = S8e(
- m,
- r.expression,
- Qit
- ), m === en)
- return $n;
- const y = Uu(m);
- if (H(y))
- return Vm(r);
- const x = Ns(
- y,
- 0
- /* Call */
- ), N = Ns(
- y,
- 1
- /* Construct */
- ).length;
- if (AM(m, y, x.length, N))
- return !H(m) && r.typeArguments && je(r, p.Untyped_function_calls_may_not_accept_type_arguments), CT(r);
- if (!x.length) {
- if (N)
- je(r, p.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, Hr(m));
- else {
- let j;
- if (r.arguments.length === 1) {
- const W = Tr(r).text;
- gu(W.charCodeAt(aa(
- W,
- r.expression.end,
- /*stopAfterLineBreak*/
- !0
- ) - 1)) && (j = Kr(r.expression, p.Are_you_missing_a_semicolon));
- }
- Kpe(r.expression, y, 0, j);
- }
- return Vm(r);
- }
- return l & 8 && !r.typeArguments && x.some(Ost) ? (NNe(r, l), zr) : x.some((j) => cn(j.declaration) && !!_j(j.declaration)) ? (je(r, p.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, Hr(m)), Vm(r)) : SE(r, x, a, l, f);
- }
- function Ost(r) {
- return !!(r.typeParameters && $de(Ha(r)));
- }
- function AM(r, a, l, f) {
- return Wa(r) || Wa(a) && !!(r.flags & 262144) || !l && !f && !(a.flags & 1048576) && !(Qd(a).flags & 131072) && $s(r, al);
- }
- function Fst(r, a, l) {
- let f = bE(r.expression);
- if (f === en)
- return $n;
- if (f = Uu(f), H(f))
- return Vm(r);
- if (Wa(f))
- return r.typeArguments && je(r, p.Untyped_function_calls_may_not_accept_type_arguments), CT(r);
- const m = Ns(
- f,
- 1
- /* Construct */
- );
- if (m.length) {
- if (!Lst(r, m[0]))
- return Vm(r);
- if (X8e(m, (N) => !!(N.flags & 4)))
- return je(r, p.Cannot_create_an_instance_of_an_abstract_class), Vm(r);
- const x = f.symbol && Ah(f.symbol);
- return x && Gn(
- x,
- 64
- /* Abstract */
- ) ? (je(r, p.Cannot_create_an_instance_of_an_abstract_class), Vm(r)) : SE(
- r,
- m,
- a,
- l,
- 0
- /* None */
- );
- }
- const y = Ns(
- f,
- 0
- /* Call */
- );
- if (y.length) {
- const x = SE(
- r,
- y,
- a,
- l,
- 0
- /* None */
- );
- return ie || (x.declaration && !qm(x.declaration) && Ha(x) !== Xt && je(r, p.Only_a_void_function_can_be_called_with_the_new_keyword), Xv(x) === Xt && je(r, p.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)), x;
- }
- return Kpe(
- r.expression,
- f,
- 1
- /* Construct */
- ), Vm(r);
- }
- function X8e(r, a) {
- return us(r) ? ut(r, (l) => X8e(l, a)) : r.compositeKind === 1048576 ? ut(r.compositeSignatures, a) : a(r);
- }
- function Zpe(r, a) {
- const l = No(a);
- if (!Nr(l))
- return !1;
- const f = l[0];
- if (f.flags & 2097152) {
- const m = f.types, y = $Pe(m);
- let x = 0;
- for (const N of f.types) {
- if (!y[x] && wn(N) & 3 && (N.symbol === r || Zpe(r, N)))
- return !0;
- x++;
- }
- return !1;
- }
- return f.symbol === r ? !0 : Zpe(r, f);
- }
- function Lst(r, a) {
- if (!a || !a.declaration)
- return !0;
- const l = a.declaration, f = ox(
- l,
- 6
- /* NonPublicAccessibilityModifier */
- );
- if (!f || l.kind !== 176)
- return !0;
- const m = Ah(l.parent.symbol), y = bo(l.parent.symbol);
- if (!Ude(r, m)) {
- const x = Ol(r);
- if (x && f & 4) {
- const N = Gk(x);
- if (Zpe(l.parent.symbol, N))
- return !0;
- }
- return f & 2 && je(r, p.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, Hr(y)), f & 4 && je(r, p.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, Hr(y)), !1;
- }
- return !0;
- }
- function Q8e(r, a, l) {
- let f;
- const m = l === 0, y = qk(a), x = y && Ns(y, l).length > 0;
- if (a.flags & 1048576) {
- const j = a.types;
- let W = !1;
- for (const Q of j)
- if (Ns(Q, l).length !== 0) {
- if (W = !0, f)
- break;
- } else if (f || (f = vs(
- f,
- m ? p.Type_0_has_no_call_signatures : p.Type_0_has_no_construct_signatures,
- Hr(Q)
- ), f = vs(
- f,
- m ? p.Not_all_constituents_of_type_0_are_callable : p.Not_all_constituents_of_type_0_are_constructable,
- Hr(a)
- )), W)
- break;
- W || (f = vs(
- /*details*/
- void 0,
- m ? p.No_constituent_of_type_0_is_callable : p.No_constituent_of_type_0_is_constructable,
- Hr(a)
- )), f || (f = vs(
- f,
- m ? p.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other : p.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,
- Hr(a)
- ));
- } else
- f = vs(
- f,
- m ? p.Type_0_has_no_call_signatures : p.Type_0_has_no_construct_signatures,
- Hr(a)
- );
- let N = m ? p.This_expression_is_not_callable : p.This_expression_is_not_constructable;
- if (Fs(r.parent) && r.parent.arguments.length === 0) {
- const { resolvedSymbol: j } = bn(r);
- j && j.flags & 32768 && (N = p.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without);
- }
- return {
- messageChain: vs(f, N),
- relatedMessage: x ? p.Did_you_forget_to_use_await : void 0
- };
- }
- function Kpe(r, a, l, f) {
- const { messageChain: m, relatedMessage: y } = Q8e(r, a, l), x = Rg(Tr(r), r, m);
- if (y && Rs(x, Kr(r, y)), Fs(r.parent)) {
- const { start: N, length: j } = q8e(r.parent);
- x.start = N, x.length = j;
- }
- Da.add(x), Y8e(a, l, f ? Rs(x, f) : x);
- }
- function Y8e(r, a, l) {
- if (!r.symbol)
- return;
- const f = Bi(r.symbol).originatingImport;
- if (f && !hf(f)) {
- const m = Ns(nn(Bi(r.symbol).target), a);
- if (!m || !m.length) return;
- Rs(l, Kr(f, p.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));
- }
- }
- function Mst(r, a, l) {
- const f = Gi(r.tag), m = Uu(f);
- if (H(m))
- return Vm(r);
- const y = Ns(
- m,
- 0
- /* Call */
- ), x = Ns(
- m,
- 1
- /* Construct */
- ).length;
- if (AM(f, m, y.length, x))
- return CT(r);
- if (!y.length) {
- if ($l(r.parent)) {
- const N = Kr(r.tag, p.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);
- return Da.add(N), Vm(r);
- }
- return Kpe(
- r.tag,
- m,
- 0
- /* Call */
- ), Vm(r);
- }
- return SE(
- r,
- y,
- a,
- l,
- 0
- /* None */
- );
- }
- function Rst(r) {
- switch (r.parent.kind) {
- case 263:
- case 231:
- return p.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 169:
- return p.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 172:
- return p.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 174:
- case 177:
- case 178:
- return p.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
- default:
- return E.fail();
- }
- }
- function jst(r, a, l) {
- const f = Gi(r.expression), m = Uu(f);
- if (H(m))
- return Vm(r);
- const y = Ns(
- m,
- 0
- /* Call */
- ), x = Ns(
- m,
- 1
- /* Construct */
- ).length;
- if (AM(f, m, y.length, x))
- return CT(r);
- if (zst(r, y) && !Yu(r.expression)) {
- const j = nc(
- r.expression,
- /*includeTrivia*/
- !1
- );
- return je(r, p._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, j), Vm(r);
- }
- const N = Rst(r);
- if (!y.length) {
- const j = Q8e(
- r.expression,
- m,
- 0
- /* Call */
- ), W = vs(j.messageChain, N), Q = Rg(Tr(r.expression), r.expression, W);
- return j.relatedMessage && Rs(Q, Kr(r.expression, j.relatedMessage)), Da.add(Q), Y8e(m, 0, Q), Vm(r);
- }
- return SE(r, y, a, l, 0, N);
- }
- function P$(r, a) {
- const l = kT(r), f = l && n_(l), m = f && Al(
- f,
- jf.Element,
- 788968
- /* Type */
- ), y = m && me.symbolToEntityName(m, 788968, r), x = A.createFunctionTypeNode(
- /*typeParameters*/
- void 0,
- [A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "props",
- /*questionToken*/
- void 0,
- me.typeToTypeNode(a, r)
- )],
- y ? A.createTypeReferenceNode(
- y,
- /*typeArguments*/
- void 0
- ) : A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- ), N = fa(1, "props");
- return N.links.type = a, ph(
- x,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [N],
- m ? bo(m) : He,
- /*resolvedTypePredicate*/
- void 0,
- 1,
- 0
- /* None */
- );
- }
- function Bst(r, a, l) {
- if (Vk(r.tagName)) {
- const x = m8e(r), N = P$(r, x);
- return w1(xE(
- r.attributes,
- g$(N, r),
- /*inferenceContext*/
- void 0,
- 0
- /* Normal */
- ), x, r.tagName, r.attributes), Nr(r.typeArguments) && (ir(r.typeArguments, la), Da.add(gC(Tr(r), r.typeArguments, p.Expected_0_type_arguments_but_got_1, 0, Nr(r.typeArguments)))), N;
- }
- const f = Gi(r.tagName), m = Uu(f);
- if (H(m))
- return Vm(r);
- const y = p8e(f, r);
- return AM(
- f,
- m,
- y.length,
- /*constructSignatures*/
- 0
- ) ? CT(r) : y.length === 0 ? (je(r.tagName, p.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, nc(r.tagName)), Vm(r)) : SE(
- r,
- y,
- a,
- l,
- 0
- /* None */
- );
- }
- function Jst(r, a, l) {
- const f = Gi(r.right);
- if (!Wa(f)) {
- const m = mde(f);
- if (m) {
- const y = Uu(m);
- if (H(y))
- return Vm(r);
- const x = Ns(
- y,
- 0
- /* Call */
- ), N = Ns(
- y,
- 1
- /* Construct */
- );
- if (AM(m, y, x.length, N.length))
- return CT(r);
- if (x.length)
- return SE(
- r,
- x,
- a,
- l,
- 0
- /* None */
- );
- } else if (!(K$(f) || O2(f, al)))
- return je(r.right, p.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method), Vm(r);
- }
- return Ct;
- }
- function zst(r, a) {
- return a.length && Mi(a, (l) => l.minArgumentCount === 0 && !Su(l) && l.parameters.length < V8e(r, l));
- }
- function Wst(r, a, l) {
- switch (r.kind) {
- case 213:
- return Ist(r, a, l);
- case 214:
- return Fst(r, a, l);
- case 215:
- return Mst(r, a, l);
- case 170:
- return jst(r, a, l);
- case 286:
- case 285:
- return Bst(r, a, l);
- case 226:
- return Jst(r, a, l);
- }
- E.assertNever(r, "Branch in 'resolveSignature' should be unreachable.");
- }
- function TE(r, a, l) {
- const f = bn(r), m = f.resolvedSignature;
- if (m && m !== zr && !a)
- return m;
- const y = Dn;
- m || (Dn = fr.length), f.resolvedSignature = zr;
- let x = Wst(
- r,
- a,
- l || 0
- /* Normal */
- );
- return Dn = y, x !== zr && (f.resolvedSignature !== zr && (x = f.resolvedSignature), f.resolvedSignature = th === Yp ? x : m), x;
- }
- function qm(r) {
- var a;
- if (!r || !cn(r))
- return !1;
- const l = Ec(r) || vo(r) ? r : (ii(r) || Qc(r)) && r.initializer && vo(r.initializer) ? r.initializer : void 0;
- if (l) {
- if (_j(r)) return !0;
- if (Qc(ag(l.parent))) return !1;
- const f = Tn(l);
- return !!((a = f?.members) != null && a.size);
- }
- return !1;
- }
- function ede(r, a) {
- var l, f;
- if (a) {
- const m = Bi(a);
- if (!m.inferredClassSymbol || !m.inferredClassSymbol.has(na(r))) {
- const y = Lg(r) ? r : ah(r);
- return y.exports = y.exports || Js(), y.members = y.members || Js(), y.flags |= a.flags & 32, (l = a.exports) != null && l.size && rd(y.exports, a.exports), (f = a.members) != null && f.size && rd(y.members, a.members), (m.inferredClassSymbol || (m.inferredClassSymbol = /* @__PURE__ */ new Map())).set(na(y), y), y;
- }
- return m.inferredClassSymbol.get(na(r));
- }
- }
- function Ust(r) {
- var a;
- const l = r && w$(
- r,
- /*allowDeclaration*/
- !0
- ), f = (a = l?.exports) == null ? void 0 : a.get("prototype"), m = f?.valueDeclaration && Vst(f.valueDeclaration);
- return m ? Tn(m) : void 0;
- }
- function w$(r, a) {
- if (!r.parent)
- return;
- let l, f;
- if (ii(r.parent) && r.parent.initializer === r) {
- if (!cn(r) && !(sI(r.parent) && no(r)))
- return;
- l = r.parent.name, f = r.parent;
- } else if (dn(r.parent)) {
- const m = r.parent, y = r.parent.operatorToken.kind;
- if (y === 64 && (a || m.right === r))
- l = m.left, f = l;
- else if ((y === 57 || y === 61) && (ii(m.parent) && m.parent.initializer === m ? (l = m.parent.name, f = m.parent) : dn(m.parent) && m.parent.operatorToken.kind === 64 && (a || m.parent.right === m) && (l = m.parent.left, f = l), !l || !aS(l) || !TC(l, m.left)))
- return;
- } else a && Ec(r) && (l = r.name, f = r);
- if (!(!f || !l || !a && !K1(r, Ry(l))))
- return i_(f);
- }
- function Vst(r) {
- if (!r.parent)
- return !1;
- let a = r.parent;
- for (; a && a.kind === 211; )
- a = a.parent;
- if (a && dn(a) && Ry(a.left) && a.operatorToken.kind === 64) {
- const l = oB(a);
- return Ks(l) && l;
- }
- }
- function qst(r, a) {
- var l, f, m;
- YM(r, r.typeArguments);
- const y = TE(
- r,
- /*candidatesOutArray*/
- void 0,
- a
- );
- if (y === zr)
- return en;
- if (A$(y, r), r.expression.kind === 108)
- return Xt;
- if (r.kind === 214) {
- const N = y.declaration;
- if (N && N.kind !== 176 && N.kind !== 180 && N.kind !== 185 && !(Lh(N) && ((f = (l = EC(N)) == null ? void 0 : l.parent) == null ? void 0 : f.kind) === 176) && !CC(N) && !qm(N))
- return ie && je(r, p.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type), xe;
- }
- if (cn(r) && tNe(r))
- return fwe(r.arguments[0]);
- const x = Ha(y);
- if (x.flags & 12288 && Z8e(r))
- return kfe(ag(r.parent));
- if (r.kind === 213 && !r.questionDotToken && r.parent.kind === 244 && x.flags & 16384 && Cp(y)) {
- if (!w3(r.expression))
- je(r.expression, p.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);
- else if (!fM(r)) {
- const N = je(r.expression, p.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);
- _M(r.expression, N);
- }
- }
- if (cn(r)) {
- const N = w$(
- r,
- /*allowDeclaration*/
- !1
- );
- if ((m = N?.exports) != null && m.size) {
- const j = Li(N, N.exports, Ue, Ue, Ue);
- return j.objectFlags |= 4096, ia([x, j]);
- }
- }
- return x;
- }
- function A$(r, a) {
- if (!(r.flags & 128) && r.declaration && r.declaration.flags & 536870912) {
- const l = NM(a), f = N3(x7(a));
- dk(l, r.declaration, f, qv(r));
- }
- }
- function NM(r) {
- switch (r = Ba(r), r.kind) {
- case 213:
- case 170:
- case 214:
- return NM(r.expression);
- case 215:
- return NM(r.tag);
- case 286:
- case 285:
- return NM(r.tagName);
- case 212:
- return r.argumentExpression;
- case 211:
- return r.name;
- case 183:
- const a = r;
- return Xu(a.typeName) ? a.typeName.right : a;
- default:
- return r;
- }
- }
- function Z8e(r) {
- if (!Fs(r)) return !1;
- let a = r.expression;
- if (Cn(a) && a.name.escapedText === "for" && (a = a.expression), !Oe(a) || a.escapedText !== "Symbol")
- return !1;
- const l = Owe(
- /*reportErrors*/
- !1
- );
- return l ? l === Nt(
- a,
- "Symbol",
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- ) : !1;
- }
- function Hst(r) {
- if (f_t(r), r.arguments.length === 0)
- return MM(r, xe);
- const a = r.arguments[0], l = wc(a), f = r.arguments.length > 1 ? wc(r.arguments[1]) : void 0;
- for (let y = 2; y < r.arguments.length; ++y)
- wc(r.arguments[y]);
- if ((l.flags & 32768 || l.flags & 65536 || !$s(l, Ie)) && je(a, p.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, Hr(l)), f) {
- const y = Iwe(
- /*reportErrors*/
- !0
- );
- y !== xs && Au(f, sM(
- y,
- 32768
- /* Undefined */
- ), r.arguments[1]);
- }
- const m = v_(r, a);
- if (m) {
- const y = m1(
- m,
- a,
- /*dontResolveAlias*/
- !0,
- /*suppressInteropError*/
- !1
- );
- if (y)
- return MM(
- r,
- K8e(nn(y), y, m, a) || eNe(nn(y), y, m, a)
- );
- }
- return MM(r, xe);
- }
- function tde(r, a, l) {
- const f = Js(), m = fa(
- 2097152,
- "default"
- /* Default */
- );
- return m.parent = a, m.links.nameType = S_("default"), m.links.aliasTarget = Mc(r), f.set("default", m), Li(l, f, Ue, Ue, Ue);
- }
- function K8e(r, a, l, f) {
- if (Y0(f) && r && !H(r)) {
- const y = r;
- if (!y.defaultOnlyType) {
- const x = tde(a, l);
- y.defaultOnlyType = x;
- }
- return y.defaultOnlyType;
- }
- }
- function eNe(r, a, l, f) {
- var m;
- if (ae && r && !H(r)) {
- const y = r;
- if (!y.syntheticType) {
- const x = (m = l.declarations) == null ? void 0 : m.find(Si);
- if (_2(
- x,
- l,
- /*dontResolveAlias*/
- !1,
- f
- )) {
- const j = fa(
- 2048,
- "__type"
- /* Type */
- ), W = tde(a, l, j);
- j.links.type = W, y.syntheticType = bM(r) ? w2(
- r,
- W,
- j,
- /*objectFlags*/
- 0,
- /*readonly*/
- !1
- ) : W;
- } else
- y.syntheticType = r;
- }
- return y.syntheticType;
- }
- return r;
- }
- function tNe(r) {
- if (!f_(
- r,
- /*requireStringLiteralLikeArgument*/
- !0
- ))
- return !1;
- if (!Oe(r.expression)) return E.fail();
- const a = Nt(
- r.expression,
- r.expression.escapedText,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- if (a === Qe)
- return !0;
- if (a.flags & 2097152)
- return !1;
- const l = a.flags & 16 ? 262 : a.flags & 3 ? 260 : 0;
- if (l !== 0) {
- const f = Jo(a, l);
- return !!f && !!(f.flags & 33554432);
- }
- return !1;
- }
- function Gst(r) {
- But(r) || YM(r, r.typeArguments), B < 2 && bl(
- r,
- 262144
- /* MakeTemplateObject */
- );
- const a = TE(r);
- return A$(a, r), Ha(a);
- }
- function $st(r, a) {
- if (r.kind === 216) {
- const l = Tr(r);
- l && xc(l.fileName, [
- ".cts",
- ".mts"
- /* Mts */
- ]) && dr(r, p.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
- }
- return rNe(r, a);
- }
- function rde(r) {
- switch (r.kind) {
- case 11:
- case 15:
- case 9:
- case 10:
- case 112:
- case 97:
- case 209:
- case 210:
- case 228:
- return !0;
- case 217:
- return rde(r.expression);
- case 224:
- const a = r.operator, l = r.operand;
- return a === 41 && (l.kind === 9 || l.kind === 10) || a === 40 && l.kind === 9;
- case 211:
- case 212:
- const f = Ba(r.expression), m = yo(f) ? Yo(
- f,
- 111551,
- /*ignoreErrors*/
- !0
- ) : void 0;
- return !!(m && m.flags & 384);
- }
- return !1;
- }
- function rNe(r, a) {
- const { type: l, expression: f } = nNe(r), m = Gi(f, a);
- if (xd(l))
- return rde(f) || je(f, p.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals), Vu(m);
- const y = bn(r);
- return y.assertionExpressionType = m, la(l), Hk(r), Ci(l);
- }
- function nNe(r) {
- let a, l;
- switch (r.kind) {
- case 234:
- case 216:
- a = r.type, l = r.expression;
- break;
- case 217:
- a = mD(r), l = r.expression;
- break;
- }
- return { type: a, expression: l };
- }
- function Xst(r) {
- const { type: a } = nNe(r), l = Yu(r) ? a : r, f = bn(r);
- E.assertIsDefined(f.assertionExpressionType);
- const m = ON(o0(f.assertionExpressionType)), y = Ci(a);
- H(y) || n(() => {
- const x = J_(m);
- MG(y, x) || I3e(m, y, l, p.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);
- });
- }
- function Qst(r) {
- const a = Gi(r.expression), l = NN(a, r.expression);
- return $G(c0(l), r, l !== a);
- }
- function Yst(r) {
- return r.flags & 64 ? Qst(r) : c0(Gi(r.expression));
- }
- function iNe(r) {
- if (YIe(r), ir(r.typeArguments, la), r.kind === 233) {
- const l = ag(r.parent);
- l.kind === 226 && l.operatorToken.kind === 104 && kb(r, l.right) && je(r, p.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression);
- }
- const a = r.kind === 233 ? Gi(r.expression) : Ly(r.exprName) ? hM(r.exprName) : Gi(r.exprName);
- return sNe(a, r);
- }
- function sNe(r, a) {
- const l = a.typeArguments;
- if (r === en || H(r) || !ut(l))
- return r;
- let f = !1, m;
- const y = N(r), x = f ? m : r;
- return x && Da.add(gC(Tr(a), l, p.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, Hr(x))), y;
- function N(W) {
- let Q = !1, ye = !1;
- const de = Ze(W);
- return f || (f = ye), Q && !ye && (m ?? (m = W)), de;
- function Ze(ct) {
- if (ct.flags & 524288) {
- const mt = Xd(ct), Gt = j(mt.callSignatures), sr = j(mt.constructSignatures);
- if (Q || (Q = mt.callSignatures.length !== 0 || mt.constructSignatures.length !== 0), ye || (ye = Gt.length !== 0 || sr.length !== 0), Gt !== mt.callSignatures || sr !== mt.constructSignatures) {
- const Xr = Li(fa(
- 0,
- "__instantiationExpression"
- /* InstantiationExpression */
- ), mt.members, Gt, sr, mt.indexInfos);
- return Xr.objectFlags |= 8388608, Xr.node = a, Xr;
- }
- } else if (ct.flags & 58982400) {
- const mt = Kl(ct);
- if (mt) {
- const Gt = Ze(mt);
- if (Gt !== mt)
- return Gt;
- }
- } else {
- if (ct.flags & 1048576)
- return Xo(ct, N);
- if (ct.flags & 2097152)
- return ia(qc(ct.types, Ze));
- }
- return ct;
- }
- }
- function j(W) {
- const Q = Ln(W, (ye) => !!ye.typeParameters && $pe(ye, l));
- return qc(Q, (ye) => {
- const de = Ype(
- ye,
- l,
- /*reportErrors*/
- !0
- );
- return de ? vN(ye, de, cn(ye.declaration)) : ye;
- });
- }
- }
- function Zst(r) {
- return la(r.type), nde(r.expression, r.type);
- }
- function nde(r, a, l) {
- const f = Gi(r, l), m = Ci(a);
- if (H(m))
- return m;
- const y = or(
- a.parent,
- (x) => x.kind === 238 || x.kind === 350
- /* JSDocSatisfiesTag */
- );
- return w1(f, m, y, r, p.Type_0_does_not_satisfy_the_expected_type_1), f;
- }
- function Kst(r) {
- return t_t(r), r.keywordToken === 105 ? ide(r) : r.keywordToken === 102 ? eat(r) : E.assertNever(r.keywordToken);
- }
- function aNe(r) {
- switch (r.keywordToken) {
- case 102:
- return Nwe();
- case 105:
- const a = ide(r);
- return H(a) ? He : hat(a);
- default:
- E.assertNever(r.keywordToken);
- }
- }
- function ide(r) {
- const a = FZ(r);
- if (a)
- if (a.kind === 176) {
- const l = Tn(a.parent);
- return nn(l);
- } else {
- const l = Tn(a);
- return nn(l);
- }
- else return je(r, p.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"), He;
- }
- function eat(r) {
- z === 100 || z === 199 ? Tr(r).impliedNodeFormat !== 99 && je(r, p.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output) : z < 6 && z !== 4 && je(r, p.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
- const a = Tr(r);
- return E.assert(!!(a.flags & 8388608), "Containing file is missing import meta node flag."), r.name.escapedText === "meta" ? Awe() : He;
- }
- function IM(r) {
- const a = r.valueDeclaration;
- return cl(
- nn(r),
- /*isProperty*/
- !1,
- /*isOptional*/
- !!a && (m0(a) || WC(a))
- );
- }
- function sde(r, a, l) {
- switch (r.name.kind) {
- case 80: {
- const f = r.name.escapedText;
- return r.dotDotDotToken ? l & 12 ? f : `${f}_${a}` : l & 3 ? f : `${f}_n`;
- }
- case 207: {
- if (r.dotDotDotToken) {
- const f = r.name.elements, m = Wn(Ro(f), va), y = f.length - (m?.dotDotDotToken ? 1 : 0);
- if (a < y) {
- const x = f[a];
- if (va(x))
- return sde(x, a, l);
- } else if (m?.dotDotDotToken)
- return sde(m, a - y, l);
- }
- break;
- }
- }
- return `arg_${a}`;
- }
- function ade(r, a = 0, l = 3, f) {
- if (!r) {
- const m = Wn(f?.valueDeclaration, Ii);
- return m ? sde(m, a, l) : `${f?.escapedName ?? "arg"}_${a}`;
- }
- return E.assert(Oe(r.name)), r.name.escapedText;
- }
- function jP(r, a, l) {
- var f;
- const m = r.parameters.length - (Su(r) ? 1 : 0);
- if (a < m)
- return r.parameters[a].escapedName;
- const y = r.parameters[m] || ze, x = l || nn(y);
- if (ha(x)) {
- const N = x.target, j = a - m, W = (f = N.labeledElementDeclarations) == null ? void 0 : f[j], Q = N.elementFlags[j];
- return ade(W, j, Q, y);
- }
- return y.escapedName;
- }
- function tat(r, a) {
- var l;
- if (((l = r.declaration) == null ? void 0 : l.kind) === 317)
- return;
- const f = r.parameters.length - (Su(r) ? 1 : 0);
- if (a < f) {
- const N = r.parameters[a], j = oNe(N);
- return j ? {
- parameter: j,
- parameterName: N.escapedName,
- isRestParameter: !1
- } : void 0;
- }
- const m = r.parameters[f] || ze, y = oNe(m);
- if (!y)
- return;
- const x = nn(m);
- if (ha(x)) {
- const N = x.target.labeledElementDeclarations, j = a - f, W = N?.[j], Q = !!W?.dotDotDotToken;
- return W ? (E.assert(Oe(W.name)), { parameter: W.name, parameterName: W.name.escapedText, isRestParameter: Q }) : void 0;
- }
- if (a === f)
- return { parameter: y, parameterName: m.escapedName, isRestParameter: !0 };
- }
- function oNe(r) {
- return r.valueDeclaration && Ii(r.valueDeclaration) && Oe(r.valueDeclaration.name) && r.valueDeclaration.name;
- }
- function cNe(r) {
- return r.kind === 202 || Ii(r) && r.name && Oe(r.name);
- }
- function rat(r, a) {
- const l = r.parameters.length - (Su(r) ? 1 : 0);
- if (a < l) {
- const y = r.parameters[a].valueDeclaration;
- return y && cNe(y) ? y : void 0;
- }
- const f = r.parameters[l] || ze, m = nn(f);
- if (ha(m)) {
- const y = m.target.labeledElementDeclarations, x = a - l;
- return y && y[x];
- }
- return f.valueDeclaration && cNe(f.valueDeclaration) ? f.valueDeclaration : void 0;
- }
- function Kd(r, a) {
- return R2(r, a) || xe;
- }
- function R2(r, a) {
- const l = r.parameters.length - (Su(r) ? 1 : 0);
- if (a < l)
- return IM(r.parameters[a]);
- if (Su(r)) {
- const f = nn(r.parameters[l]), m = a - l;
- if (!ha(f) || f.target.combinedFlags & 12 || m < f.target.fixedLength)
- return j_(f, bd(m));
- }
- }
- function OM(r, a, l) {
- const f = W_(r), m = Hm(r), y = UN(r);
- if (y && a >= f - 1)
- return a === f - 1 ? y : du(j_(y, At));
- const x = [], N = [], j = [];
- for (let W = a; W < f; W++)
- !y || W < f - 1 ? (x.push(Kd(r, W)), N.push(
- W < m ? 1 : 2
- /* Optional */
- )) : (x.push(y), N.push(
- 8
- /* Variadic */
- )), j.push(rat(r, W));
- return Eg(x, N, l, j);
- }
- function lNe(r, a) {
- const l = OM(r, a), f = l && iM(l);
- return f && Wa(f) ? xe : l;
- }
- function W_(r) {
- const a = r.parameters.length;
- if (Su(r)) {
- const l = nn(r.parameters[a - 1]);
- if (ha(l))
- return a + l.target.fixedLength - (l.target.combinedFlags & 12 ? 0 : 1);
- }
- return a;
- }
- function Hm(r, a) {
- const l = a & 1, f = a & 2;
- if (f || r.resolvedMinArgumentCount === void 0) {
- let m;
- if (Su(r)) {
- const y = nn(r.parameters[r.parameters.length - 1]);
- if (ha(y)) {
- const x = ac(y.target.elementFlags, (j) => !(j & 1)), N = x < 0 ? y.target.fixedLength : x;
- N > 0 && (m = r.parameters.length - 1 + N);
- }
- }
- if (m === void 0) {
- if (!l && r.flags & 32)
- return 0;
- m = r.minArgumentCount;
- }
- if (f)
- return m;
- for (let y = m - 1; y >= 0; y--) {
- const x = Kd(r, y);
- if (Vc(x, M8e).flags & 131072)
- break;
- m = y;
- }
- r.resolvedMinArgumentCount = m;
- }
- return r.resolvedMinArgumentCount;
- }
- function Pg(r) {
- if (Su(r)) {
- const a = nn(r.parameters[r.parameters.length - 1]);
- return !ha(a) || !!(a.target.combinedFlags & 12);
- }
- return !1;
- }
- function UN(r) {
- if (Su(r)) {
- const a = nn(r.parameters[r.parameters.length - 1]);
- if (!ha(a))
- return Wa(a) ? so : a;
- if (a.target.combinedFlags & 12)
- return NP(a, a.target.fixedLength);
- }
- }
- function VN(r) {
- const a = UN(r);
- return a && !Dp(a) && !Wa(a) ? a : void 0;
- }
- function ode(r) {
- return cde(r, Ht);
- }
- function cde(r, a) {
- return r.parameters.length > 0 ? Kd(r, 0) : a;
- }
- function uNe(r, a, l) {
- const f = r.parameters.length - (Su(r) ? 1 : 0);
- for (let m = 0; m < f; m++) {
- const y = r.parameters[m].valueDeclaration, x = Gc(y);
- if (x) {
- const N = cl(
- Ci(x),
- /*isProperty*/
- !1,
- WC(y)
- ), j = Kd(a, m);
- u0(l.inferences, N, j);
- }
- }
- }
- function nat(r, a) {
- if (a.typeParameters)
- if (!r.typeParameters)
- r.typeParameters = a.typeParameters;
- else
- return;
- if (a.thisParameter) {
- const f = r.thisParameter;
- (!f || f.valueDeclaration && !f.valueDeclaration.type) && (f || (r.thisParameter = yT(
- a.thisParameter,
- /*type*/
- void 0
- )), FM(r.thisParameter, nn(a.thisParameter)));
- }
- const l = r.parameters.length - (Su(r) ? 1 : 0);
- for (let f = 0; f < l; f++) {
- const m = r.parameters[f], y = m.valueDeclaration;
- if (!Gc(y)) {
- let x = R2(a, f);
- if (x && y.initializer) {
- let N = BP(
- y,
- 0
- /* Normal */
- );
- !$s(N, x) && $s(x, N = yde(y, N)) && (x = N);
- }
- FM(m, x);
- }
- }
- if (Su(r)) {
- const f = _a(r.parameters);
- if (f.valueDeclaration ? !Gc(f.valueDeclaration) : gc(f) & 65536) {
- const m = OM(a, l);
- FM(f, m);
- }
- }
- }
- function iat(r) {
- r.thisParameter && FM(r.thisParameter);
- for (const a of r.parameters)
- FM(a);
- }
- function FM(r, a) {
- const l = Bi(r);
- if (l.type)
- a && E.assertEqual(l.type, a, "Parameter symbol already has a cached type which differs from newly assigned type");
- else {
- const f = r.valueDeclaration;
- l.type = cl(
- a || (f ? pn(
- f,
- /*reportErrors*/
- !0
- ) : nn(r)),
- /*isProperty*/
- !1,
- /*isOptional*/
- !!f && !f.initializer && WC(f)
- ), f && f.name.kind !== 80 && (l.type === M && (l.type = Lt(f.name)), _Ne(f.name, l.type));
- }
- }
- function _Ne(r, a) {
- for (const l of r.elements)
- if (!ml(l)) {
- const f = Ka(
- l,
- a,
- /*noTupleBoundsCheck*/
- !1
- );
- l.name.kind === 80 ? Bi(Tn(l)).type = f : _Ne(l.name, f);
- }
- }
- function sat(r) {
- return uE(met(
- /*reportErrors*/
- !0
- ), [r]);
- }
- function aat(r, a) {
- return uE(get(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function oat(r, a) {
- return uE(het(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function cat(r, a) {
- return uE(yet(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function lat(r, a) {
- return uE(vet(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function uat(r, a) {
- return uE(xet(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function _at(r, a, l) {
- const f = `${a ? "p" : "P"}${l ? "s" : "S"}${r.id}`;
- let m = rr.get(f);
- if (!m) {
- const y = Js();
- y.set("name", H0("name", r)), y.set("private", H0("private", a ? nt : yr)), y.set("static", H0("static", l ? nt : yr)), m = Li(
- /*symbol*/
- void 0,
- y,
- Ue,
- Ue,
- Ue
- ), rr.set(f, m);
- }
- return m;
- }
- function fNe(r, a, l) {
- const f = tl(r), m = Di(r.name), y = m ? S_(Nn(r.name)) : i0(r.name), x = hc(r) ? aat(a, l) : Lf(r) ? oat(a, l) : K_(r) ? cat(a, l) : u_(r) ? lat(a, l) : cs(r) ? uat(a, l) : E.failBadSyntaxKind(r), N = _at(y, m, f);
- return ia([x, N]);
- }
- function fat(r, a) {
- return uE(bet(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function pat(r, a) {
- return uE(Tet(
- /*reportErrors*/
- !0
- ), [r, a]);
- }
- function dat(r, a) {
- const l = gd("this", r), f = gd("value", a);
- return Cde(
- /*typeParameters*/
- void 0,
- l,
- [f],
- a,
- /*typePredicate*/
- void 0,
- 1
- );
- }
- function lde(r, a, l) {
- const f = gd("target", r), m = gd("context", a), y = Qn([l, Xt]);
- return ZN(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [f, m],
- y
- );
- }
- function mat(r) {
- const { parent: a } = r, l = bn(a);
- if (!l.decoratorSignature)
- switch (l.decoratorSignature = Ct, a.kind) {
- case 263:
- case 231: {
- const m = nn(Tn(a)), y = sat(m);
- l.decoratorSignature = lde(m, y, m);
- break;
- }
- case 174:
- case 177:
- case 178: {
- const f = a;
- if (!Zn(f.parent)) break;
- const m = hc(f) ? _T(Zf(f)) : Gk(f), y = tl(f) ? nn(Tn(f.parent)) : b_(Tn(f.parent)), x = Lf(f) ? qNe(m) : K_(f) ? HNe(m) : m, N = fNe(f, y, m), j = Lf(f) ? qNe(m) : K_(f) ? HNe(m) : m;
- l.decoratorSignature = lde(x, N, j);
- break;
- }
- case 172: {
- const f = a;
- if (!Zn(f.parent)) break;
- const m = Gk(f), y = tl(f) ? nn(Tn(f.parent)) : b_(Tn(f.parent)), x = dm(f) ? fat(y, m) : Ae, N = fNe(f, y, m), j = dm(f) ? pat(y, m) : dat(y, m);
- l.decoratorSignature = lde(x, N, j);
- break;
- }
- }
- return l.decoratorSignature === Ct ? void 0 : l.decoratorSignature;
- }
- function gat(r) {
- const { parent: a } = r, l = bn(a);
- if (!l.decoratorSignature)
- switch (l.decoratorSignature = Ct, a.kind) {
- case 263:
- case 231: {
- const m = nn(Tn(a)), y = gd("target", m);
- l.decoratorSignature = ZN(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [y],
- Qn([m, Xt])
- );
- break;
- }
- case 169: {
- const f = a;
- if (!Qo(f.parent) && !(hc(f.parent) || K_(f.parent) && Zn(f.parent.parent)) || Eb(f.parent) === f)
- break;
- const m = Eb(f.parent) ? f.parent.parameters.indexOf(f) - 1 : f.parent.parameters.indexOf(f);
- E.assert(m >= 0);
- const y = Qo(f.parent) ? nn(Tn(f.parent.parent)) : RIe(f.parent), x = Qo(f.parent) ? Ae : jIe(f.parent), N = bd(m), j = gd("target", y), W = gd("propertyKey", x), Q = gd("parameterIndex", N);
- l.decoratorSignature = ZN(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [j, W, Q],
- Xt
- );
- break;
- }
- case 174:
- case 177:
- case 178:
- case 172: {
- const f = a;
- if (!Zn(f.parent)) break;
- const m = RIe(f), y = gd("target", m), x = jIe(f), N = gd("propertyKey", x), j = cs(f) ? Xt : Jwe(Gk(f));
- if (!cs(a) || dm(a)) {
- const Q = Jwe(Gk(f)), ye = gd("descriptor", Q);
- l.decoratorSignature = ZN(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [y, N, ye],
- Qn([j, Xt])
- );
- } else
- l.decoratorSignature = ZN(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [y, N],
- Qn([j, Xt])
- );
- break;
- }
- }
- return l.decoratorSignature === Ct ? void 0 : l.decoratorSignature;
- }
- function ude(r) {
- return X ? gat(r) : mat(r);
- }
- function LM(r) {
- const a = JL(
- /*reportErrors*/
- !0
- );
- return a !== Vi ? (r = ly(UP(r)) || M, n0(a, [r])) : M;
- }
- function pNe(r) {
- const a = Lwe(
- /*reportErrors*/
- !0
- );
- return a !== Vi ? (r = ly(UP(r)) || M, n0(a, [r])) : M;
- }
- function MM(r, a) {
- const l = LM(a);
- return l === M ? (je(
- r,
- hf(r) ? p.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : p.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option
- ), He) : (nfe(
- /*reportErrors*/
- !0
- ) || je(
- r,
- hf(r) ? p.A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : p.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option
- ), l);
- }
- function hat(r) {
- const a = fa(0, "NewTargetExpression"), l = fa(
- 4,
- "target",
- 8
- /* Readonly */
- );
- l.parent = a, l.links.type = r;
- const f = Js([l]);
- return a.members = f, Li(a, f, Ue, Ue, Ue);
- }
- function N$(r, a) {
- if (!r.body)
- return He;
- const l = Jc(r), f = (l & 2) !== 0, m = (l & 1) !== 0;
- let y, x, N, j = Xt;
- if (r.body.kind !== 241)
- y = wc(
- r.body,
- a && a & -9
- /* SkipGenericFunctions */
- ), f && (y = UP(YN(
- y,
- /*withAlias*/
- !1,
- /*errorNode*/
- r,
- p.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- )));
- else if (m) {
- const W = hNe(r, a);
- W ? W.length > 0 && (y = Qn(
- W,
- 2
- /* Subtype */
- )) : j = Ht;
- const { yieldTypes: Q, nextTypes: ye } = yat(r, a);
- x = ut(Q) ? Qn(
- Q,
- 2
- /* Subtype */
- ) : void 0, N = ut(ye) ? ia(ye) : void 0;
- } else {
- const W = hNe(r, a);
- if (!W)
- return l & 2 ? MM(r, Ht) : Ht;
- if (W.length === 0) {
- const Q = f$(
- r,
- /*contextFlags*/
- void 0
- ), ye = Q && (HM(Q, l) || Xt).flags & 32768 ? Ae : Xt;
- return l & 2 ? MM(r, ye) : (
- // Async function
- ye
- );
- }
- y = Qn(
- W,
- 2
- /* Subtype */
- );
- }
- if (y || x || N) {
- if (x && ZG(
- r,
- x,
- 3
- /* GeneratorYield */
- ), y && ZG(
- r,
- y,
- 1
- /* FunctionReturn */
- ), N && ZG(
- r,
- N,
- 2
- /* GeneratorNext */
- ), y && Yd(y) || x && Yd(x) || N && Yd(N)) {
- const W = Ape(r), Q = W ? W === Zf(r) ? m ? void 0 : y : d$(
- Ha(W),
- r,
- /*contextFlags*/
- void 0
- ) : void 0;
- m ? (x = qfe(x, Q, 0, f), y = qfe(y, Q, 1, f), N = qfe(N, Q, 2, f)) : y = mrt(y, Q, f);
- }
- x && (x = J_(x)), y && (y = J_(y)), N && (N = J_(N));
- }
- return m ? I$(
- x || Ht,
- y || j,
- N || KAe(2, r) || M,
- f
- ) : f ? LM(y || j) : y || j;
- }
- function I$(r, a, l, f) {
- const m = f ? za : Uo, y = m.getGlobalGeneratorType(
- /*reportErrors*/
- !1
- );
- if (r = m.resolveIterationType(
- r,
- /*errorNode*/
- void 0
- ) || M, a = m.resolveIterationType(
- a,
- /*errorNode*/
- void 0
- ) || M, y === Vi) {
- const x = m.getGlobalIterableIteratorType(
- /*reportErrors*/
- !1
- );
- return x !== Vi ? AP(x, [r, a, l]) : (m.getGlobalIterableIteratorType(
- /*reportErrors*/
- !0
- ), xs);
- }
- return AP(y, [r, a, l]);
- }
- function yat(r, a) {
- const l = [], f = [], m = (Jc(r) & 2) !== 0;
- return TZ(r.body, (y) => {
- const x = y.expression ? Gi(y.expression, a) : dt;
- tp(l, dNe(y, x, xe, m));
- let N;
- if (y.asteriskToken) {
- const j = V$(
- x,
- m ? 19 : 17,
- y.expression
- );
- N = j && j.nextType;
- } else
- N = a_(
- y,
- /*contextFlags*/
- void 0
- );
- N && tp(f, N);
- }), { yieldTypes: l, nextTypes: f };
- }
- function dNe(r, a, l, f) {
- const m = r.expression || r, y = r.asteriskToken ? uy(f ? 19 : 17, a, l, m) : a;
- return f ? qk(
- y,
- m,
- r.asteriskToken ? p.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : p.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- ) : y;
- }
- function mNe(r, a, l) {
- let f = 0;
- for (let m = 0; m < l.length; m++) {
- const y = m < r || m >= a ? l[m] : void 0;
- f |= y !== void 0 ? Lre.get(y) || 32768 : 0;
- }
- return f;
- }
- function gNe(r) {
- const a = bn(r);
- if (a.isExhaustive === void 0) {
- a.isExhaustive = 0;
- const l = vat(r);
- a.isExhaustive === 0 && (a.isExhaustive = l);
- } else a.isExhaustive === 0 && (a.isExhaustive = !1);
- return a.isExhaustive;
- }
- function vat(r) {
- if (r.expression.kind === 221) {
- const f = CAe(r);
- if (!f)
- return !1;
- const m = kg(wc(r.expression.expression)), y = mNe(0, 0, f);
- return m.flags & 3 ? (556800 & y) === 556800 : !Pp(m, (x) => gE(x, y) === y);
- }
- const a = wc(r.expression);
- if (!AN(a))
- return !1;
- const l = n$(r);
- return !l.length || ut(l, frt) ? !1 : _nt(Xo(a, Vu), l);
- }
- function _de(r) {
- return r.endFlowNode && pM(r.endFlowNode);
- }
- function hNe(r, a) {
- const l = Jc(r), f = [];
- let m = _de(r), y = !1;
- if (y0(r.body, (x) => {
- let N = x.expression;
- if (N) {
- if (N = Ba(
- N,
- /*excludeJSDocTypeAssertions*/
- !0
- ), l & 2 && N.kind === 223 && (N = Ba(
- N.expression,
- /*excludeJSDocTypeAssertions*/
- !0
- )), N.kind === 213 && N.expression.kind === 80 && wc(N.expression).symbol === Ra(r.symbol) && (!Wy(r.symbol.valueDeclaration) || mpe(N.expression))) {
- y = !0;
- return;
- }
- let j = wc(
- N,
- a && a & -9
- /* SkipGenericFunctions */
- );
- l & 2 && (j = UP(YN(
- j,
- /*withAlias*/
- !1,
- r,
- p.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- ))), j.flags & 131072 && (y = !0), tp(f, j);
- } else
- m = !0;
- }), !(f.length === 0 && !m && (y || bat(r))))
- return ee && f.length && m && !(qm(r) && f.some((x) => x.symbol === r.symbol)) && tp(f, Ae), f;
- }
- function bat(r) {
- switch (r.kind) {
- case 218:
- case 219:
- return !0;
- case 174:
- return r.parent.kind === 210;
- default:
- return !1;
- }
- }
- function Sat(r) {
- switch (r.kind) {
- case 176:
- case 177:
- case 178:
- return;
- }
- if (Jc(r) !== 0) return;
- let l;
- if (r.body && r.body.kind !== 241)
- l = r.body;
- else if (y0(r.body, (m) => {
- if (l || !m.expression) return !0;
- l = m.expression;
- }) || !l || _de(r)) return;
- return Tat(r, l);
- }
- function Tat(r, a) {
- if (a = Ba(
- a,
- /*excludeJSDocTypeAssertions*/
- !0
- ), !!(wc(a).flags & 16))
- return ir(r.parameters, (f, m) => {
- const y = nn(f.symbol);
- if (!y || y.flags & 16 || !Oe(f.name) || mM(f.symbol) || rg(f))
- return;
- const x = xat(r, a, f, y);
- if (x)
- return yN(1, Ei(f.name.escapedText), m, x);
- });
- }
- function xat(r, a, l, f) {
- const m = a.flowNode || a.parent.kind === 253 && a.parent.flowNode || _g(
- 2,
- /*node*/
- void 0,
- /*antecedent*/
- void 0
- ), y = _g(32, a, m), x = _0(l.name, f, f, r, y);
- if (x === f) return;
- const N = _g(64, a, m);
- return _0(l.name, f, x, r, N).flags & 131072 ? x : void 0;
- }
- function fde(r, a) {
- n(l);
- return;
- function l() {
- const f = Jc(r), m = a && HM(a, f);
- if (m && (bc(
- m,
- 16384
- /* Void */
- ) || m.flags & 32769) || r.kind === 173 || rc(r.body) || r.body.kind !== 241 || !_de(r))
- return;
- const y = r.flags & 1024, x = Y_(r) || r;
- if (m && m.flags & 131072)
- je(x, p.A_function_returning_never_cannot_have_a_reachable_end_point);
- else if (m && !y)
- je(x, p.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value);
- else if (m && ee && !$s(Ae, m))
- je(x, p.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
- else if (O.noImplicitReturns) {
- if (!m) {
- if (!y)
- return;
- const N = Ha(Zf(r));
- if (_Ie(r, N))
- return;
- }
- je(x, p.Not_all_code_paths_return_a_value);
- }
- }
- }
- function yNe(r, a) {
- if (E.assert(r.kind !== 174 || jp(r)), Hk(r), vo(r) && VP(r, r.name), a && a & 4 && Kf(r)) {
- if (!Y_(r) && !P5(r)) {
- const f = JN(r);
- if (f && I1(Ha(f))) {
- const m = bn(r);
- if (m.contextFreeType)
- return m.contextFreeType;
- const y = N$(r, a), x = ph(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- y,
- /*resolvedTypePredicate*/
- void 0,
- 0,
- 64
- /* IsNonInferrable */
- ), N = Li(r.symbol, I, [x], Ue, Ue);
- return N.objectFlags |= 262144, m.contextFreeType = N;
- }
- }
- return ba;
- }
- return !iX(r) && r.kind === 218 && Yde(r), kat(r, a), nn(Tn(r));
- }
- function kat(r, a) {
- const l = bn(r);
- if (!(l.flags & 64)) {
- const f = JN(r);
- if (!(l.flags & 64)) {
- l.flags |= 64;
- const m = el(Ns(
- nn(Tn(r)),
- 0
- /* Call */
- ));
- if (!m)
- return;
- if (Kf(r))
- if (f) {
- const y = L2(r);
- let x;
- if (a && a & 2) {
- uNe(m, f, y);
- const N = UN(f);
- N && N.flags & 262144 && (x = jk(f, y.nonFixingMapper));
- }
- x || (x = y ? jk(f, y.mapper) : f), nat(m, x);
- } else
- iat(m);
- else if (f && !r.typeParameters && f.parameters.length > r.parameters.length) {
- const y = L2(r);
- a && a & 2 && uNe(m, f, y);
- }
- if (f && !lE(r) && !m.resolvedReturnType) {
- const y = N$(r, a);
- m.resolvedReturnType || (m.resolvedReturnType = y);
- }
- GN(r);
- }
- }
- }
- function Cat(r) {
- E.assert(r.kind !== 174 || jp(r));
- const a = Jc(r), l = lE(r);
- if (fde(r, l), r.body)
- if (Y_(r) || Ha(Zf(r)), r.body.kind === 241)
- la(r.body);
- else {
- const f = Gi(r.body), m = l && HM(l, a);
- if (m) {
- const y = E$(r.body);
- if ((a & 3) === 2) {
- const x = YN(
- f,
- /*withAlias*/
- !1,
- y,
- p.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- );
- w1(x, m, y, y);
- } else
- w1(f, m, y, y);
- }
- }
- }
- function O$(r, a, l, f = !1) {
- if (!$s(a, Ss)) {
- const m = f && WP(a);
- return Rv(
- r,
- !!m && $s(m, Ss),
- l
- ), !1;
- }
- return !0;
- }
- function Eat(r) {
- if (!Fs(r) || !sS(r))
- return !1;
- const a = wc(r.arguments[2]);
- if (Rc(a, "value")) {
- const m = Gs(a, "writable"), y = m && nn(m);
- if (!y || y === yr || y === $r)
- return !0;
- if (m && m.valueDeclaration && Qc(m.valueDeclaration)) {
- const x = m.valueDeclaration.initializer, N = Gi(x);
- if (N === yr || N === $r)
- return !0;
- }
- return !1;
- }
- return !Gs(a, "set");
- }
- function em(r) {
- return !!(gc(r) & 8 || r.flags & 4 && lp(r) & 8 || r.flags & 3 && Lpe(r) & 6 || r.flags & 98304 && !(r.flags & 65536) || r.flags & 8 || ut(r.declarations, Eat));
- }
- function vNe(r, a, l) {
- var f, m;
- if (l === 0)
- return !1;
- if (em(a)) {
- if (a.flags & 4 && xo(r) && r.expression.kind === 110) {
- const y = yf(r);
- if (!(y && (y.kind === 176 || qm(y))))
- return !0;
- if (a.valueDeclaration) {
- const x = dn(a.valueDeclaration), N = y.parent === a.valueDeclaration.parent, j = y === a.valueDeclaration.parent, W = x && ((f = a.parent) == null ? void 0 : f.valueDeclaration) === y.parent, Q = x && ((m = a.parent) == null ? void 0 : m.valueDeclaration) === y;
- return !(N || j || W || Q);
- }
- }
- return !0;
- }
- if (xo(r)) {
- const y = Ba(r.expression);
- if (y.kind === 80) {
- const x = bn(y).resolvedSymbol;
- if (x.flags & 2097152) {
- const N = Du(x);
- return !!N && N.kind === 274;
- }
- }
- }
- return !1;
- }
- function qN(r, a, l) {
- const f = Dc(
- r,
- 7
- /* Parentheses */
- );
- return f.kind !== 80 && !xo(f) ? (je(r, a), !1) : f.flags & 64 ? (je(r, l), !1) : !0;
- }
- function Dat(r) {
- Gi(r.expression);
- const a = Ba(r.expression);
- if (!xo(a))
- return je(a, p.The_operand_of_a_delete_operator_must_be_a_property_reference), wt;
- Cn(a) && Di(a.name) && je(a, p.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);
- const l = bn(a), f = _f(l.resolvedSymbol);
- return f && (em(f) ? je(a, p.The_operand_of_a_delete_operator_cannot_be_a_read_only_property) : Pat(a, f)), wt;
- }
- function Pat(r, a) {
- const l = nn(a);
- ee && !(l.flags & 131075) && !(oe ? a.flags & 16777216 : Zd(
- l,
- 16777216
- /* IsUndefined */
- )) && je(r, p.The_operand_of_a_delete_operator_must_be_optional);
- }
- function wat(r) {
- return Gi(r.expression), BS;
- }
- function Aat(r) {
- return Hk(r), dt;
- }
- function bNe(r) {
- let a = !1;
- const l = v7(r);
- if (l && oc(l)) {
- const f = Hy(r) ? p.await_expression_cannot_be_used_inside_a_class_static_block : p.await_using_statements_cannot_be_used_inside_a_class_static_block;
- je(r, f), a = !0;
- } else if (!(r.flags & 65536))
- if (S7(r)) {
- const f = Tr(r);
- if (!F1(f)) {
- let m;
- if (!$T(f, O)) {
- m ?? (m = cm(f, r.pos));
- const y = Hy(r) ? p.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module : p.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module, x = fl(f, m.start, m.length, y);
- Da.add(x), a = !0;
- }
- switch (z) {
- case 100:
- case 199:
- if (f.impliedNodeFormat === 1) {
- m ?? (m = cm(f, r.pos)), Da.add(
- fl(f, m.start, m.length, p.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)
- ), a = !0;
- break;
- }
- case 7:
- case 99:
- case 200:
- case 4:
- if (B >= 4)
- break;
- default:
- m ?? (m = cm(f, r.pos));
- const y = Hy(r) ? p.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : p.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
- Da.add(fl(f, m.start, m.length, y)), a = !0;
- break;
- }
- }
- } else {
- const f = Tr(r);
- if (!F1(f)) {
- const m = cm(f, r.pos), y = Hy(r) ? p.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules : p.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules, x = fl(f, m.start, m.length, y);
- if (l && l.kind !== 176 && !(Jc(l) & 2)) {
- const N = Kr(l, p.Did_you_mean_to_mark_this_function_as_async);
- Rs(x, N);
- }
- Da.add(x), a = !0;
- }
- }
- return Hy(r) && Cpe(r) && (je(r, p.await_expressions_cannot_be_used_in_a_parameter_initializer), a = !0), a;
- }
- function Nat(r) {
- n(() => bNe(r));
- const a = Gi(r.expression), l = YN(
- a,
- /*withAlias*/
- !0,
- r,
- p.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- );
- return l === a && !H(l) && !(a.flags & 3) && zd(
- /*isError*/
- !1,
- Kr(r, p.await_has_no_effect_on_the_type_of_this_expression)
- ), l;
- }
- function Iat(r) {
- const a = Gi(r.operand);
- if (a === en)
- return en;
- switch (r.operand.kind) {
- case 9:
- switch (r.operator) {
- case 41:
- return Rk(bd(-r.operand.text));
- case 40:
- return Rk(bd(+r.operand.text));
- }
- break;
- case 10:
- if (r.operator === 41)
- return Rk(HL({
- negative: !0,
- base10Value: V4(r.operand.text)
- }));
- }
- switch (r.operator) {
- case 40:
- case 41:
- case 55:
- return Um(a, r.operand), RM(
- a,
- 12288
- /* ESSymbolLike */
- ) && je(r.operand, p.The_0_operator_cannot_be_applied_to_type_symbol, qs(r.operator)), r.operator === 40 ? (RM(
- a,
- 2112
- /* BigIntLike */
- ) && je(r.operand, p.Operator_0_cannot_be_applied_to_type_1, qs(r.operator), Hr(o0(a))), At) : pde(a);
- case 54:
- Ade(a, r.operand);
- const l = gE(
- a,
- 12582912
- /* Falsy */
- );
- return l === 4194304 ? yr : l === 8388608 ? nt : wt;
- case 46:
- case 47:
- return O$(r.operand, Um(a, r.operand), p.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type) && qN(
- r.operand,
- p.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,
- p.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access
- ), pde(a);
- }
- return He;
- }
- function Oat(r) {
- const a = Gi(r.operand);
- return a === en ? en : (O$(
- r.operand,
- Um(a, r.operand),
- p.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type
- ) && qN(
- r.operand,
- p.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,
- p.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access
- ), pde(a));
- }
- function pde(r) {
- return bc(
- r,
- 2112
- /* BigIntLike */
- ) ? eu(
- r,
- 3
- /* AnyOrUnknown */
- ) || bc(
- r,
- 296
- /* NumberLike */
- ) ? Ss : Dr : At;
- }
- function RM(r, a) {
- if (bc(r, a))
- return !0;
- const l = kg(r);
- return !!l && bc(l, a);
- }
- function bc(r, a) {
- if (r.flags & a)
- return !0;
- if (r.flags & 3145728) {
- const l = r.types;
- for (const f of l)
- if (bc(f, a))
- return !0;
- }
- return !1;
- }
- function eu(r, a, l) {
- return r.flags & a ? !0 : l && r.flags & 114691 ? !1 : !!(a & 296) && $s(r, At) || !!(a & 2112) && $s(r, Dr) || !!(a & 402653316) && $s(r, Ie) || !!(a & 528) && $s(r, wt) || !!(a & 16384) && $s(r, Xt) || !!(a & 131072) && $s(r, Ht) || !!(a & 65536) && $s(r, ht) || !!(a & 32768) && $s(r, Ae) || !!(a & 4096) && $s(r, jt) || !!(a & 67108864) && $s(r, Kt);
- }
- function HN(r, a, l) {
- return r.flags & 1048576 ? Mi(r.types, (f) => HN(f, a, l)) : eu(r, a, l);
- }
- function F$(r) {
- return !!(wn(r) & 16) && !!r.symbol && dde(r.symbol);
- }
- function dde(r) {
- return (r.flags & 128) !== 0;
- }
- function mde(r) {
- const a = oIe("hasInstance");
- if (HN(
- r,
- 67108864
- /* NonPrimitive */
- )) {
- const l = Gs(r, a);
- if (l) {
- const f = nn(l);
- if (f && Ns(
- f,
- 0
- /* Call */
- ).length !== 0)
- return f;
- }
- }
- }
- function Fat(r, a, l, f, m) {
- if (l === en || f === en)
- return en;
- !Wa(l) && HN(
- l,
- 402784252
- /* Primitive */
- ) && je(r, p.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter), E.assert(Y7(r.parent));
- const y = TE(
- r.parent,
- /*candidatesOutArray*/
- void 0,
- m
- );
- if (y === zr)
- return en;
- const x = Ha(y);
- return Au(x, wt, a, p.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression), wt;
- }
- function Lat(r) {
- return Pp(r, (a) => a === Na || !!(a.flags & 2097152) && Dg(kg(a)));
- }
- function Mat(r, a, l, f) {
- if (l === en || f === en)
- return en;
- if (Di(r)) {
- if ((B < 9 || B < 99 || !q) && bl(
- r,
- 2097152
- /* ClassPrivateFieldIn */
- ), !bn(r).resolvedSymbol && Ol(r)) {
- const m = zpe(
- r,
- f.symbol,
- /*excludeClasses*/
- !0
- );
- E8e(r, f, m);
- }
- } else
- Au(Um(l, r), Ft, r);
- return Au(Um(f, a), Kt, a) && Lat(f) && je(a, p.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, Hr(f)), wt;
- }
- function Rat(r, a, l) {
- const f = r.properties;
- if (ee && f.length === 0)
- return Um(a, r);
- for (let m = 0; m < f.length; m++)
- SNe(r, a, m, f, l);
- return a;
- }
- function SNe(r, a, l, f, m = !1) {
- const y = r.properties, x = y[l];
- if (x.kind === 303 || x.kind === 304) {
- const N = x.name, j = i0(N);
- if (up(j)) {
- const ye = _p(j), de = Gs(a, ye);
- de && (EM(de, x, m), Rpe(
- x,
- /*isSuper*/
- !1,
- /*writing*/
- !0,
- a,
- de
- ));
- }
- const W = j_(a, j, 32 | (Uk(x) ? 16 : 0), N), Q = gr(x, W);
- return DT(x.kind === 304 ? x : x.initializer, Q);
- } else if (x.kind === 305)
- if (l < y.length - 1)
- je(x, p.A_rest_element_must_be_last_in_a_destructuring_pattern);
- else {
- B < 5 && bl(
- x,
- 4
- /* Rest */
- );
- const N = [];
- if (f)
- for (const W of f)
- $g(W) || N.push(W.name);
- const j = We(a, N, a.symbol);
- return Xk(f, p.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma), DT(x.expression, j);
- }
- else
- je(x, p.Property_assignment_expected);
- }
- function jat(r, a, l) {
- const f = r.elements;
- B < 2 && O.downlevelIteration && bl(
- r,
- 512
- /* Read */
- );
- const m = uy(193, a, Ae, r) || He;
- let y = O.noUncheckedIndexedAccess ? void 0 : m;
- for (let x = 0; x < f.length; x++) {
- let N = m;
- r.elements[x].kind === 230 && (N = y = y ?? (uy(65, a, Ae, r) || He)), TNe(r, a, x, N, l);
- }
- return a;
- }
- function TNe(r, a, l, f, m) {
- const y = r.elements, x = y[l];
- if (x.kind !== 232) {
- if (x.kind !== 230) {
- const N = bd(l);
- if (oy(a)) {
- const j = 32 | (Uk(x) ? 16 : 0), W = D1(a, N, j, PM(x, N)) || He, Q = Uk(x) ? ad(
- W,
- 524288
- /* NEUndefined */
- ) : W, ye = gr(x, Q);
- return DT(x, ye, m);
- }
- return DT(x, f, m);
- }
- if (l < y.length - 1)
- je(x, p.A_rest_element_must_be_last_in_a_destructuring_pattern);
- else {
- const N = x.expression;
- if (N.kind === 226 && N.operatorToken.kind === 64)
- je(N.operatorToken, p.A_rest_element_cannot_have_an_initializer);
- else {
- Xk(r.elements, p.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
- const j = z_(a, ha) ? Xo(a, (W) => NP(W, l)) : du(f);
- return DT(N, j, m);
- }
- }
- }
- }
- function DT(r, a, l, f) {
- let m;
- if (r.kind === 304) {
- const y = r;
- y.objectAssignmentInitializer && (ee && !Zd(
- Gi(y.objectAssignmentInitializer),
- 16777216
- /* IsUndefined */
- ) && (a = ad(
- a,
- 524288
- /* NEUndefined */
- )), Wat(y.name, y.equalsToken, y.objectAssignmentInitializer, l)), m = r.name;
- } else
- m = r;
- return m.kind === 226 && m.operatorToken.kind === 64 && (he(m, l), m = m.left, ee && (a = ad(
- a,
- 524288
- /* NEUndefined */
- ))), m.kind === 210 ? Rat(m, a, f) : m.kind === 209 ? jat(m, a, l) : Bat(m, a, l);
- }
- function Bat(r, a, l) {
- const f = Gi(r, l), m = r.parent.kind === 305 ? p.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : p.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, y = r.parent.kind === 305 ? p.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : p.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;
- return qN(r, m, y) && w1(a, f, r, r), cC(r) && bl(
- r.parent,
- 1048576
- /* ClassPrivateFieldSet */
- ), a;
- }
- function jM(r) {
- switch (r = Ba(r), r.kind) {
- case 80:
- case 11:
- case 14:
- case 215:
- case 228:
- case 15:
- case 9:
- case 10:
- case 112:
- case 97:
- case 106:
- case 157:
- case 218:
- case 231:
- case 219:
- case 209:
- case 210:
- case 221:
- case 235:
- case 285:
- case 284:
- return !0;
- case 227:
- return jM(r.whenTrue) && jM(r.whenFalse);
- case 226:
- return Ph(r.operatorToken.kind) ? !1 : jM(r.left) && jM(r.right);
- case 224:
- case 225:
- switch (r.operator) {
- case 54:
- case 40:
- case 41:
- case 55:
- return !0;
- }
- return !1;
- case 222:
- case 216:
- case 234:
- default:
- return !1;
- }
- }
- function gde(r, a) {
- return (a.flags & 98304) !== 0 || MG(r, a);
- }
- function Jat() {
- const r = fO(a, l, f, m, y, x);
- return (de, Ze) => {
- const ct = r(de, Ze);
- return E.assertIsDefined(ct), ct;
- };
- function a(de, Ze, ct) {
- return Ze ? (Ze.stackIndex++, Ze.skip = !1, W(
- Ze,
- /*type*/
- void 0
- ), ye(
- Ze,
- /*type*/
- void 0
- )) : Ze = {
- checkMode: ct,
- skip: !1,
- stackIndex: 0,
- typeStack: [void 0, void 0]
- }, cn(de) && ZT(de) ? (Ze.skip = !0, ye(Ze, Gi(de.right, ct)), Ze) : (zat(de), de.operatorToken.kind === 64 && (de.left.kind === 210 || de.left.kind === 209) && (Ze.skip = !0, ye(Ze, DT(
- de.left,
- Gi(de.right, ct),
- ct,
- de.right.kind === 110
- /* ThisKeyword */
- ))), Ze);
- }
- function l(de, Ze, ct) {
- if (!Ze.skip)
- return N(Ze, de);
- }
- function f(de, Ze, ct) {
- if (!Ze.skip) {
- const mt = Q(Ze);
- E.assertIsDefined(mt), W(Ze, mt), ye(
- Ze,
- /*type*/
- void 0
- );
- const Gt = de.kind;
- if (X7(Gt)) {
- let sr = ct.parent;
- for (; sr.kind === 217 || P3(sr); )
- sr = sr.parent;
- (Gt === 56 || _v(sr)) && wde(ct.left, mt, _v(sr) ? sr.thenStatement : void 0), D3(Gt) && Ade(mt, ct.left);
- }
- }
- }
- function m(de, Ze, ct) {
- if (!Ze.skip)
- return N(Ze, de);
- }
- function y(de, Ze) {
- let ct;
- if (Ze.skip)
- ct = Q(Ze);
- else {
- const mt = j(Ze);
- E.assertIsDefined(mt);
- const Gt = Q(Ze);
- E.assertIsDefined(Gt), ct = xNe(de.left, de.operatorToken, de.right, mt, Gt, Ze.checkMode, de);
- }
- return Ze.skip = !1, W(
- Ze,
- /*type*/
- void 0
- ), ye(
- Ze,
- /*type*/
- void 0
- ), Ze.stackIndex--, ct;
- }
- function x(de, Ze, ct) {
- return ye(de, Ze), de;
- }
- function N(de, Ze) {
- if (dn(Ze))
- return Ze;
- ye(de, Gi(Ze, de.checkMode));
- }
- function j(de) {
- return de.typeStack[de.stackIndex];
- }
- function W(de, Ze) {
- de.typeStack[de.stackIndex] = Ze;
- }
- function Q(de) {
- return de.typeStack[de.stackIndex + 1];
- }
- function ye(de, Ze) {
- de.typeStack[de.stackIndex + 1] = Ze;
- }
- }
- function zat(r) {
- const { left: a, operatorToken: l, right: f } = r;
- if (l.kind === 61) {
- dn(a) && (a.operatorToken.kind === 57 || a.operatorToken.kind === 56) && dr(a, p._0_and_1_operations_cannot_be_mixed_without_parentheses, qs(a.operatorToken.kind), qs(l.kind)), dn(f) && (f.operatorToken.kind === 57 || f.operatorToken.kind === 56) && dr(f, p._0_and_1_operations_cannot_be_mixed_without_parentheses, qs(f.operatorToken.kind), qs(l.kind));
- const m = Dc(
- a,
- 31
- /* All */
- ), y = hde(m);
- y !== 3 && (r.parent.kind === 226 ? je(m, p.This_binary_expression_is_never_nullish_Are_you_missing_parentheses) : y === 1 ? je(m, p.This_expression_is_always_nullish) : je(m, p.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish));
- }
- }
- function hde(r) {
- switch (r = Dc(r), r.kind) {
- case 223:
- case 213:
- case 212:
- case 214:
- case 211:
- case 229:
- case 110:
- return 3;
- case 226:
- switch (r.operatorToken.kind) {
- case 64:
- case 61:
- case 78:
- case 57:
- case 76:
- case 56:
- case 77:
- return 3;
- }
- return 2;
- case 227:
- return hde(r.whenTrue) | hde(r.whenFalse);
- case 106:
- return 1;
- case 80:
- return Nu(r) === we ? 1 : 3;
- }
- return 2;
- }
- function Wat(r, a, l, f, m) {
- const y = a.kind;
- if (y === 64 && (r.kind === 210 || r.kind === 209))
- return DT(
- r,
- Gi(l, f),
- f,
- l.kind === 110
- /* ThisKeyword */
- );
- let x;
- D3(y) ? x = rI(r, f) : x = Gi(r, f);
- const N = Gi(l, f);
- return xNe(r, a, l, x, N, f, m);
- }
- function xNe(r, a, l, f, m, y, x) {
- const N = a.kind;
- switch (N) {
- case 42:
- case 43:
- case 67:
- case 68:
- case 44:
- case 69:
- case 45:
- case 70:
- case 41:
- case 66:
- case 48:
- case 71:
- case 49:
- case 72:
- case 50:
- case 73:
- case 52:
- case 75:
- case 53:
- case 79:
- case 51:
- case 74:
- if (f === en || m === en)
- return en;
- f = Um(f, r), m = Um(m, l);
- let pr;
- if (f.flags & 528 && m.flags & 528 && (pr = de(a.kind)) !== void 0)
- return je(x || a, p.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, qs(a.kind), qs(pr)), At;
- {
- const Un = O$(
- r,
- f,
- p.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,
- /*isAwaitValid*/
- !0
- ), ci = O$(
- l,
- m,
- p.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,
- /*isAwaitValid*/
- !0
- );
- let Jn;
- if (eu(
- f,
- 3
- /* AnyOrUnknown */
- ) && eu(
- m,
- 3
- /* AnyOrUnknown */
- ) || // Or, if neither could be bigint, implicit coercion results in a number result
- !(bc(
- f,
- 2112
- /* BigIntLike */
- ) || bc(
- m,
- 2112
- /* BigIntLike */
- )))
- Jn = At;
- else if (j(f, m)) {
- switch (N) {
- case 50:
- case 73:
- Gt();
- break;
- case 43:
- case 68:
- B < 3 && je(x, p.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);
- }
- Jn = Dr;
- } else
- Gt(j), Jn = He;
- if (Un && ci)
- switch (Ze(Jn), N) {
- case 48:
- case 71:
- case 49:
- case 72:
- case 50:
- case 73:
- const Us = tt(l);
- typeof Us.value == "number" && Math.abs(Us.value) >= 32 && Im(
- A0(ag(l.parent.parent)),
- // elevate from suggestion to error within an enum member
- x || a,
- p.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2,
- nc(r),
- qs(N),
- Us.value % 32
- );
- break;
- }
- return Jn;
- }
- case 40:
- case 65:
- if (f === en || m === en)
- return en;
- !eu(
- f,
- 402653316
- /* StringLike */
- ) && !eu(
- m,
- 402653316
- /* StringLike */
- ) && (f = Um(f, r), m = Um(m, l));
- let er;
- return eu(
- f,
- 296,
- /*strict*/
- !0
- ) && eu(
- m,
- 296,
- /*strict*/
- !0
- ) ? er = At : eu(
- f,
- 2112,
- /*strict*/
- !0
- ) && eu(
- m,
- 2112,
- /*strict*/
- !0
- ) ? er = Dr : eu(
- f,
- 402653316,
- /*strict*/
- !0
- ) || eu(
- m,
- 402653316,
- /*strict*/
- !0
- ) ? er = Ie : (Wa(f) || Wa(m)) && (er = H(f) || H(m) ? He : xe), er && !ye(N) ? er : er ? (N === 65 && Ze(er), er) : (Gt(
- (ci, Jn) => eu(ci, 402655727) && eu(Jn, 402655727)
- ), xe);
- case 30:
- case 32:
- case 33:
- case 34:
- return ye(N) && (f = Ufe(Um(f, r)), m = Ufe(Um(m, l)), mt((Un, ci) => {
- if (Wa(Un) || Wa(ci))
- return !0;
- const Jn = $s(Un, Ss), Us = $s(ci, Ss);
- return Jn && Us || !Jn && !Us && YL(Un, ci);
- })), wt;
- case 35:
- case 36:
- case 37:
- case 38:
- if (!(y && y & 64)) {
- if ((vj(r) || vj(l)) && // only report for === and !== in JS, not == or !=
- (!cn(r) || N === 37 || N === 38)) {
- const Un = N === 35 || N === 37;
- je(x, p.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, Un ? "false" : "true");
- }
- Xr(x, N, r, l), mt((Un, ci) => gde(Un, ci) || gde(ci, Un));
- }
- return wt;
- case 104:
- return Fat(r, l, f, m, y);
- case 103:
- return Mat(r, l, f, m);
- case 56:
- case 77: {
- const Un = Zd(
- f,
- 4194304
- /* Truthy */
- ) ? Qn([yrt(ee ? f : o0(m)), m]) : f;
- return N === 77 && Ze(m), Un;
- }
- case 57:
- case 76: {
- const Un = Zd(
- f,
- 8388608
- /* Falsy */
- ) ? Qn(
- [c0(Y3e(f)), m],
- 2
- /* Subtype */
- ) : f;
- return N === 76 && Ze(m), Un;
- }
- case 61:
- case 78: {
- const Un = Zd(
- f,
- 262144
- /* EQUndefinedOrNull */
- ) ? Qn(
- [c0(f), m],
- 2
- /* Subtype */
- ) : f;
- return N === 78 && Ze(m), Un;
- }
- case 64:
- const gn = dn(r.parent) ? Cc(r.parent) : 0;
- return W(gn, m), ct(gn) ? ((!(m.flags & 524288) || gn !== 2 && gn !== 6 && !a0(m) && !upe(m) && !(wn(m) & 1)) && Ze(m), f) : (Ze(m), m);
- case 28:
- if (!O.allowUnreachableCode && jM(r) && !Q(r.parent)) {
- const Un = Tr(r), ci = Un.text, Jn = aa(ci, r.pos);
- Un.parseDiagnostics.some((js) => js.code !== p.JSX_expressions_must_have_one_parent_element.code ? !1 : sj(js, Jn)) || je(r, p.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
- }
- return m;
- default:
- return E.fail();
- }
- function j(pr, er) {
- return eu(
- pr,
- 2112
- /* BigIntLike */
- ) && eu(
- er,
- 2112
- /* BigIntLike */
- );
- }
- function W(pr, er) {
- if (pr === 2)
- for (const gn of iy(er)) {
- const Un = nn(gn);
- if (Un.symbol && Un.symbol.flags & 32) {
- const ci = gn.escapedName, Jn = Nt(
- gn.valueDeclaration,
- ci,
- 788968,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- Jn?.declarations && Jn.declarations.some(SS) && (hg(Jn, p.Duplicate_identifier_0, Ei(ci), gn), hg(gn, p.Duplicate_identifier_0, Ei(ci), Jn));
- }
- }
- }
- function Q(pr) {
- return pr.parent.kind === 217 && d_(pr.left) && pr.left.text === "0" && (Fs(pr.parent.parent) && pr.parent.parent.expression === pr.parent || pr.parent.parent.kind === 215) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
- (xo(pr.right) || Oe(pr.right) && pr.right.escapedText === "eval");
- }
- function ye(pr) {
- const er = RM(
- f,
- 12288
- /* ESSymbolLike */
- ) ? r : RM(
- m,
- 12288
- /* ESSymbolLike */
- ) ? l : void 0;
- return er ? (je(er, p.The_0_operator_cannot_be_applied_to_type_symbol, qs(pr)), !1) : !0;
- }
- function de(pr) {
- switch (pr) {
- case 52:
- case 75:
- return 57;
- case 53:
- case 79:
- return 38;
- case 51:
- case 74:
- return 56;
- default:
- return;
- }
- }
- function Ze(pr) {
- Ph(N) && n(er);
- function er() {
- let gn = f;
- if (PD(a.kind) && r.kind === 211 && (gn = S$(
- r,
- /*checkMode*/
- void 0,
- /*writeOnly*/
- !0
- )), qN(r, p.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, p.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)) {
- let Un;
- if (oe && Cn(r) && bc(
- pr,
- 32768
- /* Undefined */
- )) {
- const ci = Rc(tu(r.expression), r.name.escapedText);
- jG(pr, ci) && (Un = p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target);
- }
- w1(pr, gn, r, l, Un);
- }
- }
- }
- function ct(pr) {
- var er;
- switch (pr) {
- case 2:
- return !0;
- case 1:
- case 5:
- case 6:
- case 3:
- case 4:
- const gn = i_(r), Un = ZT(l);
- return !!Un && Ks(Un) && !!((er = gn?.exports) != null && er.size);
- default:
- return !1;
- }
- }
- function mt(pr) {
- return pr(f, m) ? !1 : (Gt(pr), !0);
- }
- function Gt(pr) {
- let er = !1;
- const gn = x || a;
- if (pr) {
- const js = ly(f), Oo = ly(m);
- er = !(js === f && Oo === m) && !!(js && Oo) && pr(js, Oo);
- }
- let Un = f, ci = m;
- !er && pr && ([Un, ci] = Uat(f, m, pr));
- const [Jn, Us] = vP(Un, ci);
- sr(gn, er, Jn, Us) || Rv(
- gn,
- er,
- p.Operator_0_cannot_be_applied_to_types_1_and_2,
- qs(a.kind),
- Jn,
- Us
- );
- }
- function sr(pr, er, gn, Un) {
- switch (a.kind) {
- case 37:
- case 35:
- case 38:
- case 36:
- return Rv(
- pr,
- er,
- p.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap,
- gn,
- Un
- );
- default:
- return;
- }
- }
- function Xr(pr, er, gn, Un) {
- const ci = tn(Ba(gn)), Jn = tn(Ba(Un));
- if (ci || Jn) {
- const Us = je(pr, p.This_condition_will_always_return_0, qs(
- er === 37 || er === 35 ? 97 : 112
- /* TrueKeyword */
- ));
- if (ci && Jn) return;
- const js = er === 38 || er === 36 ? qs(
- 54
- /* ExclamationToken */
- ) : "", Oo = ci ? Un : gn, ls = Ba(Oo);
- Rs(Us, Kr(Oo, p.Did_you_mean_0, `${js}Number.isNaN(${yo(ls) ? $_(ls) : "..."})`));
- }
- }
- function tn(pr) {
- if (Oe(pr) && pr.escapedText === "NaN") {
- const er = ket();
- return !!er && er === Nu(pr);
- }
- return !1;
- }
- }
- function Uat(r, a, l) {
- let f = r, m = a;
- const y = o0(r), x = o0(a);
- return l(y, x) || (f = y, m = x), [f, m];
- }
- function Vat(r) {
- n(ye);
- const a = yf(r);
- if (!a) return xe;
- const l = Jc(a);
- if (!(l & 1))
- return xe;
- const f = (l & 2) !== 0;
- r.asteriskToken && (f && B < 5 && bl(
- r,
- 26624
- /* AsyncDelegatorIncludes */
- ), !f && B < 2 && O.downlevelIteration && bl(
- r,
- 256
- /* Values */
- ));
- let m = lE(a);
- m && m.flags & 1048576 && (m = Vc(m, (de) => Sde(
- de,
- l,
- /*errorNode*/
- void 0
- )));
- const y = m && Rde(m, f), x = y && y.yieldType || xe, N = y && y.nextType || xe, j = r.expression ? Gi(r.expression) : dt, W = dNe(r, j, N, f);
- if (m && W && w1(W, x, r.expression || r, r.expression), r.asteriskToken)
- return Ode(f ? 19 : 17, 1, j, r.expression) || xe;
- if (m)
- return j2(2, m, f) || xe;
- let Q = KAe(2, a);
- return Q || (Q = xe, n(() => {
- if (ie && !oee(r)) {
- const de = a_(
- r,
- /*contextFlags*/
- void 0
- );
- (!de || Wa(de)) && je(r, p.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);
- }
- })), Q;
- function ye() {
- r.flags & 16384 || Bl(r, p.A_yield_expression_is_only_allowed_in_a_generator_body), Cpe(r) && je(r, p.yield_expressions_cannot_be_used_in_a_parameter_initializer);
- }
- }
- function qat(r, a) {
- const l = rI(r.condition, a);
- wde(r.condition, l, r.whenTrue);
- const f = Gi(r.whenTrue, a), m = Gi(r.whenFalse, a);
- return Qn(
- [f, m],
- 2
- /* Subtype */
- );
- }
- function kNe(r) {
- const a = r.parent;
- return Yu(a) && kNe(a) || ko(a) && a.argumentExpression === r;
- }
- function Hat(r) {
- const a = [r.head.text], l = [];
- for (const m of r.templateSpans) {
- const y = Gi(m.expression);
- RM(
- y,
- 12288
- /* ESSymbolLike */
- ) && je(m.expression, p.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String), a.push(m.literal.text), l.push($s(y, gs) ? y : Ie);
- }
- const f = r.parent.kind !== 215 && tt(r).value;
- return f ? Rk(S_(f)) : JP(r) || kNe(r) || Pp(a_(
- r,
- /*contextFlags*/
- void 0
- ) || M, Gat) ? fT(a, l) : Ie;
- }
- function Gat(r) {
- return !!(r.flags & 134217856 || r.flags & 58982400 && bc(
- Kl(r) || M,
- 402653316
- /* StringLike */
- ));
- }
- function $at(r) {
- return Wb(r) && !yS(r.parent) ? r.parent.parent : r;
- }
- function xE(r, a, l, f) {
- const m = $at(r);
- vM(
- m,
- a,
- /*isCache*/
- !1
- ), uit(m, l);
- const y = Gi(r, f | 1 | (l ? 2 : 0));
- l && l.intraExpressionInferenceSites && (l.intraExpressionInferenceSites = void 0);
- const x = bc(
- y,
- 2944
- /* Literal */
- ) && L$(y, d$(
- a,
- r,
- /*contextFlags*/
- void 0
- )) ? Vu(y) : y;
- return _it(), BN(), x;
- }
- function wc(r, a) {
- if (a)
- return Gi(r, a);
- const l = bn(r);
- if (!l.resolvedType) {
- const f = th, m = qf;
- th = Yp, qf = void 0, l.resolvedType = Gi(r, a), qf = m, th = f;
- }
- return l.resolvedType;
- }
- function CNe(r) {
- return r = Ba(
- r,
- /*excludeJSDocTypeAssertions*/
- !0
- ), r.kind === 216 || r.kind === 234 || xS(r);
- }
- function BP(r, a, l) {
- const f = i3(r);
- if (cn(r)) {
- const y = I5(r);
- if (y)
- return nde(f, y, a);
- }
- const m = bde(f) || (l ? xE(
- f,
- l,
- /*inferenceContext*/
- void 0,
- a || 0
- /* Normal */
- ) : wc(f, a));
- if (Ii(va(r) ? JT(r) : r)) {
- if (r.name.kind === 206 && cy(m))
- return Xat(m, r.name);
- if (r.name.kind === 207 && ha(m))
- return Qat(m, r.name);
- }
- return m;
- }
- function Xat(r, a) {
- let l;
- for (const y of a.elements)
- if (y.initializer) {
- const x = ENe(y);
- x && !Gs(r, x) && (l = wr(l, y));
- }
- if (!l)
- return r;
- const f = Js();
- for (const y of iy(r))
- f.set(y.escapedName, y);
- for (const y of l) {
- const x = fa(16777220, ENe(y));
- x.links.type = R(
- y,
- /*includePatternInType*/
- !1,
- /*reportErrors*/
- !1
- ), f.set(x.escapedName, x);
- }
- const m = Li(r.symbol, f, Ue, Ue, wu(r));
- return m.objectFlags = r.objectFlags, m;
- }
- function ENe(r) {
- const a = i0(r.propertyName || r.name);
- return up(a) ? _p(a) : void 0;
- }
- function Qat(r, a) {
- if (r.target.combinedFlags & 12 || sy(r) >= a.elements.length)
- return r;
- const l = a.elements, f = P2(r).slice(), m = r.target.elementFlags.slice();
- for (let y = sy(r); y < l.length; y++) {
- const x = l[y];
- (y < l.length - 1 || !(x.kind === 208 && x.dotDotDotToken)) && (f.push(!ml(x) && Uk(x) ? R(
- x,
- /*includePatternInType*/
- !1,
- /*reportErrors*/
- !1
- ) : xe), m.push(
- 2
- /* Optional */
- ), !ml(x) && !Uk(x) && tb(x, xe));
- }
- return Eg(f, m, r.target.readonly);
- }
- function yde(r, a) {
- const l = DNe(r, a);
- if (cn(r)) {
- if (V3e(l))
- return tb(r, xe), xe;
- if (VG(l))
- return tb(r, so), so;
- }
- return l;
- }
- function DNe(r, a) {
- return J2(r) & 6 || Vw(r) ? a : eb(a);
- }
- function L$(r, a) {
- if (a) {
- if (a.flags & 3145728) {
- const l = a.types;
- return ut(l, (f) => L$(r, f));
- }
- if (a.flags & 58982400) {
- const l = Kl(a) || M;
- return bc(
- l,
- 4
- /* String */
- ) && bc(
- r,
- 128
- /* StringLiteral */
- ) || bc(
- l,
- 8
- /* Number */
- ) && bc(
- r,
- 256
- /* NumberLiteral */
- ) || bc(
- l,
- 64
- /* BigInt */
- ) && bc(
- r,
- 2048
- /* BigIntLiteral */
- ) || bc(
- l,
- 4096
- /* ESSymbol */
- ) && bc(
- r,
- 8192
- /* UniqueESSymbol */
- ) || L$(r, l);
- }
- return !!(a.flags & 406847616 && bc(
- r,
- 128
- /* StringLiteral */
- ) || a.flags & 256 && bc(
- r,
- 256
- /* NumberLiteral */
- ) || a.flags & 2048 && bc(
- r,
- 2048
- /* BigIntLiteral */
- ) || a.flags & 512 && bc(
- r,
- 512
- /* BooleanLiteral */
- ) || a.flags & 8192 && bc(
- r,
- 8192
- /* UniqueESSymbol */
- ));
- }
- return !1;
- }
- function JP(r) {
- const a = r.parent;
- return $1(a) && xd(a.type) || xS(a) && xd(mD(a)) || rde(r) && uT(a_(
- r,
- 0
- /* None */
- )) || (Yu(a) || $l(a) || fp(a)) && JP(a) || (Qc(a) || uu(a) || $C(a)) && JP(a.parent);
- }
- function zP(r, a, l) {
- const f = Gi(r, a, l);
- return JP(r) || CZ(r) ? Vu(f) : CNe(r) ? f : Vfe(f, d$(
- a_(
- r,
- /*contextFlags*/
- void 0
- ),
- r,
- /*contextFlags*/
- void 0
- ));
- }
- function PNe(r, a) {
- return r.name.kind === 167 && Wm(r.name), zP(r.initializer, a);
- }
- function wNe(r, a) {
- e7e(r), r.name.kind === 167 && Wm(r.name);
- const l = yNe(r, a);
- return ANe(r, l, a);
- }
- function ANe(r, a, l) {
- if (l && l & 10) {
- const f = WN(
- a,
- 0,
- /*allowMembers*/
- !0
- ), m = WN(
- a,
- 1,
- /*allowMembers*/
- !0
- ), y = f || m;
- if (y && y.typeParameters) {
- const x = nb(
- r,
- 2
- /* NoConstraints */
- );
- if (x) {
- const N = WN(
- c0(x),
- f ? 0 : 1,
- /*allowMembers*/
- !1
- );
- if (N && !N.typeParameters) {
- if (l & 8)
- return NNe(r, l), ba;
- const j = L2(r), W = j.signature && Ha(j.signature), Q = W && j8e(W);
- if (Q && !Q.typeParameters && !Mi(j.inferences, kE)) {
- const ye = eot(j, y.typeParameters), de = H_e(y, ye), Ze = lr(j.inferences, (ct) => Yfe(ct.typeParameter));
- if (Gfe(de, N, (ct, mt) => {
- u0(
- Ze,
- ct,
- mt,
- /*priority*/
- 0,
- /*contravariant*/
- !0
- );
- }), ut(Ze, kE) && ($fe(de, N, (ct, mt) => {
- u0(Ze, ct, mt);
- }), !Zat(j.inferences, Ze)))
- return Kat(j.inferences, Ze), j.inferredTypeParameters = Qi(j.inferredTypeParameters, ye), _T(de);
- }
- return _T(B8e(y, N, j), ta(n1, (ye) => ye && lr(ye.inferences, (de) => de.typeParameter)).slice());
- }
- }
- }
- }
- return a;
- }
- function NNe(r, a) {
- if (a & 2) {
- const l = L2(r);
- l.flags |= 4;
- }
- }
- function kE(r) {
- return !!(r.candidates || r.contraCandidates);
- }
- function Yat(r) {
- return !!(r.candidates || r.contraCandidates || rwe(r.typeParameter));
- }
- function Zat(r, a) {
- for (let l = 0; l < r.length; l++)
- if (kE(r[l]) && kE(a[l]))
- return !0;
- return !1;
- }
- function Kat(r, a) {
- for (let l = 0; l < r.length; l++)
- !kE(r[l]) && kE(a[l]) && (r[l] = a[l]);
- }
- function eot(r, a) {
- const l = [];
- let f, m;
- for (const y of a) {
- const x = y.symbol.escapedName;
- if (vde(r.inferredTypeParameters, x) || vde(l, x)) {
- const N = tot(Qi(r.inferredTypeParameters, l), x), j = fa(262144, N), W = pt(j);
- W.target = y, f = wr(f, y), m = wr(m, W), l.push(W);
- } else
- l.push(y);
- }
- if (m) {
- const y = B_(f, m);
- for (const x of m)
- x.mapper = y;
- }
- return l;
- }
- function vde(r, a) {
- return ut(r, (l) => l.symbol.escapedName === a);
- }
- function tot(r, a) {
- let l = a.length;
- for (; l > 1 && a.charCodeAt(l - 1) >= 48 && a.charCodeAt(l - 1) <= 57; ) l--;
- const f = a.slice(0, l);
- for (let m = 1; ; m++) {
- const y = f + m;
- if (!vde(r, y))
- return y;
- }
- }
- function INe(r) {
- const a = ET(r);
- if (a && !a.typeParameters)
- return Ha(a);
- }
- function rot(r) {
- const a = Gi(r.expression), l = NN(a, r.expression), f = INe(a);
- return f && $G(f, r, l !== a);
- }
- function tu(r) {
- const a = bde(r);
- if (a)
- return a;
- if (r.flags & 268435456 && qf) {
- const m = qf[Ma(r)];
- if (m)
- return m;
- }
- const l = z0, f = Gi(
- r,
- 64
- /* TypeOnly */
- );
- if (z0 !== l) {
- const m = qf || (qf = []);
- m[Ma(r)] = f, aee(
- r,
- r.flags | 268435456
- /* TypeCached */
- );
- }
- return f;
- }
- function bde(r) {
- let a = Ba(
- r,
- /*excludeJSDocTypeAssertions*/
- !0
- );
- if (xS(a)) {
- const l = mD(a);
- if (!xd(l))
- return Ci(l);
- }
- if (a = Ba(r), Hy(a)) {
- const l = bde(a.expression);
- return l ? qk(l) : void 0;
- }
- if (Fs(a) && a.expression.kind !== 108 && !f_(
- a,
- /*requireStringLiteralLikeArgument*/
- !0
- ) && !Z8e(a))
- return $2(a) ? rot(a) : INe(bE(a.expression));
- if ($1(a) && !xd(a.type))
- return Ci(a.type);
- if (X2(r) || a4(r))
- return Gi(r);
- }
- function BM(r) {
- const a = bn(r);
- if (a.contextFreeType)
- return a.contextFreeType;
- vM(
- r,
- xe,
- /*isCache*/
- !1
- );
- const l = a.contextFreeType = Gi(
- r,
- 4
- /* SkipContextSensitive */
- );
- return BN(), l;
- }
- function Gi(r, a, l) {
- var f, m;
- (f = rn) == null || f.push(rn.Phase.Check, "checkExpression", { kind: r.kind, pos: r.pos, end: r.end, path: r.tracingPath });
- const y = C;
- C = r, h = 0;
- const x = sot(r, a, l), N = ANe(r, x, a);
- return F$(N) && not(r, N), C = y, (m = rn) == null || m.pop(), N;
- }
- function not(r, a) {
- const l = r.parent.kind === 211 && r.parent.expression === r || r.parent.kind === 212 && r.parent.expression === r || (r.kind === 80 || r.kind === 166) && Y$(r) || r.parent.kind === 186 && r.parent.exprName === r || r.parent.kind === 281;
- if (l || je(r, p.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query), O.isolatedModules || O.verbatimModuleSyntax && l && !Nt(
- r,
- E_(r),
- 2097152,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1,
- /*excludeGlobals*/
- !0
- )) {
- E.assert(!!(a.symbol.flags & 128));
- const f = a.symbol.valueDeclaration, m = e.getRedirectReferenceForResolutionFromSourceOfProject(Tr(f).resolvedPath);
- f.flags & 33554432 && !av(r) && (!m || !jy(m.commandLine.options)) && je(r, p.Cannot_access_ambient_const_enums_when_0_is_enabled, et);
- }
- }
- function iot(r, a) {
- if (gf(r)) {
- if (mJ(r))
- return nde(r.expression, gJ(r), a);
- if (xS(r))
- return rNe(r, a);
- }
- return Gi(r.expression, a);
- }
- function sot(r, a, l) {
- const f = r.kind;
- if (i)
- switch (f) {
- case 231:
- case 218:
- case 219:
- i.throwIfCancellationRequested();
- }
- switch (f) {
- case 80:
- return Ont(r, a);
- case 81:
- return Kit(r);
- case 110:
- return hM(r);
- case 108:
- return _$(r);
- case 106:
- return Le;
- case 15:
- case 11:
- return rpe(r) ? bt : Rk(S_(r.text));
- case 9:
- return o7e(r), Rk(bd(+r.text));
- case 10:
- return c_t(r), Rk(HL({
- negative: !1,
- base10Value: V4(r.text)
- }));
- case 112:
- return nt;
- case 97:
- return yr;
- case 228:
- return Hat(r);
- case 14:
- return kit(r);
- case 209:
- return o8e(r, a, l);
- case 210:
- return Nit(r, a);
- case 211:
- return S$(r, a);
- case 166:
- return x8e(r, a);
- case 212:
- return dst(r, a);
- case 213:
- if (r.expression.kind === 102)
- return Hst(r);
- case 214:
- return qst(r, a);
- case 215:
- return Gst(r);
- case 217:
- return iot(r, a);
- case 231:
- return Xct(r);
- case 218:
- case 219:
- return yNe(r, a);
- case 221:
- return wat(r);
- case 216:
- case 234:
- return $st(r, a);
- case 235:
- return Yst(r);
- case 233:
- return iNe(r);
- case 238:
- return Zst(r);
- case 236:
- return Kst(r);
- case 220:
- return Dat(r);
- case 222:
- return Aat(r);
- case 223:
- return Nat(r);
- case 224:
- return Iat(r);
- case 225:
- return Oat(r);
- case 226:
- return he(r, a);
- case 227:
- return qat(r, a);
- case 230:
- return Cit(r, a);
- case 232:
- return dt;
- case 229:
- return Vat(r);
- case 237:
- return Eit(r);
- case 294:
- return Hit(r, a);
- case 284:
- return Lit(r);
- case 285:
- return Oit(r);
- case 288:
- return Mit(r);
- case 292:
- return jit(r, a);
- case 286:
- E.fail("Shouldn't ever directly check a JsxOpeningElement");
- }
- return He;
- }
- function ONe(r) {
- vh(r), r.expression && Bl(r.expression, p.Type_expected), la(r.constraint), la(r.default);
- const a = T2(Tn(r));
- Kl(a), CKe(a) || je(r.default, p.Type_parameter_0_has_a_circular_default, Hr(a));
- const l = s_(a), f = C2(a);
- l && f && Au(f, df(zi(l, N2(a, f)), f), r.default, p.Type_0_does_not_satisfy_the_constraint_1), Hk(r), n(() => qP(r.name, p.Type_parameter_name_cannot_be_0));
- }
- function aot(r) {
- var a, l;
- if (Xl(r.parent) || Zn(r.parent) || Vp(r.parent)) {
- const f = T2(Tn(r)), m = Bfe(f) & 24576;
- if (m) {
- const y = Tn(r.parent);
- if (Vp(r.parent) && !(wn(bo(y)) & 52))
- je(r, p.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
- else if (m === 8192 || m === 16384) {
- (a = rn) == null || a.push(rn.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: Rl(bo(y)), id: Rl(f) });
- const x = eM(y, f, m === 16384 ? $ : ge), N = eM(y, f, m === 16384 ? ge : $), j = f;
- D = f, Au(x, N, r, p.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation), D = j, (l = rn) == null || l.pop();
- }
- }
- }
- }
- function FNe(r) {
- vh(r), VM(r);
- const a = yf(r);
- Gn(
- r,
- 31
- /* ParameterPropertyModifier */
- ) && (a.kind === 176 && Mp(a.body) || je(r, p.A_parameter_property_is_only_allowed_in_a_constructor_implementation), a.kind === 176 && Oe(r.name) && r.name.escapedText === "constructor" && je(r.name, p.constructor_cannot_be_used_as_a_parameter_property_name)), !r.initializer && WC(r) && As(r.name) && a.body && je(r, p.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature), r.name && Oe(r.name) && (r.name.escapedText === "this" || r.name.escapedText === "new") && (a.parameters.indexOf(r) !== 0 && je(r, p.A_0_parameter_must_be_the_first_parameter, r.name.escapedText), (a.kind === 176 || a.kind === 180 || a.kind === 185) && je(r, p.A_constructor_cannot_have_a_this_parameter), a.kind === 219 && je(r, p.An_arrow_function_cannot_have_a_this_parameter), (a.kind === 177 || a.kind === 178) && je(r, p.get_and_set_accessors_cannot_declare_this_parameters)), r.dotDotDotToken && !As(r.name) && !$s(Qd(nn(r.symbol)), Uc) && je(r, p.A_rest_parameter_must_be_of_an_array_type);
- }
- function oot(r) {
- const a = cot(r);
- if (!a) {
- je(r, p.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
- return;
- }
- const l = Zf(a), f = Cp(l);
- if (!f)
- return;
- la(r.type);
- const { parameterName: m } = r;
- if (f.kind !== 0 && f.kind !== 2) {
- if (f.parameterIndex >= 0) {
- if (Su(l) && f.parameterIndex === l.parameters.length - 1)
- je(m, p.A_type_predicate_cannot_reference_a_rest_parameter);
- else if (f.type) {
- const y = () => vs(
- /*details*/
- void 0,
- p.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type
- );
- Au(
- f.type,
- nn(l.parameters[f.parameterIndex]),
- r.type,
- /*headMessage*/
- void 0,
- y
- );
- }
- } else if (m) {
- let y = !1;
- for (const { name: x } of a.parameters)
- if (As(x) && LNe(x, m, f.parameterName)) {
- y = !0;
- break;
- }
- y || je(r.parameterName, p.Cannot_find_parameter_0, f.parameterName);
- }
- }
- }
- function cot(r) {
- switch (r.parent.kind) {
- case 219:
- case 179:
- case 262:
- case 218:
- case 184:
- case 174:
- case 173:
- const a = r.parent;
- if (r === a.type)
- return a;
- }
- }
- function LNe(r, a, l) {
- for (const f of r.elements) {
- if (ml(f))
- continue;
- const m = f.name;
- if (m.kind === 80 && m.escapedText === l)
- return je(a, p.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, l), !0;
- if ((m.kind === 207 || m.kind === 206) && LNe(
- m,
- a,
- l
- ))
- return !0;
- }
- }
- function GN(r) {
- r.kind === 181 ? Rut(r) : (r.kind === 184 || r.kind === 262 || r.kind === 185 || r.kind === 179 || r.kind === 176 || r.kind === 180) && iX(r);
- const a = Jc(r);
- a & 4 || ((a & 3) === 3 && B < 5 && bl(
- r,
- 6144
- /* AsyncGeneratorIncludes */
- ), (a & 3) === 2 && B < 4 && bl(
- r,
- 64
- /* Awaiter */
- ), a & 3 && B < 2 && bl(
- r,
- 128
- /* Generator */
- )), GM(Ey(r)), Hct(r), ir(r.parameters, FNe), r.type && la(r.type), n(l);
- function l() {
- oct(r);
- let f = Y_(r), m = f;
- if (cn(r)) {
- const y = V1(r);
- if (y && y.typeExpression && vf(y.typeExpression.type)) {
- const x = ET(Ci(y.typeExpression));
- x && x.declaration && (f = Y_(x.declaration), m = y.typeExpression.type);
- }
- }
- if (ie && !f)
- switch (r.kind) {
- case 180:
- je(r, p.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
- break;
- case 179:
- je(r, p.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
- break;
- }
- if (f && m) {
- const y = Jc(r);
- if ((y & 5) === 1) {
- const x = Ci(f);
- x === Xt ? je(m, p.A_generator_cannot_have_a_void_type_annotation) : Sde(x, y, m);
- } else (y & 3) === 2 && Bot(r, f, m);
- }
- r.kind !== 181 && r.kind !== 317 && O1(r);
- }
- }
- function Sde(r, a, l) {
- const f = j2(0, r, (a & 2) !== 0) || xe, m = j2(1, r, (a & 2) !== 0) || f, y = j2(2, r, (a & 2) !== 0) || M, x = I$(f, m, y, !!(a & 2));
- return Au(x, r, l);
- }
- function lot(r) {
- const a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
- for (const y of r.members)
- if (y.kind === 176)
- for (const x of y.parameters)
- G_(x, y) && !As(x.name) && m(
- a,
- x.name,
- x.name.escapedText,
- 3
- /* GetOrSetAccessor */
- );
- else {
- const x = zs(y), N = y.name;
- if (!N)
- continue;
- const j = Di(N), W = j && x ? 16 : 0, Q = j ? f : x ? l : a, ye = N && tme(N);
- if (ye)
- switch (y.kind) {
- case 177:
- m(Q, N, ye, 1 | W);
- break;
- case 178:
- m(Q, N, ye, 2 | W);
- break;
- case 172:
- m(Q, N, ye, 3 | W);
- break;
- case 174:
- m(Q, N, ye, 8 | W);
- break;
- }
- }
- function m(y, x, N, j) {
- const W = y.get(N);
- if (W)
- if ((W & 16) !== (j & 16))
- je(x, p.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, nc(x));
- else {
- const Q = !!(W & 8), ye = !!(j & 8);
- Q || ye ? Q !== ye && je(x, p.Duplicate_identifier_0, nc(x)) : W & j & -17 ? je(x, p.Duplicate_identifier_0, nc(x)) : y.set(N, W | j);
- }
- else
- y.set(N, j);
- }
- }
- function uot(r) {
- for (const a of r.members) {
- const l = a.name;
- if (zs(a) && l) {
- const m = tme(l);
- switch (m) {
- case "name":
- case "length":
- case "caller":
- case "arguments":
- if (q)
- break;
- case "prototype":
- const y = p.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1, x = v1(Tn(r));
- je(l, y, m, x);
- break;
- }
- }
- }
- }
- function MNe(r) {
- const a = /* @__PURE__ */ new Map();
- for (const l of r.members)
- if (l.kind === 171) {
- let f;
- const m = l.name;
- switch (m.kind) {
- case 11:
- case 9:
- f = m.text;
- break;
- case 80:
- f = Nn(m);
- break;
- default:
- continue;
- }
- a.get(f) ? (je(os(l.symbol.valueDeclaration), p.Duplicate_identifier_0, f), je(l.name, p.Duplicate_identifier_0, f)) : a.set(f, !0);
- }
- }
- function Tde(r) {
- if (r.kind === 264) {
- const l = Tn(r);
- if (l.declarations && l.declarations.length > 0 && l.declarations[0] !== r)
- return;
- }
- const a = G_e(Tn(r));
- if (a?.declarations) {
- const l = /* @__PURE__ */ new Map();
- for (const f of a.declarations)
- f.parameters.length === 1 && f.parameters[0].type && TT(Ci(f.parameters[0].type), (m) => {
- const y = l.get(Rl(m));
- y ? y.declarations.push(f) : l.set(Rl(m), { type: m, declarations: [f] });
- });
- l.forEach((f) => {
- if (f.declarations.length > 1)
- for (const m of f.declarations)
- je(m, p.Duplicate_index_signature_for_type_0, Hr(f.type));
- });
- }
- }
- function RNe(r) {
- !vh(r) && !s_t(r) && sX(r.name), VM(r), M$(r), Gn(
- r,
- 64
- /* Abstract */
- ) && r.kind === 172 && r.initializer && je(r, p.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, _o(r.name));
- }
- function _ot(r) {
- return Di(r.name) && je(r, p.Private_identifiers_are_not_allowed_outside_class_bodies), RNe(r);
- }
- function fot(r) {
- e7e(r) || sX(r.name), hc(r) && r.asteriskToken && Oe(r.name) && Nn(r.name) === "constructor" && je(r.name, p.Class_constructor_may_not_be_a_generator), XNe(r), Gn(
- r,
- 64
- /* Abstract */
- ) && r.kind === 174 && r.body && je(r, p.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, _o(r.name)), Di(r.name) && !Ol(r) && je(r, p.Private_identifiers_are_not_allowed_outside_class_bodies), M$(r);
- }
- function M$(r) {
- if (Di(r.name) && (B < 9 || B < 99 || !q)) {
- for (let a = Cd(r); a; a = Cd(a))
- bn(a).flags |= 1048576;
- if ($c(r.parent)) {
- const a = vpe(r.parent);
- a && (bn(r.name).flags |= 32768, bn(a).flags |= 4096);
- }
- }
- }
- function pot(r) {
- vh(r), bs(r, la);
- }
- function dot(r) {
- GN(r), n_t(r) || i_t(r), la(r.body);
- const a = Tn(r), l = Jo(a, r.kind);
- if (r === l && j$(a), rc(r.body))
- return;
- n(m);
- return;
- function f(y) {
- return Ou(y) ? !0 : y.kind === 172 && !zs(y) && !!y.initializer;
- }
- function m() {
- const y = r.parent;
- if (Cb(y)) {
- bpe(r.parent, y);
- const x = Spe(y), N = GAe(r.body);
- if (N) {
- if (x && je(N, p.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null), !V && (ut(r.parent.members, f) || ut(r.parameters, (W) => Gn(
- W,
- 31
- /* ParameterPropertyModifier */
- ))))
- if (!mot(N, r.body))
- je(N, p.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
- else {
- let W;
- for (const Q of r.body.statements) {
- if (Pl(Q) && rS(Dc(Q.expression))) {
- W = Q;
- break;
- }
- if (jNe(Q))
- break;
- }
- W === void 0 && je(r, p.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers);
- }
- } else x || je(r, p.Constructors_for_derived_classes_must_contain_a_super_call);
- }
- }
- }
- function mot(r, a) {
- const l = ag(r.parent);
- return Pl(l) && l.parent === a;
- }
- function jNe(r) {
- return r.kind === 108 || r.kind === 110 ? !0 : OZ(r) ? !1 : !!bs(r, jNe);
- }
- function BNe(r) {
- Oe(r.name) && Nn(r.name) === "constructor" && Zn(r.parent) && je(r.name, p.Class_constructor_may_not_be_an_accessor), n(a), la(r.body), M$(r);
- function a() {
- if (!iX(r) && !Hut(r) && sX(r.name), zM(r), GN(r), r.kind === 177 && !(r.flags & 33554432) && Mp(r.body) && r.flags & 512 && (r.flags & 1024 || je(r.name, p.A_get_accessor_must_return_a_value)), r.name.kind === 167 && Wm(r.name), oE(r)) {
- const f = Tn(r), m = Jo(
- f,
- 177
- /* GetAccessor */
- ), y = Jo(
- f,
- 178
- /* SetAccessor */
- );
- if (m && y && !($k(m) & 1)) {
- bn(m).flags |= 1;
- const x = Mu(m), N = Mu(y);
- (x & 64) !== (N & 64) && (je(m.name, p.Accessors_must_both_be_abstract_or_non_abstract), je(y.name, p.Accessors_must_both_be_abstract_or_non_abstract)), (x & 4 && !(N & 6) || x & 2 && !(N & 2)) && (je(m.name, p.A_get_accessor_must_be_at_least_as_accessible_as_the_setter), je(y.name, p.A_get_accessor_must_be_at_least_as_accessible_as_the_setter));
- }
- }
- const l = fN(Tn(r));
- r.kind === 177 && fde(r, l);
- }
- }
- function got(r) {
- zM(r);
- }
- function hot(r, a, l) {
- return r.typeArguments && l < r.typeArguments.length ? Ci(r.typeArguments[l]) : R$(r, a)[l];
- }
- function R$(r, a) {
- return C1(lr(r.typeArguments, Ci), a, Bm(a), cn(r));
- }
- function JNe(r, a) {
- let l, f, m = !0;
- for (let y = 0; y < a.length; y++) {
- const x = s_(a[y]);
- x && (l || (l = R$(r, a), f = B_(a, l)), m = m && Au(
- l[y],
- zi(x, f),
- r.typeArguments[y],
- p.Type_0_does_not_satisfy_the_constraint_1
- ));
- }
- return m;
- }
- function yot(r, a) {
- if (!H(r))
- return a.flags & 524288 && Bi(a).typeParameters || (wn(r) & 4 ? r.target.localTypeParameters : void 0);
- }
- function xde(r) {
- const a = Ci(r);
- if (!H(a)) {
- const l = bn(r).resolvedSymbol;
- if (l)
- return yot(a, l);
- }
- }
- function kde(r) {
- if (YM(r, r.typeArguments), r.kind === 183 && !cn(r) && !e3(r) && r.typeArguments && r.typeName.end !== r.typeArguments.pos) {
- const a = Tr(r);
- bZ(a, r.typeName.end) === 25 && B2(r, aa(a.text, r.typeName.end), 1, p.JSDoc_types_can_only_be_used_inside_documentation_comments);
- }
- ir(r.typeArguments, la), zNe(r);
- }
- function zNe(r) {
- const a = Ci(r);
- if (!H(a)) {
- r.typeArguments && n(() => {
- const f = xde(r);
- f && JNe(r, f);
- });
- const l = bn(r).resolvedSymbol;
- l && ut(l.declarations, (f) => hx(f) && !!(f.flags & 536870912)) && Xh(
- NM(r),
- l.declarations,
- l.escapedName
- );
- }
- }
- function vot(r) {
- const a = Wn(r.parent, ZI);
- if (!a) return;
- const l = xde(a);
- if (!l) return;
- const f = s_(l[a.typeArguments.indexOf(r)]);
- return f && zi(f, B_(l, R$(a, l)));
- }
- function bot(r) {
- Dwe(r);
- }
- function Sot(r) {
- ir(r.members, la), n(a);
- function a() {
- const l = h3e(r);
- q$(l, l.symbol), Tde(r), MNe(r);
- }
- }
- function Tot(r) {
- la(r.elementType);
- }
- function xot(r) {
- let a = !1, l = !1;
- for (const f of r.elements) {
- let m = afe(f);
- if (m & 8) {
- const y = Ci(f.type);
- if (!oy(y)) {
- je(f, p.A_rest_element_type_must_be_an_array_type);
- break;
- }
- (Dp(y) || ha(y) && y.target.combinedFlags & 4) && (m |= 4);
- }
- if (m & 4) {
- if (l) {
- dr(f, p.A_rest_element_cannot_follow_another_rest_element);
- break;
- }
- l = !0;
- } else if (m & 2) {
- if (l) {
- dr(f, p.An_optional_element_cannot_follow_a_rest_element);
- break;
- }
- a = !0;
- } else if (m & 1 && a) {
- dr(f, p.A_required_element_cannot_follow_an_optional_element);
- break;
- }
- }
- ir(r.elements, la), Ci(r);
- }
- function kot(r) {
- ir(r.types, la), Ci(r);
- }
- function WNe(r, a) {
- if (!(r.flags & 8388608))
- return r;
- const l = r.objectType, f = r.indexType, m = R_(l) && NL(l) === 2 ? t3e(
- l,
- 0
- /* None */
- ) : Jm(
- l,
- 0
- /* None */
- ), y = !!dh(l, At);
- if (z_(f, (x) => $s(x, m) || y && Ak(x, At)))
- return a.kind === 212 && b0(a) && wn(l) & 32 && xg(l) & 1 && je(a, p.Index_signature_in_type_0_only_permits_reading, Hr(l)), r;
- if (dT(l)) {
- const x = DG(f, a);
- if (x) {
- const N = TT(Uu(l), (j) => Gs(j, x));
- if (N && lp(N) & 6)
- return je(a, p.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, Ei(x)), He;
- }
- }
- return je(a, p.Type_0_cannot_be_used_to_index_type_1, Hr(f), Hr(l)), He;
- }
- function Cot(r) {
- la(r.objectType), la(r.indexType), WNe(_3e(r), r);
- }
- function Eot(r) {
- Dot(r), la(r.typeParameter), la(r.nameType), la(r.type), r.type || tb(r, xe);
- const a = yfe(r), l = ny(a);
- if (l)
- Au(l, Ft, r.nameType);
- else {
- const f = Yf(a);
- Au(f, Ft, oC(r.typeParameter));
- }
- }
- function Dot(r) {
- var a;
- if ((a = r.members) != null && a.length)
- return dr(r.members[0], p.A_mapped_type_may_not_declare_properties_or_methods);
- }
- function Pot(r) {
- Cfe(r);
- }
- function wot(r) {
- $ut(r), la(r.type);
- }
- function Aot(r) {
- bs(r, la);
- }
- function Not(r) {
- or(r, (l) => l.parent && l.parent.kind === 194 && l.parent.extendsType === l) || dr(r, p.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type), la(r.typeParameter);
- const a = Tn(r.typeParameter);
- if (a.declarations && a.declarations.length > 1) {
- const l = Bi(a);
- if (!l.typeParametersChecked) {
- l.typeParametersChecked = !0;
- const f = T2(a), m = YY(
- a,
- 168
- /* TypeParameter */
- );
- if (!dIe(m, [f], (y) => [y])) {
- const y = Ji(a);
- for (const x of m)
- je(x.name, p.All_declarations_of_0_must_have_identical_constraints, y);
- }
- }
- }
- O1(r);
- }
- function Iot(r) {
- for (const a of r.templateSpans) {
- la(a.type);
- const l = Ci(a.type);
- Au(l, gs, a.type);
- }
- Ci(r);
- }
- function Oot(r) {
- la(r.argument), r.attributes && d6(r.attributes, dr), zNe(r);
- }
- function Fot(r) {
- r.dotDotDotToken && r.questionToken && dr(r, p.A_tuple_member_cannot_be_both_optional_and_rest), r.type.kind === 190 && dr(r.type, p.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type), r.type.kind === 191 && dr(r.type, p.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type), la(r.type), Ci(r);
- }
- function JM(r) {
- return (Z_(
- r,
- 2
- /* Private */
- ) || Ou(r)) && !!(r.flags & 33554432);
- }
- function $N(r, a) {
- let l = aX(r);
- if (r.parent.kind !== 264 && r.parent.kind !== 263 && r.parent.kind !== 231 && r.flags & 33554432) {
- const f = _7(r);
- f && f.flags & 128 && !(l & 128) && !(Sm(r.parent) && zc(r.parent.parent) && ig(r.parent.parent)) && (l |= 32), l |= 128;
- }
- return l & a;
- }
- function j$(r) {
- n(() => Lot(r));
- }
- function Lot(r) {
- function a(pr, er) {
- return er !== void 0 && er.parent === pr[0].parent ? er : pr[0];
- }
- function l(pr, er, gn, Un, ci) {
- if ((Un ^ ci) !== 0) {
- const Us = $N(a(pr, er), gn);
- Zk(pr, (js) => Tr(js).fileName).forEach((js) => {
- const Oo = $N(a(js, er), gn);
- for (const ls of js) {
- const sc = $N(ls, gn) ^ Us, Jl = $N(ls, gn) ^ Oo;
- Jl & 32 ? je(os(ls), p.Overload_signatures_must_all_be_exported_or_non_exported) : Jl & 128 ? je(os(ls), p.Overload_signatures_must_all_be_ambient_or_non_ambient) : sc & 6 ? je(os(ls) || ls, p.Overload_signatures_must_all_be_public_private_or_protected) : sc & 64 && je(os(ls), p.Overload_signatures_must_all_be_abstract_or_non_abstract);
- }
- });
- }
- }
- function f(pr, er, gn, Un) {
- if (gn !== Un) {
- const ci = tx(a(pr, er));
- ir(pr, (Jn) => {
- tx(Jn) !== ci && je(os(Jn), p.Overload_signatures_must_all_be_optional_or_required);
- });
- }
- }
- const m = 230;
- let y = 0, x = m, N = !1, j = !0, W = !1, Q, ye, de;
- const Ze = r.declarations, ct = (r.flags & 16384) !== 0;
- function mt(pr) {
- if (pr.name && rc(pr.name))
- return;
- let er = !1;
- const gn = bs(pr.parent, (ci) => {
- if (er)
- return ci;
- er = ci === pr;
- });
- if (gn && gn.pos === pr.end && gn.kind === pr.kind) {
- const ci = gn.name || gn, Jn = gn.name;
- if (pr.name && Jn && // both are private identifiers
- (Di(pr.name) && Di(Jn) && pr.name.escapedText === Jn.escapedText || // Both are computed property names
- ma(pr.name) && ma(Jn) && hh(Wm(pr.name), Wm(Jn)) || // Both are literal property names that are the same.
- fm(pr.name) && fm(Jn) && C4(pr.name) === C4(Jn))) {
- if ((pr.kind === 174 || pr.kind === 173) && zs(pr) !== zs(gn)) {
- const js = zs(pr) ? p.Function_overload_must_be_static : p.Function_overload_must_not_be_static;
- je(ci, js);
- }
- return;
- }
- if (Mp(gn.body)) {
- je(ci, p.Function_implementation_name_must_be_0, _o(pr.name));
- return;
- }
- }
- const Un = pr.name || pr;
- ct ? je(Un, p.Constructor_implementation_is_missing) : Gn(
- pr,
- 64
- /* Abstract */
- ) ? je(Un, p.All_declarations_of_an_abstract_method_must_be_consecutive) : je(Un, p.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
- }
- let Gt = !1, sr = !1, Xr = !1;
- const tn = [];
- if (Ze)
- for (const pr of Ze) {
- const er = pr, gn = er.flags & 33554432, Un = er.parent && (er.parent.kind === 264 || er.parent.kind === 187) || gn;
- if (Un && (de = void 0), (er.kind === 263 || er.kind === 231) && !gn && (Xr = !0), er.kind === 262 || er.kind === 174 || er.kind === 173 || er.kind === 176) {
- tn.push(er);
- const ci = $N(er, m);
- y |= ci, x &= ci, N = N || tx(er), j = j && tx(er);
- const Jn = Mp(er.body);
- Jn && Q ? ct ? sr = !0 : Gt = !0 : de?.parent === er.parent && de.end !== er.pos && mt(de), Jn ? Q || (Q = er) : W = !0, de = er, Un || (ye = er);
- }
- cn(pr) && ys(pr) && pr.jsDoc && (W = Nr(uB(pr)) > 0);
- }
- if (sr && ir(tn, (pr) => {
- je(pr, p.Multiple_constructor_implementations_are_not_allowed);
- }), Gt && ir(tn, (pr) => {
- je(os(pr) || pr, p.Duplicate_function_implementation);
- }), Xr && !ct && r.flags & 16 && Ze) {
- const pr = Ln(
- Ze,
- (er) => er.kind === 263
- /* ClassDeclaration */
- ).map((er) => Kr(er, p.Consider_adding_a_declare_modifier_to_this_class));
- ir(Ze, (er) => {
- const gn = er.kind === 263 ? p.Class_declaration_cannot_implement_overload_list_for_0 : er.kind === 262 ? p.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0;
- gn && Rs(
- je(os(er) || er, gn, mc(r)),
- ...pr
- );
- });
- }
- if (ye && !ye.body && !Gn(
- ye,
- 64
- /* Abstract */
- ) && !ye.questionToken && mt(ye), W && (Ze && (l(Ze, Q, m, y, x), f(Ze, Q, N, j)), Q)) {
- const pr = E2(r), er = Zf(Q);
- for (const gn of pr)
- if (!Gtt(er, gn)) {
- const Un = gn.declaration && Lh(gn.declaration) ? gn.declaration.parent.tagName : gn.declaration;
- Rs(
- je(Un, p.This_overload_signature_is_not_compatible_with_its_implementation_signature),
- Kr(Q, p.The_implementation_signature_is_declared_here)
- );
- break;
- }
- }
- }
- function XN(r) {
- n(() => Mot(r));
- }
- function Mot(r) {
- let a = r.localSymbol;
- if (!a && (a = Tn(r), !a.exportSymbol) || Jo(a, r.kind) !== r)
- return;
- let l = 0, f = 0, m = 0;
- for (const W of a.declarations) {
- const Q = j(W), ye = $N(
- W,
- 2080
- /* Default */
- );
- ye & 32 ? ye & 2048 ? m |= Q : l |= Q : f |= Q;
- }
- const y = l | f, x = l & f, N = m & y;
- if (x || N)
- for (const W of a.declarations) {
- const Q = j(W), ye = os(W);
- Q & N ? je(ye, p.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, _o(ye)) : Q & x && je(ye, p.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, _o(ye));
- }
- function j(W) {
- let Q = W;
- switch (Q.kind) {
- case 264:
- case 265:
- case 346:
- case 338:
- case 340:
- return 2;
- case 267:
- return Fu(Q) || Rh(Q) !== 0 ? 5 : 4;
- case 263:
- case 266:
- case 306:
- return 3;
- case 307:
- return 7;
- case 277:
- case 226:
- const ye = Q, de = wo(ye) ? ye.expression : ye.right;
- if (!yo(de))
- return 1;
- Q = de;
- case 271:
- case 274:
- case 273:
- let Ze = 0;
- const ct = Zl(Tn(Q));
- return ir(ct.declarations, (mt) => {
- Ze |= j(mt);
- }), Ze;
- case 260:
- case 208:
- case 262:
- case 276:
- case 80:
- return 1;
- case 173:
- case 171:
- return 2;
- default:
- return E.failBadSyntaxKind(Q);
- }
- }
- }
- function WP(r, a, l, ...f) {
- const m = QN(r, a);
- return m && qk(m, a, l, ...f);
- }
- function QN(r, a, l) {
- if (Wa(r))
- return;
- const f = r;
- if (f.promisedTypeOfPromise)
- return f.promisedTypeOfPromise;
- if (Mm(r, JL(
- /*reportErrors*/
- !1
- )))
- return f.promisedTypeOfPromise = Io(r)[0];
- if (HN(
- kg(r),
- 402915324
- /* Never */
- ))
- return;
- const m = Rc(r, "then");
- if (Wa(m))
- return;
- const y = m ? Ns(
- m,
- 0
- /* Call */
- ) : Ue;
- if (y.length === 0) {
- a && je(a, p.A_promise_must_have_a_then_method);
- return;
- }
- let x, N;
- for (const Q of y) {
- const ye = Xv(Q);
- ye && ye !== Xt && !zm(r, ye, sh) ? x = ye : N = wr(N, Q);
- }
- if (!N) {
- E.assertIsDefined(x), l && (l.value = x), a && je(a, p.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, Hr(r), Hr(x));
- return;
- }
- const j = ad(
- Qn(lr(N, ode)),
- 2097152
- /* NEUndefinedOrNull */
- );
- if (Wa(j))
- return;
- const W = Ns(
- j,
- 0
- /* Call */
- );
- if (W.length === 0) {
- a && je(a, p.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);
- return;
- }
- return f.promisedTypeOfPromise = Qn(
- lr(W, ode),
- 2
- /* Subtype */
- );
- }
- function YN(r, a, l, f, ...m) {
- return (a ? qk(r, l, f, ...m) : ly(r, l, f, ...m)) || He;
- }
- function UNe(r) {
- if (HN(
- kg(r),
- 402915324
- /* Never */
- ))
- return !1;
- const a = Rc(r, "then");
- return !!a && Ns(
- ad(
- a,
- 2097152
- /* NEUndefinedOrNull */
- ),
- 0
- /* Call */
- ).length > 0;
- }
- function B$(r) {
- var a;
- if (r.flags & 16777216) {
- const l = sfe(
- /*reportErrors*/
- !1
- );
- return !!l && r.aliasSymbol === l && ((a = r.aliasTypeArguments) == null ? void 0 : a.length) === 1;
- }
- return !1;
- }
- function UP(r) {
- return r.flags & 1048576 ? Xo(r, UP) : B$(r) ? r.aliasTypeArguments[0] : r;
- }
- function VNe(r) {
- if (Wa(r) || B$(r))
- return !1;
- if (dT(r)) {
- const a = Kl(r);
- if (a ? a.flags & 3 || a0(a) || Pp(a, UNe) : bc(
- r,
- 8650752
- /* TypeVariable */
- ))
- return !0;
- }
- return !1;
- }
- function Rot(r) {
- const a = sfe(
- /*reportErrors*/
- !0
- );
- if (a)
- return _E(a, [UP(r)]);
- }
- function jot(r) {
- return VNe(r) ? Rot(r) ?? r : (E.assert(B$(r) || QN(r) === void 0, "type provided should not be a non-generic 'promise'-like."), r);
- }
- function qk(r, a, l, ...f) {
- const m = ly(r, a, l, ...f);
- return m && jot(m);
- }
- function ly(r, a, l, ...f) {
- if (Wa(r) || B$(r))
- return r;
- const m = r;
- if (m.awaitedTypeOfType)
- return m.awaitedTypeOfType;
- if (r.flags & 1048576) {
- if (a1.lastIndexOf(r.id) >= 0) {
- a && je(a, p.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);
- return;
- }
- const N = a ? (W) => ly(W, a, l, ...f) : ly;
- a1.push(r.id);
- const j = Xo(r, N);
- return a1.pop(), m.awaitedTypeOfType = j;
- }
- if (VNe(r))
- return m.awaitedTypeOfType = r;
- const y = { value: void 0 }, x = QN(
- r,
- /*errorNode*/
- void 0,
- y
- );
- if (x) {
- if (r.id === x.id || a1.lastIndexOf(x.id) >= 0) {
- a && je(a, p.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);
- return;
- }
- a1.push(r.id);
- const N = ly(x, a, l, ...f);
- return a1.pop(), N ? m.awaitedTypeOfType = N : void 0;
- }
- if (UNe(r)) {
- if (a) {
- E.assertIsDefined(l);
- let N;
- y.value && (N = vs(N, p.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, Hr(r), Hr(y.value))), N = vs(N, l, ...f), Da.add(Rg(Tr(a), a, N));
- }
- return;
- }
- return m.awaitedTypeOfType = r;
- }
- function Bot(r, a, l) {
- const f = Ci(a);
- if (B >= 2) {
- if (H(f))
- return;
- const y = JL(
- /*reportErrors*/
- !0
- );
- if (y !== Vi && !Mm(f, y)) {
- m(p.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, a, l, Hr(ly(f) || Xt));
- return;
- }
- } else {
- if (Wk(
- r,
- 5
- /* AsyncFunction */
- ), H(f))
- return;
- const y = Yw(a);
- if (y === void 0) {
- m(p.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, a, l, Hr(f));
- return;
- }
- const x = Yo(
- y,
- 111551,
- /*ignoreErrors*/
- !0
- ), N = x ? nn(x) : He;
- if (H(N)) {
- y.kind === 80 && y.escapedText === "Promise" && cT(f) === JL(
- /*reportErrors*/
- !1
- ) ? je(l, p.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option) : m(p.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, a, l, $_(y));
- return;
- }
- const j = KKe(
- /*reportErrors*/
- !0
- );
- if (j === xs) {
- m(p.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, a, l, $_(y));
- return;
- }
- const W = p.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;
- if (!Au(N, j, l, W, () => a === l ? void 0 : vs(
- /*details*/
- void 0,
- p.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type
- )))
- return;
- const ye = y && E_(y), de = Al(
- r.locals,
- ye.escapedText,
- 111551
- /* Value */
- );
- if (de) {
- je(de.valueDeclaration, p.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, Nn(ye), $_(y));
- return;
- }
- }
- YN(
- f,
- /*withAlias*/
- !1,
- r,
- p.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- );
- function m(y, x, N, j) {
- if (x === N)
- je(N, y, j);
- else {
- const W = je(N, p.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
- Rs(W, Kr(x, y, j));
- }
- }
- }
- function Jot(r) {
- const a = Tr(r);
- if (!F1(a)) {
- let l = r.expression;
- if (Yu(l))
- return !1;
- let f = !0, m;
- for (; ; ) {
- if (Oh(l) || Ox(l)) {
- l = l.expression;
- continue;
- }
- if (Fs(l)) {
- f || (m = l), l.questionDotToken && (m = l.questionDotToken), l = l.expression, f = !1;
- continue;
- }
- if (Cn(l)) {
- l.questionDotToken && (m = l.questionDotToken), l = l.expression, f = !1;
- continue;
- }
- Oe(l) || (m = l);
- break;
- }
- if (m)
- return Rs(
- je(r.expression, p.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),
- Kr(m, p.Invalid_syntax_in_decorator)
- ), !0;
- }
- return !1;
- }
- function zot(r) {
- Jot(r);
- const a = TE(r);
- A$(a, r);
- const l = Ha(a);
- if (l.flags & 1)
- return;
- const f = ude(r);
- if (!f?.resolvedReturnType) return;
- let m;
- const y = f.resolvedReturnType;
- switch (r.parent.kind) {
- case 263:
- case 231:
- m = p.Decorator_function_return_type_0_is_not_assignable_to_type_1;
- break;
- case 172:
- if (!X) {
- m = p.Decorator_function_return_type_0_is_not_assignable_to_type_1;
- break;
- }
- case 169:
- m = p.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
- break;
- case 174:
- case 177:
- case 178:
- m = p.Decorator_function_return_type_0_is_not_assignable_to_type_1;
- break;
- default:
- return E.failBadSyntaxKind(r.parent);
- }
- Au(l, y, r.expression, m);
- }
- function ZN(r, a, l, f, m, y = l.length, x = 0) {
- const N = A.createFunctionTypeNode(
- /*typeParameters*/
- void 0,
- Ue,
- A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- );
- return ph(N, r, a, l, f, m, y, x);
- }
- function Cde(r, a, l, f, m, y, x) {
- const N = ZN(r, a, l, f, m, y, x);
- return _T(N);
- }
- function qNe(r) {
- return Cde(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- Ue,
- r
- );
- }
- function HNe(r) {
- const a = gd("value", r);
- return Cde(
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- [a],
- Xt
- );
- }
- function Ede(r) {
- if (r)
- switch (r.kind) {
- case 193:
- case 192:
- return GNe(r.types);
- case 194:
- return GNe([r.trueType, r.falseType]);
- case 196:
- case 202:
- return Ede(r.type);
- case 183:
- return r.typeName;
- }
- }
- function GNe(r) {
- let a;
- for (let l of r) {
- for (; l.kind === 196 || l.kind === 202; )
- l = l.type;
- if (l.kind === 146 || !ee && (l.kind === 201 && l.literal.kind === 106 || l.kind === 157))
- continue;
- const f = Ede(l);
- if (!f)
- return;
- if (a) {
- if (!Oe(a) || !Oe(f) || a.escapedText !== f.escapedText)
- return;
- } else
- a = f;
- }
- return a;
- }
- function J$(r) {
- const a = Gc(r);
- return rg(r) ? Kj(a) : a;
- }
- function zM(r) {
- if (!Vb(r) || !Ff(r) || !r.modifiers || !Zw(X, r, r.parent, r.parent.parent))
- return;
- const a = On(r.modifiers, dl);
- if (a) {
- X ? (bl(
- a,
- 8
- /* Decorate */
- ), r.kind === 169 && bl(
- a,
- 32
- /* Param */
- )) : B < 99 && (bl(
- a,
- 8
- /* ESDecorateAndRunInitializers */
- ), Xc(r) ? r.name ? mIe(r) && bl(
- a,
- 4194304
- /* SetFunctionName */
- ) : bl(
- a,
- 4194304
- /* SetFunctionName */
- ) : $c(r) || (Di(r.name) && (hc(r) || Ay(r) || u_(r)) && bl(
- a,
- 4194304
- /* SetFunctionName */
- ), ma(r.name) && bl(
- a,
- 8388608
- /* PropKey */
- ))), Wk(
- r,
- 8
- /* Decorator */
- );
- for (const l of r.modifiers)
- dl(l) && zot(l);
- }
- }
- function Wot(r) {
- n(a);
- function a() {
- XNe(r), Yde(r), VP(r, r.name);
- }
- }
- function Uot(r) {
- r.typeExpression || je(r.name, p.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags), r.name && qP(r.name, p.Type_alias_name_cannot_be_0), la(r.typeExpression), GM(Ey(r));
- }
- function Vot(r) {
- la(r.constraint);
- for (const a of r.typeParameters)
- la(a);
- }
- function qot(r) {
- la(r.typeExpression);
- }
- function Hot(r) {
- la(r.typeExpression);
- const a = tv(r);
- if (a) {
- const l = jI(a, sO);
- if (Nr(l) > 1)
- for (let f = 1; f < Nr(l); f++) {
- const m = l[f].tagName;
- je(m, p._0_tag_already_specified, Nn(m));
- }
- }
- }
- function Got(r) {
- r.name && XM(
- r.name,
- /*ignoreErrors*/
- !0
- );
- }
- function $ot(r) {
- la(r.typeExpression);
- }
- function Xot(r) {
- la(r.typeExpression);
- }
- function Qot(r) {
- n(a), GN(r);
- function a() {
- !r.type && !CC(r) && tb(r, xe);
- }
- }
- function Yot(r) {
- const a = tv(r);
- a && Co(a) && je(r.tagName, p.An_arrow_function_cannot_have_a_this_parameter);
- }
- function Zot(r) {
- Jde(r);
- }
- function Kot(r) {
- const a = tv(r);
- (!a || !Xc(a) && !$c(a)) && je(a, p.JSDoc_0_is_not_attached_to_a_class, Nn(r.tagName));
- }
- function ect(r) {
- const a = tv(r);
- if (!a || !Xc(a) && !$c(a)) {
- je(a, p.JSDoc_0_is_not_attached_to_a_class, Nn(r.tagName));
- return;
- }
- const l = H1(a).filter(Mx);
- E.assert(l.length > 0), l.length > 1 && je(l[1], p.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);
- const f = $Ne(r.class.expression), m = Cb(a);
- if (m) {
- const y = $Ne(m.expression);
- y && f.escapedText !== y.escapedText && je(f, p.JSDoc_0_1_does_not_match_the_extends_2_clause, Nn(r.tagName), Nn(f), Nn(y));
- }
- }
- function tct(r) {
- const a = xb(r);
- a && Ou(a) && je(r, p.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
- }
- function $Ne(r) {
- switch (r.kind) {
- case 80:
- return r;
- case 211:
- return r.name;
- default:
- return;
- }
- }
- function XNe(r) {
- var a;
- zM(r), GN(r);
- const l = Jc(r);
- if (r.name && r.name.kind === 167 && Wm(r.name), oE(r)) {
- const y = Tn(r), x = r.localSymbol || y, N = (a = x.declarations) == null ? void 0 : a.find(
- // Get first non javascript function declaration
- (j) => j.kind === r.kind && !(j.flags & 524288)
- );
- r === N && j$(x), y.parent && j$(y);
- }
- const f = r.kind === 173 ? void 0 : r.body;
- if (la(f), fde(r, lE(r)), n(m), cn(r)) {
- const y = V1(r);
- y && y.typeExpression && !wpe(Ci(y.typeExpression), r) && je(y.typeExpression.type, p.The_type_of_a_function_declaration_must_match_the_function_s_signature);
- }
- function m() {
- Y_(r) || (rc(f) && !JM(r) && tb(r, xe), l & 1 && Mp(f) && Ha(Zf(r)));
- }
- }
- function O1(r) {
- n(a);
- function a() {
- const l = Tr(r);
- let f = Bd.get(l.path);
- f || (f = [], Bd.set(l.path, f)), f.push(r);
- }
- }
- function QNe(r, a) {
- for (const l of r)
- switch (l.kind) {
- case 263:
- case 231:
- rct(l, a), Dde(l, a);
- break;
- case 307:
- case 267:
- case 241:
- case 269:
- case 248:
- case 249:
- case 250:
- KNe(l, a);
- break;
- case 176:
- case 218:
- case 262:
- case 219:
- case 174:
- case 177:
- case 178:
- l.body && KNe(l, a), Dde(l, a);
- break;
- case 173:
- case 179:
- case 180:
- case 184:
- case 185:
- case 265:
- case 264:
- Dde(l, a);
- break;
- case 195:
- nct(l, a);
- break;
- default:
- E.assertNever(l, "Node should not have been registered for unused identifiers check");
- }
- }
- function YNe(r, a, l) {
- const f = os(r) || r, m = hx(r) ? p._0_is_declared_but_never_used : p._0_is_declared_but_its_value_is_never_read;
- l(r, 0, Kr(f, m, a));
- }
- function KN(r) {
- return Oe(r) && Nn(r).charCodeAt(0) === 95;
- }
- function rct(r, a) {
- for (const l of r.members)
- switch (l.kind) {
- case 174:
- case 172:
- case 177:
- case 178:
- if (l.kind === 178 && l.symbol.flags & 32768)
- break;
- const f = Tn(l);
- !f.isReferenced && (Z_(
- l,
- 2
- /* Private */
- ) || Vl(l) && Di(l.name)) && !(l.flags & 33554432) && a(l, 0, Kr(l.name, p._0_is_declared_but_its_value_is_never_read, Ji(f)));
- break;
- case 176:
- for (const m of l.parameters)
- !m.symbol.isReferenced && Gn(
- m,
- 2
- /* Private */
- ) && a(m, 0, Kr(m.name, p.Property_0_is_declared_but_its_value_is_never_read, mc(m.symbol)));
- break;
- case 181:
- case 240:
- case 175:
- break;
- default:
- E.fail("Unexpected class member");
- }
- }
- function nct(r, a) {
- const { typeParameter: l } = r;
- Pde(l) && a(r, 1, Kr(r, p._0_is_declared_but_its_value_is_never_read, Nn(l.name)));
- }
- function Dde(r, a) {
- const l = Tn(r).declarations;
- if (!l || _a(l) !== r) return;
- const f = Ey(r), m = /* @__PURE__ */ new Set();
- for (const y of f) {
- if (!Pde(y)) continue;
- const x = Nn(y.name), { parent: N } = y;
- if (N.kind !== 195 && N.typeParameters.every(Pde)) {
- if (Xm(m, N)) {
- const j = Tr(N), W = qp(N) ? lJ(N) : uJ(j, N.typeParameters), ye = N.typeParameters.length === 1 ? [p._0_is_declared_but_its_value_is_never_read, x] : [p.All_type_parameters_are_unused];
- a(y, 1, fl(j, W.pos, W.end - W.pos, ...ye));
- }
- } else
- a(y, 1, Kr(y, p._0_is_declared_but_its_value_is_never_read, x));
- }
- }
- function Pde(r) {
- return !(Ra(r.symbol).isReferenced & 262144) && !KN(r.name);
- }
- function WM(r, a, l, f) {
- const m = String(f(a)), y = r.get(m);
- y ? y[1].push(l) : r.set(m, [a, [l]]);
- }
- function ZNe(r) {
- return Wn(pm(r), Ii);
- }
- function ict(r) {
- return va(r) ? Mf(r.parent) ? !!(r.propertyName && KN(r.name)) : KN(r.name) : Fu(r) || (ii(r) && Z2(r.parent.parent) || eIe(r)) && KN(r.name);
- }
- function KNe(r, a) {
- const l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
- r.locals.forEach((y) => {
- if (!(y.flags & 262144 ? !(y.flags & 3 && !(y.isReferenced & 3)) : y.isReferenced || y.exportSymbol) && y.declarations) {
- for (const x of y.declarations)
- if (!ict(x))
- if (eIe(x))
- WM(l, act(x), x, Ma);
- else if (va(x) && Mf(x.parent)) {
- const N = _a(x.parent.elements);
- (x === N || !_a(x.parent.elements).dotDotDotToken) && WM(f, x.parent, x, Ma);
- } else if (ii(x)) {
- const N = J2(x) & 7, j = os(x);
- (N !== 4 && N !== 6 || !j || !KN(j)) && WM(m, x.parent, x, Ma);
- } else {
- const N = y.valueDeclaration && ZNe(y.valueDeclaration), j = y.valueDeclaration && os(y.valueDeclaration);
- N && j ? !G_(N, N.parent) && !Db(N) && !KN(j) && (va(x) && w0(x.parent) ? WM(f, x.parent, x, Ma) : a(N, 1, Kr(j, p._0_is_declared_but_its_value_is_never_read, mc(y)))) : YNe(x, mc(y), a);
- }
- }
- }), l.forEach(([y, x]) => {
- const N = y.parent;
- if ((y.name ? 1 : 0) + (y.namedBindings ? y.namedBindings.kind === 274 ? 1 : y.namedBindings.elements.length : 0) === x.length)
- a(
- N,
- 0,
- x.length === 1 ? Kr(N, p._0_is_declared_but_its_value_is_never_read, Nn(xa(x).name)) : Kr(N, p.All_imports_in_import_declaration_are_unused)
- );
- else
- for (const W of x) YNe(W, Nn(W.name), a);
- }), f.forEach(([y, x]) => {
- const N = ZNe(y.parent) ? 1 : 0;
- if (y.elements.length === x.length)
- x.length === 1 && y.parent.kind === 260 && y.parent.parent.kind === 261 ? WM(m, y.parent.parent, y.parent, Ma) : a(
- y,
- N,
- x.length === 1 ? Kr(y, p._0_is_declared_but_its_value_is_never_read, UM(xa(x).name)) : Kr(y, p.All_destructured_elements_are_unused)
- );
- else
- for (const j of x)
- a(j, N, Kr(j, p._0_is_declared_but_its_value_is_never_read, UM(j.name)));
- }), m.forEach(([y, x]) => {
- if (y.declarations.length === x.length)
- a(
- y,
- 0,
- x.length === 1 ? Kr(xa(x).name, p._0_is_declared_but_its_value_is_never_read, UM(xa(x).name)) : Kr(y.parent.kind === 243 ? y.parent : y, p.All_variables_are_unused)
- );
- else
- for (const N of x)
- a(N, 0, Kr(N, p._0_is_declared_but_its_value_is_never_read, UM(N.name)));
- });
- }
- function sct() {
- var r;
- for (const a of s1)
- if (!((r = Tn(a)) != null && r.isReferenced)) {
- const l = JT(a);
- E.assert(iv(l), "Only parameter declaration should be checked here");
- const f = Kr(a.name, p._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, _o(a.name), _o(a.propertyName));
- l.type || Rs(
- f,
- fl(Tr(l), l.end, 0, p.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, _o(a.propertyName))
- ), Da.add(f);
- }
- }
- function UM(r) {
- switch (r.kind) {
- case 80:
- return Nn(r);
- case 207:
- case 206:
- return UM(Bs(xa(r.elements), va).name);
- default:
- return E.assertNever(r);
- }
- }
- function eIe(r) {
- return r.kind === 273 || r.kind === 276 || r.kind === 274;
- }
- function act(r) {
- return r.kind === 273 ? r : r.kind === 274 ? r.parent : r.parent.parent;
- }
- function z$(r) {
- if (r.kind === 241 && f0(r), Tj(r)) {
- const a = Vh;
- ir(r.statements, la), Vh = a;
- } else
- ir(r.statements, la);
- r.locals && O1(r);
- }
- function oct(r) {
- B >= 2 || !Aj(r) || r.flags & 33554432 || rc(r.body) || ir(r.parameters, (a) => {
- a.name && !As(a.name) && a.name.escapedText === Me.escapedName && Mv("noEmit", a, p.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);
- });
- }
- function eI(r, a, l) {
- if (a?.escapedText !== l || r.kind === 172 || r.kind === 171 || r.kind === 174 || r.kind === 173 || r.kind === 177 || r.kind === 178 || r.kind === 303 || r.flags & 33554432 || (Ad(r) || gl(r) || Zu(r)) && Py(r))
- return !1;
- const f = pm(r);
- return !(Ii(f) && rc(f.parent.body));
- }
- function cct(r) {
- or(r, (a) => $k(a) & 4 ? (r.kind !== 80 ? je(os(r), p.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference) : je(r, p.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference), !0) : !1);
- }
- function lct(r) {
- or(r, (a) => $k(a) & 8 ? (r.kind !== 80 ? je(os(r), p.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference) : je(r, p.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference), !0) : !1);
- }
- function uct(r, a) {
- if (e.getEmitModuleFormatOfFile(Tr(r)) >= 5 || !a || !eI(r, a, "require") && !eI(r, a, "exports") || zc(r) && Rh(r) !== 1)
- return;
- const l = aT(r);
- l.kind === 307 && X_(l) && Mv("noEmit", a, p.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, _o(a), _o(a));
- }
- function _ct(r, a) {
- if (!a || B >= 4 || !eI(r, a, "Promise") || zc(r) && Rh(r) !== 1)
- return;
- const l = aT(r);
- l.kind === 307 && X_(l) && l.flags & 4096 && Mv("noEmit", a, p.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, _o(a), _o(a));
- }
- function fct(r, a) {
- B <= 8 && (eI(r, a, "WeakMap") || eI(r, a, "WeakSet")) && md.push(r);
- }
- function pct(r) {
- const a = Cd(r);
- $k(a) & 1048576 && (E.assert(Vl(r) && Oe(r.name) && typeof r.name.escapedText == "string", "The target of a WeakMap/WeakSet collision check should be an identifier"), Mv("noEmit", r, p.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, r.name.escapedText));
- }
- function dct(r, a) {
- a && B >= 2 && B <= 8 && eI(r, a, "Reflect") && U0.push(r);
- }
- function mct(r) {
- let a = !1;
- if ($c(r)) {
- for (const l of r.members)
- if ($k(l) & 2097152) {
- a = !0;
- break;
- }
- } else if (vo(r))
- $k(r) & 2097152 && (a = !0);
- else {
- const l = Cd(r);
- l && $k(l) & 2097152 && (a = !0);
- }
- a && (E.assert(Vl(r) && Oe(r.name), "The target of a Reflect collision check should be an identifier"), Mv("noEmit", r, p.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, _o(r.name), "Reflect"));
- }
- function VP(r, a) {
- a && (uct(r, a), _ct(r, a), fct(r, a), dct(r, a), Zn(r) ? (qP(a, p.Class_name_cannot_be_0), r.flags & 33554432 || qct(a)) : Bb(r) && qP(a, p.Enum_name_cannot_be_0));
- }
- function gct(r) {
- if (J2(r) & 7 || iv(r))
- return;
- const a = Tn(r);
- if (a.flags & 1) {
- if (!Oe(r.name)) return E.fail();
- const l = Nt(
- r,
- r.name.escapedText,
- 3,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- );
- if (l && l !== a && l.flags & 2 && Lpe(l) & 7) {
- const f = nv(
- l.valueDeclaration,
- 261
- /* VariableDeclarationList */
- ), m = f.parent.kind === 243 && f.parent.parent ? f.parent.parent : void 0;
- if (!(m && (m.kind === 241 && ys(m.parent) || m.kind === 268 || m.kind === 267 || m.kind === 307))) {
- const x = Ji(l);
- je(r, p.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, x, x);
- }
- }
- }
- }
- function tI(r) {
- return r === at ? xe : r === Va ? so : r;
- }
- function VM(r) {
- var a;
- if (zM(r), va(r) || la(r.type), !r.name)
- return;
- if (r.name.kind === 167 && (Wm(r.name), K2(r) && r.initializer && wc(r.initializer)), va(r)) {
- if (r.propertyName && Oe(r.name) && iv(r) && rc(yf(r).body)) {
- s1.push(r);
- return;
- }
- Mf(r.parent) && r.dotDotDotToken && B < 5 && bl(
- r,
- 4
- /* Rest */
- ), r.propertyName && r.propertyName.kind === 167 && Wm(r.propertyName);
- const m = r.parent.parent, y = r.dotDotDotToken ? 32 : 0, x = ke(m, y), N = r.propertyName || r.name;
- if (x && !As(N)) {
- const j = i0(N);
- if (up(j)) {
- const W = _p(j), Q = Gs(x, W);
- Q && (EM(
- Q,
- /*nodeForCheckWriteOnly*/
- void 0,
- /*isSelfTypeAccess*/
- !1
- ), Rpe(
- r,
- !!m.initializer && m.initializer.kind === 108,
- /*writing*/
- !1,
- x,
- Q
- ));
- }
- }
- }
- if (As(r.name) && (r.name.kind === 207 && B < 2 && O.downlevelIteration && bl(
- r,
- 512
- /* Read */
- ), ir(r.name.elements, la)), r.initializer && iv(r) && rc(yf(r).body)) {
- je(r, p.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
- return;
- }
- if (As(r.name)) {
- if (ope(r))
- return;
- const m = K2(r) && r.initializer && r.parent.parent.kind !== 249, y = !ut(r.name.elements, hI(ml));
- if (m || y) {
- const x = pn(r);
- if (m) {
- const N = wc(r.initializer);
- ee && y ? T8e(N, r) : w1(N, pn(r), r, r.initializer);
- }
- y && (w0(r.name) ? uy(65, x, Ae, r) : ee && T8e(x, r));
- }
- return;
- }
- const l = Tn(r);
- if (l.flags & 2097152 && (Sb(r) || RZ(r))) {
- $$(r);
- return;
- }
- r.name.kind === 10 && je(r.name, p.A_bigint_literal_cannot_be_used_as_a_property_name);
- const f = tI(nn(l));
- if (r === l.valueDeclaration) {
- const m = K2(r) && i3(r);
- if (m && !(cn(r) && Ks(m) && (m.properties.length === 0 || Ry(r.name)) && !!((a = l.exports) != null && a.size)) && r.parent.parent.kind !== 249) {
- const x = wc(m);
- w1(
- x,
- f,
- r,
- m,
- /*headMessage*/
- void 0
- );
- const N = J2(r) & 7;
- if (N === 6) {
- const j = _et(
- /*reportErrors*/
- !0
- ), W = jwe(
- /*reportErrors*/
- !0
- );
- if (j !== xs && W !== xs) {
- const Q = Qn([j, W, ht, Ae]);
- Au(kp(x, r), Q, m, p.The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined);
- }
- } else if (N === 4) {
- const j = jwe(
- /*reportErrors*/
- !0
- );
- if (j !== xs) {
- const W = Qn([j, ht, Ae]);
- Au(kp(x, r), W, m, p.The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined);
- }
- }
- }
- l.declarations && l.declarations.length > 1 && ut(l.declarations, (y) => y !== r && YT(y) && !rIe(y, r)) && je(r.name, p.All_declarations_of_0_must_have_identical_modifiers, _o(r.name));
- } else {
- const m = tI(pn(r));
- !H(f) && !H(m) && !hh(f, m) && !(l.flags & 67108864) && tIe(l.valueDeclaration, f, r, m), K2(r) && r.initializer && w1(
- wc(r.initializer),
- m,
- r,
- r.initializer,
- /*headMessage*/
- void 0
- ), l.valueDeclaration && !rIe(r, l.valueDeclaration) && je(r.name, p.All_declarations_of_0_must_have_identical_modifiers, _o(r.name));
- }
- r.kind !== 172 && r.kind !== 171 && (XN(r), (r.kind === 260 || r.kind === 208) && gct(r), VP(r, r.name));
- }
- function tIe(r, a, l, f) {
- const m = os(l), y = l.kind === 172 || l.kind === 171 ? p.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : p.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, x = _o(m), N = je(
- m,
- y,
- x,
- Hr(a),
- Hr(f)
- );
- r && Rs(N, Kr(r, p._0_was_also_declared_here, x));
- }
- function rIe(r, a) {
- if (r.kind === 169 && a.kind === 260 || r.kind === 260 && a.kind === 169)
- return !0;
- if (tx(r) !== tx(a))
- return !1;
- const l = 1358;
- return ox(r, l) === ox(a, l);
- }
- function hct(r) {
- var a, l;
- (a = rn) == null || a.push(rn.Phase.Check, "checkVariableDeclaration", { kind: r.kind, pos: r.pos, end: r.end, path: r.tracingPath }), Kut(r), VM(r), (l = rn) == null || l.pop();
- }
- function yct(r) {
- return Qut(r), VM(r);
- }
- function W$(r) {
- const a = xh(r) & 7;
- (a === 4 || a === 6) && B < 99 && bl(
- r,
- 16777216
- /* AddDisposableResourceAndDisposeResources */
- ), ir(r.declarations, la);
- }
- function vct(r) {
- !vh(r) && !eme(r.declarationList) && e_t(r), W$(r.declarationList);
- }
- function bct(r) {
- f0(r), Gi(r.expression);
- }
- function Sct(r) {
- f0(r);
- const a = rI(r.expression);
- wde(r.expression, a, r.thenStatement), la(r.thenStatement), r.thenStatement.kind === 242 && je(r.thenStatement, p.The_body_of_an_if_statement_cannot_be_the_empty_statement), la(r.elseStatement);
- }
- function wde(r, a, l) {
- if (!ee) return;
- f(r, l);
- function f(y, x) {
- for (y = Ba(y), m(y, x); dn(y) && (y.operatorToken.kind === 57 || y.operatorToken.kind === 61); )
- y = Ba(y.left), m(y, x);
- }
- function m(y, x) {
- const N = P3(y) ? Ba(y.right) : y;
- if (jg(N))
- return;
- if (P3(N)) {
- f(N, x);
- return;
- }
- const j = N === y ? a : Gi(N);
- if (j.flags & 1024 && Cn(N) && (bn(N.expression).resolvedSymbol ?? ze).flags & 384) {
- je(N, p.This_condition_will_always_return_0, j.value ? "true" : "false");
- return;
- }
- const W = Cn(N) && CNe(N.expression);
- if (!Zd(
- j,
- 4194304
- /* Truthy */
- ) || W) return;
- const Q = Ns(
- j,
- 0
- /* Call */
- ), ye = !!WP(j);
- if (Q.length === 0 && !ye)
- return;
- const de = Oe(N) ? N : Cn(N) ? N.name : void 0, Ze = de && od(de);
- if (!Ze && !ye)
- return;
- Ze && dn(y.parent) && xct(y.parent, Ze) || Ze && x && Tct(y, x, de, Ze) || (ye ? Rv(
- N,
- /*maybeMissingAwait*/
- !0,
- p.This_condition_will_always_return_true_since_this_0_is_always_defined,
- K6(j)
- ) : je(N, p.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead));
- }
- }
- function Tct(r, a, l, f) {
- return !!bs(a, function m(y) {
- if (Oe(y)) {
- const x = od(y);
- if (x && x === f) {
- if (Oe(r) || Oe(l) && dn(l.parent))
- return !0;
- let N = l.parent, j = y.parent;
- for (; N && j; ) {
- if (Oe(N) && Oe(j) || N.kind === 110 && j.kind === 110)
- return od(N) === od(j);
- if (Cn(N) && Cn(j)) {
- if (od(N.name) !== od(j.name))
- return !1;
- j = j.expression, N = N.expression;
- } else if (Fs(N) && Fs(j))
- j = j.expression, N = N.expression;
- else
- return !1;
- }
- }
- }
- return bs(y, m);
- });
- }
- function xct(r, a) {
- for (; dn(r) && r.operatorToken.kind === 56; ) {
- if (bs(r.right, function f(m) {
- if (Oe(m)) {
- const y = od(m);
- if (y && y === a)
- return !0;
- }
- return bs(m, f);
- }))
- return !0;
- r = r.parent;
- }
- return !1;
- }
- function kct(r) {
- f0(r), la(r.statement), rI(r.expression);
- }
- function Cct(r) {
- f0(r), rI(r.expression), la(r.statement);
- }
- function Ade(r, a) {
- if (r.flags & 16384)
- je(a, p.An_expression_of_type_void_cannot_be_tested_for_truthiness);
- else {
- const l = Nde(a);
- l !== 3 && je(
- a,
- l === 1 ? p.This_kind_of_expression_is_always_truthy : p.This_kind_of_expression_is_always_falsy
- );
- }
- return r;
- }
- function Nde(r) {
- switch (r = Dc(r), r.kind) {
- case 9:
- return r.text === "0" || r.text === "1" ? 3 : 1;
- case 209:
- case 219:
- case 10:
- case 231:
- case 218:
- case 284:
- case 285:
- case 210:
- case 14:
- return 1;
- case 222:
- case 106:
- return 2;
- case 15:
- case 11:
- return r.text ? 1 : 2;
- case 227:
- return Nde(r.whenTrue) | Nde(r.whenFalse);
- case 80:
- return Nu(r) === we ? 2 : 3;
- }
- return 3;
- }
- function rI(r, a) {
- return Ade(Gi(r, a), r);
- }
- function Ect(r) {
- f0(r) || r.initializer && r.initializer.kind === 261 && eme(r.initializer), r.initializer && (r.initializer.kind === 261 ? W$(r.initializer) : Gi(r.initializer)), r.condition && rI(r.condition), r.incrementor && Gi(r.incrementor), la(r.statement), r.locals && O1(r);
- }
- function Dct(r) {
- KIe(r);
- const a = v7(r);
- if (r.awaitModifier ? a && oc(a) ? dr(r.awaitModifier, p.for_await_loops_cannot_be_used_inside_a_class_static_block) : (Jc(a) & 6) === 2 && B < 5 && bl(
- r,
- 16384
- /* ForAwaitOfIncludes */
- ) : O.downlevelIteration && B < 2 && bl(
- r,
- 256
- /* ForOfIncludes */
- ), r.initializer.kind === 261)
- W$(r.initializer);
- else {
- const l = r.initializer, f = qM(r);
- if (l.kind === 209 || l.kind === 210)
- DT(l, f || He);
- else {
- const m = Gi(l);
- qN(
- l,
- p.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access,
- p.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access
- ), f && w1(f, m, l, r.expression);
- }
- }
- la(r.statement), r.locals && O1(r);
- }
- function Pct(r) {
- KIe(r);
- const a = jpe(Gi(r.expression));
- if (r.initializer.kind === 261) {
- const l = r.initializer.declarations[0];
- l && As(l.name) && je(l.name, p.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern), W$(r.initializer);
- } else {
- const l = r.initializer, f = Gi(l);
- l.kind === 209 || l.kind === 210 ? je(l, p.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern) : $s(Ket(a), f) ? qN(
- l,
- p.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access,
- p.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access
- ) : je(l, p.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);
- }
- (a === Ht || !eu(
- a,
- 126091264
- /* InstantiableNonPrimitive */
- )) && je(r.expression, p.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, Hr(a)), la(r.statement), r.locals && O1(r);
- }
- function qM(r) {
- const a = r.awaitModifier ? 15 : 13;
- return uy(a, bE(r.expression), Ae, r.expression);
- }
- function uy(r, a, l, f) {
- return Wa(a) ? a : Ide(
- r,
- a,
- l,
- f,
- /*checkAssignability*/
- !0
- ) || xe;
- }
- function Ide(r, a, l, f, m) {
- const y = (r & 2) !== 0;
- if (a === Ht) {
- f && Lde(f, a, y);
- return;
- }
- const x = B >= 2, N = !x && O.downlevelIteration, j = O.noUncheckedIndexedAccess && !!(r & 128);
- if (x || N || y) {
- const Ze = V$(a, r, x ? f : void 0);
- if (m && Ze) {
- const ct = r & 8 ? p.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 : r & 32 ? p.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 : r & 64 ? p.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 : r & 16 ? p.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 : void 0;
- ct && Au(l, Ze.nextType, f, ct);
- }
- if (Ze || x)
- return j ? MN(Ze && Ze.yieldType) : Ze && Ze.yieldType;
- }
- let W = a, Q = !1;
- if (r & 4) {
- if (W.flags & 1048576) {
- const Ze = a.types, ct = Ln(Ze, (mt) => !(mt.flags & 402653316));
- ct !== Ze && (W = Qn(
- ct,
- 2
- /* Subtype */
- ));
- } else W.flags & 402653316 && (W = Ht);
- if (Q = W !== a, Q && W.flags & 131072)
- return j ? MN(Ie) : Ie;
- }
- if (!oy(W)) {
- if (f) {
- const Ze = !!(r & 4) && !Q, [ct, mt] = de(Ze, N);
- Rv(
- f,
- mt && !!WP(W),
- ct,
- Hr(W)
- );
- }
- return Q ? j ? MN(Ie) : Ie : void 0;
- }
- const ye = $v(W, At);
- if (Q && ye)
- return ye.flags & 402653316 && !O.noUncheckedIndexedAccess ? Ie : Qn(
- j ? [ye, Ie, Ae] : [ye, Ie],
- 2
- /* Subtype */
- );
- return r & 128 ? MN(ye) : ye;
- function de(Ze, ct) {
- var mt;
- return ct ? Ze ? [p.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, !0] : [p.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, !0] : Ode(
- r,
- 0,
- a,
- /*errorNode*/
- void 0
- ) ? [p.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, !1] : wct((mt = a.symbol) == null ? void 0 : mt.escapedName) ? [p.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, !0] : Ze ? [p.Type_0_is_not_an_array_type_or_a_string_type, !0] : [p.Type_0_is_not_an_array_type, !0];
- }
- }
- function wct(r) {
- switch (r) {
- case "Float32Array":
- case "Float64Array":
- case "Int16Array":
- case "Int32Array":
- case "Int8Array":
- case "NodeList":
- case "Uint16Array":
- case "Uint32Array":
- case "Uint8Array":
- case "Uint8ClampedArray":
- return !0;
- }
- return !1;
- }
- function Ode(r, a, l, f) {
- if (Wa(l))
- return;
- const m = V$(l, r, f);
- return m && m[Jye(a)];
- }
- function ib(r = Ht, a = Ht, l = M) {
- if (r.flags & 67359327 && a.flags & 180227 && l.flags & 180227) {
- const f = sd([r, a, l]);
- let m = An.get(f);
- return m || (m = { yieldType: r, returnType: a, nextType: l }, An.set(f, m)), m;
- }
- return { yieldType: r, returnType: a, nextType: l };
- }
- function nIe(r) {
- let a, l, f;
- for (const m of r)
- if (!(m === void 0 || m === ri)) {
- if (m === Fi)
- return Fi;
- a = wr(a, m.yieldType), l = wr(l, m.returnType), f = wr(f, m.nextType);
- }
- return a || l || f ? ib(
- a && Qn(a),
- l && Qn(l),
- f && ia(f)
- ) : ri;
- }
- function U$(r, a) {
- return r[a];
- }
- function yh(r, a, l) {
- return r[a] = l;
- }
- function V$(r, a, l) {
- var f, m;
- if (Wa(r))
- return Fi;
- if (!(r.flags & 1048576)) {
- const W = l ? { errors: void 0 } : void 0, Q = iIe(r, a, l, W);
- if (Q === ri) {
- if (l) {
- const ye = Lde(l, r, !!(a & 2));
- W?.errors && Rs(ye, ...W.errors);
- }
- return;
- } else if ((f = W?.errors) != null && f.length)
- for (const ye of W.errors)
- Da.add(ye);
- return Q;
- }
- const y = a & 2 ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable", x = U$(r, y);
- if (x) return x === ri ? void 0 : x;
- let N;
- for (const W of r.types) {
- const Q = l ? { errors: void 0 } : void 0, ye = iIe(W, a, l, Q);
- if (ye === ri) {
- if (l) {
- const de = Lde(l, r, !!(a & 2));
- Q?.errors && Rs(de, ...Q.errors);
- }
- yh(r, y, ri);
- return;
- } else if ((m = Q?.errors) != null && m.length)
- for (const de of Q.errors)
- Da.add(de);
- N = wr(N, ye);
- }
- const j = N ? nIe(N) : ri;
- return yh(r, y, j), j === ri ? void 0 : j;
- }
- function Fde(r, a) {
- if (r === ri) return ri;
- if (r === Fi) return Fi;
- const { yieldType: l, returnType: f, nextType: m } = r;
- return a && sfe(
- /*reportErrors*/
- !0
- ), ib(
- qk(l, a) || xe,
- qk(f, a) || xe,
- m
- );
- }
- function iIe(r, a, l, f) {
- if (Wa(r))
- return Fi;
- let m = !1;
- if (a & 2) {
- const y = sIe(r, za) || aIe(r, za);
- if (y)
- if (y === ri && l)
- m = !0;
- else
- return a & 8 ? Fde(y, l) : y;
- }
- if (a & 1) {
- let y = sIe(r, Uo) || aIe(r, Uo);
- if (y)
- if (y === ri && l)
- m = !0;
- else if (a & 2) {
- if (y !== ri)
- return y = Fde(y, l), m ? y : yh(r, "iterationTypesOfAsyncIterable", y);
- } else
- return y;
- }
- if (a & 2) {
- const y = cIe(r, za, l, f, m);
- if (y !== ri)
- return y;
- }
- if (a & 1) {
- let y = cIe(r, Uo, l, f, m);
- if (y !== ri)
- return a & 2 ? (y = Fde(y, l), m ? y : yh(r, "iterationTypesOfAsyncIterable", y)) : y;
- }
- return ri;
- }
- function sIe(r, a) {
- return U$(r, a.iterableCacheKey);
- }
- function aIe(r, a) {
- if (Mm(r, a.getGlobalIterableType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalIteratorObjectType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalIterableIteratorType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalGeneratorType(
- /*reportErrors*/
- !1
- ))) {
- const [l, f, m] = Io(r);
- return yh(r, a.iterableCacheKey, ib(a.resolveIterationType(
- l,
- /*errorNode*/
- void 0
- ) || l, a.resolveIterationType(
- f,
- /*errorNode*/
- void 0
- ) || f, m));
- }
- if (fG(r, a.getGlobalBuiltinIteratorTypes())) {
- const [l] = Io(r), f = ife(), m = M;
- return yh(r, a.iterableCacheKey, ib(a.resolveIterationType(
- l,
- /*errorNode*/
- void 0
- ) || l, a.resolveIterationType(
- f,
- /*errorNode*/
- void 0
- ) || f, m));
- }
- }
- function oIe(r) {
- const a = Owe(
- /*reportErrors*/
- !1
- ), l = a && Rc(nn(a), tc(r));
- return l && up(l) ? _p(l) : `__@${r}`;
- }
- function cIe(r, a, l, f, m) {
- const y = Gs(r, oIe(a.iteratorSymbolName)), x = y && !(y.flags & 16777216) ? nn(y) : void 0;
- if (Wa(x))
- return m ? Fi : yh(r, a.iterableCacheKey, Fi);
- const N = x ? Ns(
- x,
- 0
- /* Call */
- ) : void 0;
- if (!ut(N))
- return m ? ri : yh(r, a.iterableCacheKey, ri);
- const j = ia(lr(N, Ha)), W = lIe(j, a, l, f, m) ?? ri;
- return m ? W : yh(r, a.iterableCacheKey, W);
- }
- function Lde(r, a, l) {
- const f = l ? p.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator : p.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator, m = (
- // for (const x of Promise<...>) or [...Promise<...>]
- !!WP(a) || !l && nA(r.parent) && r.parent.expression === r && zL(
- /*reportErrors*/
- !1
- ) !== Vi && $s(a, AP(zL(
- /*reportErrors*/
- !1
- ), [xe, xe, xe]))
- );
- return Rv(r, m, f, Hr(a));
- }
- function Act(r, a, l, f) {
- return lIe(
- r,
- a,
- l,
- f,
- /*noCache*/
- !1
- );
- }
- function lIe(r, a, l, f, m) {
- if (Wa(r))
- return Fi;
- let y = Nct(r, a) || Ict(r, a);
- return y === ri && l && (y = void 0, m = !0), y ?? (y = Mct(r, a, l, f, m)), y === ri ? void 0 : y;
- }
- function Nct(r, a) {
- return U$(r, a.iteratorCacheKey);
- }
- function Ict(r, a) {
- if (Mm(r, a.getGlobalIterableIteratorType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalIteratorType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalIteratorObjectType(
- /*reportErrors*/
- !1
- )) || Mm(r, a.getGlobalGeneratorType(
- /*reportErrors*/
- !1
- ))) {
- const [l, f, m] = Io(r);
- return yh(r, a.iteratorCacheKey, ib(l, f, m));
- }
- if (fG(r, a.getGlobalBuiltinIteratorTypes())) {
- const [l] = Io(r), f = ife(), m = M;
- return yh(r, a.iteratorCacheKey, ib(l, f, m));
- }
- }
- function uIe(r, a) {
- const l = Rc(r, "done") || yr;
- return $s(a === 0 ? yr : nt, l);
- }
- function Oct(r) {
- return uIe(
- r,
- 0
- /* Yield */
- );
- }
- function Fct(r) {
- return uIe(
- r,
- 1
- /* Return */
- );
- }
- function Lct(r) {
- if (Wa(r))
- return Fi;
- const a = U$(r, "iterationTypesOfIteratorResult");
- if (a)
- return a;
- if (Mm(r, cet(
- /*reportErrors*/
- !1
- ))) {
- const x = Io(r)[0];
- return yh(r, "iterationTypesOfIteratorResult", ib(
- x,
- /*returnType*/
- void 0,
- /*nextType*/
- void 0
- ));
- }
- if (Mm(r, uet(
- /*reportErrors*/
- !1
- ))) {
- const x = Io(r)[0];
- return yh(r, "iterationTypesOfIteratorResult", ib(
- /*yieldType*/
- void 0,
- x,
- /*nextType*/
- void 0
- ));
- }
- const l = Vc(r, Oct), f = l !== Ht ? Rc(l, "value") : void 0, m = Vc(r, Fct), y = m !== Ht ? Rc(m, "value") : void 0;
- return !f && !y ? yh(r, "iterationTypesOfIteratorResult", ri) : yh(r, "iterationTypesOfIteratorResult", ib(
- f,
- y || Xt,
- /*nextType*/
- void 0
- ));
- }
- function Mde(r, a, l, f, m) {
- var y, x, N, j;
- const W = Gs(r, l);
- if (!W && l !== "next")
- return;
- const Q = W && !(l === "next" && W.flags & 16777216) ? l === "next" ? nn(W) : ad(
- nn(W),
- 2097152
- /* NEUndefinedOrNull */
- ) : void 0;
- if (Wa(Q))
- return Fi;
- const ye = Q ? Ns(
- Q,
- 0
- /* Call */
- ) : Ue;
- if (ye.length === 0) {
- if (f) {
- const pr = l === "next" ? a.mustHaveANextMethodDiagnostic : a.mustBeAMethodDiagnostic;
- m ? (m.errors ?? (m.errors = []), m.errors.push(Kr(f, pr, l))) : je(f, pr, l);
- }
- return l === "next" ? ri : void 0;
- }
- if (Q?.symbol && ye.length === 1) {
- const pr = a.getGlobalGeneratorType(
- /*reportErrors*/
- !1
- ), er = a.getGlobalIteratorType(
- /*reportErrors*/
- !1
- ), gn = ((x = (y = pr.symbol) == null ? void 0 : y.members) == null ? void 0 : x.get(l)) === Q.symbol, Un = !gn && ((j = (N = er.symbol) == null ? void 0 : N.members) == null ? void 0 : j.get(l)) === Q.symbol;
- if (gn || Un) {
- const ci = gn ? pr : er, { mapper: Jn } = Q;
- return ib(
- ay(ci.typeParameters[0], Jn),
- ay(ci.typeParameters[1], Jn),
- l === "next" ? ay(ci.typeParameters[2], Jn) : void 0
- );
- }
- }
- let de, Ze;
- for (const pr of ye)
- l !== "throw" && ut(pr.parameters) && (de = wr(de, Kd(pr, 0))), Ze = wr(Ze, Ha(pr));
- let ct, mt;
- if (l !== "throw") {
- const pr = de ? Qn(de) : M;
- if (l === "next")
- mt = pr;
- else if (l === "return") {
- const er = a.resolveIterationType(pr, f) || xe;
- ct = wr(ct, er);
- }
- }
- let Gt;
- const sr = Ze ? ia(Ze) : Ht, Xr = a.resolveIterationType(sr, f) || xe, tn = Lct(Xr);
- return tn === ri ? (f && (m ? (m.errors ?? (m.errors = []), m.errors.push(Kr(f, a.mustHaveAValueDiagnostic, l))) : je(f, a.mustHaveAValueDiagnostic, l)), Gt = xe, ct = wr(ct, xe)) : (Gt = tn.yieldType, ct = wr(ct, tn.returnType)), ib(Gt, Qn(ct), mt);
- }
- function Mct(r, a, l, f, m) {
- const y = nIe([
- Mde(r, a, "next", l, f),
- Mde(r, a, "return", l, f),
- Mde(r, a, "throw", l, f)
- ]);
- return m ? y : yh(r, a.iteratorCacheKey, y);
- }
- function j2(r, a, l) {
- if (Wa(a))
- return;
- const f = Rde(a, l);
- return f && f[Jye(r)];
- }
- function Rde(r, a) {
- if (Wa(r))
- return Fi;
- const l = a ? 2 : 1, f = a ? za : Uo;
- return V$(
- r,
- l,
- /*errorNode*/
- void 0
- ) || Act(
- r,
- f,
- /*errorNode*/
- void 0,
- /*errorOutputContainer*/
- void 0
- );
- }
- function Rct(r) {
- f0(r) || Xut(r);
- }
- function HM(r, a) {
- const l = !!(a & 1), f = !!(a & 2);
- if (l) {
- const m = j2(1, r, f);
- return m ? f ? ly(UP(m)) : m : He;
- }
- return f ? ly(r) || He : r;
- }
- function _Ie(r, a) {
- const l = HM(a, Jc(r));
- return !!(l && (bc(
- l,
- 16384
- /* Void */
- ) || l.flags & 32769));
- }
- function jct(r) {
- if (f0(r))
- return;
- const a = v7(r);
- if (a && oc(a)) {
- Bl(r, p.A_return_statement_cannot_be_used_inside_a_class_static_block);
- return;
- }
- if (!a) {
- Bl(r, p.A_return_statement_can_only_be_used_within_a_function_body);
- return;
- }
- const l = Zf(a), f = Ha(l), m = Jc(a);
- if (ee || r.expression || f.flags & 131072) {
- const y = r.expression ? wc(r.expression) : Ae;
- if (a.kind === 178)
- r.expression && je(r, p.Setters_cannot_return_a_value);
- else if (a.kind === 176)
- r.expression && !w1(y, f, r, r.expression) && je(r, p.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
- else if (lE(a)) {
- const x = HM(f, m) ?? f, N = m & 2 ? YN(
- y,
- /*withAlias*/
- !1,
- r,
- p.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- ) : y;
- x && w1(N, x, r, r.expression);
- }
- } else a.kind !== 176 && O.noImplicitReturns && !_Ie(a, f) && je(r, p.Not_all_code_paths_return_a_value);
- }
- function Bct(r) {
- f0(r) || r.flags & 65536 && Bl(r, p.with_statements_are_not_allowed_in_an_async_function_block), Gi(r.expression);
- const a = Tr(r);
- if (!F1(a)) {
- const l = cm(a, r.pos).start, f = r.statement.pos;
- B2(a, l, f - l, p.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);
- }
- }
- function Jct(r) {
- f0(r);
- let a, l = !1;
- const f = Gi(r.expression);
- ir(r.caseBlock.clauses, (m) => {
- m.kind === 297 && !l && (a === void 0 ? a = m : (dr(m, p.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement), l = !0)), m.kind === 296 && n(y(m)), ir(m.statements, la), O.noFallthroughCasesInSwitch && m.fallthroughFlowNode && pM(m.fallthroughFlowNode) && je(m, p.Fallthrough_case_in_switch);
- function y(x) {
- return () => {
- const N = Gi(x.expression);
- gde(f, N) || I3e(
- N,
- f,
- x.expression,
- /*headMessage*/
- void 0
- );
- };
- }
- }), r.caseBlock.locals && O1(r.caseBlock);
- }
- function zct(r) {
- f0(r) || or(r.parent, (a) => ys(a) ? "quit" : a.kind === 256 && a.label.escapedText === r.label.escapedText ? (dr(r.label, p.Duplicate_label_0, nc(r.label)), !0) : !1), la(r.statement);
- }
- function Wct(r) {
- f0(r) || Oe(r.expression) && !r.expression.escapedText && l_t(r, p.Line_break_not_permitted_here), r.expression && Gi(r.expression);
- }
- function Uct(r) {
- f0(r), z$(r.tryBlock);
- const a = r.catchClause;
- if (a) {
- if (a.variableDeclaration) {
- const l = a.variableDeclaration;
- VM(l);
- const f = Gc(l);
- if (f) {
- const m = Ci(f);
- m && !(m.flags & 3) && Bl(f, p.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
- } else if (l.initializer)
- Bl(l.initializer, p.Catch_clause_variable_cannot_have_an_initializer);
- else {
- const m = a.block.locals;
- m && Ch(a.locals, (y) => {
- const x = m.get(y);
- x?.valueDeclaration && x.flags & 2 && dr(x.valueDeclaration, p.Cannot_redeclare_identifier_0_in_catch_clause, Ei(y));
- });
- }
- }
- z$(a.block);
- }
- r.finallyBlock && z$(r.finallyBlock);
- }
- function q$(r, a, l) {
- const f = wu(r);
- if (f.length === 0)
- return;
- for (const y of iy(r))
- l && y.flags & 4194304 || fIe(r, y, Ok(
- y,
- 8576,
- /*includeNonPublic*/
- !0
- ), x1(y));
- const m = a.valueDeclaration;
- if (m && Zn(m)) {
- for (const y of m.members)
- if (!zs(y) && !oE(y)) {
- const x = Tn(y);
- fIe(r, x, tu(y.name.expression), x1(x));
- }
- }
- if (f.length > 1)
- for (const y of f)
- Vct(r, y);
- }
- function fIe(r, a, l, f) {
- const m = a.valueDeclaration, y = os(m);
- if (y && Di(y))
- return;
- const x = W_e(r, l), N = wn(r) & 2 ? Jo(
- r.symbol,
- 264
- /* InterfaceDeclaration */
- ) : void 0, j = m && m.kind === 226 || y && y.kind === 167 ? m : void 0, W = Cf(a) === r.symbol ? m : void 0;
- for (const Q of x) {
- const ye = Q.declaration && Cf(Tn(Q.declaration)) === r.symbol ? Q.declaration : void 0, de = W || ye || (N && !ut(No(r), (Ze) => !!k2(Ze, a.escapedName) && !!$v(Ze, Q.keyType)) ? N : void 0);
- if (de && !$s(f, Q.type)) {
- const Ze = Nm(de, p.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, Ji(a), Hr(f), Hr(Q.keyType), Hr(Q.type));
- j && de !== j && Rs(Ze, Kr(j, p._0_is_declared_here, Ji(a))), Da.add(Ze);
- }
- }
- }
- function Vct(r, a) {
- const l = a.declaration, f = W_e(r, a.keyType), m = wn(r) & 2 ? Jo(
- r.symbol,
- 264
- /* InterfaceDeclaration */
- ) : void 0, y = l && Cf(Tn(l)) === r.symbol ? l : void 0;
- for (const x of f) {
- if (x === a) continue;
- const N = x.declaration && Cf(Tn(x.declaration)) === r.symbol ? x.declaration : void 0, j = y || N || (m && !ut(No(r), (W) => !!dh(W, a.keyType) && !!$v(W, x.keyType)) ? m : void 0);
- j && !$s(a.type, x.type) && je(j, p._0_index_type_1_is_not_assignable_to_2_index_type_3, Hr(a.keyType), Hr(a.type), Hr(x.keyType), Hr(x.type));
- }
- }
- function qP(r, a) {
- switch (r.escapedText) {
- case "any":
- case "unknown":
- case "never":
- case "number":
- case "bigint":
- case "boolean":
- case "string":
- case "symbol":
- case "void":
- case "object":
- case "undefined":
- je(r, a, r.escapedText);
- }
- }
- function qct(r) {
- B >= 1 && r.escapedText === "Object" && e.getEmitModuleFormatOfFile(Tr(r)) < 5 && je(r, p.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, lw[z]);
- }
- function Hct(r) {
- const a = Ln(H1(r), dp);
- if (!Nr(a)) return;
- const l = cn(r), f = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
- if (ir(r.parameters, ({ name: x }, N) => {
- Oe(x) && f.add(x.escapedText), As(x) && m.add(N);
- }), q_e(r)) {
- const x = a.length - 1, N = a[x];
- l && N && Oe(N.name) && N.typeExpression && N.typeExpression.type && !f.has(N.name.escapedText) && !m.has(x) && !Dp(Ci(N.typeExpression.type)) && je(N.name, p.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, Nn(N.name));
- } else
- ir(a, ({ name: x, isNameFirst: N }, j) => {
- m.has(j) || Oe(x) && f.has(x.escapedText) || (Xu(x) ? l && je(x, p.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, $_(x), $_(x.left)) : N || Im(l, x, p.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, Nn(x)));
- });
- }
- function GM(r) {
- let a = !1;
- if (r)
- for (let f = 0; f < r.length; f++) {
- const m = r[f];
- ONe(m), n(l(m, f));
- }
- function l(f, m) {
- return () => {
- f.default ? (a = !0, Gct(f.default, r, m)) : a && je(f, p.Required_type_parameters_may_not_follow_optional_type_parameters);
- for (let y = 0; y < m; y++)
- r[y].symbol === f.symbol && je(f.name, p.Duplicate_identifier_0, _o(f.name));
- };
- }
- }
- function Gct(r, a, l) {
- f(r);
- function f(m) {
- if (m.kind === 183) {
- const y = jL(m);
- if (y.flags & 262144)
- for (let x = l; x < a.length; x++)
- y.symbol === Tn(a[x]) && je(m, p.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters);
- }
- bs(m, f);
- }
- }
- function pIe(r) {
- if (r.declarations && r.declarations.length === 1)
- return;
- const a = Bi(r);
- if (!a.typeParametersChecked) {
- a.typeParametersChecked = !0;
- const l = tlt(r);
- if (!l || l.length <= 1)
- return;
- const f = bo(r);
- if (!dIe(l, f.localTypeParameters, Ey)) {
- const m = Ji(r);
- for (const y of l)
- je(y.name, p.All_declarations_of_0_must_have_identical_type_parameters, m);
- }
- }
- }
- function dIe(r, a, l) {
- const f = Nr(a), m = Bm(a);
- for (const y of r) {
- const x = l(y), N = x.length;
- if (N < m || N > f)
- return !1;
- for (let j = 0; j < N; j++) {
- const W = x[j], Q = a[j];
- if (W.name.escapedText !== Q.symbol.escapedName)
- return !1;
- const ye = oC(W), de = ye && Ci(ye), Ze = s_(Q);
- if (de && Ze && !hh(de, Ze))
- return !1;
- const ct = W.default && Ci(W.default), mt = C2(Q);
- if (ct && mt && !hh(ct, mt))
- return !1;
- }
- }
- return !0;
- }
- function mIe(r) {
- const a = !X && B < 99 && v0(
- /*useLegacyDecorators*/
- !1,
- r
- ), l = B < 9 || B < 99, f = !V;
- if (a || l)
- for (const m of r.members) {
- if (a && tB(
- /*useLegacyDecorators*/
- !1,
- m,
- r
- ))
- return el(Cy(r)) ?? r;
- if (l) {
- if (oc(m))
- return m;
- if (zs(m) && (Ou(m) || f && AA(m)))
- return m;
- }
- }
- }
- function $ct(r) {
- if (r.name) return;
- const a = mte(r);
- if (!yB(a)) return;
- const l = !X && B < 99;
- let f;
- l && v0(
- /*useLegacyDecorators*/
- !1,
- r
- ) ? f = el(Cy(r)) ?? r : f = mIe(r), f && (bl(
- f,
- 4194304
- /* SetFunctionName */
- ), (Qc(a) || cs(a) || va(a)) && ma(a.name) && bl(
- f,
- 8388608
- /* PropKey */
- ));
- }
- function Xct(r) {
- return gIe(r), Hk(r), $ct(r), nn(Tn(r));
- }
- function Qct(r) {
- ir(r.members, la), O1(r);
- }
- function Yct(r) {
- const a = On(r.modifiers, dl);
- X && a && ut(r.members, (l) => tl(l) && Ou(l)) && dr(a, p.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator), !r.name && !Gn(
- r,
- 2048
- /* Default */
- ) && Bl(r, p.A_class_declaration_without_the_default_modifier_must_have_a_name), gIe(r), ir(r.members, la), O1(r);
- }
- function gIe(r) {
- Fut(r), zM(r), VP(r, r.name), GM(Ey(r)), XN(r);
- const a = Tn(r), l = bo(a), f = df(l), m = nn(a);
- pIe(a), j$(a), lot(r), !!(r.flags & 33554432) || uot(r);
- const x = _m(r);
- if (x) {
- ir(x.typeArguments, la), B < 2 && bl(
- x.parent,
- 1
- /* Extends */
- );
- const W = Cb(r);
- W && W !== x && Gi(W.expression);
- const Q = No(l);
- Q.length && n(() => {
- const ye = Q[0], de = oi(l), Ze = Uu(de);
- if (Kct(Ze, x), la(x.expression), ut(x.typeArguments)) {
- ir(x.typeArguments, la);
- for (const mt of Mn(Ze, x.typeArguments, x))
- if (!JNe(x, mt.typeParameters))
- break;
- }
- const ct = df(ye, l.thisType);
- if (Au(
- f,
- ct,
- /*errorNode*/
- void 0
- ) ? Au(m, E3e(Ze), r.name || r, p.Class_static_side_0_incorrectly_extends_base_class_static_side_1) : vIe(r, f, ct, p.Class_0_incorrectly_extends_base_class_1), de.flags & 8650752 && (Gv(m) ? Ns(
- de,
- 1
- /* Construct */
- ).some(
- (Gt) => Gt.flags & 4
- /* Abstract */
- ) && !Gn(
- r,
- 64
- /* Abstract */
- ) && je(r.name || r, p.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract) : je(r.name || r, p.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)), !(Ze.symbol && Ze.symbol.flags & 32) && !(de.flags & 8650752)) {
- const mt = mi(Ze, x.typeArguments, x);
- ir(mt, (Gt) => !qm(Gt.declaration) && !hh(Ha(Gt), ye)) && je(x.expression, p.Base_constructors_must_all_have_the_same_return_type);
- }
- rlt(l, ye);
- });
- }
- Zct(r, l, f, m);
- const N = DC(r);
- if (N)
- for (const W of N)
- (!yo(W.expression) || hu(W.expression)) && je(W.expression, p.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments), kde(W), n(j(W));
- n(() => {
- q$(l, a), q$(
- m,
- a,
- /*isStaticIndex*/
- !0
- ), Tde(r), slt(r);
- });
- function j(W) {
- return () => {
- const Q = Qd(Ci(W));
- if (!H(Q))
- if (jm(Q)) {
- const ye = Q.symbol && Q.symbol.flags & 32 ? p.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : p.Class_0_incorrectly_implements_interface_1, de = df(Q, l.thisType);
- Au(
- f,
- de,
- /*errorNode*/
- void 0
- ) || vIe(r, f, de, ye);
- } else
- je(W, p.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);
- };
- }
- }
- function Zct(r, a, l, f) {
- const y = _m(r) && No(a), x = y?.length ? df(xa(y), a.thisType) : void 0, N = oi(a);
- for (const j of r.members)
- IB(j) || (Qo(j) && ir(j.parameters, (W) => {
- G_(W, j) && hIe(
- r,
- f,
- N,
- x,
- a,
- l,
- W,
- /*memberIsParameterProperty*/
- !0
- );
- }), hIe(
- r,
- f,
- N,
- x,
- a,
- l,
- j,
- /*memberIsParameterProperty*/
- !1
- ));
- }
- function hIe(r, a, l, f, m, y, x, N, j = !0) {
- const W = x.name && od(x.name) || od(x);
- return W ? yIe(
- r,
- a,
- l,
- f,
- m,
- y,
- $7(x),
- wb(x),
- zs(x),
- N,
- W,
- j ? x : void 0
- ) : 0;
- }
- function yIe(r, a, l, f, m, y, x, N, j, W, Q, ye) {
- const de = cn(r), Ze = !!(r.flags & 33554432);
- if (f && (x || O.noImplicitOverride)) {
- const ct = j ? a : y, mt = j ? l : f, Gt = Gs(ct, Q.escapedName), sr = Gs(mt, Q.escapedName), Xr = Hr(f);
- if (Gt && !sr && x) {
- if (ye) {
- const tn = P8e(mc(Q), mt);
- tn ? je(
- ye,
- de ? p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 : p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,
- Xr,
- Ji(tn)
- ) : je(
- ye,
- de ? p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 : p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,
- Xr
- );
- }
- return 2;
- } else if (Gt && sr?.declarations && O.noImplicitOverride && !Ze) {
- const tn = ut(sr.declarations, wb);
- if (x)
- return 0;
- if (tn) {
- if (N && tn)
- return ye && je(ye, p.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, Xr), 1;
- } else {
- if (ye) {
- const pr = W ? de ? p.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : p.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 : de ? p.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : p.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
- je(ye, pr, Xr);
- }
- return 1;
- }
- }
- } else if (x) {
- if (ye) {
- const ct = Hr(m);
- je(
- ye,
- de ? p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class : p.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,
- ct
- );
- }
- return 2;
- }
- return 0;
- }
- function vIe(r, a, l, f) {
- let m = !1;
- for (const y of r.members) {
- if (zs(y))
- continue;
- const x = y.name && od(y.name) || od(y);
- if (x) {
- const N = Gs(a, x.escapedName), j = Gs(l, x.escapedName);
- if (N && j) {
- const W = () => vs(
- /*details*/
- void 0,
- p.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,
- Ji(x),
- Hr(a),
- Hr(l)
- );
- Au(
- nn(N),
- nn(j),
- y.name || y,
- /*headMessage*/
- void 0,
- W
- ) || (m = !0);
- }
- }
- }
- m || Au(a, l, r.name || r, f);
- }
- function Kct(r, a) {
- const l = Ns(
- r,
- 1
- /* Construct */
- );
- if (l.length) {
- const f = l[0].declaration;
- if (f && Z_(
- f,
- 2
- /* Private */
- )) {
- const m = Ah(r.symbol);
- Ude(a, m) || je(a, p.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, K0(r.symbol));
- }
- }
- }
- function elt(r, a, l) {
- if (!a.name)
- return 0;
- const f = Tn(r), m = bo(f), y = df(m), x = nn(f), j = _m(r) && No(m), W = j?.length ? df(xa(j), m.thisType) : void 0, Q = oi(m), ye = a.parent ? $7(a) : Gn(
- a,
- 16
- /* Override */
- );
- return yIe(
- r,
- x,
- Q,
- W,
- m,
- y,
- ye,
- wb(a),
- zs(a),
- /*memberIsParameterProperty*/
- !1,
- l
- );
- }
- function CE(r) {
- return gc(r) & 1 ? r.links.target : r;
- }
- function tlt(r) {
- return Ln(
- r.declarations,
- (a) => a.kind === 263 || a.kind === 264
- /* InterfaceDeclaration */
- );
- }
- function rlt(r, a) {
- var l, f, m, y, x;
- const N = qa(a), j = /* @__PURE__ */ new Map();
- e: for (const W of N) {
- const Q = CE(W);
- if (Q.flags & 4194304)
- continue;
- const ye = k2(r, Q.escapedName);
- if (!ye)
- continue;
- const de = CE(ye), Ze = lp(Q);
- if (E.assert(!!de, "derived should point to something, even if it is the base class' declaration."), de === Q) {
- const ct = Ah(r.symbol);
- if (Ze & 64 && (!ct || !Gn(
- ct,
- 64
- /* Abstract */
- ))) {
- for (const tn of No(r)) {
- if (tn === a) continue;
- const pr = k2(tn, Q.escapedName), er = pr && CE(pr);
- if (er && er !== Q)
- continue e;
- }
- const mt = Hr(a), Gt = Hr(r), sr = Ji(W), Xr = wr((l = j.get(ct)) == null ? void 0 : l.missedProperties, sr);
- j.set(ct, { baseTypeName: mt, typeName: Gt, missedProperties: Xr });
- }
- } else {
- const ct = lp(de);
- if (Ze & 2 || ct & 2)
- continue;
- let mt;
- const Gt = Q.flags & 98308, sr = de.flags & 98308;
- if (Gt && sr) {
- if ((gc(Q) & 6 ? (f = Q.declarations) != null && f.some((pr) => bIe(pr, Ze)) : (m = Q.declarations) != null && m.every((pr) => bIe(pr, Ze))) || gc(Q) & 262144 || de.valueDeclaration && dn(de.valueDeclaration))
- continue;
- const Xr = Gt !== 4 && sr === 4;
- if (Xr || Gt === 4 && sr !== 4) {
- const pr = Xr ? p._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : p._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
- je(os(de.valueDeclaration) || de.valueDeclaration, pr, Ji(Q), Hr(a), Hr(r));
- } else if (q) {
- const pr = (y = de.declarations) == null ? void 0 : y.find((er) => er.kind === 172 && !er.initializer);
- if (pr && !(de.flags & 33554432) && !(Ze & 64) && !(ct & 64) && !((x = de.declarations) != null && x.some((er) => !!(er.flags & 33554432)))) {
- const er = H3(Ah(r.symbol)), gn = pr.name;
- if (pr.exclamationToken || !er || !Oe(gn) || !ee || !TIe(gn, r, er)) {
- const Un = p.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;
- je(os(de.valueDeclaration) || de.valueDeclaration, Un, Ji(Q), Hr(a));
- }
- }
- }
- continue;
- } else if (Mpe(Q)) {
- if (Mpe(de) || de.flags & 4)
- continue;
- E.assert(!!(de.flags & 98304)), mt = p.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;
- } else Q.flags & 98304 ? mt = p.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function : mt = p.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;
- je(os(de.valueDeclaration) || de.valueDeclaration, mt, Hr(a), Ji(Q), Hr(r));
- }
- }
- for (const [W, Q] of j)
- if (Nr(Q.missedProperties) === 1)
- $c(W) ? je(W, p.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, xa(Q.missedProperties), Q.baseTypeName) : je(W, p.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, Q.typeName, xa(Q.missedProperties), Q.baseTypeName);
- else if (Nr(Q.missedProperties) > 5) {
- const ye = lr(Q.missedProperties.slice(0, 4), (Ze) => `'${Ze}'`).join(", "), de = Nr(Q.missedProperties) - 4;
- $c(W) ? je(W, p.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more, Q.baseTypeName, ye, de) : je(W, p.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more, Q.typeName, Q.baseTypeName, ye, de);
- } else {
- const ye = lr(Q.missedProperties, (de) => `'${de}'`).join(", ");
- $c(W) ? je(W, p.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, Q.baseTypeName, ye) : je(W, p.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2, Q.typeName, Q.baseTypeName, ye);
- }
- }
- function bIe(r, a) {
- return a & 64 && (!cs(r) || !r.initializer) || Xl(r.parent);
- }
- function nlt(r, a, l) {
- if (!Nr(a))
- return l;
- const f = /* @__PURE__ */ new Map();
- ir(l, (m) => {
- f.set(m.escapedName, m);
- });
- for (const m of a) {
- const y = qa(df(m, r.thisType));
- for (const x of y) {
- const N = f.get(x.escapedName);
- N && x.parent === N.parent && f.delete(x.escapedName);
- }
- }
- return as(f.values());
- }
- function ilt(r, a) {
- const l = No(r);
- if (l.length < 2)
- return !0;
- const f = /* @__PURE__ */ new Map();
- ir(D_e(r).declaredProperties, (y) => {
- f.set(y.escapedName, { prop: y, containingType: r });
- });
- let m = !0;
- for (const y of l) {
- const x = qa(df(y, r.thisType));
- for (const N of x) {
- const j = f.get(N.escapedName);
- if (!j)
- f.set(N.escapedName, { prop: N, containingType: y });
- else if (j.containingType !== r && !art(j.prop, N)) {
- m = !1;
- const Q = Hr(j.containingType), ye = Hr(y);
- let de = vs(
- /*details*/
- void 0,
- p.Named_property_0_of_types_1_and_2_are_not_identical,
- Ji(N),
- Q,
- ye
- );
- de = vs(de, p.Interface_0_cannot_simultaneously_extend_types_1_and_2, Hr(r), Q, ye), Da.add(Rg(Tr(a), a, de));
- }
- }
- }
- return m;
- }
- function slt(r) {
- if (!ee || !re || r.flags & 33554432)
- return;
- const a = H3(r);
- for (const l of r.members)
- if (!(Mu(l) & 128) && !zs(l) && SIe(l)) {
- const f = l.name;
- if (Oe(f) || Di(f) || ma(f)) {
- const m = nn(Tn(l));
- m.flags & 3 || mE(m) || (!a || !TIe(f, m, a)) && je(l.name, p.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, _o(f));
- }
- }
- }
- function SIe(r) {
- return r.kind === 172 && !wb(r) && !r.exclamationToken && !r.initializer;
- }
- function alt(r, a, l, f, m) {
- for (const y of l)
- if (y.pos >= f && y.pos <= m) {
- const x = A.createPropertyAccessExpression(A.createThis(), r);
- Aa(x.expression, x), Aa(x, y), x.flowNode = y.returnFlowNode;
- const N = _0(x, a, N1(a));
- if (!mE(N))
- return !0;
- }
- return !1;
- }
- function TIe(r, a, l) {
- const f = ma(r) ? A.createElementAccessExpression(A.createThis(), r.expression) : A.createPropertyAccessExpression(A.createThis(), r);
- Aa(f.expression, f), Aa(f, l), f.flowNode = l.returnFlowNode;
- const m = _0(f, a, N1(a));
- return !mE(m);
- }
- function olt(r) {
- vh(r) || zut(r), GM(r.typeParameters), n(() => {
- qP(r.name, p.Interface_name_cannot_be_0), XN(r);
- const a = Tn(r);
- pIe(a);
- const l = Jo(
- a,
- 264
- /* InterfaceDeclaration */
- );
- if (r === l) {
- const f = bo(a), m = df(f);
- if (ilt(f, r.name)) {
- for (const y of No(f))
- Au(m, df(y, f.thisType), r.name, p.Interface_0_incorrectly_extends_interface_1);
- q$(f, a);
- }
- }
- MNe(r);
- }), ir(x4(r), (a) => {
- (!yo(a.expression) || hu(a.expression)) && je(a.expression, p.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments), kde(a);
- }), ir(r.members, la), n(() => {
- Tde(r), O1(r);
- });
- }
- function clt(r) {
- if (vh(r), qP(r.name, p.Type_alias_name_cannot_be_0), XN(r), GM(r.typeParameters), r.type.kind === 141) {
- const a = Nr(r.typeParameters);
- (a === 0 ? r.name.escapedText === "BuiltinIteratorReturn" : a === 1 && Yz.has(r.name.escapedText)) || je(r.type, p.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);
- } else
- la(r.type), O1(r);
- }
- function xIe(r) {
- const a = bn(r);
- if (!(a.flags & 1024)) {
- a.flags |= 1024;
- let l = 0, f;
- for (const m of r.members) {
- const y = llt(m, l, f);
- bn(m).enumMemberValue = y, l = typeof y.value == "number" ? y.value + 1 : void 0, f = m;
- }
- }
- }
- function llt(r, a, l) {
- if (Ww(r.name))
- je(r.name, p.Computed_property_names_are_not_allowed_in_enums);
- else {
- const f = QT(r.name);
- qg(f) && !G4(f) && je(r.name, p.An_enum_member_cannot_have_a_numeric_name);
- }
- if (r.initializer)
- return ult(r);
- if (r.parent.flags & 33554432 && !Y1(r.parent))
- return pl(
- /*value*/
- void 0
- );
- if (a === void 0)
- return je(r.name, p.Enum_member_must_have_initializer), pl(
- /*value*/
- void 0
- );
- if (Wp(O) && l?.initializer) {
- const f = PT(l);
- typeof f.value == "number" && !f.resolvedOtherFiles || je(
- r.name,
- p.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled
- );
- }
- return pl(a);
- }
- function ult(r) {
- const a = Y1(r.parent), l = r.initializer, f = tt(l, r);
- return f.value !== void 0 ? a && typeof f.value == "number" && !isFinite(f.value) ? je(
- l,
- isNaN(f.value) ? p.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : p.const_enum_member_initializer_was_evaluated_to_a_non_finite_value
- ) : Wp(O) && typeof f.value == "string" && !f.isSyntacticallyString && je(
- l,
- p._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled,
- `${Nn(r.parent.name)}.${QT(r.name)}`
- ) : a ? je(l, p.const_enum_member_initializers_must_be_constant_expressions) : r.parent.flags & 33554432 ? je(l, p.In_ambient_enum_declarations_member_initializer_must_be_constant_expression) : Au(Gi(l), At, l, p.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values), f;
- }
- function kIe(r, a) {
- const l = Yo(
- r,
- 111551,
- /*ignoreErrors*/
- !0
- );
- if (!l) return pl(
- /*value*/
- void 0
- );
- if (r.kind === 80) {
- const f = r;
- if (G4(f.escapedText) && l === pE(
- f.escapedText,
- 111551,
- /*diagnostic*/
- void 0
- ))
- return pl(
- +f.escapedText,
- /*isSyntacticallyString*/
- !1
- );
- }
- if (l.flags & 8)
- return a ? CIe(r, l, a) : PT(l.valueDeclaration);
- if (zk(l)) {
- const f = l.valueDeclaration;
- if (f && ii(f) && !f.type && f.initializer && (!a || f !== a && $0(f, a))) {
- const m = tt(f.initializer, f);
- return a && Tr(a) !== Tr(f) ? pl(
- m.value,
- /*isSyntacticallyString*/
- !1,
- /*resolvedOtherFiles*/
- !0,
- /*hasExternalReferences*/
- !0
- ) : pl(
- m.value,
- m.isSyntacticallyString,
- m.resolvedOtherFiles,
- /*hasExternalReferences*/
- !0
- );
- }
- }
- return pl(
- /*value*/
- void 0
- );
- }
- function _lt(r, a) {
- const l = r.expression;
- if (yo(l) && Xa(r.argumentExpression)) {
- const f = Yo(
- l,
- 111551,
- /*ignoreErrors*/
- !0
- );
- if (f && f.flags & 384) {
- const m = tc(r.argumentExpression.text), y = f.exports.get(m);
- if (y)
- return E.assert(Tr(y.valueDeclaration) === Tr(f.valueDeclaration)), a ? CIe(r, y, a) : PT(y.valueDeclaration);
- }
- }
- return pl(
- /*value*/
- void 0
- );
- }
- function CIe(r, a, l) {
- const f = a.valueDeclaration;
- if (!f || f === l)
- return je(r, p.Property_0_is_used_before_being_assigned, Ji(a)), pl(
- /*value*/
- void 0
- );
- if (!$0(f, l))
- return je(r, p.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums), pl(
- /*value*/
- 0
- );
- const m = PT(f);
- return l.parent !== f.parent ? pl(
- m.value,
- m.isSyntacticallyString,
- m.resolvedOtherFiles,
- /*hasExternalReferences*/
- !0
- ) : m;
- }
- function flt(r) {
- n(() => plt(r));
- }
- function plt(r) {
- vh(r), VP(r, r.name), XN(r), r.members.forEach(dlt), xIe(r);
- const a = Tn(r), l = Jo(a, r.kind);
- if (r === l) {
- if (a.declarations && a.declarations.length > 1) {
- const m = Y1(r);
- ir(a.declarations, (y) => {
- Bb(y) && Y1(y) !== m && je(os(y), p.Enum_declarations_must_all_be_const_or_non_const);
- });
- }
- let f = !1;
- ir(a.declarations, (m) => {
- if (m.kind !== 266)
- return !1;
- const y = m;
- if (!y.members.length)
- return !1;
- const x = y.members[0];
- x.initializer || (f ? je(x.name, p.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element) : f = !0);
- });
- }
- }
- function dlt(r) {
- Di(r.name) && je(r, p.An_enum_member_cannot_be_named_with_a_private_identifier), r.initializer && Gi(r.initializer);
- }
- function mlt(r) {
- const a = r.declarations;
- if (a) {
- for (const l of a)
- if ((l.kind === 263 || l.kind === 262 && Mp(l.body)) && !(l.flags & 33554432))
- return l;
- }
- }
- function glt(r, a) {
- const l = Cd(r), f = Cd(a);
- return g0(l) ? g0(f) : g0(f) ? !1 : l === f;
- }
- function hlt(r) {
- r.body && (la(r.body), ig(r) || O1(r)), n(a);
- function a() {
- var l, f;
- const m = ig(r), y = r.flags & 33554432;
- m && !y && je(r.name, p.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);
- const x = Fu(r), N = x ? p.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : p.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;
- if ($M(r, N))
- return;
- if (vh(r) || !y && r.name.kind === 11 && dr(r.name, p.Only_ambient_modules_can_use_quoted_names), Oe(r.name) && (VP(r, r.name), !(r.flags & 2080))) {
- const W = Tr(r), Q = sZ(r), ye = cm(W, Q);
- c2.add(
- fl(W, ye.start, ye.length, p.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
- );
- }
- XN(r);
- const j = Tn(r);
- if (j.flags & 512 && !y && Zz(r, jy(O))) {
- if (Wp(O) && !Tr(r).externalModuleIndicator && je(r.name, p.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, et), ((l = j.declarations) == null ? void 0 : l.length) > 1) {
- const W = mlt(j);
- W && (Tr(r) !== Tr(W) ? je(r.name, p.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged) : r.pos < W.pos && je(r.name, p.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged));
- const Q = Jo(
- j,
- 263
- /* ClassDeclaration */
- );
- Q && glt(r, Q) && (bn(r).flags |= 2048);
- }
- if (O.verbatimModuleSyntax && r.parent.kind === 307 && e.getEmitModuleFormatOfFile(r.parent) === 1) {
- const W = (f = r.modifiers) == null ? void 0 : f.find(
- (Q) => Q.kind === 95
- /* ExportKeyword */
- );
- W && je(W, p.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
- }
- }
- if (x)
- if (yb(r)) {
- if ((m || Tn(r).flags & 33554432) && r.body)
- for (const Q of r.body.statements)
- jde(Q, m);
- } else g0(r.parent) ? m ? je(r.name, p.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations) : Sl(Jp(r.name)) && je(r.name, p.Ambient_module_declaration_cannot_specify_relative_module_name) : m ? je(r.name, p.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations) : je(r.name, p.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);
- }
- }
- function jde(r, a) {
- switch (r.kind) {
- case 243:
- for (const f of r.declarationList.declarations)
- jde(f, a);
- break;
- case 277:
- case 278:
- Bl(r, p.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
- break;
- case 271:
- if (nS(r)) break;
- case 272:
- Bl(r, p.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
- break;
- case 208:
- case 260:
- const l = r.name;
- if (As(l)) {
- for (const f of l.elements)
- jde(f, a);
- break;
- }
- case 263:
- case 266:
- case 262:
- case 264:
- case 267:
- case 265:
- if (a)
- return;
- break;
- }
- }
- function ylt(r) {
- switch (r.kind) {
- case 80:
- return r;
- case 166:
- do
- r = r.left;
- while (r.kind !== 80);
- return r;
- case 211:
- do {
- if (jg(r.expression) && !Di(r.name))
- return r.name;
- r = r.expression;
- } while (r.kind !== 80);
- return r;
- }
- }
- function H$(r) {
- const a = KT(r);
- if (!a || rc(a))
- return !1;
- if (!oa(a))
- return je(a, p.String_literal_expected), !1;
- const l = r.parent.kind === 268 && Fu(r.parent.parent);
- if (r.parent.kind !== 307 && !l)
- return je(
- a,
- r.kind === 278 ? p.Export_declarations_are_not_permitted_in_a_namespace : p.Import_declarations_in_a_namespace_cannot_reference_a_module
- ), !1;
- if (l && Sl(a.text) && !iT(r))
- return je(r, p.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name), !1;
- if (!gl(r) && r.attributes) {
- const f = r.attributes.token === 118 ? p.Import_attribute_values_must_be_string_literal_expressions : p.Import_assertion_values_must_be_string_literal_expressions;
- let m = !1;
- for (const y of r.attributes.elements)
- oa(y.value) || (m = !0, je(y.value, f));
- return !m;
- }
- return !0;
- }
- function G$(r, a = !0) {
- r === void 0 || r.kind !== 11 || (a ? (z === 5 || z === 6) && dr(r, p.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020) : dr(r, p.Identifier_expected));
- }
- function $$(r) {
- var a, l, f, m;
- let y = Tn(r);
- const x = Zl(y);
- if (x !== ze) {
- if (y = Ra(y.exportSymbol || y), cn(r) && !(x.flags & 111551) && !Py(r)) {
- const W = G1(r) ? r.propertyName || r.name : Vl(r) ? r.name : r;
- if (E.assert(
- r.kind !== 280
- /* NamespaceExport */
- ), r.kind === 281) {
- const Q = je(W, p.Types_cannot_appear_in_export_declarations_in_JavaScript_files), ye = (l = (a = Tr(r).symbol) == null ? void 0 : a.exports) == null ? void 0 : l.get(hb(r.propertyName || r.name));
- if (ye === x) {
- const de = (f = ye.declarations) == null ? void 0 : f.find(uC);
- de && Rs(
- Q,
- Kr(
- de,
- p._0_is_automatically_exported_here,
- Ei(ye.escapedName)
- )
- );
- }
- } else {
- E.assert(
- r.kind !== 260
- /* VariableDeclaration */
- );
- const Q = or(r, Nf(ic, gl)), ye = (Q && ((m = xC(Q)) == null ? void 0 : m.text)) ?? "...", de = Ei(Oe(W) ? W.escapedText : y.escapedName);
- je(
- W,
- p._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation,
- de,
- `import("${ye}").${de}`
- );
- }
- return;
- }
- const N = Pu(x), j = (y.flags & 1160127 ? 111551 : 0) | (y.flags & 788968 ? 788968 : 0) | (y.flags & 1920 ? 1920 : 0);
- if (N & j) {
- const W = r.kind === 281 ? p.Export_declaration_conflicts_with_exported_declaration_of_0 : p.Import_declaration_conflicts_with_local_declaration_of_0;
- je(r, W, Ji(y));
- } else r.kind !== 281 && O.isolatedModules && !or(r, Py) && y.flags & 1160127 && je(
- r,
- p.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,
- Ji(y),
- et
- );
- if (Wp(O) && !Py(r) && !(r.flags & 33554432)) {
- const W = Fm(y), Q = !(N & 111551);
- if (Q || W)
- switch (r.kind) {
- case 273:
- case 276:
- case 271: {
- if (O.verbatimModuleSyntax) {
- E.assertIsDefined(r.name, "An ImportClause with a symbol should have a name");
- const ye = O.verbatimModuleSyntax && nS(r) ? p.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : Q ? p._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : p._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled, de = Fy(r.kind === 276 && r.propertyName || r.name);
- l2(
- je(r, ye, de),
- Q ? void 0 : W,
- de
- );
- }
- Q && r.kind === 271 && Z_(
- r,
- 32
- /* Export */
- ) && je(r, p.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, et);
- break;
- }
- case 281:
- if (O.verbatimModuleSyntax || Tr(W) !== Tr(r)) {
- const ye = Fy(r.propertyName || r.name), de = Q ? je(r, p.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, et) : je(r, p._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, ye, et);
- l2(de, Q ? void 0 : W, ye);
- break;
- }
- }
- if (O.verbatimModuleSyntax && r.kind !== 271 && !cn(r) && e.getEmitModuleFormatOfFile(Tr(r)) === 1 ? je(r, p.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled) : z === 200 && r.kind !== 271 && r.kind !== 260 && e.getEmitModuleFormatOfFile(Tr(r)) === 1 && je(r, p.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve), O.verbatimModuleSyntax && !Py(r) && !(r.flags & 33554432) && N & 128) {
- const ye = x.valueDeclaration, de = e.getRedirectReferenceForResolutionFromSourceOfProject(Tr(ye).resolvedPath);
- ye.flags & 33554432 && (!de || !jy(de.commandLine.options)) && je(r, p.Cannot_access_ambient_const_enums_when_0_is_enabled, et);
- }
- }
- if (Zu(r)) {
- const W = Bde(y, r);
- $h(W) && W.declarations && Xh(r, W.declarations, W.escapedName);
- }
- }
- }
- function Bde(r, a) {
- if (!(r.flags & 2097152) || $h(r) || !Du(r))
- return r;
- const l = Zl(r);
- if (l === ze) return l;
- for (; r.flags & 2097152; ) {
- const f = h$(r);
- if (f) {
- if (f === l) break;
- if (f.declarations && Nr(f.declarations))
- if ($h(f)) {
- Xh(a, f.declarations, f.escapedName);
- break;
- } else {
- if (r === l) break;
- r = f;
- }
- } else
- break;
- }
- return l;
- }
- function X$(r) {
- VP(r, r.name), $$(r), r.kind === 276 && (G$(r.propertyName), ng(r.propertyName || r.name) && Wg(O) && e.getEmitModuleFormatOfFile(Tr(r)) < 4 && bl(
- r,
- 131072
- /* ImportDefault */
- ));
- }
- function Jde(r) {
- var a;
- const l = r.attributes;
- if (l) {
- const f = rfe(
- /*reportErrors*/
- !0
- );
- f !== xs && Au(ts(l), sM(
- f,
- 32768
- /* Undefined */
- ), l);
- const m = FW(r), y = d6(l, m ? dr : void 0), x = r.attributes.token === 118;
- if (m && y)
- return;
- if ((z === 199 && r.moduleSpecifier && Gf(r.moduleSpecifier)) !== 99 && z !== 99 && z !== 200) {
- const W = x ? z === 199 ? p.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : p.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : z === 199 ? p.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : p.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
- return dr(l, W);
- }
- if (Cm(r) || (ic(r) ? (a = r.importClause) == null ? void 0 : a.isTypeOnly : r.isTypeOnly))
- return dr(l, x ? p.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : p.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
- if (y)
- return dr(l, p.resolution_mode_can_only_be_set_for_type_only_imports);
- }
- }
- function vlt(r) {
- return Vu(wc(r.value));
- }
- function blt(r) {
- if (!$M(r, cn(r) ? p.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : p.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
- if (!vh(r) && r.modifiers && Bl(r, p.An_import_declaration_cannot_have_modifiers), H$(r)) {
- const a = r.importClause;
- a && !__t(a) ? (a.name && X$(a), a.namedBindings && (a.namedBindings.kind === 274 ? (X$(a.namedBindings), e.getEmitModuleFormatOfFile(Tr(r)) < 4 && Wg(O) && bl(
- r,
- 65536
- /* ImportStar */
- )) : v_(r, r.moduleSpecifier) && ir(a.namedBindings.elements, X$))) : _e && !a && v_(r, r.moduleSpecifier);
- }
- Jde(r);
- }
- }
- function Slt(r) {
- if (!$M(r, cn(r) ? p.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : p.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module) && (vh(r), nS(r) || H$(r)))
- if (X$(r), Wk(
- r,
- 6
- /* ExportImportEquals */
- ), r.moduleReference.kind !== 283) {
- const a = Zl(Tn(r));
- if (a !== ze) {
- const l = Pu(a);
- if (l & 111551) {
- const f = E_(r.moduleReference);
- Yo(
- f,
- 112575
- /* Namespace */
- ).flags & 1920 || je(f, p.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, _o(f));
- }
- l & 788968 && qP(r.name, p.Import_name_cannot_be_0);
- }
- r.isTypeOnly && dr(r, p.An_import_alias_cannot_use_import_type);
- } else
- 5 <= z && z <= 99 && !r.isTypeOnly && !(r.flags & 33554432) && dr(r, p.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
- }
- function Tlt(r) {
- if (!$M(r, cn(r) ? p.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : p.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
- if (!vh(r) && fK(r) && Bl(r, p.An_export_declaration_cannot_have_modifiers), xlt(r), !r.moduleSpecifier || H$(r))
- if (r.exportClause && !ug(r.exportClause)) {
- ir(r.exportClause.elements, klt);
- const a = r.parent.kind === 268 && Fu(r.parent.parent), l = !a && r.parent.kind === 268 && !r.moduleSpecifier && r.flags & 33554432;
- r.parent.kind !== 307 && !a && !l && je(r, p.Export_declarations_are_not_permitted_in_a_namespace);
- } else {
- const a = v_(r, r.moduleSpecifier);
- a && eT(a) ? je(r.moduleSpecifier, p.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, Ji(a)) : r.exportClause && ($$(r.exportClause), G$(r.exportClause.name)), e.getEmitModuleFormatOfFile(Tr(r)) < 4 && (r.exportClause ? Wg(O) && bl(
- r,
- 65536
- /* ImportStar */
- ) : bl(
- r,
- 32768
- /* ExportStar */
- ));
- }
- Jde(r);
- }
- }
- function xlt(r) {
- var a;
- return r.isTypeOnly && ((a = r.exportClause) == null ? void 0 : a.kind) === 279 ? c7e(r.exportClause) : !1;
- }
- function $M(r, a) {
- const l = r.parent.kind === 307 || r.parent.kind === 268 || r.parent.kind === 267;
- return l || Bl(r, a), !l;
- }
- function klt(r) {
- $$(r);
- const a = r.parent.parent.moduleSpecifier !== void 0;
- if (G$(r.propertyName, a), G$(r.name), P_(O) && tE(
- r.propertyName || r.name,
- /*setVisibility*/
- !0
- ), a)
- Wg(O) && e.getEmitModuleFormatOfFile(Tr(r)) < 4 && ng(r.propertyName || r.name) && bl(
- r,
- 131072
- /* ImportDefault */
- );
- else {
- const l = r.propertyName || r.name;
- if (l.kind === 11)
- return;
- const f = Nt(
- l,
- l.escapedText,
- 2998271,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- f && (f === we || f === fe || f.declarations && g0(aT(f.declarations[0]))) ? je(l, p.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, Nn(l)) : Wk(
- r,
- 7
- /* ExportSpecifier */
- );
- }
- }
- function Clt(r) {
- const a = r.isExportEquals ? p.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration : p.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration;
- if ($M(r, a))
- return;
- const l = r.parent.kind === 307 ? r.parent : r.parent.parent;
- if (l.kind === 267 && !Fu(l)) {
- r.isExportEquals ? je(r, p.An_export_assignment_cannot_be_used_in_a_namespace) : je(r, p.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
- return;
- }
- !vh(r) && NB(r) && Bl(r, p.An_export_assignment_cannot_have_modifiers);
- const f = Gc(r);
- f && Au(wc(r.expression), Ci(f), r.expression);
- const m = !r.isExportEquals && !(r.flags & 33554432) && O.verbatimModuleSyntax && e.getEmitModuleFormatOfFile(Tr(r)) === 1;
- if (r.expression.kind === 80) {
- const y = r.expression, x = _f(Yo(
- y,
- -1,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- r
- ));
- if (x) {
- Wk(
- r,
- 3
- /* ExportAssignment */
- );
- const N = Fm(
- x,
- 111551
- /* Value */
- );
- if (Pu(x) & 111551 ? (wc(y), !m && !(r.flags & 33554432) && O.verbatimModuleSyntax && N && je(
- y,
- r.isExportEquals ? p.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : p.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
- Nn(y)
- )) : !m && !(r.flags & 33554432) && O.verbatimModuleSyntax && je(
- y,
- r.isExportEquals ? p.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : p.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,
- Nn(y)
- ), !m && !(r.flags & 33554432) && Wp(O) && !(x.flags & 111551)) {
- const j = Pu(
- x,
- /*excludeTypeOnlyMeanings*/
- !1,
- /*excludeLocalMeanings*/
- !0
- );
- x.flags & 2097152 && j & 788968 && !(j & 111551) && (!N || Tr(N) !== Tr(r)) ? je(
- y,
- r.isExportEquals ? p._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : p._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
- Nn(y),
- et
- ) : N && Tr(N) !== Tr(r) && l2(
- je(
- y,
- r.isExportEquals ? p._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : p._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
- Nn(y),
- et
- ),
- N,
- Nn(y)
- );
- }
- } else
- wc(y);
- P_(O) && tE(
- y,
- /*setVisibility*/
- !0
- );
- } else
- wc(r.expression);
- m && je(r, p.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled), EIe(l), r.flags & 33554432 && !yo(r.expression) && dr(r.expression, p.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context), r.isExportEquals && (z >= 5 && z !== 200 && (r.flags & 33554432 && e.getImpliedNodeFormatForEmit(Tr(r)) === 99 || !(r.flags & 33554432) && e.getImpliedNodeFormatForEmit(Tr(r)) !== 1) ? dr(r, p.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead) : z === 4 && !(r.flags & 33554432) && dr(r, p.Export_assignment_is_not_supported_when_module_flag_is_system));
- }
- function Elt(r) {
- return El(r.exports, (a, l) => l !== "export=");
- }
- function EIe(r) {
- const a = Tn(r), l = Bi(a);
- if (!l.exportsChecked) {
- const f = a.exports.get("export=");
- if (f && Elt(a)) {
- const y = Du(f) || f.valueDeclaration;
- y && !iT(y) && !cn(y) && je(y, p.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
- }
- const m = lh(a);
- m && m.forEach(({ declarations: y, flags: x }, N) => {
- if (N === "__export" || x & 1920)
- return;
- const j = py(y, gI(uMe, hI(Xl)));
- if (!(x & 524288 && j <= 2) && j > 1 && !Q$(y))
- for (const W of y)
- jye(W) && Da.add(Kr(W, p.Cannot_redeclare_exported_variable_0, Ei(N)));
- }), l.exportsChecked = !0;
- }
- }
- function Q$(r) {
- return r && r.length > 1 && r.every((a) => cn(a) && xo(a) && (iS(a.expression) || jg(a.expression)));
- }
- function la(r) {
- if (r) {
- const a = C;
- C = r, h = 0, Dlt(r), C = a;
- }
- }
- function Dlt(r) {
- if ($k(r) & 8388608)
- return;
- p3(r) && ir(r.jsDoc, ({ comment: l, tags: f }) => {
- DIe(l), ir(f, (m) => {
- DIe(m.comment), cn(r) && la(m);
- });
- });
- const a = r.kind;
- if (i)
- switch (a) {
- case 267:
- case 263:
- case 264:
- case 262:
- i.throwIfCancellationRequested();
- }
- switch (a >= 243 && a <= 259 && f3(r) && r.flowNode && !pM(r.flowNode) && Im(O.allowUnreachableCode === !1, r, p.Unreachable_code_detected), a) {
- case 168:
- return ONe(r);
- case 169:
- return FNe(r);
- case 172:
- return RNe(r);
- case 171:
- return _ot(r);
- case 185:
- case 184:
- case 179:
- case 180:
- case 181:
- return GN(r);
- case 174:
- case 173:
- return fot(r);
- case 175:
- return pot(r);
- case 176:
- return dot(r);
- case 177:
- case 178:
- return BNe(r);
- case 183:
- return kde(r);
- case 182:
- return oot(r);
- case 186:
- return bot(r);
- case 187:
- return Sot(r);
- case 188:
- return Tot(r);
- case 189:
- return xot(r);
- case 192:
- case 193:
- return kot(r);
- case 196:
- case 190:
- case 191:
- return la(r.type);
- case 197:
- return Pot(r);
- case 198:
- return wot(r);
- case 194:
- return Aot(r);
- case 195:
- return Not(r);
- case 203:
- return Iot(r);
- case 205:
- return Oot(r);
- case 202:
- return Fot(r);
- case 328:
- return ect(r);
- case 329:
- return Kot(r);
- case 346:
- case 338:
- case 340:
- return Uot(r);
- case 345:
- return Vot(r);
- case 344:
- return qot(r);
- case 324:
- case 325:
- case 326:
- return Got(r);
- case 341:
- return $ot(r);
- case 348:
- return Xot(r);
- case 317:
- Qot(r);
- case 315:
- case 314:
- case 312:
- case 313:
- case 322:
- PIe(r), bs(r, la);
- return;
- case 318:
- Plt(r);
- return;
- case 309:
- return la(r.type);
- case 333:
- case 335:
- case 334:
- return tct(r);
- case 350:
- return Hot(r);
- case 343:
- return Yot(r);
- case 351:
- return Zot(r);
- case 199:
- return Cot(r);
- case 200:
- return Eot(r);
- case 262:
- return Wot(r);
- case 241:
- case 268:
- return z$(r);
- case 243:
- return vct(r);
- case 244:
- return bct(r);
- case 245:
- return Sct(r);
- case 246:
- return kct(r);
- case 247:
- return Cct(r);
- case 248:
- return Ect(r);
- case 249:
- return Pct(r);
- case 250:
- return Dct(r);
- case 251:
- case 252:
- return Rct(r);
- case 253:
- return jct(r);
- case 254:
- return Bct(r);
- case 255:
- return Jct(r);
- case 256:
- return zct(r);
- case 257:
- return Wct(r);
- case 258:
- return Uct(r);
- case 260:
- return hct(r);
- case 208:
- return yct(r);
- case 263:
- return Yct(r);
- case 264:
- return olt(r);
- case 265:
- return clt(r);
- case 266:
- return flt(r);
- case 267:
- return hlt(r);
- case 272:
- return blt(r);
- case 271:
- return Slt(r);
- case 278:
- return Tlt(r);
- case 277:
- return Clt(r);
- case 242:
- case 259:
- f0(r);
- return;
- case 282:
- return got(r);
- }
- }
- function DIe(r) {
- us(r) && ir(r, (a) => {
- qT(a) && la(a);
- });
- }
- function PIe(r) {
- if (!cn(r))
- if (eO(r) || QC(r)) {
- const a = qs(
- eO(r) ? 54 : 58
- /* QuestionToken */
- ), l = r.postfix ? p._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 : p._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1, f = r.type, m = Ci(f);
- dr(
- r,
- l,
- a,
- Hr(
- QC(r) && !(m === Ht || m === Xt) ? Qn(wr([m, Ae], r.postfix ? void 0 : ht)) : m
- )
- );
- } else
- dr(r, p.JSDoc_types_can_only_be_used_inside_documentation_comments);
- }
- function Plt(r) {
- PIe(r), la(r.type);
- const { parent: a } = r;
- if (Ii(a) && YC(a.parent)) {
- _a(a.parent.parameters) !== a && je(r, p.A_rest_parameter_must_be_last_in_a_parameter_list);
- return;
- }
- pv(a) || je(r, p.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
- const l = r.parent.parent;
- if (!dp(l)) {
- je(r, p.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
- return;
- }
- const f = d3(l);
- if (!f)
- return;
- const m = ev(l);
- (!m || _a(m.parameters).symbol !== f) && je(r, p.A_rest_parameter_must_be_last_in_a_parameter_list);
- }
- function wlt(r) {
- const a = Ci(r.type), { parent: l } = r, f = r.parent.parent;
- if (pv(r.parent) && dp(f)) {
- const m = ev(f), y = JJ(f.parent.parent);
- if (m || y) {
- const x = Ro(y ? f.parent.parent.typeExpression.parameters : m.parameters), N = d3(f);
- if (!x || N && x.symbol === N && rg(x))
- return du(a);
- }
- }
- return Ii(l) && YC(l.parent) ? du(a) : cl(a);
- }
- function Hk(r) {
- const a = Tr(r), l = bn(a);
- l.flags & 1 ? E.assert(!l.deferredNodes, "A type-checked file should have no deferred nodes.") : (l.deferredNodes || (l.deferredNodes = /* @__PURE__ */ new Set()), l.deferredNodes.add(r));
- }
- function wIe(r) {
- const a = bn(r);
- a.deferredNodes && a.deferredNodes.forEach(Alt), a.deferredNodes = void 0;
- }
- function Alt(r) {
- var a, l;
- (a = rn) == null || a.push(rn.Phase.Check, "checkDeferredNode", { kind: r.kind, pos: r.pos, end: r.end, path: r.tracingPath });
- const f = C;
- switch (C = r, h = 0, r.kind) {
- case 213:
- case 214:
- case 215:
- case 170:
- case 286:
- CT(r);
- break;
- case 218:
- case 219:
- case 174:
- case 173:
- Cat(r);
- break;
- case 177:
- case 178:
- BNe(r);
- break;
- case 231:
- Qct(r);
- break;
- case 168:
- aot(r);
- break;
- case 285:
- Iit(r);
- break;
- case 284:
- Fit(r);
- break;
- case 216:
- case 234:
- case 217:
- Xst(r);
- break;
- case 222:
- Gi(r.expression);
- break;
- case 226:
- Y7(r) && CT(r);
- break;
- }
- C = f, (l = rn) == null || l.pop();
- }
- function Nlt(r, a) {
- var l, f;
- (l = rn) == null || l.push(
- rn.Phase.Check,
- a ? "checkSourceFileNodes" : "checkSourceFile",
- { path: r.path },
- /*separateBeginAndEnd*/
- !0
- );
- const m = a ? "beforeCheckNodes" : "beforeCheck", y = a ? "afterCheckNodes" : "afterCheck";
- Ko(m), a ? Olt(r, a) : Ilt(r), Ko(y), rp("Check", m, y), (f = rn) == null || f.pop();
- }
- function AIe(r, a) {
- if (a)
- return !1;
- switch (r) {
- case 0:
- return !!O.noUnusedLocals;
- case 1:
- return !!O.noUnusedParameters;
- default:
- return E.assertNever(r);
- }
- }
- function NIe(r) {
- return Bd.get(r.path) || Ue;
- }
- function Ilt(r) {
- const a = bn(r);
- if (!(a.flags & 1)) {
- if (JC(r, O, e))
- return;
- a7e(r), Ap(Hh), Ap(W0), Ap(md), Ap(U0), Ap(s1), a.flags & 8388608 && (Hh = a.potentialThisCollisions, W0 = a.potentialNewTargetCollisions, md = a.potentialWeakMapSetCollisions, U0 = a.potentialReflectCollisions, s1 = a.potentialUnusedRenamedBindingElementsInTypes), ir(r.statements, la), la(r.endOfFileToken), wIe(r), X_(r) && O1(r), n(() => {
- !r.isDeclarationFile && (O.noUnusedLocals || O.noUnusedParameters) && QNe(NIe(r), (l, f, m) => {
- !GT(l) && AIe(f, !!(l.flags & 33554432)) && Da.add(m);
- }), r.isDeclarationFile || sct();
- }), X_(r) && EIe(r), Hh.length && (ir(Hh, cct), Ap(Hh)), W0.length && (ir(W0, lct), Ap(W0)), md.length && (ir(md, pct), Ap(md)), U0.length && (ir(U0, mct), Ap(U0)), a.flags |= 1;
- }
- }
- function Olt(r, a) {
- const l = bn(r);
- if (!(l.flags & 1)) {
- if (JC(r, O, e))
- return;
- a7e(r), Ap(Hh), Ap(W0), Ap(md), Ap(U0), Ap(s1), ir(a, la), wIe(r), (l.potentialThisCollisions || (l.potentialThisCollisions = [])).push(...Hh), (l.potentialNewTargetCollisions || (l.potentialNewTargetCollisions = [])).push(...W0), (l.potentialWeakMapSetCollisions || (l.potentialWeakMapSetCollisions = [])).push(...md), (l.potentialReflectCollisions || (l.potentialReflectCollisions = [])).push(...U0), (l.potentialUnusedRenamedBindingElementsInTypes || (l.potentialUnusedRenamedBindingElementsInTypes = [])).push(
- ...s1
- ), l.flags |= 8388608;
- for (const f of a) {
- const m = bn(f);
- m.flags |= 8388608;
- }
- }
- }
- function IIe(r, a, l) {
- try {
- return i = a, Flt(r, l);
- } finally {
- i = void 0;
- }
- }
- function zde() {
- for (const r of t)
- r();
- t = [];
- }
- function Wde(r, a) {
- zde();
- const l = n;
- n = (f) => f(), Nlt(r, a), n = l;
- }
- function Flt(r, a) {
- if (r) {
- zde();
- const l = Da.getGlobalDiagnostics(), f = l.length;
- Wde(r, a);
- const m = Da.getDiagnostics(r.fileName);
- if (a)
- return m;
- const y = Da.getGlobalDiagnostics();
- if (y !== l) {
- const x = mX(l, y, R4);
- return Qi(x, m);
- } else if (f === 0 && y.length > 0)
- return Qi(y, m);
- return m;
- }
- return ir(e.getSourceFiles(), (l) => Wde(l)), Da.getDiagnostics();
- }
- function Llt() {
- return zde(), Da.getGlobalDiagnostics();
- }
- function Mlt(r, a) {
- if (r.flags & 67108864)
- return [];
- const l = Js();
- let f = !1;
- return m(), l.delete(
- "this"
- /* This */
- ), U_e(l);
- function m() {
- for (; r; ) {
- switch (tg(r) && r.locals && !g0(r) && x(r.locals, a), r.kind) {
- case 307:
- if (!il(r)) break;
- case 267:
- N(
- Tn(r).exports,
- a & 2623475
- /* ModuleMember */
- );
- break;
- case 266:
- x(
- Tn(r).exports,
- a & 8
- /* EnumMember */
- );
- break;
- case 231:
- r.name && y(r.symbol, a);
- case 263:
- case 264:
- f || x(
- k1(Tn(r)),
- a & 788968
- /* Type */
- );
- break;
- case 218:
- r.name && y(r.symbol, a);
- break;
- }
- DZ(r) && y(Me, a), f = zs(r), r = r.parent;
- }
- x(Te, a);
- }
- function y(j, W) {
- if (FC(j) & W) {
- const Q = j.escapedName;
- l.has(Q) || l.set(Q, j);
- }
- }
- function x(j, W) {
- W && j.forEach((Q) => {
- y(Q, W);
- });
- }
- function N(j, W) {
- W && j.forEach((Q) => {
- !Jo(
- Q,
- 281
- /* ExportSpecifier */
- ) && !Jo(
- Q,
- 280
- /* NamespaceExport */
- ) && Q.escapedName !== "default" && y(Q, W);
- });
- }
- }
- function Rlt(r) {
- return r.kind === 80 && hx(r.parent) && os(r.parent) === r;
- }
- function OIe(r) {
- for (; r.parent.kind === 166; )
- r = r.parent;
- return r.parent.kind === 183;
- }
- function jlt(r) {
- for (; r.parent.kind === 211; )
- r = r.parent;
- return r.parent.kind === 233;
- }
- function FIe(r, a) {
- let l, f = Ol(r);
- for (; f && !(l = a(f)); )
- f = Ol(f);
- return l;
- }
- function Blt(r) {
- return !!or(r, (a) => Qo(a) && Mp(a.body) || cs(a) ? !0 : Zn(a) || no(a) ? "quit" : !1);
- }
- function Ude(r, a) {
- return !!FIe(r, (l) => l === a);
- }
- function Jlt(r) {
- for (; r.parent.kind === 166; )
- r = r.parent;
- if (r.parent.kind === 271)
- return r.parent.moduleReference === r ? r.parent : void 0;
- if (r.parent.kind === 277)
- return r.parent.expression === r ? r.parent : void 0;
- }
- function Y$(r) {
- return Jlt(r) !== void 0;
- }
- function zlt(r) {
- switch (Cc(r.parent.parent)) {
- case 1:
- case 3:
- return i_(r.parent);
- case 5:
- if (Cn(r.parent) && LC(r.parent) === r)
- return;
- case 4:
- case 2:
- return Tn(r.parent.parent);
- }
- }
- function Wlt(r) {
- let a = r.parent;
- for (; Xu(a); )
- r = a, a = a.parent;
- if (a && a.kind === 205 && a.qualifier === r)
- return a;
- }
- function Ult(r) {
- if (r.expression.kind === 110) {
- const a = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (ys(a)) {
- const l = XAe(a);
- if (l) {
- const f = nb(
- l,
- /*contextFlags*/
- void 0
- ), m = YAe(l, f);
- return m && !Wa(m);
- }
- }
- }
- }
- function LIe(r) {
- if (og(r))
- return i_(r.parent);
- if (cn(r) && r.parent.kind === 211 && r.parent === r.parent.parent.left && !Di(r) && !dv(r) && !Ult(r.parent)) {
- const a = zlt(r);
- if (a)
- return a;
- }
- if (r.parent.kind === 277 && yo(r)) {
- const a = Yo(
- r,
- /*all meanings*/
- 2998271,
- /*ignoreErrors*/
- !0
- );
- if (a && a !== ze)
- return a;
- } else if (l_(r) && Y$(r)) {
- const a = nv(
- r,
- 271
- /* ImportEqualsDeclaration */
- );
- return E.assert(a !== void 0), vk(
- r,
- /*dontResolveAlias*/
- !0
- );
- }
- if (l_(r)) {
- const a = Wlt(r);
- if (a) {
- Ci(a);
- const l = bn(r).resolvedSymbol;
- return l === ze ? void 0 : l;
- }
- }
- for (; yK(r); )
- r = r.parent;
- if (jlt(r)) {
- let a = 0;
- r.parent.kind === 233 ? (a = um(r) ? 788968 : 111551, Q7(r.parent) && (a |= 111551)) : a = 1920, a |= 2097152;
- const l = yo(r) ? Yo(
- r,
- a,
- /*ignoreErrors*/
- !0
- ) : void 0;
- if (l)
- return l;
- }
- if (r.parent.kind === 341)
- return d3(r.parent);
- if (r.parent.kind === 168 && r.parent.parent.kind === 345) {
- E.assert(!cn(r));
- const a = VZ(r.parent);
- return a && a.symbol;
- }
- if (Ed(r)) {
- if (rc(r))
- return;
- const a = or(r, Nf(qT, _D, dv)), l = a ? 901119 : 111551;
- if (r.kind === 80) {
- if (SC(r) && Vk(r)) {
- const m = v$(r.parent);
- return m === ze ? void 0 : m;
- }
- const f = Yo(
- r,
- l,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- ev(r)
- );
- if (!f && a) {
- const m = or(r, Nf(Zn, Xl));
- if (m)
- return XM(
- r,
- /*ignoreErrors*/
- !0,
- Tn(m)
- );
- }
- if (f && a) {
- const m = xb(r);
- if (m && A0(m) && m === f.valueDeclaration)
- return Yo(
- r,
- l,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- Tr(m)
- ) || f;
- }
- return f;
- } else {
- if (Di(r))
- return T$(r);
- if (r.kind === 211 || r.kind === 166) {
- const f = bn(r);
- return f.resolvedSymbol ? f.resolvedSymbol : (r.kind === 211 ? (S$(
- r,
- 0
- /* Normal */
- ), f.resolvedSymbol || (f.resolvedSymbol = MIe(wc(r.expression), i0(r.name)))) : x8e(
- r,
- 0
- /* Normal */
- ), !f.resolvedSymbol && a && Xu(r) ? XM(r) : f.resolvedSymbol);
- } else if (dv(r))
- return XM(r);
- }
- } else if (OIe(r)) {
- const a = r.parent.kind === 183 ? 788968 : 1920, l = Yo(
- r,
- a,
- /*ignoreErrors*/
- !1,
- /*dontResolveAlias*/
- !0
- );
- return l && l !== ze ? l : TG(r);
- }
- if (r.parent.kind === 182)
- return Yo(
- r,
- /*meaning*/
- 1
- /* FunctionScopedVariable */
- );
- }
- function MIe(r, a) {
- const l = W_e(r, a);
- if (l.length && r.members) {
- const f = vG(Xd(r).members);
- if (l === wu(r))
- return f;
- if (f) {
- const m = Bi(f), y = Ai(l, (N) => N.declaration), x = lr(y, Ma).join(",");
- if (m.filteredIndexSymbolCache || (m.filteredIndexSymbolCache = /* @__PURE__ */ new Map()), m.filteredIndexSymbolCache.has(x))
- return m.filteredIndexSymbolCache.get(x);
- {
- const N = fa(
- 131072,
- "__index"
- /* Index */
- );
- return N.declarations = Ai(l, (j) => j.declaration), N.parent = r.aliasSymbol ? r.aliasSymbol : r.symbol ? r.symbol : od(N.declarations[0].parent), m.filteredIndexSymbolCache.set(x, N), N;
- }
- }
- }
- }
- function XM(r, a, l) {
- if (l_(r)) {
- let x = Yo(
- r,
- 901119,
- a,
- /*dontResolveAlias*/
- !0,
- ev(r)
- );
- if (!x && Oe(r) && l && (x = Ra(Al(n_(l), r.escapedText, 901119))), x)
- return x;
- }
- const f = Oe(r) ? l : XM(r.left, a, l), m = Oe(r) ? r.escapedText : r.right.escapedText;
- if (f) {
- const y = f.flags & 111551 && Gs(nn(f), "prototype"), x = y ? nn(y) : bo(f);
- return Gs(x, m);
- }
- }
- function od(r, a) {
- if (Si(r))
- return il(r) ? Ra(r.symbol) : void 0;
- const { parent: l } = r, f = l.parent;
- if (!(r.flags & 67108864)) {
- if (Bye(r)) {
- const m = Tn(l);
- return G1(r.parent) && r.parent.propertyName === r ? h$(m) : m;
- } else if (g3(r))
- return Tn(l.parent);
- if (r.kind === 80) {
- if (Y$(r))
- return LIe(r);
- if (l.kind === 208 && f.kind === 206 && r === l.propertyName) {
- const m = Gk(f), y = Gs(m, r.escapedText);
- if (y)
- return y;
- } else if (sD(l) && l.name === r)
- return l.keywordToken === 105 && Nn(r) === "target" ? ide(l).symbol : l.keywordToken === 102 && Nn(r) === "meta" ? Nwe().members.get("meta") : void 0;
- }
- switch (r.kind) {
- case 80:
- case 81:
- case 211:
- case 166:
- if (!Pb(r))
- return LIe(r);
- case 110:
- const m = Lu(
- r,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (ys(m)) {
- const N = Zf(m);
- if (N.thisParameter)
- return N.thisParameter;
- }
- if (k7(r))
- return Gi(r).symbol;
- case 197:
- return Cfe(r).symbol;
- case 108:
- return Gi(r).symbol;
- case 137:
- const y = r.parent;
- return y && y.kind === 176 ? y.parent.symbol : void 0;
- case 11:
- case 15:
- if (Z1(r.parent.parent) && g4(r.parent.parent) === r || (r.parent.kind === 272 || r.parent.kind === 278) && r.parent.moduleSpecifier === r || cn(r) && Cm(r.parent) && r.parent.moduleSpecifier === r || cn(r) && f_(
- r.parent,
- /*requireStringLiteralLikeArgument*/
- !1
- ) || hf(r.parent) || P0(r.parent) && h0(r.parent.parent) && r.parent.parent.argument === r.parent)
- return v_(r, r, a);
- if (Fs(l) && sS(l) && l.arguments[1] === r)
- return Tn(l);
- case 9:
- const x = ko(l) ? l.argumentExpression === r ? tu(l.expression) : void 0 : P0(l) && Rb(f) ? Ci(f.objectType) : void 0;
- return x && Gs(x, tc(r.text));
- case 90:
- case 100:
- case 39:
- case 86:
- return i_(r.parent);
- case 205:
- return h0(r) ? od(r.argument.literal, a) : void 0;
- case 95:
- return wo(r.parent) ? E.checkDefined(r.parent.symbol) : void 0;
- case 102:
- case 105:
- return sD(r.parent) ? aNe(r.parent).symbol : void 0;
- case 104:
- if (dn(r.parent)) {
- const N = tu(r.parent.right), j = mde(N);
- return j?.symbol ?? N.symbol;
- }
- return;
- case 236:
- return Gi(r).symbol;
- case 295:
- if (SC(r) && Vk(r)) {
- const N = v$(r.parent);
- return N === ze ? void 0 : N;
- }
- default:
- return;
- }
- }
- }
- function Vlt(r) {
- if (Oe(r) && Cn(r.parent) && r.parent.name === r) {
- const a = i0(r), l = tu(r.parent.expression), f = l.flags & 1048576 ? l.types : [l];
- return ta(f, (m) => Ln(wu(m), (y) => Ak(a, y.keyType)));
- }
- }
- function qlt(r) {
- if (r && r.kind === 304)
- return Yo(
- r.name,
- 2208703
- /* Alias */
- );
- }
- function Hlt(r) {
- if (vu(r)) {
- const a = r.propertyName || r.name;
- return r.parent.parent.moduleSpecifier ? ch(r.parent.parent, r) : a.kind === 11 ? void 0 : (
- // Skip for invalid syntax like this: export { "x" }
- Yo(
- a,
- 2998271
- /* Alias */
- )
- );
- } else
- return Yo(
- r,
- 2998271
- /* Alias */
- );
- }
- function Gk(r) {
- if (Si(r) && !il(r) || r.flags & 67108864)
- return He;
- const a = MB(r), l = a && b_(Tn(a.class));
- if (um(r)) {
- const f = Ci(r);
- return l ? df(f, l.thisType) : f;
- }
- if (Ed(r))
- return Vde(r);
- if (l && !a.isImplements) {
- const f = el(No(l));
- return f ? df(f, l.thisType) : He;
- }
- if (hx(r)) {
- const f = Tn(r);
- return bo(f);
- }
- if (Rlt(r)) {
- const f = od(r);
- return f ? bo(f) : He;
- }
- if (va(r))
- return Xf(
- r,
- /*includeOptionality*/
- !0,
- 0
- /* Normal */
- ) || He;
- if (ql(r)) {
- const f = Tn(r);
- return f ? nn(f) : He;
- }
- if (Bye(r)) {
- const f = od(r);
- return f ? nn(f) : He;
- }
- if (As(r))
- return Xf(
- r.parent,
- /*includeOptionality*/
- !0,
- 0
- /* Normal */
- ) || He;
- if (Y$(r)) {
- const f = od(r);
- if (f) {
- const m = bo(f);
- return H(m) ? nn(f) : m;
- }
- }
- return sD(r.parent) && r.parent.keywordToken === r.kind ? aNe(r.parent) : hS(r) ? rfe(
- /*reportErrors*/
- !1
- ) : He;
- }
- function Z$(r) {
- if (E.assert(
- r.kind === 210 || r.kind === 209
- /* ArrayLiteralExpression */
- ), r.parent.kind === 250) {
- const m = qM(r.parent);
- return DT(r, m || He);
- }
- if (r.parent.kind === 226) {
- const m = tu(r.parent.right);
- return DT(r, m || He);
- }
- if (r.parent.kind === 303) {
- const m = Bs(r.parent.parent, Ks), y = Z$(m) || He, x = mC(m.properties, r.parent);
- return SNe(m, y, x);
- }
- const a = Bs(r.parent, $l), l = Z$(a) || He, f = uy(65, l, Ae, r.parent) || He;
- return TNe(a, l, a.elements.indexOf(r), f);
- }
- function Glt(r) {
- const a = Z$(Bs(r.parent.parent, o4));
- return a && Gs(a, r.escapedText);
- }
- function Vde(r) {
- return A4(r) && (r = r.parent), Vu(tu(r));
- }
- function RIe(r) {
- const a = i_(r.parent);
- return zs(r) ? nn(a) : bo(a);
- }
- function jIe(r) {
- const a = r.name;
- switch (a.kind) {
- case 80:
- return S_(Nn(a));
- case 9:
- case 11:
- return S_(a.text);
- case 167:
- const l = Wm(a);
- return eu(
- l,
- 12288
- /* ESSymbolLike */
- ) ? l : Ie;
- default:
- return E.fail("Unsupported property name.");
- }
- }
- function qde(r) {
- r = Uu(r);
- const a = Js(qa(r)), l = Ns(
- r,
- 0
- /* Call */
- ).length ? hp : Ns(
- r,
- 1
- /* Construct */
- ).length ? Pe : void 0;
- return l && ir(qa(l), (f) => {
- a.has(f.escapedName) || a.set(f.escapedName, f);
- }), ai(a);
- }
- function K$(r) {
- return Ns(
- r,
- 0
- /* Call */
- ).length !== 0 || Ns(
- r,
- 1
- /* Construct */
- ).length !== 0;
- }
- function BIe(r) {
- const a = $lt(r);
- return a ? ta(a, BIe) : [r];
- }
- function $lt(r) {
- if (gc(r) & 6)
- return Ai(Bi(r).containingType.types, (a) => Gs(a, r.escapedName));
- if (r.flags & 33554432) {
- const { links: { leftSpread: a, rightSpread: l, syntheticOrigin: f } } = r;
- return a ? [a, l] : f ? [f] : MT(Xlt(r));
- }
- }
- function Xlt(r) {
- let a, l = r;
- for (; l = Bi(l).target; )
- a = l;
- return a;
- }
- function Qlt(r) {
- if (jo(r)) return !1;
- const a = fs(r, Oe);
- if (!a) return !1;
- const l = a.parent;
- return l ? !((Cn(l) || Qc(l)) && l.name === a) && iI(a) === Me : !1;
- }
- function Ylt(r) {
- return Fw(r.parent) && r === r.parent.name;
- }
- function Zlt(r, a) {
- var l;
- const f = fs(r, Oe);
- if (f) {
- let m = iI(
- f,
- /*startInDeclarationContainer*/
- Ylt(f)
- );
- if (m) {
- if (m.flags & 1048576) {
- const x = Ra(m.exportSymbol);
- if (!a && x.flags & 944 && !(x.flags & 3))
- return;
- m = x;
- }
- const y = Cf(m);
- if (y) {
- if (y.flags & 512 && ((l = y.valueDeclaration) == null ? void 0 : l.kind) === 307) {
- const x = y.valueDeclaration, N = Tr(f);
- return x !== N ? void 0 : x;
- }
- return or(f.parent, (x) => Fw(x) && Tn(x) === y);
- }
- }
- }
- }
- function Klt(r) {
- const a = Iee(r);
- if (a)
- return a;
- const l = fs(r, Oe);
- if (l) {
- const f = mut(l);
- if (f2(
- f,
- /*excludes*/
- 111551
- /* Value */
- ) && !Fm(
- f,
- 111551
- /* Value */
- ))
- return Du(f);
- }
- }
- function eut(r) {
- return r.valueDeclaration && va(r.valueDeclaration) && JT(r.valueDeclaration).parent.kind === 299;
- }
- function JIe(r) {
- if (r.flags & 418 && r.valueDeclaration && !Si(r.valueDeclaration)) {
- const a = Bi(r);
- if (a.isDeclarationWithCollidingName === void 0) {
- const l = Cd(r.valueDeclaration);
- if (rZ(l) || eut(r))
- if (Nt(
- l.parent,
- r.escapedName,
- 111551,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !1
- ))
- a.isDeclarationWithCollidingName = !0;
- else if (Hde(
- r.valueDeclaration,
- 16384
- /* CapturedBlockScopedBinding */
- )) {
- const f = Hde(
- r.valueDeclaration,
- 32768
- /* BlockScopedBindingInLoop */
- ), m = Ny(
- l,
- /*lookInLabeledStatements*/
- !1
- ), y = l.kind === 241 && Ny(
- l.parent,
- /*lookInLabeledStatements*/
- !1
- );
- a.isDeclarationWithCollidingName = !uZ(l) && (!f || !m && !y);
- } else
- a.isDeclarationWithCollidingName = !1;
- }
- return a.isDeclarationWithCollidingName;
- }
- return !1;
- }
- function tut(r) {
- if (!jo(r)) {
- const a = fs(r, Oe);
- if (a) {
- const l = iI(a);
- if (l && JIe(l))
- return l.valueDeclaration;
- }
- }
- }
- function rut(r) {
- const a = fs(r, ql);
- if (a) {
- const l = Tn(a);
- if (l)
- return JIe(l);
- }
- return !1;
- }
- function zIe(r) {
- switch (E.assert(Re), r.kind) {
- case 271:
- return eX(Tn(r));
- case 273:
- case 274:
- case 276:
- case 281:
- const a = Tn(r);
- return !!a && eX(
- a,
- /*excludeTypeOnlyValues*/
- !0
- );
- case 278:
- const l = r.exportClause;
- return !!l && (ug(l) || ut(l.elements, zIe));
- case 277:
- return r.expression && r.expression.kind === 80 ? eX(
- Tn(r),
- /*excludeTypeOnlyValues*/
- !0
- ) : !0;
- }
- return !1;
- }
- function nut(r) {
- const a = fs(r, gl);
- return a === void 0 || a.parent.kind !== 307 || !nS(a) ? !1 : eX(Tn(a)) && a.moduleReference && !rc(a.moduleReference);
- }
- function eX(r, a) {
- if (!r)
- return !1;
- const l = Tr(r.valueDeclaration), f = l && Tn(l);
- M_(f);
- const m = _f(Zl(r));
- return m === ze ? !a || !Fm(r) : !!(Pu(
- r,
- a,
- /*excludeLocalMeanings*/
- !0
- ) & 111551) && (jy(O) || !nI(m));
- }
- function nI(r) {
- return dde(r) || !!r.constEnumOnlyModule;
- }
- function WIe(r, a) {
- if (E.assert(Re), kf(r)) {
- const l = Tn(r), f = l && Bi(l);
- if (f?.referenced)
- return !0;
- const m = Bi(l).aliasTarget;
- if (m && Mu(r) & 32 && Pu(m) & 111551 && (jy(O) || !nI(m)))
- return !0;
- }
- return a ? !!bs(r, (l) => WIe(l, a)) : !1;
- }
- function UIe(r) {
- if (Mp(r.body)) {
- if (d0(r) || om(r)) return !1;
- const a = Tn(r), l = E2(a);
- return l.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
- // e.g.: function foo(a: string): string;
- // function foo(a: any) { // This is implementation of the overloads
- // return a;
- // }
- l.length === 1 && l[0].declaration !== r;
- }
- return !1;
- }
- function iut(r) {
- const a = rX(r);
- if (!a) return !1;
- const l = Ci(a);
- return mE(l);
- }
- function tX(r, a) {
- return (sut(r, a) || aut(r)) && !iut(r);
- }
- function sut(r, a) {
- return !ee || ML(r) || dp(r) || !r.initializer ? !1 : Gn(
- r,
- 31
- /* ParameterPropertyModifier */
- ) ? !!a && no(a) : !0;
- }
- function aut(r) {
- return ee && ML(r) && (dp(r) || !r.initializer) && Gn(
- r,
- 31
- /* ParameterPropertyModifier */
- );
- }
- function VIe(r) {
- const a = fs(r, (f) => Ec(f) || ii(f));
- if (!a)
- return !1;
- let l;
- if (ii(a)) {
- if (a.type || !cn(a) && !sI(a))
- return !1;
- const f = y4(a);
- if (!f || !kd(f))
- return !1;
- l = Tn(f);
- } else
- l = Tn(a);
- return !l || !(l.flags & 16 | 3) ? !1 : !!El(n_(l), (f) => f.flags & 111551 && vx(f.valueDeclaration));
- }
- function out(r) {
- const a = fs(r, Ec);
- if (!a)
- return Ue;
- const l = Tn(a);
- return l && qa(nn(l)) || Ue;
- }
- function $k(r) {
- var a;
- const l = r.id || 0;
- return l < 0 || l >= po.length ? 0 : ((a = po[l]) == null ? void 0 : a.flags) || 0;
- }
- function Hde(r, a) {
- return cut(r, a), !!($k(r) & a);
- }
- function cut(r, a) {
- if (!O.noCheck && U4(Tr(r), O) || bn(r).calculatedFlags & a)
- return;
- switch (a) {
- case 16:
- case 32:
- return x(r);
- case 128:
- case 256:
- case 2097152:
- return y(r);
- case 512:
- case 8192:
- case 65536:
- case 262144:
- return j(r);
- case 536870912:
- return Q(r);
- case 4096:
- case 32768:
- case 16384:
- return de(r);
- default:
- return E.assertNever(a, `Unhandled node check flag calculation: ${E.formatNodeCheckFlags(a)}`);
- }
- function f(ct, mt) {
- const Gt = mt(ct, ct.parent);
- if (Gt !== "skip")
- return Gt || jx(ct, mt);
- }
- function m(ct) {
- const mt = bn(ct);
- if (mt.calculatedFlags & a) return "skip";
- mt.calculatedFlags |= 2097536, x(ct);
- }
- function y(ct) {
- f(ct, m);
- }
- function x(ct) {
- const mt = bn(ct);
- mt.calculatedFlags |= 48, ct.kind === 108 && _$(ct);
- }
- function N(ct) {
- const mt = bn(ct);
- if (mt.calculatedFlags & a) return "skip";
- mt.calculatedFlags |= 336384, Q(ct);
- }
- function j(ct) {
- f(ct, N);
- }
- function W(ct) {
- return Ed(ct) || uu(ct.parent) && (ct.parent.objectAssignmentInitializer ?? ct.parent.name) === ct;
- }
- function Q(ct) {
- const mt = bn(ct);
- if (mt.calculatedFlags |= 536870912, Oe(ct) && (mt.calculatedFlags |= 49152, W(ct) && !(Cn(ct.parent) && ct.parent.name === ct))) {
- const Gt = Nu(ct);
- Gt && Gt !== ze && qAe(ct, Gt);
- }
- }
- function ye(ct) {
- const mt = bn(ct);
- if (mt.calculatedFlags & a) return "skip";
- mt.calculatedFlags |= 53248, Ze(ct);
- }
- function de(ct) {
- const mt = Cd(og(ct) ? ct.parent : ct);
- f(mt, ye);
- }
- function Ze(ct) {
- Q(ct), ma(ct) && Wm(ct), Di(ct) && _l(ct.parent) && M$(ct.parent);
- }
- }
- function PT(r) {
- return xIe(r.parent), bn(r).enumMemberValue ?? pl(
- /*value*/
- void 0
- );
- }
- function qIe(r) {
- switch (r.kind) {
- case 306:
- case 211:
- case 212:
- return !0;
- }
- return !1;
- }
- function Gde(r) {
- if (r.kind === 306)
- return PT(r).value;
- bn(r).resolvedSymbol || wc(r);
- const a = bn(r).resolvedSymbol || (yo(r) ? Yo(
- r,
- 111551,
- /*ignoreErrors*/
- !0
- ) : void 0);
- if (a && a.flags & 8) {
- const l = a.valueDeclaration;
- if (Y1(l.parent))
- return PT(l).value;
- }
- }
- function $de(r) {
- return !!(r.flags & 524288) && Ns(
- r,
- 0
- /* Call */
- ).length > 0;
- }
- function lut(r, a) {
- var l;
- const f = fs(r, l_);
- if (!f || a && (a = fs(a), !a))
- return 0;
- let m = !1;
- if (Xu(f)) {
- const Q = Yo(
- E_(f),
- 111551,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- a
- );
- m = !!((l = Q?.declarations) != null && l.every(Py));
- }
- const y = Yo(
- f,
- 111551,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- a
- ), x = y && y.flags & 2097152 ? Zl(y) : y;
- m || (m = !!(y && Fm(
- y,
- 111551
- /* Value */
- )));
- const N = Yo(
- f,
- 788968,
- /*ignoreErrors*/
- !0,
- /*dontResolveAlias*/
- !0,
- a
- ), j = N && N.flags & 2097152 ? Zl(N) : N;
- if (y || m || (m = !!(N && Fm(
- N,
- 788968
- /* Type */
- ))), x && x === j) {
- const Q = nfe(
- /*reportErrors*/
- !1
- );
- if (Q && x === Q)
- return 9;
- const ye = nn(x);
- if (ye && Cr(ye))
- return m ? 10 : 1;
- }
- if (!j)
- return m ? 11 : 0;
- const W = bo(j);
- return H(W) ? m ? 11 : 0 : W.flags & 3 ? 11 : eu(
- W,
- 245760
- /* Never */
- ) ? 2 : eu(
- W,
- 528
- /* BooleanLike */
- ) ? 6 : eu(
- W,
- 296
- /* NumberLike */
- ) ? 3 : eu(
- W,
- 2112
- /* BigIntLike */
- ) ? 4 : eu(
- W,
- 402653316
- /* StringLike */
- ) ? 5 : ha(W) ? 7 : eu(
- W,
- 12288
- /* ESSymbolLike */
- ) ? 8 : $de(W) ? 10 : Dp(W) ? 7 : 11;
- }
- function uut(r, a, l, f, m) {
- const y = fs(r, kZ);
- if (!y)
- return A.createToken(
- 133
- /* AnyKeyword */
- );
- const x = Tn(y), N = x && !(x.flags & 133120) ? eb(nn(x)) : He;
- return me.serializeTypeForDeclaration(y, N, x, a, l | 1024, f, m);
- }
- function _ut(r) {
- return ys(r) || wo(r) || YT(r);
- }
- function QM(r) {
- r = fs(r, Ew);
- const a = r.kind === 178 ? 177 : 178, l = Jo(Tn(r), a), f = l && l.pos < r.pos ? l : r, m = l && l.pos < r.pos ? r : l, y = r.kind === 178 ? r : l, x = r.kind === 177 ? r : l;
- return {
- firstAccessor: f,
- secondAccessor: m,
- setAccessor: y,
- getAccessor: x
- };
- }
- function HIe(r) {
- return ys(r) && !om(r) ? GIe(r) : wo(r) ? r.expression : r.initializer ? r.initializer : Ii(r) && om(r.parent) ? GIe(QM(r.parent).getAccessor) : void 0;
- }
- function GIe(r) {
- let a;
- if (r && !rc(r.body)) {
- if (Jc(r) & 3) return;
- const l = r.body;
- l && Cs(l) ? y0(l, (f) => {
- if (!a)
- a = f.expression;
- else
- return a = void 0, !0;
- }) : a = l;
- }
- return a;
- }
- function fut(r, a, l, f, m) {
- const y = fs(r, ys);
- return y ? me.serializeReturnTypeForSignature(Zf(y), a, l | 1024, f, m) : A.createToken(
- 133
- /* AnyKeyword */
- );
- }
- function put(r, a, l, f, m) {
- const y = fs(r, _t);
- if (!y)
- return A.createToken(
- 133
- /* AnyKeyword */
- );
- const x = J_(Vde(y));
- return me.expressionOrTypeToTypeNode(
- y,
- x,
- /*addUndefined*/
- void 0,
- a,
- l | 1024,
- f,
- m
- );
- }
- function dut(r) {
- return Te.has(tc(r));
- }
- function iI(r, a) {
- const l = bn(r).resolvedSymbol;
- if (l)
- return l;
- let f = r;
- if (a) {
- const m = r.parent;
- ql(m) && r === m.name && (f = aT(m));
- }
- return Nt(
- f,
- r.escapedText,
- 3257279,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0
- );
- }
- function mut(r) {
- const a = bn(r).resolvedSymbol;
- return a && a !== ze ? a : Nt(
- r,
- r.escapedText,
- 3257279,
- /*nameNotFoundMessage*/
- void 0,
- /*isUse*/
- !0,
- /*excludeGlobals*/
- void 0
- );
- }
- function gut(r) {
- if (!jo(r)) {
- const a = fs(r, Oe);
- if (a) {
- const l = iI(a);
- if (l)
- return _f(l).valueDeclaration;
- }
- }
- }
- function hut(r) {
- if (!jo(r)) {
- const a = fs(r, Oe);
- if (a) {
- const l = iI(a);
- if (l)
- return Ln(_f(l).declarations, (f) => {
- switch (f.kind) {
- case 260:
- case 169:
- case 208:
- case 172:
- case 303:
- case 304:
- case 306:
- case 210:
- case 262:
- case 218:
- case 219:
- case 263:
- case 231:
- case 266:
- case 174:
- case 177:
- case 178:
- case 267:
- return !0;
- }
- return !1;
- });
- }
- }
- }
- function yut(r) {
- return Vw(r) || ii(r) && sI(r) ? A2(nn(Tn(r))) : !1;
- }
- function vut(r, a, l) {
- const f = r.flags & 1056 ? me.symbolToExpression(
- r.symbol,
- 111551,
- a,
- /*flags*/
- void 0,
- /*internalFlags*/
- void 0,
- l
- ) : r === nt ? A.createTrue() : r === yr && A.createFalse();
- if (f) return f;
- const m = r.value;
- return typeof m == "object" ? A.createBigIntLiteral(m) : typeof m == "string" ? A.createStringLiteral(m) : m < 0 ? A.createPrefixUnaryExpression(41, A.createNumericLiteral(-m)) : A.createNumericLiteral(m);
- }
- function but(r, a) {
- const l = nn(Tn(r));
- return vut(l, r, a);
- }
- function $Ie(r) {
- return r ? (gg(r), Tr(r).localJsxFactory || ih) : ih;
- }
- function Xde(r) {
- if (r) {
- const a = Tr(r);
- if (a) {
- if (a.localJsxFragmentFactory)
- return a.localJsxFragmentFactory;
- const l = a.pragmas.get("jsxfrag"), f = us(l) ? l[0] : l;
- if (f)
- return a.localJsxFragmentFactory = Jx(f.arguments.factory, B), a.localJsxFragmentFactory;
- }
- }
- if (O.jsxFragmentFactory)
- return Jx(O.jsxFragmentFactory, B);
- }
- function rX(r) {
- const a = Gc(r);
- if (a)
- return a;
- if (r.kind === 169 && r.parent.kind === 178) {
- const l = QM(r.parent).getAccessor;
- if (l)
- return Y_(l);
- }
- }
- function Sut(r) {
- const a = Y_(r);
- if (a)
- return a;
- if (r.kind === 177) {
- const l = QM(r).setAccessor;
- if (l) {
- const f = IC(l);
- if (f)
- return Gc(f);
- }
- }
- }
- function Tut() {
- return {
- getReferencedExportContainer: Zlt,
- getReferencedImportDeclaration: Klt,
- getReferencedDeclarationWithCollidingName: tut,
- isDeclarationWithCollidingName: rut,
- isValueAliasDeclaration: (a) => {
- const l = fs(a);
- return l && Re ? zIe(l) : !0;
- },
- hasGlobalName: dut,
- isReferencedAliasDeclaration: (a, l) => {
- const f = fs(a);
- return f && Re ? WIe(f, l) : !0;
- },
- hasNodeCheckFlag: (a, l) => {
- const f = fs(a);
- return f ? Hde(f, l) : !1;
- },
- isTopLevelValueImportEqualsWithEntityName: nut,
- isDeclarationVisible: yd,
- isImplementationOfOverload: UIe,
- requiresAddingImplicitUndefined: tX,
- isExpandoFunctionDeclaration: VIe,
- getPropertiesOfContainerFunction: out,
- createTypeOfDeclaration: uut,
- createReturnTypeOfSignatureDeclaration: fut,
- createTypeOfExpression: put,
- createLiteralConstValue: but,
- isSymbolAccessible: Hd,
- isEntityNameVisible: oN,
- getConstantValue: (a) => {
- const l = fs(a, qIe);
- return l ? Gde(l) : void 0;
- },
- getEnumMemberValue: (a) => {
- const l = fs(a, A0);
- return l ? PT(l) : void 0;
- },
- collectLinkedAliases: tE,
- markLinkedReferences: (a) => {
- const l = fs(a);
- return l && Wk(
- l,
- 0
- /* Unspecified */
- );
- },
- getReferencedValueDeclaration: gut,
- getReferencedValueDeclarations: hut,
- getTypeReferenceSerializationKind: lut,
- isOptionalParameter: ML,
- isArgumentsLocalBinding: Qlt,
- getExternalModuleFileFromDeclaration: (a) => {
- const l = fs(a, pZ);
- return l && Qde(l);
- },
- isLiteralConstDeclaration: yut,
- isLateBound: (a) => {
- const l = fs(a, ql), f = l && Tn(l);
- return !!(f && gc(f) & 4096);
- },
- getJsxFactoryEntity: $Ie,
- getJsxFragmentFactoryEntity: Xde,
- isBindingCapturedByNode: (a, l) => {
- const f = fs(a), m = fs(l);
- return !!f && !!m && (ii(m) || va(m)) && jnt(f, m);
- },
- getDeclarationStatementsForSourceFile: (a, l, f, m) => {
- const y = fs(a);
- E.assert(y && y.kind === 307, "Non-sourcefile node passed into getDeclarationsForSourceFile");
- const x = Tn(a);
- return x ? (M_(x), x.exports ? me.symbolTableToDeclarationStatements(x.exports, a, l, f, m) : []) : a.locals ? me.symbolTableToDeclarationStatements(a.locals, a, l, f, m) : [];
- },
- isImportRequiredByAugmentation: r,
- isDefinitelyReferenceToGlobalSymbolObject: xl
- };
- function r(a) {
- const l = Tr(a);
- if (!l.symbol) return !1;
- const f = Qde(a);
- if (!f || f === l) return !1;
- const m = lh(l.symbol);
- for (const y of as(m.values()))
- if (y.mergeId) {
- const x = Ra(y);
- if (x.declarations) {
- for (const N of x.declarations)
- if (Tr(N) === f)
- return !0;
- }
- }
- return !1;
- }
- }
- function Qde(r) {
- const a = r.kind === 267 ? Wn(r.name, oa) : KT(r), l = p2(
- a,
- a,
- /*moduleNotFoundError*/
- void 0
- );
- if (l)
- return Jo(
- l,
- 307
- /* SourceFile */
- );
- }
- function xut() {
- for (const a of e.getSourceFiles())
- wre(a, O);
- vc = /* @__PURE__ */ new Map();
- let r;
- for (const a of e.getSourceFiles())
- if (!a.redirectInfo) {
- if (!X_(a)) {
- const l = a.locals.get("globalThis");
- if (l?.declarations)
- for (const f of l.declarations)
- Da.add(Kr(f, p.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis"));
- rd(Te, a.locals);
- }
- a.jsGlobalAugmentations && rd(Te, a.jsGlobalAugmentations), a.patternAmbientModules && a.patternAmbientModules.length && (_c = Qi(_c, a.patternAmbientModules)), a.moduleAugmentations.length && (r || (r = [])).push(a.moduleAugmentations), a.symbol && a.symbol.globalExports && a.symbol.globalExports.forEach((f, m) => {
- Te.has(m) || Te.set(m, f);
- });
- }
- if (r)
- for (const a of r)
- for (const l of a)
- ig(l.parent) && gk(l);
- if (G0(), Bi(we).type = dt, Bi(Me).type = fc(
- "IArguments",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), Bi(ze).type = He, Bi(fe).type = k(16, fe), Et = fc(
- "Array",
- /*arity*/
- 1,
- /*reportErrors*/
- !0
- ), Lc = fc(
- "Object",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), al = fc(
- "Function",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), hp = ue && fc(
- "CallableFunction",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ) || al, Pe = ue && fc(
- "NewableFunction",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ) || al, $i = fc(
- "String",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), Sa = fc(
- "Number",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), ka = fc(
- "Boolean",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), Pc = fc(
- "RegExp",
- /*arity*/
- 0,
- /*reportErrors*/
- !0
- ), so = du(xe), Va = du(at), Va === xs && (Va = Li(
- /*symbol*/
- void 0,
- I,
- Ue,
- Ue,
- Ue
- )), Lr = Bwe(
- "ReadonlyArray",
- /*arity*/
- 1
- ) || Et, Uc = Lr ? AP(Lr, [xe]) : so, yl = Bwe(
- "ThisType",
- /*arity*/
- 1
- ), r)
- for (const a of r)
- for (const l of a)
- ig(l.parent) || gk(l);
- vc.forEach(({ firstFile: a, secondFile: l, conflictingSymbols: f }) => {
- if (f.size < 8)
- f.forEach(({ isBlockScoped: m, firstFileLocations: y, secondFileLocations: x }, N) => {
- const j = m ? p.Cannot_redeclare_block_scoped_variable_0 : p.Duplicate_identifier_0;
- for (const W of y)
- mk(W, j, N, x);
- for (const W of x)
- mk(W, j, N, y);
- });
- else {
- const m = as(f.keys()).join(", ");
- Da.add(Rs(
- Kr(a, p.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, m),
- Kr(l, p.Conflicts_are_in_this_file)
- )), Da.add(Rs(
- Kr(l, p.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, m),
- Kr(a, p.Conflicts_are_in_this_file)
- ));
- }
- }), vc = void 0;
- }
- function bl(r, a) {
- if (O.importHelpers) {
- const l = Tr(r);
- if ($T(l, O) && !(r.flags & 33554432)) {
- const f = Cut(l, r);
- if (f !== ze) {
- const m = Bi(f);
- if (m.requestedExternalEmitHelpers ?? (m.requestedExternalEmitHelpers = 0), (m.requestedExternalEmitHelpers & a) !== a) {
- const y = a & ~m.requestedExternalEmitHelpers;
- for (let x = 1; x <= 16777216; x <<= 1)
- if (y & x)
- for (const N of kut(x)) {
- const j = Mc(Al(
- lh(f),
- tc(N),
- 111551
- /* Value */
- ));
- j ? x & 524288 ? ut(E2(j), (W) => W_(W) > 3) || je(r, p.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, X1, N, 4) : x & 1048576 ? ut(E2(j), (W) => W_(W) > 4) || je(r, p.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, X1, N, 5) : x & 1024 && (ut(E2(j), (W) => W_(W) > 2) || je(r, p.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, X1, N, 3)) : je(r, p.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, X1, N);
- }
- }
- m.requestedExternalEmitHelpers |= a;
- }
- }
- }
- }
- function kut(r) {
- switch (r) {
- case 1:
- return ["__extends"];
- case 2:
- return ["__assign"];
- case 4:
- return ["__rest"];
- case 8:
- return X ? ["__decorate"] : ["__esDecorate", "__runInitializers"];
- case 16:
- return ["__metadata"];
- case 32:
- return ["__param"];
- case 64:
- return ["__awaiter"];
- case 128:
- return ["__generator"];
- case 256:
- return ["__values"];
- case 512:
- return ["__read"];
- case 1024:
- return ["__spreadArray"];
- case 2048:
- return ["__await"];
- case 4096:
- return ["__asyncGenerator"];
- case 8192:
- return ["__asyncDelegator"];
- case 16384:
- return ["__asyncValues"];
- case 32768:
- return ["__exportStar"];
- case 65536:
- return ["__importStar"];
- case 131072:
- return ["__importDefault"];
- case 262144:
- return ["__makeTemplateObject"];
- case 524288:
- return ["__classPrivateFieldGet"];
- case 1048576:
- return ["__classPrivateFieldSet"];
- case 2097152:
- return ["__classPrivateFieldIn"];
- case 4194304:
- return ["__setFunctionName"];
- case 8388608:
- return ["__propKey"];
- case 16777216:
- return ["__addDisposableResource", "__disposeResources"];
- default:
- return E.fail("Unrecognized helper");
- }
- }
- function Cut(r, a) {
- const l = bn(r);
- return l.externalHelpersModule || (l.externalHelpersModule = Sk(v_t(r), X1, p.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, a) || ze), l.externalHelpersModule;
- }
- function vh(r) {
- var a;
- const l = Put(r) || Eut(r);
- if (l !== void 0)
- return l;
- if (Ii(r) && Db(r))
- return Bl(r, p.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters);
- const f = yc(r) ? r.declarationList.flags & 7 : 0;
- let m, y, x, N, j, W = 0, Q = !1, ye = !1;
- for (const de of r.modifiers)
- if (dl(de)) {
- if (Zw(X, r, r.parent, r.parent.parent)) {
- if (X && (r.kind === 177 || r.kind === 178)) {
- const Ze = QM(r);
- if (Ff(Ze.firstAccessor) && r === Ze.secondAccessor)
- return Bl(r, p.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);
- }
- } else return r.kind === 174 && !Mp(r.body) ? Bl(r, p.A_decorator_can_only_decorate_a_method_implementation_not_an_overload) : Bl(r, p.Decorators_are_not_valid_here);
- if (W & -34849)
- return dr(de, p.Decorators_are_not_valid_here);
- if (ye && W & 98303) {
- E.assertIsDefined(j);
- const Ze = Tr(de);
- return F1(Ze) ? !1 : (Rs(
- je(de, p.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
- Kr(j, p.Decorator_used_before_export_here)
- ), !0);
- }
- W |= 32768, W & 98303 ? W & 32 && (Q = !0) : ye = !0, j ?? (j = de);
- } else {
- if (de.kind !== 148) {
- if (r.kind === 171 || r.kind === 173)
- return dr(de, p._0_modifier_cannot_appear_on_a_type_member, qs(de.kind));
- if (r.kind === 181 && (de.kind !== 126 || !Zn(r.parent)))
- return dr(de, p._0_modifier_cannot_appear_on_an_index_signature, qs(de.kind));
- }
- if (de.kind !== 103 && de.kind !== 147 && de.kind !== 87 && r.kind === 168)
- return dr(de, p._0_modifier_cannot_appear_on_a_type_parameter, qs(de.kind));
- switch (de.kind) {
- case 87: {
- if (r.kind !== 266 && r.kind !== 168)
- return dr(r, p.A_class_member_cannot_have_the_0_keyword, qs(
- 87
- /* ConstKeyword */
- ));
- const mt = qp(r.parent) && tv(r.parent) || r.parent;
- if (r.kind === 168 && !(no(mt) || Zn(mt) || lg(mt) || VC(mt) || Dx(mt) || tA(mt) || vm(mt)))
- return dr(de, p._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, qs(de.kind));
- break;
- }
- case 164:
- if (W & 16)
- return dr(de, p._0_modifier_already_seen, "override");
- if (W & 128)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "override", "declare");
- if (W & 8)
- return dr(de, p._0_modifier_must_precede_1_modifier, "override", "readonly");
- if (W & 512)
- return dr(de, p._0_modifier_must_precede_1_modifier, "override", "accessor");
- if (W & 1024)
- return dr(de, p._0_modifier_must_precede_1_modifier, "override", "async");
- W |= 16, N = de;
- break;
- case 125:
- case 124:
- case 123:
- const Ze = SP(cx(de.kind));
- if (W & 7)
- return dr(de, p.Accessibility_modifier_already_seen);
- if (W & 16)
- return dr(de, p._0_modifier_must_precede_1_modifier, Ze, "override");
- if (W & 256)
- return dr(de, p._0_modifier_must_precede_1_modifier, Ze, "static");
- if (W & 512)
- return dr(de, p._0_modifier_must_precede_1_modifier, Ze, "accessor");
- if (W & 8)
- return dr(de, p._0_modifier_must_precede_1_modifier, Ze, "readonly");
- if (W & 1024)
- return dr(de, p._0_modifier_must_precede_1_modifier, Ze, "async");
- if (r.parent.kind === 268 || r.parent.kind === 307)
- return dr(de, p._0_modifier_cannot_appear_on_a_module_or_namespace_element, Ze);
- if (W & 64)
- return de.kind === 123 ? dr(de, p._0_modifier_cannot_be_used_with_1_modifier, Ze, "abstract") : dr(de, p._0_modifier_must_precede_1_modifier, Ze, "abstract");
- if (Ou(r))
- return dr(de, p.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
- W |= cx(de.kind);
- break;
- case 126:
- if (W & 256)
- return dr(de, p._0_modifier_already_seen, "static");
- if (W & 8)
- return dr(de, p._0_modifier_must_precede_1_modifier, "static", "readonly");
- if (W & 1024)
- return dr(de, p._0_modifier_must_precede_1_modifier, "static", "async");
- if (W & 512)
- return dr(de, p._0_modifier_must_precede_1_modifier, "static", "accessor");
- if (r.parent.kind === 268 || r.parent.kind === 307)
- return dr(de, p._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
- if (r.kind === 169)
- return dr(de, p._0_modifier_cannot_appear_on_a_parameter, "static");
- if (W & 64)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
- if (W & 16)
- return dr(de, p._0_modifier_must_precede_1_modifier, "static", "override");
- W |= 256, m = de;
- break;
- case 129:
- if (W & 512)
- return dr(de, p._0_modifier_already_seen, "accessor");
- if (W & 8)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly");
- if (W & 128)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare");
- if (r.kind !== 172)
- return dr(de, p.accessor_modifier_can_only_appear_on_a_property_declaration);
- W |= 512;
- break;
- case 148:
- if (W & 8)
- return dr(de, p._0_modifier_already_seen, "readonly");
- if (r.kind !== 172 && r.kind !== 171 && r.kind !== 181 && r.kind !== 169)
- return dr(de, p.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
- if (W & 512)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor");
- W |= 8;
- break;
- case 95:
- if (O.verbatimModuleSyntax && !(r.flags & 33554432) && r.kind !== 265 && r.kind !== 264 && // ModuleDeclaration needs to be checked that it is uninstantiated later
- r.kind !== 267 && r.parent.kind === 307 && e.getEmitModuleFormatOfFile(Tr(r)) === 1)
- return dr(de, p.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
- if (W & 32)
- return dr(de, p._0_modifier_already_seen, "export");
- if (W & 128)
- return dr(de, p._0_modifier_must_precede_1_modifier, "export", "declare");
- if (W & 64)
- return dr(de, p._0_modifier_must_precede_1_modifier, "export", "abstract");
- if (W & 1024)
- return dr(de, p._0_modifier_must_precede_1_modifier, "export", "async");
- if (Zn(r.parent))
- return dr(de, p._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export");
- if (r.kind === 169)
- return dr(de, p._0_modifier_cannot_appear_on_a_parameter, "export");
- if (f === 4)
- return dr(de, p._0_modifier_cannot_appear_on_a_using_declaration, "export");
- if (f === 6)
- return dr(de, p._0_modifier_cannot_appear_on_an_await_using_declaration, "export");
- W |= 32;
- break;
- case 90:
- const ct = r.parent.kind === 307 ? r.parent : r.parent.parent;
- if (ct.kind === 267 && !Fu(ct))
- return dr(de, p.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
- if (f === 4)
- return dr(de, p._0_modifier_cannot_appear_on_a_using_declaration, "default");
- if (f === 6)
- return dr(de, p._0_modifier_cannot_appear_on_an_await_using_declaration, "default");
- if (W & 32) {
- if (Q)
- return dr(j, p.Decorators_are_not_valid_here);
- } else return dr(de, p._0_modifier_must_precede_1_modifier, "export", "default");
- W |= 2048;
- break;
- case 138:
- if (W & 128)
- return dr(de, p._0_modifier_already_seen, "declare");
- if (W & 1024)
- return dr(de, p._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- if (W & 16)
- return dr(de, p._0_modifier_cannot_be_used_in_an_ambient_context, "override");
- if (Zn(r.parent) && !cs(r))
- return dr(de, p._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare");
- if (r.kind === 169)
- return dr(de, p._0_modifier_cannot_appear_on_a_parameter, "declare");
- if (f === 4)
- return dr(de, p._0_modifier_cannot_appear_on_a_using_declaration, "declare");
- if (f === 6)
- return dr(de, p._0_modifier_cannot_appear_on_an_await_using_declaration, "declare");
- if (r.parent.flags & 33554432 && r.parent.kind === 268)
- return dr(de, p.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
- if (Ou(r))
- return dr(de, p._0_modifier_cannot_be_used_with_a_private_identifier, "declare");
- if (W & 512)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor");
- W |= 128, y = de;
- break;
- case 128:
- if (W & 64)
- return dr(de, p._0_modifier_already_seen, "abstract");
- if (r.kind !== 263 && r.kind !== 185) {
- if (r.kind !== 174 && r.kind !== 172 && r.kind !== 177 && r.kind !== 178)
- return dr(de, p.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
- if (!(r.parent.kind === 263 && Gn(
- r.parent,
- 64
- /* Abstract */
- ))) {
- const mt = r.kind === 172 ? p.Abstract_properties_can_only_appear_within_an_abstract_class : p.Abstract_methods_can_only_appear_within_an_abstract_class;
- return dr(de, mt);
- }
- if (W & 256)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
- if (W & 2)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract");
- if (W & 1024 && x)
- return dr(x, p._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
- if (W & 16)
- return dr(de, p._0_modifier_must_precede_1_modifier, "abstract", "override");
- if (W & 512)
- return dr(de, p._0_modifier_must_precede_1_modifier, "abstract", "accessor");
- }
- if (Vl(r) && r.name.kind === 81)
- return dr(de, p._0_modifier_cannot_be_used_with_a_private_identifier, "abstract");
- W |= 64;
- break;
- case 134:
- if (W & 1024)
- return dr(de, p._0_modifier_already_seen, "async");
- if (W & 128 || r.parent.flags & 33554432)
- return dr(de, p._0_modifier_cannot_be_used_in_an_ambient_context, "async");
- if (r.kind === 169)
- return dr(de, p._0_modifier_cannot_appear_on_a_parameter, "async");
- if (W & 64)
- return dr(de, p._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract");
- W |= 1024, x = de;
- break;
- case 103:
- case 147: {
- const mt = de.kind === 103 ? 8192 : 16384, Gt = de.kind === 103 ? "in" : "out", sr = qp(r.parent) && (tv(r.parent) || On((a = EC(r.parent)) == null ? void 0 : a.tags, SS)) || r.parent;
- if (r.kind !== 168 || sr && !(Xl(sr) || Zn(sr) || Vp(sr) || SS(sr)))
- return dr(de, p._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, Gt);
- if (W & mt)
- return dr(de, p._0_modifier_already_seen, Gt);
- if (mt & 8192 && W & 16384)
- return dr(de, p._0_modifier_must_precede_1_modifier, "in", "out");
- W |= mt;
- break;
- }
- }
- }
- return r.kind === 176 ? W & 256 ? dr(m, p._0_modifier_cannot_appear_on_a_constructor_declaration, "static") : W & 16 ? dr(N, p._0_modifier_cannot_appear_on_a_constructor_declaration, "override") : W & 1024 ? dr(x, p._0_modifier_cannot_appear_on_a_constructor_declaration, "async") : !1 : (r.kind === 272 || r.kind === 271) && W & 128 ? dr(y, p.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare") : r.kind === 169 && W & 31 && As(r.name) ? dr(r, p.A_parameter_property_may_not_be_declared_using_a_binding_pattern) : r.kind === 169 && W & 31 && r.dotDotDotToken ? dr(r, p.A_parameter_property_cannot_be_declared_using_a_rest_parameter) : W & 1024 ? Aut(r, x) : !1;
- }
- function Eut(r) {
- if (!r.modifiers) return !1;
- const a = Dut(r);
- return a && Bl(a, p.Modifiers_cannot_appear_here);
- }
- function nX(r, a) {
- const l = On(r.modifiers, ra);
- return l && l.kind !== a ? l : void 0;
- }
- function Dut(r) {
- switch (r.kind) {
- case 177:
- case 178:
- case 176:
- case 172:
- case 171:
- case 174:
- case 173:
- case 181:
- case 267:
- case 272:
- case 271:
- case 278:
- case 277:
- case 218:
- case 219:
- case 169:
- case 168:
- return;
- case 175:
- case 303:
- case 304:
- case 270:
- case 282:
- return On(r.modifiers, ra);
- default:
- if (r.parent.kind === 268 || r.parent.kind === 307)
- return;
- switch (r.kind) {
- case 262:
- return nX(
- r,
- 134
- /* AsyncKeyword */
- );
- case 263:
- case 185:
- return nX(
- r,
- 128
- /* AbstractKeyword */
- );
- case 231:
- case 264:
- case 265:
- return On(r.modifiers, ra);
- case 243:
- return r.declarationList.flags & 4 ? nX(
- r,
- 135
- /* AwaitKeyword */
- ) : On(r.modifiers, ra);
- case 266:
- return nX(
- r,
- 87
- /* ConstKeyword */
- );
- default:
- E.assertNever(r);
- }
- }
- }
- function Put(r) {
- const a = wut(r);
- return a && Bl(a, p.Decorators_are_not_valid_here);
- }
- function wut(r) {
- return nz(r) ? On(r.modifiers, dl) : void 0;
- }
- function Aut(r, a) {
- switch (r.kind) {
- case 174:
- case 262:
- case 218:
- case 219:
- return !1;
- }
- return dr(a, p._0_modifier_cannot_be_used_here, "async");
- }
- function Xk(r, a = p.Trailing_comma_not_allowed) {
- return r && r.hasTrailingComma ? B2(r[0], r.end - 1, 1, a) : !1;
- }
- function XIe(r, a) {
- if (r && r.length === 0) {
- const l = r.pos - 1, f = aa(a.text, r.end) + 1;
- return B2(a, l, f - l, p.Type_parameter_list_cannot_be_empty);
- }
- return !1;
- }
- function Nut(r) {
- let a = !1;
- const l = r.length;
- for (let f = 0; f < l; f++) {
- const m = r[f];
- if (m.dotDotDotToken) {
- if (f !== l - 1)
- return dr(m.dotDotDotToken, p.A_rest_parameter_must_be_last_in_a_parameter_list);
- if (m.flags & 33554432 || Xk(r, p.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma), m.questionToken)
- return dr(m.questionToken, p.A_rest_parameter_cannot_be_optional);
- if (m.initializer)
- return dr(m.name, p.A_rest_parameter_cannot_have_an_initializer);
- } else if (V_e(m)) {
- if (a = !0, m.questionToken && m.initializer)
- return dr(m.name, p.Parameter_cannot_have_question_mark_and_initializer);
- } else if (a && !m.initializer)
- return dr(m.name, p.A_required_parameter_cannot_follow_an_optional_parameter);
- }
- }
- function Iut(r) {
- return Ln(r, (a) => !!a.initializer || As(a.name) || rg(a));
- }
- function Out(r) {
- if (B >= 3) {
- const a = r.body && Cs(r.body) && KJ(r.body.statements);
- if (a) {
- const l = Iut(r.parameters);
- if (Nr(l)) {
- ir(l, (m) => {
- Rs(
- je(m, p.This_parameter_is_not_allowed_with_use_strict_directive),
- Kr(a, p.use_strict_directive_used_here)
- );
- });
- const f = l.map((m, y) => y === 0 ? Kr(m, p.Non_simple_parameter_declared_here) : Kr(m, p.and_here));
- return Rs(je(a, p.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...f), !0;
- }
- }
- }
- return !1;
- }
- function iX(r) {
- const a = Tr(r);
- return vh(r) || XIe(r.typeParameters, a) || Nut(r.parameters) || Lut(r, a) || no(r) && Out(r);
- }
- function Fut(r) {
- const a = Tr(r);
- return Jut(r) || XIe(r.typeParameters, a);
- }
- function Lut(r, a) {
- if (!Co(r))
- return !1;
- r.typeParameters && !(Nr(r.typeParameters) > 1 || r.typeParameters.hasTrailingComma || r.typeParameters[0].constraint) && a && xc(a.fileName, [
- ".mts",
- ".cts"
- /* Cts */
- ]) && dr(r.typeParameters[0], p.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);
- const { equalsGreaterThanToken: l } = r, f = Qs(a, l.pos).line, m = Qs(a, l.end).line;
- return f !== m && dr(l, p.Line_terminator_not_permitted_before_arrow);
- }
- function Mut(r) {
- const a = r.parameters[0];
- if (r.parameters.length !== 1)
- return dr(a ? a.name : r, p.An_index_signature_must_have_exactly_one_parameter);
- if (Xk(r.parameters, p.An_index_signature_cannot_have_a_trailing_comma), a.dotDotDotToken)
- return dr(a.dotDotDotToken, p.An_index_signature_cannot_have_a_rest_parameter);
- if (NB(a))
- return dr(a.name, p.An_index_signature_parameter_cannot_have_an_accessibility_modifier);
- if (a.questionToken)
- return dr(a.questionToken, p.An_index_signature_parameter_cannot_have_a_question_mark);
- if (a.initializer)
- return dr(a.name, p.An_index_signature_parameter_cannot_have_an_initializer);
- if (!a.type)
- return dr(a.name, p.An_index_signature_parameter_must_have_a_type_annotation);
- const l = Ci(a.type);
- return Pp(l, (f) => !!(f.flags & 8576)) || Lk(l) ? dr(a.name, p.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead) : z_(l, bG) ? r.type ? !1 : dr(r, p.An_index_signature_must_have_a_type_annotation) : dr(a.name, p.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);
- }
- function Rut(r) {
- return vh(r) || Mut(r);
- }
- function jut(r, a) {
- if (a && a.length === 0) {
- const l = Tr(r), f = a.pos - 1, m = aa(l.text, a.end) + 1;
- return B2(l, f, m - f, p.Type_argument_list_cannot_be_empty);
- }
- return !1;
- }
- function YM(r, a) {
- return Xk(a) || jut(r, a);
- }
- function But(r) {
- return r.questionDotToken || r.flags & 64 ? dr(r.template, p.Tagged_template_expressions_are_not_permitted_in_an_optional_chain) : !1;
- }
- function QIe(r) {
- const a = r.types;
- if (Xk(a))
- return !0;
- if (a && a.length === 0) {
- const l = qs(r.token);
- return B2(r, a.pos, 0, p._0_list_cannot_be_empty, l);
- }
- return ut(a, YIe);
- }
- function YIe(r) {
- return Oh(r) && nD(r.expression) && r.typeArguments ? dr(r, p.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments) : YM(r, r.typeArguments);
- }
- function Jut(r) {
- let a = !1, l = !1;
- if (!vh(r) && r.heritageClauses)
- for (const f of r.heritageClauses) {
- if (f.token === 96) {
- if (a)
- return Bl(f, p.extends_clause_already_seen);
- if (l)
- return Bl(f, p.extends_clause_must_precede_implements_clause);
- if (f.types.length > 1)
- return Bl(f.types[1], p.Classes_can_only_extend_a_single_class);
- a = !0;
- } else {
- if (E.assert(
- f.token === 119
- /* ImplementsKeyword */
- ), l)
- return Bl(f, p.implements_clause_already_seen);
- l = !0;
- }
- QIe(f);
- }
- }
- function zut(r) {
- let a = !1;
- if (r.heritageClauses)
- for (const l of r.heritageClauses) {
- if (l.token === 96) {
- if (a)
- return Bl(l, p.extends_clause_already_seen);
- a = !0;
- } else
- return E.assert(
- l.token === 119
- /* ImplementsKeyword */
- ), Bl(l, p.Interface_declaration_cannot_have_implements_clause);
- QIe(l);
- }
- return !1;
- }
- function sX(r) {
- if (r.kind !== 167)
- return !1;
- const a = r;
- return a.expression.kind === 226 && a.expression.operatorToken.kind === 28 ? dr(a.expression, p.A_comma_expression_is_not_allowed_in_a_computed_property_name) : !1;
- }
- function Yde(r) {
- if (r.asteriskToken) {
- if (E.assert(
- r.kind === 262 || r.kind === 218 || r.kind === 174
- /* MethodDeclaration */
- ), r.flags & 33554432)
- return dr(r.asteriskToken, p.Generators_are_not_allowed_in_an_ambient_context);
- if (!r.body)
- return dr(r.asteriskToken, p.An_overload_signature_cannot_be_declared_as_a_generator);
- }
- }
- function Zde(r, a) {
- return !!r && dr(r, a);
- }
- function ZIe(r, a) {
- return !!r && dr(r, a);
- }
- function Wut(r, a) {
- const l = /* @__PURE__ */ new Map();
- for (const f of r.properties) {
- if (f.kind === 305) {
- if (a) {
- const x = Ba(f.expression);
- if ($l(x) || Ks(x))
- return dr(f.expression, p.A_rest_element_cannot_contain_a_binding_pattern);
- }
- continue;
- }
- const m = f.name;
- if (m.kind === 167 && sX(m), f.kind === 304 && !a && f.objectAssignmentInitializer && dr(f.equalsToken, p.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern), m.kind === 81 && dr(m, p.Private_identifiers_are_not_allowed_outside_class_bodies), Hp(f) && f.modifiers)
- for (const x of f.modifiers)
- ra(x) && (x.kind !== 134 || f.kind !== 174) && dr(x, p._0_modifier_cannot_be_used_here, nc(x));
- else if (yte(f) && f.modifiers)
- for (const x of f.modifiers)
- ra(x) && dr(x, p._0_modifier_cannot_be_used_here, nc(x));
- let y;
- switch (f.kind) {
- case 304:
- case 303:
- ZIe(f.exclamationToken, p.A_definite_assignment_assertion_is_not_permitted_in_this_context), Zde(f.questionToken, p.An_object_member_cannot_be_declared_optional), m.kind === 9 && o7e(m), m.kind === 10 && zd(
- /*isError*/
- !0,
- Kr(m, p.A_bigint_literal_cannot_be_used_as_a_property_name)
- ), y = 4;
- break;
- case 174:
- y = 8;
- break;
- case 177:
- y = 1;
- break;
- case 178:
- y = 2;
- break;
- default:
- E.assertNever(f, "Unexpected syntax kind:" + f.kind);
- }
- if (!a) {
- const x = tme(m);
- if (x === void 0)
- continue;
- const N = l.get(x);
- if (!N)
- l.set(x, y);
- else if (y & 8 && N & 8)
- dr(m, p.Duplicate_identifier_0, nc(m));
- else if (y & 4 && N & 4)
- dr(m, p.An_object_literal_cannot_have_multiple_properties_with_the_same_name, nc(m));
- else if (y & 3 && N & 3)
- if (N !== 3 && y !== N)
- l.set(x, y | N);
- else
- return dr(m, p.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
- else
- return dr(m, p.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
- }
- }
- }
- function Uut(r) {
- Vut(r.tagName), YM(r, r.typeArguments);
- const a = /* @__PURE__ */ new Map();
- for (const l of r.attributes.properties) {
- if (l.kind === 293)
- continue;
- const { name: f, initializer: m } = l, y = X4(f);
- if (!a.get(y))
- a.set(y, !0);
- else
- return dr(f, p.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
- if (m && m.kind === 294 && !m.expression)
- return dr(m, p.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
- }
- }
- function Vut(r) {
- if (Cn(r) && Nd(r.expression))
- return dr(r.expression, p.JSX_property_access_expressions_cannot_include_JSX_namespace_names);
- if (Nd(r) && p5(O) && !AC(r.namespace.escapedText))
- return dr(r, p.React_components_cannot_include_JSX_namespace_names);
- }
- function qut(r) {
- if (r.expression && dD(r.expression))
- return dr(r.expression, p.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);
- }
- function KIe(r) {
- if (f0(r))
- return !0;
- if (r.kind === 250 && r.awaitModifier && !(r.flags & 65536)) {
- const a = Tr(r);
- if (S7(r)) {
- if (!F1(a))
- switch ($T(a, O) || Da.add(Kr(r.awaitModifier, p.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)), z) {
- case 100:
- case 199:
- if (a.impliedNodeFormat === 1) {
- Da.add(
- Kr(r.awaitModifier, p.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)
- );
- break;
- }
- case 7:
- case 99:
- case 200:
- case 4:
- if (B >= 4)
- break;
- default:
- Da.add(
- Kr(r.awaitModifier, p.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
- );
- break;
- }
- } else if (!F1(a)) {
- const l = Kr(r.awaitModifier, p.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules), f = yf(r);
- if (f && f.kind !== 176) {
- E.assert((Jc(f) & 2) === 0, "Enclosing function should never be an async function.");
- const m = Kr(f, p.Did_you_mean_to_mark_this_function_as_async);
- Rs(l, m);
- }
- return Da.add(l), !0;
- }
- }
- if (nA(r) && !(r.flags & 65536) && Oe(r.initializer) && r.initializer.escapedText === "async")
- return dr(r.initializer, p.The_left_hand_side_of_a_for_of_statement_may_not_be_async), !1;
- if (r.initializer.kind === 261) {
- const a = r.initializer;
- if (!eme(a)) {
- const l = a.declarations;
- if (!l.length)
- return !1;
- if (l.length > 1) {
- const m = r.kind === 249 ? p.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : p.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;
- return Bl(a.declarations[1], m);
- }
- const f = l[0];
- if (f.initializer) {
- const m = r.kind === 249 ? p.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : p.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;
- return dr(f.name, m);
- }
- if (f.type) {
- const m = r.kind === 249 ? p.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : p.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;
- return dr(f, m);
- }
- }
- }
- return !1;
- }
- function Hut(r) {
- if (!(r.flags & 33554432) && r.parent.kind !== 187 && r.parent.kind !== 264) {
- if (B < 2 && Di(r.name))
- return dr(r.name, p.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
- if (r.body === void 0 && !Gn(
- r,
- 64
- /* Abstract */
- ))
- return B2(r, r.end - 1, 1, p._0_expected, "{");
- }
- if (r.body) {
- if (Gn(
- r,
- 64
- /* Abstract */
- ))
- return dr(r, p.An_abstract_accessor_cannot_have_an_implementation);
- if (r.parent.kind === 187 || r.parent.kind === 264)
- return dr(r.body, p.An_implementation_cannot_be_declared_in_ambient_contexts);
- }
- if (r.typeParameters)
- return dr(r.name, p.An_accessor_cannot_have_type_parameters);
- if (!Gut(r))
- return dr(
- r.name,
- r.kind === 177 ? p.A_get_accessor_cannot_have_parameters : p.A_set_accessor_must_have_exactly_one_parameter
- );
- if (r.kind === 178) {
- if (r.type)
- return dr(r.name, p.A_set_accessor_cannot_have_a_return_type_annotation);
- const a = E.checkDefined(IC(r), "Return value does not match parameter count assertion.");
- if (a.dotDotDotToken)
- return dr(a.dotDotDotToken, p.A_set_accessor_cannot_have_rest_parameter);
- if (a.questionToken)
- return dr(a.questionToken, p.A_set_accessor_cannot_have_an_optional_parameter);
- if (a.initializer)
- return dr(r.name, p.A_set_accessor_parameter_cannot_have_an_initializer);
- }
- return !1;
- }
- function Gut(r) {
- return Kde(r) || r.parameters.length === (r.kind === 177 ? 0 : 1);
- }
- function Kde(r) {
- if (r.parameters.length === (r.kind === 177 ? 1 : 2))
- return Eb(r);
- }
- function $ut(r) {
- if (r.operator === 158) {
- if (r.type.kind !== 155)
- return dr(r.type, p._0_expected, qs(
- 155
- /* SymbolKeyword */
- ));
- let a = m3(r.parent);
- if (cn(a) && pv(a)) {
- const l = xb(a);
- l && (a = rx(l) || l);
- }
- switch (a.kind) {
- case 260:
- const l = a;
- if (l.name.kind !== 80)
- return dr(r, p.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
- if (!p4(l))
- return dr(r, p.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);
- if (!(l.parent.flags & 2))
- return dr(a.name, p.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
- break;
- case 172:
- if (!zs(a) || !P4(a))
- return dr(a.name, p.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);
- break;
- case 171:
- if (!Gn(
- a,
- 8
- /* Readonly */
- ))
- return dr(a.name, p.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);
- break;
- default:
- return dr(r, p.unique_symbol_types_are_not_allowed_here);
- }
- } else if (r.operator === 148 && r.type.kind !== 188 && r.type.kind !== 189)
- return Bl(r, p.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, qs(
- 155
- /* SymbolKeyword */
- ));
- }
- function HP(r, a) {
- if (QZe(r))
- return dr(r, a);
- }
- function e7e(r) {
- if (iX(r))
- return !0;
- if (r.kind === 174) {
- if (r.parent.kind === 210) {
- if (r.modifiers && !(r.modifiers.length === 1 && xa(r.modifiers).kind === 134))
- return Bl(r, p.Modifiers_cannot_appear_here);
- if (Zde(r.questionToken, p.An_object_member_cannot_be_declared_optional))
- return !0;
- if (ZIe(r.exclamationToken, p.A_definite_assignment_assertion_is_not_permitted_in_this_context))
- return !0;
- if (r.body === void 0)
- return B2(r, r.end - 1, 1, p._0_expected, "{");
- }
- if (Yde(r))
- return !0;
- }
- if (Zn(r.parent)) {
- if (B < 2 && Di(r.name))
- return dr(r.name, p.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
- if (r.flags & 33554432)
- return HP(r.name, p.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- if (r.kind === 174 && !r.body)
- return HP(r.name, p.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- } else {
- if (r.parent.kind === 264)
- return HP(r.name, p.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- if (r.parent.kind === 187)
- return HP(r.name, p.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);
- }
- }
- function Xut(r) {
- let a = r;
- for (; a; ) {
- if (lC(a))
- return dr(r, p.Jump_target_cannot_cross_function_boundary);
- switch (a.kind) {
- case 256:
- if (r.label && a.label.escapedText === r.label.escapedText)
- return r.kind === 251 && !Ny(
- a.statement,
- /*lookInLabeledStatements*/
- !0
- ) ? dr(r, p.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement) : !1;
- break;
- case 255:
- if (r.kind === 252 && !r.label)
- return !1;
- break;
- default:
- if (Ny(
- a,
- /*lookInLabeledStatements*/
- !1
- ) && !r.label)
- return !1;
- break;
- }
- a = a.parent;
- }
- if (r.label) {
- const l = r.kind === 252 ? p.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : p.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;
- return dr(r, l);
- } else {
- const l = r.kind === 252 ? p.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : p.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;
- return dr(r, l);
- }
- }
- function Qut(r) {
- if (r.dotDotDotToken) {
- const a = r.parent.elements;
- if (r !== _a(a))
- return dr(r, p.A_rest_element_must_be_last_in_a_destructuring_pattern);
- if (Xk(a, p.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma), r.propertyName)
- return dr(r.name, p.A_rest_element_cannot_have_a_property_name);
- }
- if (r.dotDotDotToken && r.initializer)
- return B2(r, r.initializer.pos - 1, 1, p.A_rest_element_cannot_have_an_initializer);
- }
- function t7e(r) {
- return Of(r) || r.kind === 224 && r.operator === 41 && r.operand.kind === 9;
- }
- function Yut(r) {
- return r.kind === 10 || r.kind === 224 && r.operator === 41 && r.operand.kind === 10;
- }
- function Zut(r) {
- if ((Cn(r) || ko(r) && t7e(r.argumentExpression)) && yo(r.expression))
- return !!(wc(r).flags & 1056);
- }
- function r7e(r) {
- const a = r.initializer;
- if (a) {
- const l = !(t7e(a) || Zut(a) || a.kind === 112 || a.kind === 97 || Yut(a));
- if ((Vw(r) || ii(r) && sI(r)) && !r.type) {
- if (l)
- return dr(a, p.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);
- } else
- return dr(a, p.Initializers_are_not_allowed_in_ambient_contexts);
- }
- }
- function Kut(r) {
- const a = J2(r), l = a & 7;
- if (As(r.name))
- switch (l) {
- case 6:
- return dr(r, p._0_declarations_may_not_have_binding_patterns, "await using");
- case 4:
- return dr(r, p._0_declarations_may_not_have_binding_patterns, "using");
- }
- if (r.parent.parent.kind !== 249 && r.parent.parent.kind !== 250) {
- if (a & 33554432)
- r7e(r);
- else if (!r.initializer) {
- if (As(r.name) && !As(r.parent))
- return dr(r, p.A_destructuring_declaration_must_have_an_initializer);
- switch (l) {
- case 6:
- return dr(r, p._0_declarations_must_be_initialized, "await using");
- case 4:
- return dr(r, p._0_declarations_must_be_initialized, "using");
- case 2:
- return dr(r, p._0_declarations_must_be_initialized, "const");
- }
- }
- }
- if (r.exclamationToken && (r.parent.parent.kind !== 243 || !r.type || r.initializer || a & 33554432)) {
- const f = r.initializer ? p.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : r.type ? p.A_definite_assignment_assertion_is_not_permitted_in_this_context : p.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;
- return dr(r.exclamationToken, f);
- }
- return e.getEmitModuleFormatOfFile(Tr(r)) < 4 && !(r.parent.parent.flags & 33554432) && Gn(
- r.parent.parent,
- 32
- /* Export */
- ) && n7e(r.name), !!l && i7e(r.name);
- }
- function n7e(r) {
- if (r.kind === 80) {
- if (Nn(r) === "__esModule")
- return r_t("noEmit", r, p.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules);
- } else {
- const a = r.elements;
- for (const l of a)
- if (!ml(l))
- return n7e(l.name);
- }
- return !1;
- }
- function i7e(r) {
- if (r.kind === 80) {
- if (r.escapedText === "let")
- return dr(r, p.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
- } else {
- const a = r.elements;
- for (const l of a)
- ml(l) || i7e(l.name);
- }
- return !1;
- }
- function eme(r) {
- const a = r.declarations;
- if (Xk(r.declarations))
- return !0;
- if (!r.declarations.length)
- return B2(r, a.pos, a.end - a.pos, p.Variable_declaration_list_cannot_be_empty);
- const l = r.flags & 7;
- return (l === 4 || l === 6) && Z5(r.parent) ? dr(
- r,
- l === 4 ? p.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : p.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration
- ) : l === 6 ? bNe(r) : !1;
- }
- function s7e(r) {
- switch (r.kind) {
- case 245:
- case 246:
- case 247:
- case 254:
- case 248:
- case 249:
- case 250:
- return !1;
- case 256:
- return s7e(r.parent);
- }
- return !0;
- }
- function e_t(r) {
- if (!s7e(r.parent)) {
- const a = J2(r.declarationList) & 7;
- if (a) {
- const l = a === 1 ? "let" : a === 2 ? "const" : a === 4 ? "using" : a === 6 ? "await using" : E.fail("Unknown BlockScope flag");
- return dr(r, p._0_declarations_can_only_be_declared_inside_a_block, l);
- }
- }
- }
- function t_t(r) {
- const a = r.name.escapedText;
- switch (r.keywordToken) {
- case 105:
- if (a !== "target")
- return dr(r.name, p._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, Ei(r.name.escapedText), qs(r.keywordToken), "target");
- break;
- case 102:
- if (a !== "meta")
- return dr(r.name, p._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, Ei(r.name.escapedText), qs(r.keywordToken), "meta");
- break;
- }
- }
- function F1(r) {
- return r.parseDiagnostics.length > 0;
- }
- function Bl(r, a, ...l) {
- const f = Tr(r);
- if (!F1(f)) {
- const m = cm(f, r.pos);
- return Da.add(fl(f, m.start, m.length, a, ...l)), !0;
- }
- return !1;
- }
- function B2(r, a, l, f, ...m) {
- const y = Tr(r);
- return F1(y) ? !1 : (Da.add(fl(y, a, l, f, ...m)), !0);
- }
- function r_t(r, a, l, ...f) {
- const m = Tr(a);
- return F1(m) ? !1 : (Mv(r, a, l, ...f), !0);
- }
- function dr(r, a, ...l) {
- const f = Tr(r);
- return F1(f) ? !1 : (Da.add(Kr(r, a, ...l)), !0);
- }
- function n_t(r) {
- const a = cn(r) ? G7(r) : void 0, l = r.typeParameters || a && el(a);
- if (l) {
- const f = l.pos === l.end ? l.pos : aa(Tr(r).text, l.pos);
- return B2(r, f, l.end - f, p.Type_parameters_cannot_appear_on_a_constructor_declaration);
- }
- }
- function i_t(r) {
- const a = r.type || Y_(r);
- if (a)
- return dr(a, p.Type_annotation_cannot_appear_on_a_constructor_declaration);
- }
- function s_t(r) {
- if (ma(r.name) && dn(r.name.expression) && r.name.expression.operatorToken.kind === 103)
- return dr(r.parent.members[0], p.A_mapped_type_may_not_declare_properties_or_methods);
- if (Zn(r.parent)) {
- if (oa(r.name) && r.name.text === "constructor")
- return dr(r.name, p.Classes_may_not_have_a_field_named_constructor);
- if (HP(r.name, p.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))
- return !0;
- if (B < 2 && Di(r.name))
- return dr(r.name, p.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
- if (B < 2 && u_(r))
- return dr(r.name, p.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);
- if (u_(r) && Zde(r.questionToken, p.An_accessor_property_cannot_be_declared_optional))
- return !0;
- } else if (r.parent.kind === 264) {
- if (HP(r.name, p.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))
- return !0;
- if (E.assertNode(r, m_), r.initializer)
- return dr(r.initializer, p.An_interface_property_cannot_have_an_initializer);
- } else if (Qu(r.parent)) {
- if (HP(r.name, p.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))
- return !0;
- if (E.assertNode(r, m_), r.initializer)
- return dr(r.initializer, p.A_type_literal_property_cannot_have_an_initializer);
- }
- if (r.flags & 33554432 && r7e(r), cs(r) && r.exclamationToken && (!Zn(r.parent) || !r.type || r.initializer || r.flags & 33554432 || zs(r) || wb(r))) {
- const a = r.initializer ? p.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : r.type ? p.A_definite_assignment_assertion_is_not_permitted_in_this_context : p.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;
- return dr(r.exclamationToken, a);
- }
- }
- function a_t(r) {
- return r.kind === 264 || r.kind === 265 || r.kind === 272 || r.kind === 271 || r.kind === 278 || r.kind === 277 || r.kind === 270 || Gn(
- r,
- 2208
- /* Default */
- ) ? !1 : Bl(r, p.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);
- }
- function o_t(r) {
- for (const a of r.statements)
- if ((ql(a) || a.kind === 243) && a_t(a))
- return !0;
- return !1;
- }
- function a7e(r) {
- return !!(r.flags & 33554432) && o_t(r);
- }
- function f0(r) {
- if (r.flags & 33554432) {
- if (!bn(r).hasReportedStatementInAmbientContext && (ys(r.parent) || Ay(r.parent)))
- return bn(r).hasReportedStatementInAmbientContext = Bl(r, p.An_implementation_cannot_be_declared_in_ambient_contexts);
- if (r.parent.kind === 241 || r.parent.kind === 268 || r.parent.kind === 307) {
- const l = bn(r.parent);
- if (!l.hasReportedStatementInAmbientContext)
- return l.hasReportedStatementInAmbientContext = Bl(r, p.Statements_are_not_allowed_in_ambient_contexts);
- }
- }
- return !1;
- }
- function o7e(r) {
- const a = nc(r).includes("."), l = r.numericLiteralFlags & 16;
- a || l || +r.text <= 2 ** 53 - 1 || zd(
- /*isError*/
- !1,
- Kr(r, p.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers)
- );
- }
- function c_t(r) {
- return !!(!(P0(r.parent) || uv(r.parent) && P0(r.parent.parent)) && B < 7 && dr(r, p.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020));
- }
- function l_t(r, a, ...l) {
- const f = Tr(r);
- if (!F1(f)) {
- const m = cm(f, r.pos);
- return Da.add(fl(
- f,
- ec(m),
- /*length*/
- 0,
- a,
- ...l
- )), !0;
- }
- return !1;
- }
- function u_t() {
- return Lo || (Lo = [], Te.forEach((r, a) => {
- Fre.test(a) && Lo.push(r);
- })), Lo;
- }
- function __t(r) {
- var a;
- return r.isTypeOnly && r.name && r.namedBindings ? dr(r, p.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both) : r.isTypeOnly && ((a = r.namedBindings) == null ? void 0 : a.kind) === 275 ? c7e(r.namedBindings) : !1;
- }
- function c7e(r) {
- return !!ir(r.elements, (a) => {
- if (a.isTypeOnly)
- return Bl(
- a,
- a.kind === 276 ? p.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : p.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement
- );
- });
- }
- function f_t(r) {
- if (O.verbatimModuleSyntax && z === 1)
- return dr(r, p.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
- if (z === 5)
- return dr(r, p.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
- if (r.typeArguments)
- return dr(r, p.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
- const a = r.arguments;
- if (z !== 99 && z !== 199 && z !== 100 && z !== 200 && (Xk(a), a.length > 1)) {
- const f = a[1];
- return dr(f, p.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve);
- }
- if (a.length === 0 || a.length > 2)
- return dr(r, p.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
- const l = On(a, fp);
- return l ? dr(l, p.Argument_of_dynamic_import_cannot_be_spread_element) : !1;
- }
- function p_t(r, a) {
- const l = wn(r);
- if (l & 20 && a.flags & 1048576)
- return On(a.types, (f) => {
- if (f.flags & 524288) {
- const m = l & wn(f);
- if (m & 4)
- return r.target === f.target;
- if (m & 16)
- return !!r.aliasSymbol && r.aliasSymbol === f.aliasSymbol;
- }
- return !1;
- });
- }
- function d_t(r, a) {
- if (wn(r) & 128 && Pp(a, oy))
- return On(a.types, (l) => !oy(l));
- }
- function m_t(r, a) {
- let l = 0;
- if (Ns(r, l).length > 0 || (l = 1, Ns(r, l).length > 0))
- return On(a.types, (m) => Ns(m, l).length > 0);
- }
- function g_t(r, a) {
- let l;
- if (!(r.flags & 406978556)) {
- let f = 0;
- for (const m of a.types)
- if (!(m.flags & 406978556)) {
- const y = ia([Jm(r), Jm(m)]);
- if (y.flags & 4194304)
- return m;
- if (Yd(y) || y.flags & 1048576) {
- const x = y.flags & 1048576 ? py(y.types, Yd) : 1;
- x >= f && (l = m, f = x);
- }
- }
- }
- return l;
- }
- function h_t(r) {
- if (bc(
- r,
- 67108864
- /* NonPrimitive */
- )) {
- const a = Vc(r, (l) => !(l.flags & 402784252));
- if (!(a.flags & 131072))
- return a;
- }
- return r;
- }
- function l7e(r, a, l) {
- if (a.flags & 1048576 && r.flags & 2621440) {
- const f = pAe(a, r);
- if (f)
- return f;
- const m = qa(r);
- if (m) {
- const y = fAe(m, a);
- if (y) {
- const x = Mfe(a, lr(y, (N) => [() => nn(N), N.escapedName]), l);
- if (x !== a)
- return x;
- }
- }
- }
- }
- function tme(r) {
- const a = oS(r);
- return a || (ma(r) ? cpe(tu(r.expression)) : void 0);
- }
- function aX(r) {
- return Ir === r || (Ir = r, jr = U1(r)), jr;
- }
- function J2(r) {
- return Wt === r || (Wt = r, _r = xh(r)), _r;
- }
- function sI(r) {
- const a = J2(r) & 7;
- return a === 2 || a === 4 || a === 6;
- }
- function y_t(r, a) {
- const l = O.importHelpers ? 1 : 0, f = r?.imports[l];
- return f && E.assert(fo(f) && f.text === a, `Expected sourceFile.imports[${l}] to be the synthesized JSX runtime import`), f;
- }
- function v_t(r) {
- E.assert(O.importHelpers, "Expected importHelpers to be enabled");
- const a = r.imports[0];
- return E.assert(a && fo(a) && a.text === "tslib", "Expected sourceFile.imports[0] to be the synthesized tslib import"), a;
- }
- }
- function fMe(e) {
- return !Ay(e);
- }
- function jye(e) {
- return e.kind !== 262 && e.kind !== 174 || !!e.body;
- }
- function Bye(e) {
- switch (e.parent.kind) {
- case 276:
- case 281:
- return Oe(e) || e.kind === 11;
- default:
- return og(e);
- }
- }
- var jf;
- ((e) => {
- e.JSX = "JSX", e.IntrinsicElements = "IntrinsicElements", e.ElementClass = "ElementClass", e.ElementAttributesPropertyNameContainer = "ElementAttributesProperty", e.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute", e.Element = "Element", e.ElementType = "ElementType", e.IntrinsicAttributes = "IntrinsicAttributes", e.IntrinsicClassAttributes = "IntrinsicClassAttributes", e.LibraryManagedAttributes = "LibraryManagedAttributes";
- })(jf || (jf = {}));
- function Jye(e) {
- switch (e) {
- case 0:
- return "yieldType";
- case 1:
- return "returnType";
- case 2:
- return "nextType";
- }
- }
- function Su(e) {
- return !!(e.flags & 1);
- }
- function zye(e) {
- return !!(e.flags & 2);
- }
- function pMe(e) {
- return {
- getCommonSourceDirectory: e.getCommonSourceDirectory ? () => e.getCommonSourceDirectory() : () => "",
- getCurrentDirectory: () => e.getCurrentDirectory(),
- getSymlinkCache: Ms(e, e.getSymlinkCache),
- getPackageJsonInfoCache: () => {
- var t;
- return (t = e.getPackageJsonInfoCache) == null ? void 0 : t.call(e);
- },
- useCaseSensitiveFileNames: Ms(e, e.useCaseSensitiveFileNames),
- redirectTargetsMap: e.redirectTargetsMap,
- getProjectReferenceRedirect: (t) => e.getProjectReferenceRedirect(t),
- isSourceOfProjectReferenceRedirect: (t) => e.isSourceOfProjectReferenceRedirect(t),
- fileExists: (t) => e.fileExists(t),
- getFileIncludeReasons: () => e.getFileIncludeReasons(),
- readFile: e.readFile ? (t) => e.readFile(t) : void 0,
- getDefaultResolutionModeForFile: (t) => e.getDefaultResolutionModeForFile(t),
- getModeForResolutionAtIndex: (t, n) => e.getModeForResolutionAtIndex(t, n)
- };
- }
- var Rre = class E7e {
- constructor(t, n, i) {
- this.moduleResolverHost = void 0, this.inner = void 0, this.disableTrackSymbol = !1;
- for (var s; n instanceof E7e; )
- n = n.inner;
- this.inner = n, this.moduleResolverHost = i, this.context = t, this.canTrackSymbol = !!((s = this.inner) != null && s.trackSymbol);
- }
- trackSymbol(t, n, i) {
- var s, o;
- if ((s = this.inner) != null && s.trackSymbol && !this.disableTrackSymbol) {
- if (this.inner.trackSymbol(t, n, i))
- return this.onDiagnosticReported(), !0;
- t.flags & 262144 || ((o = this.context).trackedSymbols ?? (o.trackedSymbols = [])).push([t, n, i]);
- }
- return !1;
- }
- reportInaccessibleThisError() {
- var t;
- (t = this.inner) != null && t.reportInaccessibleThisError && (this.onDiagnosticReported(), this.inner.reportInaccessibleThisError());
- }
- reportPrivateInBaseOfClassExpression(t) {
- var n;
- (n = this.inner) != null && n.reportPrivateInBaseOfClassExpression && (this.onDiagnosticReported(), this.inner.reportPrivateInBaseOfClassExpression(t));
- }
- reportInaccessibleUniqueSymbolError() {
- var t;
- (t = this.inner) != null && t.reportInaccessibleUniqueSymbolError && (this.onDiagnosticReported(), this.inner.reportInaccessibleUniqueSymbolError());
- }
- reportCyclicStructureError() {
- var t;
- (t = this.inner) != null && t.reportCyclicStructureError && (this.onDiagnosticReported(), this.inner.reportCyclicStructureError());
- }
- reportLikelyUnsafeImportRequiredError(t) {
- var n;
- (n = this.inner) != null && n.reportLikelyUnsafeImportRequiredError && (this.onDiagnosticReported(), this.inner.reportLikelyUnsafeImportRequiredError(t));
- }
- reportTruncationError() {
- var t;
- (t = this.inner) != null && t.reportTruncationError && (this.onDiagnosticReported(), this.inner.reportTruncationError());
- }
- reportNonlocalAugmentation(t, n, i) {
- var s;
- (s = this.inner) != null && s.reportNonlocalAugmentation && (this.onDiagnosticReported(), this.inner.reportNonlocalAugmentation(t, n, i));
- }
- reportNonSerializableProperty(t) {
- var n;
- (n = this.inner) != null && n.reportNonSerializableProperty && (this.onDiagnosticReported(), this.inner.reportNonSerializableProperty(t));
- }
- onDiagnosticReported() {
- this.context.reportedDiagnostic = !0;
- }
- reportInferenceFallback(t) {
- var n;
- (n = this.inner) != null && n.reportInferenceFallback && this.inner.reportInferenceFallback(t);
- }
- };
- function Ge(e, t, n, i) {
- if (e === void 0)
- return e;
- const s = t(e);
- let o;
- if (s !== void 0)
- return us(s) ? o = (i || vMe)(s) : o = s, E.assertNode(o, n), o;
- }
- function Fr(e, t, n, i, s) {
- if (e === void 0)
- return e;
- const o = e.length;
- (i === void 0 || i < 0) && (i = 0), (s === void 0 || s > o - i) && (s = o - i);
- let c, _ = -1, u = -1;
- i > 0 || s < o ? c = e.hasTrailingComma && i + s === o : (_ = e.pos, u = e.end, c = e.hasTrailingComma);
- const d = Wye(e, t, n, i, s);
- if (d !== e) {
- const g = A.createNodeArray(d, c);
- return wd(g, _, u), g;
- }
- return e;
- }
- function wA(e, t, n, i, s) {
- if (e === void 0)
- return e;
- const o = e.length;
- return (i === void 0 || i < 0) && (i = 0), (s === void 0 || s > o - i) && (s = o - i), Wye(e, t, n, i, s);
- }
- function Wye(e, t, n, i, s) {
- let o;
- const c = e.length;
- (i > 0 || s < c) && (o = []);
- for (let _ = 0; _ < s; _++) {
- const u = e[_ + i], d = u !== void 0 ? t ? t(u) : u : void 0;
- if ((o !== void 0 || d === void 0 || d !== u) && (o === void 0 && (o = e.slice(0, _), E.assertEachNode(o, n)), d))
- if (us(d))
- for (const g of d)
- E.assertNode(g, n), o.push(g);
- else
- E.assertNode(d, n), o.push(d);
- }
- return o || (E.assertEachNode(e, n), e);
- }
- function Kz(e, t, n, i, s, o = Fr) {
- return n.startLexicalEnvironment(), e = o(e, t, bi, i), s && (e = n.factory.ensureUseStrict(e)), A.mergeLexicalEnvironment(e, n.endLexicalEnvironment());
- }
- function cc(e, t, n, i = Fr) {
- let s;
- return n.startLexicalEnvironment(), e && (n.setLexicalEnvironmentFlags(1, !0), s = i(e, t, Ii), n.getLexicalEnvironmentFlags() & 2 && pa(n.getCompilerOptions()) >= 2 && (s = dMe(s, n)), n.setLexicalEnvironmentFlags(1, !1)), n.suspendLexicalEnvironment(), s;
- }
- function dMe(e, t) {
- let n;
- for (let i = 0; i < e.length; i++) {
- const s = e[i], o = mMe(s, t);
- (n || o !== s) && (n || (n = e.slice(0, i)), n[i] = o);
- }
- return n ? lt(t.factory.createNodeArray(n, e.hasTrailingComma), e) : e;
- }
- function mMe(e, t) {
- return e.dotDotDotToken ? e : As(e.name) ? gMe(e, t) : e.initializer ? hMe(e, e.name, e.initializer, t) : e;
- }
- function gMe(e, t) {
- const { factory: n } = t;
- return t.addInitializationStatement(
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList([
- n.createVariableDeclaration(
- e.name,
- /*exclamationToken*/
- void 0,
- e.type,
- e.initializer ? n.createConditionalExpression(
- n.createStrictEquality(
- n.getGeneratedNameForNode(e),
- n.createVoidZero()
- ),
- /*questionToken*/
- void 0,
- e.initializer,
- /*colonToken*/
- void 0,
- n.getGeneratedNameForNode(e)
- ) : n.getGeneratedNameForNode(e)
- )
- ])
- )
- ), n.updateParameterDeclaration(
- e,
- e.modifiers,
- e.dotDotDotToken,
- n.getGeneratedNameForNode(e),
- e.questionToken,
- e.type,
- /*initializer*/
- void 0
- );
- }
- function hMe(e, t, n, i) {
- const s = i.factory;
- return i.addInitializationStatement(
- s.createIfStatement(
- s.createTypeCheck(s.cloneNode(t), "undefined"),
- an(
- lt(
- s.createBlock([
- s.createExpressionStatement(
- an(
- lt(
- s.createAssignment(
- an(
- s.cloneNode(t),
- 96
- /* NoSourceMap */
- ),
- an(
- n,
- 96 | ya(n) | 3072
- /* NoComments */
- )
- ),
- e
- ),
- 3072
- /* NoComments */
- )
- )
- ]),
- e
- ),
- 3905
- /* NoComments */
- )
- )
- ), s.updateParameterDeclaration(
- e,
- e.modifiers,
- e.dotDotDotToken,
- e.name,
- e.questionToken,
- e.type,
- /*initializer*/
- void 0
- );
- }
- function Bf(e, t, n, i = Ge) {
- n.resumeLexicalEnvironment();
- const s = i(e, t, GI), o = n.endLexicalEnvironment();
- if (ut(o)) {
- if (!s)
- return n.factory.createBlock(o);
- const c = n.factory.converters.convertToFunctionBlock(s), _ = A.mergeLexicalEnvironment(c.statements, o);
- return n.factory.updateBlock(c, _);
- }
- return s;
- }
- function Ku(e, t, n, i = Ge) {
- n.startBlockScope();
- const s = i(e, t, bi, n.factory.liftToBlock);
- E.assert(s);
- const o = n.endBlockScope();
- return ut(o) ? Cs(s) ? (o.push(...s.statements), n.factory.updateBlock(s, o)) : (o.push(s), n.factory.createBlock(o)) : s;
- }
- function VO(e, t, n = t) {
- if (n === t || e.length <= 1)
- return Fr(e, t, _t);
- let i = 0;
- const s = e.length;
- return Fr(e, (o) => {
- const c = i < s - 1;
- return i++, c ? n(o) : t(o);
- }, _t);
- }
- function br(e, t, n = MA, i = Fr, s, o = Ge) {
- if (e === void 0)
- return;
- const c = yMe[e.kind];
- return c === void 0 ? e : c(e, t, n, i, o, s);
- }
- var yMe = {
- 166: function(t, n, i, s, o, c) {
- return i.factory.updateQualifiedName(
- t,
- E.checkDefined(o(t.left, n, l_)),
- E.checkDefined(o(t.right, n, Oe))
- );
- },
- 167: function(t, n, i, s, o, c) {
- return i.factory.updateComputedPropertyName(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- // Signature elements
- 168: function(t, n, i, s, o, c) {
- return i.factory.updateTypeParameterDeclaration(
- t,
- s(t.modifiers, n, ra),
- E.checkDefined(o(t.name, n, Oe)),
- o(t.constraint, n, fi),
- o(t.default, n, fi)
- );
- },
- 169: function(t, n, i, s, o, c) {
- return i.factory.updateParameterDeclaration(
- t,
- s(t.modifiers, n, Bo),
- c ? o(t.dotDotDotToken, c, V5) : t.dotDotDotToken,
- E.checkDefined(o(t.name, n, Y2)),
- c ? o(t.questionToken, c, Vy) : t.questionToken,
- o(t.type, n, fi),
- o(t.initializer, n, _t)
- );
- },
- 170: function(t, n, i, s, o, c) {
- return i.factory.updateDecorator(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- // Type elements
- 171: function(t, n, i, s, o, c) {
- return i.factory.updatePropertySignature(
- t,
- s(t.modifiers, n, ra),
- E.checkDefined(o(t.name, n, Bc)),
- c ? o(t.questionToken, c, Vy) : t.questionToken,
- o(t.type, n, fi)
- );
- },
- 172: function(t, n, i, s, o, c) {
- return i.factory.updatePropertyDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Bc)),
- // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration
- c ? o(t.questionToken ?? t.exclamationToken, c, vte) : t.questionToken ?? t.exclamationToken,
- o(t.type, n, fi),
- o(t.initializer, n, _t)
- );
- },
- 173: function(t, n, i, s, o, c) {
- return i.factory.updateMethodSignature(
- t,
- s(t.modifiers, n, ra),
- E.checkDefined(o(t.name, n, Bc)),
- c ? o(t.questionToken, c, Vy) : t.questionToken,
- s(t.typeParameters, n, zo),
- s(t.parameters, n, Ii),
- o(t.type, n, fi)
- );
- },
- 174: function(t, n, i, s, o, c) {
- return i.factory.updateMethodDeclaration(
- t,
- s(t.modifiers, n, Bo),
- c ? o(t.asteriskToken, c, K3) : t.asteriskToken,
- E.checkDefined(o(t.name, n, Bc)),
- c ? o(t.questionToken, c, Vy) : t.questionToken,
- s(t.typeParameters, n, zo),
- cc(t.parameters, n, i, s),
- o(t.type, n, fi),
- Bf(t.body, n, i, o)
- );
- },
- 176: function(t, n, i, s, o, c) {
- return i.factory.updateConstructorDeclaration(
- t,
- s(t.modifiers, n, Bo),
- cc(t.parameters, n, i, s),
- Bf(t.body, n, i, o)
- );
- },
- 177: function(t, n, i, s, o, c) {
- return i.factory.updateGetAccessorDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Bc)),
- cc(t.parameters, n, i, s),
- o(t.type, n, fi),
- Bf(t.body, n, i, o)
- );
- },
- 178: function(t, n, i, s, o, c) {
- return i.factory.updateSetAccessorDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Bc)),
- cc(t.parameters, n, i, s),
- Bf(t.body, n, i, o)
- );
- },
- 175: function(t, n, i, s, o, c) {
- return i.startLexicalEnvironment(), i.suspendLexicalEnvironment(), i.factory.updateClassStaticBlockDeclaration(
- t,
- Bf(t.body, n, i, o)
- );
- },
- 179: function(t, n, i, s, o, c) {
- return i.factory.updateCallSignature(
- t,
- s(t.typeParameters, n, zo),
- s(t.parameters, n, Ii),
- o(t.type, n, fi)
- );
- },
- 180: function(t, n, i, s, o, c) {
- return i.factory.updateConstructSignature(
- t,
- s(t.typeParameters, n, zo),
- s(t.parameters, n, Ii),
- o(t.type, n, fi)
- );
- },
- 181: function(t, n, i, s, o, c) {
- return i.factory.updateIndexSignature(
- t,
- s(t.modifiers, n, Bo),
- s(t.parameters, n, Ii),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- // Types
- 182: function(t, n, i, s, o, c) {
- return i.factory.updateTypePredicateNode(
- t,
- o(t.assertsModifier, n, Jee),
- E.checkDefined(o(t.parameterName, n, bte)),
- o(t.type, n, fi)
- );
- },
- 183: function(t, n, i, s, o, c) {
- return i.factory.updateTypeReferenceNode(
- t,
- E.checkDefined(o(t.typeName, n, l_)),
- s(t.typeArguments, n, fi)
- );
- },
- 184: function(t, n, i, s, o, c) {
- return i.factory.updateFunctionTypeNode(
- t,
- s(t.typeParameters, n, zo),
- s(t.parameters, n, Ii),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 185: function(t, n, i, s, o, c) {
- return i.factory.updateConstructorTypeNode(
- t,
- s(t.modifiers, n, ra),
- s(t.typeParameters, n, zo),
- s(t.parameters, n, Ii),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 186: function(t, n, i, s, o, c) {
- return i.factory.updateTypeQueryNode(
- t,
- E.checkDefined(o(t.exprName, n, l_)),
- s(t.typeArguments, n, fi)
- );
- },
- 187: function(t, n, i, s, o, c) {
- return i.factory.updateTypeLiteralNode(
- t,
- s(t.members, n, db)
- );
- },
- 188: function(t, n, i, s, o, c) {
- return i.factory.updateArrayTypeNode(
- t,
- E.checkDefined(o(t.elementType, n, fi))
- );
- },
- 189: function(t, n, i, s, o, c) {
- return i.factory.updateTupleTypeNode(
- t,
- s(t.elements, n, fi)
- );
- },
- 190: function(t, n, i, s, o, c) {
- return i.factory.updateOptionalTypeNode(
- t,
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 191: function(t, n, i, s, o, c) {
- return i.factory.updateRestTypeNode(
- t,
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 192: function(t, n, i, s, o, c) {
- return i.factory.updateUnionTypeNode(
- t,
- s(t.types, n, fi)
- );
- },
- 193: function(t, n, i, s, o, c) {
- return i.factory.updateIntersectionTypeNode(
- t,
- s(t.types, n, fi)
- );
- },
- 194: function(t, n, i, s, o, c) {
- return i.factory.updateConditionalTypeNode(
- t,
- E.checkDefined(o(t.checkType, n, fi)),
- E.checkDefined(o(t.extendsType, n, fi)),
- E.checkDefined(o(t.trueType, n, fi)),
- E.checkDefined(o(t.falseType, n, fi))
- );
- },
- 195: function(t, n, i, s, o, c) {
- return i.factory.updateInferTypeNode(
- t,
- E.checkDefined(o(t.typeParameter, n, zo))
- );
- },
- 205: function(t, n, i, s, o, c) {
- return i.factory.updateImportTypeNode(
- t,
- E.checkDefined(o(t.argument, n, fi)),
- o(t.attributes, n, hS),
- o(t.qualifier, n, l_),
- s(t.typeArguments, n, fi),
- t.isTypeOf
- );
- },
- 302: function(t, n, i, s, o, c) {
- return i.factory.updateImportTypeAssertionContainer(
- t,
- E.checkDefined(o(t.assertClause, n, Qee)),
- t.multiLine
- );
- },
- 202: function(t, n, i, s, o, c) {
- return i.factory.updateNamedTupleMember(
- t,
- c ? o(t.dotDotDotToken, c, V5) : t.dotDotDotToken,
- E.checkDefined(o(t.name, n, Oe)),
- c ? o(t.questionToken, c, Vy) : t.questionToken,
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 196: function(t, n, i, s, o, c) {
- return i.factory.updateParenthesizedType(
- t,
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 198: function(t, n, i, s, o, c) {
- return i.factory.updateTypeOperatorNode(
- t,
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 199: function(t, n, i, s, o, c) {
- return i.factory.updateIndexedAccessTypeNode(
- t,
- E.checkDefined(o(t.objectType, n, fi)),
- E.checkDefined(o(t.indexType, n, fi))
- );
- },
- 200: function(t, n, i, s, o, c) {
- return i.factory.updateMappedTypeNode(
- t,
- c ? o(t.readonlyToken, c, Ste) : t.readonlyToken,
- E.checkDefined(o(t.typeParameter, n, zo)),
- o(t.nameType, n, fi),
- c ? o(t.questionToken, c, Tte) : t.questionToken,
- o(t.type, n, fi),
- s(t.members, n, db)
- );
- },
- 201: function(t, n, i, s, o, c) {
- return i.factory.updateLiteralTypeNode(
- t,
- E.checkDefined(o(t.literal, n, JY))
- );
- },
- 203: function(t, n, i, s, o, c) {
- return i.factory.updateTemplateLiteralType(
- t,
- E.checkDefined(o(t.head, n, kx)),
- s(t.templateSpans, n, IJ)
- );
- },
- 204: function(t, n, i, s, o, c) {
- return i.factory.updateTemplateLiteralTypeSpan(
- t,
- E.checkDefined(o(t.type, n, fi)),
- E.checkDefined(o(t.literal, n, UI))
- );
- },
- // Binding patterns
- 206: function(t, n, i, s, o, c) {
- return i.factory.updateObjectBindingPattern(
- t,
- s(t.elements, n, va)
- );
- },
- 207: function(t, n, i, s, o, c) {
- return i.factory.updateArrayBindingPattern(
- t,
- s(t.elements, n, qI)
- );
- },
- 208: function(t, n, i, s, o, c) {
- return i.factory.updateBindingElement(
- t,
- c ? o(t.dotDotDotToken, c, V5) : t.dotDotDotToken,
- o(t.propertyName, n, Bc),
- E.checkDefined(o(t.name, n, Y2)),
- o(t.initializer, n, _t)
- );
- },
- // Expression
- 209: function(t, n, i, s, o, c) {
- return i.factory.updateArrayLiteralExpression(
- t,
- s(t.elements, n, _t)
- );
- },
- 210: function(t, n, i, s, o, c) {
- return i.factory.updateObjectLiteralExpression(
- t,
- s(t.properties, n, kh)
- );
- },
- 211: function(t, n, i, s, o, c) {
- return BI(t) ? i.factory.updatePropertyAccessChain(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- c ? o(t.questionDotToken, c, q5) : t.questionDotToken,
- E.checkDefined(o(t.name, n, Fg))
- ) : i.factory.updatePropertyAccessExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.name, n, Fg))
- );
- },
- 212: function(t, n, i, s, o, c) {
- return mj(t) ? i.factory.updateElementAccessChain(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- c ? o(t.questionDotToken, c, q5) : t.questionDotToken,
- E.checkDefined(o(t.argumentExpression, n, _t))
- ) : i.factory.updateElementAccessExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.argumentExpression, n, _t))
- );
- },
- 213: function(t, n, i, s, o, c) {
- return $2(t) ? i.factory.updateCallChain(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- c ? o(t.questionDotToken, c, q5) : t.questionDotToken,
- s(t.typeArguments, n, fi),
- s(t.arguments, n, _t)
- ) : i.factory.updateCallExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- s(t.typeArguments, n, fi),
- s(t.arguments, n, _t)
- );
- },
- 214: function(t, n, i, s, o, c) {
- return i.factory.updateNewExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- s(t.typeArguments, n, fi),
- s(t.arguments, n, _t)
- );
- },
- 215: function(t, n, i, s, o, c) {
- return i.factory.updateTaggedTemplateExpression(
- t,
- E.checkDefined(o(t.tag, n, _t)),
- s(t.typeArguments, n, fi),
- E.checkDefined(o(t.template, n, VT))
- );
- },
- 216: function(t, n, i, s, o, c) {
- return i.factory.updateTypeAssertion(
- t,
- E.checkDefined(o(t.type, n, fi)),
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 217: function(t, n, i, s, o, c) {
- return i.factory.updateParenthesizedExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 218: function(t, n, i, s, o, c) {
- return i.factory.updateFunctionExpression(
- t,
- s(t.modifiers, n, ra),
- c ? o(t.asteriskToken, c, K3) : t.asteriskToken,
- o(t.name, n, Oe),
- s(t.typeParameters, n, zo),
- cc(t.parameters, n, i, s),
- o(t.type, n, fi),
- Bf(t.body, n, i, o)
- );
- },
- 219: function(t, n, i, s, o, c) {
- return i.factory.updateArrowFunction(
- t,
- s(t.modifiers, n, ra),
- s(t.typeParameters, n, zo),
- cc(t.parameters, n, i, s),
- o(t.type, n, fi),
- c ? E.checkDefined(o(t.equalsGreaterThanToken, c, Bee)) : t.equalsGreaterThanToken,
- Bf(t.body, n, i, o)
- );
- },
- 220: function(t, n, i, s, o, c) {
- return i.factory.updateDeleteExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 221: function(t, n, i, s, o, c) {
- return i.factory.updateTypeOfExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 222: function(t, n, i, s, o, c) {
- return i.factory.updateVoidExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 223: function(t, n, i, s, o, c) {
- return i.factory.updateAwaitExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 224: function(t, n, i, s, o, c) {
- return i.factory.updatePrefixUnaryExpression(
- t,
- E.checkDefined(o(t.operand, n, _t))
- );
- },
- 225: function(t, n, i, s, o, c) {
- return i.factory.updatePostfixUnaryExpression(
- t,
- E.checkDefined(o(t.operand, n, _t))
- );
- },
- 226: function(t, n, i, s, o, c) {
- return i.factory.updateBinaryExpression(
- t,
- E.checkDefined(o(t.left, n, _t)),
- c ? E.checkDefined(o(t.operatorToken, c, kte)) : t.operatorToken,
- E.checkDefined(o(t.right, n, _t))
- );
- },
- 227: function(t, n, i, s, o, c) {
- return i.factory.updateConditionalExpression(
- t,
- E.checkDefined(o(t.condition, n, _t)),
- c ? E.checkDefined(o(t.questionToken, c, Vy)) : t.questionToken,
- E.checkDefined(o(t.whenTrue, n, _t)),
- c ? E.checkDefined(o(t.colonToken, c, jee)) : t.colonToken,
- E.checkDefined(o(t.whenFalse, n, _t))
- );
- },
- 228: function(t, n, i, s, o, c) {
- return i.factory.updateTemplateExpression(
- t,
- E.checkDefined(o(t.head, n, kx)),
- s(t.templateSpans, n, $C)
- );
- },
- 229: function(t, n, i, s, o, c) {
- return i.factory.updateYieldExpression(
- t,
- c ? o(t.asteriskToken, c, K3) : t.asteriskToken,
- o(t.expression, n, _t)
- );
- },
- 230: function(t, n, i, s, o, c) {
- return i.factory.updateSpreadElement(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 231: function(t, n, i, s, o, c) {
- return i.factory.updateClassExpression(
- t,
- s(t.modifiers, n, Bo),
- o(t.name, n, Oe),
- s(t.typeParameters, n, zo),
- s(t.heritageClauses, n, ef),
- s(t.members, n, _l)
- );
- },
- 233: function(t, n, i, s, o, c) {
- return i.factory.updateExpressionWithTypeArguments(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- s(t.typeArguments, n, fi)
- );
- },
- 234: function(t, n, i, s, o, c) {
- return i.factory.updateAsExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 238: function(t, n, i, s, o, c) {
- return i.factory.updateSatisfiesExpression(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 235: function(t, n, i, s, o, c) {
- return hu(t) ? i.factory.updateNonNullChain(
- t,
- E.checkDefined(o(t.expression, n, _t))
- ) : i.factory.updateNonNullExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 236: function(t, n, i, s, o, c) {
- return i.factory.updateMetaProperty(
- t,
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- // Misc
- 239: function(t, n, i, s, o, c) {
- return i.factory.updateTemplateSpan(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.literal, n, UI))
- );
- },
- // Element
- 241: function(t, n, i, s, o, c) {
- return i.factory.updateBlock(
- t,
- s(t.statements, n, bi)
- );
- },
- 243: function(t, n, i, s, o, c) {
- return i.factory.updateVariableStatement(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.declarationList, n, Fl))
- );
- },
- 244: function(t, n, i, s, o, c) {
- return i.factory.updateExpressionStatement(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 245: function(t, n, i, s, o, c) {
- return i.factory.updateIfStatement(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.thenStatement, n, bi, i.factory.liftToBlock)),
- o(t.elseStatement, n, bi, i.factory.liftToBlock)
- );
- },
- 246: function(t, n, i, s, o, c) {
- return i.factory.updateDoStatement(
- t,
- Ku(t.statement, n, i, o),
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 247: function(t, n, i, s, o, c) {
- return i.factory.updateWhileStatement(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- Ku(t.statement, n, i, o)
- );
- },
- 248: function(t, n, i, s, o, c) {
- return i.factory.updateForStatement(
- t,
- o(t.initializer, n, ip),
- o(t.condition, n, _t),
- o(t.incrementor, n, _t),
- Ku(t.statement, n, i, o)
- );
- },
- 249: function(t, n, i, s, o, c) {
- return i.factory.updateForInStatement(
- t,
- E.checkDefined(o(t.initializer, n, ip)),
- E.checkDefined(o(t.expression, n, _t)),
- Ku(t.statement, n, i, o)
- );
- },
- 250: function(t, n, i, s, o, c) {
- return i.factory.updateForOfStatement(
- t,
- c ? o(t.awaitModifier, c, NJ) : t.awaitModifier,
- E.checkDefined(o(t.initializer, n, ip)),
- E.checkDefined(o(t.expression, n, _t)),
- Ku(t.statement, n, i, o)
- );
- },
- 251: function(t, n, i, s, o, c) {
- return i.factory.updateContinueStatement(
- t,
- o(t.label, n, Oe)
- );
- },
- 252: function(t, n, i, s, o, c) {
- return i.factory.updateBreakStatement(
- t,
- o(t.label, n, Oe)
- );
- },
- 253: function(t, n, i, s, o, c) {
- return i.factory.updateReturnStatement(
- t,
- o(t.expression, n, _t)
- );
- },
- 254: function(t, n, i, s, o, c) {
- return i.factory.updateWithStatement(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.statement, n, bi, i.factory.liftToBlock))
- );
- },
- 255: function(t, n, i, s, o, c) {
- return i.factory.updateSwitchStatement(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- E.checkDefined(o(t.caseBlock, n, cD))
- );
- },
- 256: function(t, n, i, s, o, c) {
- return i.factory.updateLabeledStatement(
- t,
- E.checkDefined(o(t.label, n, Oe)),
- E.checkDefined(o(t.statement, n, bi, i.factory.liftToBlock))
- );
- },
- 257: function(t, n, i, s, o, c) {
- return i.factory.updateThrowStatement(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 258: function(t, n, i, s, o, c) {
- return i.factory.updateTryStatement(
- t,
- E.checkDefined(o(t.tryBlock, n, Cs)),
- o(t.catchClause, n, Ub),
- o(t.finallyBlock, n, Cs)
- );
- },
- 260: function(t, n, i, s, o, c) {
- return i.factory.updateVariableDeclaration(
- t,
- E.checkDefined(o(t.name, n, Y2)),
- c ? o(t.exclamationToken, c, eA) : t.exclamationToken,
- o(t.type, n, fi),
- o(t.initializer, n, _t)
- );
- },
- 261: function(t, n, i, s, o, c) {
- return i.factory.updateVariableDeclarationList(
- t,
- s(t.declarations, n, ii)
- );
- },
- 262: function(t, n, i, s, o, c) {
- return i.factory.updateFunctionDeclaration(
- t,
- s(t.modifiers, n, ra),
- c ? o(t.asteriskToken, c, K3) : t.asteriskToken,
- o(t.name, n, Oe),
- s(t.typeParameters, n, zo),
- cc(t.parameters, n, i, s),
- o(t.type, n, fi),
- Bf(t.body, n, i, o)
- );
- },
- 263: function(t, n, i, s, o, c) {
- return i.factory.updateClassDeclaration(
- t,
- s(t.modifiers, n, Bo),
- o(t.name, n, Oe),
- s(t.typeParameters, n, zo),
- s(t.heritageClauses, n, ef),
- s(t.members, n, _l)
- );
- },
- 264: function(t, n, i, s, o, c) {
- return i.factory.updateInterfaceDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Oe)),
- s(t.typeParameters, n, zo),
- s(t.heritageClauses, n, ef),
- s(t.members, n, db)
- );
- },
- 265: function(t, n, i, s, o, c) {
- return i.factory.updateTypeAliasDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Oe)),
- s(t.typeParameters, n, zo),
- E.checkDefined(o(t.type, n, fi))
- );
- },
- 266: function(t, n, i, s, o, c) {
- return i.factory.updateEnumDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, Oe)),
- s(t.members, n, A0)
- );
- },
- 267: function(t, n, i, s, o, c) {
- return i.factory.updateModuleDeclaration(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.name, n, xte)),
- o(t.body, n, WY)
- );
- },
- 268: function(t, n, i, s, o, c) {
- return i.factory.updateModuleBlock(
- t,
- s(t.statements, n, bi)
- );
- },
- 269: function(t, n, i, s, o, c) {
- return i.factory.updateCaseBlock(
- t,
- s(t.clauses, n, XI)
- );
- },
- 270: function(t, n, i, s, o, c) {
- return i.factory.updateNamespaceExportDeclaration(
- t,
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- 271: function(t, n, i, s, o, c) {
- return i.factory.updateImportEqualsDeclaration(
- t,
- s(t.modifiers, n, Bo),
- t.isTypeOnly,
- E.checkDefined(o(t.name, n, Oe)),
- E.checkDefined(o(t.moduleReference, n, GY))
- );
- },
- 272: function(t, n, i, s, o, c) {
- return i.factory.updateImportDeclaration(
- t,
- s(t.modifiers, n, Bo),
- o(t.importClause, n, Ad),
- E.checkDefined(o(t.moduleSpecifier, n, _t)),
- o(t.attributes, n, hS)
- );
- },
- 300: function(t, n, i, s, o, c) {
- return i.factory.updateImportAttributes(
- t,
- s(t.elements, n, Yee),
- t.multiLine
- );
- },
- 301: function(t, n, i, s, o, c) {
- return i.factory.updateImportAttribute(
- t,
- E.checkDefined(o(t.name, n, FY)),
- E.checkDefined(o(t.value, n, _t))
- );
- },
- 273: function(t, n, i, s, o, c) {
- return i.factory.updateImportClause(
- t,
- t.isTypeOnly,
- o(t.name, n, Oe),
- o(t.namedBindings, n, Pj)
- );
- },
- 274: function(t, n, i, s, o, c) {
- return i.factory.updateNamespaceImport(
- t,
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- 280: function(t, n, i, s, o, c) {
- return i.factory.updateNamespaceExport(
- t,
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- 275: function(t, n, i, s, o, c) {
- return i.factory.updateNamedImports(
- t,
- s(t.elements, n, Zu)
- );
- },
- 276: function(t, n, i, s, o, c) {
- return i.factory.updateImportSpecifier(
- t,
- t.isTypeOnly,
- o(t.propertyName, n, K5),
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- 277: function(t, n, i, s, o, c) {
- return i.factory.updateExportAssignment(
- t,
- s(t.modifiers, n, Bo),
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 278: function(t, n, i, s, o, c) {
- return i.factory.updateExportDeclaration(
- t,
- s(t.modifiers, n, Bo),
- t.isTypeOnly,
- o(t.exportClause, n, hj),
- o(t.moduleSpecifier, n, _t),
- o(t.attributes, n, hS)
- );
- },
- 279: function(t, n, i, s, o, c) {
- return i.factory.updateNamedExports(
- t,
- s(t.elements, n, vu)
- );
- },
- 281: function(t, n, i, s, o, c) {
- return i.factory.updateExportSpecifier(
- t,
- t.isTypeOnly,
- o(t.propertyName, n, K5),
- E.checkDefined(o(t.name, n, K5))
- );
- },
- // Module references
- 283: function(t, n, i, s, o, c) {
- return i.factory.updateExternalModuleReference(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- // JSX
- 284: function(t, n, i, s, o, c) {
- return i.factory.updateJsxElement(
- t,
- E.checkDefined(o(t.openingElement, n, xm)),
- s(t.children, n, Mw),
- E.checkDefined(o(t.closingElement, n, Jb))
- );
- },
- 285: function(t, n, i, s, o, c) {
- return i.factory.updateJsxSelfClosingElement(
- t,
- E.checkDefined(o(t.tagName, n, c4)),
- s(t.typeArguments, n, fi),
- E.checkDefined(o(t.attributes, n, Wb))
- );
- },
- 286: function(t, n, i, s, o, c) {
- return i.factory.updateJsxOpeningElement(
- t,
- E.checkDefined(o(t.tagName, n, c4)),
- s(t.typeArguments, n, fi),
- E.checkDefined(o(t.attributes, n, Wb))
- );
- },
- 287: function(t, n, i, s, o, c) {
- return i.factory.updateJsxClosingElement(
- t,
- E.checkDefined(o(t.tagName, n, c4))
- );
- },
- 295: function(t, n, i, s, o, c) {
- return i.factory.updateJsxNamespacedName(
- t,
- E.checkDefined(o(t.namespace, n, Oe)),
- E.checkDefined(o(t.name, n, Oe))
- );
- },
- 288: function(t, n, i, s, o, c) {
- return i.factory.updateJsxFragment(
- t,
- E.checkDefined(o(t.openingFragment, n, vS)),
- s(t.children, n, Mw),
- E.checkDefined(o(t.closingFragment, n, Kee))
- );
- },
- 291: function(t, n, i, s, o, c) {
- return i.factory.updateJsxAttribute(
- t,
- E.checkDefined(o(t.name, n, fee)),
- o(t.initializer, n, $Y)
- );
- },
- 292: function(t, n, i, s, o, c) {
- return i.factory.updateJsxAttributes(
- t,
- s(t.properties, n, $I)
- );
- },
- 293: function(t, n, i, s, o, c) {
- return i.factory.updateJsxSpreadAttribute(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 294: function(t, n, i, s, o, c) {
- return i.factory.updateJsxExpression(
- t,
- o(t.expression, n, _t)
- );
- },
- // Clauses
- 296: function(t, n, i, s, o, c) {
- return i.factory.updateCaseClause(
- t,
- E.checkDefined(o(t.expression, n, _t)),
- s(t.statements, n, bi)
- );
- },
- 297: function(t, n, i, s, o, c) {
- return i.factory.updateDefaultClause(
- t,
- s(t.statements, n, bi)
- );
- },
- 298: function(t, n, i, s, o, c) {
- return i.factory.updateHeritageClause(
- t,
- s(t.types, n, Oh)
- );
- },
- 299: function(t, n, i, s, o, c) {
- return i.factory.updateCatchClause(
- t,
- o(t.variableDeclaration, n, ii),
- E.checkDefined(o(t.block, n, Cs))
- );
- },
- // Property assignments
- 303: function(t, n, i, s, o, c) {
- return i.factory.updatePropertyAssignment(
- t,
- E.checkDefined(o(t.name, n, Bc)),
- E.checkDefined(o(t.initializer, n, _t))
- );
- },
- 304: function(t, n, i, s, o, c) {
- return i.factory.updateShorthandPropertyAssignment(
- t,
- E.checkDefined(o(t.name, n, Oe)),
- o(t.objectAssignmentInitializer, n, _t)
- );
- },
- 305: function(t, n, i, s, o, c) {
- return i.factory.updateSpreadAssignment(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- // Enum
- 306: function(t, n, i, s, o, c) {
- return i.factory.updateEnumMember(
- t,
- E.checkDefined(o(t.name, n, Bc)),
- o(t.initializer, n, _t)
- );
- },
- // Top-level nodes
- 307: function(t, n, i, s, o, c) {
- return i.factory.updateSourceFile(
- t,
- Kz(t.statements, n, i)
- );
- },
- // Transformation nodes
- 354: function(t, n, i, s, o, c) {
- return i.factory.updatePartiallyEmittedExpression(
- t,
- E.checkDefined(o(t.expression, n, _t))
- );
- },
- 355: function(t, n, i, s, o, c) {
- return i.factory.updateCommaListExpression(
- t,
- s(t.elements, n, _t)
- );
- }
- };
- function vMe(e) {
- return E.assert(e.length <= 1, "Too many nodes written to output."), Qm(e);
- }
- function jre(e, t, n, i, s) {
- var { enter: o, exit: c } = s.extendedDiagnostics ? ER("Source Map", "beforeSourcemap", "afterSourcemap") : RX, _ = [], u = [], d = /* @__PURE__ */ new Map(), g, h = [], S, T = [], C = "", D = 0, P = 0, I = 0, F = 0, O = 0, B = 0, z = !1, X = 0, q = 0, V = 0, ae = 0, ee = 0, G = 0, ue = !1, re = !1, ne = !1;
- return {
- getSources: () => _,
- addSource: ie,
- setSourceContent: Se,
- addName: J,
- addMapping: he,
- appendSourceMap: le,
- toJSON: we,
- toString: () => JSON.stringify(we())
- };
- function ie(Me) {
- o();
- const Qe = jT(
- i,
- Me,
- e.getCurrentDirectory(),
- e.getCanonicalFileName,
- /*isAbsolutePathAnUrl*/
- !0
- );
- let et = d.get(Qe);
- return et === void 0 && (et = u.length, u.push(Qe), _.push(Me), d.set(Qe, et)), c(), et;
- }
- function Se(Me, Qe) {
- if (o(), Qe !== null) {
- for (g || (g = []); g.length < Me; )
- g.push(null);
- g[Me] = Qe;
- }
- c();
- }
- function J(Me) {
- o(), S || (S = /* @__PURE__ */ new Map());
- let Qe = S.get(Me);
- return Qe === void 0 && (Qe = h.length, h.push(Me), S.set(Me, Qe)), c(), Qe;
- }
- function oe(Me, Qe) {
- return !ue || X !== Me || q !== Qe;
- }
- function _e(Me, Qe, et) {
- return Me !== void 0 && Qe !== void 0 && et !== void 0 && V === Me && (ae > Qe || ae === Qe && ee > et);
- }
- function he(Me, Qe, et, Re, ft, Wt) {
- E.assert(Me >= X, "generatedLine cannot backtrack"), E.assert(Qe >= 0, "generatedCharacter cannot be negative"), E.assert(et === void 0 || et >= 0, "sourceIndex cannot be negative"), E.assert(Re === void 0 || Re >= 0, "sourceLine cannot be negative"), E.assert(ft === void 0 || ft >= 0, "sourceCharacter cannot be negative"), o(), (oe(Me, Qe) || _e(et, Re, ft)) && (tt(), X = Me, q = Qe, re = !1, ne = !1, ue = !0), et !== void 0 && Re !== void 0 && ft !== void 0 && (V = et, ae = Re, ee = ft, re = !0, Wt !== void 0 && (G = Wt, ne = !0)), c();
- }
- function le(Me, Qe, et, Re, ft, Wt) {
- E.assert(Me >= X, "generatedLine cannot backtrack"), E.assert(Qe >= 0, "generatedCharacter cannot be negative"), o();
- const _r = [];
- let Ir;
- const jr = nW(et.mappings);
- for (const Nt of jr) {
- if (Wt && (Nt.generatedLine > Wt.line || Nt.generatedLine === Wt.line && Nt.generatedCharacter > Wt.character))
- break;
- if (ft && (Nt.generatedLine < ft.line || ft.line === Nt.generatedLine && Nt.generatedCharacter < ft.character))
- continue;
- let Qt, Br, xr, zn;
- if (Nt.sourceIndex !== void 0) {
- if (Qt = _r[Nt.sourceIndex], Qt === void 0) {
- const Jr = et.sources[Nt.sourceIndex], ji = et.sourceRoot ? Bn(et.sourceRoot, Jr) : Jr, Fe = Bn(Xn(Re), ji);
- _r[Nt.sourceIndex] = Qt = ie(Fe), et.sourcesContent && typeof et.sourcesContent[Nt.sourceIndex] == "string" && Se(Qt, et.sourcesContent[Nt.sourceIndex]);
- }
- Br = Nt.sourceLine, xr = Nt.sourceCharacter, et.names && Nt.nameIndex !== void 0 && (Ir || (Ir = []), zn = Ir[Nt.nameIndex], zn === void 0 && (Ir[Nt.nameIndex] = zn = J(et.names[Nt.nameIndex])));
- }
- const ki = Nt.generatedLine - (ft ? ft.line : 0), rs = ki + Me, ei = ft && ft.line === Nt.generatedLine ? Nt.generatedCharacter - ft.character : Nt.generatedCharacter, Ri = ki === 0 ? ei + Qe : ei;
- he(rs, Ri, Qt, Br, xr, zn);
- }
- c();
- }
- function me() {
- return !z || D !== X || P !== q || I !== V || F !== ae || O !== ee || B !== G;
- }
- function ve(Me) {
- T.push(Me), T.length >= 1024 && Te();
- }
- function tt() {
- if (!(!ue || !me())) {
- if (o(), D < X) {
- do
- ve(
- 59
- /* semicolon */
- ), D++;
- while (D < X);
- P = 0;
- } else
- E.assertEqual(D, X, "generatedLine cannot backtrack"), z && ve(
- 44
- /* comma */
- );
- fe(q - P), P = q, re && (fe(V - I), I = V, fe(ae - F), F = ae, fe(ee - O), O = ee, ne && (fe(G - B), B = G)), z = !0, c();
- }
- }
- function Te() {
- T.length > 0 && (C += String.fromCharCode.apply(void 0, T), T.length = 0);
- }
- function we() {
- return tt(), Te(), {
- version: 3,
- file: t,
- sourceRoot: n,
- sources: u,
- names: h,
- mappings: C,
- sourcesContent: g
- };
- }
- function fe(Me) {
- Me < 0 ? Me = (-Me << 1) + 1 : Me = Me << 1;
- do {
- let Qe = Me & 31;
- Me = Me >> 5, Me > 0 && (Qe = Qe | 32), ve(TMe(Qe));
- } while (Me > 0);
- }
- }
- var Bre = /\/\/[@#] source[M]appingURL=(.+)\r?\n?$/, eW = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/, tW = /^\s*(\/\/[@#] .*)?$/;
- function rW(e, t) {
- return {
- getLineCount: () => t.length,
- getLineText: (n) => e.substring(t[n], t[n + 1])
- };
- }
- function Jre(e) {
- for (let t = e.getLineCount() - 1; t >= 0; t--) {
- const n = e.getLineText(t), i = eW.exec(n);
- if (i)
- return i[1].trimEnd();
- if (!n.match(tW))
- break;
- }
- }
- function bMe(e) {
- return typeof e == "string" || e === null;
- }
- function SMe(e) {
- return e !== null && typeof e == "object" && e.version === 3 && typeof e.file == "string" && typeof e.mappings == "string" && us(e.sources) && Mi(e.sources, _s) && (e.sourceRoot === void 0 || e.sourceRoot === null || typeof e.sourceRoot == "string") && (e.sourcesContent === void 0 || e.sourcesContent === null || us(e.sourcesContent) && Mi(e.sourcesContent, bMe)) && (e.names === void 0 || e.names === null || us(e.names) && Mi(e.names, _s));
- }
- function zre(e) {
- try {
- const t = JSON.parse(e);
- if (SMe(t))
- return t;
- } catch {
- }
- }
- function nW(e) {
- let t = !1, n = 0, i = 0, s = 0, o = 0, c = 0, _ = 0, u = 0, d;
- return {
- get pos() {
- return n;
- },
- get error() {
- return d;
- },
- get state() {
- return g(
- /*hasSource*/
- !0,
- /*hasName*/
- !0
- );
- },
- next() {
- for (; !t && n < e.length; ) {
- const I = e.charCodeAt(n);
- if (I === 59) {
- i++, s = 0, n++;
- continue;
- }
- if (I === 44) {
- n++;
- continue;
- }
- let F = !1, O = !1;
- if (s += P(), C()) return h();
- if (s < 0) return T("Invalid generatedCharacter found");
- if (!D()) {
- if (F = !0, o += P(), C()) return h();
- if (o < 0) return T("Invalid sourceIndex found");
- if (D()) return T("Unsupported Format: No entries after sourceIndex");
- if (c += P(), C()) return h();
- if (c < 0) return T("Invalid sourceLine found");
- if (D()) return T("Unsupported Format: No entries after sourceLine");
- if (_ += P(), C()) return h();
- if (_ < 0) return T("Invalid sourceCharacter found");
- if (!D()) {
- if (O = !0, u += P(), C()) return h();
- if (u < 0) return T("Invalid nameIndex found");
- if (!D()) return T("Unsupported Error Format: Entries after nameIndex");
- }
- }
- return { value: g(F, O), done: t };
- }
- return h();
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- function g(I, F) {
- return {
- generatedLine: i,
- generatedCharacter: s,
- sourceIndex: I ? o : void 0,
- sourceLine: I ? c : void 0,
- sourceCharacter: I ? _ : void 0,
- nameIndex: F ? u : void 0
- };
- }
- function h() {
- return t = !0, { value: void 0, done: !0 };
- }
- function S(I) {
- d === void 0 && (d = I);
- }
- function T(I) {
- return S(I), h();
- }
- function C() {
- return d !== void 0;
- }
- function D() {
- return n === e.length || e.charCodeAt(n) === 44 || e.charCodeAt(n) === 59;
- }
- function P() {
- let I = !0, F = 0, O = 0;
- for (; I; n++) {
- if (n >= e.length) return S("Error in decoding base64VLQFormatDecode, past the mapping string"), -1;
- const B = xMe(e.charCodeAt(n));
- if (B === -1) return S("Invalid character in VLQ"), -1;
- I = (B & 32) !== 0, O = O | (B & 31) << F, F += 5;
- }
- return O & 1 ? (O = O >> 1, O = -O) : O = O >> 1, O;
- }
- }
- function Uye(e, t) {
- return e === t || e.generatedLine === t.generatedLine && e.generatedCharacter === t.generatedCharacter && e.sourceIndex === t.sourceIndex && e.sourceLine === t.sourceLine && e.sourceCharacter === t.sourceCharacter && e.nameIndex === t.nameIndex;
- }
- function Wre(e) {
- return e.sourceIndex !== void 0 && e.sourceLine !== void 0 && e.sourceCharacter !== void 0;
- }
- function TMe(e) {
- return e >= 0 && e < 26 ? 65 + e : e >= 26 && e < 52 ? 97 + e - 26 : e >= 52 && e < 62 ? 48 + e - 52 : e === 62 ? 43 : e === 63 ? 47 : E.fail(`${e}: not a base64 value`);
- }
- function xMe(e) {
- return e >= 65 && e <= 90 ? e - 65 : e >= 97 && e <= 122 ? e - 97 + 26 : e >= 48 && e <= 57 ? e - 48 + 52 : e === 43 ? 62 : e === 47 ? 63 : -1;
- }
- function Vye(e) {
- return e.sourceIndex !== void 0 && e.sourcePosition !== void 0;
- }
- function qye(e, t) {
- return e.generatedPosition === t.generatedPosition && e.sourceIndex === t.sourceIndex && e.sourcePosition === t.sourcePosition;
- }
- function kMe(e, t) {
- return E.assert(e.sourceIndex === t.sourceIndex), ho(e.sourcePosition, t.sourcePosition);
- }
- function CMe(e, t) {
- return ho(e.generatedPosition, t.generatedPosition);
- }
- function EMe(e) {
- return e.sourcePosition;
- }
- function DMe(e) {
- return e.generatedPosition;
- }
- function Ure(e, t, n) {
- const i = Xn(n), s = t.sourceRoot ? es(t.sourceRoot, i) : i, o = es(t.file, i), c = e.getSourceFileLike(o), _ = t.sources.map((F) => es(F, s)), u = new Map(_.map((F, O) => [e.getCanonicalFileName(F), O]));
- let d, g, h;
- return {
- getSourcePosition: I,
- getGeneratedPosition: P
- };
- function S(F) {
- const O = c !== void 0 ? pw(
- c,
- F.generatedLine,
- F.generatedCharacter,
- /*allowEdits*/
- !0
- ) : -1;
- let B, z;
- if (Wre(F)) {
- const X = e.getSourceFileLike(_[F.sourceIndex]);
- B = t.sources[F.sourceIndex], z = X !== void 0 ? pw(
- X,
- F.sourceLine,
- F.sourceCharacter,
- /*allowEdits*/
- !0
- ) : -1;
- }
- return {
- generatedPosition: O,
- source: B,
- sourceIndex: F.sourceIndex,
- sourcePosition: z,
- nameIndex: F.nameIndex
- };
- }
- function T() {
- if (d === void 0) {
- const F = nW(t.mappings), O = as(F, S);
- F.error !== void 0 ? (e.log && e.log(`Encountered error while decoding sourcemap: ${F.error}`), d = Ue) : d = O;
- }
- return d;
- }
- function C(F) {
- if (h === void 0) {
- const O = [];
- for (const B of T()) {
- if (!Vye(B)) continue;
- let z = O[B.sourceIndex];
- z || (O[B.sourceIndex] = z = []), z.push(B);
- }
- h = O.map((B) => IE(B, kMe, qye));
- }
- return h[F];
- }
- function D() {
- if (g === void 0) {
- const F = [];
- for (const O of T())
- F.push(O);
- g = IE(F, CMe, qye);
- }
- return g;
- }
- function P(F) {
- const O = u.get(e.getCanonicalFileName(F.fileName));
- if (O === void 0) return F;
- const B = C(O);
- if (!ut(B)) return F;
- let z = IT(B, F.pos, EMe, ho);
- z < 0 && (z = ~z);
- const X = B[z];
- return X === void 0 || X.sourceIndex !== O ? F : { fileName: o, pos: X.generatedPosition };
- }
- function I(F) {
- const O = D();
- if (!ut(O)) return F;
- let B = IT(O, F.pos, DMe, ho);
- B < 0 && (B = ~B);
- const z = O[B];
- return z === void 0 || !Vye(z) ? F : { fileName: _[z.sourceIndex], pos: z.sourcePosition };
- }
- }
- var iW = {
- getSourcePosition: go,
- getGeneratedPosition: go
- };
- function e_(e) {
- return e = Ho(e), e ? Ma(e) : 0;
- }
- function Hye(e) {
- return !e || !Tm(e) && !pp(e) ? !1 : ut(e.elements, Gye);
- }
- function Gye(e) {
- return ng(e.propertyName || e.name);
- }
- function Fd(e, t) {
- return n;
- function n(s) {
- return s.kind === 307 ? t(s) : i(s);
- }
- function i(s) {
- return e.factory.createBundle(lr(s.sourceFiles, t));
- }
- }
- function Vre(e) {
- return !!kC(e);
- }
- function qO(e) {
- if (kC(e))
- return !0;
- const t = e.importClause && e.importClause.namedBindings;
- if (!t || !Tm(t)) return !1;
- let n = 0;
- for (const i of t.elements)
- Gye(i) && n++;
- return n > 0 && n !== t.elements.length || !!(t.elements.length - n) && ex(e);
- }
- function sW(e) {
- return !qO(e) && (ex(e) || !!e.importClause && Tm(e.importClause.namedBindings) && Hye(e.importClause.namedBindings));
- }
- function aW(e, t) {
- const n = e.getEmitResolver(), i = e.getCompilerOptions(), s = [], o = new PMe(), c = [], _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set();
- let d, g = !1, h, S = !1, T = !1, C = !1;
- for (const F of t.statements)
- switch (F.kind) {
- case 272:
- s.push(F), !T && qO(F) && (T = !0), !C && sW(F) && (C = !0);
- break;
- case 271:
- F.moduleReference.kind === 283 && s.push(F);
- break;
- case 278:
- if (F.moduleSpecifier)
- if (!F.exportClause)
- s.push(F), S = !0;
- else if (s.push(F), pp(F.exportClause))
- P(F), C || (C = Hye(F.exportClause));
- else {
- const O = F.exportClause.name, B = Fy(O);
- _.get(B) || (DD(c, e_(F), O), _.set(B, !0), d = wr(d, O)), T = !0;
- }
- else
- P(F);
- break;
- case 277:
- F.isExportEquals && !h && (h = F);
- break;
- case 243:
- if (Gn(
- F,
- 32
- /* Export */
- ))
- for (const O of F.declarationList.declarations)
- d = $ye(O, _, d, c);
- break;
- case 262:
- Gn(
- F,
- 32
- /* Export */
- ) && I(
- F,
- /*name*/
- void 0,
- Gn(
- F,
- 2048
- /* Default */
- )
- );
- break;
- case 263:
- if (Gn(
- F,
- 32
- /* Export */
- ))
- if (Gn(
- F,
- 2048
- /* Default */
- ))
- g || (DD(c, e_(F), e.factory.getDeclarationName(F)), g = !0);
- else {
- const O = F.name;
- O && !_.get(Nn(O)) && (DD(c, e_(F), O), _.set(Nn(O), !0), d = wr(d, O));
- }
- break;
- }
- const D = ez(e.factory, e.getEmitHelperFactory(), t, i, S, T, C);
- return D && s.unshift(D), { externalImports: s, exportSpecifiers: o, exportEquals: h, hasExportStarsToExportValues: S, exportedBindings: c, exportedNames: d, exportedFunctions: u, externalHelpersImportDeclaration: D };
- function P(F) {
- for (const O of Bs(F.exportClause, pp).elements) {
- const B = Fy(O.name);
- if (!_.get(B)) {
- const z = O.propertyName || O.name;
- if (z.kind !== 11) {
- F.moduleSpecifier || o.add(z, O);
- const X = n.getReferencedImportDeclaration(z) || n.getReferencedValueDeclaration(z);
- if (X) {
- if (X.kind === 262) {
- I(X, O.name, ng(O.name));
- continue;
- }
- DD(c, e_(X), O.name);
- }
- }
- _.set(B, !0), d = wr(d, O.name);
- }
- }
- }
- function I(F, O, B) {
- if (u.add(Ho(F, Ec)), B)
- g || (DD(c, e_(F), O ?? e.factory.getDeclarationName(F)), g = !0);
- else {
- O ?? (O = F.name);
- const z = Fy(O);
- _.get(z) || (DD(c, e_(F), O), _.set(z, !0));
- }
- }
- }
- function $ye(e, t, n, i) {
- if (As(e.name))
- for (const s of e.name.elements)
- ml(s) || (n = $ye(s, t, n, i));
- else if (!jo(e.name)) {
- const s = Nn(e.name);
- t.get(s) || (t.set(s, !0), n = wr(n, e.name), Mh(e.name) && DD(i, e_(e), e.name));
- }
- return n;
- }
- function DD(e, t, n) {
- let i = e[t];
- return i ? i.push(n) : e[t] = i = [n], i;
- }
- var _6 = class PE {
- constructor() {
- this._map = /* @__PURE__ */ new Map();
- }
- get size() {
- return this._map.size;
- }
- has(t) {
- return this._map.has(PE.toKey(t));
- }
- get(t) {
- return this._map.get(PE.toKey(t));
- }
- set(t, n) {
- return this._map.set(PE.toKey(t), n), this;
- }
- delete(t) {
- var n;
- return ((n = this._map) == null ? void 0 : n.delete(PE.toKey(t))) ?? !1;
- }
- clear() {
- this._map.clear();
- }
- values() {
- return this._map.values();
- }
- static toKey(t) {
- if (Q2(t) || jo(t)) {
- const n = t.emitNode.autoGenerate;
- if ((n.flags & 7) === 4) {
- const i = fA(t), s = Fg(i) && i !== t ? PE.toKey(i) : `(generated@${Ma(i)})`;
- return mv(
- /*privateName*/
- !1,
- n.prefix,
- s,
- n.suffix,
- PE.toKey
- );
- } else {
- const i = `(auto@${n.id})`;
- return mv(
- /*privateName*/
- !1,
- n.prefix,
- i,
- n.suffix,
- PE.toKey
- );
- }
- }
- return Di(t) ? Nn(t).slice(1) : Nn(t);
- }
- }, PMe = class extends _6 {
- add(e, t) {
- let n = this.get(e);
- return n ? n.push(t) : this.set(e, n = [t]), n;
- }
- remove(e, t) {
- const n = this.get(e);
- n && (LT(n, t), n.length || this.delete(e));
- }
- };
- function Hb(e) {
- return Xa(e) || e.kind === 9 || p_(e.kind) || Oe(e);
- }
- function fg(e) {
- return !Oe(e) && Hb(e);
- }
- function PD(e) {
- return e >= 65 && e <= 79;
- }
- function wD(e) {
- switch (e) {
- case 65:
- return 40;
- case 66:
- return 41;
- case 67:
- return 42;
- case 68:
- return 43;
- case 69:
- return 44;
- case 70:
- return 45;
- case 71:
- return 48;
- case 72:
- return 49;
- case 73:
- return 50;
- case 74:
- return 51;
- case 75:
- return 52;
- case 79:
- return 53;
- case 76:
- return 57;
- case 77:
- return 56;
- case 78:
- return 61;
- }
- }
- function HO(e) {
- if (!Pl(e))
- return;
- const t = Ba(e.expression);
- return rS(t) ? t : void 0;
- }
- function Xye(e, t, n) {
- for (let i = t; i < e.length; i += 1) {
- const s = e[i];
- if (HO(s))
- return n.unshift(i), !0;
- if (gS(s) && Xye(s.tryBlock.statements, 0, n))
- return n.unshift(i), !0;
- }
- return !1;
- }
- function GO(e, t) {
- const n = [];
- return Xye(e, t, n), n;
- }
- function oW(e, t, n) {
- return Ln(e.members, (i) => AMe(i, t, n));
- }
- function wMe(e) {
- return NMe(e) || oc(e);
- }
- function $O(e) {
- return Ln(e.members, wMe);
- }
- function AMe(e, t, n) {
- return cs(e) && (!!e.initializer || !t) && tl(e) === n;
- }
- function NMe(e) {
- return cs(e) && tl(e);
- }
- function AA(e) {
- return e.kind === 172 && e.initializer !== void 0;
- }
- function qre(e) {
- return !zs(e) && (UT(e) || u_(e)) && Di(e.name);
- }
- function Hre(e) {
- let t;
- if (e) {
- const n = e.parameters, i = n.length > 0 && Db(n[0]), s = i ? 1 : 0, o = i ? n.length - 1 : n.length;
- for (let c = 0; c < o; c++) {
- const _ = n[c + s];
- (t || Ff(_)) && (t || (t = new Array(o)), t[c] = Cy(_));
- }
- }
- return t;
- }
- function cW(e) {
- const t = Cy(e), n = Hre(Bg(e));
- if (!(!ut(t) && !ut(n)))
- return {
- decorators: t,
- parameters: n
- };
- }
- function XO(e, t, n) {
- switch (e.kind) {
- case 177:
- case 178:
- return n ? IMe(e, t) : Qye(e);
- case 174:
- return Qye(e);
- case 172:
- return OMe(e);
- default:
- return;
- }
- }
- function IMe(e, t) {
- if (!e.body)
- return;
- const { firstAccessor: n, secondAccessor: i, getAccessor: s, setAccessor: o } = My(t.members, e), c = Ff(n) ? n : i && Ff(i) ? i : void 0;
- if (!c || e !== c)
- return;
- const _ = Cy(c), u = Hre(o);
- if (!(!ut(_) && !ut(u)))
- return {
- decorators: _,
- parameters: u,
- getDecorators: s && Cy(s),
- setDecorators: o && Cy(o)
- };
- }
- function Qye(e) {
- if (!e.body)
- return;
- const t = Cy(e), n = Hre(e);
- if (!(!ut(t) && !ut(n)))
- return { decorators: t, parameters: n };
- }
- function OMe(e) {
- const t = Cy(e);
- if (ut(t))
- return { decorators: t };
- }
- function FMe(e, t) {
- for (; e; ) {
- const n = t(e);
- if (n !== void 0) return n;
- e = e.previous;
- }
- }
- function Gre(e) {
- return { data: e };
- }
- function lW(e, t) {
- var n, i;
- return Q2(t) ? (n = e?.generatedIdentifiers) == null ? void 0 : n.get(fA(t)) : (i = e?.identifiers) == null ? void 0 : i.get(t.escapedText);
- }
- function ES(e, t, n) {
- Q2(t) ? (e.generatedIdentifiers ?? (e.generatedIdentifiers = /* @__PURE__ */ new Map()), e.generatedIdentifiers.set(fA(t), n)) : (e.identifiers ?? (e.identifiers = /* @__PURE__ */ new Map()), e.identifiers.set(t.escapedText, n));
- }
- function $re(e, t) {
- return FMe(e, (n) => lW(n.privateEnv, t));
- }
- function LMe(e) {
- return !e.initializer && Oe(e.name);
- }
- function NA(e) {
- return Mi(e, LMe);
- }
- var Xre = /* @__PURE__ */ ((e) => (e[e.All = 0] = "All", e[e.ObjectRest = 1] = "ObjectRest", e))(Xre || {});
- function DS(e, t, n, i, s, o) {
- let c = e, _;
- if (x0(e))
- for (_ = e.right; bK(e.left) || jB(e.left); )
- if (x0(_))
- c = e = _, _ = e.right;
- else
- return E.checkDefined(Ge(_, t, _t));
- let u;
- const d = {
- context: n,
- level: i,
- downlevelIteration: !!n.getCompilerOptions().downlevelIteration,
- hoistTempVariables: !0,
- emitExpression: g,
- emitBindingOrAssignment: h,
- createArrayBindingOrAssignmentPattern: (S) => UMe(n.factory, S),
- createObjectBindingOrAssignmentPattern: (S) => qMe(n.factory, S),
- createArrayBindingOrAssignmentElement: GMe,
- visitor: t
- };
- if (_ && (_ = Ge(_, t, _t), E.assert(_), Oe(_) && Qre(e, _.escapedText) || Yre(e) ? _ = qx(
- d,
- _,
- /*reuseIdentifierExpressions*/
- !1,
- c
- ) : s ? _ = qx(
- d,
- _,
- /*reuseIdentifierExpressions*/
- !0,
- c
- ) : fo(e) && (c = _)), AD(
- d,
- e,
- _,
- c,
- /*skipInitializer*/
- x0(e)
- ), _ && s) {
- if (!ut(u))
- return _;
- u.push(_);
- }
- return n.factory.inlineExpressions(u) || n.factory.createOmittedExpression();
- function g(S) {
- u = wr(u, S);
- }
- function h(S, T, C, D) {
- E.assertNode(S, o ? Oe : _t);
- const P = o ? o(S, T, C) : lt(
- n.factory.createAssignment(E.checkDefined(Ge(S, t, _t)), T),
- C
- );
- P.original = D, g(P);
- }
- }
- function Qre(e, t) {
- const n = $y(e);
- return ww(n) ? MMe(n, t) : Oe(n) ? n.escapedText === t : !1;
- }
- function MMe(e, t) {
- const n = t6(e);
- for (const i of n)
- if (Qre(i, t))
- return !0;
- return !1;
- }
- function Yre(e) {
- const t = _O(e);
- if (t && ma(t) && !X2(t.expression))
- return !0;
- const n = $y(e);
- return !!n && ww(n) && RMe(n);
- }
- function RMe(e) {
- return !!ir(t6(e), Yre);
- }
- function Gb(e, t, n, i, s, o = !1, c) {
- let _;
- const u = [], d = [], g = {
- context: n,
- level: i,
- downlevelIteration: !!n.getCompilerOptions().downlevelIteration,
- hoistTempVariables: o,
- emitExpression: h,
- emitBindingOrAssignment: S,
- createArrayBindingOrAssignmentPattern: (T) => WMe(n.factory, T),
- createObjectBindingOrAssignmentPattern: (T) => VMe(n.factory, T),
- createArrayBindingOrAssignmentElement: (T) => HMe(n.factory, T),
- visitor: t
- };
- if (ii(e)) {
- let T = uA(e);
- T && (Oe(T) && Qre(e, T.escapedText) || Yre(e)) && (T = qx(
- g,
- E.checkDefined(Ge(T, g.visitor, _t)),
- /*reuseIdentifierExpressions*/
- !1,
- T
- ), e = n.factory.updateVariableDeclaration(
- e,
- e.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- T
- ));
- }
- if (AD(g, e, s, e, c), _) {
- const T = n.factory.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- if (o) {
- const C = n.factory.inlineExpressions(_);
- _ = void 0, S(
- T,
- C,
- /*location*/
- void 0,
- /*original*/
- void 0
- );
- } else {
- n.hoistVariableDeclaration(T);
- const C = _a(u);
- C.pendingExpressions = wr(
- C.pendingExpressions,
- n.factory.createAssignment(T, C.value)
- ), Fn(C.pendingExpressions, _), C.value = T;
- }
- }
- for (const { pendingExpressions: T, name: C, value: D, location: P, original: I } of u) {
- const F = n.factory.createVariableDeclaration(
- C,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- T ? n.factory.inlineExpressions(wr(T, D)) : D
- );
- F.original = I, lt(F, P), d.push(F);
- }
- return d;
- function h(T) {
- _ = wr(_, T);
- }
- function S(T, C, D, P) {
- E.assertNode(T, Y2), _ && (C = n.factory.inlineExpressions(wr(_, C)), _ = void 0), u.push({ pendingExpressions: _, name: T, value: C, location: D, original: P });
- }
- }
- function AD(e, t, n, i, s) {
- const o = $y(t);
- if (!s) {
- const c = Ge(uA(t), e.visitor, _t);
- c ? n ? (n = JMe(e, n, c, i), !fg(c) && ww(o) && (n = qx(
- e,
- n,
- /*reuseIdentifierExpressions*/
- !0,
- i
- ))) : n = c : n || (n = e.context.factory.createVoidZero());
- }
- xj(o) ? jMe(e, t, o, n, i) : kj(o) ? BMe(e, t, o, n, i) : e.emitBindingOrAssignment(
- o,
- n,
- i,
- /*original*/
- t
- );
- }
- function jMe(e, t, n, i, s) {
- const o = t6(n), c = o.length;
- if (c !== 1) {
- const d = !Pw(t) || c !== 0;
- i = qx(e, i, d, s);
- }
- let _, u;
- for (let d = 0; d < c; d++) {
- const g = o[d];
- if (uO(g)) {
- if (d === c - 1) {
- _ && (e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(_), i, s, n), _ = void 0);
- const h = e.context.getEmitHelperFactory().createRestHelper(i, o, u, n);
- AD(e, g, h, g);
- }
- } else {
- const h = tz(g);
- if (e.level >= 1 && !(g.transformFlags & 98304) && !($y(g).transformFlags & 98304) && !ma(h))
- _ = wr(_, Ge(g, e.visitor, RY));
- else {
- _ && (e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(_), i, s, n), _ = void 0);
- const S = zMe(e, i, h);
- ma(h) && (u = wr(u, S.argumentExpression)), AD(
- e,
- g,
- S,
- /*location*/
- g
- );
- }
- }
- }
- _ && e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(_), i, s, n);
- }
- function BMe(e, t, n, i, s) {
- const o = t6(n), c = o.length;
- if (e.level < 1 && e.downlevelIteration)
- i = qx(
- e,
- lt(
- e.context.getEmitHelperFactory().createReadHelper(
- i,
- c > 0 && uO(o[c - 1]) ? void 0 : c
- ),
- s
- ),
- /*reuseIdentifierExpressions*/
- !1,
- s
- );
- else if (c !== 1 && (e.level < 1 || c === 0) || Mi(o, ml)) {
- const d = !Pw(t) || c !== 0;
- i = qx(e, i, d, s);
- }
- let _, u;
- for (let d = 0; d < c; d++) {
- const g = o[d];
- if (e.level >= 1)
- if (g.transformFlags & 65536 || e.hasTransformedPriorElement && !Yye(g)) {
- e.hasTransformedPriorElement = !0;
- const h = e.context.factory.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- e.hoistTempVariables && e.context.hoistVariableDeclaration(h), u = wr(u, [h, g]), _ = wr(_, e.createArrayBindingOrAssignmentElement(h));
- } else
- _ = wr(_, g);
- else {
- if (ml(g))
- continue;
- if (uO(g)) {
- if (d === c - 1) {
- const h = e.context.factory.createArraySliceCall(i, d);
- AD(
- e,
- g,
- h,
- /*location*/
- g
- );
- }
- } else {
- const h = e.context.factory.createElementAccessExpression(i, d);
- AD(
- e,
- g,
- h,
- /*location*/
- g
- );
- }
- }
- }
- if (_ && e.emitBindingOrAssignment(e.createArrayBindingOrAssignmentPattern(_), i, s, n), u)
- for (const [d, g] of u)
- AD(e, g, d, g);
- }
- function Yye(e) {
- const t = $y(e);
- if (!t || ml(t)) return !0;
- const n = _O(e);
- if (n && !fm(n)) return !1;
- const i = uA(e);
- return i && !fg(i) ? !1 : ww(t) ? Mi(t6(t), Yye) : Oe(t);
- }
- function JMe(e, t, n, i) {
- return t = qx(
- e,
- t,
- /*reuseIdentifierExpressions*/
- !0,
- i
- ), e.context.factory.createConditionalExpression(
- e.context.factory.createTypeCheck(t, "undefined"),
- /*questionToken*/
- void 0,
- n,
- /*colonToken*/
- void 0,
- t
- );
- }
- function zMe(e, t, n) {
- const { factory: i } = e.context;
- if (ma(n)) {
- const s = qx(
- e,
- E.checkDefined(Ge(n.expression, e.visitor, _t)),
- /*reuseIdentifierExpressions*/
- !1,
- /*location*/
- n
- );
- return e.context.factory.createElementAccessExpression(t, s);
- } else if (Of(n) || eD(n)) {
- const s = i.cloneNode(n);
- return e.context.factory.createElementAccessExpression(t, s);
- } else {
- const s = e.context.factory.createIdentifier(Nn(n));
- return e.context.factory.createPropertyAccessExpression(t, s);
- }
- }
- function qx(e, t, n, i) {
- if (Oe(t) && n)
- return t;
- {
- const s = e.context.factory.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- return e.hoistTempVariables ? (e.context.hoistVariableDeclaration(s), e.emitExpression(lt(e.context.factory.createAssignment(s, t), i))) : e.emitBindingOrAssignment(
- s,
- t,
- i,
- /*original*/
- void 0
- ), s;
- }
- }
- function WMe(e, t) {
- return E.assertEachNode(t, qI), e.createArrayBindingPattern(t);
- }
- function UMe(e, t) {
- return E.assertEachNode(t, Nw), e.createArrayLiteralExpression(lr(t, e.converters.convertToArrayAssignmentElement));
- }
- function VMe(e, t) {
- return E.assertEachNode(t, va), e.createObjectBindingPattern(t);
- }
- function qMe(e, t) {
- return E.assertEachNode(t, Aw), e.createObjectLiteralExpression(lr(t, e.converters.convertToObjectAssignmentElement));
- }
- function HMe(e, t) {
- return e.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- void 0,
- t
- );
- }
- function GMe(e) {
- return e;
- }
- function $Me(e, t, n = e.createThis()) {
- const i = e.createAssignment(t, n), s = e.createExpressionStatement(i), o = e.createBlock(
- [s],
- /*multiLine*/
- !1
- ), c = e.createClassStaticBlockDeclaration(o);
- return lu(c).classThis = t, c;
- }
- function ND(e) {
- var t;
- if (!oc(e) || e.body.statements.length !== 1)
- return !1;
- const n = e.body.statements[0];
- return Pl(n) && Dl(
- n.expression,
- /*excludeCompoundAssignment*/
- !0
- ) && Oe(n.expression.left) && ((t = e.emitNode) == null ? void 0 : t.classThis) === n.expression.left && n.expression.right.kind === 110;
- }
- function uW(e) {
- var t;
- return !!((t = e.emitNode) != null && t.classThis) && ut(e.members, ND);
- }
- function Zre(e, t, n, i) {
- if (uW(t))
- return t;
- const s = $Me(e, n, i);
- t.name && da(s.body.statements[0], t.name);
- const o = e.createNodeArray([s, ...t.members]);
- lt(o, t.members);
- const c = Xc(t) ? e.updateClassDeclaration(
- t,
- t.modifiers,
- t.name,
- t.typeParameters,
- t.heritageClauses,
- o
- ) : e.updateClassExpression(
- t,
- t.modifiers,
- t.name,
- t.typeParameters,
- t.heritageClauses,
- o
- );
- return lu(c).classThis = n, c;
- }
- function QO(e, t, n) {
- const i = Ho(Dc(n));
- return (Xc(i) || Ec(i)) && !i.name && Gn(
- i,
- 2048
- /* Default */
- ) ? e.createStringLiteral("default") : e.createStringLiteralFromNode(t);
- }
- function Zye(e, t, n) {
- const { factory: i } = e;
- if (n !== void 0)
- return { assignedName: i.createStringLiteral(n), name: t };
- if (fm(t) || Di(t))
- return { assignedName: i.createStringLiteralFromNode(t), name: t };
- if (fm(t.expression) && !Oe(t.expression))
- return { assignedName: i.createStringLiteralFromNode(t.expression), name: t };
- const s = i.getGeneratedNameForNode(t);
- e.hoistVariableDeclaration(s);
- const o = e.getEmitHelperFactory().createPropKeyHelper(t.expression), c = i.createAssignment(s, o), _ = i.updateComputedPropertyName(t, c);
- return { assignedName: s, name: _ };
- }
- function XMe(e, t, n = e.factory.createThis()) {
- const { factory: i } = e, s = e.getEmitHelperFactory().createSetFunctionNameHelper(n, t), o = i.createExpressionStatement(s), c = i.createBlock(
- [o],
- /*multiLine*/
- !1
- ), _ = i.createClassStaticBlockDeclaration(c);
- return lu(_).assignedName = t, _;
- }
- function Hx(e) {
- var t;
- if (!oc(e) || e.body.statements.length !== 1)
- return !1;
- const n = e.body.statements[0];
- return Pl(n) && K4(n.expression, "___setFunctionName") && n.expression.arguments.length >= 2 && n.expression.arguments[1] === ((t = e.emitNode) == null ? void 0 : t.assignedName);
- }
- function YO(e) {
- var t;
- return !!((t = e.emitNode) != null && t.assignedName) && ut(e.members, Hx);
- }
- function _W(e) {
- return !!e.name || YO(e);
- }
- function ZO(e, t, n, i) {
- if (YO(t))
- return t;
- const { factory: s } = e, o = XMe(e, n, i);
- t.name && da(o.body.statements[0], t.name);
- const c = ac(t.members, ND) + 1, _ = t.members.slice(0, c), u = t.members.slice(c), d = s.createNodeArray([..._, o, ...u]);
- return lt(d, t.members), t = Xc(t) ? s.updateClassDeclaration(
- t,
- t.modifiers,
- t.name,
- t.typeParameters,
- t.heritageClauses,
- d
- ) : s.updateClassExpression(
- t,
- t.modifiers,
- t.name,
- t.typeParameters,
- t.heritageClauses,
- d
- ), lu(t).assignedName = n, t;
- }
- function f6(e, t, n, i) {
- if (i && oa(n) && rB(n))
- return t;
- const { factory: s } = e, o = Dc(t), c = $c(o) ? Bs(ZO(e, o, n), $c) : e.getEmitHelperFactory().createSetFunctionNameHelper(o, n);
- return s.restoreOuterExpressions(t, c);
- }
- function QMe(e, t, n, i) {
- const { factory: s } = e, { assignedName: o, name: c } = Zye(e, t.name, i), _ = f6(e, t.initializer, o, n);
- return s.updatePropertyAssignment(
- t,
- c,
- _
- );
- }
- function YMe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : QO(s, t.name, t.objectAssignmentInitializer), c = f6(e, t.objectAssignmentInitializer, o, n);
- return s.updateShorthandPropertyAssignment(
- t,
- t.name,
- c
- );
- }
- function ZMe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : QO(s, t.name, t.initializer), c = f6(e, t.initializer, o, n);
- return s.updateVariableDeclaration(
- t,
- t.name,
- t.exclamationToken,
- t.type,
- c
- );
- }
- function KMe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : QO(s, t.name, t.initializer), c = f6(e, t.initializer, o, n);
- return s.updateParameterDeclaration(
- t,
- t.modifiers,
- t.dotDotDotToken,
- t.name,
- t.questionToken,
- t.type,
- c
- );
- }
- function eRe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : QO(s, t.name, t.initializer), c = f6(e, t.initializer, o, n);
- return s.updateBindingElement(
- t,
- t.dotDotDotToken,
- t.propertyName,
- t.name,
- c
- );
- }
- function tRe(e, t, n, i) {
- const { factory: s } = e, { assignedName: o, name: c } = Zye(e, t.name, i), _ = f6(e, t.initializer, o, n);
- return s.updatePropertyDeclaration(
- t,
- t.modifiers,
- c,
- t.questionToken ?? t.exclamationToken,
- t.type,
- _
- );
- }
- function rRe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : QO(s, t.left, t.right), c = f6(e, t.right, o, n);
- return s.updateBinaryExpression(
- t,
- t.left,
- t.operatorToken,
- c
- );
- }
- function nRe(e, t, n, i) {
- const { factory: s } = e, o = i !== void 0 ? s.createStringLiteral(i) : s.createStringLiteral(t.isExportEquals ? "" : "default"), c = f6(e, t.expression, o, n);
- return s.updateExportAssignment(
- t,
- t.modifiers,
- c
- );
- }
- function tf(e, t, n, i) {
- switch (t.kind) {
- case 303:
- return QMe(e, t, n, i);
- case 304:
- return YMe(e, t, n, i);
- case 260:
- return ZMe(e, t, n, i);
- case 169:
- return KMe(e, t, n, i);
- case 208:
- return eRe(e, t, n, i);
- case 172:
- return tRe(e, t, n, i);
- case 226:
- return rRe(e, t, n, i);
- case 277:
- return nRe(e, t, n, i);
- }
- }
- var Kre = /* @__PURE__ */ ((e) => (e[e.LiftRestriction = 0] = "LiftRestriction", e[e.All = 1] = "All", e))(Kre || {});
- function fW(e, t, n, i, s, o) {
- const c = Ge(t.tag, n, _t);
- E.assert(c);
- const _ = [void 0], u = [], d = [], g = t.template;
- if (o === 0 && !kB(g))
- return br(t, n, e);
- const { factory: h } = e;
- if (fS(g))
- u.push(ene(h, g)), d.push(tne(h, g, i));
- else {
- u.push(ene(h, g.head)), d.push(tne(h, g.head, i));
- for (const T of g.templateSpans)
- u.push(ene(h, T.literal)), d.push(tne(h, T.literal, i)), _.push(E.checkDefined(Ge(T.expression, n, _t)));
- }
- const S = e.getEmitHelperFactory().createTemplateObjectHelper(
- h.createArrayLiteralExpression(u),
- h.createArrayLiteralExpression(d)
- );
- if (il(i)) {
- const T = h.createUniqueName("templateObject");
- s(T), _[0] = h.createLogicalOr(
- T,
- h.createAssignment(
- T,
- S
- )
- );
- } else
- _[0] = S;
- return h.createCallExpression(
- c,
- /*typeArguments*/
- void 0,
- _
- );
- }
- function ene(e, t) {
- return t.templateFlags & 26656 ? e.createVoidZero() : e.createStringLiteral(t.text);
- }
- function tne(e, t, n) {
- let i = t.rawText;
- if (i === void 0) {
- E.assertIsDefined(n, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."), i = gb(n, t);
- const s = t.kind === 15 || t.kind === 18;
- i = i.substring(1, i.length - (s ? 1 : 2));
- }
- return i = i.replace(/\r\n?/g, `
-`), lt(e.createStringLiteral(i), t);
- }
- function rne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- startLexicalEnvironment: i,
- resumeLexicalEnvironment: s,
- endLexicalEnvironment: o,
- hoistVariableDeclaration: c
- } = e, _ = e.getEmitResolver(), u = e.getCompilerOptions(), d = pa(u), g = Ru(u), h = !!u.experimentalDecorators, S = u.emitDecoratorMetadata ? ine(e) : void 0, T = e.onEmitNode, C = e.onSubstituteNode;
- e.onEmitNode = Zc, e.onSubstituteNode = Yi, e.enableSubstitution(
- 211
- /* PropertyAccessExpression */
- ), e.enableSubstitution(
- 212
- /* ElementAccessExpression */
- );
- let D, P, I, F, O, B, z;
- return X;
- function X(ge) {
- return ge.kind === 308 ? q(ge) : V(ge);
- }
- function q(ge) {
- return t.createBundle(
- ge.sourceFiles.map(V)
- );
- }
- function V(ge) {
- if (ge.isDeclarationFile)
- return ge;
- D = ge;
- const $ = ae(ge, fe);
- return Ih($, e.readEmitHelpers()), D = void 0, $;
- }
- function ae(ge, $) {
- const rt = F, Ct = O;
- ee(ge);
- const $t = $(ge);
- return F !== rt && (O = Ct), F = rt, $t;
- }
- function ee(ge) {
- switch (ge.kind) {
- case 307:
- case 269:
- case 268:
- case 241:
- F = ge, O = void 0;
- break;
- case 263:
- case 262:
- if (Gn(
- ge,
- 128
- /* Ambient */
- ))
- break;
- ge.name ? U(ge) : E.assert(ge.kind === 263 || Gn(
- ge,
- 2048
- /* Default */
- ));
- break;
- }
- }
- function G(ge) {
- return ae(ge, ue);
- }
- function ue(ge) {
- return ge.transformFlags & 1 ? we(ge) : ge;
- }
- function re(ge) {
- return ae(ge, ne);
- }
- function ne(ge) {
- switch (ge.kind) {
- case 272:
- case 271:
- case 277:
- case 278:
- return Se(ge);
- default:
- return ue(ge);
- }
- }
- function ie(ge) {
- const $ = fs(ge);
- if ($ === ge || wo(ge))
- return !1;
- if (!$ || $.kind !== ge.kind)
- return !0;
- switch (ge.kind) {
- case 272:
- if (E.assertNode($, ic), ge.importClause !== $.importClause || ge.attributes !== $.attributes)
- return !0;
- break;
- case 271:
- if (E.assertNode($, gl), ge.name !== $.name || ge.isTypeOnly !== $.isTypeOnly || ge.moduleReference !== $.moduleReference && (l_(ge.moduleReference) || l_($.moduleReference)))
- return !0;
- break;
- case 278:
- if (E.assertNode($, Nc), ge.exportClause !== $.exportClause || ge.attributes !== $.attributes)
- return !0;
- break;
- }
- return !1;
- }
- function Se(ge) {
- if (ie(ge))
- return ge.transformFlags & 1 ? br(ge, G, e) : ge;
- switch (ge.kind) {
- case 272:
- return Dr(ge);
- case 271:
- return mr(ge);
- case 277:
- return ot(ge);
- case 278:
- return wt(ge);
- default:
- E.fail("Unhandled ellided statement");
- }
- }
- function J(ge) {
- return ae(ge, oe);
- }
- function oe(ge) {
- if (!(ge.kind === 278 || ge.kind === 272 || ge.kind === 273 || ge.kind === 271 && ge.moduleReference.kind === 283))
- return ge.transformFlags & 1 || Gn(
- ge,
- 32
- /* Export */
- ) ? we(ge) : ge;
- }
- function _e(ge) {
- return ($) => ae($, (rt) => he(rt, ge));
- }
- function he(ge, $) {
- switch (ge.kind) {
- case 176:
- return Fe(ge);
- case 172:
- return ji(ge, $);
- case 177:
- return Oi(ge, $);
- case 178:
- return Ws(ge, $);
- case 174:
- return ti(ge, $);
- case 175:
- return br(ge, G, e);
- case 240:
- return ge;
- case 181:
- return;
- default:
- return E.failBadSyntaxKind(ge);
- }
- }
- function le(ge) {
- return ($) => ae($, (rt) => me(rt, ge));
- }
- function me(ge, $) {
- switch (ge.kind) {
- case 303:
- case 304:
- case 305:
- return G(ge);
- case 177:
- return Oi(ge, $);
- case 178:
- return Ws(ge, $);
- case 174:
- return ti(ge, $);
- default:
- return E.failBadSyntaxKind(ge);
- }
- }
- function ve(ge) {
- return dl(ge) ? void 0 : G(ge);
- }
- function tt(ge) {
- return ra(ge) ? void 0 : G(ge);
- }
- function Te(ge) {
- if (!dl(ge) && !(cx(ge.kind) & 28895) && !(P && ge.kind === 95))
- return ge;
- }
- function we(ge) {
- if (bi(ge) && Gn(
- ge,
- 128
- /* Ambient */
- ))
- return t.createNotEmittedStatement(ge);
- switch (ge.kind) {
- case 95:
- case 90:
- return P ? void 0 : ge;
- case 125:
- case 123:
- case 124:
- case 128:
- case 164:
- case 87:
- case 138:
- case 148:
- case 103:
- case 147:
- case 188:
- case 189:
- case 190:
- case 191:
- case 187:
- case 182:
- case 168:
- case 133:
- case 159:
- case 136:
- case 154:
- case 150:
- case 146:
- case 116:
- case 155:
- case 185:
- case 184:
- case 186:
- case 183:
- case 192:
- case 193:
- case 194:
- case 196:
- case 197:
- case 198:
- case 199:
- case 200:
- case 201:
- case 181:
- return;
- case 265:
- return t.createNotEmittedStatement(ge);
- case 270:
- return;
- case 264:
- return t.createNotEmittedStatement(ge);
- case 263:
- return ft(ge);
- case 231:
- return Wt(ge);
- case 298:
- return ei(ge);
- case 233:
- return Ri(ge);
- case 210:
- return Me(ge);
- case 176:
- case 172:
- case 174:
- case 177:
- case 178:
- case 175:
- return E.fail("Class and object literal elements must be visited with their respective visitors");
- case 262:
- return Hs(ge);
- case 218:
- return rr(ge);
- case 219:
- return Ea(ge);
- case 169:
- return Xe(ge);
- case 217:
- return K(ge);
- case 216:
- case 234:
- return De(ge);
- case 238:
- return Ke(ge);
- case 213:
- return xe(ge);
- case 214:
- return at(ge);
- case 215:
- return $e(ge);
- case 235:
- return Ve(ge);
- case 266:
- return Zt(ge);
- case 243:
- return Tt(ge);
- case 260:
- return ze(ge);
- case 267:
- return Le(ge);
- case 271:
- return mr(ge);
- case 285:
- return bt(ge);
- case 286:
- return He(ge);
- default:
- return br(ge, G, e);
- }
- }
- function fe(ge) {
- const $ = cu(u, "alwaysStrict") && !(il(ge) && g >= 5) && !Rp(ge);
- return t.updateSourceFile(
- ge,
- Kz(
- ge.statements,
- re,
- e,
- /*start*/
- 0,
- $
- )
- );
- }
- function Me(ge) {
- return t.updateObjectLiteralExpression(
- ge,
- Fr(ge.properties, le(ge), kh)
- );
- }
- function Qe(ge) {
- let $ = 0;
- ut(oW(
- ge,
- /*requireInitializer*/
- !0,
- /*isStatic*/
- !0
- )) && ($ |= 1);
- const rt = _m(ge);
- return rt && Dc(rt.expression).kind !== 106 && ($ |= 64), v0(h, ge) && ($ |= 2), m4(h, ge) && ($ |= 4), Kt(ge) ? $ |= 8 : Ss(ge) ? $ |= 32 : Ft(ge) && ($ |= 16), $;
- }
- function et(ge) {
- return !!(ge.transformFlags & 8192);
- }
- function Re(ge) {
- return Ff(ge) || ut(ge.typeParameters) || ut(ge.heritageClauses, et) || ut(ge.members, et);
- }
- function ft(ge) {
- const $ = Qe(ge), rt = d <= 1 && !!($ & 7);
- if (!Re(ge) && !v0(h, ge) && !Kt(ge))
- return t.updateClassDeclaration(
- ge,
- Fr(ge.modifiers, Te, ra),
- ge.name,
- /*typeParameters*/
- void 0,
- Fr(ge.heritageClauses, G, ef),
- Fr(ge.members, _e(ge), _l)
- );
- rt && e.startLexicalEnvironment();
- const Ct = rt || $ & 8;
- let $t = Ct ? Fr(ge.modifiers, tt, Bo) : Fr(ge.modifiers, G, Bo);
- $ & 2 && ($t = Ir($t, ge));
- const $n = Ct && !ge.name || $ & 4 || $ & 1 ? ge.name ?? t.getGeneratedNameForNode(ge) : ge.name, ar = t.updateClassDeclaration(
- ge,
- $t,
- $n,
- /*typeParameters*/
- void 0,
- Fr(ge.heritageClauses, G, ef),
- _r(ge)
- );
- let An = ya(ge);
- $ & 1 && (An |= 64), an(ar, An);
- let ri;
- if (rt) {
- const Fi = [ar], za = JB(
- aa(D.text, ge.members.end),
- 20
- /* CloseBraceToken */
- ), Uo = t.getInternalName(ge), vc = t.createPartiallyEmittedExpression(Uo);
- zC(vc, za.end), an(
- vc,
- 3072
- /* NoComments */
- );
- const Oc = t.createReturnStatement(vc);
- q4(Oc, za.pos), an(
- Oc,
- 3840
- /* NoTokenSourceMaps */
- ), Fi.push(Oc), Mg(Fi, e.endLexicalEnvironment());
- const Fc = t.createImmediatelyInvokedArrowFunction(Fi);
- Q3(
- Fc,
- 1
- /* TypeScriptClassWrapper */
- );
- const Lo = t.createVariableDeclaration(
- t.getLocalName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !1
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Fc
- );
- kn(Lo, ge);
- const _c = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [Lo],
- 1
- /* Let */
- )
- );
- kn(_c, ge), nl(_c, ge), da(_c, wh(ge)), bu(_c), ri = _c;
- } else
- ri = ar;
- if (Ct) {
- if ($ & 8)
- return [
- ri,
- gs(ge)
- ];
- if ($ & 32)
- return [
- ri,
- t.createExportDefault(t.getLocalName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ))
- ];
- if ($ & 16)
- return [
- ri,
- t.createExternalModuleExport(t.getDeclarationName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ))
- ];
- }
- return ri;
- }
- function Wt(ge) {
- let $ = Fr(ge.modifiers, tt, Bo);
- return v0(h, ge) && ($ = Ir($, ge)), t.updateClassExpression(
- ge,
- $,
- ge.name,
- /*typeParameters*/
- void 0,
- Fr(ge.heritageClauses, G, ef),
- _r(ge)
- );
- }
- function _r(ge) {
- const $ = Fr(ge.members, _e(ge), _l);
- let rt;
- const Ct = Bg(ge), $t = Ct && Ln(Ct.parameters, (zr) => G_(zr, Ct));
- if ($t)
- for (const zr of $t) {
- const $n = t.createPropertyDeclaration(
- /*modifiers*/
- void 0,
- zr.name,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- );
- kn($n, zr), rt = wr(rt, $n);
- }
- return rt ? (rt = Fn(rt, $), lt(
- t.createNodeArray(rt),
- /*location*/
- ge.members
- )) : $;
- }
- function Ir(ge, $) {
- const rt = Nt($, $);
- if (ut(rt)) {
- const Ct = [];
- Fn(Ct, kR(ge, _A)), Fn(Ct, Ln(ge, dl)), Fn(Ct, rt), Fn(Ct, Ln(AX(ge, _A), ra)), ge = lt(t.createNodeArray(Ct), ge);
- }
- return ge;
- }
- function jr(ge, $, rt) {
- if (Zn(rt) && tB(h, $, rt)) {
- const Ct = Nt($, rt);
- if (ut(Ct)) {
- const $t = [];
- Fn($t, Ln(ge, dl)), Fn($t, Ct), Fn($t, Ln(ge, ra)), ge = lt(t.createNodeArray($t), ge);
- }
- }
- return ge;
- }
- function Nt(ge, $) {
- if (h)
- return Qt(ge, $);
- }
- function Qt(ge, $) {
- if (S) {
- let rt;
- if (Br(ge)) {
- const Ct = n().createMetadataHelper("design:type", S.serializeTypeOfNode({ currentLexicalScope: F, currentNameScope: $ }, ge, $));
- rt = wr(rt, t.createDecorator(Ct));
- }
- if (zn(ge)) {
- const Ct = n().createMetadataHelper("design:paramtypes", S.serializeParameterTypesOfNode({ currentLexicalScope: F, currentNameScope: $ }, ge, $));
- rt = wr(rt, t.createDecorator(Ct));
- }
- if (xr(ge)) {
- const Ct = n().createMetadataHelper("design:returntype", S.serializeReturnTypeOfNode({ currentLexicalScope: F, currentNameScope: $ }, ge));
- rt = wr(rt, t.createDecorator(Ct));
- }
- return rt;
- }
- }
- function Br(ge) {
- const $ = ge.kind;
- return $ === 174 || $ === 177 || $ === 178 || $ === 172;
- }
- function xr(ge) {
- return ge.kind === 174;
- }
- function zn(ge) {
- switch (ge.kind) {
- case 263:
- case 231:
- return Bg(ge) !== void 0;
- case 174:
- case 177:
- case 178:
- return !0;
- }
- return !1;
- }
- function ki(ge, $) {
- const rt = ge.name;
- return Di(rt) ? t.createIdentifier("") : ma(rt) ? rt.expression : Oe(rt) ? t.createStringLiteral(Nn(rt)) : t.cloneNode(rt);
- }
- function rs(ge) {
- const $ = ge.name;
- if (h && ma($) && Ff(ge)) {
- const rt = Ge($.expression, G, _t);
- E.assert(rt);
- const Ct = ud(rt);
- if (!fg(Ct)) {
- const $t = t.getGeneratedNameForNode($);
- return c($t), t.updateComputedPropertyName($, t.createAssignment($t, rt));
- }
- }
- return E.checkDefined(Ge($, G, Bc));
- }
- function ei(ge) {
- if (ge.token !== 119)
- return br(ge, G, e);
- }
- function Ri(ge) {
- return t.updateExpressionWithTypeArguments(
- ge,
- E.checkDefined(Ge(ge.expression, G, __)),
- /*typeArguments*/
- void 0
- );
- }
- function Jr(ge) {
- return !rc(ge.body);
- }
- function ji(ge, $) {
- const rt = ge.flags & 33554432 || Gn(
- ge,
- 64
- /* Abstract */
- );
- if (rt && !(h && Ff(ge)))
- return;
- let Ct = Zn($) ? rt ? Fr(ge.modifiers, tt, Bo) : Fr(ge.modifiers, G, Bo) : Fr(ge.modifiers, ve, Bo);
- return Ct = jr(Ct, ge, $), rt ? t.updatePropertyDeclaration(
- ge,
- Qi(Ct, t.createModifiersFromModifierFlags(
- 128
- /* Ambient */
- )),
- E.checkDefined(Ge(ge.name, G, Bc)),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ) : t.updatePropertyDeclaration(
- ge,
- Ct,
- rs(ge),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ge(ge.initializer, G, _t)
- );
- }
- function Fe(ge) {
- if (Jr(ge))
- return t.updateConstructorDeclaration(
- ge,
- /*modifiers*/
- void 0,
- cc(ge.parameters, G, e),
- Ar(ge.body, ge)
- );
- }
- function Ot(ge, $, rt, Ct, $t, zr) {
- const $n = Ct[$t], ar = $[$n];
- if (Fn(ge, Fr($, G, bi, rt, $n - rt)), gS(ar)) {
- const An = [];
- Ot(
- An,
- ar.tryBlock.statements,
- /*statementOffset*/
- 0,
- Ct,
- $t + 1,
- zr
- );
- const ri = t.createNodeArray(An);
- lt(ri, ar.tryBlock.statements), ge.push(t.updateTryStatement(
- ar,
- t.updateBlock(ar.tryBlock, An),
- Ge(ar.catchClause, G, Ub),
- Ge(ar.finallyBlock, G, Cs)
- ));
- } else
- Fn(ge, Fr($, G, bi, $n, 1)), Fn(ge, zr);
- Fn(ge, Fr($, G, bi, $n + 1));
- }
- function Ar(ge, $) {
- const rt = $ && Ln($.parameters, (An) => G_(An, $));
- if (!ut(rt))
- return Bf(ge, G, e);
- let Ct = [];
- s();
- const $t = t.copyPrologue(
- ge.statements,
- Ct,
- /*ensureUseStrict*/
- !1,
- G
- ), zr = GO(ge.statements, $t), $n = Ai(rt, mn);
- zr.length ? Ot(
- Ct,
- ge.statements,
- $t,
- zr,
- /*superPathDepth*/
- 0,
- $n
- ) : (Fn(Ct, $n), Fn(Ct, Fr(ge.statements, G, bi, $t))), Ct = t.mergeLexicalEnvironment(Ct, o());
- const ar = t.createBlock(
- lt(t.createNodeArray(Ct), ge.statements),
- /*multiLine*/
- !0
- );
- return lt(
- ar,
- /*location*/
- ge
- ), kn(ar, ge), ar;
- }
- function mn(ge) {
- const $ = ge.name;
- if (!Oe($))
- return;
- const rt = Aa(lt(t.cloneNode($), $), $.parent);
- an(
- rt,
- 3168
- /* NoSourceMap */
- );
- const Ct = Aa(lt(t.cloneNode($), $), $.parent);
- return an(
- Ct,
- 3072
- /* NoComments */
- ), bu(
- X3(
- lt(
- kn(
- t.createExpressionStatement(
- t.createAssignment(
- lt(
- t.createPropertyAccessExpression(
- t.createThis(),
- rt
- ),
- ge.name
- ),
- Ct
- )
- ),
- ge
- ),
- sv(ge, -1)
- )
- )
- );
- }
- function ti(ge, $) {
- if (!(ge.transformFlags & 1))
- return ge;
- if (!Jr(ge))
- return;
- let rt = Zn($) ? Fr(ge.modifiers, G, Bo) : Fr(ge.modifiers, ve, Bo);
- return rt = jr(rt, ge, $), t.updateMethodDeclaration(
- ge,
- rt,
- ge.asteriskToken,
- rs(ge),
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- cc(ge.parameters, G, e),
- /*type*/
- void 0,
- Bf(ge.body, G, e)
- );
- }
- function qn(ge) {
- return !(rc(ge.body) && Gn(
- ge,
- 64
- /* Abstract */
- ));
- }
- function Oi(ge, $) {
- if (!(ge.transformFlags & 1))
- return ge;
- if (!qn(ge))
- return;
- let rt = Zn($) ? Fr(ge.modifiers, G, Bo) : Fr(ge.modifiers, ve, Bo);
- return rt = jr(rt, ge, $), t.updateGetAccessorDeclaration(
- ge,
- rt,
- rs(ge),
- cc(ge.parameters, G, e),
- /*type*/
- void 0,
- Bf(ge.body, G, e) || t.createBlock([])
- );
- }
- function Ws(ge, $) {
- if (!(ge.transformFlags & 1))
- return ge;
- if (!qn(ge))
- return;
- let rt = Zn($) ? Fr(ge.modifiers, G, Bo) : Fr(ge.modifiers, ve, Bo);
- return rt = jr(rt, ge, $), t.updateSetAccessorDeclaration(
- ge,
- rt,
- rs(ge),
- cc(ge.parameters, G, e),
- Bf(ge.body, G, e) || t.createBlock([])
- );
- }
- function Hs(ge) {
- if (!Jr(ge))
- return t.createNotEmittedStatement(ge);
- const $ = t.updateFunctionDeclaration(
- ge,
- Fr(ge.modifiers, Te, ra),
- ge.asteriskToken,
- ge.name,
- /*typeParameters*/
- void 0,
- cc(ge.parameters, G, e),
- /*type*/
- void 0,
- Bf(ge.body, G, e) || t.createBlock([])
- );
- if (Kt(ge)) {
- const rt = [$];
- return Ts(rt, ge), rt;
- }
- return $;
- }
- function rr(ge) {
- return Jr(ge) ? t.updateFunctionExpression(
- ge,
- Fr(ge.modifiers, Te, ra),
- ge.asteriskToken,
- ge.name,
- /*typeParameters*/
- void 0,
- cc(ge.parameters, G, e),
- /*type*/
- void 0,
- Bf(ge.body, G, e) || t.createBlock([])
- ) : t.createOmittedExpression();
- }
- function Ea(ge) {
- return t.updateArrowFunction(
- ge,
- Fr(ge.modifiers, Te, ra),
- /*typeParameters*/
- void 0,
- cc(ge.parameters, G, e),
- /*type*/
- void 0,
- ge.equalsGreaterThanToken,
- Bf(ge.body, G, e)
- );
- }
- function Xe(ge) {
- if (Db(ge))
- return;
- const $ = t.updateParameterDeclaration(
- ge,
- Fr(ge.modifiers, (rt) => dl(rt) ? G(rt) : void 0, Bo),
- ge.dotDotDotToken,
- E.checkDefined(Ge(ge.name, G, Y2)),
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- Ge(ge.initializer, G, _t)
- );
- return $ !== ge && (nl($, ge), lt($, gm(ge)), da($, gm(ge)), an(
- $.name,
- 64
- /* NoTrailingSourceMap */
- )), $;
- }
- function Tt(ge) {
- if (Kt(ge)) {
- const $ = F4(ge.declarationList);
- return $.length === 0 ? void 0 : lt(
- t.createExpressionStatement(
- t.inlineExpressions(
- lr($, te)
- )
- ),
- ge
- );
- } else
- return br(ge, G, e);
- }
- function te(ge) {
- const $ = ge.name;
- return As($) ? DS(
- ge,
- G,
- e,
- 0,
- /*needsValue*/
- !1,
- lc
- ) : lt(
- t.createAssignment(
- Ic($),
- E.checkDefined(Ge(ge.initializer, G, _t))
- ),
- /*location*/
- ge
- );
- }
- function ze(ge) {
- const $ = t.updateVariableDeclaration(
- ge,
- E.checkDefined(Ge(ge.name, G, Y2)),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ge(ge.initializer, G, _t)
- );
- return ge.type && wee($.name, ge.type), $;
- }
- function K(ge) {
- const $ = Dc(ge.expression, -23);
- if ($1($) || Y5($)) {
- const rt = Ge(ge.expression, G, _t);
- return E.assert(rt), t.createPartiallyEmittedExpression(rt, ge);
- }
- return br(ge, G, e);
- }
- function De(ge) {
- const $ = Ge(ge.expression, G, _t);
- return E.assert($), t.createPartiallyEmittedExpression($, ge);
- }
- function Ve(ge) {
- const $ = Ge(ge.expression, G, __);
- return E.assert($), t.createPartiallyEmittedExpression($, ge);
- }
- function Ke(ge) {
- const $ = Ge(ge.expression, G, _t);
- return E.assert($), t.createPartiallyEmittedExpression($, ge);
- }
- function xe(ge) {
- return t.updateCallExpression(
- ge,
- E.checkDefined(Ge(ge.expression, G, _t)),
- /*typeArguments*/
- void 0,
- Fr(ge.arguments, G, _t)
- );
- }
- function at(ge) {
- return t.updateNewExpression(
- ge,
- E.checkDefined(Ge(ge.expression, G, _t)),
- /*typeArguments*/
- void 0,
- Fr(ge.arguments, G, _t)
- );
- }
- function $e(ge) {
- return t.updateTaggedTemplateExpression(
- ge,
- E.checkDefined(Ge(ge.tag, G, _t)),
- /*typeArguments*/
- void 0,
- E.checkDefined(Ge(ge.template, G, VT))
- );
- }
- function bt(ge) {
- return t.updateJsxSelfClosingElement(
- ge,
- E.checkDefined(Ge(ge.tagName, G, c4)),
- /*typeArguments*/
- void 0,
- E.checkDefined(Ge(ge.attributes, G, Wb))
- );
- }
- function He(ge) {
- return t.updateJsxOpeningElement(
- ge,
- E.checkDefined(Ge(ge.tagName, G, c4)),
- /*typeArguments*/
- void 0,
- E.checkDefined(Ge(ge.attributes, G, Wb))
- );
- }
- function Vt(ge) {
- return !Y1(ge) || jy(u);
- }
- function Zt(ge) {
- if (!Vt(ge))
- return t.createNotEmittedStatement(ge);
- const $ = [];
- let rt = 4;
- const Ct = ht($, ge);
- Ct && (g !== 4 || F !== D) && (rt |= 1024);
- const $t = io(ge), zr = vi(ge), $n = Kt(ge) ? t.getExternalModuleOrNamespaceExportName(
- I,
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ) : t.getDeclarationName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- );
- let ar = t.createLogicalOr(
- $n,
- t.createAssignment(
- $n,
- t.createObjectLiteralExpression()
- )
- );
- if (Kt(ge)) {
- const ri = t.getLocalName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- );
- ar = t.createAssignment(ri, ar);
- }
- const An = t.createExpressionStatement(
- t.createCallExpression(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- $t
- )],
- /*type*/
- void 0,
- vn(ge, zr)
- ),
- /*typeArguments*/
- void 0,
- [ar]
- )
- );
- return kn(An, ge), Ct && (ov(An, void 0), Sx(An, void 0)), lt(An, ge), hm(An, rt), $.push(An), $;
- }
- function vn(ge, $) {
- const rt = I;
- I = $;
- const Ct = [];
- i();
- const $t = lr(ge.members, M);
- return Mg(Ct, o()), Fn(Ct, $t), I = rt, t.createBlock(
- lt(
- t.createNodeArray(Ct),
- /*location*/
- ge.members
- ),
- /*multiLine*/
- !0
- );
- }
- function M(ge) {
- const $ = ki(
- ge
- ), rt = _.getEnumMemberValue(ge), Ct = Ae(ge, rt?.value), $t = t.createAssignment(
- t.createElementAccessExpression(
- I,
- $
- ),
- Ct
- ), zr = typeof rt?.value == "string" || rt?.isSyntacticallyString ? $t : t.createAssignment(
- t.createElementAccessExpression(
- I,
- $t
- ),
- $
- );
- return lt(
- t.createExpressionStatement(
- lt(
- zr,
- ge
- )
- ),
- ge
- );
- }
- function Ae(ge, $) {
- return $ !== void 0 ? typeof $ == "string" ? t.createStringLiteral($) : $ < 0 ? t.createPrefixUnaryExpression(41, t.createNumericLiteral(-$)) : t.createNumericLiteral($) : (ca(), ge.initializer ? E.checkDefined(Ge(ge.initializer, G, _t)) : t.createVoidZero());
- }
- function dt(ge) {
- const $ = fs(ge, zc);
- return $ ? Zz($, jy(u)) : !0;
- }
- function U(ge) {
- O || (O = /* @__PURE__ */ new Map());
- const $ = Z(ge);
- O.has($) || O.set($, ge);
- }
- function be(ge) {
- if (O) {
- const $ = Z(ge);
- return O.get($) === ge;
- }
- return !0;
- }
- function Z(ge) {
- return E.assertNode(ge.name, Oe), ge.name.escapedText;
- }
- function ht(ge, $) {
- const rt = t.createVariableDeclaration(t.getLocalName(
- $,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- )), Ct = F.kind === 307 ? 0 : 1, $t = t.createVariableStatement(
- Fr($.modifiers, Te, ra),
- t.createVariableDeclarationList([rt], Ct)
- );
- return kn(rt, $), ov(rt, void 0), Sx(rt, void 0), kn($t, $), U($), be($) ? ($.kind === 266 ? da($t.declarationList, $) : da($t, $), nl($t, $), hm(
- $t,
- 2048
- /* NoTrailingComments */
- ), ge.push($t), !0) : !1;
- }
- function Le(ge) {
- if (!dt(ge))
- return t.createNotEmittedStatement(ge);
- E.assertNode(ge.name, Oe, "A TypeScript namespace should have an Identifier name."), Ll();
- const $ = [];
- let rt = 4;
- const Ct = ht($, ge);
- Ct && (g !== 4 || F !== D) && (rt |= 1024);
- const $t = io(ge), zr = vi(ge), $n = Kt(ge) ? t.getExternalModuleOrNamespaceExportName(
- I,
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ) : t.getDeclarationName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- );
- let ar = t.createLogicalOr(
- $n,
- t.createAssignment(
- $n,
- t.createObjectLiteralExpression()
- )
- );
- if (Kt(ge)) {
- const ri = t.getLocalName(
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- );
- ar = t.createAssignment(ri, ar);
- }
- const An = t.createExpressionStatement(
- t.createCallExpression(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- $t
- )],
- /*type*/
- void 0,
- Ie(ge, zr)
- ),
- /*typeArguments*/
- void 0,
- [ar]
- )
- );
- return kn(An, ge), Ct && (ov(An, void 0), Sx(An, void 0)), lt(An, ge), hm(An, rt), $.push(An), $;
- }
- function Ie(ge, $) {
- const rt = I, Ct = P, $t = O;
- I = $, P = ge, O = void 0;
- const zr = [];
- i();
- let $n, ar;
- if (ge.body)
- if (ge.body.kind === 268)
- ae(ge.body, (ri) => Fn(zr, Fr(ri.statements, J, bi))), $n = ge.body.statements, ar = ge.body;
- else {
- const ri = Le(ge.body);
- ri && (us(ri) ? Fn(zr, ri) : zr.push(ri));
- const Fi = At(ge).body;
- $n = sv(Fi.statements, -1);
- }
- Mg(zr, o()), I = rt, P = Ct, O = $t;
- const An = t.createBlock(
- lt(
- t.createNodeArray(zr),
- /*location*/
- $n
- ),
- /*multiLine*/
- !0
- );
- return lt(An, ar), (!ge.body || ge.body.kind !== 268) && an(
- An,
- ya(An) | 3072
- /* NoComments */
- ), An;
- }
- function At(ge) {
- if (ge.body.kind === 267)
- return At(ge.body) || ge.body;
- }
- function Dr(ge) {
- if (!ge.importClause)
- return ge;
- if (ge.importClause.isTypeOnly)
- return;
- const $ = Ge(ge.importClause, yr, Ad);
- return $ ? t.updateImportDeclaration(
- ge,
- /*modifiers*/
- void 0,
- $,
- ge.moduleSpecifier,
- ge.attributes
- ) : void 0;
- }
- function yr(ge) {
- E.assert(!ge.isTypeOnly);
- const $ = Ao(ge) ? ge.name : void 0, rt = Ge(ge.namedBindings, $r, Pj);
- return $ || rt ? t.updateImportClause(
- ge,
- /*isTypeOnly*/
- !1,
- $,
- rt
- ) : void 0;
- }
- function $r(ge) {
- if (ge.kind === 274)
- return Ao(ge) ? ge : void 0;
- {
- const $ = u.verbatimModuleSyntax, rt = Fr(ge.elements, nt, Zu);
- return $ || ut(rt) ? t.updateNamedImports(ge, rt) : void 0;
- }
- }
- function nt(ge) {
- return !ge.isTypeOnly && Ao(ge) ? ge : void 0;
- }
- function ot(ge) {
- return u.verbatimModuleSyntax || _.isValueAliasDeclaration(ge) ? br(ge, G, e) : void 0;
- }
- function wt(ge) {
- if (ge.isTypeOnly)
- return;
- if (!ge.exportClause || ug(ge.exportClause))
- return ge;
- const $ = !!u.verbatimModuleSyntax, rt = Ge(
- ge.exportClause,
- (Ct) => Ht(Ct, $),
- hj
- );
- return rt ? t.updateExportDeclaration(
- ge,
- /*modifiers*/
- void 0,
- ge.isTypeOnly,
- rt,
- ge.moduleSpecifier,
- ge.attributes
- ) : void 0;
- }
- function jt(ge, $) {
- const rt = Fr(ge.elements, en, vu);
- return $ || ut(rt) ? t.updateNamedExports(ge, rt) : void 0;
- }
- function Xt(ge) {
- return t.updateNamespaceExport(ge, E.checkDefined(Ge(ge.name, G, Oe)));
- }
- function Ht(ge, $) {
- return ug(ge) ? Xt(ge) : jt(ge, $);
- }
- function en(ge) {
- return !ge.isTypeOnly && (u.verbatimModuleSyntax || _.isValueAliasDeclaration(ge)) ? ge : void 0;
- }
- function zt(ge) {
- return Ao(ge) || !il(D) && _.isTopLevelValueImportEqualsWithEntityName(ge);
- }
- function mr(ge) {
- if (ge.isTypeOnly)
- return;
- if (Z1(ge))
- return Ao(ge) ? br(ge, G, e) : void 0;
- if (!zt(ge))
- return;
- const $ = oA(t, ge.moduleReference);
- return an(
- $,
- 7168
- /* NoNestedComments */
- ), Ft(ge) || !Kt(ge) ? kn(
- lt(
- t.createVariableStatement(
- Fr(ge.modifiers, Te, ra),
- t.createVariableDeclarationList([
- kn(
- t.createVariableDeclaration(
- ge.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- $
- ),
- ge
- )
- ])
- ),
- ge
- ),
- ge
- ) : kn(
- Ua(
- ge.name,
- $,
- ge
- ),
- ge
- );
- }
- function Kt(ge) {
- return P !== void 0 && Gn(
- ge,
- 32
- /* Export */
- );
- }
- function hr(ge) {
- return P === void 0 && Gn(
- ge,
- 32
- /* Export */
- );
- }
- function Ft(ge) {
- return hr(ge) && !Gn(
- ge,
- 2048
- /* Default */
- );
- }
- function Ss(ge) {
- return hr(ge) && Gn(
- ge,
- 2048
- /* Default */
- );
- }
- function gs(ge) {
- const $ = t.createAssignment(
- t.getExternalModuleOrNamespaceExportName(
- I,
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ),
- t.getLocalName(ge)
- );
- da($, op(ge.name ? ge.name.pos : ge.pos, ge.end));
- const rt = t.createExpressionStatement($);
- return da(rt, op(-1, ge.end)), rt;
- }
- function Ts(ge, $) {
- ge.push(gs($));
- }
- function Ua(ge, $, rt) {
- return lt(
- t.createExpressionStatement(
- t.createAssignment(
- t.getNamespaceMemberName(
- I,
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ),
- $
- )
- ),
- rt
- );
- }
- function lc(ge, $, rt) {
- return lt(t.createAssignment(Ic(ge), $), rt);
- }
- function Ic(ge) {
- return t.getNamespaceMemberName(
- I,
- ge,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- );
- }
- function io(ge) {
- const $ = t.getGeneratedNameForNode(ge);
- return da($, ge.name), $;
- }
- function vi(ge) {
- return t.getGeneratedNameForNode(ge);
- }
- function ca() {
- B & 8 || (B |= 8, e.enableSubstitution(
- 80
- /* Identifier */
- ));
- }
- function Ll() {
- B & 2 || (B |= 2, e.enableSubstitution(
- 80
- /* Identifier */
- ), e.enableSubstitution(
- 304
- /* ShorthandPropertyAssignment */
- ), e.enableEmitNotification(
- 267
- /* ModuleDeclaration */
- ));
- }
- function xs(ge) {
- return Ho(ge).kind === 267;
- }
- function Cu(ge) {
- return Ho(ge).kind === 266;
- }
- function Zc(ge, $, rt) {
- const Ct = z, $t = D;
- Si($) && (D = $), B & 2 && xs($) && (z |= 2), B & 8 && Cu($) && (z |= 8), T(ge, $, rt), z = Ct, D = $t;
- }
- function Yi(ge, $) {
- return $ = C(ge, $), ge === 1 ? Ia($) : uu($) ? Na($) : $;
- }
- function Na(ge) {
- if (B & 2) {
- const $ = ge.name, rt = ba($);
- if (rt) {
- if (ge.objectAssignmentInitializer) {
- const Ct = t.createAssignment(rt, ge.objectAssignmentInitializer);
- return lt(t.createPropertyAssignment($, Ct), ge);
- }
- return lt(t.createPropertyAssignment($, rt), ge);
- }
- }
- return ge;
- }
- function Ia(ge) {
- switch (ge.kind) {
- case 80:
- return Vi(ge);
- case 211:
- return Bt(ge);
- case 212:
- return to(ge);
- }
- return ge;
- }
- function Vi(ge) {
- return ba(ge) || ge;
- }
- function ba(ge) {
- if (B & z && !jo(ge) && !Mh(ge)) {
- const $ = _.getReferencedExportContainer(
- ge,
- /*prefixLocals*/
- !1
- );
- if ($ && $.kind !== 307 && (z & 2 && $.kind === 267 || z & 8 && $.kind === 266))
- return lt(
- t.createPropertyAccessExpression(t.getGeneratedNameForNode($), ge),
- /*location*/
- ge
- );
- }
- }
- function Bt(ge) {
- return Wc(ge);
- }
- function to(ge) {
- return Wc(ge);
- }
- function _u(ge) {
- return ge.replace(/\*\//g, "*_/");
- }
- function Wc(ge) {
- const $ = of(ge);
- if ($ !== void 0) {
- Dee(ge, $);
- const rt = typeof $ == "string" ? t.createStringLiteral($) : $ < 0 ? t.createPrefixUnaryExpression(41, t.createNumericLiteral(-$)) : t.createNumericLiteral($);
- if (!u.removeComments) {
- const Ct = Ho(ge, xo);
- j5(rt, 3, ` ${_u(nc(Ct))} `);
- }
- return rt;
- }
- return ge;
- }
- function of(ge) {
- if (!Wp(u))
- return Cn(ge) || ko(ge) ? _.getConstantValue(ge) : void 0;
- }
- function Ao(ge) {
- return u.verbatimModuleSyntax || cn(ge) || _.isReferencedAliasDeclaration(ge);
- }
- }
- function nne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- hoistVariableDeclaration: i,
- endLexicalEnvironment: s,
- startLexicalEnvironment: o,
- resumeLexicalEnvironment: c,
- addBlockScopedVariable: _
- } = e, u = e.getEmitResolver(), d = e.getCompilerOptions(), g = pa(d), h = R3(d), S = !!d.experimentalDecorators, T = !h, C = h && g < 9, D = T || C, P = g < 9, I = g < 99 ? -1 : h ? 0 : 3, F = g < 9, O = F && g >= 2, B = D || P || I === -1, z = e.onSubstituteNode;
- e.onSubstituteNode = _u;
- const X = e.onEmitNode;
- e.onEmitNode = to;
- let q = !1, V, ae, ee, G, ue;
- const re = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Set();
- let ie, Se, J = !1, oe = !1;
- return Fd(e, _e);
- function _e($) {
- if ($.isDeclarationFile || (ue = void 0, q = !!(_d($) & 32), !B && !q))
- return $;
- const rt = br($, le, e);
- return Ih(rt, e.readEmitHelpers()), rt;
- }
- function he($) {
- switch ($.kind) {
- case 129:
- return Ot() ? void 0 : $;
- default:
- return Wn($, ra);
- }
- }
- function le($) {
- if (!($.transformFlags & 16777216) && !($.transformFlags & 134234112))
- return $;
- switch ($.kind) {
- case 263:
- return Zt($);
- case 231:
- return M($);
- case 175:
- case 172:
- return E.fail("Use `classElementVisitor` instead.");
- case 303:
- return Re($);
- case 243:
- return ft($);
- case 260:
- return Wt($);
- case 169:
- return _r($);
- case 208:
- return Ir($);
- case 277:
- return jr($);
- case 81:
- return Qe($);
- case 211:
- return Ws($);
- case 212:
- return Hs($);
- case 224:
- case 225:
- return rr(
- $,
- /*discarded*/
- !1
- );
- case 226:
- return Ve(
- $,
- /*discarded*/
- !1
- );
- case 217:
- return xe(
- $,
- /*discarded*/
- !1
- );
- case 213:
- return te($);
- case 244:
- return Xe($);
- case 215:
- return ze($);
- case 248:
- return Ea($);
- case 110:
- return U($);
- case 262:
- case 218:
- return ki(
- /*classElement*/
- void 0,
- me,
- $
- );
- case 176:
- case 174:
- case 177:
- case 178:
- return ki(
- $,
- me,
- $
- );
- default:
- return me($);
- }
- }
- function me($) {
- return br($, le, e);
- }
- function ve($) {
- switch ($.kind) {
- case 224:
- case 225:
- return rr(
- $,
- /*discarded*/
- !0
- );
- case 226:
- return Ve(
- $,
- /*discarded*/
- !0
- );
- case 355:
- return Ke(
- $
- );
- case 217:
- return xe(
- $,
- /*discarded*/
- !0
- );
- default:
- return le($);
- }
- }
- function tt($) {
- switch ($.kind) {
- case 298:
- return br($, tt, e);
- case 233:
- return He($);
- default:
- return le($);
- }
- }
- function Te($) {
- switch ($.kind) {
- case 210:
- case 209:
- return Bt($);
- default:
- return le($);
- }
- }
- function we($) {
- switch ($.kind) {
- case 176:
- return ki(
- $,
- Br,
- $
- );
- case 177:
- case 178:
- case 174:
- return ki(
- $,
- zn,
- $
- );
- case 172:
- return ki(
- $,
- Ar,
- $
- );
- case 175:
- return ki(
- $,
- dt,
- $
- );
- case 167:
- return Qt($);
- case 240:
- return $;
- default:
- return Bo($) ? he($) : le($);
- }
- }
- function fe($) {
- switch ($.kind) {
- case 167:
- return Qt($);
- default:
- return le($);
- }
- }
- function Me($) {
- switch ($.kind) {
- case 172:
- return Fe($);
- case 177:
- case 178:
- return we($);
- default:
- E.assertMissingNode($, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");
- break;
- }
- }
- function Qe($) {
- return !P || bi($.parent) ? $ : kn(t.createIdentifier(""), $);
- }
- function et($) {
- const rt = ca($.left);
- if (rt) {
- const Ct = Ge($.right, le, _t);
- return kn(
- n().createClassPrivateFieldInHelper(rt.brandCheckIdentifier, Ct),
- $
- );
- }
- return br($, le, e);
- }
- function Re($) {
- return Q_($, De) && ($ = tf(e, $)), br($, le, e);
- }
- function ft($) {
- const rt = G;
- G = [];
- const Ct = br($, le, e), $t = ut(G) ? [Ct, ...G] : Ct;
- return G = rt, $t;
- }
- function Wt($) {
- return Q_($, De) && ($ = tf(e, $)), br($, le, e);
- }
- function _r($) {
- return Q_($, De) && ($ = tf(e, $)), br($, le, e);
- }
- function Ir($) {
- return Q_($, De) && ($ = tf(e, $)), br($, le, e);
- }
- function jr($) {
- return Q_($, De) && ($ = tf(
- e,
- $,
- /*ignoreEmptyStringLiteral*/
- !0,
- $.isExportEquals ? "" : "default"
- )), br($, le, e);
- }
- function Nt($) {
- return ut(ee) && (Yu($) ? (ee.push($.expression), $ = t.updateParenthesizedExpression($, t.inlineExpressions(ee))) : (ee.push($), $ = t.inlineExpressions(ee)), ee = void 0), $;
- }
- function Qt($) {
- const rt = Ge($.expression, le, _t);
- return t.updateComputedPropertyName($, Nt(rt));
- }
- function Br($) {
- return ie ? ht($, ie) : me($);
- }
- function xr($) {
- return !!(P || tl($) && _d($) & 32);
- }
- function zn($) {
- if (E.assert(!Ff($)), !Ou($) || !xr($))
- return br($, we, e);
- const rt = ca($.name);
- if (E.assert(rt, "Undeclared private name for property declaration."), !rt.isValid)
- return $;
- const Ct = rs($);
- Ct && hr().push(
- t.createAssignment(
- Ct,
- t.createFunctionExpression(
- Ln($.modifiers, ($t) => ra($t) && !Ex($t) && !Vee($t)),
- $.asteriskToken,
- Ct,
- /*typeParameters*/
- void 0,
- cc($.parameters, le, e),
- /*type*/
- void 0,
- Bf($.body, le, e)
- )
- )
- );
- }
- function ki($, rt, Ct) {
- if ($ !== Se) {
- const $t = Se;
- Se = $;
- const zr = rt(Ct);
- return Se = $t, zr;
- }
- return rt(Ct);
- }
- function rs($) {
- E.assert(Di($.name));
- const rt = ca($.name);
- if (E.assert(rt, "Undeclared private name for property declaration."), rt.kind === "m")
- return rt.methodName;
- if (rt.kind === "a") {
- if (d0($))
- return rt.getterName;
- if (om($))
- return rt.setterName;
- }
- }
- function ei() {
- const $ = mr();
- return $.classThis ?? $.classConstructor ?? ie?.name;
- }
- function Ri($) {
- const rt = ym($), Ct = E0($), $t = $.name;
- let zr = $t, $n = $t;
- if (ma($t) && !fg($t.expression)) {
- const vc = pO($t);
- if (vc)
- zr = t.updateComputedPropertyName($t, Ge($t.expression, le, _t)), $n = t.updateComputedPropertyName($t, vc.left);
- else {
- const Oc = t.createTempVariable(i);
- da(Oc, $t.expression);
- const Fc = Ge($t.expression, le, _t), Lo = t.createAssignment(Oc, Fc);
- da(Lo, $t.expression), zr = t.updateComputedPropertyName($t, Lo), $n = t.updateComputedPropertyName($t, Oc);
- }
- }
- const ar = Fr($.modifiers, he, ra), An = az(t, $, ar, $.initializer);
- kn(An, $), an(
- An,
- 3072
- /* NoComments */
- ), da(An, Ct);
- const ri = zs($) ? ei() ?? t.createThis() : t.createThis(), Fi = Ete(t, $, ar, zr, ri);
- kn(Fi, $), nl(Fi, rt), da(Fi, Ct);
- const za = t.createModifiersFromModifierFlags(mm(ar)), Uo = Dte(t, $, za, $n, ri);
- return kn(Uo, $), an(
- Uo,
- 3072
- /* NoComments */
- ), da(Uo, Ct), wA([An, Fi, Uo], Me, _l);
- }
- function Jr($) {
- if (xr($)) {
- const rt = ca($.name);
- if (E.assert(rt, "Undeclared private name for property declaration."), !rt.isValid)
- return $;
- if (rt.isStatic && !P) {
- const Ct = Dr($, t.createThis());
- if (Ct)
- return t.createClassStaticBlockDeclaration(t.createBlock(
- [Ct],
- /*multiLine*/
- !0
- ));
- }
- return;
- }
- return T && !zs($) && ue?.data && ue.data.facts & 16 ? t.updatePropertyDeclaration(
- $,
- Fr($.modifiers, le, Bo),
- $.name,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ) : (Q_($, De) && ($ = tf(e, $)), t.updatePropertyDeclaration(
- $,
- Fr($.modifiers, he, ra),
- Ge($.name, fe, Bc),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ge($.initializer, le, _t)
- ));
- }
- function ji($) {
- if (D && !u_($)) {
- const rt = Ht(
- $.name,
- /*shouldHoist*/
- !!$.initializer || h
- );
- if (rt && hr().push(...Pte(rt)), zs($) && !P) {
- const Ct = Dr($, t.createThis());
- if (Ct) {
- const $t = t.createClassStaticBlockDeclaration(
- t.createBlock([Ct])
- );
- return kn($t, $), nl($t, $), nl(Ct, { pos: -1, end: -1 }), ov(Ct, void 0), Sx(Ct, void 0), $t;
- }
- }
- return;
- }
- return t.updatePropertyDeclaration(
- $,
- Fr($.modifiers, he, ra),
- Ge($.name, fe, Bc),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ge($.initializer, le, _t)
- );
- }
- function Fe($) {
- return E.assert(!Ff($), "Decorators should already have been transformed and elided."), Ou($) ? Jr($) : ji($);
- }
- function Ot() {
- return I === -1 || I === 3 && !!ue?.data && !!(ue.data.facts & 16);
- }
- function Ar($) {
- return u_($) && (Ot() || tl($) && _d($) & 32) ? Ri($) : Fe($);
- }
- function mn() {
- return !!Se && tl(Se) && Ay(Se) && u_(Ho(Se));
- }
- function ti($) {
- if (mn()) {
- const rt = Dc($);
- rt.kind === 110 && ne.add(rt);
- }
- }
- function qn($, rt) {
- return rt = Ge(rt, le, _t), ti(rt), Oi($, rt);
- }
- function Oi($, rt) {
- switch (nl(rt, sv(rt, -1)), $.kind) {
- case "a":
- return n().createClassPrivateFieldGetHelper(
- rt,
- $.brandCheckIdentifier,
- $.kind,
- $.getterName
- );
- case "m":
- return n().createClassPrivateFieldGetHelper(
- rt,
- $.brandCheckIdentifier,
- $.kind,
- $.methodName
- );
- case "f":
- return n().createClassPrivateFieldGetHelper(
- rt,
- $.brandCheckIdentifier,
- $.kind,
- $.isStatic ? $.variableName : void 0
- );
- case "untransformed":
- return E.fail("Access helpers should not be created for untransformed private elements");
- default:
- E.assertNever($, "Unknown private element type");
- }
- }
- function Ws($) {
- if (Di($.name)) {
- const rt = ca($.name);
- if (rt)
- return lt(
- kn(
- qn(rt, $.expression),
- $
- ),
- $
- );
- }
- if (O && Se && C_($) && Oe($.name) && ID(Se) && ue?.data) {
- const { classConstructor: rt, superClassReference: Ct, facts: $t } = ue.data;
- if ($t & 1)
- return Xt($);
- if (rt && Ct) {
- const zr = t.createReflectGetCall(
- Ct,
- t.createStringLiteralFromNode($.name),
- rt
- );
- return kn(zr, $.expression), lt(zr, $.expression), zr;
- }
- }
- return br($, le, e);
- }
- function Hs($) {
- if (O && Se && C_($) && ID(Se) && ue?.data) {
- const { classConstructor: rt, superClassReference: Ct, facts: $t } = ue.data;
- if ($t & 1)
- return Xt($);
- if (rt && Ct) {
- const zr = t.createReflectGetCall(
- Ct,
- Ge($.argumentExpression, le, _t),
- rt
- );
- return kn(zr, $.expression), lt(zr, $.expression), zr;
- }
- }
- return br($, le, e);
- }
- function rr($, rt) {
- if ($.operator === 46 || $.operator === 47) {
- const Ct = Ba($.operand);
- if (cC(Ct)) {
- let $t;
- if ($t = ca(Ct.name)) {
- const zr = Ge(Ct.expression, le, _t);
- ti(zr);
- const { readExpression: $n, initializeExpression: ar } = Tt(zr);
- let An = qn($t, $n);
- const ri = uv($) || rt ? void 0 : t.createTempVariable(i);
- return An = aO(t, $, An, i, ri), An = at(
- $t,
- ar || $n,
- An,
- 64
- /* EqualsToken */
- ), kn(An, $), lt(An, $), ri && (An = t.createComma(An, ri), lt(An, $)), An;
- }
- } else if (O && Se && C_(Ct) && ID(Se) && ue?.data) {
- const { classConstructor: $t, superClassReference: zr, facts: $n } = ue.data;
- if ($n & 1) {
- const ar = Xt(Ct);
- return uv($) ? t.updatePrefixUnaryExpression($, ar) : t.updatePostfixUnaryExpression($, ar);
- }
- if ($t && zr) {
- let ar, An;
- if (Cn(Ct) ? Oe(Ct.name) && (An = ar = t.createStringLiteralFromNode(Ct.name)) : fg(Ct.argumentExpression) ? An = ar = Ct.argumentExpression : (An = t.createTempVariable(i), ar = t.createAssignment(An, Ge(Ct.argumentExpression, le, _t))), ar && An) {
- let ri = t.createReflectGetCall(zr, An, $t);
- lt(ri, Ct);
- const Fi = rt ? void 0 : t.createTempVariable(i);
- return ri = aO(t, $, ri, i, Fi), ri = t.createReflectSetCall(zr, ar, ri, $t), kn(ri, $), lt(ri, $), Fi && (ri = t.createComma(ri, Fi), lt(ri, $)), ri;
- }
- }
- }
- }
- return br($, le, e);
- }
- function Ea($) {
- return t.updateForStatement(
- $,
- Ge($.initializer, ve, ip),
- Ge($.condition, le, _t),
- Ge($.incrementor, ve, _t),
- Ku($.statement, le, e)
- );
- }
- function Xe($) {
- return t.updateExpressionStatement(
- $,
- Ge($.expression, ve, _t)
- );
- }
- function Tt($) {
- const rt = fo($) ? $ : t.cloneNode($);
- if ($.kind === 110 && ne.has($) && ne.add(rt), fg($))
- return { readExpression: rt, initializeExpression: void 0 };
- const Ct = t.createTempVariable(i), $t = t.createAssignment(Ct, rt);
- return { readExpression: Ct, initializeExpression: $t };
- }
- function te($) {
- var rt;
- if (cC($.expression) && ca($.expression.name)) {
- const { thisArg: Ct, target: $t } = t.createCallBinding($.expression, i, g);
- return $2($) ? t.updateCallChain(
- $,
- t.createPropertyAccessChain(Ge($t, le, _t), $.questionDotToken, "call"),
- /*questionDotToken*/
- void 0,
- /*typeArguments*/
- void 0,
- [Ge(Ct, le, _t), ...Fr($.arguments, le, _t)]
- ) : t.updateCallExpression(
- $,
- t.createPropertyAccessExpression(Ge($t, le, _t), "call"),
- /*typeArguments*/
- void 0,
- [Ge(Ct, le, _t), ...Fr($.arguments, le, _t)]
- );
- }
- if (O && Se && C_($.expression) && ID(Se) && ((rt = ue?.data) != null && rt.classConstructor)) {
- const Ct = t.createFunctionCallCall(
- Ge($.expression, le, _t),
- ue.data.classConstructor,
- Fr($.arguments, le, _t)
- );
- return kn(Ct, $), lt(Ct, $), Ct;
- }
- return br($, le, e);
- }
- function ze($) {
- var rt;
- if (cC($.tag) && ca($.tag.name)) {
- const { thisArg: Ct, target: $t } = t.createCallBinding($.tag, i, g);
- return t.updateTaggedTemplateExpression(
- $,
- t.createCallExpression(
- t.createPropertyAccessExpression(Ge($t, le, _t), "bind"),
- /*typeArguments*/
- void 0,
- [Ge(Ct, le, _t)]
- ),
- /*typeArguments*/
- void 0,
- Ge($.template, le, VT)
- );
- }
- if (O && Se && C_($.tag) && ID(Se) && ((rt = ue?.data) != null && rt.classConstructor)) {
- const Ct = t.createFunctionBindCall(
- Ge($.tag, le, _t),
- ue.data.classConstructor,
- []
- );
- return kn(Ct, $), lt(Ct, $), t.updateTaggedTemplateExpression(
- $,
- Ct,
- /*typeArguments*/
- void 0,
- Ge($.template, le, VT)
- );
- }
- return br($, le, e);
- }
- function K($) {
- if (ue && re.set(Ho($), ue), P) {
- if (ND($)) {
- const $t = Ge($.body.statements[0].expression, le, _t);
- return Dl(
- $t,
- /*excludeCompoundAssignment*/
- !0
- ) && $t.left === $t.right ? void 0 : $t;
- }
- if (Hx($))
- return Ge($.body.statements[0].expression, le, _t);
- o();
- let rt = ki(
- $,
- ($t) => Fr($t, le, bi),
- $.body.statements
- );
- rt = t.mergeLexicalEnvironment(rt, s());
- const Ct = t.createImmediatelyInvokedArrowFunction(rt);
- return kn(Ba(Ct.expression), $), hm(
- Ba(Ct.expression),
- 4
- /* AdviseOnEmitNode */
- ), kn(Ct, $), lt(Ct, $), Ct;
- }
- }
- function De($) {
- if ($c($) && !$.name) {
- const rt = $O($);
- return ut(rt, Hx) ? !1 : (P || !!_d($)) && ut(rt, ($t) => oc($t) || Ou($t) || D && AA($t));
- }
- return !1;
- }
- function Ve($, rt) {
- if (x0($)) {
- const Ct = ee;
- ee = void 0, $ = t.updateBinaryExpression(
- $,
- Ge($.left, Te, _t),
- $.operatorToken,
- Ge($.right, le, _t)
- );
- const $t = ut(ee) ? t.inlineExpressions(tw([...ee, $])) : $;
- return ee = Ct, $t;
- }
- if (Dl($)) {
- Q_($, De) && ($ = tf(e, $), E.assertNode($, Dl));
- const Ct = Dc(
- $.left,
- 9
- /* Parentheses */
- );
- if (cC(Ct)) {
- const $t = ca(Ct.name);
- if ($t)
- return lt(
- kn(
- at($t, Ct.expression, $.right, $.operatorToken.kind),
- $
- ),
- $
- );
- } else if (O && Se && C_($.left) && ID(Se) && ue?.data) {
- const { classConstructor: $t, superClassReference: zr, facts: $n } = ue.data;
- if ($n & 1)
- return t.updateBinaryExpression(
- $,
- Xt($.left),
- $.operatorToken,
- Ge($.right, le, _t)
- );
- if ($t && zr) {
- let ar = ko($.left) ? Ge($.left.argumentExpression, le, _t) : Oe($.left.name) ? t.createStringLiteralFromNode($.left.name) : void 0;
- if (ar) {
- let An = Ge($.right, le, _t);
- if (PD($.operatorToken.kind)) {
- let Fi = ar;
- fg(ar) || (Fi = t.createTempVariable(i), ar = t.createAssignment(Fi, ar));
- const za = t.createReflectGetCall(
- zr,
- Fi,
- $t
- );
- kn(za, $.left), lt(za, $.left), An = t.createBinaryExpression(
- za,
- wD($.operatorToken.kind),
- An
- ), lt(An, $);
- }
- const ri = rt ? void 0 : t.createTempVariable(i);
- return ri && (An = t.createAssignment(ri, An), lt(ri, $)), An = t.createReflectSetCall(
- zr,
- ar,
- An,
- $t
- ), kn(An, $), lt(An, $), ri && (An = t.createComma(An, ri), lt(An, $)), An;
- }
- }
- }
- }
- return cRe($) ? et($) : br($, le, e);
- }
- function Ke($, rt) {
- const Ct = VO($.elements, ve);
- return t.updateCommaListExpression($, Ct);
- }
- function xe($, rt) {
- const Ct = rt ? ve : le, $t = Ge($.expression, Ct, _t);
- return t.updateParenthesizedExpression($, $t);
- }
- function at($, rt, Ct, $t) {
- if (rt = Ge(rt, le, _t), Ct = Ge(Ct, le, _t), ti(rt), PD($t)) {
- const { readExpression: zr, initializeExpression: $n } = Tt(rt);
- rt = $n || zr, Ct = t.createBinaryExpression(
- Oi($, zr),
- wD($t),
- Ct
- );
- }
- switch (nl(rt, sv(rt, -1)), $.kind) {
- case "a":
- return n().createClassPrivateFieldSetHelper(
- rt,
- $.brandCheckIdentifier,
- Ct,
- $.kind,
- $.setterName
- );
- case "m":
- return n().createClassPrivateFieldSetHelper(
- rt,
- $.brandCheckIdentifier,
- Ct,
- $.kind,
- /*f*/
- void 0
- );
- case "f":
- return n().createClassPrivateFieldSetHelper(
- rt,
- $.brandCheckIdentifier,
- Ct,
- $.kind,
- $.isStatic ? $.variableName : void 0
- );
- case "untransformed":
- return E.fail("Access helpers should not be created for untransformed private elements");
- default:
- E.assertNever($, "Unknown private element type");
- }
- }
- function $e($) {
- return Ln($.members, qre);
- }
- function bt($) {
- var rt;
- let Ct = 0;
- const $t = Ho($);
- Zn($t) && v0(S, $t) && (Ct |= 1), P && (uW($) || YO($)) && (Ct |= 2);
- let zr = !1, $n = !1, ar = !1, An = !1;
- for (const Fi of $.members)
- zs(Fi) ? ((Fi.name && (Di(Fi.name) || u_(Fi)) && P || u_(Fi) && I === -1 && !$.name && !((rt = $.emitNode) != null && rt.classThis)) && (Ct |= 2), (cs(Fi) || oc(Fi)) && (F && Fi.transformFlags & 16384 && (Ct |= 8, Ct & 1 || (Ct |= 2)), O && Fi.transformFlags & 134217728 && (Ct & 1 || (Ct |= 6)))) : wb(Ho(Fi)) || (u_(Fi) ? (An = !0, ar || (ar = Ou(Fi))) : Ou(Fi) ? (ar = !0, u.hasNodeCheckFlag(
- Fi,
- 262144
- /* ContainsConstructorReference */
- ) && (Ct |= 2)) : cs(Fi) && (zr = !0, $n || ($n = !!Fi.initializer)));
- return (C && zr || T && $n || P && ar || P && An && I === -1) && (Ct |= 16), Ct;
- }
- function He($) {
- var rt;
- if ((((rt = ue?.data) == null ? void 0 : rt.facts) || 0) & 4) {
- const $t = t.createTempVariable(
- i,
- /*reservedInNestedScopes*/
- !0
- );
- return mr().superClassReference = $t, t.updateExpressionWithTypeArguments(
- $,
- t.createAssignment(
- $t,
- Ge($.expression, le, _t)
- ),
- /*typeArguments*/
- void 0
- );
- }
- return br($, le, e);
- }
- function Vt($, rt) {
- var Ct;
- const $t = ie, zr = ee, $n = ue;
- ie = $, ee = void 0, en();
- const ar = _d($) & 32;
- if (P || ar) {
- const Fi = os($);
- if (Fi && Oe(Fi))
- Kt().data.className = Fi;
- else if ((Ct = $.emitNode) != null && Ct.assignedName && oa($.emitNode.assignedName)) {
- if ($.emitNode.assignedName.textSourceNode && Oe($.emitNode.assignedName.textSourceNode))
- Kt().data.className = $.emitNode.assignedName.textSourceNode;
- else if (k_($.emitNode.assignedName.text, g)) {
- const za = t.createIdentifier($.emitNode.assignedName.text);
- Kt().data.className = za;
- }
- }
- }
- if (P) {
- const Fi = $e($);
- ut(Fi) && (Kt().data.weakSetName = io(
- "instances",
- Fi[0].name
- ));
- }
- const An = bt($);
- An && (mr().facts = An), An & 8 && wt();
- const ri = rt($, An);
- return zt(), E.assert(ue === $n), ie = $t, ee = zr, ri;
- }
- function Zt($) {
- return Vt($, vn);
- }
- function vn($, rt) {
- var Ct, $t;
- let zr;
- if (rt & 2)
- if (P && ((Ct = $.emitNode) != null && Ct.classThis))
- mr().classConstructor = $.emitNode.classThis, zr = t.createAssignment($.emitNode.classThis, t.getInternalName($));
- else {
- const Lo = t.createTempVariable(
- i,
- /*reservedInNestedScopes*/
- !0
- );
- mr().classConstructor = t.cloneNode(Lo), zr = t.createAssignment(Lo, t.getInternalName($));
- }
- ($t = $.emitNode) != null && $t.classThis && (mr().classThis = $.emitNode.classThis);
- const $n = u.hasNodeCheckFlag(
- $,
- 262144
- /* ContainsConstructorReference */
- ), ar = Gn(
- $,
- 32
- /* Export */
- ), An = Gn(
- $,
- 2048
- /* Default */
- );
- let ri = Fr($.modifiers, he, ra);
- const Fi = Fr($.heritageClauses, tt, ef), { members: za, prologue: Uo } = be($), vc = [];
- if (zr && hr().unshift(zr), ut(ee) && vc.push(t.createExpressionStatement(t.inlineExpressions(ee))), T || P || _d($) & 32) {
- const Lo = $O($);
- ut(Lo) && At(vc, Lo, t.getInternalName($));
- }
- vc.length > 0 && ar && An && (ri = Fr(ri, (Lo) => _A(Lo) ? void 0 : Lo, ra), vc.push(t.createExportAssignment(
- /*modifiers*/
- void 0,
- /*isExportEquals*/
- !1,
- t.getLocalName(
- $,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- )
- )));
- const Oc = mr().classConstructor;
- $n && Oc && (ot(), ae[e_($)] = Oc);
- const Fc = t.updateClassDeclaration(
- $,
- ri,
- $.name,
- /*typeParameters*/
- void 0,
- Fi,
- za
- );
- return vc.unshift(Fc), Uo && vc.unshift(t.createExpressionStatement(Uo)), vc;
- }
- function M($) {
- return Vt($, Ae);
- }
- function Ae($, rt) {
- var Ct, $t, zr;
- const $n = !!(rt & 1), ar = $O($), An = u.hasNodeCheckFlag(
- $,
- 262144
- /* ContainsConstructorReference */
- ), ri = u.hasNodeCheckFlag(
- $,
- 32768
- /* BlockScopedBindingInLoop */
- );
- let Fi;
- function za() {
- var Lc;
- if (P && ((Lc = $.emitNode) != null && Lc.classThis))
- return mr().classConstructor = $.emitNode.classThis;
- const al = t.createTempVariable(
- ri ? _ : i,
- /*reservedInNestedScopes*/
- !0
- );
- return mr().classConstructor = t.cloneNode(al), al;
- }
- (Ct = $.emitNode) != null && Ct.classThis && (mr().classThis = $.emitNode.classThis), rt & 2 && (Fi ?? (Fi = za()));
- const Uo = Fr($.modifiers, he, ra), vc = Fr($.heritageClauses, tt, ef), { members: Oc, prologue: Fc } = be($), Lo = t.updateClassExpression(
- $,
- Uo,
- $.name,
- /*typeParameters*/
- void 0,
- vc,
- Oc
- ), _c = [];
- if (Fc && _c.push(Fc), (P || _d($) & 32) && ut(ar, (Lc) => oc(Lc) || Ou(Lc) || D && AA(Lc)) || ut(ee))
- if ($n)
- E.assertIsDefined(G, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."), ut(ee) && Fn(G, lr(ee, t.createExpressionStatement)), ut(ar) && At(G, ar, (($t = $.emitNode) == null ? void 0 : $t.classThis) ?? t.getInternalName($)), Fi ? _c.push(t.createAssignment(Fi, Lo)) : P && ((zr = $.emitNode) != null && zr.classThis) ? _c.push(t.createAssignment($.emitNode.classThis, Lo)) : _c.push(Lo);
- else {
- if (Fi ?? (Fi = za()), An) {
- ot();
- const Lc = t.cloneNode(Fi);
- Lc.emitNode.autoGenerate.flags &= -9, ae[e_($)] = Lc;
- }
- _c.push(t.createAssignment(Fi, Lo)), Fn(_c, ee), Fn(_c, yr(ar, Fi)), _c.push(t.cloneNode(Fi));
- }
- else
- _c.push(Lo);
- return _c.length > 1 && (hm(
- Lo,
- 131072
- /* Indented */
- ), _c.forEach(bu)), t.inlineExpressions(_c);
- }
- function dt($) {
- if (!P)
- return br($, le, e);
- }
- function U($) {
- if (F && Se && oc(Se) && ue?.data) {
- const { classThis: rt, classConstructor: Ct } = ue.data;
- return rt ?? Ct ?? $;
- }
- return $;
- }
- function be($) {
- const rt = !!(_d($) & 32);
- if (P || q) {
- for (const ar of $.members)
- if (Ou(ar))
- if (xr(ar))
- Ic(ar, ar.name, Ft);
- else {
- const An = Kt();
- ES(An, ar.name, { kind: "untransformed" });
- }
- if (P && ut($e($)) && Z(), Ot()) {
- for (const ar of $.members)
- if (u_(ar)) {
- const An = t.getGeneratedPrivateNameForNode(
- ar.name,
- /*prefix*/
- void 0,
- "_accessor_storage"
- );
- if (P || rt && tl(ar))
- Ic(ar, An, Ss);
- else {
- const ri = Kt();
- ES(ri, An, { kind: "untransformed" });
- }
- }
- }
- }
- let Ct = Fr($.members, we, _l), $t;
- ut(Ct, Qo) || ($t = ht(
- /*constructor*/
- void 0,
- $
- ));
- let zr, $n;
- if (!P && ut(ee)) {
- let ar = t.createExpressionStatement(t.inlineExpressions(ee));
- if (ar.transformFlags & 134234112) {
- const ri = t.createTempVariable(i), Fi = t.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- [],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- t.createBlock([ar])
- );
- zr = t.createAssignment(ri, Fi), ar = t.createExpressionStatement(t.createCallExpression(
- ri,
- /*typeArguments*/
- void 0,
- []
- ));
- }
- const An = t.createBlock([ar]);
- $n = t.createClassStaticBlockDeclaration(An), ee = void 0;
- }
- if ($t || $n) {
- let ar;
- const An = On(Ct, ND), ri = On(Ct, Hx);
- ar = wr(ar, An), ar = wr(ar, ri), ar = wr(ar, $t), ar = wr(ar, $n);
- const Fi = An || ri ? Ln(Ct, (za) => za !== An && za !== ri) : Ct;
- ar = Fn(ar, Fi), Ct = lt(
- t.createNodeArray(ar),
- /*location*/
- $.members
- );
- }
- return { members: Ct, prologue: zr };
- }
- function Z() {
- const { weakSetName: $ } = Kt().data;
- E.assert($, "weakSetName should be set in private identifier environment"), hr().push(
- t.createAssignment(
- $,
- t.createNewExpression(
- t.createIdentifier("WeakSet"),
- /*typeArguments*/
- void 0,
- []
- )
- )
- );
- }
- function ht($, rt) {
- if ($ = Ge($, le, Qo), !ue?.data || !(ue.data.facts & 16))
- return $;
- const Ct = _m(rt), $t = !!(Ct && Dc(Ct.expression).kind !== 106), zr = cc($ ? $.parameters : void 0, le, e), $n = Ie(rt, $, $t);
- return $n ? $ ? (E.assert(zr), t.updateConstructorDeclaration(
- $,
- /*modifiers*/
- void 0,
- zr,
- $n
- )) : bu(
- kn(
- lt(
- t.createConstructorDeclaration(
- /*modifiers*/
- void 0,
- zr ?? [],
- $n
- ),
- $ || rt
- ),
- $
- )
- ) : $;
- }
- function Le($, rt, Ct, $t, zr, $n, ar) {
- const An = $t[zr], ri = rt[An];
- if (Fn($, Fr(rt, le, bi, Ct, An - Ct)), Ct = An + 1, gS(ri)) {
- const Fi = [];
- Le(
- Fi,
- ri.tryBlock.statements,
- /*statementOffset*/
- 0,
- $t,
- zr + 1,
- $n,
- ar
- );
- const za = t.createNodeArray(Fi);
- lt(za, ri.tryBlock.statements), $.push(t.updateTryStatement(
- ri,
- t.updateBlock(ri.tryBlock, Fi),
- Ge(ri.catchClause, le, Ub),
- Ge(ri.finallyBlock, le, Cs)
- ));
- } else {
- for (Fn($, Fr(rt, le, bi, An, 1)); Ct < rt.length; ) {
- const Fi = rt[Ct];
- if (G_(Ho(Fi), ar))
- Ct++;
- else
- break;
- }
- Fn($, $n);
- }
- Fn($, Fr(rt, le, bi, Ct));
- }
- function Ie($, rt, Ct) {
- var $t;
- const zr = oW(
- $,
- /*requireInitializer*/
- !1,
- /*isStatic*/
- !1
- );
- let $n = zr;
- h || ($n = Ln($n, (Fc) => !!Fc.initializer || Di(Fc.name) || dm(Fc)));
- const ar = $e($), An = ut($n) || ut(ar);
- if (!rt && !An)
- return Bf(
- /*node*/
- void 0,
- le,
- e
- );
- c();
- const ri = !rt && Ct;
- let Fi = 0, za = [];
- const Uo = [], vc = t.createThis();
- if (jt(Uo, ar, vc), rt) {
- const Fc = Ln(zr, (_c) => G_(Ho(_c), rt)), Lo = Ln($n, (_c) => !G_(Ho(_c), rt));
- At(Uo, Fc, vc), At(Uo, Lo, vc);
- } else
- At(Uo, $n, vc);
- if (rt?.body) {
- Fi = t.copyPrologue(
- rt.body.statements,
- za,
- /*ensureUseStrict*/
- !1,
- le
- );
- const Fc = GO(rt.body.statements, Fi);
- if (Fc.length)
- Le(
- za,
- rt.body.statements,
- Fi,
- Fc,
- /*superPathDepth*/
- 0,
- Uo,
- rt
- );
- else {
- for (; Fi < rt.body.statements.length; ) {
- const Lo = rt.body.statements[Fi];
- if (G_(Ho(Lo), rt))
- Fi++;
- else
- break;
- }
- Fn(za, Uo), Fn(za, Fr(rt.body.statements, le, bi, Fi));
- }
- } else
- ri && za.push(
- t.createExpressionStatement(
- t.createCallExpression(
- t.createSuper(),
- /*typeArguments*/
- void 0,
- [t.createSpreadElement(t.createIdentifier("arguments"))]
- )
- )
- ), Fn(za, Uo);
- if (za = t.mergeLexicalEnvironment(za, s()), za.length === 0 && !rt)
- return;
- const Oc = rt?.body && rt.body.statements.length >= za.length ? rt.body.multiLine ?? za.length > 0 : za.length > 0;
- return lt(
- t.createBlock(
- lt(
- t.createNodeArray(za),
- /*location*/
- (($t = rt?.body) == null ? void 0 : $t.statements) ?? $.members
- ),
- Oc
- ),
- rt?.body
- );
- }
- function At($, rt, Ct) {
- for (const $t of rt) {
- if (zs($t) && !P)
- continue;
- const zr = Dr($t, Ct);
- zr && $.push(zr);
- }
- }
- function Dr($, rt) {
- const Ct = oc($) ? ki($, K, $) : $r($, rt);
- if (!Ct)
- return;
- const $t = t.createExpressionStatement(Ct);
- kn($t, $), hm(
- $t,
- ya($) & 3072
- /* NoComments */
- ), nl($t, $);
- const zr = Ho($);
- return Ii(zr) ? (da($t, zr), X3($t)) : da($t, gm($)), ov(Ct, void 0), Sx(Ct, void 0), dm(zr) && hm(
- $t,
- 3072
- /* NoComments */
- ), $t;
- }
- function yr($, rt) {
- const Ct = [];
- for (const $t of $) {
- const zr = oc($t) ? ki($t, K, $t) : ki(
- $t,
- () => $r($t, rt),
- /*arg*/
- void 0
- );
- zr && (bu(zr), kn(zr, $t), hm(
- zr,
- ya($t) & 3072
- /* NoComments */
- ), da(zr, gm($t)), nl(zr, $t), Ct.push(zr));
- }
- return Ct;
- }
- function $r($, rt) {
- var Ct;
- const $t = Se, zr = nt($, rt);
- return zr && tl($) && ((Ct = ue?.data) != null && Ct.facts) && (kn(zr, $), hm(
- zr,
- 4
- /* AdviseOnEmitNode */
- ), da(zr, E0($.name)), re.set(Ho($), ue)), Se = $t, zr;
- }
- function nt($, rt) {
- const Ct = !h;
- Q_($, De) && ($ = tf(e, $));
- const $t = dm($) ? t.getGeneratedPrivateNameForNode($.name) : ma($.name) && !fg($.name.expression) ? t.updateComputedPropertyName($.name, t.getGeneratedNameForNode($.name)) : $.name;
- if (tl($) && (Se = $), Di($t) && xr($)) {
- const ar = ca($t);
- if (ar)
- return ar.kind === "f" ? ar.isStatic ? iRe(
- t,
- ar.variableName,
- Ge($.initializer, le, _t)
- ) : sRe(
- t,
- rt,
- Ge($.initializer, le, _t),
- ar.brandCheckIdentifier
- ) : void 0;
- E.fail("Undeclared private name for property declaration.");
- }
- if ((Di($t) || tl($)) && !$.initializer)
- return;
- const zr = Ho($);
- if (Gn(
- zr,
- 64
- /* Abstract */
- ))
- return;
- let $n = Ge($.initializer, le, _t);
- if (G_(zr, zr.parent) && Oe($t)) {
- const ar = t.cloneNode($t);
- $n ? (Yu($n) && cA($n.expression) && K4($n.expression.left, "___runInitializers") && Nx($n.expression.right) && d_($n.expression.right.expression) && ($n = $n.expression.left), $n = t.inlineExpressions([$n, ar])) : $n = ar, an(
- $t,
- 3168
- /* NoSourceMap */
- ), da(ar, zr.name), an(
- ar,
- 3072
- /* NoComments */
- );
- } else
- $n ?? ($n = t.createVoidZero());
- if (Ct || Di($t)) {
- const ar = TS(
- t,
- rt,
- $t,
- /*location*/
- $t
- );
- return hm(
- ar,
- 1024
- /* NoLeadingComments */
- ), t.createAssignment(ar, $n);
- } else {
- const ar = ma($t) ? $t.expression : Oe($t) ? t.createStringLiteral(Ei($t.escapedText)) : $t, An = t.createPropertyDescriptor({ value: $n, configurable: !0, writable: !0, enumerable: !0 });
- return t.createObjectDefinePropertyCall(rt, ar, An);
- }
- }
- function ot() {
- V & 1 || (V |= 1, e.enableSubstitution(
- 80
- /* Identifier */
- ), ae = []);
- }
- function wt() {
- V & 2 || (V |= 2, e.enableSubstitution(
- 110
- /* ThisKeyword */
- ), e.enableEmitNotification(
- 262
- /* FunctionDeclaration */
- ), e.enableEmitNotification(
- 218
- /* FunctionExpression */
- ), e.enableEmitNotification(
- 176
- /* Constructor */
- ), e.enableEmitNotification(
- 177
- /* GetAccessor */
- ), e.enableEmitNotification(
- 178
- /* SetAccessor */
- ), e.enableEmitNotification(
- 174
- /* MethodDeclaration */
- ), e.enableEmitNotification(
- 172
- /* PropertyDeclaration */
- ), e.enableEmitNotification(
- 167
- /* ComputedPropertyName */
- ));
- }
- function jt($, rt, Ct) {
- if (!P || !ut(rt))
- return;
- const { weakSetName: $t } = Kt().data;
- E.assert($t, "weakSetName should be set in private identifier environment"), $.push(
- t.createExpressionStatement(
- aRe(t, Ct, $t)
- )
- );
- }
- function Xt($) {
- return Cn($) ? t.updatePropertyAccessExpression(
- $,
- t.createVoidZero(),
- $.name
- ) : t.updateElementAccessExpression(
- $,
- t.createVoidZero(),
- Ge($.argumentExpression, le, _t)
- );
- }
- function Ht($, rt) {
- if (ma($)) {
- const Ct = pO($), $t = Ge($.expression, le, _t), zr = ud($t), $n = fg(zr);
- if (!(!!Ct || Dl(zr) && jo(zr.left)) && !$n && rt) {
- const An = t.getGeneratedNameForNode($);
- return u.hasNodeCheckFlag(
- $,
- 32768
- /* BlockScopedBindingInLoop */
- ) ? _(An) : i(An), t.createAssignment(An, $t);
- }
- return $n || Oe(zr) ? void 0 : $t;
- }
- }
- function en() {
- ue = { previous: ue, data: void 0 };
- }
- function zt() {
- ue = ue?.previous;
- }
- function mr() {
- return E.assert(ue), ue.data ?? (ue.data = {
- facts: 0,
- classConstructor: void 0,
- classThis: void 0,
- superClassReference: void 0
- // privateIdentifierEnvironment: undefined,
- });
- }
- function Kt() {
- return E.assert(ue), ue.privateEnv ?? (ue.privateEnv = Gre({
- className: void 0,
- weakSetName: void 0
- }));
- }
- function hr() {
- return ee ?? (ee = []);
- }
- function Ft($, rt, Ct, $t, zr, $n, ar) {
- u_($) ? lc($, rt, Ct, $t, zr, $n) : cs($) ? Ss($, rt, Ct, $t, zr, $n) : hc($) ? gs($, rt, Ct, $t, zr, $n) : Lf($) ? Ts($, rt, Ct, $t, zr, $n, ar) : K_($) && Ua($, rt, Ct, $t, zr, $n, ar);
- }
- function Ss($, rt, Ct, $t, zr, $n, ar) {
- if (zr) {
- const An = E.checkDefined(Ct.classThis ?? Ct.classConstructor, "classConstructor should be set in private identifier environment"), ri = vi(rt);
- ES($t, rt, {
- kind: "f",
- isStatic: !0,
- brandCheckIdentifier: An,
- variableName: ri,
- isValid: $n
- });
- } else {
- const An = vi(rt);
- ES($t, rt, {
- kind: "f",
- isStatic: !1,
- brandCheckIdentifier: An,
- isValid: $n
- }), hr().push(t.createAssignment(
- An,
- t.createNewExpression(
- t.createIdentifier("WeakMap"),
- /*typeArguments*/
- void 0,
- []
- )
- ));
- }
- }
- function gs($, rt, Ct, $t, zr, $n, ar) {
- const An = vi(rt), ri = zr ? E.checkDefined(Ct.classThis ?? Ct.classConstructor, "classConstructor should be set in private identifier environment") : E.checkDefined($t.data.weakSetName, "weakSetName should be set in private identifier environment");
- ES($t, rt, {
- kind: "m",
- methodName: An,
- brandCheckIdentifier: ri,
- isStatic: zr,
- isValid: $n
- });
- }
- function Ts($, rt, Ct, $t, zr, $n, ar) {
- const An = vi(rt, "_get"), ri = zr ? E.checkDefined(Ct.classThis ?? Ct.classConstructor, "classConstructor should be set in private identifier environment") : E.checkDefined($t.data.weakSetName, "weakSetName should be set in private identifier environment");
- ar?.kind === "a" && ar.isStatic === zr && !ar.getterName ? ar.getterName = An : ES($t, rt, {
- kind: "a",
- getterName: An,
- setterName: void 0,
- brandCheckIdentifier: ri,
- isStatic: zr,
- isValid: $n
- });
- }
- function Ua($, rt, Ct, $t, zr, $n, ar) {
- const An = vi(rt, "_set"), ri = zr ? E.checkDefined(Ct.classThis ?? Ct.classConstructor, "classConstructor should be set in private identifier environment") : E.checkDefined($t.data.weakSetName, "weakSetName should be set in private identifier environment");
- ar?.kind === "a" && ar.isStatic === zr && !ar.setterName ? ar.setterName = An : ES($t, rt, {
- kind: "a",
- getterName: void 0,
- setterName: An,
- brandCheckIdentifier: ri,
- isStatic: zr,
- isValid: $n
- });
- }
- function lc($, rt, Ct, $t, zr, $n, ar) {
- const An = vi(rt, "_get"), ri = vi(rt, "_set"), Fi = zr ? E.checkDefined(Ct.classThis ?? Ct.classConstructor, "classConstructor should be set in private identifier environment") : E.checkDefined($t.data.weakSetName, "weakSetName should be set in private identifier environment");
- ES($t, rt, {
- kind: "a",
- getterName: An,
- setterName: ri,
- brandCheckIdentifier: Fi,
- isStatic: zr,
- isValid: $n
- });
- }
- function Ic($, rt, Ct) {
- const $t = mr(), zr = Kt(), $n = lW(zr, rt), ar = tl($), An = !oRe(rt) && $n === void 0;
- Ct($, rt, $t, zr, ar, An, $n);
- }
- function io($, rt, Ct) {
- const { className: $t } = Kt().data, zr = $t ? { prefix: "_", node: $t, suffix: "_" } : "_", $n = typeof $ == "object" ? t.getGeneratedNameForNode($, 24, zr, Ct) : typeof $ == "string" ? t.createUniqueName($, 16, zr, Ct) : t.createTempVariable(
- /*recordTempVariable*/
- void 0,
- /*reservedInNestedScopes*/
- !0,
- zr,
- Ct
- );
- return u.hasNodeCheckFlag(
- rt,
- 32768
- /* BlockScopedBindingInLoop */
- ) ? _($n) : i($n), $n;
- }
- function vi($, rt) {
- const Ct = f4($);
- return io(Ct?.substring(1) ?? $, $, rt);
- }
- function ca($) {
- const rt = $re(ue, $);
- return rt?.kind === "untransformed" ? void 0 : rt;
- }
- function Ll($) {
- const rt = t.getGeneratedNameForNode($), Ct = ca($.name);
- if (!Ct)
- return br($, le, e);
- let $t = $.expression;
- return (Qw($) || C_($) || !Hb($.expression)) && ($t = t.createTempVariable(
- i,
- /*reservedInNestedScopes*/
- !0
- ), hr().push(t.createBinaryExpression($t, 64, Ge($.expression, le, _t)))), t.createAssignmentTargetWrapper(
- rt,
- at(
- Ct,
- $t,
- rt,
- 64
- /* EqualsToken */
- )
- );
- }
- function xs($) {
- if (Ks($) || $l($))
- return Bt($);
- if (cC($))
- return Ll($);
- if (O && Se && C_($) && ID(Se) && ue?.data) {
- const { classConstructor: rt, superClassReference: Ct, facts: $t } = ue.data;
- if ($t & 1)
- return Xt($);
- if (rt && Ct) {
- const zr = ko($) ? Ge($.argumentExpression, le, _t) : Oe($.name) ? t.createStringLiteralFromNode($.name) : void 0;
- if (zr) {
- const $n = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- return t.createAssignmentTargetWrapper(
- $n,
- t.createReflectSetCall(
- Ct,
- zr,
- $n,
- rt
- )
- );
- }
- }
- }
- return br($, le, e);
- }
- function Cu($) {
- if (Q_($, De) && ($ = tf(e, $)), Dl(
- $,
- /*excludeCompoundAssignment*/
- !0
- )) {
- const rt = xs($.left), Ct = Ge($.right, le, _t);
- return t.updateBinaryExpression($, rt, $.operatorToken, Ct);
- }
- return xs($);
- }
- function Zc($) {
- if (__($.expression)) {
- const rt = xs($.expression);
- return t.updateSpreadElement($, rt);
- }
- return br($, le, e);
- }
- function Yi($) {
- if (Nw($)) {
- if (fp($)) return Zc($);
- if (!ml($)) return Cu($);
- }
- return br($, le, e);
- }
- function Na($) {
- const rt = Ge($.name, le, Bc);
- if (Dl(
- $.initializer,
- /*excludeCompoundAssignment*/
- !0
- )) {
- const Ct = Cu($.initializer);
- return t.updatePropertyAssignment($, rt, Ct);
- }
- if (__($.initializer)) {
- const Ct = xs($.initializer);
- return t.updatePropertyAssignment($, rt, Ct);
- }
- return br($, le, e);
- }
- function Ia($) {
- return Q_($, De) && ($ = tf(e, $)), br($, le, e);
- }
- function Vi($) {
- if (__($.expression)) {
- const rt = xs($.expression);
- return t.updateSpreadAssignment($, rt);
- }
- return br($, le, e);
- }
- function ba($) {
- return E.assertNode($, Aw), $g($) ? Vi($) : uu($) ? Ia($) : Qc($) ? Na($) : br($, le, e);
- }
- function Bt($) {
- return $l($) ? t.updateArrayLiteralExpression(
- $,
- Fr($.elements, Yi, _t)
- ) : t.updateObjectLiteralExpression(
- $,
- Fr($.properties, ba, kh)
- );
- }
- function to($, rt, Ct) {
- const $t = Ho(rt), zr = re.get($t);
- if (zr) {
- const $n = ue, ar = oe;
- ue = zr, oe = J, J = !oc($t) || !(_d($t) & 32), X($, rt, Ct), J = oe, oe = ar, ue = $n;
- return;
- }
- switch (rt.kind) {
- case 218:
- if (Co($t) || ya(rt) & 524288)
- break;
- case 262:
- case 176:
- case 177:
- case 178:
- case 174:
- case 172: {
- const $n = ue, ar = oe;
- ue = void 0, oe = J, J = !1, X($, rt, Ct), J = oe, oe = ar, ue = $n;
- return;
- }
- case 167: {
- const $n = ue, ar = J;
- ue = ue?.previous, J = oe, X($, rt, Ct), J = ar, ue = $n;
- return;
- }
- }
- X($, rt, Ct);
- }
- function _u($, rt) {
- return rt = z($, rt), $ === 1 ? Wc(rt) : rt;
- }
- function Wc($) {
- switch ($.kind) {
- case 80:
- return Ao($);
- case 110:
- return of($);
- }
- return $;
- }
- function of($) {
- if (V & 2 && ue?.data && !ne.has($)) {
- const { facts: rt, classConstructor: Ct, classThis: $t } = ue.data, zr = J ? $t ?? Ct : Ct;
- if (zr)
- return lt(
- kn(
- t.cloneNode(zr),
- $
- ),
- $
- );
- if (rt & 1 && S)
- return t.createParenthesizedExpression(t.createVoidZero());
- }
- return $;
- }
- function Ao($) {
- return ge($) || $;
- }
- function ge($) {
- if (V & 1 && u.hasNodeCheckFlag(
- $,
- 536870912
- /* ConstructorReference */
- )) {
- const rt = u.getReferencedValueDeclaration($);
- if (rt) {
- const Ct = ae[rt.id];
- if (Ct) {
- const $t = t.cloneNode(Ct);
- return da($t, $), nl($t, $), $t;
- }
- }
- }
- }
- }
- function iRe(e, t, n) {
- return e.createAssignment(
- t,
- e.createObjectLiteralExpression([
- e.createPropertyAssignment("value", n || e.createVoidZero())
- ])
- );
- }
- function sRe(e, t, n, i) {
- return e.createCallExpression(
- e.createPropertyAccessExpression(i, "set"),
- /*typeArguments*/
- void 0,
- [t, n || e.createVoidZero()]
- );
- }
- function aRe(e, t, n) {
- return e.createCallExpression(
- e.createPropertyAccessExpression(n, "add"),
- /*typeArguments*/
- void 0,
- [t]
- );
- }
- function oRe(e) {
- return !Q2(e) && e.escapedText === "#constructor";
- }
- function cRe(e) {
- return Di(e.left) && e.operatorToken.kind === 103;
- }
- function lRe(e) {
- return cs(e) && tl(e);
- }
- function ID(e) {
- return oc(e) || lRe(e);
- }
- function ine(e) {
- const {
- factory: t,
- hoistVariableDeclaration: n
- } = e, i = e.getEmitResolver(), s = e.getCompilerOptions(), o = pa(s), c = cu(s, "strictNullChecks");
- let _, u;
- return {
- serializeTypeNode: (ee, G) => d(ee, D, G),
- serializeTypeOfNode: (ee, G, ue) => d(ee, h, G, ue),
- serializeParameterTypesOfNode: (ee, G, ue) => d(ee, S, G, ue),
- serializeReturnTypeOfNode: (ee, G) => d(ee, C, G)
- };
- function d(ee, G, ue, re) {
- const ne = _, ie = u;
- _ = ee.currentLexicalScope, u = ee.currentNameScope;
- const Se = re === void 0 ? G(ue) : G(ue, re);
- return _ = ne, u = ie, Se;
- }
- function g(ee, G) {
- const ue = My(G.members, ee);
- return ue.setAccessor && oK(ue.setAccessor) || ue.getAccessor && Y_(ue.getAccessor);
- }
- function h(ee, G) {
- switch (ee.kind) {
- case 172:
- case 169:
- return D(ee.type);
- case 178:
- case 177:
- return D(g(ee, G));
- case 263:
- case 231:
- case 174:
- return t.createIdentifier("Function");
- default:
- return t.createVoidZero();
- }
- }
- function S(ee, G) {
- const ue = Zn(ee) ? Bg(ee) : ys(ee) && Mp(ee.body) ? ee : void 0, re = [];
- if (ue) {
- const ne = T(ue, G), ie = ne.length;
- for (let Se = 0; Se < ie; Se++) {
- const J = ne[Se];
- Se === 0 && Oe(J.name) && J.name.escapedText === "this" || (J.dotDotDotToken ? re.push(D(Kj(J.type))) : re.push(h(J, G)));
- }
- }
- return t.createArrayLiteralExpression(re);
- }
- function T(ee, G) {
- if (G && ee.kind === 177) {
- const { setAccessor: ue } = My(G.members, ee);
- if (ue)
- return ue.parameters;
- }
- return ee.parameters;
- }
- function C(ee) {
- return ys(ee) && ee.type ? D(ee.type) : k4(ee) ? t.createIdentifier("Promise") : t.createVoidZero();
- }
- function D(ee) {
- if (ee === void 0)
- return t.createIdentifier("Object");
- switch (ee = b4(ee), ee.kind) {
- case 116:
- case 157:
- case 146:
- return t.createVoidZero();
- case 184:
- case 185:
- return t.createIdentifier("Function");
- case 188:
- case 189:
- return t.createIdentifier("Array");
- case 182:
- return ee.assertsModifier ? t.createVoidZero() : t.createIdentifier("Boolean");
- case 136:
- return t.createIdentifier("Boolean");
- case 203:
- case 154:
- return t.createIdentifier("String");
- case 151:
- return t.createIdentifier("Object");
- case 201:
- return P(ee.literal);
- case 150:
- return t.createIdentifier("Number");
- case 163:
- return ae(
- "BigInt",
- 7
- /* ES2020 */
- );
- case 155:
- return ae(
- "Symbol",
- 2
- /* ES2015 */
- );
- case 183:
- return O(ee);
- case 193:
- return I(
- ee.types,
- /*isIntersection*/
- !0
- );
- case 192:
- return I(
- ee.types,
- /*isIntersection*/
- !1
- );
- case 194:
- return I(
- [ee.trueType, ee.falseType],
- /*isIntersection*/
- !1
- );
- case 198:
- if (ee.operator === 148)
- return D(ee.type);
- break;
- case 186:
- case 199:
- case 200:
- case 187:
- case 133:
- case 159:
- case 197:
- case 205:
- break;
- case 312:
- case 313:
- case 317:
- case 318:
- case 319:
- break;
- case 314:
- case 315:
- case 316:
- return D(ee.type);
- default:
- return E.failBadSyntaxKind(ee);
- }
- return t.createIdentifier("Object");
- }
- function P(ee) {
- switch (ee.kind) {
- case 11:
- case 15:
- return t.createIdentifier("String");
- case 224: {
- const G = ee.operand;
- switch (G.kind) {
- case 9:
- case 10:
- return P(G);
- default:
- return E.failBadSyntaxKind(G);
- }
- }
- case 9:
- return t.createIdentifier("Number");
- case 10:
- return ae(
- "BigInt",
- 7
- /* ES2020 */
- );
- case 112:
- case 97:
- return t.createIdentifier("Boolean");
- case 106:
- return t.createVoidZero();
- default:
- return E.failBadSyntaxKind(ee);
- }
- }
- function I(ee, G) {
- let ue;
- for (let re of ee) {
- if (re = b4(re), re.kind === 146) {
- if (G) return t.createVoidZero();
- continue;
- }
- if (re.kind === 159) {
- if (!G) return t.createIdentifier("Object");
- continue;
- }
- if (re.kind === 133)
- return t.createIdentifier("Object");
- if (!c && (P0(re) && re.literal.kind === 106 || re.kind === 157))
- continue;
- const ne = D(re);
- if (Oe(ne) && ne.escapedText === "Object")
- return ne;
- if (ue) {
- if (!F(ue, ne))
- return t.createIdentifier("Object");
- } else
- ue = ne;
- }
- return ue ?? t.createVoidZero();
- }
- function F(ee, G) {
- return (
- // temp vars used in fallback
- jo(ee) ? jo(G) : (
- // entity names
- Oe(ee) ? Oe(G) && ee.escapedText === G.escapedText : Cn(ee) ? Cn(G) && F(ee.expression, G.expression) && F(ee.name, G.name) : (
- // `void 0`
- Nx(ee) ? Nx(G) && d_(ee.expression) && ee.expression.text === "0" && d_(G.expression) && G.expression.text === "0" : (
- // `"undefined"` or `"function"` in `typeof` checks
- oa(ee) ? oa(G) && ee.text === G.text : (
- // used in `typeof` checks for fallback
- GC(ee) ? GC(G) && F(ee.expression, G.expression) : (
- // parens in `typeof` checks with temps
- Yu(ee) ? Yu(G) && F(ee.expression, G.expression) : (
- // conditionals used in fallback
- Ix(ee) ? Ix(G) && F(ee.condition, G.condition) && F(ee.whenTrue, G.whenTrue) && F(ee.whenFalse, G.whenFalse) : (
- // logical binary and assignments used in fallback
- dn(ee) ? dn(G) && ee.operatorToken.kind === G.operatorToken.kind && F(ee.left, G.left) && F(ee.right, G.right) : !1
- )
- )
- )
- )
- )
- )
- )
- );
- }
- function O(ee) {
- const G = i.getTypeReferenceSerializationKind(ee.typeName, u ?? _);
- switch (G) {
- case 0:
- if (or(ee, (ne) => ne.parent && Mb(ne.parent) && (ne.parent.trueType === ne || ne.parent.falseType === ne)))
- return t.createIdentifier("Object");
- const ue = z(ee.typeName), re = t.createTempVariable(n);
- return t.createConditionalExpression(
- t.createTypeCheck(t.createAssignment(re, ue), "function"),
- /*questionToken*/
- void 0,
- re,
- /*colonToken*/
- void 0,
- t.createIdentifier("Object")
- );
- case 1:
- return X(ee.typeName);
- case 2:
- return t.createVoidZero();
- case 4:
- return ae(
- "BigInt",
- 7
- /* ES2020 */
- );
- case 6:
- return t.createIdentifier("Boolean");
- case 3:
- return t.createIdentifier("Number");
- case 5:
- return t.createIdentifier("String");
- case 7:
- return t.createIdentifier("Array");
- case 8:
- return ae(
- "Symbol",
- 2
- /* ES2015 */
- );
- case 10:
- return t.createIdentifier("Function");
- case 9:
- return t.createIdentifier("Promise");
- case 11:
- return t.createIdentifier("Object");
- default:
- return E.assertNever(G);
- }
- }
- function B(ee, G) {
- return t.createLogicalAnd(
- t.createStrictInequality(t.createTypeOfExpression(ee), t.createStringLiteral("undefined")),
- G
- );
- }
- function z(ee) {
- if (ee.kind === 80) {
- const re = X(ee);
- return B(re, re);
- }
- if (ee.left.kind === 80)
- return B(X(ee.left), X(ee));
- const G = z(ee.left), ue = t.createTempVariable(n);
- return t.createLogicalAnd(
- t.createLogicalAnd(
- G.left,
- t.createStrictInequality(t.createAssignment(ue, G.right), t.createVoidZero())
- ),
- t.createPropertyAccessExpression(ue, ee.right)
- );
- }
- function X(ee) {
- switch (ee.kind) {
- case 80:
- const G = Aa(lt(gv.cloneNode(ee), ee), ee.parent);
- return G.original = void 0, Aa(G, fs(_)), G;
- case 166:
- return q(ee);
- }
- }
- function q(ee) {
- return t.createPropertyAccessExpression(X(ee.left), ee.right);
- }
- function V(ee) {
- return t.createConditionalExpression(
- t.createTypeCheck(t.createIdentifier(ee), "function"),
- /*questionToken*/
- void 0,
- t.createIdentifier(ee),
- /*colonToken*/
- void 0,
- t.createIdentifier("Object")
- );
- }
- function ae(ee, G) {
- return o < G ? V(ee) : t.createIdentifier(ee);
- }
- }
- function sne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- hoistVariableDeclaration: i
- } = e, s = e.getEmitResolver(), o = e.getCompilerOptions(), c = pa(o), _ = e.onSubstituteNode;
- e.onSubstituteNode = fe;
- let u;
- return Fd(e, d);
- function d(Re) {
- const ft = br(Re, h, e);
- return Ih(ft, e.readEmitHelpers()), ft;
- }
- function g(Re) {
- return dl(Re) ? void 0 : Re;
- }
- function h(Re) {
- if (!(Re.transformFlags & 33554432))
- return Re;
- switch (Re.kind) {
- case 170:
- return;
- case 263:
- return S(Re);
- case 231:
- return O(Re);
- case 176:
- return B(Re);
- case 174:
- return X(Re);
- case 178:
- return V(Re);
- case 177:
- return q(Re);
- case 172:
- return ae(Re);
- case 169:
- return ee(Re);
- default:
- return br(Re, h, e);
- }
- }
- function S(Re) {
- if (!(v0(
- /*useLegacyDecorators*/
- !0,
- Re
- ) || m4(
- /*useLegacyDecorators*/
- !0,
- Re
- )))
- return br(Re, h, e);
- const ft = v0(
- /*useLegacyDecorators*/
- !0,
- Re
- ) ? F(Re, Re.name) : I(Re, Re.name);
- return Ym(ft);
- }
- function T(Re) {
- return !!(Re.transformFlags & 536870912);
- }
- function C(Re) {
- return ut(Re, T);
- }
- function D(Re) {
- for (const ft of Re.members) {
- if (!Vb(ft)) continue;
- const Wt = XO(
- ft,
- Re,
- /*useLegacyDecorators*/
- !0
- );
- if (ut(Wt?.decorators, T) || ut(Wt?.parameters, C)) return !0;
- }
- return !1;
- }
- function P(Re, ft) {
- let Wt = [];
- return re(
- Wt,
- Re,
- /*isStatic*/
- !1
- ), re(
- Wt,
- Re,
- /*isStatic*/
- !0
- ), D(Re) && (ft = lt(
- t.createNodeArray([
- ...ft,
- t.createClassStaticBlockDeclaration(
- t.createBlock(
- Wt,
- /*multiLine*/
- !0
- )
- )
- ]),
- ft
- ), Wt = void 0), { decorationStatements: Wt, members: ft };
- }
- function I(Re, ft) {
- const Wt = Fr(Re.modifiers, g, ra), _r = Fr(Re.heritageClauses, h, ef);
- let Ir = Fr(Re.members, h, _l), jr = [];
- ({ members: Ir, decorationStatements: jr } = P(Re, Ir));
- const Nt = t.updateClassDeclaration(
- Re,
- Wt,
- ft,
- /*typeParameters*/
- void 0,
- _r,
- Ir
- );
- return Fn([Nt], jr);
- }
- function F(Re, ft) {
- const Wt = Gn(
- Re,
- 32
- /* Export */
- ), _r = Gn(
- Re,
- 2048
- /* Default */
- ), Ir = Fr(Re.modifiers, (Ot) => _A(Ot) || dl(Ot) ? void 0 : Ot, Bo), jr = gm(Re), Nt = tt(Re), Qt = c < 2 ? t.getInternalName(
- Re,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ) : t.getLocalName(
- Re,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ), Br = Fr(Re.heritageClauses, h, ef);
- let xr = Fr(Re.members, h, _l), zn = [];
- ({ members: xr, decorationStatements: zn } = P(Re, xr));
- const ki = c >= 9 && !!Nt && ut(xr, (Ot) => cs(Ot) && Gn(
- Ot,
- 256
- /* Static */
- ) || oc(Ot));
- ki && (xr = lt(
- t.createNodeArray([
- t.createClassStaticBlockDeclaration(
- t.createBlock([
- t.createExpressionStatement(
- t.createAssignment(Nt, t.createThis())
- )
- ])
- ),
- ...xr
- ]),
- xr
- ));
- const rs = t.createClassExpression(
- Ir,
- ft && jo(ft) ? void 0 : ft,
- /*typeParameters*/
- void 0,
- Br,
- xr
- );
- kn(rs, Re), lt(rs, jr);
- const ei = Nt && !ki ? t.createAssignment(Nt, rs) : rs, Ri = t.createVariableDeclaration(
- Qt,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- ei
- );
- kn(Ri, Re);
- const Jr = t.createVariableDeclarationList(
- [Ri],
- 1
- /* Let */
- ), ji = t.createVariableStatement(
- /*modifiers*/
- void 0,
- Jr
- );
- kn(ji, Re), lt(ji, jr), nl(ji, Re);
- const Fe = [ji];
- if (Fn(Fe, zn), oe(Fe, Re), Wt)
- if (_r) {
- const Ot = t.createExportDefault(Qt);
- Fe.push(Ot);
- } else {
- const Ot = t.createExternalModuleExport(t.getDeclarationName(Re));
- Fe.push(Ot);
- }
- return Fe;
- }
- function O(Re) {
- return t.updateClassExpression(
- Re,
- Fr(Re.modifiers, g, ra),
- Re.name,
- /*typeParameters*/
- void 0,
- Fr(Re.heritageClauses, h, ef),
- Fr(Re.members, h, _l)
- );
- }
- function B(Re) {
- return t.updateConstructorDeclaration(
- Re,
- Fr(Re.modifiers, g, ra),
- Fr(Re.parameters, h, Ii),
- Ge(Re.body, h, Cs)
- );
- }
- function z(Re, ft) {
- return Re !== ft && (nl(Re, ft), da(Re, gm(ft))), Re;
- }
- function X(Re) {
- return z(
- t.updateMethodDeclaration(
- Re,
- Fr(Re.modifiers, g, ra),
- Re.asteriskToken,
- E.checkDefined(Ge(Re.name, h, Bc)),
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- Fr(Re.parameters, h, Ii),
- /*type*/
- void 0,
- Ge(Re.body, h, Cs)
- ),
- Re
- );
- }
- function q(Re) {
- return z(
- t.updateGetAccessorDeclaration(
- Re,
- Fr(Re.modifiers, g, ra),
- E.checkDefined(Ge(Re.name, h, Bc)),
- Fr(Re.parameters, h, Ii),
- /*type*/
- void 0,
- Ge(Re.body, h, Cs)
- ),
- Re
- );
- }
- function V(Re) {
- return z(
- t.updateSetAccessorDeclaration(
- Re,
- Fr(Re.modifiers, g, ra),
- E.checkDefined(Ge(Re.name, h, Bc)),
- Fr(Re.parameters, h, Ii),
- Ge(Re.body, h, Cs)
- ),
- Re
- );
- }
- function ae(Re) {
- if (!(Re.flags & 33554432 || Gn(
- Re,
- 128
- /* Ambient */
- )))
- return z(
- t.updatePropertyDeclaration(
- Re,
- Fr(Re.modifiers, g, ra),
- E.checkDefined(Ge(Re.name, h, Bc)),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ge(Re.initializer, h, _t)
- ),
- Re
- );
- }
- function ee(Re) {
- const ft = t.updateParameterDeclaration(
- Re,
- Cte(t, Re.modifiers),
- Re.dotDotDotToken,
- E.checkDefined(Ge(Re.name, h, Y2)),
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- Ge(Re.initializer, h, _t)
- );
- return ft !== Re && (nl(ft, Re), lt(ft, gm(Re)), da(ft, gm(Re)), an(
- ft.name,
- 64
- /* NoTrailingSourceMap */
- )), ft;
- }
- function G(Re) {
- return K4(Re.expression, "___metadata");
- }
- function ue(Re) {
- if (!Re)
- return;
- const { false: ft, true: Wt } = dR(Re.decorators, G), _r = [];
- return Fn(_r, lr(ft, he)), Fn(_r, ta(Re.parameters, le)), Fn(_r, lr(Wt, he)), _r;
- }
- function re(Re, ft, Wt) {
- Fn(Re, lr(Se(ft, Wt), (_r) => t.createExpressionStatement(_r)));
- }
- function ne(Re, ft, Wt) {
- return Kw(
- /*useLegacyDecorators*/
- !0,
- Re,
- Wt
- ) && ft === zs(Re);
- }
- function ie(Re, ft) {
- return Ln(Re.members, (Wt) => ne(Wt, ft, Re));
- }
- function Se(Re, ft) {
- const Wt = ie(Re, ft);
- let _r;
- for (const Ir of Wt)
- _r = wr(_r, J(Re, Ir));
- return _r;
- }
- function J(Re, ft) {
- const Wt = XO(
- ft,
- Re,
- /*useLegacyDecorators*/
- !0
- ), _r = ue(Wt);
- if (!_r)
- return;
- const Ir = we(Re, ft), jr = me(
- ft,
- /*generateNameForComputedPropertyName*/
- !Gn(
- ft,
- 128
- /* Ambient */
- )
- ), Nt = cs(ft) && !dm(ft) ? t.createVoidZero() : t.createNull(), Qt = n().createDecorateHelper(
- _r,
- Ir,
- jr,
- Nt
- );
- return an(
- Qt,
- 3072
- /* NoComments */
- ), da(Qt, gm(ft)), Qt;
- }
- function oe(Re, ft) {
- const Wt = _e(ft);
- Wt && Re.push(kn(t.createExpressionStatement(Wt), ft));
- }
- function _e(Re) {
- const ft = cW(Re), Wt = ue(ft);
- if (!Wt)
- return;
- const _r = u && u[e_(Re)], Ir = c < 2 ? t.getInternalName(
- Re,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ) : t.getDeclarationName(
- Re,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ), jr = n().createDecorateHelper(Wt, Ir), Nt = t.createAssignment(Ir, _r ? t.createAssignment(_r, jr) : jr);
- return an(
- Nt,
- 3072
- /* NoComments */
- ), da(Nt, gm(Re)), Nt;
- }
- function he(Re) {
- return E.checkDefined(Ge(Re.expression, h, _t));
- }
- function le(Re, ft) {
- let Wt;
- if (Re) {
- Wt = [];
- for (const _r of Re) {
- const Ir = n().createParamHelper(
- he(_r),
- ft
- );
- lt(Ir, _r.expression), an(
- Ir,
- 3072
- /* NoComments */
- ), Wt.push(Ir);
- }
- }
- return Wt;
- }
- function me(Re, ft) {
- const Wt = Re.name;
- return Di(Wt) ? t.createIdentifier("") : ma(Wt) ? ft && !fg(Wt.expression) ? t.getGeneratedNameForNode(Wt) : Wt.expression : Oe(Wt) ? t.createStringLiteral(Nn(Wt)) : t.cloneNode(Wt);
- }
- function ve() {
- u || (e.enableSubstitution(
- 80
- /* Identifier */
- ), u = []);
- }
- function tt(Re) {
- if (s.hasNodeCheckFlag(
- Re,
- 262144
- /* ContainsConstructorReference */
- )) {
- ve();
- const ft = t.createUniqueName(Re.name && !jo(Re.name) ? Nn(Re.name) : "default");
- return u[e_(Re)] = ft, i(ft), ft;
- }
- }
- function Te(Re) {
- return t.createPropertyAccessExpression(t.getDeclarationName(Re), "prototype");
- }
- function we(Re, ft) {
- return zs(ft) ? t.getDeclarationName(Re) : Te(Re);
- }
- function fe(Re, ft) {
- return ft = _(Re, ft), Re === 1 ? Me(ft) : ft;
- }
- function Me(Re) {
- switch (Re.kind) {
- case 80:
- return Qe(Re);
- }
- return Re;
- }
- function Qe(Re) {
- return et(Re) ?? Re;
- }
- function et(Re) {
- if (u && s.hasNodeCheckFlag(
- Re,
- 536870912
- /* ConstructorReference */
- )) {
- const ft = s.getReferencedValueDeclaration(Re);
- if (ft) {
- const Wt = u[ft.id];
- if (Wt) {
- const _r = t.cloneNode(Wt);
- return da(_r, Re), nl(_r, Re), _r;
- }
- }
- }
- }
- }
- function ane(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- startLexicalEnvironment: i,
- endLexicalEnvironment: s,
- hoistVariableDeclaration: o
- } = e, c = pa(e.getCompilerOptions());
- let _, u, d, g, h, S;
- return Fd(e, T);
- function T(U) {
- _ = void 0, S = !1;
- const be = br(U, V, e);
- return Ih(be, e.readEmitHelpers()), S && (bx(
- be,
- 32
- /* TransformPrivateStaticElements */
- ), S = !1), be;
- }
- function C() {
- switch (u = void 0, d = void 0, g = void 0, _?.kind) {
- case "class":
- u = _.classInfo;
- break;
- case "class-element":
- u = _.next.classInfo, d = _.classThis, g = _.classSuper;
- break;
- case "name":
- const U = _.next.next.next;
- U?.kind === "class-element" && (u = U.next.classInfo, d = U.classThis, g = U.classSuper);
- break;
- }
- }
- function D(U) {
- _ = { kind: "class", next: _, classInfo: U, savedPendingExpressions: h }, h = void 0, C();
- }
- function P() {
- E.assert(_?.kind === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${_?.kind}' instead.`), h = _.savedPendingExpressions, _ = _.next, C();
- }
- function I(U) {
- var be, Z;
- E.assert(_?.kind === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${_?.kind}' instead.`), _ = { kind: "class-element", next: _ }, (oc(U) || cs(U) && tl(U)) && (_.classThis = (be = _.next.classInfo) == null ? void 0 : be.classThis, _.classSuper = (Z = _.next.classInfo) == null ? void 0 : Z.classSuper), C();
- }
- function F() {
- var U;
- E.assert(_?.kind === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${_?.kind}' instead.`), E.assert(((U = _.next) == null ? void 0 : U.kind) === "class", "Incorrect value for top.next.kind.", () => {
- var be;
- return `Expected top.next.kind to be 'class' but got '${(be = _.next) == null ? void 0 : be.kind}' instead.`;
- }), _ = _.next, C();
- }
- function O() {
- E.assert(_?.kind === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${_?.kind}' instead.`), _ = { kind: "name", next: _ }, C();
- }
- function B() {
- E.assert(_?.kind === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${_?.kind}' instead.`), _ = _.next, C();
- }
- function z() {
- _?.kind === "other" ? (E.assert(!h), _.depth++) : (_ = { kind: "other", next: _, depth: 0, savedPendingExpressions: h }, h = void 0, C());
- }
- function X() {
- E.assert(_?.kind === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${_?.kind}' instead.`), _.depth > 0 ? (E.assert(!h), _.depth--) : (h = _.savedPendingExpressions, _ = _.next, C());
- }
- function q(U) {
- return !!(U.transformFlags & 33554432) || !!d && !!(U.transformFlags & 16384) || !!d && !!g && !!(U.transformFlags & 134217728);
- }
- function V(U) {
- if (!q(U))
- return U;
- switch (U.kind) {
- case 170:
- return E.fail("Use `modifierVisitor` instead.");
- case 263:
- return _e(U);
- case 231:
- return he(U);
- case 176:
- case 172:
- case 175:
- return E.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");
- case 169:
- return jr(U);
- case 226:
- return zn(
- U,
- /*discarded*/
- !1
- );
- case 303:
- return ji(U);
- case 260:
- return Fe(U);
- case 208:
- return Ot(U);
- case 277:
- return Xe(U);
- case 110:
- return Re(U);
- case 248:
- return Br(U);
- case 244:
- return xr(U);
- case 355:
- return rs(
- U,
- /*discarded*/
- !1
- );
- case 217:
- return Tt(
- U,
- /*discarded*/
- !1
- );
- case 354:
- return te(
- U
- );
- case 213:
- return ft(U);
- case 215:
- return Wt(U);
- case 224:
- case 225:
- return ki(
- U,
- /*discarded*/
- !1
- );
- case 211:
- return _r(U);
- case 212:
- return Ir(U);
- case 167:
- return Jr(U);
- case 174:
- case 178:
- case 177:
- case 218:
- case 262: {
- z();
- const be = br(U, ae, e);
- return X(), be;
- }
- default:
- return br(U, ae, e);
- }
- }
- function ae(U) {
- switch (U.kind) {
- case 170:
- return;
- default:
- return V(U);
- }
- }
- function ee(U) {
- switch (U.kind) {
- case 170:
- return;
- default:
- return U;
- }
- }
- function G(U) {
- switch (U.kind) {
- case 176:
- return ve(U);
- case 174:
- return we(U);
- case 177:
- return fe(U);
- case 178:
- return Me(U);
- case 172:
- return et(U);
- case 175:
- return Qe(U);
- default:
- return V(U);
- }
- }
- function ue(U) {
- switch (U.kind) {
- case 224:
- case 225:
- return ki(
- U,
- /*discarded*/
- !0
- );
- case 226:
- return zn(
- U,
- /*discarded*/
- !0
- );
- case 355:
- return rs(
- U,
- /*discarded*/
- !0
- );
- case 217:
- return Tt(
- U,
- /*discarded*/
- !0
- );
- default:
- return V(U);
- }
- }
- function re(U) {
- let be = U.name && Oe(U.name) && !jo(U.name) ? Nn(U.name) : U.name && Di(U.name) && !jo(U.name) ? Nn(U.name).slice(1) : U.name && oa(U.name) && k_(
- U.name.text,
- 99
- /* ESNext */
- ) ? U.name.text : Zn(U) ? "class" : "member";
- return d0(U) && (be = `get_${be}`), om(U) && (be = `set_${be}`), U.name && Di(U.name) && (be = `private_${be}`), zs(U) && (be = `static_${be}`), "_" + be;
- }
- function ne(U, be) {
- return t.createUniqueName(
- `${re(U)}_${be}`,
- 24
- /* ReservedInNestedScopes */
- );
- }
- function ie(U, be) {
- return t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- U,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- be
- )
- ],
- 1
- /* Let */
- )
- );
- }
- function Se(U) {
- const be = t.createUniqueName(
- "_metadata",
- 48
- /* FileLevel */
- );
- let Z, ht, Le = !1, Ie = !1, At = !1, Dr, yr, $r;
- if (bC(
- /*useLegacyDecorators*/
- !1,
- U
- )) {
- const nt = ut(U.members, (ot) => (Ou(ot) || u_(ot)) && tl(ot));
- Dr = t.createUniqueName(
- "_classThis",
- nt ? 24 : 48
- /* FileLevel */
- );
- }
- for (const nt of U.members) {
- if (UT(nt) && Kw(
- /*useLegacyDecorators*/
- !1,
- nt,
- U
- ))
- if (tl(nt)) {
- if (!ht) {
- ht = t.createUniqueName(
- "_staticExtraInitializers",
- 48
- /* FileLevel */
- );
- const ot = n().createRunInitializersHelper(Dr ?? t.createThis(), ht);
- da(ot, U.name ?? wh(U)), yr ?? (yr = []), yr.push(ot);
- }
- } else {
- if (!Z) {
- Z = t.createUniqueName(
- "_instanceExtraInitializers",
- 48
- /* FileLevel */
- );
- const ot = n().createRunInitializersHelper(t.createThis(), Z);
- da(ot, U.name ?? wh(U)), $r ?? ($r = []), $r.push(ot);
- }
- Z ?? (Z = t.createUniqueName(
- "_instanceExtraInitializers",
- 48
- /* FileLevel */
- ));
- }
- if (oc(nt) ? Hx(nt) || (Le = !0) : cs(nt) && (tl(nt) ? Le || (Le = !!nt.initializer || Ff(nt)) : Ie || (Ie = !Hj(nt))), (Ou(nt) || u_(nt)) && tl(nt) && (At = !0), ht && Z && Le && Ie && At)
- break;
- }
- return {
- class: U,
- classThis: Dr,
- metadataReference: be,
- instanceMethodExtraInitializersName: Z,
- staticMethodExtraInitializersName: ht,
- hasStaticInitializers: Le,
- hasNonAmbientInstanceFields: Ie,
- hasStaticPrivateClassElements: At,
- pendingStaticInitializers: yr,
- pendingInstanceInitializers: $r
- };
- }
- function J(U) {
- i(), !_W(U) && v0(
- /*useLegacyDecorators*/
- !1,
- U
- ) && (U = ZO(e, U, t.createStringLiteral("")));
- const be = t.getLocalName(
- U,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !1,
- /*ignoreAssignedName*/
- !0
- ), Z = Se(U), ht = [];
- let Le, Ie, At, Dr, yr = !1;
- const $r = Ve(cW(U));
- $r && (Z.classDecoratorsName = t.createUniqueName(
- "_classDecorators",
- 48
- /* FileLevel */
- ), Z.classDescriptorName = t.createUniqueName(
- "_classDescriptor",
- 48
- /* FileLevel */
- ), Z.classExtraInitializersName = t.createUniqueName(
- "_classExtraInitializers",
- 48
- /* FileLevel */
- ), E.assertIsDefined(Z.classThis), ht.push(
- ie(Z.classDecoratorsName, t.createArrayLiteralExpression($r)),
- ie(Z.classDescriptorName),
- ie(Z.classExtraInitializersName, t.createArrayLiteralExpression()),
- ie(Z.classThis)
- ), Z.hasStaticPrivateClassElements && (yr = !0, S = !0));
- const nt = y3(
- U.heritageClauses,
- 96
- /* ExtendsKeyword */
- ), ot = nt && el(nt.types), wt = ot && Ge(ot.expression, V, _t);
- if (wt) {
- Z.classSuper = t.createUniqueName(
- "_classSuper",
- 48
- /* FileLevel */
- );
- const Kt = Dc(wt), hr = $c(Kt) && !Kt.name || vo(Kt) && !Kt.name || Co(Kt) ? t.createComma(t.createNumericLiteral(0), wt) : wt;
- ht.push(ie(Z.classSuper, hr));
- const Ft = t.updateExpressionWithTypeArguments(
- ot,
- Z.classSuper,
- /*typeArguments*/
- void 0
- ), Ss = t.updateHeritageClause(nt, [Ft]);
- Dr = t.createNodeArray([Ss]);
- }
- const jt = Z.classThis ?? t.createThis();
- D(Z), Le = wr(Le, M(Z.metadataReference, Z.classSuper));
- let Xt = U.members;
- if (Xt = Fr(Xt, (Kt) => Qo(Kt) ? Kt : G(Kt), _l), Xt = Fr(Xt, (Kt) => Qo(Kt) ? G(Kt) : Kt, _l), h) {
- let Kt;
- for (let hr of h) {
- hr = Ge(hr, function Ss(gs) {
- if (!(gs.transformFlags & 16384))
- return gs;
- switch (gs.kind) {
- case 110:
- return Kt || (Kt = t.createUniqueName(
- "_outerThis",
- 16
- /* Optimistic */
- ), ht.unshift(ie(Kt, t.createThis()))), Kt;
- default:
- return br(gs, Ss, e);
- }
- }, _t);
- const Ft = t.createExpressionStatement(hr);
- Le = wr(Le, Ft);
- }
- h = void 0;
- }
- if (P(), ut(Z.pendingInstanceInitializers) && !Bg(U)) {
- const Kt = le(U, Z);
- if (Kt) {
- const hr = _m(U), Ft = !!(hr && Dc(hr.expression).kind !== 106), Ss = [];
- if (Ft) {
- const Ts = t.createSpreadElement(t.createIdentifier("arguments")), Ua = t.createCallExpression(
- t.createSuper(),
- /*typeArguments*/
- void 0,
- [Ts]
- );
- Ss.push(t.createExpressionStatement(Ua));
- }
- Fn(Ss, Kt);
- const gs = t.createBlock(
- Ss,
- /*multiLine*/
- !0
- );
- At = t.createConstructorDeclaration(
- /*modifiers*/
- void 0,
- [],
- gs
- );
- }
- }
- if (Z.staticMethodExtraInitializersName && ht.push(
- ie(Z.staticMethodExtraInitializersName, t.createArrayLiteralExpression())
- ), Z.instanceMethodExtraInitializersName && ht.push(
- ie(Z.instanceMethodExtraInitializersName, t.createArrayLiteralExpression())
- ), Z.memberInfos && El(Z.memberInfos, (Kt, hr) => {
- zs(hr) && (ht.push(ie(Kt.memberDecoratorsName)), Kt.memberInitializersName && ht.push(ie(Kt.memberInitializersName, t.createArrayLiteralExpression())), Kt.memberExtraInitializersName && ht.push(ie(Kt.memberExtraInitializersName, t.createArrayLiteralExpression())), Kt.memberDescriptorName && ht.push(ie(Kt.memberDescriptorName)));
- }), Z.memberInfos && El(Z.memberInfos, (Kt, hr) => {
- zs(hr) || (ht.push(ie(Kt.memberDecoratorsName)), Kt.memberInitializersName && ht.push(ie(Kt.memberInitializersName, t.createArrayLiteralExpression())), Kt.memberExtraInitializersName && ht.push(ie(Kt.memberExtraInitializersName, t.createArrayLiteralExpression())), Kt.memberDescriptorName && ht.push(ie(Kt.memberDescriptorName)));
- }), Le = Fn(Le, Z.staticNonFieldDecorationStatements), Le = Fn(Le, Z.nonStaticNonFieldDecorationStatements), Le = Fn(Le, Z.staticFieldDecorationStatements), Le = Fn(Le, Z.nonStaticFieldDecorationStatements), Z.classDescriptorName && Z.classDecoratorsName && Z.classExtraInitializersName && Z.classThis) {
- Le ?? (Le = []);
- const Kt = t.createPropertyAssignment("value", jt), hr = t.createObjectLiteralExpression([Kt]), Ft = t.createAssignment(Z.classDescriptorName, hr), Ss = t.createPropertyAccessExpression(jt, "name"), gs = n().createESDecorateHelper(
- t.createNull(),
- Ft,
- Z.classDecoratorsName,
- { kind: "class", name: Ss, metadata: Z.metadataReference },
- t.createNull(),
- Z.classExtraInitializersName
- ), Ts = t.createExpressionStatement(gs);
- da(Ts, wh(U)), Le.push(Ts);
- const Ua = t.createPropertyAccessExpression(Z.classDescriptorName, "value"), lc = t.createAssignment(Z.classThis, Ua), Ic = t.createAssignment(be, lc);
- Le.push(t.createExpressionStatement(Ic));
- }
- if (Le.push(Ae(jt, Z.metadataReference)), ut(Z.pendingStaticInitializers)) {
- for (const Kt of Z.pendingStaticInitializers) {
- const hr = t.createExpressionStatement(Kt);
- da(hr, E0(Kt)), Ie = wr(Ie, hr);
- }
- Z.pendingStaticInitializers = void 0;
- }
- if (Z.classExtraInitializersName) {
- const Kt = n().createRunInitializersHelper(jt, Z.classExtraInitializersName), hr = t.createExpressionStatement(Kt);
- da(hr, U.name ?? wh(U)), Ie = wr(Ie, hr);
- }
- Le && Ie && !Z.hasStaticInitializers && (Fn(Le, Ie), Ie = void 0);
- const Ht = Le && t.createClassStaticBlockDeclaration(t.createBlock(
- Le,
- /*multiLine*/
- !0
- ));
- Ht && yr && Q3(
- Ht,
- 32
- /* TransformPrivateStaticElements */
- );
- const en = Ie && t.createClassStaticBlockDeclaration(t.createBlock(
- Ie,
- /*multiLine*/
- !0
- ));
- if (Ht || At || en) {
- const Kt = [], hr = Xt.findIndex(Hx);
- Ht ? (Fn(Kt, Xt, 0, hr + 1), Kt.push(Ht), Fn(Kt, Xt, hr + 1)) : Fn(Kt, Xt), At && Kt.push(At), en && Kt.push(en), Xt = lt(t.createNodeArray(Kt), Xt);
- }
- const zt = s();
- let mr;
- if ($r) {
- mr = t.createClassExpression(
- /*modifiers*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- Dr,
- Xt
- ), Z.classThis && (mr = Zre(t, mr, Z.classThis));
- const Kt = t.createVariableDeclaration(
- be,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- mr
- ), hr = t.createVariableDeclarationList([Kt]), Ft = Z.classThis ? t.createAssignment(be, Z.classThis) : be;
- ht.push(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- hr
- ),
- t.createReturnStatement(Ft)
- );
- } else
- mr = t.createClassExpression(
- /*modifiers*/
- void 0,
- U.name,
- /*typeParameters*/
- void 0,
- Dr,
- Xt
- ), ht.push(t.createReturnStatement(mr));
- if (yr) {
- bx(
- mr,
- 32
- /* TransformPrivateStaticElements */
- );
- for (const Kt of mr.members)
- (Ou(Kt) || u_(Kt)) && tl(Kt) && bx(
- Kt,
- 32
- /* TransformPrivateStaticElements */
- );
- }
- return kn(mr, U), t.createImmediatelyInvokedArrowFunction(t.mergeLexicalEnvironment(ht, zt));
- }
- function oe(U) {
- return v0(
- /*useLegacyDecorators*/
- !1,
- U
- ) || m4(
- /*useLegacyDecorators*/
- !1,
- U
- );
- }
- function _e(U) {
- if (oe(U)) {
- const be = [], Z = Ho(U, Zn) ?? U, ht = Z.name ? t.createStringLiteralFromNode(Z.name) : t.createStringLiteral("default"), Le = Gn(
- U,
- 32
- /* Export */
- ), Ie = Gn(
- U,
- 2048
- /* Default */
- );
- if (U.name || (U = ZO(e, U, ht)), Le && Ie) {
- const At = J(U);
- if (U.name) {
- const Dr = t.createVariableDeclaration(
- t.getLocalName(U),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- At
- );
- kn(Dr, U);
- const yr = t.createVariableDeclarationList(
- [Dr],
- 1
- /* Let */
- ), $r = t.createVariableStatement(
- /*modifiers*/
- void 0,
- yr
- );
- be.push($r);
- const nt = t.createExportDefault(t.getDeclarationName(U));
- kn(nt, U), nl(nt, ym(U)), da(nt, wh(U)), be.push(nt);
- } else {
- const Dr = t.createExportDefault(At);
- kn(Dr, U), nl(Dr, ym(U)), da(Dr, wh(U)), be.push(Dr);
- }
- } else {
- E.assertIsDefined(U.name, "A class declaration that is not a default export must have a name.");
- const At = J(U), Dr = Le ? (jt) => Cx(jt) ? void 0 : ee(jt) : ee, yr = Fr(U.modifiers, Dr, ra), $r = t.getLocalName(
- U,
- /*allowComments*/
- !1,
- /*allowSourceMaps*/
- !0
- ), nt = t.createVariableDeclaration(
- $r,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- At
- );
- kn(nt, U);
- const ot = t.createVariableDeclarationList(
- [nt],
- 1
- /* Let */
- ), wt = t.createVariableStatement(yr, ot);
- if (kn(wt, U), nl(wt, ym(U)), be.push(wt), Le) {
- const jt = t.createExternalModuleExport($r);
- kn(jt, U), be.push(jt);
- }
- }
- return Ym(be);
- } else {
- const be = Fr(U.modifiers, ee, ra), Z = Fr(U.heritageClauses, V, ef);
- D(
- /*classInfo*/
- void 0
- );
- const ht = Fr(U.members, G, _l);
- return P(), t.updateClassDeclaration(
- U,
- be,
- U.name,
- /*typeParameters*/
- void 0,
- Z,
- ht
- );
- }
- }
- function he(U) {
- if (oe(U)) {
- const be = J(U);
- return kn(be, U), be;
- } else {
- const be = Fr(U.modifiers, ee, ra), Z = Fr(U.heritageClauses, V, ef);
- D(
- /*classInfo*/
- void 0
- );
- const ht = Fr(U.members, G, _l);
- return P(), t.updateClassExpression(
- U,
- be,
- U.name,
- /*typeParameters*/
- void 0,
- Z,
- ht
- );
- }
- }
- function le(U, be) {
- if (ut(be.pendingInstanceInitializers)) {
- const Z = [];
- return Z.push(
- t.createExpressionStatement(
- t.inlineExpressions(be.pendingInstanceInitializers)
- )
- ), be.pendingInstanceInitializers = void 0, Z;
- }
- }
- function me(U, be, Z, ht, Le, Ie) {
- const At = ht[Le], Dr = be[At];
- if (Fn(U, Fr(be, V, bi, Z, At - Z)), gS(Dr)) {
- const yr = [];
- me(
- yr,
- Dr.tryBlock.statements,
- /*statementOffset*/
- 0,
- ht,
- Le + 1,
- Ie
- );
- const $r = t.createNodeArray(yr);
- lt($r, Dr.tryBlock.statements), U.push(t.updateTryStatement(
- Dr,
- t.updateBlock(Dr.tryBlock, yr),
- Ge(Dr.catchClause, V, Ub),
- Ge(Dr.finallyBlock, V, Cs)
- ));
- } else
- Fn(U, Fr(be, V, bi, At, 1)), Fn(U, Ie);
- Fn(U, Fr(be, V, bi, At + 1));
- }
- function ve(U) {
- I(U);
- const be = Fr(U.modifiers, ee, ra), Z = Fr(U.parameters, V, Ii);
- let ht;
- if (U.body && u) {
- const Le = le(u.class, u);
- if (Le) {
- const Ie = [], At = t.copyPrologue(
- U.body.statements,
- Ie,
- /*ensureUseStrict*/
- !1,
- V
- ), Dr = GO(U.body.statements, At);
- Dr.length > 0 ? me(Ie, U.body.statements, At, Dr, 0, Le) : (Fn(Ie, Le), Fn(Ie, Fr(U.body.statements, V, bi))), ht = t.createBlock(
- Ie,
- /*multiLine*/
- !0
- ), kn(ht, U.body), lt(ht, U.body);
- }
- }
- return ht ?? (ht = Ge(U.body, V, Cs)), F(), t.updateConstructorDeclaration(U, be, Z, ht);
- }
- function tt(U, be) {
- return U !== be && (nl(U, be), da(U, wh(be))), U;
- }
- function Te(U, be, Z) {
- let ht, Le, Ie, At, Dr, yr;
- if (!be) {
- const ot = Fr(U.modifiers, ee, ra);
- return O(), Le = Ri(U.name), B(), { modifiers: ot, referencedName: ht, name: Le, initializersName: Ie, descriptorName: yr, thisArg: Dr };
- }
- const $r = Ve(XO(
- U,
- be.class,
- /*useLegacyDecorators*/
- !1
- )), nt = Fr(U.modifiers, ee, ra);
- if ($r) {
- const ot = ne(U, "decorators"), wt = t.createArrayLiteralExpression($r), jt = t.createAssignment(ot, wt), Xt = { memberDecoratorsName: ot };
- be.memberInfos ?? (be.memberInfos = /* @__PURE__ */ new Map()), be.memberInfos.set(U, Xt), h ?? (h = []), h.push(jt);
- const Ht = UT(U) || u_(U) ? zs(U) ? be.staticNonFieldDecorationStatements ?? (be.staticNonFieldDecorationStatements = []) : be.nonStaticNonFieldDecorationStatements ?? (be.nonStaticNonFieldDecorationStatements = []) : cs(U) && !u_(U) ? zs(U) ? be.staticFieldDecorationStatements ?? (be.staticFieldDecorationStatements = []) : be.nonStaticFieldDecorationStatements ?? (be.nonStaticFieldDecorationStatements = []) : E.fail(), en = Lf(U) ? "getter" : K_(U) ? "setter" : hc(U) ? "method" : u_(U) ? "accessor" : cs(U) ? "field" : E.fail();
- let zt;
- if (Oe(U.name) || Di(U.name))
- zt = { computed: !1, name: U.name };
- else if (fm(U.name))
- zt = { computed: !0, name: t.createStringLiteralFromNode(U.name) };
- else {
- const Kt = U.name.expression;
- fm(Kt) && !Oe(Kt) ? zt = { computed: !0, name: t.createStringLiteralFromNode(Kt) } : (O(), { referencedName: ht, name: Le } = ei(U.name), zt = { computed: !0, name: ht }, B());
- }
- const mr = {
- kind: en,
- name: zt,
- static: zs(U),
- private: Di(U.name),
- access: {
- // 15.7.3 CreateDecoratorAccessObject (kind, name)
- // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ...
- get: cs(U) || Lf(U) || hc(U),
- // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ...
- set: cs(U) || K_(U)
- },
- metadata: be.metadataReference
- };
- if (UT(U)) {
- const Kt = zs(U) ? be.staticMethodExtraInitializersName : be.instanceMethodExtraInitializersName;
- E.assertIsDefined(Kt);
- let hr;
- Ou(U) && Z && (hr = Z(U, Fr(nt, (gs) => Wn(gs, tD), ra)), Xt.memberDescriptorName = yr = ne(U, "descriptor"), hr = t.createAssignment(yr, hr));
- const Ft = n().createESDecorateHelper(t.createThis(), hr ?? t.createNull(), ot, mr, t.createNull(), Kt), Ss = t.createExpressionStatement(Ft);
- da(Ss, wh(U)), Ht.push(Ss);
- } else if (cs(U)) {
- Ie = Xt.memberInitializersName ?? (Xt.memberInitializersName = ne(U, "initializers")), At = Xt.memberExtraInitializersName ?? (Xt.memberExtraInitializersName = ne(U, "extraInitializers")), zs(U) && (Dr = be.classThis);
- let Kt;
- Ou(U) && dm(U) && Z && (Kt = Z(
- U,
- /*modifiers*/
- void 0
- ), Xt.memberDescriptorName = yr = ne(U, "descriptor"), Kt = t.createAssignment(yr, Kt));
- const hr = n().createESDecorateHelper(
- u_(U) ? t.createThis() : t.createNull(),
- Kt ?? t.createNull(),
- ot,
- mr,
- Ie,
- At
- ), Ft = t.createExpressionStatement(hr);
- da(Ft, wh(U)), Ht.push(Ft);
- }
- }
- return Le === void 0 && (O(), Le = Ri(U.name), B()), !ut(nt) && (hc(U) || cs(U)) && an(
- Le,
- 1024
- /* NoLeadingComments */
- ), { modifiers: nt, referencedName: ht, name: Le, initializersName: Ie, extraInitializersName: At, descriptorName: yr, thisArg: Dr };
- }
- function we(U) {
- I(U);
- const { modifiers: be, name: Z, descriptorName: ht } = Te(U, u, at);
- if (ht)
- return F(), tt(Vt(be, Z, ht), U);
- {
- const Le = Fr(U.parameters, V, Ii), Ie = Ge(U.body, V, Cs);
- return F(), tt(t.updateMethodDeclaration(
- U,
- be,
- U.asteriskToken,
- Z,
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- Le,
- /*type*/
- void 0,
- Ie
- ), U);
- }
- }
- function fe(U) {
- I(U);
- const { modifiers: be, name: Z, descriptorName: ht } = Te(U, u, $e);
- if (ht)
- return F(), tt(Zt(be, Z, ht), U);
- {
- const Le = Fr(U.parameters, V, Ii), Ie = Ge(U.body, V, Cs);
- return F(), tt(t.updateGetAccessorDeclaration(
- U,
- be,
- Z,
- Le,
- /*type*/
- void 0,
- Ie
- ), U);
- }
- }
- function Me(U) {
- I(U);
- const { modifiers: be, name: Z, descriptorName: ht } = Te(U, u, bt);
- if (ht)
- return F(), tt(vn(be, Z, ht), U);
- {
- const Le = Fr(U.parameters, V, Ii), Ie = Ge(U.body, V, Cs);
- return F(), tt(t.updateSetAccessorDeclaration(U, be, Z, Le, Ie), U);
- }
- }
- function Qe(U) {
- I(U);
- let be;
- if (Hx(U))
- be = br(U, V, e);
- else if (ND(U)) {
- const Z = d;
- d = void 0, be = br(U, V, e), d = Z;
- } else if (U = br(U, V, e), be = U, u && (u.hasStaticInitializers = !0, ut(u.pendingStaticInitializers))) {
- const Z = [];
- for (const Ie of u.pendingStaticInitializers) {
- const At = t.createExpressionStatement(Ie);
- da(At, E0(Ie)), Z.push(At);
- }
- const ht = t.createBlock(
- Z,
- /*multiLine*/
- !0
- );
- be = [t.createClassStaticBlockDeclaration(ht), be], u.pendingStaticInitializers = void 0;
- }
- return F(), be;
- }
- function et(U) {
- Q_(U, Nt) && (U = tf(e, U, Qt(U.initializer))), I(U), E.assert(!Hj(U), "Not yet implemented.");
- const { modifiers: be, name: Z, initializersName: ht, extraInitializersName: Le, descriptorName: Ie, thisArg: At } = Te(U, u, dm(U) ? He : void 0);
- i();
- let Dr = Ge(U.initializer, V, _t);
- ht && (Dr = n().createRunInitializersHelper(
- At ?? t.createThis(),
- ht,
- Dr ?? t.createVoidZero()
- )), zs(U) && u && Dr && (u.hasStaticInitializers = !0);
- const yr = s();
- if (ut(yr) && (Dr = t.createImmediatelyInvokedArrowFunction([
- ...yr,
- t.createReturnStatement(Dr)
- ])), u && (zs(U) ? (Dr = De(
- u,
- /*isStatic*/
- !0,
- Dr
- ), Le && (u.pendingStaticInitializers ?? (u.pendingStaticInitializers = []), u.pendingStaticInitializers.push(
- n().createRunInitializersHelper(
- u.classThis ?? t.createThis(),
- Le
- )
- ))) : (Dr = De(
- u,
- /*isStatic*/
- !1,
- Dr
- ), Le && (u.pendingInstanceInitializers ?? (u.pendingInstanceInitializers = []), u.pendingInstanceInitializers.push(
- n().createRunInitializersHelper(
- t.createThis(),
- Le
- )
- )))), F(), dm(U) && Ie) {
- const $r = ym(U), nt = E0(U), ot = U.name;
- let wt = ot, jt = ot;
- if (ma(ot) && !fg(ot.expression)) {
- const mr = pO(ot);
- if (mr)
- wt = t.updateComputedPropertyName(ot, Ge(ot.expression, V, _t)), jt = t.updateComputedPropertyName(ot, mr.left);
- else {
- const Kt = t.createTempVariable(o);
- da(Kt, ot.expression);
- const hr = Ge(ot.expression, V, _t), Ft = t.createAssignment(Kt, hr);
- da(Ft, ot.expression), wt = t.updateComputedPropertyName(ot, Ft), jt = t.updateComputedPropertyName(ot, Kt);
- }
- }
- const Xt = Fr(be, (mr) => mr.kind !== 129 ? mr : void 0, ra), Ht = az(t, U, Xt, Dr);
- kn(Ht, U), an(
- Ht,
- 3072
- /* NoComments */
- ), da(Ht, nt), da(Ht.name, U.name);
- const en = Zt(Xt, wt, Ie);
- kn(en, U), nl(en, $r), da(en, nt);
- const zt = vn(Xt, jt, Ie);
- return kn(zt, U), an(
- zt,
- 3072
- /* NoComments */
- ), da(zt, nt), [Ht, en, zt];
- }
- return tt(t.updatePropertyDeclaration(
- U,
- be,
- Z,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- Dr
- ), U);
- }
- function Re(U) {
- return d ?? U;
- }
- function ft(U) {
- if (C_(U.expression) && d) {
- const be = Ge(U.expression, V, _t), Z = Fr(U.arguments, V, _t), ht = t.createFunctionCallCall(be, d, Z);
- return kn(ht, U), lt(ht, U), ht;
- }
- return br(U, V, e);
- }
- function Wt(U) {
- if (C_(U.tag) && d) {
- const be = Ge(U.tag, V, _t), Z = t.createFunctionBindCall(be, d, []);
- kn(Z, U), lt(Z, U);
- const ht = Ge(U.template, V, VT);
- return t.updateTaggedTemplateExpression(
- U,
- Z,
- /*typeArguments*/
- void 0,
- ht
- );
- }
- return br(U, V, e);
- }
- function _r(U) {
- if (C_(U) && Oe(U.name) && d && g) {
- const be = t.createStringLiteralFromNode(U.name), Z = t.createReflectGetCall(g, be, d);
- return kn(Z, U.expression), lt(Z, U.expression), Z;
- }
- return br(U, V, e);
- }
- function Ir(U) {
- if (C_(U) && d && g) {
- const be = Ge(U.argumentExpression, V, _t), Z = t.createReflectGetCall(g, be, d);
- return kn(Z, U.expression), lt(Z, U.expression), Z;
- }
- return br(U, V, e);
- }
- function jr(U) {
- Q_(U, Nt) && (U = tf(e, U, Qt(U.initializer)));
- const be = t.updateParameterDeclaration(
- U,
- /*modifiers*/
- void 0,
- U.dotDotDotToken,
- Ge(U.name, V, Y2),
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- Ge(U.initializer, V, _t)
- );
- return be !== U && (nl(be, U), lt(be, gm(U)), da(be, gm(U)), an(
- be.name,
- 64
- /* NoTrailingSourceMap */
- )), be;
- }
- function Nt(U) {
- return $c(U) && !U.name && oe(U);
- }
- function Qt(U) {
- const be = Dc(U);
- return $c(be) && !be.name && !v0(
- /*useLegacyDecorators*/
- !1,
- be
- );
- }
- function Br(U) {
- return t.updateForStatement(
- U,
- Ge(U.initializer, ue, ip),
- Ge(U.condition, V, _t),
- Ge(U.incrementor, ue, _t),
- Ku(U.statement, V, e)
- );
- }
- function xr(U) {
- return br(U, ue, e);
- }
- function zn(U, be) {
- if (x0(U)) {
- const Z = Ea(U.left), ht = Ge(U.right, V, _t);
- return t.updateBinaryExpression(U, Z, U.operatorToken, ht);
- }
- if (Dl(U)) {
- if (Q_(U, Nt))
- return U = tf(e, U, Qt(U.right)), br(U, V, e);
- if (C_(U.left) && d && g) {
- let Z = ko(U.left) ? Ge(U.left.argumentExpression, V, _t) : Oe(U.left.name) ? t.createStringLiteralFromNode(U.left.name) : void 0;
- if (Z) {
- let ht = Ge(U.right, V, _t);
- if (PD(U.operatorToken.kind)) {
- let Ie = Z;
- fg(Z) || (Ie = t.createTempVariable(o), Z = t.createAssignment(Ie, Z));
- const At = t.createReflectGetCall(
- g,
- Ie,
- d
- );
- kn(At, U.left), lt(At, U.left), ht = t.createBinaryExpression(
- At,
- wD(U.operatorToken.kind),
- ht
- ), lt(ht, U);
- }
- const Le = be ? void 0 : t.createTempVariable(o);
- return Le && (ht = t.createAssignment(Le, ht), lt(Le, U)), ht = t.createReflectSetCall(
- g,
- Z,
- ht,
- d
- ), kn(ht, U), lt(ht, U), Le && (ht = t.createComma(ht, Le), lt(ht, U)), ht;
- }
- }
- }
- if (U.operatorToken.kind === 28) {
- const Z = Ge(U.left, ue, _t), ht = Ge(U.right, be ? ue : V, _t);
- return t.updateBinaryExpression(U, Z, U.operatorToken, ht);
- }
- return br(U, V, e);
- }
- function ki(U, be) {
- if (U.operator === 46 || U.operator === 47) {
- const Z = Ba(U.operand);
- if (C_(Z) && d && g) {
- let ht = ko(Z) ? Ge(Z.argumentExpression, V, _t) : Oe(Z.name) ? t.createStringLiteralFromNode(Z.name) : void 0;
- if (ht) {
- let Le = ht;
- fg(ht) || (Le = t.createTempVariable(o), ht = t.createAssignment(Le, ht));
- let Ie = t.createReflectGetCall(g, Le, d);
- kn(Ie, U), lt(Ie, U);
- const At = be ? void 0 : t.createTempVariable(o);
- return Ie = aO(t, U, Ie, o, At), Ie = t.createReflectSetCall(g, ht, Ie, d), kn(Ie, U), lt(Ie, U), At && (Ie = t.createComma(Ie, At), lt(Ie, U)), Ie;
- }
- }
- }
- return br(U, V, e);
- }
- function rs(U, be) {
- const Z = be ? VO(U.elements, ue) : VO(U.elements, V, ue);
- return t.updateCommaListExpression(U, Z);
- }
- function ei(U) {
- if (fm(U) || Di(U)) {
- const Ie = t.createStringLiteralFromNode(U), At = Ge(U, V, Bc);
- return { referencedName: Ie, name: At };
- }
- if (fm(U.expression) && !Oe(U.expression)) {
- const Ie = t.createStringLiteralFromNode(U.expression), At = Ge(U, V, Bc);
- return { referencedName: Ie, name: At };
- }
- const be = t.getGeneratedNameForNode(U);
- o(be);
- const Z = n().createPropKeyHelper(Ge(U.expression, V, _t)), ht = t.createAssignment(be, Z), Le = t.updateComputedPropertyName(U, K(ht));
- return { referencedName: be, name: Le };
- }
- function Ri(U) {
- return ma(U) ? Jr(U) : Ge(U, V, Bc);
- }
- function Jr(U) {
- let be = Ge(U.expression, V, _t);
- return fg(be) || (be = K(be)), t.updateComputedPropertyName(U, be);
- }
- function ji(U) {
- return Q_(U, Nt) && (U = tf(e, U, Qt(U.initializer))), br(U, V, e);
- }
- function Fe(U) {
- return Q_(U, Nt) && (U = tf(e, U, Qt(U.initializer))), br(U, V, e);
- }
- function Ot(U) {
- return Q_(U, Nt) && (U = tf(e, U, Qt(U.initializer))), br(U, V, e);
- }
- function Ar(U) {
- if (Ks(U) || $l(U))
- return Ea(U);
- if (C_(U) && d && g) {
- const be = ko(U) ? Ge(U.argumentExpression, V, _t) : Oe(U.name) ? t.createStringLiteralFromNode(U.name) : void 0;
- if (be) {
- const Z = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), ht = t.createAssignmentTargetWrapper(
- Z,
- t.createReflectSetCall(
- g,
- be,
- Z,
- d
- )
- );
- return kn(ht, U), lt(ht, U), ht;
- }
- }
- return br(U, V, e);
- }
- function mn(U) {
- if (Dl(
- U,
- /*excludeCompoundAssignment*/
- !0
- )) {
- Q_(U, Nt) && (U = tf(e, U, Qt(U.right)));
- const be = Ar(U.left), Z = Ge(U.right, V, _t);
- return t.updateBinaryExpression(U, be, U.operatorToken, Z);
- } else
- return Ar(U);
- }
- function ti(U) {
- if (__(U.expression)) {
- const be = Ar(U.expression);
- return t.updateSpreadElement(U, be);
- }
- return br(U, V, e);
- }
- function qn(U) {
- return E.assertNode(U, Nw), fp(U) ? ti(U) : ml(U) ? br(U, V, e) : mn(U);
- }
- function Oi(U) {
- const be = Ge(U.name, V, Bc);
- if (Dl(
- U.initializer,
- /*excludeCompoundAssignment*/
- !0
- )) {
- const Z = mn(U.initializer);
- return t.updatePropertyAssignment(U, be, Z);
- }
- if (__(U.initializer)) {
- const Z = Ar(U.initializer);
- return t.updatePropertyAssignment(U, be, Z);
- }
- return br(U, V, e);
- }
- function Ws(U) {
- return Q_(U, Nt) && (U = tf(e, U, Qt(U.objectAssignmentInitializer))), br(U, V, e);
- }
- function Hs(U) {
- if (__(U.expression)) {
- const be = Ar(U.expression);
- return t.updateSpreadAssignment(U, be);
- }
- return br(U, V, e);
- }
- function rr(U) {
- return E.assertNode(U, Aw), $g(U) ? Hs(U) : uu(U) ? Ws(U) : Qc(U) ? Oi(U) : br(U, V, e);
- }
- function Ea(U) {
- if ($l(U)) {
- const be = Fr(U.elements, qn, _t);
- return t.updateArrayLiteralExpression(U, be);
- } else {
- const be = Fr(U.properties, rr, kh);
- return t.updateObjectLiteralExpression(U, be);
- }
- }
- function Xe(U) {
- return Q_(U, Nt) && (U = tf(e, U, Qt(U.expression))), br(U, V, e);
- }
- function Tt(U, be) {
- const Z = be ? ue : V, ht = Ge(U.expression, Z, _t);
- return t.updateParenthesizedExpression(U, ht);
- }
- function te(U, be) {
- const Z = V, ht = Ge(U.expression, Z, _t);
- return t.updatePartiallyEmittedExpression(U, ht);
- }
- function ze(U, be) {
- return ut(U) && (be ? Yu(be) ? (U.push(be.expression), be = t.updateParenthesizedExpression(be, t.inlineExpressions(U))) : (U.push(be), be = t.inlineExpressions(U)) : be = t.inlineExpressions(U)), be;
- }
- function K(U) {
- const be = ze(h, U);
- return E.assertIsDefined(be), be !== U && (h = void 0), be;
- }
- function De(U, be, Z) {
- const ht = ze(be ? U.pendingStaticInitializers : U.pendingInstanceInitializers, Z);
- return ht !== Z && (be ? U.pendingStaticInitializers = void 0 : U.pendingInstanceInitializers = void 0), ht;
- }
- function Ve(U) {
- if (!U)
- return;
- const be = [];
- return Fn(be, lr(U.decorators, Ke)), be;
- }
- function Ke(U) {
- const be = Ge(U.expression, V, _t);
- an(
- be,
- 3072
- /* NoComments */
- );
- const Z = Dc(be);
- if (xo(Z)) {
- const { target: ht, thisArg: Le } = t.createCallBinding(
- be,
- o,
- c,
- /*cacheIdentifiers*/
- !0
- );
- return t.restoreOuterExpressions(be, t.createFunctionBindCall(ht, Le, []));
- }
- return be;
- }
- function xe(U, be, Z, ht, Le, Ie, At) {
- const Dr = t.createFunctionExpression(
- Z,
- ht,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- Ie,
- /*type*/
- void 0,
- At ?? t.createBlock([])
- );
- kn(Dr, U), da(Dr, wh(U)), an(
- Dr,
- 3072
- /* NoComments */
- );
- const yr = Le === "get" || Le === "set" ? Le : void 0, $r = t.createStringLiteralFromNode(
- be,
- /*isSingleQuote*/
- void 0
- ), nt = n().createSetFunctionNameHelper(Dr, $r, yr), ot = t.createPropertyAssignment(t.createIdentifier(Le), nt);
- return kn(ot, U), da(ot, wh(U)), an(
- ot,
- 3072
- /* NoComments */
- ), ot;
- }
- function at(U, be) {
- return t.createObjectLiteralExpression([
- xe(
- U,
- U.name,
- be,
- U.asteriskToken,
- "value",
- Fr(U.parameters, V, Ii),
- Ge(U.body, V, Cs)
- )
- ]);
- }
- function $e(U, be) {
- return t.createObjectLiteralExpression([
- xe(
- U,
- U.name,
- be,
- /*asteriskToken*/
- void 0,
- "get",
- [],
- Ge(U.body, V, Cs)
- )
- ]);
- }
- function bt(U, be) {
- return t.createObjectLiteralExpression([
- xe(
- U,
- U.name,
- be,
- /*asteriskToken*/
- void 0,
- "set",
- Fr(U.parameters, V, Ii),
- Ge(U.body, V, Cs)
- )
- ]);
- }
- function He(U, be) {
- return t.createObjectLiteralExpression([
- xe(
- U,
- U.name,
- be,
- /*asteriskToken*/
- void 0,
- "get",
- [],
- t.createBlock([
- t.createReturnStatement(
- t.createPropertyAccessExpression(
- t.createThis(),
- t.getGeneratedPrivateNameForNode(U.name)
- )
- )
- ])
- ),
- xe(
- U,
- U.name,
- be,
- /*asteriskToken*/
- void 0,
- "set",
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "value"
- )],
- t.createBlock([
- t.createExpressionStatement(
- t.createAssignment(
- t.createPropertyAccessExpression(
- t.createThis(),
- t.getGeneratedPrivateNameForNode(U.name)
- ),
- t.createIdentifier("value")
- )
- )
- ])
- )
- ]);
- }
- function Vt(U, be, Z) {
- return U = Fr(U, (ht) => Ex(ht) ? ht : void 0, ra), t.createGetAccessorDeclaration(
- U,
- be,
- [],
- /*type*/
- void 0,
- t.createBlock([
- t.createReturnStatement(
- t.createPropertyAccessExpression(
- Z,
- t.createIdentifier("value")
- )
- )
- ])
- );
- }
- function Zt(U, be, Z) {
- return U = Fr(U, (ht) => Ex(ht) ? ht : void 0, ra), t.createGetAccessorDeclaration(
- U,
- be,
- [],
- /*type*/
- void 0,
- t.createBlock([
- t.createReturnStatement(
- t.createFunctionCallCall(
- t.createPropertyAccessExpression(
- Z,
- t.createIdentifier("get")
- ),
- t.createThis(),
- []
- )
- )
- ])
- );
- }
- function vn(U, be, Z) {
- return U = Fr(U, (ht) => Ex(ht) ? ht : void 0, ra), t.createSetAccessorDeclaration(
- U,
- be,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "value"
- )],
- t.createBlock([
- t.createReturnStatement(
- t.createFunctionCallCall(
- t.createPropertyAccessExpression(
- Z,
- t.createIdentifier("set")
- ),
- t.createThis(),
- [t.createIdentifier("value")]
- )
- )
- ])
- );
- }
- function M(U, be) {
- const Z = t.createVariableDeclaration(
- U,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createConditionalExpression(
- t.createLogicalAnd(
- t.createTypeCheck(t.createIdentifier("Symbol"), "function"),
- t.createPropertyAccessExpression(t.createIdentifier("Symbol"), "metadata")
- ),
- t.createToken(
- 58
- /* QuestionToken */
- ),
- t.createCallExpression(
- t.createPropertyAccessExpression(t.createIdentifier("Object"), "create"),
- /*typeArguments*/
- void 0,
- [be ? dt(be) : t.createNull()]
- ),
- t.createToken(
- 59
- /* ColonToken */
- ),
- t.createVoidZero()
- )
- );
- return t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [Z],
- 2
- /* Const */
- )
- );
- }
- function Ae(U, be) {
- const Z = t.createObjectDefinePropertyCall(
- U,
- t.createPropertyAccessExpression(t.createIdentifier("Symbol"), "metadata"),
- t.createPropertyDescriptor(
- { configurable: !0, writable: !0, enumerable: !0, value: be },
- /*singleLine*/
- !0
- )
- );
- return an(
- t.createIfStatement(be, t.createExpressionStatement(Z)),
- 1
- /* SingleLine */
- );
- }
- function dt(U) {
- return t.createBinaryExpression(
- t.createElementAccessExpression(
- U,
- t.createPropertyAccessExpression(t.createIdentifier("Symbol"), "metadata")
- ),
- 61,
- t.createNull()
- );
- }
- }
- function one(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- resumeLexicalEnvironment: i,
- endLexicalEnvironment: s,
- hoistVariableDeclaration: o
- } = e, c = e.getEmitResolver(), _ = e.getCompilerOptions(), u = pa(_);
- let d, g = 0, h, S, T, C;
- const D = [];
- let P = 0;
- const I = e.onEmitNode, F = e.onSubstituteNode;
- return e.onEmitNode = xr, e.onSubstituteNode = zn, Fd(e, O);
- function O(Fe) {
- if (Fe.isDeclarationFile)
- return Fe;
- B(1, !1), B(2, !qj(Fe, _));
- const Ot = br(Fe, G, e);
- return Ih(Ot, e.readEmitHelpers()), Ot;
- }
- function B(Fe, Ot) {
- P = Ot ? P | Fe : P & ~Fe;
- }
- function z(Fe) {
- return (P & Fe) !== 0;
- }
- function X() {
- return !z(
- 1
- /* NonTopLevel */
- );
- }
- function q() {
- return z(
- 2
- /* HasLexicalThis */
- );
- }
- function V(Fe, Ot, Ar) {
- const mn = Fe & ~P;
- if (mn) {
- B(
- mn,
- /*val*/
- !0
- );
- const ti = Ot(Ar);
- return B(
- mn,
- /*val*/
- !1
- ), ti;
- }
- return Ot(Ar);
- }
- function ae(Fe) {
- return br(Fe, G, e);
- }
- function ee(Fe) {
- switch (Fe.kind) {
- case 218:
- case 262:
- case 174:
- case 177:
- case 178:
- case 176:
- return Fe;
- case 169:
- case 208:
- case 260:
- break;
- case 80:
- if (C && c.isArgumentsLocalBinding(Fe))
- return C;
- break;
- }
- return br(Fe, ee, e);
- }
- function G(Fe) {
- if (!(Fe.transformFlags & 256))
- return C ? ee(Fe) : Fe;
- switch (Fe.kind) {
- case 134:
- return;
- case 223:
- return oe(Fe);
- case 174:
- return V(3, he, Fe);
- case 262:
- return V(3, ve, Fe);
- case 218:
- return V(3, tt, Fe);
- case 219:
- return V(1, Te, Fe);
- case 211:
- return S && Cn(Fe) && Fe.expression.kind === 108 && S.add(Fe.name.escapedText), br(Fe, G, e);
- case 212:
- return S && Fe.expression.kind === 108 && (T = !0), br(Fe, G, e);
- case 177:
- return V(3, le, Fe);
- case 178:
- return V(3, me, Fe);
- case 176:
- return V(3, _e, Fe);
- case 263:
- case 231:
- return V(3, ae, Fe);
- default:
- return br(Fe, G, e);
- }
- }
- function ue(Fe) {
- if (GZ(Fe))
- switch (Fe.kind) {
- case 243:
- return ne(Fe);
- case 248:
- return J(Fe);
- case 249:
- return ie(Fe);
- case 250:
- return Se(Fe);
- case 299:
- return re(Fe);
- case 241:
- case 255:
- case 269:
- case 296:
- case 297:
- case 258:
- case 246:
- case 247:
- case 245:
- case 254:
- case 256:
- return br(Fe, ue, e);
- default:
- return E.assertNever(Fe, "Unhandled node.");
- }
- return G(Fe);
- }
- function re(Fe) {
- const Ot = /* @__PURE__ */ new Set();
- we(Fe.variableDeclaration, Ot);
- let Ar;
- if (Ot.forEach((mn, ti) => {
- h.has(ti) && (Ar || (Ar = new Set(h)), Ar.delete(ti));
- }), Ar) {
- const mn = h;
- h = Ar;
- const ti = br(Fe, ue, e);
- return h = mn, ti;
- } else
- return br(Fe, ue, e);
- }
- function ne(Fe) {
- if (fe(Fe.declarationList)) {
- const Ot = Me(
- Fe.declarationList,
- /*hasReceiver*/
- !1
- );
- return Ot ? t.createExpressionStatement(Ot) : void 0;
- }
- return br(Fe, G, e);
- }
- function ie(Fe) {
- return t.updateForInStatement(
- Fe,
- fe(Fe.initializer) ? Me(
- Fe.initializer,
- /*hasReceiver*/
- !0
- ) : E.checkDefined(Ge(Fe.initializer, G, ip)),
- E.checkDefined(Ge(Fe.expression, G, _t)),
- Ku(Fe.statement, ue, e)
- );
- }
- function Se(Fe) {
- return t.updateForOfStatement(
- Fe,
- Ge(Fe.awaitModifier, G, NJ),
- fe(Fe.initializer) ? Me(
- Fe.initializer,
- /*hasReceiver*/
- !0
- ) : E.checkDefined(Ge(Fe.initializer, G, ip)),
- E.checkDefined(Ge(Fe.expression, G, _t)),
- Ku(Fe.statement, ue, e)
- );
- }
- function J(Fe) {
- const Ot = Fe.initializer;
- return t.updateForStatement(
- Fe,
- fe(Ot) ? Me(
- Ot,
- /*hasReceiver*/
- !1
- ) : Ge(Fe.initializer, G, ip),
- Ge(Fe.condition, G, _t),
- Ge(Fe.incrementor, G, _t),
- Ku(Fe.statement, ue, e)
- );
- }
- function oe(Fe) {
- return X() ? br(Fe, G, e) : kn(
- lt(
- t.createYieldExpression(
- /*asteriskToken*/
- void 0,
- Ge(Fe.expression, G, _t)
- ),
- Fe
- ),
- Fe
- );
- }
- function _e(Fe) {
- const Ot = C;
- C = void 0;
- const Ar = t.updateConstructorDeclaration(
- Fe,
- Fr(Fe.modifiers, G, ra),
- cc(Fe.parameters, G, e),
- Wt(Fe)
- );
- return C = Ot, Ar;
- }
- function he(Fe) {
- let Ot;
- const Ar = Jc(Fe), mn = C;
- C = void 0;
- const ti = t.updateMethodDeclaration(
- Fe,
- Fr(Fe.modifiers, G, Bo),
- Fe.asteriskToken,
- Fe.name,
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- Ot = Ar & 2 ? Ir(Fe) : cc(Fe.parameters, G, e),
- /*type*/
- void 0,
- Ar & 2 ? jr(Fe, Ot) : Wt(Fe)
- );
- return C = mn, ti;
- }
- function le(Fe) {
- const Ot = C;
- C = void 0;
- const Ar = t.updateGetAccessorDeclaration(
- Fe,
- Fr(Fe.modifiers, G, Bo),
- Fe.name,
- cc(Fe.parameters, G, e),
- /*type*/
- void 0,
- Wt(Fe)
- );
- return C = Ot, Ar;
- }
- function me(Fe) {
- const Ot = C;
- C = void 0;
- const Ar = t.updateSetAccessorDeclaration(
- Fe,
- Fr(Fe.modifiers, G, Bo),
- Fe.name,
- cc(Fe.parameters, G, e),
- Wt(Fe)
- );
- return C = Ot, Ar;
- }
- function ve(Fe) {
- let Ot;
- const Ar = C;
- C = void 0;
- const mn = Jc(Fe), ti = t.updateFunctionDeclaration(
- Fe,
- Fr(Fe.modifiers, G, Bo),
- Fe.asteriskToken,
- Fe.name,
- /*typeParameters*/
- void 0,
- Ot = mn & 2 ? Ir(Fe) : cc(Fe.parameters, G, e),
- /*type*/
- void 0,
- mn & 2 ? jr(Fe, Ot) : Bf(Fe.body, G, e)
- );
- return C = Ar, ti;
- }
- function tt(Fe) {
- let Ot;
- const Ar = C;
- C = void 0;
- const mn = Jc(Fe), ti = t.updateFunctionExpression(
- Fe,
- Fr(Fe.modifiers, G, ra),
- Fe.asteriskToken,
- Fe.name,
- /*typeParameters*/
- void 0,
- Ot = mn & 2 ? Ir(Fe) : cc(Fe.parameters, G, e),
- /*type*/
- void 0,
- mn & 2 ? jr(Fe, Ot) : Bf(Fe.body, G, e)
- );
- return C = Ar, ti;
- }
- function Te(Fe) {
- let Ot;
- const Ar = Jc(Fe);
- return t.updateArrowFunction(
- Fe,
- Fr(Fe.modifiers, G, ra),
- /*typeParameters*/
- void 0,
- Ot = Ar & 2 ? Ir(Fe) : cc(Fe.parameters, G, e),
- /*type*/
- void 0,
- Fe.equalsGreaterThanToken,
- Ar & 2 ? jr(Fe, Ot) : Bf(Fe.body, G, e)
- );
- }
- function we({ name: Fe }, Ot) {
- if (Oe(Fe))
- Ot.add(Fe.escapedText);
- else
- for (const Ar of Fe.elements)
- ml(Ar) || we(Ar, Ot);
- }
- function fe(Fe) {
- return !!Fe && Fl(Fe) && !(Fe.flags & 7) && Fe.declarations.some(ft);
- }
- function Me(Fe, Ot) {
- Qe(Fe);
- const Ar = F4(Fe);
- return Ar.length === 0 ? Ot ? Ge(t.converters.convertToAssignmentElementTarget(Fe.declarations[0].name), G, _t) : void 0 : t.inlineExpressions(lr(Ar, Re));
- }
- function Qe(Fe) {
- ir(Fe.declarations, et);
- }
- function et({ name: Fe }) {
- if (Oe(Fe))
- o(Fe);
- else
- for (const Ot of Fe.elements)
- ml(Ot) || et(Ot);
- }
- function Re(Fe) {
- const Ot = da(
- t.createAssignment(
- t.converters.convertToAssignmentElementTarget(Fe.name),
- Fe.initializer
- ),
- Fe
- );
- return E.checkDefined(Ge(Ot, G, _t));
- }
- function ft({ name: Fe }) {
- if (Oe(Fe))
- return h.has(Fe.escapedText);
- for (const Ot of Fe.elements)
- if (!ml(Ot) && ft(Ot))
- return !0;
- return !1;
- }
- function Wt(Fe) {
- E.assertIsDefined(Fe.body);
- const Ot = S, Ar = T;
- S = /* @__PURE__ */ new Set(), T = !1;
- let mn = Bf(Fe.body, G, e);
- const ti = Ho(Fe, no);
- if (u >= 2 && (c.hasNodeCheckFlag(
- Fe,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) || c.hasNodeCheckFlag(
- Fe,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- )) && (Jc(ti) & 3) !== 3) {
- if (Br(), S.size) {
- const Oi = KO(t, c, Fe, S);
- D[Ma(Oi)] = !0;
- const Ws = mn.statements.slice();
- Mg(Ws, [Oi]), mn = t.updateBlock(mn, Ws);
- }
- T && (c.hasNodeCheckFlag(
- Fe,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) ? Tx(mn, W5) : c.hasNodeCheckFlag(
- Fe,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ) && Tx(mn, z5));
- }
- return S = Ot, T = Ar, mn;
- }
- function _r() {
- E.assert(C);
- const Fe = t.createVariableDeclaration(
- C,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createIdentifier("arguments")
- ), Ot = t.createVariableStatement(
- /*modifiers*/
- void 0,
- [Fe]
- );
- return bu(Ot), hm(
- Ot,
- 2097152
- /* CustomPrologue */
- ), Ot;
- }
- function Ir(Fe) {
- if (NA(Fe.parameters))
- return cc(Fe.parameters, G, e);
- const Ot = [];
- for (const mn of Fe.parameters) {
- if (mn.initializer || mn.dotDotDotToken) {
- if (Fe.kind === 219) {
- const qn = t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- t.createToken(
- 26
- /* DotDotDotToken */
- ),
- t.createUniqueName(
- "args",
- 8
- /* ReservedInNestedScopes */
- )
- );
- Ot.push(qn);
- }
- break;
- }
- const ti = t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.getGeneratedNameForNode(
- mn.name,
- 8
- /* ReservedInNestedScopes */
- )
- );
- Ot.push(ti);
- }
- const Ar = t.createNodeArray(Ot);
- return lt(Ar, Fe.parameters), Ar;
- }
- function jr(Fe, Ot) {
- const Ar = NA(Fe.parameters) ? void 0 : cc(Fe.parameters, G, e);
- i();
- const ti = Ho(Fe, ys).type, qn = u < 2 ? Qt(ti) : void 0, Oi = Fe.kind === 219, Ws = C, rr = c.hasNodeCheckFlag(
- Fe,
- 512
- /* CaptureArguments */
- ) && !C;
- rr && (C = t.createUniqueName("arguments"));
- let Ea;
- if (Ar)
- if (Oi) {
- const Ve = [];
- E.assert(Ot.length <= Fe.parameters.length);
- for (let Ke = 0; Ke < Fe.parameters.length; Ke++) {
- E.assert(Ke < Ot.length);
- const xe = Fe.parameters[Ke], at = Ot[Ke];
- if (E.assertNode(at.name, Oe), xe.initializer || xe.dotDotDotToken) {
- E.assert(Ke === Ot.length - 1), Ve.push(t.createSpreadElement(at.name));
- break;
- }
- Ve.push(at.name);
- }
- Ea = t.createArrayLiteralExpression(Ve);
- } else
- Ea = t.createIdentifier("arguments");
- const Xe = h;
- h = /* @__PURE__ */ new Set();
- for (const Ve of Fe.parameters)
- we(Ve, h);
- const Tt = S, te = T;
- Oi || (S = /* @__PURE__ */ new Set(), T = !1);
- const ze = q();
- let K = Nt(Fe.body);
- K = t.updateBlock(K, t.mergeLexicalEnvironment(K.statements, s()));
- let De;
- if (Oi) {
- if (De = n().createAwaiterHelper(
- ze,
- Ea,
- qn,
- Ar,
- K
- ), rr) {
- const Ve = t.converters.convertToFunctionBlock(De);
- De = t.updateBlock(Ve, t.mergeLexicalEnvironment(Ve.statements, [_r()]));
- }
- } else {
- const Ve = [];
- Ve.push(
- t.createReturnStatement(
- n().createAwaiterHelper(
- ze,
- Ea,
- qn,
- Ar,
- K
- )
- )
- );
- const Ke = u >= 2 && (c.hasNodeCheckFlag(
- Fe,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) || c.hasNodeCheckFlag(
- Fe,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ));
- if (Ke && (Br(), S.size)) {
- const at = KO(t, c, Fe, S);
- D[Ma(at)] = !0, Mg(Ve, [at]);
- }
- rr && Mg(Ve, [_r()]);
- const xe = t.createBlock(
- Ve,
- /*multiLine*/
- !0
- );
- lt(xe, Fe.body), Ke && T && (c.hasNodeCheckFlag(
- Fe,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) ? Tx(xe, W5) : c.hasNodeCheckFlag(
- Fe,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ) && Tx(xe, z5)), De = xe;
- }
- return h = Xe, Oi || (S = Tt, T = te, C = Ws), De;
- }
- function Nt(Fe, Ot) {
- return Cs(Fe) ? t.updateBlock(Fe, Fr(Fe.statements, ue, bi, Ot)) : t.converters.convertToFunctionBlock(E.checkDefined(Ge(Fe, ue, GI)));
- }
- function Qt(Fe) {
- const Ot = Fe && Yw(Fe);
- if (Ot && l_(Ot)) {
- const Ar = c.getTypeReferenceSerializationKind(Ot);
- if (Ar === 1 || Ar === 0)
- return Ot;
- }
- }
- function Br() {
- d & 1 || (d |= 1, e.enableSubstitution(
- 213
- /* CallExpression */
- ), e.enableSubstitution(
- 211
- /* PropertyAccessExpression */
- ), e.enableSubstitution(
- 212
- /* ElementAccessExpression */
- ), e.enableEmitNotification(
- 263
- /* ClassDeclaration */
- ), e.enableEmitNotification(
- 174
- /* MethodDeclaration */
- ), e.enableEmitNotification(
- 177
- /* GetAccessor */
- ), e.enableEmitNotification(
- 178
- /* SetAccessor */
- ), e.enableEmitNotification(
- 176
- /* Constructor */
- ), e.enableEmitNotification(
- 243
- /* VariableStatement */
- ));
- }
- function xr(Fe, Ot, Ar) {
- if (d & 1 && Jr(Ot)) {
- const mn = (c.hasNodeCheckFlag(
- Ot,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ) ? 128 : 0) | (c.hasNodeCheckFlag(
- Ot,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) ? 256 : 0);
- if (mn !== g) {
- const ti = g;
- g = mn, I(Fe, Ot, Ar), g = ti;
- return;
- }
- } else if (d && D[Ma(Ot)]) {
- const mn = g;
- g = 0, I(Fe, Ot, Ar), g = mn;
- return;
- }
- I(Fe, Ot, Ar);
- }
- function zn(Fe, Ot) {
- return Ot = F(Fe, Ot), Fe === 1 && g ? ki(Ot) : Ot;
- }
- function ki(Fe) {
- switch (Fe.kind) {
- case 211:
- return rs(Fe);
- case 212:
- return ei(Fe);
- case 213:
- return Ri(Fe);
- }
- return Fe;
- }
- function rs(Fe) {
- return Fe.expression.kind === 108 ? lt(
- t.createPropertyAccessExpression(
- t.createUniqueName(
- "_super",
- 48
- /* FileLevel */
- ),
- Fe.name
- ),
- Fe
- ) : Fe;
- }
- function ei(Fe) {
- return Fe.expression.kind === 108 ? ji(
- Fe.argumentExpression,
- Fe
- ) : Fe;
- }
- function Ri(Fe) {
- const Ot = Fe.expression;
- if (C_(Ot)) {
- const Ar = Cn(Ot) ? rs(Ot) : ei(Ot);
- return t.createCallExpression(
- t.createPropertyAccessExpression(Ar, "call"),
- /*typeArguments*/
- void 0,
- [
- t.createThis(),
- ...Fe.arguments
- ]
- );
- }
- return Fe;
- }
- function Jr(Fe) {
- const Ot = Fe.kind;
- return Ot === 263 || Ot === 176 || Ot === 174 || Ot === 177 || Ot === 178;
- }
- function ji(Fe, Ot) {
- return g & 256 ? lt(
- t.createPropertyAccessExpression(
- t.createCallExpression(
- t.createUniqueName(
- "_superIndex",
- 48
- /* FileLevel */
- ),
- /*typeArguments*/
- void 0,
- [Fe]
- ),
- "value"
- ),
- Ot
- ) : lt(
- t.createCallExpression(
- t.createUniqueName(
- "_superIndex",
- 48
- /* FileLevel */
- ),
- /*typeArguments*/
- void 0,
- [Fe]
- ),
- Ot
- );
- }
- }
- function KO(e, t, n, i) {
- const s = t.hasNodeCheckFlag(
- n,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ), o = [];
- return i.forEach((c, _) => {
- const u = Ei(_), d = [];
- d.push(e.createPropertyAssignment(
- "get",
- e.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- /* parameters */
- [],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- an(
- e.createPropertyAccessExpression(
- an(
- e.createSuper(),
- 8
- /* NoSubstitution */
- ),
- u
- ),
- 8
- /* NoSubstitution */
- )
- )
- )), s && d.push(
- e.createPropertyAssignment(
- "set",
- e.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- /* parameters */
- [
- e.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "v",
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- )
- ],
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- e.createAssignment(
- an(
- e.createPropertyAccessExpression(
- an(
- e.createSuper(),
- 8
- /* NoSubstitution */
- ),
- u
- ),
- 8
- /* NoSubstitution */
- ),
- e.createIdentifier("v")
- )
- )
- )
- ), o.push(
- e.createPropertyAssignment(
- u,
- e.createObjectLiteralExpression(d)
- )
- );
- }), e.createVariableStatement(
- /*modifiers*/
- void 0,
- e.createVariableDeclarationList(
- [
- e.createVariableDeclaration(
- e.createUniqueName(
- "_super",
- 48
- /* FileLevel */
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- e.createCallExpression(
- e.createPropertyAccessExpression(
- e.createIdentifier("Object"),
- "create"
- ),
- /*typeArguments*/
- void 0,
- [
- e.createNull(),
- e.createObjectLiteralExpression(
- o,
- /*multiLine*/
- !0
- )
- ]
- )
- )
- ],
- 2
- /* Const */
- )
- );
- }
- function cne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- resumeLexicalEnvironment: i,
- endLexicalEnvironment: s,
- hoistVariableDeclaration: o
- } = e, c = e.getEmitResolver(), _ = e.getCompilerOptions(), u = pa(_), d = e.onEmitNode;
- e.onEmitNode = Ws;
- const g = e.onSubstituteNode;
- e.onSubstituteNode = Hs;
- let h = !1, S, T, C, D = 0, P = 0, I, F, O, B;
- const z = [];
- return Fd(e, ee);
- function X(K, De) {
- return P !== (P & ~K | De);
- }
- function q(K, De) {
- const Ve = P;
- return P = (P & ~K | De) & 3, Ve;
- }
- function V(K) {
- P = K;
- }
- function ae(K) {
- F = wr(
- F,
- t.createVariableDeclaration(K)
- );
- }
- function ee(K) {
- if (K.isDeclarationFile)
- return K;
- I = K;
- const De = Te(K);
- return Ih(De, e.readEmitHelpers()), I = void 0, F = void 0, De;
- }
- function G(K) {
- return Se(
- K,
- /*expressionResultIsUnused*/
- !1
- );
- }
- function ue(K) {
- return Se(
- K,
- /*expressionResultIsUnused*/
- !0
- );
- }
- function re(K) {
- if (K.kind !== 134)
- return K;
- }
- function ne(K, De, Ve, Ke) {
- if (X(Ve, Ke)) {
- const xe = q(Ve, Ke), at = K(De);
- return V(xe), at;
- }
- return K(De);
- }
- function ie(K) {
- return br(K, G, e);
- }
- function Se(K, De) {
- if (!(K.transformFlags & 128))
- return K;
- switch (K.kind) {
- case 223:
- return J(K);
- case 229:
- return oe(K);
- case 253:
- return _e(K);
- case 256:
- return he(K);
- case 210:
- return me(K);
- case 226:
- return fe(K, De);
- case 355:
- return Me(K, De);
- case 299:
- return Qe(K);
- case 243:
- return et(K);
- case 260:
- return Re(K);
- case 246:
- case 247:
- case 249:
- return ne(
- ie,
- K,
- 0,
- 2
- /* IterationStatementIncludes */
- );
- case 250:
- return Ir(
- K,
- /*outermostLabeledStatement*/
- void 0
- );
- case 248:
- return ne(
- Wt,
- K,
- 0,
- 2
- /* IterationStatementIncludes */
- );
- case 222:
- return _r(K);
- case 176:
- return ne(
- rs,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 174:
- return ne(
- Jr,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 177:
- return ne(
- ei,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 178:
- return ne(
- Ri,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 262:
- return ne(
- ji,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 218:
- return ne(
- Ot,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- case 219:
- return ne(
- Fe,
- K,
- 2,
- 0
- /* ArrowFunctionIncludes */
- );
- case 169:
- return zn(K);
- case 244:
- return ve(K);
- case 217:
- return tt(K, De);
- case 215:
- return we(K);
- case 211:
- return O && Cn(K) && K.expression.kind === 108 && O.add(K.name.escapedText), br(K, G, e);
- case 212:
- return O && K.expression.kind === 108 && (B = !0), br(K, G, e);
- case 263:
- case 231:
- return ne(
- ie,
- K,
- 2,
- 1
- /* ClassOrFunctionIncludes */
- );
- default:
- return br(K, G, e);
- }
- }
- function J(K) {
- return T & 2 && T & 1 ? kn(
- lt(
- t.createYieldExpression(
- /*asteriskToken*/
- void 0,
- n().createAwaitHelper(Ge(K.expression, G, _t))
- ),
- /*location*/
- K
- ),
- K
- ) : br(K, G, e);
- }
- function oe(K) {
- if (T & 2 && T & 1) {
- if (K.asteriskToken) {
- const De = Ge(E.checkDefined(K.expression), G, _t);
- return kn(
- lt(
- t.createYieldExpression(
- /*asteriskToken*/
- void 0,
- n().createAwaitHelper(
- t.updateYieldExpression(
- K,
- K.asteriskToken,
- lt(
- n().createAsyncDelegatorHelper(
- lt(
- n().createAsyncValuesHelper(De),
- De
- )
- ),
- De
- )
- )
- )
- ),
- K
- ),
- K
- );
- }
- return kn(
- lt(
- t.createYieldExpression(
- /*asteriskToken*/
- void 0,
- Qt(
- K.expression ? Ge(K.expression, G, _t) : t.createVoidZero()
- )
- ),
- K
- ),
- K
- );
- }
- return br(K, G, e);
- }
- function _e(K) {
- return T & 2 && T & 1 ? t.updateReturnStatement(
- K,
- Qt(
- K.expression ? Ge(K.expression, G, _t) : t.createVoidZero()
- )
- ) : br(K, G, e);
- }
- function he(K) {
- if (T & 2) {
- const De = eB(K);
- return De.kind === 250 && De.awaitModifier ? Ir(De, K) : t.restoreEnclosingLabel(Ge(De, G, bi, t.liftToBlock), K);
- }
- return br(K, G, e);
- }
- function le(K) {
- let De;
- const Ve = [];
- for (const Ke of K)
- if (Ke.kind === 305) {
- De && (Ve.push(t.createObjectLiteralExpression(De)), De = void 0);
- const xe = Ke.expression;
- Ve.push(Ge(xe, G, _t));
- } else
- De = wr(
- De,
- Ke.kind === 303 ? t.createPropertyAssignment(Ke.name, Ge(Ke.initializer, G, _t)) : Ge(Ke, G, kh)
- );
- return De && Ve.push(t.createObjectLiteralExpression(De)), Ve;
- }
- function me(K) {
- if (K.transformFlags & 65536) {
- const De = le(K.properties);
- De.length && De[0].kind !== 210 && De.unshift(t.createObjectLiteralExpression());
- let Ve = De[0];
- if (De.length > 1) {
- for (let Ke = 1; Ke < De.length; Ke++)
- Ve = n().createAssignHelper([Ve, De[Ke]]);
- return Ve;
- } else
- return n().createAssignHelper(De);
- }
- return br(K, G, e);
- }
- function ve(K) {
- return br(K, ue, e);
- }
- function tt(K, De) {
- return br(K, De ? ue : G, e);
- }
- function Te(K) {
- const De = q(
- 2,
- qj(K, _) ? 0 : 1
- /* SourceFileIncludes */
- );
- h = !1;
- const Ve = br(K, G, e), Ke = Qi(
- Ve.statements,
- F && [
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(F)
- )
- ]
- ), xe = t.updateSourceFile(Ve, lt(t.createNodeArray(Ke), K.statements));
- return V(De), xe;
- }
- function we(K) {
- return fW(
- e,
- K,
- G,
- I,
- ae,
- 0
- /* LiftRestriction */
- );
- }
- function fe(K, De) {
- return x0(K) && pA(K.left) ? DS(
- K,
- G,
- e,
- 1,
- !De
- ) : K.operatorToken.kind === 28 ? t.updateBinaryExpression(
- K,
- Ge(K.left, ue, _t),
- K.operatorToken,
- Ge(K.right, De ? ue : G, _t)
- ) : br(K, G, e);
- }
- function Me(K, De) {
- if (De)
- return br(K, ue, e);
- let Ve;
- for (let xe = 0; xe < K.elements.length; xe++) {
- const at = K.elements[xe], $e = Ge(at, xe < K.elements.length - 1 ? ue : G, _t);
- (Ve || $e !== at) && (Ve || (Ve = K.elements.slice(0, xe)), Ve.push($e));
- }
- const Ke = Ve ? lt(t.createNodeArray(Ve), K.elements) : K.elements;
- return t.updateCommaListExpression(K, Ke);
- }
- function Qe(K) {
- if (K.variableDeclaration && As(K.variableDeclaration.name) && K.variableDeclaration.name.transformFlags & 65536) {
- const De = t.getGeneratedNameForNode(K.variableDeclaration.name), Ve = t.updateVariableDeclaration(
- K.variableDeclaration,
- K.variableDeclaration.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- De
- ), Ke = Gb(
- Ve,
- G,
- e,
- 1
- /* ObjectRest */
- );
- let xe = Ge(K.block, G, Cs);
- return ut(Ke) && (xe = t.updateBlock(xe, [
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- Ke
- ),
- ...xe.statements
- ])), t.updateCatchClause(
- K,
- t.updateVariableDeclaration(
- K.variableDeclaration,
- De,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ),
- xe
- );
- }
- return br(K, G, e);
- }
- function et(K) {
- if (Gn(
- K,
- 32
- /* Export */
- )) {
- const De = h;
- h = !0;
- const Ve = br(K, G, e);
- return h = De, Ve;
- }
- return br(K, G, e);
- }
- function Re(K) {
- if (h) {
- const De = h;
- h = !1;
- const Ve = ft(
- K,
- /*exportedVariableStatement*/
- !0
- );
- return h = De, Ve;
- }
- return ft(
- K,
- /*exportedVariableStatement*/
- !1
- );
- }
- function ft(K, De) {
- return As(K.name) && K.name.transformFlags & 65536 ? Gb(
- K,
- G,
- e,
- 1,
- /*rval*/
- void 0,
- De
- ) : br(K, G, e);
- }
- function Wt(K) {
- return t.updateForStatement(
- K,
- Ge(K.initializer, ue, ip),
- Ge(K.condition, G, _t),
- Ge(K.incrementor, ue, _t),
- Ku(K.statement, G, e)
- );
- }
- function _r(K) {
- return br(K, ue, e);
- }
- function Ir(K, De) {
- const Ve = q(
- 0,
- 2
- /* IterationStatementIncludes */
- );
- (K.initializer.transformFlags & 65536 || o4(K.initializer) && pA(K.initializer)) && (K = jr(K));
- const Ke = K.awaitModifier ? Br(K, De, Ve) : t.restoreEnclosingLabel(br(K, G, e), De);
- return V(Ve), Ke;
- }
- function jr(K) {
- const De = Ba(K.initializer);
- if (Fl(De) || o4(De)) {
- let Ve, Ke;
- const xe = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), at = [QJ(t, De, xe)];
- return Cs(K.statement) ? (Fn(at, K.statement.statements), Ve = K.statement, Ke = K.statement.statements) : K.statement && (wr(at, K.statement), Ve = K.statement, Ke = K.statement), t.updateForOfStatement(
- K,
- K.awaitModifier,
- lt(
- t.createVariableDeclarationList(
- [
- lt(t.createVariableDeclaration(xe), K.initializer)
- ],
- 1
- /* Let */
- ),
- K.initializer
- ),
- K.expression,
- lt(
- t.createBlock(
- lt(t.createNodeArray(at), Ke),
- /*multiLine*/
- !0
- ),
- Ve
- )
- );
- }
- return K;
- }
- function Nt(K, De, Ve) {
- const Ke = t.createTempVariable(o), xe = t.createAssignment(Ke, De), at = t.createExpressionStatement(xe);
- da(at, K.expression);
- const $e = t.createAssignment(Ve, t.createFalse()), bt = t.createExpressionStatement($e);
- da(bt, K.expression);
- const He = [at, bt], Vt = QJ(t, K.initializer, Ke);
- He.push(Ge(Vt, G, bi));
- let Zt, vn;
- const M = Ku(K.statement, G, e);
- return Cs(M) ? (Fn(He, M.statements), Zt = M, vn = M.statements) : He.push(M), lt(
- t.createBlock(
- lt(t.createNodeArray(He), vn),
- /*multiLine*/
- !0
- ),
- Zt
- );
- }
- function Qt(K) {
- return T & 1 ? t.createYieldExpression(
- /*asteriskToken*/
- void 0,
- n().createAwaitHelper(K)
- ) : t.createAwaitExpression(K);
- }
- function Br(K, De, Ve) {
- const Ke = Ge(K.expression, G, _t), xe = Oe(Ke) ? t.getGeneratedNameForNode(Ke) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), at = Oe(Ke) ? t.getGeneratedNameForNode(xe) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), $e = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), bt = t.createTempVariable(o), He = t.createUniqueName("e"), Vt = t.getGeneratedNameForNode(He), Zt = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), vn = lt(n().createAsyncValuesHelper(Ke), K.expression), M = t.createCallExpression(
- t.createPropertyAccessExpression(xe, "next"),
- /*typeArguments*/
- void 0,
- []
- ), Ae = t.createPropertyAccessExpression(at, "done"), dt = t.createPropertyAccessExpression(at, "value"), U = t.createFunctionCallCall(Zt, xe, []);
- o(He), o(Zt);
- const be = Ve & 2 ? t.inlineExpressions([t.createAssignment(He, t.createVoidZero()), vn]) : vn, Z = an(
- lt(
- t.createForStatement(
- /*initializer*/
- an(
- lt(
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- $e,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createTrue()
- ),
- lt(t.createVariableDeclaration(
- xe,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- be
- ), K.expression),
- t.createVariableDeclaration(at)
- ]),
- K.expression
- ),
- 4194304
- /* NoHoisting */
- ),
- /*condition*/
- t.inlineExpressions([
- t.createAssignment(at, Qt(M)),
- t.createAssignment(bt, Ae),
- t.createLogicalNot(bt)
- ]),
- /*incrementor*/
- t.createAssignment($e, t.createTrue()),
- /*statement*/
- Nt(K, dt, $e)
- ),
- /*location*/
- K
- ),
- 512
- /* NoTokenTrailingSourceMaps */
- );
- return kn(Z, K), t.createTryStatement(
- t.createBlock([
- t.restoreEnclosingLabel(
- Z,
- De
- )
- ]),
- t.createCatchClause(
- t.createVariableDeclaration(Vt),
- an(
- t.createBlock([
- t.createExpressionStatement(
- t.createAssignment(
- He,
- t.createObjectLiteralExpression([
- t.createPropertyAssignment("error", Vt)
- ])
- )
- )
- ]),
- 1
- /* SingleLine */
- )
- ),
- t.createBlock([
- t.createTryStatement(
- /*tryBlock*/
- t.createBlock([
- an(
- t.createIfStatement(
- t.createLogicalAnd(
- t.createLogicalAnd(
- t.createLogicalNot($e),
- t.createLogicalNot(bt)
- ),
- t.createAssignment(
- Zt,
- t.createPropertyAccessExpression(xe, "return")
- )
- ),
- t.createExpressionStatement(Qt(U))
- ),
- 1
- /* SingleLine */
- )
- ]),
- /*catchClause*/
- void 0,
- /*finallyBlock*/
- an(
- t.createBlock([
- an(
- t.createIfStatement(
- He,
- t.createThrowStatement(
- t.createPropertyAccessExpression(He, "error")
- )
- ),
- 1
- /* SingleLine */
- )
- ]),
- 1
- /* SingleLine */
- )
- )
- ])
- );
- }
- function xr(K) {
- return E.assertNode(K, Ii), zn(K);
- }
- function zn(K) {
- return C?.has(K) ? t.updateParameterDeclaration(
- K,
- /*modifiers*/
- void 0,
- K.dotDotDotToken,
- As(K.name) ? t.getGeneratedNameForNode(K) : K.name,
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ) : K.transformFlags & 65536 ? t.updateParameterDeclaration(
- K,
- /*modifiers*/
- void 0,
- K.dotDotDotToken,
- t.getGeneratedNameForNode(K),
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- Ge(K.initializer, G, _t)
- ) : br(K, G, e);
- }
- function ki(K) {
- let De;
- for (const Ve of K.parameters)
- De ? De.add(Ve) : Ve.transformFlags & 65536 && (De = /* @__PURE__ */ new Set());
- return De;
- }
- function rs(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateConstructorDeclaration(
- K,
- K.modifiers,
- cc(K.parameters, xr, e),
- ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function ei(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateGetAccessorDeclaration(
- K,
- K.modifiers,
- Ge(K.name, G, Bc),
- cc(K.parameters, xr, e),
- /*type*/
- void 0,
- ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function Ri(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateSetAccessorDeclaration(
- K,
- K.modifiers,
- Ge(K.name, G, Bc),
- cc(K.parameters, xr, e),
- ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function Jr(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateMethodDeclaration(
- K,
- T & 1 ? Fr(K.modifiers, re, Bo) : K.modifiers,
- T & 2 ? void 0 : K.asteriskToken,
- Ge(K.name, G, Bc),
- Ge(
- /*node*/
- void 0,
- G,
- Vy
- ),
- /*typeParameters*/
- void 0,
- T & 2 && T & 1 ? Ar(K) : cc(K.parameters, xr, e),
- /*type*/
- void 0,
- T & 2 && T & 1 ? mn(K) : ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function ji(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateFunctionDeclaration(
- K,
- T & 1 ? Fr(K.modifiers, re, ra) : K.modifiers,
- T & 2 ? void 0 : K.asteriskToken,
- K.name,
- /*typeParameters*/
- void 0,
- T & 2 && T & 1 ? Ar(K) : cc(K.parameters, xr, e),
- /*type*/
- void 0,
- T & 2 && T & 1 ? mn(K) : ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function Fe(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateArrowFunction(
- K,
- K.modifiers,
- /*typeParameters*/
- void 0,
- cc(K.parameters, xr, e),
- /*type*/
- void 0,
- K.equalsGreaterThanToken,
- ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function Ot(K) {
- const De = T, Ve = C;
- T = Jc(K), C = ki(K);
- const Ke = t.updateFunctionExpression(
- K,
- T & 1 ? Fr(K.modifiers, re, ra) : K.modifiers,
- T & 2 ? void 0 : K.asteriskToken,
- K.name,
- /*typeParameters*/
- void 0,
- T & 2 && T & 1 ? Ar(K) : cc(K.parameters, xr, e),
- /*type*/
- void 0,
- T & 2 && T & 1 ? mn(K) : ti(K)
- );
- return T = De, C = Ve, Ke;
- }
- function Ar(K) {
- if (NA(K.parameters))
- return cc(K.parameters, G, e);
- const De = [];
- for (const Ke of K.parameters) {
- if (Ke.initializer || Ke.dotDotDotToken)
- break;
- const xe = t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.getGeneratedNameForNode(
- Ke.name,
- 8
- /* ReservedInNestedScopes */
- )
- );
- De.push(xe);
- }
- const Ve = t.createNodeArray(De);
- return lt(Ve, K.parameters), Ve;
- }
- function mn(K) {
- const De = NA(K.parameters) ? void 0 : cc(K.parameters, G, e);
- i();
- const Ve = O, Ke = B;
- O = /* @__PURE__ */ new Set(), B = !1;
- const xe = [];
- let at = t.updateBlock(K.body, Fr(K.body.statements, G, bi));
- at = t.updateBlock(at, t.mergeLexicalEnvironment(at.statements, qn(s(), K)));
- const $e = t.createReturnStatement(
- n().createAsyncGeneratorHelper(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- t.createToken(
- 42
- /* AsteriskToken */
- ),
- K.name && t.getGeneratedNameForNode(K.name),
- /*typeParameters*/
- void 0,
- De ?? [],
- /*type*/
- void 0,
- at
- ),
- !!(P & 1)
- )
- ), bt = u >= 2 && (c.hasNodeCheckFlag(
- K,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) || c.hasNodeCheckFlag(
- K,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ));
- if (bt) {
- Oi();
- const Vt = KO(t, c, K, O);
- z[Ma(Vt)] = !0, Mg(xe, [Vt]);
- }
- xe.push($e);
- const He = t.updateBlock(K.body, xe);
- return bt && B && (c.hasNodeCheckFlag(
- K,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) ? Tx(He, W5) : c.hasNodeCheckFlag(
- K,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ) && Tx(He, z5)), O = Ve, B = Ke, He;
- }
- function ti(K) {
- i();
- let De = 0;
- const Ve = [], Ke = Ge(K.body, G, GI) ?? t.createBlock([]);
- Cs(Ke) && (De = t.copyPrologue(
- Ke.statements,
- Ve,
- /*ensureUseStrict*/
- !1,
- G
- )), Fn(Ve, qn(
- /*statements*/
- void 0,
- K
- ));
- const xe = s();
- if (De > 0 || ut(Ve) || ut(xe)) {
- const at = t.converters.convertToFunctionBlock(
- Ke,
- /*multiLine*/
- !0
- );
- return Mg(Ve, xe), Fn(Ve, at.statements.slice(De)), t.updateBlock(at, lt(t.createNodeArray(Ve), at.statements));
- }
- return Ke;
- }
- function qn(K, De) {
- let Ve = !1;
- for (const Ke of De.parameters)
- if (Ve) {
- if (As(Ke.name)) {
- if (Ke.name.elements.length > 0) {
- const xe = Gb(
- Ke,
- G,
- e,
- 0,
- t.getGeneratedNameForNode(Ke)
- );
- if (ut(xe)) {
- const at = t.createVariableDeclarationList(xe), $e = t.createVariableStatement(
- /*modifiers*/
- void 0,
- at
- );
- an(
- $e,
- 2097152
- /* CustomPrologue */
- ), K = wr(K, $e);
- }
- } else if (Ke.initializer) {
- const xe = t.getGeneratedNameForNode(Ke), at = Ge(Ke.initializer, G, _t), $e = t.createAssignment(xe, at), bt = t.createExpressionStatement($e);
- an(
- bt,
- 2097152
- /* CustomPrologue */
- ), K = wr(K, bt);
- }
- } else if (Ke.initializer) {
- const xe = t.cloneNode(Ke.name);
- lt(xe, Ke.name), an(
- xe,
- 96
- /* NoSourceMap */
- );
- const at = Ge(Ke.initializer, G, _t);
- hm(
- at,
- 3168
- /* NoComments */
- );
- const $e = t.createAssignment(xe, at);
- lt($e, Ke), an(
- $e,
- 3072
- /* NoComments */
- );
- const bt = t.createBlock([t.createExpressionStatement($e)]);
- lt(bt, Ke), an(
- bt,
- 3905
- /* NoComments */
- );
- const He = t.createTypeCheck(t.cloneNode(Ke.name), "undefined"), Vt = t.createIfStatement(He, bt);
- bu(Vt), lt(Vt, Ke), an(
- Vt,
- 2101056
- /* NoComments */
- ), K = wr(K, Vt);
- }
- } else if (Ke.transformFlags & 65536) {
- Ve = !0;
- const xe = Gb(
- Ke,
- G,
- e,
- 1,
- t.getGeneratedNameForNode(Ke),
- /*hoistTempVariables*/
- !1,
- /*skipInitializer*/
- !0
- );
- if (ut(xe)) {
- const at = t.createVariableDeclarationList(xe), $e = t.createVariableStatement(
- /*modifiers*/
- void 0,
- at
- );
- an(
- $e,
- 2097152
- /* CustomPrologue */
- ), K = wr(K, $e);
- }
- }
- return K;
- }
- function Oi() {
- S & 1 || (S |= 1, e.enableSubstitution(
- 213
- /* CallExpression */
- ), e.enableSubstitution(
- 211
- /* PropertyAccessExpression */
- ), e.enableSubstitution(
- 212
- /* ElementAccessExpression */
- ), e.enableEmitNotification(
- 263
- /* ClassDeclaration */
- ), e.enableEmitNotification(
- 174
- /* MethodDeclaration */
- ), e.enableEmitNotification(
- 177
- /* GetAccessor */
- ), e.enableEmitNotification(
- 178
- /* SetAccessor */
- ), e.enableEmitNotification(
- 176
- /* Constructor */
- ), e.enableEmitNotification(
- 243
- /* VariableStatement */
- ));
- }
- function Ws(K, De, Ve) {
- if (S & 1 && te(De)) {
- const Ke = (c.hasNodeCheckFlag(
- De,
- 128
- /* MethodWithSuperPropertyAccessInAsync */
- ) ? 128 : 0) | (c.hasNodeCheckFlag(
- De,
- 256
- /* MethodWithSuperPropertyAssignmentInAsync */
- ) ? 256 : 0);
- if (Ke !== D) {
- const xe = D;
- D = Ke, d(K, De, Ve), D = xe;
- return;
- }
- } else if (S && z[Ma(De)]) {
- const Ke = D;
- D = 0, d(K, De, Ve), D = Ke;
- return;
- }
- d(K, De, Ve);
- }
- function Hs(K, De) {
- return De = g(K, De), K === 1 && D ? rr(De) : De;
- }
- function rr(K) {
- switch (K.kind) {
- case 211:
- return Ea(K);
- case 212:
- return Xe(K);
- case 213:
- return Tt(K);
- }
- return K;
- }
- function Ea(K) {
- return K.expression.kind === 108 ? lt(
- t.createPropertyAccessExpression(
- t.createUniqueName(
- "_super",
- 48
- /* FileLevel */
- ),
- K.name
- ),
- K
- ) : K;
- }
- function Xe(K) {
- return K.expression.kind === 108 ? ze(
- K.argumentExpression,
- K
- ) : K;
- }
- function Tt(K) {
- const De = K.expression;
- if (C_(De)) {
- const Ve = Cn(De) ? Ea(De) : Xe(De);
- return t.createCallExpression(
- t.createPropertyAccessExpression(Ve, "call"),
- /*typeArguments*/
- void 0,
- [
- t.createThis(),
- ...K.arguments
- ]
- );
- }
- return K;
- }
- function te(K) {
- const De = K.kind;
- return De === 263 || De === 176 || De === 174 || De === 177 || De === 178;
- }
- function ze(K, De) {
- return D & 256 ? lt(
- t.createPropertyAccessExpression(
- t.createCallExpression(
- t.createIdentifier("_superIndex"),
- /*typeArguments*/
- void 0,
- [K]
- ),
- "value"
- ),
- De
- ) : lt(
- t.createCallExpression(
- t.createIdentifier("_superIndex"),
- /*typeArguments*/
- void 0,
- [K]
- ),
- De
- );
- }
- }
- function lne(e) {
- const t = e.factory;
- return Fd(e, n);
- function n(o) {
- return o.isDeclarationFile ? o : br(o, i, e);
- }
- function i(o) {
- if (!(o.transformFlags & 64))
- return o;
- switch (o.kind) {
- case 299:
- return s(o);
- default:
- return br(o, i, e);
- }
- }
- function s(o) {
- return o.variableDeclaration ? br(o, i, e) : t.updateCatchClause(
- o,
- t.createVariableDeclaration(t.createTempVariable(
- /*recordTempVariable*/
- void 0
- )),
- Ge(o.block, i, Cs)
- );
- }
- }
- function une(e) {
- const {
- factory: t,
- hoistVariableDeclaration: n
- } = e;
- return Fd(e, i);
- function i(C) {
- return C.isDeclarationFile ? C : br(C, s, e);
- }
- function s(C) {
- if (!(C.transformFlags & 32))
- return C;
- switch (C.kind) {
- case 213: {
- const D = u(
- C,
- /*captureThisArg*/
- !1
- );
- return E.assertNotNode(D, Fx), D;
- }
- case 211:
- case 212:
- if (hu(C)) {
- const D = g(
- C,
- /*captureThisArg*/
- !1,
- /*isDelete*/
- !1
- );
- return E.assertNotNode(D, Fx), D;
- }
- return br(C, s, e);
- case 226:
- return C.operatorToken.kind === 61 ? S(C) : br(C, s, e);
- case 220:
- return T(C);
- default:
- return br(C, s, e);
- }
- }
- function o(C) {
- E.assertNotNode(C, zI);
- const D = [C];
- for (; !C.questionDotToken && !lv(C); )
- C = Bs(ud(C.expression), hu), E.assertNotNode(C, zI), D.unshift(C);
- return { expression: C.expression, chain: D };
- }
- function c(C, D, P) {
- const I = d(C.expression, D, P);
- return Fx(I) ? t.createSyntheticReferenceExpression(t.updateParenthesizedExpression(C, I.expression), I.thisArg) : t.updateParenthesizedExpression(C, I);
- }
- function _(C, D, P) {
- if (hu(C))
- return g(C, D, P);
- let I = Ge(C.expression, s, _t);
- E.assertNotNode(I, Fx);
- let F;
- return D && (Hb(I) ? F = I : (F = t.createTempVariable(n), I = t.createAssignment(F, I))), I = C.kind === 211 ? t.updatePropertyAccessExpression(C, I, Ge(C.name, s, Oe)) : t.updateElementAccessExpression(C, I, Ge(C.argumentExpression, s, _t)), F ? t.createSyntheticReferenceExpression(I, F) : I;
- }
- function u(C, D) {
- if (hu(C))
- return g(
- C,
- D,
- /*isDelete*/
- !1
- );
- if (Yu(C.expression) && hu(Ba(C.expression))) {
- const P = c(
- C.expression,
- /*captureThisArg*/
- !0,
- /*isDelete*/
- !1
- ), I = Fr(C.arguments, s, _t);
- return Fx(P) ? lt(t.createFunctionCallCall(P.expression, P.thisArg, I), C) : t.updateCallExpression(
- C,
- P,
- /*typeArguments*/
- void 0,
- I
- );
- }
- return br(C, s, e);
- }
- function d(C, D, P) {
- switch (C.kind) {
- case 217:
- return c(C, D, P);
- case 211:
- case 212:
- return _(C, D, P);
- case 213:
- return u(C, D);
- default:
- return Ge(C, s, _t);
- }
- }
- function g(C, D, P) {
- const { expression: I, chain: F } = o(C), O = d(
- ud(I),
- $2(F[0]),
- /*isDelete*/
- !1
- );
- let B = Fx(O) ? O.thisArg : void 0, z = Fx(O) ? O.expression : O, X = t.restoreOuterExpressions(
- I,
- z,
- 8
- /* PartiallyEmittedExpressions */
- );
- Hb(z) || (z = t.createTempVariable(n), X = t.createAssignment(z, X));
- let q = z, V;
- for (let ee = 0; ee < F.length; ee++) {
- const G = F[ee];
- switch (G.kind) {
- case 211:
- case 212:
- ee === F.length - 1 && D && (Hb(q) ? V = q : (V = t.createTempVariable(n), q = t.createAssignment(V, q))), q = G.kind === 211 ? t.createPropertyAccessExpression(q, Ge(G.name, s, Oe)) : t.createElementAccessExpression(q, Ge(G.argumentExpression, s, _t));
- break;
- case 213:
- ee === 0 && B ? (jo(B) || (B = t.cloneNode(B), hm(
- B,
- 3072
- /* NoComments */
- )), q = t.createFunctionCallCall(
- q,
- B.kind === 108 ? t.createThis() : B,
- Fr(G.arguments, s, _t)
- )) : q = t.createCallExpression(
- q,
- /*typeArguments*/
- void 0,
- Fr(G.arguments, s, _t)
- );
- break;
- }
- kn(q, G);
- }
- const ae = P ? t.createConditionalExpression(
- h(
- X,
- z,
- /*invert*/
- !0
- ),
- /*questionToken*/
- void 0,
- t.createTrue(),
- /*colonToken*/
- void 0,
- t.createDeleteExpression(q)
- ) : t.createConditionalExpression(
- h(
- X,
- z,
- /*invert*/
- !0
- ),
- /*questionToken*/
- void 0,
- t.createVoidZero(),
- /*colonToken*/
- void 0,
- q
- );
- return lt(ae, C), V ? t.createSyntheticReferenceExpression(ae, V) : ae;
- }
- function h(C, D, P) {
- return t.createBinaryExpression(
- t.createBinaryExpression(
- C,
- t.createToken(
- P ? 37 : 38
- /* ExclamationEqualsEqualsToken */
- ),
- t.createNull()
- ),
- t.createToken(
- P ? 57 : 56
- /* AmpersandAmpersandToken */
- ),
- t.createBinaryExpression(
- D,
- t.createToken(
- P ? 37 : 38
- /* ExclamationEqualsEqualsToken */
- ),
- t.createVoidZero()
- )
- );
- }
- function S(C) {
- let D = Ge(C.left, s, _t), P = D;
- return Hb(D) || (P = t.createTempVariable(n), D = t.createAssignment(P, D)), lt(
- t.createConditionalExpression(
- h(D, P),
- /*questionToken*/
- void 0,
- P,
- /*colonToken*/
- void 0,
- Ge(C.right, s, _t)
- ),
- C
- );
- }
- function T(C) {
- return hu(Ba(C.expression)) ? kn(d(
- C.expression,
- /*captureThisArg*/
- !1,
- /*isDelete*/
- !0
- ), C) : t.updateDeleteExpression(C, Ge(C.expression, s, _t));
- }
- }
- function _ne(e) {
- const {
- hoistVariableDeclaration: t,
- factory: n
- } = e;
- return Fd(e, i);
- function i(c) {
- return c.isDeclarationFile ? c : br(c, s, e);
- }
- function s(c) {
- return c.transformFlags & 16 ? FB(c) ? o(c) : br(c, s, e) : c;
- }
- function o(c) {
- const _ = c.operatorToken, u = wD(_.kind);
- let d = Ba(Ge(c.left, s, __)), g = d;
- const h = Ba(Ge(c.right, s, _t));
- if (xo(d)) {
- const S = Hb(d.expression), T = S ? d.expression : n.createTempVariable(t), C = S ? d.expression : n.createAssignment(
- T,
- d.expression
- );
- if (Cn(d))
- g = n.createPropertyAccessExpression(
- T,
- d.name
- ), d = n.createPropertyAccessExpression(
- C,
- d.name
- );
- else {
- const D = Hb(d.argumentExpression), P = D ? d.argumentExpression : n.createTempVariable(t);
- g = n.createElementAccessExpression(
- T,
- P
- ), d = n.createElementAccessExpression(
- C,
- D ? d.argumentExpression : n.createAssignment(
- P,
- d.argumentExpression
- )
- );
- }
- }
- return n.createBinaryExpression(
- d,
- u,
- n.createParenthesizedExpression(
- n.createAssignment(
- g,
- h
- )
- )
- );
- }
- }
- function fne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- hoistVariableDeclaration: i,
- startLexicalEnvironment: s,
- endLexicalEnvironment: o
- } = e;
- let c, _, u, d;
- return Fd(e, g);
- function g(ne) {
- if (ne.isDeclarationFile)
- return ne;
- const ie = Ge(ne, h, Si);
- return Ih(ie, e.readEmitHelpers()), _ = void 0, c = void 0, u = void 0, ie;
- }
- function h(ne) {
- if (!(ne.transformFlags & 4))
- return ne;
- switch (ne.kind) {
- case 307:
- return S(ne);
- case 241:
- return T(ne);
- case 248:
- return C(ne);
- case 250:
- return D(ne);
- case 255:
- return I(ne);
- default:
- return br(ne, h, e);
- }
- }
- function S(ne) {
- const ie = pW(ne.statements);
- if (ie) {
- s(), c = new _6(), _ = [];
- const Se = Kye(ne.statements), J = [];
- Fn(J, wA(ne.statements, h, bi, 0, Se));
- let oe = Se;
- for (; oe < ne.statements.length; ) {
- const le = ne.statements[oe];
- if (dne(le) !== 0) {
- oe > Se && Fn(J, Fr(ne.statements, h, bi, Se, oe - Se));
- break;
- }
- oe++;
- }
- E.assert(oe < ne.statements.length, "Should have encountered at least one 'using' statement.");
- const _e = ue(), he = F(ne.statements, oe, ne.statements.length, _e, J);
- return c.size && wr(
- J,
- t.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- t.createNamedExports(as(c.values()))
- )
- ), Fn(J, o()), _.length && J.push(t.createVariableStatement(
- t.createModifiersFromModifierFlags(
- 32
- /* Export */
- ),
- t.createVariableDeclarationList(
- _,
- 1
- /* Let */
- )
- )), Fn(J, re(
- he,
- _e,
- ie === 2
- /* Async */
- )), d && J.push(t.createExportAssignment(
- /*modifiers*/
- void 0,
- /*isExportEquals*/
- !0,
- d
- )), t.updateSourceFile(ne, J);
- }
- return br(ne, h, e);
- }
- function T(ne) {
- const ie = pW(ne.statements);
- if (ie) {
- const Se = Kye(ne.statements), J = ue();
- return t.updateBlock(
- ne,
- [
- ...wA(ne.statements, h, bi, 0, Se),
- ...re(
- F(
- ne.statements,
- Se,
- ne.statements.length,
- J,
- /*topLevelStatements*/
- void 0
- ),
- J,
- ie === 2
- /* Async */
- )
- ]
- );
- }
- return br(ne, h, e);
- }
- function C(ne) {
- return ne.initializer && e1e(ne.initializer) ? Ge(
- t.createBlock([
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- ne.initializer
- ),
- t.updateForStatement(
- ne,
- /*initializer*/
- void 0,
- ne.condition,
- ne.incrementor,
- ne.statement
- )
- ]),
- h,
- bi
- ) : br(ne, h, e);
- }
- function D(ne) {
- if (e1e(ne.initializer)) {
- const ie = ne.initializer, Se = el(ie.declarations) || t.createVariableDeclaration(t.createTempVariable(
- /*recordTempVariable*/
- void 0
- )), J = pne(ie) === 2, oe = t.getGeneratedNameForNode(Se.name), _e = t.updateVariableDeclaration(
- Se,
- Se.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- oe
- ), he = t.createVariableDeclarationList(
- [_e],
- J ? 6 : 4
- /* Using */
- ), le = t.createVariableStatement(
- /*modifiers*/
- void 0,
- he
- );
- return Ge(
- t.updateForOfStatement(
- ne,
- ne.awaitModifier,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(oe)
- ],
- 2
- /* Const */
- ),
- ne.expression,
- Cs(ne.statement) ? t.updateBlock(ne.statement, [
- le,
- ...ne.statement.statements
- ]) : t.createBlock(
- [
- le,
- ne.statement
- ],
- /*multiLine*/
- !0
- )
- ),
- h,
- bi
- );
- }
- return br(ne, h, e);
- }
- function P(ne, ie) {
- return pW(ne.statements) !== 0 ? XC(ne) ? t.updateCaseClause(
- ne,
- Ge(ne.expression, h, _t),
- F(
- ne.statements,
- /*start*/
- 0,
- ne.statements.length,
- ie,
- /*topLevelStatements*/
- void 0
- )
- ) : t.updateDefaultClause(
- ne,
- F(
- ne.statements,
- /*start*/
- 0,
- ne.statements.length,
- ie,
- /*topLevelStatements*/
- void 0
- )
- ) : br(ne, h, e);
- }
- function I(ne) {
- const ie = _Re(ne.caseBlock.clauses);
- if (ie) {
- const Se = ue();
- return re(
- [
- t.updateSwitchStatement(
- ne,
- Ge(ne.expression, h, _t),
- t.updateCaseBlock(
- ne.caseBlock,
- ne.caseBlock.clauses.map((J) => P(J, Se))
- )
- )
- ],
- Se,
- ie === 2
- /* Async */
- );
- }
- return br(ne, h, e);
- }
- function F(ne, ie, Se, J, oe) {
- const _e = [];
- for (let me = ie; me < Se; me++) {
- const ve = ne[me], tt = dne(ve);
- if (tt) {
- E.assertNode(ve, yc);
- const we = [];
- for (let fe of ve.declarationList.declarations) {
- if (!Oe(fe.name)) {
- we.length = 0;
- break;
- }
- Q_(fe) && (fe = tf(e, fe));
- const Me = Ge(fe.initializer, h, _t) ?? t.createVoidZero();
- we.push(t.updateVariableDeclaration(
- fe,
- fe.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n().createAddDisposableResourceHelper(
- J,
- Me,
- tt === 2
- /* Async */
- )
- ));
- }
- if (we.length) {
- const fe = t.createVariableDeclarationList(
- we,
- 2
- /* Const */
- );
- kn(fe, ve.declarationList), lt(fe, ve.declarationList), he(t.updateVariableStatement(
- ve,
- /*modifiers*/
- void 0,
- fe
- ));
- continue;
- }
- }
- const Te = h(ve);
- us(Te) ? Te.forEach(he) : Te && he(Te);
- }
- return _e;
- function he(me) {
- E.assertNode(me, bi), wr(_e, le(me));
- }
- function le(me) {
- if (!oe) return me;
- switch (me.kind) {
- case 272:
- case 271:
- case 278:
- case 262:
- return O(me, oe);
- case 277:
- return B(me);
- case 263:
- return q(me);
- case 243:
- return V(me);
- }
- return me;
- }
- }
- function O(ne, ie) {
- ie.push(ne);
- }
- function B(ne) {
- return ne.isExportEquals ? X(ne) : z(ne);
- }
- function z(ne) {
- if (u)
- return ne;
- u = t.createUniqueName(
- "_default",
- 56
- /* Optimistic */
- ), G(
- u,
- /*isExport*/
- !0,
- "default",
- ne
- );
- let ie = ne.expression, Se = Dc(ie);
- Q_(Se) && (Se = tf(
- e,
- Se,
- /*ignoreEmptyStringLiteral*/
- !1,
- "default"
- ), ie = t.restoreOuterExpressions(ie, Se));
- const J = t.createAssignment(u, ie);
- return t.createExpressionStatement(J);
- }
- function X(ne) {
- if (d)
- return ne;
- d = t.createUniqueName(
- "_default",
- 56
- /* Optimistic */
- ), i(d);
- const ie = t.createAssignment(d, ne.expression);
- return t.createExpressionStatement(ie);
- }
- function q(ne) {
- if (!ne.name && u)
- return ne;
- const ie = Gn(
- ne,
- 32
- /* Export */
- ), Se = Gn(
- ne,
- 2048
- /* Default */
- );
- let J = t.converters.convertToClassExpression(ne);
- return ne.name && (G(
- t.getLocalName(ne),
- ie && !Se,
- /*exportAlias*/
- void 0,
- ne
- ), J = t.createAssignment(t.getDeclarationName(ne), J), Q_(J) && (J = tf(
- e,
- J,
- /*ignoreEmptyStringLiteral*/
- !1
- )), kn(J, ne), da(J, ne), nl(J, ne)), Se && !u && (u = t.createUniqueName(
- "_default",
- 56
- /* Optimistic */
- ), G(
- u,
- /*isExport*/
- !0,
- "default",
- ne
- ), J = t.createAssignment(u, J), Q_(J) && (J = tf(
- e,
- J,
- /*ignoreEmptyStringLiteral*/
- !1,
- "default"
- )), kn(J, ne)), t.createExpressionStatement(J);
- }
- function V(ne) {
- let ie;
- const Se = Gn(
- ne,
- 32
- /* Export */
- );
- for (const J of ne.declarationList.declarations)
- ee(J, Se, J), J.initializer && (ie = wr(ie, ae(J)));
- if (ie) {
- const J = t.createExpressionStatement(t.inlineExpressions(ie));
- return kn(J, ne), nl(J, ne), da(J, ne), J;
- }
- }
- function ae(ne) {
- E.assertIsDefined(ne.initializer);
- let ie;
- Oe(ne.name) ? (ie = t.cloneNode(ne.name), an(ie, ya(ie) & -114689)) : ie = t.converters.convertToAssignmentPattern(ne.name);
- const Se = t.createAssignment(ie, ne.initializer);
- return kn(Se, ne), nl(Se, ne), da(Se, ne), Se;
- }
- function ee(ne, ie, Se) {
- if (As(ne.name))
- for (const J of ne.name.elements)
- ml(J) || ee(J, ie, Se);
- else
- G(
- ne.name,
- ie,
- /*exportAlias*/
- void 0,
- Se
- );
- }
- function G(ne, ie, Se, J) {
- const oe = jo(ne) ? ne : t.cloneNode(ne);
- if (ie) {
- if (Se === void 0 && !Mh(oe)) {
- const me = t.createVariableDeclaration(oe);
- J && kn(me, J), _.push(me);
- return;
- }
- const _e = Se !== void 0 ? oe : void 0, he = Se !== void 0 ? Se : oe, le = t.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- _e,
- he
- );
- J && kn(le, J), c.set(oe, le);
- }
- i(oe);
- }
- function ue() {
- return t.createUniqueName("env");
- }
- function re(ne, ie, Se) {
- const J = [], oe = t.createObjectLiteralExpression([
- t.createPropertyAssignment("stack", t.createArrayLiteralExpression()),
- t.createPropertyAssignment("error", t.createVoidZero()),
- t.createPropertyAssignment("hasError", t.createFalse())
- ]), _e = t.createVariableDeclaration(
- ie,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- oe
- ), he = t.createVariableDeclarationList(
- [_e],
- 2
- /* Const */
- ), le = t.createVariableStatement(
- /*modifiers*/
- void 0,
- he
- );
- J.push(le);
- const me = t.createBlock(
- ne,
- /*multiLine*/
- !0
- ), ve = t.createUniqueName("e"), tt = t.createCatchClause(
- ve,
- t.createBlock(
- [
- t.createExpressionStatement(
- t.createAssignment(
- t.createPropertyAccessExpression(ie, "error"),
- ve
- )
- ),
- t.createExpressionStatement(
- t.createAssignment(
- t.createPropertyAccessExpression(ie, "hasError"),
- t.createTrue()
- )
- )
- ],
- /*multiLine*/
- !0
- )
- );
- let Te;
- if (Se) {
- const fe = t.createUniqueName("result");
- Te = t.createBlock(
- [
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- fe,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n().createDisposeResourcesHelper(ie)
- )
- ],
- 2
- /* Const */
- )
- ),
- t.createIfStatement(fe, t.createExpressionStatement(t.createAwaitExpression(fe)))
- ],
- /*multiLine*/
- !0
- );
- } else
- Te = t.createBlock(
- [
- t.createExpressionStatement(
- n().createDisposeResourcesHelper(ie)
- )
- ],
- /*multiLine*/
- !0
- );
- const we = t.createTryStatement(me, tt, Te);
- return J.push(we), J;
- }
- }
- function Kye(e) {
- for (let t = 0; t < e.length; t++)
- if (!lm(e[t]) && !Gw(e[t]))
- return t;
- return 0;
- }
- function e1e(e) {
- return Fl(e) && pne(e) !== 0;
- }
- function pne(e) {
- return (e.flags & 7) === 6 ? 2 : (e.flags & 7) === 4 ? 1 : 0;
- }
- function uRe(e) {
- return pne(e.declarationList);
- }
- function dne(e) {
- return yc(e) ? uRe(e) : 0;
- }
- function pW(e) {
- let t = 0;
- for (const n of e) {
- const i = dne(n);
- if (i === 2) return 2;
- i > t && (t = i);
- }
- return t;
- }
- function _Re(e) {
- let t = 0;
- for (const n of e) {
- const i = pW(n.statements);
- if (i === 2) return 2;
- i > t && (t = i);
- }
- return t;
- }
- function mne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n
- } = e, i = e.getCompilerOptions();
- let s, o;
- return Fd(e, h);
- function c() {
- if (o.filenameDeclaration)
- return o.filenameDeclaration.name;
- const we = t.createVariableDeclaration(
- t.createUniqueName(
- "_jsxFileName",
- 48
- /* FileLevel */
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createStringLiteral(s.fileName)
- );
- return o.filenameDeclaration = we, o.filenameDeclaration.name;
- }
- function _(we) {
- return i.jsx === 5 ? "jsxDEV" : we ? "jsxs" : "jsx";
- }
- function u(we) {
- const fe = _(we);
- return g(fe);
- }
- function d() {
- return g("Fragment");
- }
- function g(we) {
- var fe, Me;
- const Qe = we === "createElement" ? o.importSpecifier : m5(o.importSpecifier, i), et = (Me = (fe = o.utilizedImplicitRuntimeImports) == null ? void 0 : fe.get(Qe)) == null ? void 0 : Me.get(we);
- if (et)
- return et.name;
- o.utilizedImplicitRuntimeImports || (o.utilizedImplicitRuntimeImports = /* @__PURE__ */ new Map());
- let Re = o.utilizedImplicitRuntimeImports.get(Qe);
- Re || (Re = /* @__PURE__ */ new Map(), o.utilizedImplicitRuntimeImports.set(Qe, Re));
- const ft = t.createUniqueName(
- `_${we}`,
- 112
- /* AllowNameSubstitution */
- ), Wt = t.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- t.createIdentifier(we),
- ft
- );
- return Nee(ft, Wt), Re.set(we, Wt), ft;
- }
- function h(we) {
- if (we.isDeclarationFile)
- return we;
- s = we, o = {}, o.importSpecifier = d5(i, we);
- let fe = br(we, S, e);
- Ih(fe, e.readEmitHelpers());
- let Me = fe.statements;
- if (o.filenameDeclaration && (Me = eS(Me.slice(), t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [o.filenameDeclaration],
- 2
- /* Const */
- )
- ))), o.utilizedImplicitRuntimeImports) {
- for (const [Qe, et] of as(o.utilizedImplicitRuntimeImports.entries()))
- if (il(we)) {
- const Re = t.createImportDeclaration(
- /*modifiers*/
- void 0,
- t.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- t.createNamedImports(as(et.values()))
- ),
- t.createStringLiteral(Qe),
- /*attributes*/
- void 0
- );
- Nh(
- Re,
- /*incremental*/
- !1
- ), Me = eS(Me.slice(), Re);
- } else if (X_(we)) {
- const Re = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- t.createObjectBindingPattern(as(et.values(), (ft) => t.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- ft.propertyName,
- ft.name
- ))),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createCallExpression(
- t.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- [t.createStringLiteral(Qe)]
- )
- )
- ],
- 2
- /* Const */
- )
- );
- Nh(
- Re,
- /*incremental*/
- !1
- ), Me = eS(Me.slice(), Re);
- }
- }
- return Me !== fe.statements && (fe = t.updateSourceFile(fe, Me)), o = void 0, fe;
- }
- function S(we) {
- return we.transformFlags & 2 ? T(we) : we;
- }
- function T(we) {
- switch (we.kind) {
- case 284:
- return F(
- we,
- /*isChild*/
- !1
- );
- case 285:
- return O(
- we,
- /*isChild*/
- !1
- );
- case 288:
- return B(
- we,
- /*isChild*/
- !1
- );
- case 294:
- return Te(we);
- default:
- return br(we, S, e);
- }
- }
- function C(we) {
- switch (we.kind) {
- case 12:
- return oe(we);
- case 294:
- return Te(we);
- case 284:
- return F(
- we,
- /*isChild*/
- !0
- );
- case 285:
- return O(
- we,
- /*isChild*/
- !0
- );
- case 288:
- return B(
- we,
- /*isChild*/
- !0
- );
- default:
- return E.failBadSyntaxKind(we);
- }
- }
- function D(we) {
- return we.properties.some(
- (fe) => Qc(fe) && (Oe(fe.name) && Nn(fe.name) === "__proto__" || oa(fe.name) && fe.name.text === "__proto__")
- );
- }
- function P(we) {
- let fe = !1;
- for (const Me of we.attributes.properties)
- if (Lx(Me) && (!Ks(Me.expression) || Me.expression.properties.some($g)))
- fe = !0;
- else if (fe && km(Me) && Oe(Me.name) && Me.name.escapedText === "key")
- return !0;
- return !1;
- }
- function I(we) {
- return o.importSpecifier === void 0 || P(we);
- }
- function F(we, fe) {
- return (I(we.openingElement) ? ae : q)(
- we.openingElement,
- we.children,
- fe,
- /*location*/
- we
- );
- }
- function O(we, fe) {
- return (I(we) ? ae : q)(
- we,
- /*children*/
- void 0,
- fe,
- /*location*/
- we
- );
- }
- function B(we, fe) {
- return (o.importSpecifier === void 0 ? G : ee)(
- we.openingFragment,
- we.children,
- fe,
- /*location*/
- we
- );
- }
- function z(we) {
- const fe = X(we);
- return fe && t.createObjectLiteralExpression([fe]);
- }
- function X(we) {
- const fe = wC(we);
- if (Nr(fe) === 1 && !fe[0].dotDotDotToken) {
- const Qe = C(fe[0]);
- return Qe && t.createPropertyAssignment("children", Qe);
- }
- const Me = Ai(we, C);
- return Nr(Me) ? t.createPropertyAssignment("children", t.createArrayLiteralExpression(Me)) : void 0;
- }
- function q(we, fe, Me, Qe) {
- const et = ve(we), Re = fe && fe.length ? X(fe) : void 0, ft = On(we.attributes.properties, (Ir) => !!Ir.name && Oe(Ir.name) && Ir.name.escapedText === "key"), Wt = ft ? Ln(we.attributes.properties, (Ir) => Ir !== ft) : we.attributes.properties, _r = Nr(Wt) ? re(Wt, Re) : t.createObjectLiteralExpression(Re ? [Re] : Ue);
- return V(
- et,
- _r,
- ft,
- fe || Ue,
- Me,
- Qe
- );
- }
- function V(we, fe, Me, Qe, et, Re) {
- var ft;
- const Wt = wC(Qe), _r = Nr(Wt) > 1 || !!((ft = Wt[0]) != null && ft.dotDotDotToken), Ir = [we, fe];
- if (Me && Ir.push(J(Me.initializer)), i.jsx === 5) {
- const Nt = Ho(s);
- if (Nt && Si(Nt)) {
- Me === void 0 && Ir.push(t.createVoidZero()), Ir.push(_r ? t.createTrue() : t.createFalse());
- const Qt = Qs(Nt, Re.pos);
- Ir.push(t.createObjectLiteralExpression([
- t.createPropertyAssignment("fileName", c()),
- t.createPropertyAssignment("lineNumber", t.createNumericLiteral(Qt.line + 1)),
- t.createPropertyAssignment("columnNumber", t.createNumericLiteral(Qt.character + 1))
- ])), Ir.push(t.createThis());
- }
- }
- const jr = lt(
- t.createCallExpression(
- u(_r),
- /*typeArguments*/
- void 0,
- Ir
- ),
- Re
- );
- return et && bu(jr), jr;
- }
- function ae(we, fe, Me, Qe) {
- const et = ve(we), Re = we.attributes.properties, ft = Nr(Re) ? re(Re) : t.createNull(), Wt = o.importSpecifier === void 0 ? XJ(
- t,
- e.getEmitResolver().getJsxFactoryEntity(s),
- i.reactNamespace,
- // TODO: GH#18217
- we
- ) : g("createElement"), _r = _te(
- t,
- Wt,
- et,
- ft,
- Ai(fe, C),
- Qe
- );
- return Me && bu(_r), _r;
- }
- function ee(we, fe, Me, Qe) {
- let et;
- if (fe && fe.length) {
- const Re = z(fe);
- Re && (et = Re);
- }
- return V(
- d(),
- et || t.createObjectLiteralExpression([]),
- /*keyAttr*/
- void 0,
- fe,
- Me,
- Qe
- );
- }
- function G(we, fe, Me, Qe) {
- const et = fte(
- t,
- e.getEmitResolver().getJsxFactoryEntity(s),
- e.getEmitResolver().getJsxFragmentFactoryEntity(s),
- i.reactNamespace,
- // TODO: GH#18217
- Ai(fe, C),
- we,
- Qe
- );
- return Me && bu(et), et;
- }
- function ue(we) {
- return Ks(we.expression) && !D(we.expression) ? qc(we.expression.properties, (fe) => E.checkDefined(Ge(fe, S, kh))) : t.createSpreadAssignment(E.checkDefined(Ge(we.expression, S, _t)));
- }
- function re(we, fe) {
- const Me = pa(i);
- return Me && Me >= 5 ? t.createObjectLiteralExpression(ne(we, fe)) : ie(we, fe);
- }
- function ne(we, fe) {
- const Me = Np(aR(we, Lx, (Qe, et) => Np(lr(Qe, (Re) => et ? ue(Re) : Se(Re)))));
- return fe && Me.push(fe), Me;
- }
- function ie(we, fe) {
- const Me = [];
- let Qe = [];
- for (const Re of we) {
- if (Lx(Re)) {
- if (Ks(Re.expression) && !D(Re.expression)) {
- for (const ft of Re.expression.properties) {
- if ($g(ft)) {
- et(), Me.push(E.checkDefined(Ge(ft.expression, S, _t)));
- continue;
- }
- Qe.push(E.checkDefined(Ge(ft, S)));
- }
- continue;
- }
- et(), Me.push(E.checkDefined(Ge(Re.expression, S, _t)));
- continue;
- }
- Qe.push(Se(Re));
- }
- return fe && Qe.push(fe), et(), Me.length && !Ks(Me[0]) && Me.unshift(t.createObjectLiteralExpression()), Qm(Me) || n().createAssignHelper(Me);
- function et() {
- Qe.length && (Me.push(t.createObjectLiteralExpression(Qe)), Qe = []);
- }
- }
- function Se(we) {
- const fe = tt(we), Me = J(we.initializer);
- return t.createPropertyAssignment(fe, Me);
- }
- function J(we) {
- if (we === void 0)
- return t.createTrue();
- if (we.kind === 11) {
- const fe = we.singleQuote !== void 0 ? we.singleQuote : !w7(we, s), Me = t.createStringLiteral(me(we.text) || we.text, fe);
- return lt(Me, we);
- }
- return we.kind === 294 ? we.expression === void 0 ? t.createTrue() : E.checkDefined(Ge(we.expression, S, _t)) : Gg(we) ? F(
- we,
- /*isChild*/
- !1
- ) : yS(we) ? O(
- we,
- /*isChild*/
- !1
- ) : zb(we) ? B(
- we,
- /*isChild*/
- !1
- ) : E.failBadSyntaxKind(we);
- }
- function oe(we) {
- const fe = _e(we.text);
- return fe === void 0 ? void 0 : t.createStringLiteral(fe);
- }
- function _e(we) {
- let fe, Me = 0, Qe = -1;
- for (let et = 0; et < we.length; et++) {
- const Re = we.charCodeAt(et);
- gu(Re) ? (Me !== -1 && Qe !== -1 && (fe = he(fe, we.substr(Me, Qe - Me + 1))), Me = -1) : sm(Re) || (Qe = et, Me === -1 && (Me = et));
- }
- return Me !== -1 ? he(fe, we.substr(Me)) : fe;
- }
- function he(we, fe) {
- const Me = le(fe);
- return we === void 0 ? Me : we + " " + Me;
- }
- function le(we) {
- return we.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, (fe, Me, Qe, et, Re, ft, Wt) => {
- if (Re)
- return QE(parseInt(Re, 10));
- if (ft)
- return QE(parseInt(ft, 16));
- {
- const _r = fRe.get(Wt);
- return _r ? QE(_r) : fe;
- }
- });
- }
- function me(we) {
- const fe = le(we);
- return fe === we ? void 0 : fe;
- }
- function ve(we) {
- if (we.kind === 284)
- return ve(we.openingElement);
- {
- const fe = we.tagName;
- return Oe(fe) && AC(fe.escapedText) ? t.createStringLiteral(Nn(fe)) : Nd(fe) ? t.createStringLiteral(Nn(fe.namespace) + ":" + Nn(fe.name)) : oA(t, fe);
- }
- }
- function tt(we) {
- const fe = we.name;
- if (Oe(fe)) {
- const Me = Nn(fe);
- return /^[A-Z_]\w*$/i.test(Me) ? fe : t.createStringLiteral(Me);
- }
- return t.createStringLiteral(Nn(fe.namespace) + ":" + Nn(fe.name));
- }
- function Te(we) {
- const fe = Ge(we.expression, S, _t);
- return we.dotDotDotToken ? t.createSpreadElement(fe) : fe;
- }
- }
- var fRe = new Map(Object.entries({
- quot: 34,
- amp: 38,
- apos: 39,
- lt: 60,
- gt: 62,
- nbsp: 160,
- iexcl: 161,
- cent: 162,
- pound: 163,
- curren: 164,
- yen: 165,
- brvbar: 166,
- sect: 167,
- uml: 168,
- copy: 169,
- ordf: 170,
- laquo: 171,
- not: 172,
- shy: 173,
- reg: 174,
- macr: 175,
- deg: 176,
- plusmn: 177,
- sup2: 178,
- sup3: 179,
- acute: 180,
- micro: 181,
- para: 182,
- middot: 183,
- cedil: 184,
- sup1: 185,
- ordm: 186,
- raquo: 187,
- frac14: 188,
- frac12: 189,
- frac34: 190,
- iquest: 191,
- Agrave: 192,
- Aacute: 193,
- Acirc: 194,
- Atilde: 195,
- Auml: 196,
- Aring: 197,
- AElig: 198,
- Ccedil: 199,
- Egrave: 200,
- Eacute: 201,
- Ecirc: 202,
- Euml: 203,
- Igrave: 204,
- Iacute: 205,
- Icirc: 206,
- Iuml: 207,
- ETH: 208,
- Ntilde: 209,
- Ograve: 210,
- Oacute: 211,
- Ocirc: 212,
- Otilde: 213,
- Ouml: 214,
- times: 215,
- Oslash: 216,
- Ugrave: 217,
- Uacute: 218,
- Ucirc: 219,
- Uuml: 220,
- Yacute: 221,
- THORN: 222,
- szlig: 223,
- agrave: 224,
- aacute: 225,
- acirc: 226,
- atilde: 227,
- auml: 228,
- aring: 229,
- aelig: 230,
- ccedil: 231,
- egrave: 232,
- eacute: 233,
- ecirc: 234,
- euml: 235,
- igrave: 236,
- iacute: 237,
- icirc: 238,
- iuml: 239,
- eth: 240,
- ntilde: 241,
- ograve: 242,
- oacute: 243,
- ocirc: 244,
- otilde: 245,
- ouml: 246,
- divide: 247,
- oslash: 248,
- ugrave: 249,
- uacute: 250,
- ucirc: 251,
- uuml: 252,
- yacute: 253,
- thorn: 254,
- yuml: 255,
- OElig: 338,
- oelig: 339,
- Scaron: 352,
- scaron: 353,
- Yuml: 376,
- fnof: 402,
- circ: 710,
- tilde: 732,
- Alpha: 913,
- Beta: 914,
- Gamma: 915,
- Delta: 916,
- Epsilon: 917,
- Zeta: 918,
- Eta: 919,
- Theta: 920,
- Iota: 921,
- Kappa: 922,
- Lambda: 923,
- Mu: 924,
- Nu: 925,
- Xi: 926,
- Omicron: 927,
- Pi: 928,
- Rho: 929,
- Sigma: 931,
- Tau: 932,
- Upsilon: 933,
- Phi: 934,
- Chi: 935,
- Psi: 936,
- Omega: 937,
- alpha: 945,
- beta: 946,
- gamma: 947,
- delta: 948,
- epsilon: 949,
- zeta: 950,
- eta: 951,
- theta: 952,
- iota: 953,
- kappa: 954,
- lambda: 955,
- mu: 956,
- nu: 957,
- xi: 958,
- omicron: 959,
- pi: 960,
- rho: 961,
- sigmaf: 962,
- sigma: 963,
- tau: 964,
- upsilon: 965,
- phi: 966,
- chi: 967,
- psi: 968,
- omega: 969,
- thetasym: 977,
- upsih: 978,
- piv: 982,
- ensp: 8194,
- emsp: 8195,
- thinsp: 8201,
- zwnj: 8204,
- zwj: 8205,
- lrm: 8206,
- rlm: 8207,
- ndash: 8211,
- mdash: 8212,
- lsquo: 8216,
- rsquo: 8217,
- sbquo: 8218,
- ldquo: 8220,
- rdquo: 8221,
- bdquo: 8222,
- dagger: 8224,
- Dagger: 8225,
- bull: 8226,
- hellip: 8230,
- permil: 8240,
- prime: 8242,
- Prime: 8243,
- lsaquo: 8249,
- rsaquo: 8250,
- oline: 8254,
- frasl: 8260,
- euro: 8364,
- image: 8465,
- weierp: 8472,
- real: 8476,
- trade: 8482,
- alefsym: 8501,
- larr: 8592,
- uarr: 8593,
- rarr: 8594,
- darr: 8595,
- harr: 8596,
- crarr: 8629,
- lArr: 8656,
- uArr: 8657,
- rArr: 8658,
- dArr: 8659,
- hArr: 8660,
- forall: 8704,
- part: 8706,
- exist: 8707,
- empty: 8709,
- nabla: 8711,
- isin: 8712,
- notin: 8713,
- ni: 8715,
- prod: 8719,
- sum: 8721,
- minus: 8722,
- lowast: 8727,
- radic: 8730,
- prop: 8733,
- infin: 8734,
- ang: 8736,
- and: 8743,
- or: 8744,
- cap: 8745,
- cup: 8746,
- int: 8747,
- there4: 8756,
- sim: 8764,
- cong: 8773,
- asymp: 8776,
- ne: 8800,
- equiv: 8801,
- le: 8804,
- ge: 8805,
- sub: 8834,
- sup: 8835,
- nsub: 8836,
- sube: 8838,
- supe: 8839,
- oplus: 8853,
- otimes: 8855,
- perp: 8869,
- sdot: 8901,
- lceil: 8968,
- rceil: 8969,
- lfloor: 8970,
- rfloor: 8971,
- lang: 9001,
- rang: 9002,
- loz: 9674,
- spades: 9824,
- clubs: 9827,
- hearts: 9829,
- diams: 9830
- }));
- function gne(e) {
- const {
- factory: t,
- hoistVariableDeclaration: n
- } = e;
- return Fd(e, i);
- function i(u) {
- return u.isDeclarationFile ? u : br(u, s, e);
- }
- function s(u) {
- if (!(u.transformFlags & 512))
- return u;
- switch (u.kind) {
- case 226:
- return o(u);
- default:
- return br(u, s, e);
- }
- }
- function o(u) {
- switch (u.operatorToken.kind) {
- case 68:
- return c(u);
- case 43:
- return _(u);
- default:
- return br(u, s, e);
- }
- }
- function c(u) {
- let d, g;
- const h = Ge(u.left, s, _t), S = Ge(u.right, s, _t);
- if (ko(h)) {
- const T = t.createTempVariable(n), C = t.createTempVariable(n);
- d = lt(
- t.createElementAccessExpression(
- lt(t.createAssignment(T, h.expression), h.expression),
- lt(t.createAssignment(C, h.argumentExpression), h.argumentExpression)
- ),
- h
- ), g = lt(
- t.createElementAccessExpression(
- T,
- C
- ),
- h
- );
- } else if (Cn(h)) {
- const T = t.createTempVariable(n);
- d = lt(
- t.createPropertyAccessExpression(
- lt(t.createAssignment(T, h.expression), h.expression),
- h.name
- ),
- h
- ), g = lt(
- t.createPropertyAccessExpression(
- T,
- h.name
- ),
- h
- );
- } else
- d = h, g = h;
- return lt(
- t.createAssignment(
- d,
- lt(t.createGlobalMethodCall("Math", "pow", [g, S]), u)
- ),
- u
- );
- }
- function _(u) {
- const d = Ge(u.left, s, _t), g = Ge(u.right, s, _t);
- return lt(t.createGlobalMethodCall("Math", "pow", [d, g]), u);
- }
- }
- function t1e(e, t) {
- return { kind: e, expression: t };
- }
- function hne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- startLexicalEnvironment: i,
- resumeLexicalEnvironment: s,
- endLexicalEnvironment: o,
- hoistVariableDeclaration: c
- } = e, _ = e.getCompilerOptions(), u = e.getEmitResolver(), d = e.onSubstituteNode, g = e.onEmitNode;
- e.onEmitNode = A_, e.onSubstituteNode = yp;
- let h, S, T, C;
- function D(Y) {
- C = wr(
- C,
- t.createVariableDeclaration(Y)
- );
- }
- let P, I;
- return Fd(e, F);
- function F(Y) {
- if (Y.isDeclarationFile)
- return Y;
- h = Y, S = Y.text;
- const st = re(Y);
- return Ih(st, e.readEmitHelpers()), h = void 0, S = void 0, C = void 0, T = 0, st;
- }
- function O(Y, st) {
- const It = T;
- return T = (T & ~Y | st) & 32767, It;
- }
- function B(Y, st, It) {
- T = (T & ~st | It) & -32768 | Y;
- }
- function z(Y) {
- return (T & 8192) !== 0 && Y.kind === 253 && !Y.expression;
- }
- function X(Y) {
- return Y.transformFlags & 4194304 && (Up(Y) || _v(Y) || Xee(Y) || oD(Y) || cD(Y) || XC(Y) || uD(Y) || gS(Y) || Ub(Y) || Gy(Y) || Ny(
- Y,
- /*lookInLabeledStatements*/
- !1
- ) || Cs(Y));
- }
- function q(Y) {
- return (Y.transformFlags & 1024) !== 0 || P !== void 0 || T & 8192 && X(Y) || Ny(
- Y,
- /*lookInLabeledStatements*/
- !1
- ) && vi(Y) || (_d(Y) & 1) !== 0;
- }
- function V(Y) {
- return q(Y) ? ue(
- Y,
- /*expressionResultIsUnused*/
- !1
- ) : Y;
- }
- function ae(Y) {
- return q(Y) ? ue(
- Y,
- /*expressionResultIsUnused*/
- !0
- ) : Y;
- }
- function ee(Y) {
- if (q(Y)) {
- const st = Ho(Y);
- if (cs(st) && tl(st)) {
- const It = O(
- 32670,
- 16449
- /* StaticInitializerIncludes */
- ), Mt = ue(
- Y,
- /*expressionResultIsUnused*/
- !1
- );
- return B(
- It,
- 229376,
- 0
- /* None */
- ), Mt;
- }
- return ue(
- Y,
- /*expressionResultIsUnused*/
- !1
- );
- }
- return Y;
- }
- function G(Y) {
- return Y.kind === 108 ? cf(
- Y,
- /*isExpressionOfCall*/
- !0
- ) : V(Y);
- }
- function ue(Y, st) {
- switch (Y.kind) {
- case 126:
- return;
- case 263:
- return ve(Y);
- case 231:
- return tt(Y);
- case 169:
- return Hs(Y);
- case 262:
- return Zt(Y);
- case 219:
- return He(Y);
- case 218:
- return Vt(Y);
- case 260:
- return $r(Y);
- case 80:
- return le(Y);
- case 261:
- return Ie(Y);
- case 255:
- return ne(Y);
- case 269:
- return ie(Y);
- case 241:
- return Ae(
- Y
- );
- case 252:
- case 251:
- return me(Y);
- case 256:
- return wt(Y);
- case 246:
- case 247:
- return Ht(
- Y,
- /*outermostLabeledStatement*/
- void 0
- );
- case 248:
- return en(
- Y,
- /*outermostLabeledStatement*/
- void 0
- );
- case 249:
- return mr(
- Y,
- /*outermostLabeledStatement*/
- void 0
- );
- case 250:
- return Kt(
- Y,
- /*outermostLabeledStatement*/
- void 0
- );
- case 244:
- return dt(Y);
- case 210:
- return Ts(Y);
- case 299:
- return ri(Y);
- case 304:
- return vc(Y);
- case 167:
- return Oc(Y);
- case 209:
- return Lo(Y);
- case 213:
- return _c(Y);
- case 214:
- return al(Y);
- case 217:
- return U(Y, st);
- case 226:
- return be(Y, st);
- case 355:
- return Z(Y, st);
- case 15:
- case 16:
- case 17:
- case 18:
- return ka(Y);
- case 11:
- return Pc(Y);
- case 9:
- return yl(Y);
- case 215:
- return so(Y);
- case 228:
- return Va(Y);
- case 229:
- return Fc(Y);
- case 230:
- return Sa(Y);
- case 108:
- return cf(
- Y,
- /*isExpressionOfCall*/
- !1
- );
- case 110:
- return _e(Y);
- case 236:
- return Xp(Y);
- case 174:
- return za(Y);
- case 177:
- case 178:
- return Uo(Y);
- case 243:
- return Le(Y);
- case 253:
- return oe(Y);
- case 222:
- return he(Y);
- default:
- return br(Y, V, e);
- }
- }
- function re(Y) {
- const st = O(
- 8064,
- 64
- /* SourceFileIncludes */
- ), It = [], Mt = [];
- i();
- const Sr = t.copyPrologue(
- Y.statements,
- It,
- /*ensureUseStrict*/
- !1,
- V
- );
- return Fn(Mt, Fr(Y.statements, V, bi, Sr)), C && Mt.push(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(C)
- )
- ), t.mergeLexicalEnvironment(It, o()), K(It, Y), B(
- st,
- 0,
- 0
- /* None */
- ), t.updateSourceFile(
- Y,
- lt(t.createNodeArray(Qi(It, Mt)), Y.statements)
- );
- }
- function ne(Y) {
- if (P !== void 0) {
- const st = P.allowedNonLabeledJumps;
- P.allowedNonLabeledJumps |= 2;
- const It = br(Y, V, e);
- return P.allowedNonLabeledJumps = st, It;
- }
- return br(Y, V, e);
- }
- function ie(Y) {
- const st = O(
- 7104,
- 0
- /* BlockScopeIncludes */
- ), It = br(Y, V, e);
- return B(
- st,
- 0,
- 0
- /* None */
- ), It;
- }
- function Se(Y) {
- return kn(t.createReturnStatement(J()), Y);
- }
- function J() {
- return t.createUniqueName(
- "_this",
- 48
- /* FileLevel */
- );
- }
- function oe(Y) {
- return P ? (P.nonLocalJumps |= 8, z(Y) && (Y = Se(Y)), t.createReturnStatement(
- t.createObjectLiteralExpression(
- [
- t.createPropertyAssignment(
- t.createIdentifier("value"),
- Y.expression ? E.checkDefined(Ge(Y.expression, V, _t)) : t.createVoidZero()
- )
- ]
- )
- )) : z(Y) ? Se(Y) : br(Y, V, e);
- }
- function _e(Y) {
- return T |= 65536, T & 2 && !(T & 16384) && (T |= 131072), P ? T & 2 ? (P.containsLexicalThis = !0, Y) : P.thisName || (P.thisName = t.createUniqueName("this")) : Y;
- }
- function he(Y) {
- return br(Y, ae, e);
- }
- function le(Y) {
- return P && u.isArgumentsLocalBinding(Y) ? P.argumentsName || (P.argumentsName = t.createUniqueName("arguments")) : Y.flags & 256 ? kn(
- lt(
- t.createIdentifier(Ei(Y.escapedText)),
- Y
- ),
- Y
- ) : Y;
- }
- function me(Y) {
- if (P) {
- const st = Y.kind === 252 ? 2 : 4;
- if (!(Y.label && P.labels && P.labels.get(Nn(Y.label)) || !Y.label && P.allowedNonLabeledJumps & st)) {
- let Mt;
- const Sr = Y.label;
- Sr ? Y.kind === 252 ? (Mt = `break-${Sr.escapedText}`, rt(
- P,
- /*isBreak*/
- !0,
- Nn(Sr),
- Mt
- )) : (Mt = `continue-${Sr.escapedText}`, rt(
- P,
- /*isBreak*/
- !1,
- Nn(Sr),
- Mt
- )) : Y.kind === 252 ? (P.nonLocalJumps |= 2, Mt = "break") : (P.nonLocalJumps |= 4, Mt = "continue");
- let Vr = t.createStringLiteral(Mt);
- if (P.loopOutParameters.length) {
- const En = P.loopOutParameters;
- let si;
- for (let L = 0; L < En.length; L++) {
- const Ce = of(
- En[L],
- 1
- /* ToOutParameter */
- );
- L === 0 ? si = Ce : si = t.createBinaryExpression(si, 28, Ce);
- }
- Vr = t.createBinaryExpression(si, 28, Vr);
- }
- return t.createReturnStatement(Vr);
- }
- }
- return br(Y, V, e);
- }
- function ve(Y) {
- const st = t.createVariableDeclaration(
- t.getLocalName(
- Y,
- /*allowComments*/
- !0
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Te(Y)
- );
- kn(st, Y);
- const It = [], Mt = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([st])
- );
- if (kn(Mt, Y), lt(Mt, Y), bu(Mt), It.push(Mt), Gn(
- Y,
- 32
- /* Export */
- )) {
- const Sr = Gn(
- Y,
- 2048
- /* Default */
- ) ? t.createExportDefault(t.getLocalName(Y)) : t.createExternalModuleExport(t.getLocalName(Y));
- kn(Sr, Mt), It.push(Sr);
- }
- return Ym(It);
- }
- function tt(Y) {
- return Te(Y);
- }
- function Te(Y) {
- Y.name && Sf();
- const st = Cb(Y), It = t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- st ? [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Uc()
- )] : [],
- /*type*/
- void 0,
- we(Y, st)
- );
- an(
- It,
- ya(Y) & 131072 | 1048576
- /* ReuseTempVariableScope */
- );
- const Mt = t.createPartiallyEmittedExpression(It);
- zC(Mt, Y.end), an(
- Mt,
- 3072
- /* NoComments */
- );
- const Sr = t.createPartiallyEmittedExpression(Mt);
- zC(Sr, aa(S, Y.pos)), an(
- Sr,
- 3072
- /* NoComments */
- );
- const Vr = t.createParenthesizedExpression(
- t.createCallExpression(
- Sr,
- /*typeArguments*/
- void 0,
- st ? [E.checkDefined(Ge(st.expression, V, _t))] : []
- )
- );
- return Z4(Vr, 3, "* @class "), Vr;
- }
- function we(Y, st) {
- const It = [], Mt = t.getInternalName(Y), Sr = hB(Mt) ? t.getGeneratedNameForNode(Mt) : Mt;
- i(), fe(It, Y, st), Me(It, Y, Sr, st), Ke(It, Y);
- const Vr = JB(
- aa(S, Y.members.end),
- 20
- /* CloseBraceToken */
- ), En = t.createPartiallyEmittedExpression(Sr);
- zC(En, Vr.end), an(
- En,
- 3072
- /* NoComments */
- );
- const si = t.createReturnStatement(En);
- q4(si, Vr.pos), an(
- si,
- 3840
- /* NoTokenSourceMaps */
- ), It.push(si), Mg(It, o());
- const L = t.createBlock(
- lt(
- t.createNodeArray(It),
- /*location*/
- Y.members
- ),
- /*multiLine*/
- !0
- );
- return an(
- L,
- 3072
- /* NoComments */
- ), L;
- }
- function fe(Y, st, It) {
- It && Y.push(
- lt(
- t.createExpressionStatement(
- n().createExtendsHelper(t.getInternalName(st))
- ),
- /*location*/
- It
- )
- );
- }
- function Me(Y, st, It, Mt) {
- const Sr = P;
- P = void 0;
- const Vr = O(
- 32662,
- 73
- /* ConstructorIncludes */
- ), En = Bg(st), si = Vf(En, Mt !== void 0), L = t.createFunctionDeclaration(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- It,
- /*typeParameters*/
- void 0,
- Qe(En, si),
- /*type*/
- void 0,
- Wt(En, st, Mt, si)
- );
- lt(L, En || st), Mt && an(
- L,
- 16
- /* CapturesThis */
- ), Y.push(L), B(
- Vr,
- 229376,
- 0
- /* None */
- ), P = Sr;
- }
- function Qe(Y, st) {
- return cc(Y && !st ? Y.parameters : void 0, V, e) || [];
- }
- function et(Y, st) {
- const It = [];
- s(), t.mergeLexicalEnvironment(It, o()), st && It.push(t.createReturnStatement(Ws()));
- const Mt = t.createNodeArray(It);
- lt(Mt, Y.members);
- const Sr = t.createBlock(
- Mt,
- /*multiLine*/
- !0
- );
- return lt(Sr, Y), an(
- Sr,
- 3072
- /* NoComments */
- ), Sr;
- }
- function Re(Y) {
- return yc(Y) && Mi(Y.declarationList.declarations, (st) => Oe(st.name) && !st.initializer);
- }
- function ft(Y) {
- if (rS(Y))
- return !0;
- if (!(Y.transformFlags & 134217728))
- return !1;
- switch (Y.kind) {
- case 219:
- case 218:
- case 262:
- case 176:
- case 175:
- return !1;
- case 177:
- case 178:
- case 174:
- case 172: {
- const st = Y;
- return ma(st.name) ? !!bs(st.name, ft) : !1;
- }
- }
- return !!bs(Y, ft);
- }
- function Wt(Y, st, It, Mt) {
- const Sr = !!It && Dc(It.expression).kind !== 106;
- if (!Y) return et(st, Sr);
- const Vr = [], En = [];
- s();
- const si = t.copyStandardPrologue(
- Y.body.statements,
- Vr,
- /*statementOffset*/
- 0
- );
- (Mt || ft(Y.body)) && (T |= 8192), Fn(En, Fr(Y.body.statements, V, bi, si));
- const L = Sr || T & 8192;
- Ea(Vr, Y), ze(Vr, Y, Mt), Ve(Vr, Y), L ? De(Vr, Y, Oi()) : K(Vr, Y), t.mergeLexicalEnvironment(Vr, o()), L && !qn(Y.body) && En.push(t.createReturnStatement(J()));
- const Ce = t.createBlock(
- lt(
- t.createNodeArray(
- [
- ...Vr,
- ...En
- ]
- ),
- /*location*/
- Y.body.statements
- ),
- /*multiLine*/
- !0
- );
- return lt(Ce, Y.body), ti(Ce, Y.body, Mt);
- }
- function _r(Y) {
- return jo(Y) && Nn(Y) === "_this";
- }
- function Ir(Y) {
- return jo(Y) && Nn(Y) === "_super";
- }
- function jr(Y) {
- return yc(Y) && Y.declarationList.declarations.length === 1 && Nt(Y.declarationList.declarations[0]);
- }
- function Nt(Y) {
- return ii(Y) && _r(Y.name) && !!Y.initializer;
- }
- function Qt(Y) {
- return Dl(
- Y,
- /*excludeCompoundAssignment*/
- !0
- ) && _r(Y.left);
- }
- function Br(Y) {
- return Fs(Y) && Cn(Y.expression) && Ir(Y.expression.expression) && Oe(Y.expression.name) && (Nn(Y.expression.name) === "call" || Nn(Y.expression.name) === "apply") && Y.arguments.length >= 1 && Y.arguments[0].kind === 110;
- }
- function xr(Y) {
- return dn(Y) && Y.operatorToken.kind === 57 && Y.right.kind === 110 && Br(Y.left);
- }
- function zn(Y) {
- return dn(Y) && Y.operatorToken.kind === 56 && dn(Y.left) && Y.left.operatorToken.kind === 38 && Ir(Y.left.left) && Y.left.right.kind === 106 && Br(Y.right) && Nn(Y.right.expression.name) === "apply";
- }
- function ki(Y) {
- return dn(Y) && Y.operatorToken.kind === 57 && Y.right.kind === 110 && zn(Y.left);
- }
- function rs(Y) {
- return Qt(Y) && xr(Y.right);
- }
- function ei(Y) {
- return Qt(Y) && ki(Y.right);
- }
- function Ri(Y) {
- return Br(Y) || xr(Y) || rs(Y) || zn(Y) || ki(Y) || ei(Y);
- }
- function Jr(Y) {
- for (let st = 0; st < Y.statements.length - 1; st++) {
- const It = Y.statements[st];
- if (!jr(It))
- continue;
- const Mt = It.declarationList.declarations[0];
- if (Mt.initializer.kind !== 110)
- continue;
- const Sr = st;
- let Vr = st + 1;
- for (; Vr < Y.statements.length; ) {
- const hi = Y.statements[Vr];
- if (Pl(hi) && Ri(Dc(hi.expression)))
- break;
- if (Re(hi)) {
- Vr++;
- continue;
- }
- return Y;
- }
- const En = Y.statements[Vr];
- let si = En.expression;
- Qt(si) && (si = si.right);
- const L = t.updateVariableDeclaration(
- Mt,
- Mt.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- si
- ), Ce = t.updateVariableDeclarationList(It.declarationList, [L]), yt = t.createVariableStatement(It.modifiers, Ce);
- kn(yt, En), lt(yt, En);
- const Mr = t.createNodeArray([
- ...Y.statements.slice(0, Sr),
- // copy statements preceding to `var _this`
- ...Y.statements.slice(Sr + 1, Vr),
- // copy intervening temp variables
- yt,
- ...Y.statements.slice(Vr + 1)
- // copy statements following `super.call(this, ...)`
- ]);
- return lt(Mr, Y.statements), t.updateBlock(Y, Mr);
- }
- return Y;
- }
- function ji(Y, st) {
- for (const Mt of st.statements)
- if (Mt.transformFlags & 134217728 && !HO(Mt))
- return Y;
- const It = !(st.transformFlags & 16384) && !(T & 65536) && !(T & 131072);
- for (let Mt = Y.statements.length - 1; Mt > 0; Mt--) {
- const Sr = Y.statements[Mt];
- if (Up(Sr) && Sr.expression && _r(Sr.expression)) {
- const Vr = Y.statements[Mt - 1];
- let En;
- if (Pl(Vr) && rs(Dc(Vr.expression)))
- En = Vr.expression;
- else if (It && jr(Vr)) {
- const Ce = Vr.declarationList.declarations[0];
- Ri(Dc(Ce.initializer)) && (En = t.createAssignment(
- J(),
- Ce.initializer
- ));
- }
- if (!En)
- break;
- const si = t.createReturnStatement(En);
- kn(si, Vr), lt(si, Vr);
- const L = t.createNodeArray([
- ...Y.statements.slice(0, Mt - 1),
- // copy all statements preceding `_super.call(this, ...)`
- si,
- ...Y.statements.slice(Mt + 1)
- // copy all statements following `return _this;`
- ]);
- return lt(L, Y.statements), t.updateBlock(Y, L);
- }
- }
- return Y;
- }
- function Fe(Y) {
- if (jr(Y)) {
- if (Y.declarationList.declarations[0].initializer.kind === 110)
- return;
- } else if (Qt(Y))
- return t.createPartiallyEmittedExpression(Y.right, Y);
- switch (Y.kind) {
- case 219:
- case 218:
- case 262:
- case 176:
- case 175:
- return Y;
- case 177:
- case 178:
- case 174:
- case 172: {
- const st = Y;
- return ma(st.name) ? t.replacePropertyName(st, br(
- st.name,
- Fe,
- /*context*/
- void 0
- )) : Y;
- }
- }
- return br(
- Y,
- Fe,
- /*context*/
- void 0
- );
- }
- function Ot(Y, st) {
- if (st.transformFlags & 16384 || T & 65536 || T & 131072)
- return Y;
- for (const It of st.statements)
- if (It.transformFlags & 134217728 && !HO(It))
- return Y;
- return t.updateBlock(Y, Fr(Y.statements, Fe, bi));
- }
- function Ar(Y) {
- if (Br(Y) && Y.arguments.length === 2 && Oe(Y.arguments[1]) && Nn(Y.arguments[1]) === "arguments")
- return t.createLogicalAnd(
- t.createStrictInequality(
- Uc(),
- t.createNull()
- ),
- Y
- );
- switch (Y.kind) {
- case 219:
- case 218:
- case 262:
- case 176:
- case 175:
- return Y;
- case 177:
- case 178:
- case 174:
- case 172: {
- const st = Y;
- return ma(st.name) ? t.replacePropertyName(st, br(
- st.name,
- Ar,
- /*context*/
- void 0
- )) : Y;
- }
- }
- return br(
- Y,
- Ar,
- /*context*/
- void 0
- );
- }
- function mn(Y) {
- return t.updateBlock(Y, Fr(Y.statements, Ar, bi));
- }
- function ti(Y, st, It) {
- const Mt = Y;
- return Y = Jr(Y), Y = ji(Y, st), Y !== Mt && (Y = Ot(Y, st)), It && (Y = mn(Y)), Y;
- }
- function qn(Y) {
- if (Y.kind === 253)
- return !0;
- if (Y.kind === 245) {
- const st = Y;
- if (st.elseStatement)
- return qn(st.thenStatement) && qn(st.elseStatement);
- } else if (Y.kind === 241) {
- const st = Ro(Y.statements);
- if (st && qn(st))
- return !0;
- }
- return !1;
- }
- function Oi() {
- return an(
- t.createThis(),
- 8
- /* NoSubstitution */
- );
- }
- function Ws() {
- return t.createLogicalOr(
- t.createLogicalAnd(
- t.createStrictInequality(
- Uc(),
- t.createNull()
- ),
- t.createFunctionApplyCall(
- Uc(),
- Oi(),
- t.createIdentifier("arguments")
- )
- ),
- Oi()
- );
- }
- function Hs(Y) {
- if (!Y.dotDotDotToken)
- return As(Y.name) ? kn(
- lt(
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- t.getGeneratedNameForNode(Y),
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ),
- /*location*/
- Y
- ),
- /*original*/
- Y
- ) : Y.initializer ? kn(
- lt(
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Y.name,
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ),
- /*location*/
- Y
- ),
- /*original*/
- Y
- ) : Y;
- }
- function rr(Y) {
- return Y.initializer !== void 0 || As(Y.name);
- }
- function Ea(Y, st) {
- if (!ut(st.parameters, rr))
- return !1;
- let It = !1;
- for (const Mt of st.parameters) {
- const { name: Sr, initializer: Vr, dotDotDotToken: En } = Mt;
- En || (As(Sr) ? It = Xe(Y, Mt, Sr, Vr) || It : Vr && (Tt(Y, Mt, Sr, Vr), It = !0));
- }
- return It;
- }
- function Xe(Y, st, It, Mt) {
- return It.elements.length > 0 ? (eS(
- Y,
- an(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- Gb(
- st,
- V,
- e,
- 0,
- t.getGeneratedNameForNode(st)
- )
- )
- ),
- 2097152
- /* CustomPrologue */
- )
- ), !0) : Mt ? (eS(
- Y,
- an(
- t.createExpressionStatement(
- t.createAssignment(
- t.getGeneratedNameForNode(st),
- E.checkDefined(Ge(Mt, V, _t))
- )
- ),
- 2097152
- /* CustomPrologue */
- )
- ), !0) : !1;
- }
- function Tt(Y, st, It, Mt) {
- Mt = E.checkDefined(Ge(Mt, V, _t));
- const Sr = t.createIfStatement(
- t.createTypeCheck(t.cloneNode(It), "undefined"),
- an(
- lt(
- t.createBlock([
- t.createExpressionStatement(
- an(
- lt(
- t.createAssignment(
- // TODO(rbuckton): Does this need to be parented?
- an(
- Aa(lt(t.cloneNode(It), It), It.parent),
- 96
- /* NoSourceMap */
- ),
- an(
- Mt,
- 96 | ya(Mt) | 3072
- /* NoComments */
- )
- ),
- st
- ),
- 3072
- /* NoComments */
- )
- )
- ]),
- st
- ),
- 3905
- /* NoComments */
- )
- );
- bu(Sr), lt(Sr, st), an(
- Sr,
- 2101056
- /* NoComments */
- ), eS(Y, Sr);
- }
- function te(Y, st) {
- return !!(Y && Y.dotDotDotToken && !st);
- }
- function ze(Y, st, It) {
- const Mt = [], Sr = Ro(st.parameters);
- if (!te(Sr, It))
- return !1;
- const Vr = Sr.name.kind === 80 ? Aa(lt(t.cloneNode(Sr.name), Sr.name), Sr.name.parent) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- an(
- Vr,
- 96
- /* NoSourceMap */
- );
- const En = Sr.name.kind === 80 ? t.cloneNode(Sr.name) : Vr, si = st.parameters.length - 1, L = t.createLoopVariable();
- Mt.push(
- an(
- lt(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- Vr,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createArrayLiteralExpression([])
- )
- ])
- ),
- /*location*/
- Sr
- ),
- 2097152
- /* CustomPrologue */
- )
- );
- const Ce = t.createForStatement(
- lt(
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- L,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createNumericLiteral(si)
- )
- ]),
- Sr
- ),
- lt(
- t.createLessThan(
- L,
- t.createPropertyAccessExpression(t.createIdentifier("arguments"), "length")
- ),
- Sr
- ),
- lt(t.createPostfixIncrement(L), Sr),
- t.createBlock([
- bu(
- lt(
- t.createExpressionStatement(
- t.createAssignment(
- t.createElementAccessExpression(
- En,
- si === 0 ? L : t.createSubtract(L, t.createNumericLiteral(si))
- ),
- t.createElementAccessExpression(t.createIdentifier("arguments"), L)
- )
- ),
- /*location*/
- Sr
- )
- )
- ])
- );
- return an(
- Ce,
- 2097152
- /* CustomPrologue */
- ), bu(Ce), Mt.push(Ce), Sr.name.kind !== 80 && Mt.push(
- an(
- lt(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- Gb(Sr, V, e, 0, En)
- )
- ),
- Sr
- ),
- 2097152
- /* CustomPrologue */
- )
- ), Mj(Y, Mt), !0;
- }
- function K(Y, st) {
- return T & 131072 && st.kind !== 219 ? (De(Y, st, t.createThis()), !0) : !1;
- }
- function De(Y, st, It) {
- Uf();
- const Mt = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- J(),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- It
- )
- ])
- );
- an(
- Mt,
- 2100224
- /* CustomPrologue */
- ), da(Mt, st), eS(Y, Mt);
- }
- function Ve(Y, st) {
- if (T & 32768) {
- let It;
- switch (st.kind) {
- case 219:
- return Y;
- case 174:
- case 177:
- case 178:
- It = t.createVoidZero();
- break;
- case 176:
- It = t.createPropertyAccessExpression(
- an(
- t.createThis(),
- 8
- /* NoSubstitution */
- ),
- "constructor"
- );
- break;
- case 262:
- case 218:
- It = t.createConditionalExpression(
- t.createLogicalAnd(
- an(
- t.createThis(),
- 8
- /* NoSubstitution */
- ),
- t.createBinaryExpression(
- an(
- t.createThis(),
- 8
- /* NoSubstitution */
- ),
- 104,
- t.getLocalName(st)
- )
- ),
- /*questionToken*/
- void 0,
- t.createPropertyAccessExpression(
- an(
- t.createThis(),
- 8
- /* NoSubstitution */
- ),
- "constructor"
- ),
- /*colonToken*/
- void 0,
- t.createVoidZero()
- );
- break;
- default:
- return E.failBadSyntaxKind(st);
- }
- const Mt = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- t.createUniqueName(
- "_newTarget",
- 48
- /* FileLevel */
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- It
- )
- ])
- );
- an(
- Mt,
- 2100224
- /* CustomPrologue */
- ), eS(Y, Mt);
- }
- return Y;
- }
- function Ke(Y, st) {
- for (const It of st.members)
- switch (It.kind) {
- case 240:
- Y.push(xe(It));
- break;
- case 174:
- Y.push(at(Zg(st, It), It, st));
- break;
- case 177:
- case 178:
- const Mt = My(st.members, It);
- It === Mt.firstAccessor && Y.push($e(Zg(st, It), Mt, st));
- break;
- case 176:
- case 175:
- break;
- default:
- E.failBadSyntaxKind(It, h && h.fileName);
- break;
- }
- }
- function xe(Y) {
- return lt(t.createEmptyStatement(), Y);
- }
- function at(Y, st, It) {
- const Mt = ym(st), Sr = E0(st), Vr = vn(
- st,
- /*location*/
- st,
- /*name*/
- void 0,
- It
- ), En = Ge(st.name, V, Bc);
- E.assert(En);
- let si;
- if (!Di(En) && R3(e.getCompilerOptions())) {
- const Ce = ma(En) ? En.expression : Oe(En) ? t.createStringLiteral(Ei(En.escapedText)) : En;
- si = t.createObjectDefinePropertyCall(Y, Ce, t.createPropertyDescriptor({ value: Vr, enumerable: !1, writable: !0, configurable: !0 }));
- } else {
- const Ce = TS(
- t,
- Y,
- En,
- /*location*/
- st.name
- );
- si = t.createAssignment(Ce, Vr);
- }
- an(
- Vr,
- 3072
- /* NoComments */
- ), da(Vr, Sr);
- const L = lt(
- t.createExpressionStatement(si),
- /*location*/
- st
- );
- return kn(L, st), nl(L, Mt), an(
- L,
- 96
- /* NoSourceMap */
- ), L;
- }
- function $e(Y, st, It) {
- const Mt = t.createExpressionStatement(bt(
- Y,
- st,
- It,
- /*startsOnNewLine*/
- !1
- ));
- return an(
- Mt,
- 3072
- /* NoComments */
- ), da(Mt, E0(st.firstAccessor)), Mt;
- }
- function bt(Y, { firstAccessor: st, getAccessor: It, setAccessor: Mt }, Sr, Vr) {
- const En = Aa(lt(t.cloneNode(Y), Y), Y.parent);
- an(
- En,
- 3136
- /* NoTrailingSourceMap */
- ), da(En, st.name);
- const si = Ge(st.name, V, Bc);
- if (E.assert(si), Di(si))
- return E.failBadSyntaxKind(si, "Encountered unhandled private identifier while transforming ES2015.");
- const L = YJ(t, si);
- an(
- L,
- 3104
- /* NoLeadingSourceMap */
- ), da(L, st.name);
- const Ce = [];
- if (It) {
- const Mr = vn(
- It,
- /*location*/
- void 0,
- /*name*/
- void 0,
- Sr
- );
- da(Mr, E0(It)), an(
- Mr,
- 1024
- /* NoLeadingComments */
- );
- const hi = t.createPropertyAssignment("get", Mr);
- nl(hi, ym(It)), Ce.push(hi);
- }
- if (Mt) {
- const Mr = vn(
- Mt,
- /*location*/
- void 0,
- /*name*/
- void 0,
- Sr
- );
- da(Mr, E0(Mt)), an(
- Mr,
- 1024
- /* NoLeadingComments */
- );
- const hi = t.createPropertyAssignment("set", Mr);
- nl(hi, ym(Mt)), Ce.push(hi);
- }
- Ce.push(
- t.createPropertyAssignment("enumerable", It || Mt ? t.createFalse() : t.createTrue()),
- t.createPropertyAssignment("configurable", t.createTrue())
- );
- const yt = t.createCallExpression(
- t.createPropertyAccessExpression(t.createIdentifier("Object"), "defineProperty"),
- /*typeArguments*/
- void 0,
- [
- En,
- L,
- t.createObjectLiteralExpression(
- Ce,
- /*multiLine*/
- !0
- )
- ]
- );
- return Vr && bu(yt), yt;
- }
- function He(Y) {
- Y.transformFlags & 16384 && !(T & 16384) && (T |= 131072);
- const st = P;
- P = void 0;
- const It = O(
- 15232,
- 66
- /* ArrowFunctionIncludes */
- ), Mt = t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- cc(Y.parameters, V, e),
- /*type*/
- void 0,
- M(Y)
- );
- return lt(Mt, Y), kn(Mt, Y), an(
- Mt,
- 16
- /* CapturesThis */
- ), B(
- It,
- 0,
- 0
- /* None */
- ), P = st, Mt;
- }
- function Vt(Y) {
- const st = ya(Y) & 524288 ? O(
- 32662,
- 69
- /* AsyncFunctionBodyIncludes */
- ) : O(
- 32670,
- 65
- /* FunctionIncludes */
- ), It = P;
- P = void 0;
- const Mt = cc(Y.parameters, V, e), Sr = M(Y), Vr = T & 32768 ? t.getLocalName(Y) : Y.name;
- return B(
- st,
- 229376,
- 0
- /* None */
- ), P = It, t.updateFunctionExpression(
- Y,
- /*modifiers*/
- void 0,
- Y.asteriskToken,
- Vr,
- /*typeParameters*/
- void 0,
- Mt,
- /*type*/
- void 0,
- Sr
- );
- }
- function Zt(Y) {
- const st = P;
- P = void 0;
- const It = O(
- 32670,
- 65
- /* FunctionIncludes */
- ), Mt = cc(Y.parameters, V, e), Sr = M(Y), Vr = T & 32768 ? t.getLocalName(Y) : Y.name;
- return B(
- It,
- 229376,
- 0
- /* None */
- ), P = st, t.updateFunctionDeclaration(
- Y,
- Fr(Y.modifiers, V, ra),
- Y.asteriskToken,
- Vr,
- /*typeParameters*/
- void 0,
- Mt,
- /*type*/
- void 0,
- Sr
- );
- }
- function vn(Y, st, It, Mt) {
- const Sr = P;
- P = void 0;
- const Vr = Mt && Zn(Mt) && !zs(Y) ? O(
- 32670,
- 73
- /* NonStaticClassElement */
- ) : O(
- 32670,
- 65
- /* FunctionIncludes */
- ), En = cc(Y.parameters, V, e), si = M(Y);
- return T & 32768 && !It && (Y.kind === 262 || Y.kind === 218) && (It = t.getGeneratedNameForNode(Y)), B(
- Vr,
- 229376,
- 0
- /* None */
- ), P = Sr, kn(
- lt(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- Y.asteriskToken,
- It,
- /*typeParameters*/
- void 0,
- En,
- /*type*/
- void 0,
- si
- ),
- st
- ),
- /*original*/
- Y
- );
- }
- function M(Y) {
- let st = !1, It = !1, Mt, Sr;
- const Vr = [], En = [], si = Y.body;
- let L;
- if (s(), Cs(si) && (L = t.copyStandardPrologue(
- si.statements,
- Vr,
- 0,
- /*ensureUseStrict*/
- !1
- ), L = t.copyCustomPrologue(si.statements, En, L, V, d7), L = t.copyCustomPrologue(si.statements, En, L, V, m7)), st = Ea(En, Y) || st, st = ze(
- En,
- Y,
- /*inConstructorWithSynthesizedSuper*/
- !1
- ) || st, Cs(si))
- L = t.copyCustomPrologue(si.statements, En, L, V), Mt = si.statements, Fn(En, Fr(si.statements, V, bi, L)), !st && si.multiLine && (st = !0);
- else {
- E.assert(
- Y.kind === 219
- /* ArrowFunction */
- ), Mt = e5(si, -1);
- const yt = Y.equalsGreaterThanToken;
- !fo(yt) && !fo(si) && (I3(yt, si, h) ? It = !0 : st = !0);
- const Mr = Ge(si, V, _t), hi = t.createReturnStatement(Mr);
- lt(hi, si), Cee(hi, si), an(
- hi,
- 2880
- /* NoTrailingComments */
- ), En.push(hi), Sr = si;
- }
- if (t.mergeLexicalEnvironment(Vr, o()), Ve(Vr, Y), K(Vr, Y), ut(Vr) && (st = !0), En.unshift(...Vr), Cs(si) && Af(En, si.statements))
- return si;
- const Ce = t.createBlock(lt(t.createNodeArray(En), Mt), st);
- return lt(Ce, Y.body), !st && It && an(
- Ce,
- 1
- /* SingleLine */
- ), Sr && kee(Ce, 20, Sr), kn(Ce, Y.body), Ce;
- }
- function Ae(Y, st) {
- const It = T & 256 ? O(
- 7104,
- 512
- /* IterationStatementBlockIncludes */
- ) : O(
- 6976,
- 128
- /* BlockIncludes */
- ), Mt = br(Y, V, e);
- return B(
- It,
- 0,
- 0
- /* None */
- ), Mt;
- }
- function dt(Y) {
- return br(Y, ae, e);
- }
- function U(Y, st) {
- return br(Y, st ? ae : V, e);
- }
- function be(Y, st) {
- return x0(Y) ? DS(
- Y,
- V,
- e,
- 0,
- !st
- ) : Y.operatorToken.kind === 28 ? t.updateBinaryExpression(
- Y,
- E.checkDefined(Ge(Y.left, ae, _t)),
- Y.operatorToken,
- E.checkDefined(Ge(Y.right, st ? ae : V, _t))
- ) : br(Y, V, e);
- }
- function Z(Y, st) {
- if (st)
- return br(Y, ae, e);
- let It;
- for (let Sr = 0; Sr < Y.elements.length; Sr++) {
- const Vr = Y.elements[Sr], En = Ge(Vr, Sr < Y.elements.length - 1 ? ae : V, _t);
- (It || En !== Vr) && (It || (It = Y.elements.slice(0, Sr)), E.assert(En), It.push(En));
- }
- const Mt = It ? lt(t.createNodeArray(It), Y.elements) : Y.elements;
- return t.updateCommaListExpression(Y, Mt);
- }
- function ht(Y) {
- return Y.declarationList.declarations.length === 1 && !!Y.declarationList.declarations[0].initializer && !!(_d(Y.declarationList.declarations[0].initializer) & 1);
- }
- function Le(Y) {
- const st = O(
- 0,
- Gn(
- Y,
- 32
- /* Export */
- ) ? 32 : 0
- /* None */
- );
- let It;
- if (P && !(Y.declarationList.flags & 7) && !ht(Y)) {
- let Mt;
- for (const Sr of Y.declarationList.declarations)
- if (Ll(P, Sr), Sr.initializer) {
- let Vr;
- As(Sr.name) ? Vr = DS(
- Sr,
- V,
- e,
- 0
- /* All */
- ) : (Vr = t.createBinaryExpression(Sr.name, 64, E.checkDefined(Ge(Sr.initializer, V, _t))), lt(Vr, Sr)), Mt = wr(Mt, Vr);
- }
- Mt ? It = lt(t.createExpressionStatement(t.inlineExpressions(Mt)), Y) : It = void 0;
- } else
- It = br(Y, V, e);
- return B(
- st,
- 0,
- 0
- /* None */
- ), It;
- }
- function Ie(Y) {
- if (Y.flags & 7 || Y.transformFlags & 524288) {
- Y.flags & 7 && Sf();
- const st = Fr(
- Y.declarations,
- Y.flags & 1 ? yr : $r,
- ii
- ), It = t.createVariableDeclarationList(st);
- return kn(It, Y), lt(It, Y), nl(It, Y), Y.transformFlags & 524288 && (As(Y.declarations[0].name) || As(_a(Y.declarations).name)) && da(It, At(st)), It;
- }
- return br(Y, V, e);
- }
- function At(Y) {
- let st = -1, It = -1;
- for (const Mt of Y)
- st = st === -1 ? Mt.pos : Mt.pos === -1 ? st : Math.min(st, Mt.pos), It = Math.max(It, Mt.end);
- return op(st, It);
- }
- function Dr(Y) {
- const st = u.hasNodeCheckFlag(
- Y,
- 16384
- /* CapturedBlockScopedBinding */
- ), It = u.hasNodeCheckFlag(
- Y,
- 32768
- /* BlockScopedBindingInLoop */
- );
- return !((T & 64) !== 0 || st && It && (T & 512) !== 0) && (T & 4096) === 0 && (!u.isDeclarationWithCollidingName(Y) || It && !st && (T & 6144) === 0);
- }
- function yr(Y) {
- const st = Y.name;
- return As(st) ? $r(Y) : !Y.initializer && Dr(Y) ? t.updateVariableDeclaration(
- Y,
- Y.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createVoidZero()
- ) : br(Y, V, e);
- }
- function $r(Y) {
- const st = O(
- 32,
- 0
- /* None */
- );
- let It;
- return As(Y.name) ? It = Gb(
- Y,
- V,
- e,
- 0,
- /*rval*/
- void 0,
- (st & 32) !== 0
- ) : It = br(Y, V, e), B(
- st,
- 0,
- 0
- /* None */
- ), It;
- }
- function nt(Y) {
- P.labels.set(Nn(Y.label), !0);
- }
- function ot(Y) {
- P.labels.set(Nn(Y.label), !1);
- }
- function wt(Y) {
- P && !P.labels && (P.labels = /* @__PURE__ */ new Map());
- const st = eB(Y, P && nt);
- return Ny(
- st,
- /*lookInLabeledStatements*/
- !1
- ) ? jt(
- st,
- /*outermostLabeledStatement*/
- Y
- ) : t.restoreEnclosingLabel(Ge(st, V, bi, t.liftToBlock) ?? lt(t.createEmptyStatement(), st), Y, P && ot);
- }
- function jt(Y, st) {
- switch (Y.kind) {
- case 246:
- case 247:
- return Ht(Y, st);
- case 248:
- return en(Y, st);
- case 249:
- return mr(Y, st);
- case 250:
- return Kt(Y, st);
- }
- }
- function Xt(Y, st, It, Mt, Sr) {
- const Vr = O(Y, st), En = xs(It, Mt, Vr, Sr);
- return B(
- Vr,
- 0,
- 0
- /* None */
- ), En;
- }
- function Ht(Y, st) {
- return Xt(
- 0,
- 1280,
- Y,
- st
- );
- }
- function en(Y, st) {
- return Xt(
- 5056,
- 3328,
- Y,
- st
- );
- }
- function zt(Y) {
- return t.updateForStatement(
- Y,
- Ge(Y.initializer, ae, ip),
- Ge(Y.condition, V, _t),
- Ge(Y.incrementor, ae, _t),
- E.checkDefined(Ge(Y.statement, V, bi, t.liftToBlock))
- );
- }
- function mr(Y, st) {
- return Xt(
- 3008,
- 5376,
- Y,
- st
- );
- }
- function Kt(Y, st) {
- return Xt(
- 3008,
- 5376,
- Y,
- st,
- _.downlevelIteration ? gs : Ss
- );
- }
- function hr(Y, st, It) {
- const Mt = [], Sr = Y.initializer;
- if (Fl(Sr)) {
- Y.initializer.flags & 7 && Sf();
- const Vr = el(Sr.declarations);
- if (Vr && As(Vr.name)) {
- const En = Gb(
- Vr,
- V,
- e,
- 0,
- st
- ), si = lt(t.createVariableDeclarationList(En), Y.initializer);
- kn(si, Y.initializer), da(si, op(En[0].pos, _a(En).end)), Mt.push(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- si
- )
- );
- } else
- Mt.push(
- lt(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- kn(
- lt(
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- Vr ? Vr.name : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- st
- )
- ]),
- sv(Sr, -1)
- ),
- Sr
- )
- ),
- e5(Sr, -1)
- )
- );
- } else {
- const Vr = t.createAssignment(Sr, st);
- x0(Vr) ? Mt.push(t.createExpressionStatement(be(
- Vr,
- /*expressionResultIsUnused*/
- !0
- ))) : (zC(Vr, Sr.end), Mt.push(lt(t.createExpressionStatement(E.checkDefined(Ge(Vr, V, _t))), e5(Sr, -1))));
- }
- if (It)
- return Ft(Fn(Mt, It));
- {
- const Vr = Ge(Y.statement, V, bi, t.liftToBlock);
- return E.assert(Vr), Cs(Vr) ? t.updateBlock(Vr, lt(t.createNodeArray(Qi(Mt, Vr.statements)), Vr.statements)) : (Mt.push(Vr), Ft(Mt));
- }
- }
- function Ft(Y) {
- return an(
- t.createBlock(
- t.createNodeArray(Y),
- /*multiLine*/
- !0
- ),
- 864
- /* NoTokenSourceMaps */
- );
- }
- function Ss(Y, st, It) {
- const Mt = Ge(Y.expression, V, _t);
- E.assert(Mt);
- const Sr = t.createLoopVariable(), Vr = Oe(Mt) ? t.getGeneratedNameForNode(Mt) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- an(Mt, 96 | ya(Mt));
- const En = lt(
- t.createForStatement(
- /*initializer*/
- an(
- lt(
- t.createVariableDeclarationList([
- lt(t.createVariableDeclaration(
- Sr,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createNumericLiteral(0)
- ), sv(Y.expression, -1)),
- lt(t.createVariableDeclaration(
- Vr,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Mt
- ), Y.expression)
- ]),
- Y.expression
- ),
- 4194304
- /* NoHoisting */
- ),
- /*condition*/
- lt(
- t.createLessThan(
- Sr,
- t.createPropertyAccessExpression(Vr, "length")
- ),
- Y.expression
- ),
- /*incrementor*/
- lt(t.createPostfixIncrement(Sr), Y.expression),
- /*statement*/
- hr(
- Y,
- t.createElementAccessExpression(Vr, Sr),
- It
- )
- ),
- /*location*/
- Y
- );
- return an(
- En,
- 512
- /* NoTokenTrailingSourceMaps */
- ), lt(En, Y), t.restoreEnclosingLabel(En, st, P && ot);
- }
- function gs(Y, st, It, Mt) {
- const Sr = Ge(Y.expression, V, _t);
- E.assert(Sr);
- const Vr = Oe(Sr) ? t.getGeneratedNameForNode(Sr) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), En = Oe(Sr) ? t.getGeneratedNameForNode(Vr) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), si = t.createUniqueName("e"), L = t.getGeneratedNameForNode(si), Ce = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), yt = lt(n().createValuesHelper(Sr), Y.expression), Mr = t.createCallExpression(
- t.createPropertyAccessExpression(Vr, "next"),
- /*typeArguments*/
- void 0,
- []
- );
- c(si), c(Ce);
- const hi = Mt & 1024 ? t.inlineExpressions([t.createAssignment(si, t.createVoidZero()), yt]) : yt, Es = an(
- lt(
- t.createForStatement(
- /*initializer*/
- an(
- lt(
- t.createVariableDeclarationList([
- lt(t.createVariableDeclaration(
- Vr,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- hi
- ), Y.expression),
- t.createVariableDeclaration(
- En,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Mr
- )
- ]),
- Y.expression
- ),
- 4194304
- /* NoHoisting */
- ),
- /*condition*/
- t.createLogicalNot(t.createPropertyAccessExpression(En, "done")),
- /*incrementor*/
- t.createAssignment(En, Mr),
- /*statement*/
- hr(
- Y,
- t.createPropertyAccessExpression(En, "value"),
- It
- )
- ),
- /*location*/
- Y
- ),
- 512
- /* NoTokenTrailingSourceMaps */
- );
- return t.createTryStatement(
- t.createBlock([
- t.restoreEnclosingLabel(
- Es,
- st,
- P && ot
- )
- ]),
- t.createCatchClause(
- t.createVariableDeclaration(L),
- an(
- t.createBlock([
- t.createExpressionStatement(
- t.createAssignment(
- si,
- t.createObjectLiteralExpression([
- t.createPropertyAssignment("error", L)
- ])
- )
- )
- ]),
- 1
- /* SingleLine */
- )
- ),
- t.createBlock([
- t.createTryStatement(
- /*tryBlock*/
- t.createBlock([
- an(
- t.createIfStatement(
- t.createLogicalAnd(
- t.createLogicalAnd(
- En,
- t.createLogicalNot(
- t.createPropertyAccessExpression(En, "done")
- )
- ),
- t.createAssignment(
- Ce,
- t.createPropertyAccessExpression(Vr, "return")
- )
- ),
- t.createExpressionStatement(
- t.createFunctionCallCall(Ce, Vr, [])
- )
- ),
- 1
- /* SingleLine */
- )
- ]),
- /*catchClause*/
- void 0,
- /*finallyBlock*/
- an(
- t.createBlock([
- an(
- t.createIfStatement(
- si,
- t.createThrowStatement(
- t.createPropertyAccessExpression(si, "error")
- )
- ),
- 1
- /* SingleLine */
- )
- ]),
- 1
- /* SingleLine */
- )
- )
- ])
- );
- }
- function Ts(Y) {
- const st = Y.properties;
- let It = -1, Mt = !1;
- for (let si = 0; si < st.length; si++) {
- const L = st[si];
- if (L.transformFlags & 1048576 && T & 4 || (Mt = E.checkDefined(L.name).kind === 167)) {
- It = si;
- break;
- }
- }
- if (It < 0)
- return br(Y, V, e);
- const Sr = t.createTempVariable(c), Vr = [], En = t.createAssignment(
- Sr,
- an(
- t.createObjectLiteralExpression(
- Fr(st, V, kh, 0, It),
- Y.multiLine
- ),
- Mt ? 131072 : 0
- )
- );
- return Y.multiLine && bu(En), Vr.push(En), zr(Vr, Y, Sr, It), Vr.push(Y.multiLine ? bu(Aa(lt(t.cloneNode(Sr), Sr), Sr.parent)) : Sr), t.inlineExpressions(Vr);
- }
- function Ua(Y) {
- return u.hasNodeCheckFlag(
- Y,
- 8192
- /* ContainsCapturedBlockScopeBinding */
- );
- }
- function lc(Y) {
- return fv(Y) && !!Y.initializer && Ua(Y.initializer);
- }
- function Ic(Y) {
- return fv(Y) && !!Y.condition && Ua(Y.condition);
- }
- function io(Y) {
- return fv(Y) && !!Y.incrementor && Ua(Y.incrementor);
- }
- function vi(Y) {
- return ca(Y) || lc(Y);
- }
- function ca(Y) {
- return u.hasNodeCheckFlag(
- Y,
- 4096
- /* LoopWithCapturedBlockScopedBinding */
- );
- }
- function Ll(Y, st) {
- Y.hoistedLocalVariables || (Y.hoistedLocalVariables = []), It(st.name);
- function It(Mt) {
- if (Mt.kind === 80)
- Y.hoistedLocalVariables.push(Mt);
- else
- for (const Sr of Mt.elements)
- ml(Sr) || It(Sr.name);
- }
- }
- function xs(Y, st, It, Mt) {
- if (!vi(Y)) {
- let yt;
- P && (yt = P.allowedNonLabeledJumps, P.allowedNonLabeledJumps = 6);
- const Mr = Mt ? Mt(
- Y,
- st,
- /*convertedLoopBodyStatements*/
- void 0,
- It
- ) : t.restoreEnclosingLabel(
- fv(Y) ? zt(Y) : br(Y, V, e),
- st,
- P && ot
- );
- return P && (P.allowedNonLabeledJumps = yt), Mr;
- }
- const Sr = ba(Y), Vr = [], En = P;
- P = Sr;
- const si = lc(Y) ? _u(Y, Sr) : void 0, L = ca(Y) ? Wc(Y, Sr, En) : void 0;
- P = En, si && Vr.push(si.functionDeclaration), L && Vr.push(L.functionDeclaration), Bt(Vr, Sr, En), si && Vr.push(ge(si.functionName, si.containsYield));
- let Ce;
- if (L)
- if (Mt)
- Ce = Mt(Y, st, L.part, It);
- else {
- const yt = Cu(Y, si, t.createBlock(
- L.part,
- /*multiLine*/
- !0
- ));
- Ce = t.restoreEnclosingLabel(yt, st, P && ot);
- }
- else {
- const yt = Cu(Y, si, E.checkDefined(Ge(Y.statement, V, bi, t.liftToBlock)));
- Ce = t.restoreEnclosingLabel(yt, st, P && ot);
- }
- return Vr.push(Ce), Vr;
- }
- function Cu(Y, st, It) {
- switch (Y.kind) {
- case 248:
- return Zc(Y, st, It);
- case 249:
- return Na(Y, It);
- case 250:
- return Yi(Y, It);
- case 246:
- return Ia(Y, It);
- case 247:
- return Vi(Y, It);
- default:
- return E.failBadSyntaxKind(Y, "IterationStatement expected");
- }
- }
- function Zc(Y, st, It) {
- const Mt = Y.condition && Ua(Y.condition), Sr = Mt || Y.incrementor && Ua(Y.incrementor);
- return t.updateForStatement(
- Y,
- Ge(st ? st.part : Y.initializer, ae, ip),
- Ge(Mt ? void 0 : Y.condition, V, _t),
- Ge(Sr ? void 0 : Y.incrementor, ae, _t),
- It
- );
- }
- function Yi(Y, st) {
- return t.updateForOfStatement(
- Y,
- /*awaitModifier*/
- void 0,
- E.checkDefined(Ge(Y.initializer, V, ip)),
- E.checkDefined(Ge(Y.expression, V, _t)),
- st
- );
- }
- function Na(Y, st) {
- return t.updateForInStatement(
- Y,
- E.checkDefined(Ge(Y.initializer, V, ip)),
- E.checkDefined(Ge(Y.expression, V, _t)),
- st
- );
- }
- function Ia(Y, st) {
- return t.updateDoStatement(
- Y,
- st,
- E.checkDefined(Ge(Y.expression, V, _t))
- );
- }
- function Vi(Y, st) {
- return t.updateWhileStatement(
- Y,
- E.checkDefined(Ge(Y.expression, V, _t)),
- st
- );
- }
- function ba(Y) {
- let st;
- switch (Y.kind) {
- case 248:
- case 249:
- case 250:
- const Vr = Y.initializer;
- Vr && Vr.kind === 261 && (st = Vr);
- break;
- }
- const It = [], Mt = [];
- if (st && xh(st) & 7) {
- const Vr = lc(Y) || Ic(Y) || io(Y);
- for (const En of st.declarations)
- $t(Y, En, It, Mt, Vr);
- }
- const Sr = { loopParameters: It, loopOutParameters: Mt };
- return P && (P.argumentsName && (Sr.argumentsName = P.argumentsName), P.thisName && (Sr.thisName = P.thisName), P.hoistedLocalVariables && (Sr.hoistedLocalVariables = P.hoistedLocalVariables)), Sr;
- }
- function Bt(Y, st, It) {
- let Mt;
- if (st.argumentsName && (It ? It.argumentsName = st.argumentsName : (Mt || (Mt = [])).push(
- t.createVariableDeclaration(
- st.argumentsName,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createIdentifier("arguments")
- )
- )), st.thisName && (It ? It.thisName = st.thisName : (Mt || (Mt = [])).push(
- t.createVariableDeclaration(
- st.thisName,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createIdentifier("this")
- )
- )), st.hoistedLocalVariables)
- if (It)
- It.hoistedLocalVariables = st.hoistedLocalVariables;
- else {
- Mt || (Mt = []);
- for (const Sr of st.hoistedLocalVariables)
- Mt.push(t.createVariableDeclaration(Sr));
- }
- if (st.loopOutParameters.length) {
- Mt || (Mt = []);
- for (const Sr of st.loopOutParameters)
- Mt.push(t.createVariableDeclaration(Sr.outParamName));
- }
- st.conditionVariable && (Mt || (Mt = []), Mt.push(t.createVariableDeclaration(
- st.conditionVariable,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createFalse()
- ))), Mt && Y.push(t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(Mt)
- ));
- }
- function to(Y) {
- return t.createVariableDeclaration(
- Y.originalName,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Y.outParamName
- );
- }
- function _u(Y, st) {
- const It = t.createUniqueName("_loop_init"), Mt = (Y.initializer.transformFlags & 1048576) !== 0;
- let Sr = 0;
- st.containsLexicalThis && (Sr |= 16), Mt && T & 4 && (Sr |= 524288);
- const Vr = [];
- Vr.push(t.createVariableStatement(
- /*modifiers*/
- void 0,
- Y.initializer
- )), Ao(st.loopOutParameters, 2, 1, Vr);
- const En = t.createVariableStatement(
- /*modifiers*/
- void 0,
- an(
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- It,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- an(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- Mt ? t.createToken(
- 42
- /* AsteriskToken */
- ) : void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- void 0,
- /*type*/
- void 0,
- E.checkDefined(Ge(
- t.createBlock(
- Vr,
- /*multiLine*/
- !0
- ),
- V,
- Cs
- ))
- ),
- Sr
- )
- )
- ]),
- 4194304
- /* NoHoisting */
- )
- ), si = t.createVariableDeclarationList(lr(st.loopOutParameters, to));
- return { functionName: It, containsYield: Mt, functionDeclaration: En, part: si };
- }
- function Wc(Y, st, It) {
- const Mt = t.createUniqueName("_loop");
- i();
- const Sr = Ge(Y.statement, V, bi, t.liftToBlock), Vr = o(), En = [];
- (Ic(Y) || io(Y)) && (st.conditionVariable = t.createUniqueName("inc"), Y.incrementor ? En.push(t.createIfStatement(
- st.conditionVariable,
- t.createExpressionStatement(E.checkDefined(Ge(Y.incrementor, V, _t))),
- t.createExpressionStatement(t.createAssignment(st.conditionVariable, t.createTrue()))
- )) : En.push(t.createIfStatement(
- t.createLogicalNot(st.conditionVariable),
- t.createExpressionStatement(t.createAssignment(st.conditionVariable, t.createTrue()))
- )), Ic(Y) && En.push(t.createIfStatement(
- t.createPrefixUnaryExpression(54, E.checkDefined(Ge(Y.condition, V, _t))),
- E.checkDefined(Ge(t.createBreakStatement(), V, bi))
- ))), E.assert(Sr), Cs(Sr) ? Fn(En, Sr.statements) : En.push(Sr), Ao(st.loopOutParameters, 1, 1, En), Mg(En, Vr);
- const si = t.createBlock(
- En,
- /*multiLine*/
- !0
- );
- Cs(Sr) && kn(si, Sr);
- const L = (Y.statement.transformFlags & 1048576) !== 0;
- let Ce = 1048576;
- st.containsLexicalThis && (Ce |= 16), L && T & 4 && (Ce |= 524288);
- const yt = t.createVariableStatement(
- /*modifiers*/
- void 0,
- an(
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- Mt,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- an(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- L ? t.createToken(
- 42
- /* AsteriskToken */
- ) : void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- st.loopParameters,
- /*type*/
- void 0,
- si
- ),
- Ce
- )
- )
- ]
- ),
- 4194304
- /* NoHoisting */
- )
- ), Mr = $(Mt, st, It, L);
- return { functionName: Mt, containsYield: L, functionDeclaration: yt, part: Mr };
- }
- function of(Y, st) {
- const It = st === 0 ? Y.outParamName : Y.originalName, Mt = st === 0 ? Y.originalName : Y.outParamName;
- return t.createBinaryExpression(Mt, 64, It);
- }
- function Ao(Y, st, It, Mt) {
- for (const Sr of Y)
- Sr.flags & st && Mt.push(t.createExpressionStatement(of(Sr, It)));
- }
- function ge(Y, st) {
- const It = t.createCallExpression(
- Y,
- /*typeArguments*/
- void 0,
- []
- ), Mt = st ? t.createYieldExpression(
- t.createToken(
- 42
- /* AsteriskToken */
- ),
- an(
- It,
- 8388608
- /* Iterator */
- )
- ) : It;
- return t.createExpressionStatement(Mt);
- }
- function $(Y, st, It, Mt) {
- const Sr = [], Vr = !(st.nonLocalJumps & -5) && !st.labeledNonLocalBreaks && !st.labeledNonLocalContinues, En = t.createCallExpression(
- Y,
- /*typeArguments*/
- void 0,
- lr(st.loopParameters, (L) => L.name)
- ), si = Mt ? t.createYieldExpression(
- t.createToken(
- 42
- /* AsteriskToken */
- ),
- an(
- En,
- 8388608
- /* Iterator */
- )
- ) : En;
- if (Vr)
- Sr.push(t.createExpressionStatement(si)), Ao(st.loopOutParameters, 1, 0, Sr);
- else {
- const L = t.createUniqueName("state"), Ce = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [t.createVariableDeclaration(
- L,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- si
- )]
- )
- );
- if (Sr.push(Ce), Ao(st.loopOutParameters, 1, 0, Sr), st.nonLocalJumps & 8) {
- let yt;
- It ? (It.nonLocalJumps |= 8, yt = t.createReturnStatement(L)) : yt = t.createReturnStatement(t.createPropertyAccessExpression(L, "value")), Sr.push(
- t.createIfStatement(
- t.createTypeCheck(L, "object"),
- yt
- )
- );
- }
- if (st.nonLocalJumps & 2 && Sr.push(
- t.createIfStatement(
- t.createStrictEquality(
- L,
- t.createStringLiteral("break")
- ),
- t.createBreakStatement()
- )
- ), st.labeledNonLocalBreaks || st.labeledNonLocalContinues) {
- const yt = [];
- Ct(
- st.labeledNonLocalBreaks,
- /*isBreak*/
- !0,
- L,
- It,
- yt
- ), Ct(
- st.labeledNonLocalContinues,
- /*isBreak*/
- !1,
- L,
- It,
- yt
- ), Sr.push(
- t.createSwitchStatement(
- L,
- t.createCaseBlock(yt)
- )
- );
- }
- }
- return Sr;
- }
- function rt(Y, st, It, Mt) {
- st ? (Y.labeledNonLocalBreaks || (Y.labeledNonLocalBreaks = /* @__PURE__ */ new Map()), Y.labeledNonLocalBreaks.set(It, Mt)) : (Y.labeledNonLocalContinues || (Y.labeledNonLocalContinues = /* @__PURE__ */ new Map()), Y.labeledNonLocalContinues.set(It, Mt));
- }
- function Ct(Y, st, It, Mt, Sr) {
- Y && Y.forEach((Vr, En) => {
- const si = [];
- if (!Mt || Mt.labels && Mt.labels.get(En)) {
- const L = t.createIdentifier(En);
- si.push(st ? t.createBreakStatement(L) : t.createContinueStatement(L));
- } else
- rt(Mt, st, En, Vr), si.push(t.createReturnStatement(It));
- Sr.push(t.createCaseClause(t.createStringLiteral(Vr), si));
- });
- }
- function $t(Y, st, It, Mt, Sr) {
- const Vr = st.name;
- if (As(Vr))
- for (const En of Vr.elements)
- ml(En) || $t(Y, En, It, Mt, Sr);
- else {
- It.push(t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Vr
- ));
- const En = u.hasNodeCheckFlag(
- st,
- 65536
- /* NeedsLoopOutParameter */
- );
- if (En || Sr) {
- const si = t.createUniqueName("out_" + Nn(Vr));
- let L = 0;
- En && (L |= 1), fv(Y) && (Y.initializer && u.isBindingCapturedByNode(Y.initializer, st) && (L |= 2), (Y.condition && u.isBindingCapturedByNode(Y.condition, st) || Y.incrementor && u.isBindingCapturedByNode(Y.incrementor, st)) && (L |= 1)), Mt.push({ flags: L, originalName: Vr, outParamName: si });
- }
- }
- }
- function zr(Y, st, It, Mt) {
- const Sr = st.properties, Vr = Sr.length;
- for (let En = Mt; En < Vr; En++) {
- const si = Sr[En];
- switch (si.kind) {
- case 177:
- case 178:
- const L = My(st.properties, si);
- si === L.firstAccessor && Y.push(bt(It, L, st, !!st.multiLine));
- break;
- case 174:
- Y.push(An(si, It, st, st.multiLine));
- break;
- case 303:
- Y.push($n(si, It, st.multiLine));
- break;
- case 304:
- Y.push(ar(si, It, st.multiLine));
- break;
- default:
- E.failBadSyntaxKind(st);
- break;
- }
- }
- }
- function $n(Y, st, It) {
- const Mt = t.createAssignment(
- TS(
- t,
- st,
- E.checkDefined(Ge(Y.name, V, Bc))
- ),
- E.checkDefined(Ge(Y.initializer, V, _t))
- );
- return lt(Mt, Y), It && bu(Mt), Mt;
- }
- function ar(Y, st, It) {
- const Mt = t.createAssignment(
- TS(
- t,
- st,
- E.checkDefined(Ge(Y.name, V, Bc))
- ),
- t.cloneNode(Y.name)
- );
- return lt(Mt, Y), It && bu(Mt), Mt;
- }
- function An(Y, st, It, Mt) {
- const Sr = t.createAssignment(
- TS(
- t,
- st,
- E.checkDefined(Ge(Y.name, V, Bc))
- ),
- vn(
- Y,
- /*location*/
- Y,
- /*name*/
- void 0,
- It
- )
- );
- return lt(Sr, Y), Mt && bu(Sr), Sr;
- }
- function ri(Y) {
- const st = O(
- 7104,
- 0
- /* BlockScopeIncludes */
- );
- let It;
- if (E.assert(!!Y.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."), As(Y.variableDeclaration.name)) {
- const Mt = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), Sr = t.createVariableDeclaration(Mt);
- lt(Sr, Y.variableDeclaration);
- const Vr = Gb(
- Y.variableDeclaration,
- V,
- e,
- 0,
- Mt
- ), En = t.createVariableDeclarationList(Vr);
- lt(En, Y.variableDeclaration);
- const si = t.createVariableStatement(
- /*modifiers*/
- void 0,
- En
- );
- It = t.updateCatchClause(Y, Sr, Fi(Y.block, si));
- } else
- It = br(Y, V, e);
- return B(
- st,
- 0,
- 0
- /* None */
- ), It;
- }
- function Fi(Y, st) {
- const It = Fr(Y.statements, V, bi);
- return t.updateBlock(Y, [st, ...It]);
- }
- function za(Y) {
- E.assert(!ma(Y.name));
- const st = vn(
- Y,
- /*location*/
- sv(Y, -1),
- /*name*/
- void 0,
- /*container*/
- void 0
- );
- return an(st, 1024 | ya(st)), lt(
- t.createPropertyAssignment(
- Y.name,
- st
- ),
- /*location*/
- Y
- );
- }
- function Uo(Y) {
- E.assert(!ma(Y.name));
- const st = P;
- P = void 0;
- const It = O(
- 32670,
- 65
- /* FunctionIncludes */
- );
- let Mt;
- const Sr = cc(Y.parameters, V, e), Vr = M(Y);
- return Y.kind === 177 ? Mt = t.updateGetAccessorDeclaration(Y, Y.modifiers, Y.name, Sr, Y.type, Vr) : Mt = t.updateSetAccessorDeclaration(Y, Y.modifiers, Y.name, Sr, Vr), B(
- It,
- 229376,
- 0
- /* None */
- ), P = st, Mt;
- }
- function vc(Y) {
- return lt(
- t.createPropertyAssignment(
- Y.name,
- le(t.cloneNode(Y.name))
- ),
- /*location*/
- Y
- );
- }
- function Oc(Y) {
- return br(Y, V, e);
- }
- function Fc(Y) {
- return br(Y, V, e);
- }
- function Lo(Y) {
- return ut(Y.elements, fp) ? hp(
- Y.elements,
- /*isArgumentList*/
- !1,
- !!Y.multiLine,
- /*hasTrailingComma*/
- !!Y.elements.hasTrailingComma
- ) : br(Y, V, e);
- }
- function _c(Y) {
- if (_d(Y) & 1)
- return Wf(Y);
- const st = Dc(Y.expression);
- return st.kind === 108 || C_(st) || ut(Y.arguments, fp) ? Lc(
- Y
- ) : t.updateCallExpression(
- Y,
- E.checkDefined(Ge(Y.expression, G, _t)),
- /*typeArguments*/
- void 0,
- Fr(Y.arguments, V, _t)
- );
- }
- function Wf(Y) {
- const st = Bs(Bs(Dc(Y.expression), Co).body, Cs), It = ($o) => yc($o) && !!xa($o.declarationList.declarations).initializer, Mt = P;
- P = void 0;
- const Sr = Fr(st.statements, ee, bi);
- P = Mt;
- const Vr = Ln(Sr, It), En = Ln(Sr, ($o) => !It($o)), L = Bs(xa(Vr), yc).declarationList.declarations[0], Ce = Dc(L.initializer);
- let yt = Wn(Ce, Dl);
- !yt && dn(Ce) && Ce.operatorToken.kind === 28 && (yt = Wn(Ce.left, Dl));
- const Mr = Bs(yt ? Dc(yt.right) : Ce, Fs), hi = Bs(Dc(Mr.expression), vo), Es = hi.body.statements;
- let ns = 0, Ds = -1;
- const Pa = [];
- if (yt) {
- const $o = Wn(Es[ns], Pl);
- $o && (Pa.push($o), ns++), Pa.push(Es[ns]), ns++, Pa.push(
- t.createExpressionStatement(
- t.createAssignment(
- yt.left,
- Bs(L.name, Oe)
- )
- )
- );
- }
- for (; !Up(gy(Es, Ds)); )
- Ds--;
- Fn(Pa, Es, ns, Ds), Ds < -1 && Fn(Pa, Es, Ds + 1);
- const ga = Wn(gy(Es, Ds), Up);
- for (const $o of En)
- Up($o) && ga?.expression && !Oe(ga.expression) ? Pa.push(ga) : Pa.push($o);
- return Fn(
- Pa,
- Vr,
- /*start*/
- 1
- ), t.restoreOuterExpressions(
- Y.expression,
- t.restoreOuterExpressions(
- L.initializer,
- t.restoreOuterExpressions(
- yt && yt.right,
- t.updateCallExpression(
- Mr,
- t.restoreOuterExpressions(
- Mr.expression,
- t.updateFunctionExpression(
- hi,
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- hi.parameters,
- /*type*/
- void 0,
- t.updateBlock(
- hi.body,
- Pa
- )
- )
- ),
- /*typeArguments*/
- void 0,
- Mr.arguments
- )
- )
- )
- );
- }
- function Lc(Y, st) {
- if (Y.transformFlags & 32768 || Y.expression.kind === 108 || C_(Dc(Y.expression))) {
- const { target: It, thisArg: Mt } = t.createCallBinding(Y.expression, c);
- Y.expression.kind === 108 && an(
- Mt,
- 8
- /* NoSubstitution */
- );
- let Sr;
- if (Y.transformFlags & 32768 ? Sr = t.createFunctionApplyCall(
- E.checkDefined(Ge(It, G, _t)),
- Y.expression.kind === 108 ? Mt : E.checkDefined(Ge(Mt, V, _t)),
- hp(
- Y.arguments,
- /*isArgumentList*/
- !0,
- /*multiLine*/
- !1,
- /*hasTrailingComma*/
- !1
- )
- ) : Sr = lt(
- t.createFunctionCallCall(
- E.checkDefined(Ge(It, G, _t)),
- Y.expression.kind === 108 ? Mt : E.checkDefined(Ge(Mt, V, _t)),
- Fr(Y.arguments, V, _t)
- ),
- Y
- ), Y.expression.kind === 108) {
- const Vr = t.createLogicalOr(
- Sr,
- Oi()
- );
- Sr = t.createAssignment(J(), Vr);
- }
- return kn(Sr, Y);
- }
- return rS(Y) && (T |= 131072), br(Y, V, e);
- }
- function al(Y) {
- if (ut(Y.arguments, fp)) {
- const { target: st, thisArg: It } = t.createCallBinding(t.createPropertyAccessExpression(Y.expression, "bind"), c);
- return t.createNewExpression(
- t.createFunctionApplyCall(
- E.checkDefined(Ge(st, V, _t)),
- It,
- hp(
- t.createNodeArray([t.createVoidZero(), ...Y.arguments]),
- /*isArgumentList*/
- !0,
- /*multiLine*/
- !1,
- /*hasTrailingComma*/
- !1
- )
- ),
- /*typeArguments*/
- void 0,
- []
- );
- }
- return br(Y, V, e);
- }
- function hp(Y, st, It, Mt) {
- const Sr = Y.length, Vr = Np(
- // As we visit each element, we return one of two functions to use as the "key":
- // - `visitSpanOfSpreads` for one or more contiguous `...` spread expressions, i.e. `...a, ...b` in `[1, 2, ...a, ...b]`
- // - `visitSpanOfNonSpreads` for one or more contiguous non-spread elements, i.e. `1, 2`, in `[1, 2, ...a, ...b]`
- aR(Y, Pe, (Ce, yt, Mr, hi) => yt(Ce, It, Mt && hi === Sr))
- );
- if (Vr.length === 1) {
- const Ce = Vr[0];
- if (st && !_.downlevelIteration || pJ(Ce.expression) || K4(Ce.expression, "___spreadArray"))
- return Ce.expression;
- }
- const En = n(), si = Vr[0].kind !== 0;
- let L = si ? t.createArrayLiteralExpression() : Vr[0].expression;
- for (let Ce = si ? 0 : 1; Ce < Vr.length; Ce++) {
- const yt = Vr[Ce];
- L = En.createSpreadArrayHelper(
- L,
- yt.expression,
- yt.kind === 1 && !st
- );
- }
- return L;
- }
- function Pe(Y) {
- return fp(Y) ? Et : $i;
- }
- function Et(Y) {
- return lr(Y, Lr);
- }
- function Lr(Y) {
- E.assertNode(Y, fp);
- let st = Ge(Y.expression, V, _t);
- E.assert(st);
- const It = K4(st, "___read");
- let Mt = It || pJ(st) ? 2 : 1;
- return _.downlevelIteration && Mt === 1 && !$l(st) && !It && (st = n().createReadHelper(
- st,
- /*count*/
- void 0
- ), Mt = 2), t1e(Mt, st);
- }
- function $i(Y, st, It) {
- const Mt = t.createArrayLiteralExpression(
- Fr(t.createNodeArray(Y, It), V, _t),
- st
- );
- return t1e(0, Mt);
- }
- function Sa(Y) {
- return Ge(Y.expression, V, _t);
- }
- function ka(Y) {
- return lt(t.createStringLiteral(Y.text), Y);
- }
- function Pc(Y) {
- return Y.hasExtendedUnicodeEscape ? lt(t.createStringLiteral(Y.text), Y) : Y;
- }
- function yl(Y) {
- return Y.numericLiteralFlags & 384 ? lt(t.createNumericLiteral(Y.text), Y) : Y;
- }
- function so(Y) {
- return fW(
- e,
- Y,
- V,
- h,
- D,
- 1
- /* All */
- );
- }
- function Va(Y) {
- let st = t.createStringLiteral(Y.head.text);
- for (const It of Y.templateSpans) {
- const Mt = [E.checkDefined(Ge(It.expression, V, _t))];
- It.literal.text.length > 0 && Mt.push(t.createStringLiteral(It.literal.text)), st = t.createCallExpression(
- t.createPropertyAccessExpression(st, "concat"),
- /*typeArguments*/
- void 0,
- Mt
- );
- }
- return lt(st, Y);
- }
- function Uc() {
- return t.createUniqueName(
- "_super",
- 48
- /* FileLevel */
- );
- }
- function cf(Y, st) {
- const It = T & 8 && !st ? t.createPropertyAccessExpression(kn(Uc(), Y), "prototype") : Uc();
- return kn(It, Y), nl(It, Y), da(It, Y), It;
- }
- function Xp(Y) {
- return Y.keywordToken === 105 && Y.name.escapedText === "target" ? (T |= 32768, t.createUniqueName(
- "_newTarget",
- 48
- /* FileLevel */
- )) : Y;
- }
- function A_(Y, st, It) {
- if (I & 1 && ys(st)) {
- const Mt = O(
- 32670,
- ya(st) & 16 ? 81 : 65
- /* FunctionIncludes */
- );
- g(Y, st, It), B(
- Mt,
- 0,
- 0
- /* None */
- );
- return;
- }
- g(Y, st, It);
- }
- function Sf() {
- I & 2 || (I |= 2, e.enableSubstitution(
- 80
- /* Identifier */
- ));
- }
- function Uf() {
- I & 1 || (I |= 1, e.enableSubstitution(
- 110
- /* ThisKeyword */
- ), e.enableEmitNotification(
- 176
- /* Constructor */
- ), e.enableEmitNotification(
- 174
- /* MethodDeclaration */
- ), e.enableEmitNotification(
- 177
- /* GetAccessor */
- ), e.enableEmitNotification(
- 178
- /* SetAccessor */
- ), e.enableEmitNotification(
- 219
- /* ArrowFunction */
- ), e.enableEmitNotification(
- 218
- /* FunctionExpression */
- ), e.enableEmitNotification(
- 262
- /* FunctionDeclaration */
- ));
- }
- function yp(Y, st) {
- return st = d(Y, st), Y === 1 ? y_(st) : Oe(st) ? Yg(st) : st;
- }
- function Yg(Y) {
- if (I & 2 && !ZJ(Y)) {
- const st = fs(Y, Oe);
- if (st && Qp(st))
- return lt(t.getGeneratedNameForNode(st), Y);
- }
- return Y;
- }
- function Qp(Y) {
- switch (Y.parent.kind) {
- case 208:
- case 263:
- case 266:
- case 260:
- return Y.parent.name === Y && u.isDeclarationWithCollidingName(Y.parent);
- }
- return !1;
- }
- function y_(Y) {
- switch (Y.kind) {
- case 80:
- return vl(Y);
- case 110:
- return r_(Y);
- }
- return Y;
- }
- function vl(Y) {
- if (I & 2 && !ZJ(Y)) {
- const st = u.getReferencedDeclarationWithCollidingName(Y);
- if (st && !(Zn(st) && Uh(st, Y)))
- return lt(t.getGeneratedNameForNode(os(st)), Y);
- }
- return Y;
- }
- function Uh(Y, st) {
- let It = fs(st);
- if (!It || It === Y || It.end <= Y.pos || It.pos >= Y.end)
- return !1;
- const Mt = Cd(Y);
- for (; It; ) {
- if (It === Mt || It === Y)
- return !1;
- if (_l(It) && It.parent === Y)
- return !0;
- It = It.parent;
- }
- return !1;
- }
- function r_(Y) {
- return I & 1 && T & 16 ? lt(J(), Y) : Y;
- }
- function Zg(Y, st) {
- return zs(st) ? t.getInternalName(Y) : t.createPropertyAccessExpression(t.getInternalName(Y), "prototype");
- }
- function Vf(Y, st) {
- if (!Y || !st || ut(Y.parameters))
- return !1;
- const It = el(Y.body.statements);
- if (!It || !fo(It) || It.kind !== 244)
- return !1;
- const Mt = It.expression;
- if (!fo(Mt) || Mt.kind !== 213)
- return !1;
- const Sr = Mt.expression;
- if (!fo(Sr) || Sr.kind !== 108)
- return !1;
- const Vr = Qm(Mt.arguments);
- if (!Vr || !fo(Vr) || Vr.kind !== 230)
- return !1;
- const En = Vr.expression;
- return Oe(En) && En.escapedText === "arguments";
- }
- }
- function pRe(e) {
- switch (e) {
- case 2:
- return "return";
- case 3:
- return "break";
- case 4:
- return "yield";
- case 5:
- return "yield*";
- case 7:
- return "endfinally";
- default:
- return;
- }
- }
- function yne(e) {
- const {
- factory: t,
- getEmitHelperFactory: n,
- resumeLexicalEnvironment: i,
- endLexicalEnvironment: s,
- hoistFunctionDeclaration: o,
- hoistVariableDeclaration: c
- } = e, _ = e.getCompilerOptions(), u = pa(_), d = e.getEmitResolver(), g = e.onSubstituteNode;
- e.onSubstituteNode = dt;
- let h, S, T, C, D, P, I, F, O, B, z = 1, X, q, V, ae, ee = 0, G = 0, ue, re, ne, ie, Se, J, oe, _e;
- return Fd(e, he);
- function he(Pe) {
- if (Pe.isDeclarationFile || !(Pe.transformFlags & 2048))
- return Pe;
- const Et = br(Pe, le, e);
- return Ih(Et, e.readEmitHelpers()), Et;
- }
- function le(Pe) {
- const Et = Pe.transformFlags;
- return C ? me(Pe) : T ? ve(Pe) : no(Pe) && Pe.asteriskToken ? Te(Pe) : Et & 2048 ? br(Pe, le, e) : Pe;
- }
- function me(Pe) {
- switch (Pe.kind) {
- case 246:
- return Ws(Pe);
- case 247:
- return rr(Pe);
- case 255:
- return bt(Pe);
- case 256:
- return Vt(Pe);
- default:
- return ve(Pe);
- }
- }
- function ve(Pe) {
- switch (Pe.kind) {
- case 262:
- return we(Pe);
- case 218:
- return fe(Pe);
- case 177:
- case 178:
- return Me(Pe);
- case 243:
- return et(Pe);
- case 248:
- return Xe(Pe);
- case 249:
- return te(Pe);
- case 252:
- return Ve(Pe);
- case 251:
- return K(Pe);
- case 253:
- return xe(Pe);
- default:
- return Pe.transformFlags & 1048576 ? tt(Pe) : Pe.transformFlags & 4196352 ? br(Pe, le, e) : Pe;
- }
- }
- function tt(Pe) {
- switch (Pe.kind) {
- case 226:
- return Re(Pe);
- case 355:
- return Ir(Pe);
- case 227:
- return Nt(Pe);
- case 229:
- return Qt(Pe);
- case 209:
- return Br(Pe);
- case 210:
- return zn(Pe);
- case 212:
- return ki(Pe);
- case 213:
- return rs(Pe);
- case 214:
- return ei(Pe);
- default:
- return br(Pe, le, e);
- }
- }
- function Te(Pe) {
- switch (Pe.kind) {
- case 262:
- return we(Pe);
- case 218:
- return fe(Pe);
- default:
- return E.failBadSyntaxKind(Pe);
- }
- }
- function we(Pe) {
- if (Pe.asteriskToken)
- Pe = kn(
- lt(
- t.createFunctionDeclaration(
- Pe.modifiers,
- /*asteriskToken*/
- void 0,
- Pe.name,
- /*typeParameters*/
- void 0,
- cc(Pe.parameters, le, e),
- /*type*/
- void 0,
- Qe(Pe.body)
- ),
- /*location*/
- Pe
- ),
- Pe
- );
- else {
- const Et = T, Lr = C;
- T = !1, C = !1, Pe = br(Pe, le, e), T = Et, C = Lr;
- }
- if (T) {
- o(Pe);
- return;
- } else
- return Pe;
- }
- function fe(Pe) {
- if (Pe.asteriskToken)
- Pe = kn(
- lt(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- Pe.name,
- /*typeParameters*/
- void 0,
- cc(Pe.parameters, le, e),
- /*type*/
- void 0,
- Qe(Pe.body)
- ),
- /*location*/
- Pe
- ),
- Pe
- );
- else {
- const Et = T, Lr = C;
- T = !1, C = !1, Pe = br(Pe, le, e), T = Et, C = Lr;
- }
- return Pe;
- }
- function Me(Pe) {
- const Et = T, Lr = C;
- return T = !1, C = !1, Pe = br(Pe, le, e), T = Et, C = Lr, Pe;
- }
- function Qe(Pe) {
- const Et = [], Lr = T, $i = C, Sa = D, ka = P, Pc = I, yl = F, so = O, Va = B, Uc = z, cf = X, Xp = q, A_ = V, Sf = ae;
- T = !0, C = !1, D = void 0, P = void 0, I = void 0, F = void 0, O = void 0, B = void 0, z = 1, X = void 0, q = void 0, V = void 0, ae = t.createTempVariable(
- /*recordTempVariable*/
- void 0
- ), i();
- const Uf = t.copyPrologue(
- Pe.statements,
- Et,
- /*ensureUseStrict*/
- !1,
- le
- );
- Ri(Pe.statements, Uf);
- const yp = rt();
- return Mg(Et, s()), Et.push(t.createReturnStatement(yp)), T = Lr, C = $i, D = Sa, P = ka, I = Pc, F = yl, O = so, B = Va, z = Uc, X = cf, q = Xp, V = A_, ae = Sf, lt(t.createBlock(Et, Pe.multiLine), Pe);
- }
- function et(Pe) {
- if (Pe.transformFlags & 1048576) {
- mn(Pe.declarationList);
- return;
- } else {
- if (ya(Pe) & 2097152)
- return Pe;
- for (const Lr of Pe.declarationList.declarations)
- c(Lr.name);
- const Et = F4(Pe.declarationList);
- return Et.length === 0 ? void 0 : da(
- t.createExpressionStatement(
- t.inlineExpressions(
- lr(Et, ti)
- )
- ),
- Pe
- );
- }
- }
- function Re(Pe) {
- const Et = SB(Pe);
- switch (Et) {
- case 0:
- return Wt(Pe);
- case 1:
- return ft(Pe);
- default:
- return E.assertNever(Et);
- }
- }
- function ft(Pe) {
- const { left: Et, right: Lr } = Pe;
- if (M(Lr)) {
- let $i;
- switch (Et.kind) {
- case 211:
- $i = t.updatePropertyAccessExpression(
- Et,
- Z(E.checkDefined(Ge(Et.expression, le, __))),
- Et.name
- );
- break;
- case 212:
- $i = t.updateElementAccessExpression(Et, Z(E.checkDefined(Ge(Et.expression, le, __))), Z(E.checkDefined(Ge(Et.argumentExpression, le, _t))));
- break;
- default:
- $i = E.checkDefined(Ge(Et, le, _t));
- break;
- }
- const Sa = Pe.operatorToken.kind;
- return PD(Sa) ? lt(
- t.createAssignment(
- $i,
- lt(
- t.createBinaryExpression(
- Z($i),
- wD(Sa),
- E.checkDefined(Ge(Lr, le, _t))
- ),
- Pe
- )
- ),
- Pe
- ) : t.updateBinaryExpression(Pe, $i, Pe.operatorToken, E.checkDefined(Ge(Lr, le, _t)));
- }
- return br(Pe, le, e);
- }
- function Wt(Pe) {
- return M(Pe.right) ? hK(Pe.operatorToken.kind) ? jr(Pe) : Pe.operatorToken.kind === 28 ? _r(Pe) : t.updateBinaryExpression(Pe, Z(E.checkDefined(Ge(Pe.left, le, _t))), Pe.operatorToken, E.checkDefined(Ge(Pe.right, le, _t))) : br(Pe, le, e);
- }
- function _r(Pe) {
- let Et = [];
- return Lr(Pe.left), Lr(Pe.right), t.inlineExpressions(Et);
- function Lr($i) {
- dn($i) && $i.operatorToken.kind === 28 ? (Lr($i.left), Lr($i.right)) : (M($i) && Et.length > 0 && ($(1, [t.createExpressionStatement(t.inlineExpressions(Et))]), Et = []), Et.push(E.checkDefined(Ge($i, le, _t))));
- }
- }
- function Ir(Pe) {
- let Et = [];
- for (const Lr of Pe.elements)
- dn(Lr) && Lr.operatorToken.kind === 28 ? Et.push(_r(Lr)) : (M(Lr) && Et.length > 0 && ($(1, [t.createExpressionStatement(t.inlineExpressions(Et))]), Et = []), Et.push(E.checkDefined(Ge(Lr, le, _t))));
- return t.inlineExpressions(Et);
- }
- function jr(Pe) {
- const Et = Le(), Lr = ht();
- return Vi(
- Lr,
- E.checkDefined(Ge(Pe.left, le, _t)),
- /*location*/
- Pe.left
- ), Pe.operatorToken.kind === 56 ? to(
- Et,
- Lr,
- /*location*/
- Pe.left
- ) : Bt(
- Et,
- Lr,
- /*location*/
- Pe.left
- ), Vi(
- Lr,
- E.checkDefined(Ge(Pe.right, le, _t)),
- /*location*/
- Pe.right
- ), Ie(Et), Lr;
- }
- function Nt(Pe) {
- if (M(Pe.whenTrue) || M(Pe.whenFalse)) {
- const Et = Le(), Lr = Le(), $i = ht();
- return to(
- Et,
- E.checkDefined(Ge(Pe.condition, le, _t)),
- /*location*/
- Pe.condition
- ), Vi(
- $i,
- E.checkDefined(Ge(Pe.whenTrue, le, _t)),
- /*location*/
- Pe.whenTrue
- ), ba(Lr), Ie(Et), Vi(
- $i,
- E.checkDefined(Ge(Pe.whenFalse, le, _t)),
- /*location*/
- Pe.whenFalse
- ), Ie(Lr), $i;
- }
- return br(Pe, le, e);
- }
- function Qt(Pe) {
- const Et = Le(), Lr = Ge(Pe.expression, le, _t);
- if (Pe.asteriskToken) {
- const $i = ya(Pe.expression) & 8388608 ? Lr : lt(n().createValuesHelper(Lr), Pe);
- _u(
- $i,
- /*location*/
- Pe
- );
- } else
- Wc(
- Lr,
- /*location*/
- Pe
- );
- return Ie(Et), Yi(
- /*location*/
- Pe
- );
- }
- function Br(Pe) {
- return xr(
- Pe.elements,
- /*leadingElement*/
- void 0,
- /*location*/
- void 0,
- Pe.multiLine
- );
- }
- function xr(Pe, Et, Lr, $i) {
- const Sa = Ae(Pe);
- let ka;
- if (Sa > 0) {
- ka = ht();
- const so = Fr(Pe, le, _t, 0, Sa);
- Vi(
- ka,
- t.createArrayLiteralExpression(
- Et ? [Et, ...so] : so
- )
- ), Et = void 0;
- }
- const Pc = Hu(Pe, yl, [], Sa);
- return ka ? t.createArrayConcatCall(ka, [t.createArrayLiteralExpression(Pc, $i)]) : lt(
- t.createArrayLiteralExpression(Et ? [Et, ...Pc] : Pc, $i),
- Lr
- );
- function yl(so, Va) {
- if (M(Va) && so.length > 0) {
- const Uc = ka !== void 0;
- ka || (ka = ht()), Vi(
- ka,
- Uc ? t.createArrayConcatCall(
- ka,
- [t.createArrayLiteralExpression(so, $i)]
- ) : t.createArrayLiteralExpression(
- Et ? [Et, ...so] : so,
- $i
- )
- ), Et = void 0, so = [];
- }
- return so.push(E.checkDefined(Ge(Va, le, _t))), so;
- }
- }
- function zn(Pe) {
- const Et = Pe.properties, Lr = Pe.multiLine, $i = Ae(Et), Sa = ht();
- Vi(
- Sa,
- t.createObjectLiteralExpression(
- Fr(Et, le, kh, 0, $i),
- Lr
- )
- );
- const ka = Hu(Et, Pc, [], $i);
- return ka.push(Lr ? bu(Aa(lt(t.cloneNode(Sa), Sa), Sa.parent)) : Sa), t.inlineExpressions(ka);
- function Pc(yl, so) {
- M(so) && yl.length > 0 && (Ia(t.createExpressionStatement(t.inlineExpressions(yl))), yl = []);
- const Va = pte(t, Pe, so, Sa), Uc = Ge(Va, le, _t);
- return Uc && (Lr && bu(Uc), yl.push(Uc)), yl;
- }
- }
- function ki(Pe) {
- return M(Pe.argumentExpression) ? t.updateElementAccessExpression(Pe, Z(E.checkDefined(Ge(Pe.expression, le, __))), E.checkDefined(Ge(Pe.argumentExpression, le, _t))) : br(Pe, le, e);
- }
- function rs(Pe) {
- if (!hf(Pe) && ir(Pe.arguments, M)) {
- const { target: Et, thisArg: Lr } = t.createCallBinding(
- Pe.expression,
- c,
- u,
- /*cacheIdentifiers*/
- !0
- );
- return kn(
- lt(
- t.createFunctionApplyCall(
- Z(E.checkDefined(Ge(Et, le, __))),
- Lr,
- xr(Pe.arguments)
- ),
- Pe
- ),
- Pe
- );
- }
- return br(Pe, le, e);
- }
- function ei(Pe) {
- if (ir(Pe.arguments, M)) {
- const { target: Et, thisArg: Lr } = t.createCallBinding(t.createPropertyAccessExpression(Pe.expression, "bind"), c);
- return kn(
- lt(
- t.createNewExpression(
- t.createFunctionApplyCall(
- Z(E.checkDefined(Ge(Et, le, _t))),
- Lr,
- xr(
- Pe.arguments,
- /*leadingElement*/
- t.createVoidZero()
- )
- ),
- /*typeArguments*/
- void 0,
- []
- ),
- Pe
- ),
- Pe
- );
- }
- return br(Pe, le, e);
- }
- function Ri(Pe, Et = 0) {
- const Lr = Pe.length;
- for (let $i = Et; $i < Lr; $i++)
- ji(Pe[$i]);
- }
- function Jr(Pe) {
- Cs(Pe) ? Ri(Pe.statements) : ji(Pe);
- }
- function ji(Pe) {
- const Et = C;
- C || (C = M(Pe)), Fe(Pe), C = Et;
- }
- function Fe(Pe) {
- switch (Pe.kind) {
- case 241:
- return Ot(Pe);
- case 244:
- return Ar(Pe);
- case 245:
- return qn(Pe);
- case 246:
- return Oi(Pe);
- case 247:
- return Hs(Pe);
- case 248:
- return Ea(Pe);
- case 249:
- return Tt(Pe);
- case 251:
- return ze(Pe);
- case 252:
- return De(Pe);
- case 253:
- return Ke(Pe);
- case 254:
- return at(Pe);
- case 255:
- return $e(Pe);
- case 256:
- return He(Pe);
- case 257:
- return Zt(Pe);
- case 258:
- return vn(Pe);
- default:
- return Ia(Ge(Pe, le, bi));
- }
- }
- function Ot(Pe) {
- M(Pe) ? Ri(Pe.statements) : Ia(Ge(Pe, le, bi));
- }
- function Ar(Pe) {
- Ia(Ge(Pe, le, bi));
- }
- function mn(Pe) {
- for (const ka of Pe.declarations) {
- const Pc = t.cloneNode(ka.name);
- nl(Pc, ka.name), c(Pc);
- }
- const Et = F4(Pe), Lr = Et.length;
- let $i = 0, Sa = [];
- for (; $i < Lr; ) {
- for (let ka = $i; ka < Lr; ka++) {
- const Pc = Et[ka];
- if (M(Pc.initializer) && Sa.length > 0)
- break;
- Sa.push(ti(Pc));
- }
- Sa.length && (Ia(t.createExpressionStatement(t.inlineExpressions(Sa))), $i += Sa.length, Sa = []);
- }
- }
- function ti(Pe) {
- return da(
- t.createAssignment(
- da(t.cloneNode(Pe.name), Pe.name),
- E.checkDefined(Ge(Pe.initializer, le, _t))
- ),
- Pe
- );
- }
- function qn(Pe) {
- if (M(Pe))
- if (M(Pe.thenStatement) || M(Pe.elseStatement)) {
- const Et = Le(), Lr = Pe.elseStatement ? Le() : void 0;
- to(
- Pe.elseStatement ? Lr : Et,
- E.checkDefined(Ge(Pe.expression, le, _t)),
- /*location*/
- Pe.expression
- ), Jr(Pe.thenStatement), Pe.elseStatement && (ba(Et), Ie(Lr), Jr(Pe.elseStatement)), Ie(Et);
- } else
- Ia(Ge(Pe, le, bi));
- else
- Ia(Ge(Pe, le, bi));
- }
- function Oi(Pe) {
- if (M(Pe)) {
- const Et = Le(), Lr = Le();
- zt(
- /*continueLabel*/
- Et
- ), Ie(Lr), Jr(Pe.statement), Ie(Et), Bt(Lr, E.checkDefined(Ge(Pe.expression, le, _t))), mr();
- } else
- Ia(Ge(Pe, le, bi));
- }
- function Ws(Pe) {
- return C ? (en(), Pe = br(Pe, le, e), mr(), Pe) : br(Pe, le, e);
- }
- function Hs(Pe) {
- if (M(Pe)) {
- const Et = Le(), Lr = zt(Et);
- Ie(Et), to(Lr, E.checkDefined(Ge(Pe.expression, le, _t))), Jr(Pe.statement), ba(Et), mr();
- } else
- Ia(Ge(Pe, le, bi));
- }
- function rr(Pe) {
- return C ? (en(), Pe = br(Pe, le, e), mr(), Pe) : br(Pe, le, e);
- }
- function Ea(Pe) {
- if (M(Pe)) {
- const Et = Le(), Lr = Le(), $i = zt(Lr);
- if (Pe.initializer) {
- const Sa = Pe.initializer;
- Fl(Sa) ? mn(Sa) : Ia(
- lt(
- t.createExpressionStatement(
- E.checkDefined(Ge(Sa, le, _t))
- ),
- Sa
- )
- );
- }
- Ie(Et), Pe.condition && to($i, E.checkDefined(Ge(Pe.condition, le, _t))), Jr(Pe.statement), Ie(Lr), Pe.incrementor && Ia(
- lt(
- t.createExpressionStatement(
- E.checkDefined(Ge(Pe.incrementor, le, _t))
- ),
- Pe.incrementor
- )
- ), ba(Et), mr();
- } else
- Ia(Ge(Pe, le, bi));
- }
- function Xe(Pe) {
- C && en();
- const Et = Pe.initializer;
- if (Et && Fl(Et)) {
- for (const $i of Et.declarations)
- c($i.name);
- const Lr = F4(Et);
- Pe = t.updateForStatement(
- Pe,
- Lr.length > 0 ? t.inlineExpressions(lr(Lr, ti)) : void 0,
- Ge(Pe.condition, le, _t),
- Ge(Pe.incrementor, le, _t),
- Ku(Pe.statement, le, e)
- );
- } else
- Pe = br(Pe, le, e);
- return C && mr(), Pe;
- }
- function Tt(Pe) {
- if (M(Pe)) {
- const Et = ht(), Lr = ht(), $i = ht(), Sa = t.createLoopVariable(), ka = Pe.initializer;
- c(Sa), Vi(Et, E.checkDefined(Ge(Pe.expression, le, _t))), Vi(Lr, t.createArrayLiteralExpression()), Ia(
- t.createForInStatement(
- $i,
- Et,
- t.createExpressionStatement(
- t.createCallExpression(
- t.createPropertyAccessExpression(Lr, "push"),
- /*typeArguments*/
- void 0,
- [$i]
- )
- )
- )
- ), Vi(Sa, t.createNumericLiteral(0));
- const Pc = Le(), yl = Le(), so = zt(yl);
- Ie(Pc), to(so, t.createLessThan(Sa, t.createPropertyAccessExpression(Lr, "length"))), Vi($i, t.createElementAccessExpression(Lr, Sa)), to(yl, t.createBinaryExpression($i, 103, Et));
- let Va;
- if (Fl(ka)) {
- for (const Uc of ka.declarations)
- c(Uc.name);
- Va = t.cloneNode(ka.declarations[0].name);
- } else
- Va = E.checkDefined(Ge(ka, le, _t)), E.assert(__(Va));
- Vi(Va, $i), Jr(Pe.statement), Ie(yl), Ia(t.createExpressionStatement(t.createPostfixIncrement(Sa))), ba(Pc), mr();
- } else
- Ia(Ge(Pe, le, bi));
- }
- function te(Pe) {
- C && en();
- const Et = Pe.initializer;
- if (Fl(Et)) {
- for (const Lr of Et.declarations)
- c(Lr.name);
- Pe = t.updateForInStatement(Pe, Et.declarations[0].name, E.checkDefined(Ge(Pe.expression, le, _t)), E.checkDefined(Ge(Pe.statement, le, bi, t.liftToBlock)));
- } else
- Pe = br(Pe, le, e);
- return C && mr(), Pe;
- }
- function ze(Pe) {
- const Et = ca(Pe.label ? Nn(Pe.label) : void 0);
- Et > 0 ? ba(
- Et,
- /*location*/
- Pe
- ) : Ia(Pe);
- }
- function K(Pe) {
- if (C) {
- const Et = ca(Pe.label && Nn(Pe.label));
- if (Et > 0)
- return Cu(
- Et,
- /*location*/
- Pe
- );
- }
- return br(Pe, le, e);
- }
- function De(Pe) {
- const Et = vi(Pe.label ? Nn(Pe.label) : void 0);
- Et > 0 ? ba(
- Et,
- /*location*/
- Pe
- ) : Ia(Pe);
- }
- function Ve(Pe) {
- if (C) {
- const Et = vi(Pe.label && Nn(Pe.label));
- if (Et > 0)
- return Cu(
- Et,
- /*location*/
- Pe
- );
- }
- return br(Pe, le, e);
- }
- function Ke(Pe) {
- of(
- Ge(Pe.expression, le, _t),
- /*location*/
- Pe
- );
- }
- function xe(Pe) {
- return Zc(
- Ge(Pe.expression, le, _t),
- /*location*/
- Pe
- );
- }
- function at(Pe) {
- M(Pe) ? (nt(Z(E.checkDefined(Ge(Pe.expression, le, _t)))), Jr(Pe.statement), ot()) : Ia(Ge(Pe, le, bi));
- }
- function $e(Pe) {
- if (M(Pe.caseBlock)) {
- const Et = Pe.caseBlock, Lr = Et.clauses.length, $i = hr(), Sa = Z(E.checkDefined(Ge(Pe.expression, le, _t))), ka = [];
- let Pc = -1;
- for (let Va = 0; Va < Lr; Va++) {
- const Uc = Et.clauses[Va];
- ka.push(Le()), Uc.kind === 297 && Pc === -1 && (Pc = Va);
- }
- let yl = 0, so = [];
- for (; yl < Lr; ) {
- let Va = 0;
- for (let Uc = yl; Uc < Lr; Uc++) {
- const cf = Et.clauses[Uc];
- if (cf.kind === 296) {
- if (M(cf.expression) && so.length > 0)
- break;
- so.push(
- t.createCaseClause(
- E.checkDefined(Ge(cf.expression, le, _t)),
- [
- Cu(
- ka[Uc],
- /*location*/
- cf.expression
- )
- ]
- )
- );
- } else
- Va++;
- }
- so.length && (Ia(t.createSwitchStatement(Sa, t.createCaseBlock(so))), yl += so.length, so = []), Va > 0 && (yl += Va, Va = 0);
- }
- Pc >= 0 ? ba(ka[Pc]) : ba($i);
- for (let Va = 0; Va < Lr; Va++)
- Ie(ka[Va]), Ri(Et.clauses[Va].statements);
- Ft();
- } else
- Ia(Ge(Pe, le, bi));
- }
- function bt(Pe) {
- return C && Kt(), Pe = br(Pe, le, e), C && Ft(), Pe;
- }
- function He(Pe) {
- M(Pe) ? (gs(Nn(Pe.label)), Jr(Pe.statement), Ts()) : Ia(Ge(Pe, le, bi));
- }
- function Vt(Pe) {
- return C && Ss(Nn(Pe.label)), Pe = br(Pe, le, e), C && Ts(), Pe;
- }
- function Zt(Pe) {
- Ao(
- E.checkDefined(Ge(Pe.expression ?? t.createVoidZero(), le, _t)),
- /*location*/
- Pe
- );
- }
- function vn(Pe) {
- M(Pe) ? (wt(), Jr(Pe.tryBlock), Pe.catchClause && (jt(Pe.catchClause.variableDeclaration), Jr(Pe.catchClause.block)), Pe.finallyBlock && (Xt(), Jr(Pe.finallyBlock)), Ht()) : Ia(br(Pe, le, e));
- }
- function M(Pe) {
- return !!Pe && (Pe.transformFlags & 1048576) !== 0;
- }
- function Ae(Pe) {
- const Et = Pe.length;
- for (let Lr = 0; Lr < Et; Lr++)
- if (M(Pe[Lr]))
- return Lr;
- return -1;
- }
- function dt(Pe, Et) {
- return Et = g(Pe, Et), Pe === 1 ? U(Et) : Et;
- }
- function U(Pe) {
- return Oe(Pe) ? be(Pe) : Pe;
- }
- function be(Pe) {
- if (!jo(Pe) && h && h.has(Nn(Pe))) {
- const Et = Ho(Pe);
- if (Oe(Et) && Et.parent) {
- const Lr = d.getReferencedValueDeclaration(Et);
- if (Lr) {
- const $i = S[e_(Lr)];
- if ($i) {
- const Sa = Aa(lt(t.cloneNode($i), $i), $i.parent);
- return da(Sa, Pe), nl(Sa, Pe), Sa;
- }
- }
- }
- }
- return Pe;
- }
- function Z(Pe) {
- if (jo(Pe) || ya(Pe) & 8192)
- return Pe;
- const Et = t.createTempVariable(c);
- return Vi(
- Et,
- Pe,
- /*location*/
- Pe
- ), Et;
- }
- function ht(Pe) {
- const Et = Pe ? t.createUniqueName(Pe) : t.createTempVariable(
- /*recordTempVariable*/
- void 0
- );
- return c(Et), Et;
- }
- function Le() {
- O || (O = []);
- const Pe = z;
- return z++, O[Pe] = -1, Pe;
- }
- function Ie(Pe) {
- E.assert(O !== void 0, "No labels were defined."), O[Pe] = X ? X.length : 0;
- }
- function At(Pe) {
- D || (D = [], I = [], P = [], F = []);
- const Et = I.length;
- return I[Et] = 0, P[Et] = X ? X.length : 0, D[Et] = Pe, F.push(Pe), Et;
- }
- function Dr() {
- const Pe = yr();
- if (Pe === void 0) return E.fail("beginBlock was never called.");
- const Et = I.length;
- return I[Et] = 1, P[Et] = X ? X.length : 0, D[Et] = Pe, F.pop(), Pe;
- }
- function yr() {
- return Ro(F);
- }
- function $r() {
- const Pe = yr();
- return Pe && Pe.kind;
- }
- function nt(Pe) {
- const Et = Le(), Lr = Le();
- Ie(Et), At({
- kind: 1,
- expression: Pe,
- startLabel: Et,
- endLabel: Lr
- });
- }
- function ot() {
- E.assert(
- $r() === 1
- /* With */
- );
- const Pe = Dr();
- Ie(Pe.endLabel);
- }
- function wt() {
- const Pe = Le(), Et = Le();
- return Ie(Pe), At({
- kind: 0,
- state: 0,
- startLabel: Pe,
- endLabel: Et
- }), Na(), Et;
- }
- function jt(Pe) {
- E.assert(
- $r() === 0
- /* Exception */
- );
- let Et;
- if (jo(Pe.name))
- Et = Pe.name, c(Pe.name);
- else {
- const ka = Nn(Pe.name);
- Et = ht(ka), h || (h = /* @__PURE__ */ new Map(), S = [], e.enableSubstitution(
- 80
- /* Identifier */
- )), h.set(ka, !0), S[e_(Pe)] = Et;
- }
- const Lr = yr();
- E.assert(
- Lr.state < 1
- /* Catch */
- );
- const $i = Lr.endLabel;
- ba($i);
- const Sa = Le();
- Ie(Sa), Lr.state = 1, Lr.catchVariable = Et, Lr.catchLabel = Sa, Vi(Et, t.createCallExpression(
- t.createPropertyAccessExpression(ae, "sent"),
- /*typeArguments*/
- void 0,
- []
- )), Na();
- }
- function Xt() {
- E.assert(
- $r() === 0
- /* Exception */
- );
- const Pe = yr();
- E.assert(
- Pe.state < 2
- /* Finally */
- );
- const Et = Pe.endLabel;
- ba(Et);
- const Lr = Le();
- Ie(Lr), Pe.state = 2, Pe.finallyLabel = Lr;
- }
- function Ht() {
- E.assert(
- $r() === 0
- /* Exception */
- );
- const Pe = Dr();
- Pe.state < 2 ? ba(Pe.endLabel) : ge(), Ie(Pe.endLabel), Na(), Pe.state = 3;
- }
- function en() {
- At({
- kind: 3,
- isScript: !0,
- breakLabel: -1,
- continueLabel: -1
- });
- }
- function zt(Pe) {
- const Et = Le();
- return At({
- kind: 3,
- isScript: !1,
- breakLabel: Et,
- continueLabel: Pe
- }), Et;
- }
- function mr() {
- E.assert(
- $r() === 3
- /* Loop */
- );
- const Pe = Dr(), Et = Pe.breakLabel;
- Pe.isScript || Ie(Et);
- }
- function Kt() {
- At({
- kind: 2,
- isScript: !0,
- breakLabel: -1
- });
- }
- function hr() {
- const Pe = Le();
- return At({
- kind: 2,
- isScript: !1,
- breakLabel: Pe
- }), Pe;
- }
- function Ft() {
- E.assert(
- $r() === 2
- /* Switch */
- );
- const Pe = Dr(), Et = Pe.breakLabel;
- Pe.isScript || Ie(Et);
- }
- function Ss(Pe) {
- At({
- kind: 4,
- isScript: !0,
- labelText: Pe,
- breakLabel: -1
- });
- }
- function gs(Pe) {
- const Et = Le();
- At({
- kind: 4,
- isScript: !1,
- labelText: Pe,
- breakLabel: Et
- });
- }
- function Ts() {
- E.assert(
- $r() === 4
- /* Labeled */
- );
- const Pe = Dr();
- Pe.isScript || Ie(Pe.breakLabel);
- }
- function Ua(Pe) {
- return Pe.kind === 2 || Pe.kind === 3;
- }
- function lc(Pe) {
- return Pe.kind === 4;
- }
- function Ic(Pe) {
- return Pe.kind === 3;
- }
- function io(Pe, Et) {
- for (let Lr = Et; Lr >= 0; Lr--) {
- const $i = F[Lr];
- if (lc($i)) {
- if ($i.labelText === Pe)
- return !0;
- } else
- break;
- }
- return !1;
- }
- function vi(Pe) {
- if (F)
- if (Pe)
- for (let Et = F.length - 1; Et >= 0; Et--) {
- const Lr = F[Et];
- if (lc(Lr) && Lr.labelText === Pe)
- return Lr.breakLabel;
- if (Ua(Lr) && io(Pe, Et - 1))
- return Lr.breakLabel;
- }
- else
- for (let Et = F.length - 1; Et >= 0; Et--) {
- const Lr = F[Et];
- if (Ua(Lr))
- return Lr.breakLabel;
- }
- return 0;
- }
- function ca(Pe) {
- if (F)
- if (Pe)
- for (let Et = F.length - 1; Et >= 0; Et--) {
- const Lr = F[Et];
- if (Ic(Lr) && io(Pe, Et - 1))
- return Lr.continueLabel;
- }
- else
- for (let Et = F.length - 1; Et >= 0; Et--) {
- const Lr = F[Et];
- if (Ic(Lr))
- return Lr.continueLabel;
- }
- return 0;
- }
- function Ll(Pe) {
- if (Pe !== void 0 && Pe > 0) {
- B === void 0 && (B = []);
- const Et = t.createNumericLiteral(Number.MAX_SAFE_INTEGER);
- return B[Pe] === void 0 ? B[Pe] = [Et] : B[Pe].push(Et), Et;
- }
- return t.createOmittedExpression();
- }
- function xs(Pe) {
- const Et = t.createNumericLiteral(Pe);
- return j5(Et, 3, pRe(Pe)), Et;
- }
- function Cu(Pe, Et) {
- return E.assertLessThan(0, Pe, "Invalid label"), lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 3
- /* Break */
- ),
- Ll(Pe)
- ])
- ),
- Et
- );
- }
- function Zc(Pe, Et) {
- return lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression(
- Pe ? [xs(
- 2
- /* Return */
- ), Pe] : [xs(
- 2
- /* Return */
- )]
- )
- ),
- Et
- );
- }
- function Yi(Pe) {
- return lt(
- t.createCallExpression(
- t.createPropertyAccessExpression(ae, "sent"),
- /*typeArguments*/
- void 0,
- []
- ),
- Pe
- );
- }
- function Na() {
- $(
- 0
- /* Nop */
- );
- }
- function Ia(Pe) {
- Pe ? $(1, [Pe]) : Na();
- }
- function Vi(Pe, Et, Lr) {
- $(2, [Pe, Et], Lr);
- }
- function ba(Pe, Et) {
- $(3, [Pe], Et);
- }
- function Bt(Pe, Et, Lr) {
- $(4, [Pe, Et], Lr);
- }
- function to(Pe, Et, Lr) {
- $(5, [Pe, Et], Lr);
- }
- function _u(Pe, Et) {
- $(7, [Pe], Et);
- }
- function Wc(Pe, Et) {
- $(6, [Pe], Et);
- }
- function of(Pe, Et) {
- $(8, [Pe], Et);
- }
- function Ao(Pe, Et) {
- $(9, [Pe], Et);
- }
- function ge() {
- $(
- 10
- /* Endfinally */
- );
- }
- function $(Pe, Et, Lr) {
- X === void 0 && (X = [], q = [], V = []), O === void 0 && Ie(Le());
- const $i = X.length;
- X[$i] = Pe, q[$i] = Et, V[$i] = Lr;
- }
- function rt() {
- ee = 0, G = 0, ue = void 0, re = !1, ne = !1, ie = void 0, Se = void 0, J = void 0, oe = void 0, _e = void 0;
- const Pe = Ct();
- return n().createGeneratorHelper(
- an(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- ae
- )],
- /*type*/
- void 0,
- t.createBlock(
- Pe,
- /*multiLine*/
- Pe.length > 0
- )
- ),
- 1048576
- /* ReuseTempVariableScope */
- )
- );
- }
- function Ct() {
- if (X) {
- for (let Pe = 0; Pe < X.length; Pe++)
- za(Pe);
- zr(X.length);
- } else
- zr(0);
- if (ie) {
- const Pe = t.createPropertyAccessExpression(ae, "label"), Et = t.createSwitchStatement(Pe, t.createCaseBlock(ie));
- return [bu(Et)];
- }
- return Se || [];
- }
- function $t() {
- Se && (ar(
- /*markLabelEnd*/
- !re
- ), re = !1, ne = !1, G++);
- }
- function zr(Pe) {
- $n(Pe) && (An(Pe), _e = void 0, Fc(
- /*expression*/
- void 0,
- /*operationLocation*/
- void 0
- )), Se && ie && ar(
- /*markLabelEnd*/
- !1
- ), ri();
- }
- function $n(Pe) {
- if (!ne)
- return !0;
- if (!O || !B)
- return !1;
- for (let Et = 0; Et < O.length; Et++)
- if (O[Et] === Pe && B[Et])
- return !0;
- return !1;
- }
- function ar(Pe) {
- if (ie || (ie = []), Se) {
- if (_e)
- for (let Et = _e.length - 1; Et >= 0; Et--) {
- const Lr = _e[Et];
- Se = [t.createWithStatement(Lr.expression, t.createBlock(Se))];
- }
- if (oe) {
- const { startLabel: Et, catchLabel: Lr, finallyLabel: $i, endLabel: Sa } = oe;
- Se.unshift(
- t.createExpressionStatement(
- t.createCallExpression(
- t.createPropertyAccessExpression(t.createPropertyAccessExpression(ae, "trys"), "push"),
- /*typeArguments*/
- void 0,
- [
- t.createArrayLiteralExpression([
- Ll(Et),
- Ll(Lr),
- Ll($i),
- Ll(Sa)
- ])
- ]
- )
- )
- ), oe = void 0;
- }
- Pe && Se.push(
- t.createExpressionStatement(
- t.createAssignment(
- t.createPropertyAccessExpression(ae, "label"),
- t.createNumericLiteral(G + 1)
- )
- )
- );
- }
- ie.push(
- t.createCaseClause(
- t.createNumericLiteral(G),
- Se || []
- )
- ), Se = void 0;
- }
- function An(Pe) {
- if (O)
- for (let Et = 0; Et < O.length; Et++)
- O[Et] === Pe && ($t(), ue === void 0 && (ue = []), ue[G] === void 0 ? ue[G] = [Et] : ue[G].push(Et));
- }
- function ri() {
- if (B !== void 0 && ue !== void 0)
- for (let Pe = 0; Pe < ue.length; Pe++) {
- const Et = ue[Pe];
- if (Et !== void 0)
- for (const Lr of Et) {
- const $i = B[Lr];
- if ($i !== void 0)
- for (const Sa of $i)
- Sa.text = String(Pe);
- }
- }
- }
- function Fi(Pe) {
- if (D)
- for (; ee < I.length && P[ee] <= Pe; ee++) {
- const Et = D[ee], Lr = I[ee];
- switch (Et.kind) {
- case 0:
- Lr === 0 ? (J || (J = []), Se || (Se = []), J.push(oe), oe = Et) : Lr === 1 && (oe = J.pop());
- break;
- case 1:
- Lr === 0 ? (_e || (_e = []), _e.push(Et)) : Lr === 1 && _e.pop();
- break;
- }
- }
- }
- function za(Pe) {
- if (An(Pe), Fi(Pe), re)
- return;
- re = !1, ne = !1;
- const Et = X[Pe];
- if (Et === 0)
- return;
- if (Et === 10)
- return hp();
- const Lr = q[Pe];
- if (Et === 1)
- return Uo(Lr[0]);
- const $i = V[Pe];
- switch (Et) {
- case 2:
- return vc(Lr[0], Lr[1], $i);
- case 3:
- return Lo(Lr[0], $i);
- case 4:
- return _c(Lr[0], Lr[1], $i);
- case 5:
- return Wf(Lr[0], Lr[1], $i);
- case 6:
- return Lc(Lr[0], $i);
- case 7:
- return al(Lr[0], $i);
- case 8:
- return Fc(Lr[0], $i);
- case 9:
- return Oc(Lr[0], $i);
- }
- }
- function Uo(Pe) {
- Pe && (Se ? Se.push(Pe) : Se = [Pe]);
- }
- function vc(Pe, Et, Lr) {
- Uo(lt(t.createExpressionStatement(t.createAssignment(Pe, Et)), Lr));
- }
- function Oc(Pe, Et) {
- re = !0, ne = !0, Uo(lt(t.createThrowStatement(Pe), Et));
- }
- function Fc(Pe, Et) {
- re = !0, ne = !0, Uo(
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression(
- Pe ? [xs(
- 2
- /* Return */
- ), Pe] : [xs(
- 2
- /* Return */
- )]
- )
- ),
- Et
- ),
- 768
- /* NoTokenSourceMaps */
- )
- );
- }
- function Lo(Pe, Et) {
- re = !0, Uo(
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 3
- /* Break */
- ),
- Ll(Pe)
- ])
- ),
- Et
- ),
- 768
- /* NoTokenSourceMaps */
- )
- );
- }
- function _c(Pe, Et, Lr) {
- Uo(
- an(
- t.createIfStatement(
- Et,
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 3
- /* Break */
- ),
- Ll(Pe)
- ])
- ),
- Lr
- ),
- 768
- /* NoTokenSourceMaps */
- )
- ),
- 1
- /* SingleLine */
- )
- );
- }
- function Wf(Pe, Et, Lr) {
- Uo(
- an(
- t.createIfStatement(
- t.createLogicalNot(Et),
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 3
- /* Break */
- ),
- Ll(Pe)
- ])
- ),
- Lr
- ),
- 768
- /* NoTokenSourceMaps */
- )
- ),
- 1
- /* SingleLine */
- )
- );
- }
- function Lc(Pe, Et) {
- re = !0, Uo(
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression(
- Pe ? [xs(
- 4
- /* Yield */
- ), Pe] : [xs(
- 4
- /* Yield */
- )]
- )
- ),
- Et
- ),
- 768
- /* NoTokenSourceMaps */
- )
- );
- }
- function al(Pe, Et) {
- re = !0, Uo(
- an(
- lt(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 5
- /* YieldStar */
- ),
- Pe
- ])
- ),
- Et
- ),
- 768
- /* NoTokenSourceMaps */
- )
- );
- }
- function hp() {
- re = !0, Uo(
- t.createReturnStatement(
- t.createArrayLiteralExpression([
- xs(
- 7
- /* Endfinally */
- )
- ])
- )
- );
- }
- }
- function dW(e) {
- function t(M) {
- switch (M) {
- case 2:
- return X;
- case 3:
- return q;
- default:
- return z;
- }
- }
- const {
- factory: n,
- getEmitHelperFactory: i,
- startLexicalEnvironment: s,
- endLexicalEnvironment: o,
- hoistVariableDeclaration: c
- } = e, _ = e.getCompilerOptions(), u = e.getEmitResolver(), d = e.getEmitHost(), g = pa(_), h = Ru(_), S = e.onSubstituteNode, T = e.onEmitNode;
- e.onSubstituteNode = xe, e.onEmitNode = Ke, e.enableSubstitution(
- 213
- /* CallExpression */
- ), e.enableSubstitution(
- 215
- /* TaggedTemplateExpression */
- ), e.enableSubstitution(
- 80
- /* Identifier */
- ), e.enableSubstitution(
- 226
- /* BinaryExpression */
- ), e.enableSubstitution(
- 304
- /* ShorthandPropertyAssignment */
- ), e.enableEmitNotification(
- 307
- /* SourceFile */
- );
- const C = [];
- let D, P;
- const I = [];
- let F;
- return Fd(e, O);
- function O(M) {
- if (M.isDeclarationFile || !($T(M, _) || M.transformFlags & 8388608 || Rp(M) && u5(_) && _.outFile))
- return M;
- D = M, P = aW(e, M), C[e_(M)] = P;
- const dt = t(h)(M);
- return D = void 0, P = void 0, F = !1, dt;
- }
- function B() {
- return Ug(D.fileName) && D.commonJsModuleIndicator && (!D.externalModuleIndicator || D.externalModuleIndicator === !0) ? !1 : !!(!P.exportEquals && il(D));
- }
- function z(M) {
- s();
- const Ae = [], dt = cu(_, "alwaysStrict") || il(D), U = n.copyPrologue(M.statements, Ae, dt && !Rp(M), ue);
- if (B() && wr(Ae, ze()), ut(P.exportedNames))
- for (let ht = 0; ht < P.exportedNames.length; ht += 50)
- wr(
- Ae,
- n.createExpressionStatement(
- Hu(
- P.exportedNames.slice(ht, ht + 50),
- (Le, Ie) => Ie.kind === 11 ? n.createAssignment(n.createElementAccessExpression(n.createIdentifier("exports"), n.createStringLiteral(Ie.text)), Le) : n.createAssignment(n.createPropertyAccessExpression(n.createIdentifier("exports"), n.createIdentifier(Nn(Ie))), Le),
- n.createVoidZero()
- )
- )
- );
- for (const Z of P.exportedFunctions)
- Xe(Ae, Z);
- wr(Ae, Ge(P.externalHelpersImportDeclaration, ue, bi)), Fn(Ae, Fr(M.statements, ue, bi, U)), G(
- Ae,
- /*emitAsReturn*/
- !1
- ), Mg(Ae, o());
- const be = n.updateSourceFile(M, lt(n.createNodeArray(Ae), M.statements));
- return Ih(be, e.readEmitHelpers()), be;
- }
- function X(M) {
- const Ae = n.createIdentifier("define"), dt = lA(n, M, d, _), U = Rp(M) && M, { aliasedModuleNames: be, unaliasedModuleNames: Z, importAliasNames: ht } = V(
- M,
- /*includeNonAmdDependencies*/
- !0
- ), Le = n.updateSourceFile(
- M,
- lt(
- n.createNodeArray([
- n.createExpressionStatement(
- n.createCallExpression(
- Ae,
- /*typeArguments*/
- void 0,
- [
- // Add the module name (if provided).
- ...dt ? [dt] : [],
- // Add the dependency array argument:
- //
- // ["require", "exports", module1", "module2", ...]
- n.createArrayLiteralExpression(
- U ? Ue : [
- n.createStringLiteral("require"),
- n.createStringLiteral("exports"),
- ...be,
- ...Z
- ]
- ),
- // Add the module body function argument:
- //
- // function (require, exports, module1, module2) ...
- U ? U.statements.length ? U.statements[0].expression : n.createObjectLiteralExpression() : n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "require"
- ),
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "exports"
- ),
- ...ht
- ],
- /*type*/
- void 0,
- ee(M)
- )
- ]
- )
- )
- ]),
- /*location*/
- M.statements
- )
- );
- return Ih(Le, e.readEmitHelpers()), Le;
- }
- function q(M) {
- const { aliasedModuleNames: Ae, unaliasedModuleNames: dt, importAliasNames: U } = V(
- M,
- /*includeNonAmdDependencies*/
- !1
- ), be = lA(n, M, d, _), Z = n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "factory"
- )],
- /*type*/
- void 0,
- lt(
- n.createBlock(
- [
- n.createIfStatement(
- n.createLogicalAnd(
- n.createTypeCheck(n.createIdentifier("module"), "object"),
- n.createTypeCheck(n.createPropertyAccessExpression(n.createIdentifier("module"), "exports"), "object")
- ),
- n.createBlock([
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- [
- n.createVariableDeclaration(
- "v",
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n.createCallExpression(
- n.createIdentifier("factory"),
- /*typeArguments*/
- void 0,
- [
- n.createIdentifier("require"),
- n.createIdentifier("exports")
- ]
- )
- )
- ]
- ),
- an(
- n.createIfStatement(
- n.createStrictInequality(
- n.createIdentifier("v"),
- n.createIdentifier("undefined")
- ),
- n.createExpressionStatement(
- n.createAssignment(
- n.createPropertyAccessExpression(n.createIdentifier("module"), "exports"),
- n.createIdentifier("v")
- )
- )
- ),
- 1
- /* SingleLine */
- )
- ]),
- n.createIfStatement(
- n.createLogicalAnd(
- n.createTypeCheck(n.createIdentifier("define"), "function"),
- n.createPropertyAccessExpression(n.createIdentifier("define"), "amd")
- ),
- n.createBlock([
- n.createExpressionStatement(
- n.createCallExpression(
- n.createIdentifier("define"),
- /*typeArguments*/
- void 0,
- [
- // Add the module name (if provided).
- ...be ? [be] : [],
- n.createArrayLiteralExpression([
- n.createStringLiteral("require"),
- n.createStringLiteral("exports"),
- ...Ae,
- ...dt
- ]),
- n.createIdentifier("factory")
- ]
- )
- )
- ])
- )
- )
- ],
- /*multiLine*/
- !0
- ),
- /*location*/
- void 0
- )
- ), ht = n.updateSourceFile(
- M,
- lt(
- n.createNodeArray([
- n.createExpressionStatement(
- n.createCallExpression(
- Z,
- /*typeArguments*/
- void 0,
- [
- // Add the module body function argument:
- //
- // function (require, exports) ...
- n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "require"
- ),
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "exports"
- ),
- ...U
- ],
- /*type*/
- void 0,
- ee(M)
- )
- ]
- )
- )
- ]),
- /*location*/
- M.statements
- )
- );
- return Ih(ht, e.readEmitHelpers()), ht;
- }
- function V(M, Ae) {
- const dt = [], U = [], be = [];
- for (const Z of M.amdDependencies)
- Z.name ? (dt.push(n.createStringLiteral(Z.path)), be.push(n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Z.name
- ))) : U.push(n.createStringLiteral(Z.path));
- for (const Z of P.externalImports) {
- const ht = Rx(n, Z, D, d, u, _), Le = e6(n, Z, D);
- ht && (Ae && Le ? (an(
- Le,
- 8
- /* NoSubstitution */
- ), dt.push(ht), be.push(n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Le
- ))) : U.push(ht));
- }
- return { aliasedModuleNames: dt, unaliasedModuleNames: U, importAliasNames: be };
- }
- function ae(M) {
- if (gl(M) || Nc(M) || !Rx(n, M, D, d, u, _))
- return;
- const Ae = e6(n, M, D), dt = rs(M, Ae);
- if (dt !== Ae)
- return n.createExpressionStatement(n.createAssignment(Ae, dt));
- }
- function ee(M) {
- s();
- const Ae = [], dt = n.copyPrologue(
- M.statements,
- Ae,
- /*ensureUseStrict*/
- !0,
- ue
- );
- B() && wr(Ae, ze()), ut(P.exportedNames) && wr(
- Ae,
- n.createExpressionStatement(Hu(P.exportedNames, (be, Z) => Z.kind === 11 ? n.createAssignment(n.createElementAccessExpression(n.createIdentifier("exports"), n.createStringLiteral(Z.text)), be) : n.createAssignment(n.createPropertyAccessExpression(n.createIdentifier("exports"), n.createIdentifier(Nn(Z))), be), n.createVoidZero()))
- );
- for (const be of P.exportedFunctions)
- Xe(Ae, be);
- wr(Ae, Ge(P.externalHelpersImportDeclaration, ue, bi)), h === 2 && Fn(Ae, Ai(P.externalImports, ae)), Fn(Ae, Fr(M.statements, ue, bi, dt)), G(
- Ae,
- /*emitAsReturn*/
- !0
- ), Mg(Ae, o());
- const U = n.createBlock(
- Ae,
- /*multiLine*/
- !0
- );
- return F && Tx(U, dRe), U;
- }
- function G(M, Ae) {
- if (P.exportEquals) {
- const dt = Ge(P.exportEquals.expression, ie, _t);
- if (dt)
- if (Ae) {
- const U = n.createReturnStatement(dt);
- lt(U, P.exportEquals), an(
- U,
- 3840
- /* NoComments */
- ), M.push(U);
- } else {
- const U = n.createExpressionStatement(
- n.createAssignment(
- n.createPropertyAccessExpression(
- n.createIdentifier("module"),
- "exports"
- ),
- dt
- )
- );
- lt(U, P.exportEquals), an(
- U,
- 3072
- /* NoComments */
- ), M.push(U);
- }
- }
- }
- function ue(M) {
- switch (M.kind) {
- case 272:
- return ei(M);
- case 271:
- return Jr(M);
- case 278:
- return ji(M);
- case 277:
- return Fe(M);
- default:
- return re(M);
- }
- }
- function re(M) {
- switch (M.kind) {
- case 243:
- return mn(M);
- case 262:
- return Ot(M);
- case 263:
- return Ar(M);
- case 248:
- return _e(
- M,
- /*isTopLevel*/
- !0
- );
- case 249:
- return he(M);
- case 250:
- return le(M);
- case 246:
- return me(M);
- case 247:
- return ve(M);
- case 256:
- return tt(M);
- case 254:
- return Te(M);
- case 245:
- return we(M);
- case 255:
- return fe(M);
- case 269:
- return Me(M);
- case 296:
- return Qe(M);
- case 297:
- return et(M);
- case 258:
- return Re(M);
- case 299:
- return ft(M);
- case 241:
- return Wt(M);
- default:
- return ie(M);
- }
- }
- function ne(M, Ae) {
- if (!(M.transformFlags & 276828160))
- return M;
- switch (M.kind) {
- case 248:
- return _e(
- M,
- /*isTopLevel*/
- !1
- );
- case 244:
- return _r(M);
- case 217:
- return Ir(M, Ae);
- case 354:
- return jr(M, Ae);
- case 213:
- if (hf(M) && d.shouldTransformImportCall(D))
- return Qt(M);
- break;
- case 226:
- if (x0(M))
- return oe(M, Ae);
- break;
- case 224:
- case 225:
- return Nt(M, Ae);
- }
- return br(M, ie, e);
- }
- function ie(M) {
- return ne(
- M,
- /*valueIsDiscarded*/
- !1
- );
- }
- function Se(M) {
- return ne(
- M,
- /*valueIsDiscarded*/
- !0
- );
- }
- function J(M) {
- if (Ks(M))
- for (const Ae of M.properties)
- switch (Ae.kind) {
- case 303:
- if (J(Ae.initializer))
- return !0;
- break;
- case 304:
- if (J(Ae.name))
- return !0;
- break;
- case 305:
- if (J(Ae.expression))
- return !0;
- break;
- case 174:
- case 177:
- case 178:
- return !1;
- default:
- E.assertNever(Ae, "Unhandled object member kind");
- }
- else if ($l(M)) {
- for (const Ae of M.elements)
- if (fp(Ae)) {
- if (J(Ae.expression))
- return !0;
- } else if (J(Ae))
- return !0;
- } else if (Oe(M))
- return Nr(vn(M)) > (oO(M) ? 1 : 0);
- return !1;
- }
- function oe(M, Ae) {
- return J(M.left) ? DS(M, ie, e, 0, !Ae, ti) : br(M, ie, e);
- }
- function _e(M, Ae) {
- if (Ae && M.initializer && Fl(M.initializer) && !(M.initializer.flags & 7)) {
- const dt = rr(
- /*statements*/
- void 0,
- M.initializer,
- /*isForInOrOfInitializer*/
- !1
- );
- if (dt) {
- const U = [], be = Ge(M.initializer, Se, Fl), Z = n.createVariableStatement(
- /*modifiers*/
- void 0,
- be
- );
- U.push(Z), Fn(U, dt);
- const ht = Ge(M.condition, ie, _t), Le = Ge(M.incrementor, Se, _t), Ie = Ku(M.statement, Ae ? re : ie, e);
- return U.push(n.updateForStatement(
- M,
- /*initializer*/
- void 0,
- ht,
- Le,
- Ie
- )), U;
- }
- }
- return n.updateForStatement(
- M,
- Ge(M.initializer, Se, ip),
- Ge(M.condition, ie, _t),
- Ge(M.incrementor, Se, _t),
- Ku(M.statement, Ae ? re : ie, e)
- );
- }
- function he(M) {
- if (Fl(M.initializer) && !(M.initializer.flags & 7)) {
- const Ae = rr(
- /*statements*/
- void 0,
- M.initializer,
- /*isForInOrOfInitializer*/
- !0
- );
- if (ut(Ae)) {
- const dt = Ge(M.initializer, Se, ip), U = Ge(M.expression, ie, _t), be = Ku(M.statement, re, e), Z = Cs(be) ? n.updateBlock(be, [...Ae, ...be.statements]) : n.createBlock(
- [...Ae, be],
- /*multiLine*/
- !0
- );
- return n.updateForInStatement(M, dt, U, Z);
- }
- }
- return n.updateForInStatement(
- M,
- Ge(M.initializer, Se, ip),
- Ge(M.expression, ie, _t),
- Ku(M.statement, re, e)
- );
- }
- function le(M) {
- if (Fl(M.initializer) && !(M.initializer.flags & 7)) {
- const Ae = rr(
- /*statements*/
- void 0,
- M.initializer,
- /*isForInOrOfInitializer*/
- !0
- ), dt = Ge(M.initializer, Se, ip), U = Ge(M.expression, ie, _t);
- let be = Ku(M.statement, re, e);
- return ut(Ae) && (be = Cs(be) ? n.updateBlock(be, [...Ae, ...be.statements]) : n.createBlock(
- [...Ae, be],
- /*multiLine*/
- !0
- )), n.updateForOfStatement(M, M.awaitModifier, dt, U, be);
- }
- return n.updateForOfStatement(
- M,
- M.awaitModifier,
- Ge(M.initializer, Se, ip),
- Ge(M.expression, ie, _t),
- Ku(M.statement, re, e)
- );
- }
- function me(M) {
- return n.updateDoStatement(
- M,
- Ku(M.statement, re, e),
- Ge(M.expression, ie, _t)
- );
- }
- function ve(M) {
- return n.updateWhileStatement(
- M,
- Ge(M.expression, ie, _t),
- Ku(M.statement, re, e)
- );
- }
- function tt(M) {
- return n.updateLabeledStatement(
- M,
- M.label,
- Ge(M.statement, re, bi, n.liftToBlock) ?? lt(n.createEmptyStatement(), M.statement)
- );
- }
- function Te(M) {
- return n.updateWithStatement(
- M,
- Ge(M.expression, ie, _t),
- E.checkDefined(Ge(M.statement, re, bi, n.liftToBlock))
- );
- }
- function we(M) {
- return n.updateIfStatement(
- M,
- Ge(M.expression, ie, _t),
- Ge(M.thenStatement, re, bi, n.liftToBlock) ?? n.createBlock([]),
- Ge(M.elseStatement, re, bi, n.liftToBlock)
- );
- }
- function fe(M) {
- return n.updateSwitchStatement(
- M,
- Ge(M.expression, ie, _t),
- E.checkDefined(Ge(M.caseBlock, re, cD))
- );
- }
- function Me(M) {
- return n.updateCaseBlock(
- M,
- Fr(M.clauses, re, XI)
- );
- }
- function Qe(M) {
- return n.updateCaseClause(
- M,
- Ge(M.expression, ie, _t),
- Fr(M.statements, re, bi)
- );
- }
- function et(M) {
- return br(M, re, e);
- }
- function Re(M) {
- return br(M, re, e);
- }
- function ft(M) {
- return n.updateCatchClause(
- M,
- M.variableDeclaration,
- E.checkDefined(Ge(M.block, re, Cs))
- );
- }
- function Wt(M) {
- return M = br(M, re, e), M;
- }
- function _r(M) {
- return n.updateExpressionStatement(
- M,
- Ge(M.expression, Se, _t)
- );
- }
- function Ir(M, Ae) {
- return n.updateParenthesizedExpression(M, Ge(M.expression, Ae ? Se : ie, _t));
- }
- function jr(M, Ae) {
- return n.updatePartiallyEmittedExpression(M, Ge(M.expression, Ae ? Se : ie, _t));
- }
- function Nt(M, Ae) {
- if ((M.operator === 46 || M.operator === 47) && Oe(M.operand) && !jo(M.operand) && !Mh(M.operand) && !WB(M.operand)) {
- const dt = vn(M.operand);
- if (dt) {
- let U, be = Ge(M.operand, ie, _t);
- uv(M) ? be = n.updatePrefixUnaryExpression(M, be) : (be = n.updatePostfixUnaryExpression(M, be), Ae || (U = n.createTempVariable(c), be = n.createAssignment(U, be), lt(be, M)), be = n.createComma(be, n.cloneNode(M.operand)), lt(be, M));
- for (const Z of dt)
- I[Ma(be)] = !0, be = De(Z, be), lt(be, M);
- return U && (I[Ma(be)] = !0, be = n.createComma(be, U), lt(be, M)), be;
- }
- }
- return br(M, ie, e);
- }
- function Qt(M) {
- if (h === 0 && g >= 7)
- return br(M, ie, e);
- const Ae = Rx(n, M, D, d, u, _), dt = Ge(el(M.arguments), ie, _t), U = Ae && (!dt || !oa(dt) || dt.text !== Ae.text) ? Ae : dt, be = !!(M.transformFlags & 16384);
- switch (_.module) {
- case 2:
- return xr(U, be);
- case 3:
- return Br(U ?? n.createVoidZero(), be);
- case 1:
- default:
- return zn(U);
- }
- }
- function Br(M, Ae) {
- if (F = !0, Hb(M)) {
- const dt = jo(M) ? M : oa(M) ? n.createStringLiteralFromNode(M) : an(
- lt(n.cloneNode(M), M),
- 3072
- /* NoComments */
- );
- return n.createConditionalExpression(
- /*condition*/
- n.createIdentifier("__syncRequire"),
- /*questionToken*/
- void 0,
- /*whenTrue*/
- zn(M),
- /*colonToken*/
- void 0,
- /*whenFalse*/
- xr(dt, Ae)
- );
- } else {
- const dt = n.createTempVariable(c);
- return n.createComma(
- n.createAssignment(dt, M),
- n.createConditionalExpression(
- /*condition*/
- n.createIdentifier("__syncRequire"),
- /*questionToken*/
- void 0,
- /*whenTrue*/
- zn(
- dt,
- /*isInlineable*/
- !0
- ),
- /*colonToken*/
- void 0,
- /*whenFalse*/
- xr(dt, Ae)
- )
- );
- }
- }
- function xr(M, Ae) {
- const dt = n.createUniqueName("resolve"), U = n.createUniqueName("reject"), be = [
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- dt
- ),
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- U
- )
- ], Z = n.createBlock([
- n.createExpressionStatement(
- n.createCallExpression(
- n.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- [n.createArrayLiteralExpression([M || n.createOmittedExpression()]), dt, U]
- )
- )
- ]);
- let ht;
- g >= 2 ? ht = n.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- be,
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- Z
- ) : (ht = n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- be,
- /*type*/
- void 0,
- Z
- ), Ae && an(
- ht,
- 16
- /* CapturesThis */
- ));
- const Le = n.createNewExpression(
- n.createIdentifier("Promise"),
- /*typeArguments*/
- void 0,
- [ht]
- );
- return Wg(_) ? n.createCallExpression(
- n.createPropertyAccessExpression(Le, n.createIdentifier("then")),
- /*typeArguments*/
- void 0,
- [i().createImportStarCallbackHelper()]
- ) : Le;
- }
- function zn(M, Ae) {
- const dt = M && !fg(M) && !Ae, U = n.createCallExpression(
- n.createPropertyAccessExpression(n.createIdentifier("Promise"), "resolve"),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- dt ? g >= 2 ? [
- n.createTemplateExpression(n.createTemplateHead(""), [
- n.createTemplateSpan(M, n.createTemplateTail(""))
- ])
- ] : [
- n.createCallExpression(
- n.createPropertyAccessExpression(n.createStringLiteral(""), "concat"),
- /*typeArguments*/
- void 0,
- [M]
- )
- ] : []
- );
- let be = n.createCallExpression(
- n.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- dt ? [n.createIdentifier("s")] : M ? [M] : []
- );
- Wg(_) && (be = i().createImportStarHelper(be));
- const Z = dt ? [
- n.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- "s"
- )
- ] : [];
- let ht;
- return g >= 2 ? ht = n.createArrowFunction(
- /*modifiers*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- Z,
- /*type*/
- void 0,
- /*equalsGreaterThanToken*/
- void 0,
- be
- ) : ht = n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- Z,
- /*type*/
- void 0,
- n.createBlock([n.createReturnStatement(be)])
- ), n.createCallExpression(
- n.createPropertyAccessExpression(U, "then"),
- /*typeArguments*/
- void 0,
- [ht]
- );
- }
- function ki(M, Ae) {
- return !Wg(_) || _d(M) & 2 ? Ae : Vre(M) ? i().createImportStarHelper(Ae) : Ae;
- }
- function rs(M, Ae) {
- return !Wg(_) || _d(M) & 2 ? Ae : qO(M) ? i().createImportStarHelper(Ae) : sW(M) ? i().createImportDefaultHelper(Ae) : Ae;
- }
- function ei(M) {
- let Ae;
- const dt = kC(M);
- if (h !== 2)
- if (M.importClause) {
- const U = [];
- dt && !ex(M) ? U.push(
- n.createVariableDeclaration(
- n.cloneNode(dt.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- rs(M, Ri(M))
- )
- ) : (U.push(
- n.createVariableDeclaration(
- n.getGeneratedNameForNode(M),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- rs(M, Ri(M))
- )
- ), dt && ex(M) && U.push(
- n.createVariableDeclaration(
- n.cloneNode(dt.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n.getGeneratedNameForNode(M)
- )
- )), Ae = wr(
- Ae,
- kn(
- lt(
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList(
- U,
- g >= 2 ? 2 : 0
- /* None */
- )
- ),
- /*location*/
- M
- ),
- /*original*/
- M
- )
- );
- } else
- return kn(lt(n.createExpressionStatement(Ri(M)), M), M);
- else dt && ex(M) && (Ae = wr(
- Ae,
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList(
- [
- kn(
- lt(
- n.createVariableDeclaration(
- n.cloneNode(dt.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n.getGeneratedNameForNode(M)
- ),
- /*location*/
- M
- ),
- /*original*/
- M
- )
- ],
- g >= 2 ? 2 : 0
- /* None */
- )
- )
- ));
- return Ae = Oi(Ae, M), Ym(Ae);
- }
- function Ri(M) {
- const Ae = Rx(n, M, D, d, u, _), dt = [];
- return Ae && dt.push(Ae), n.createCallExpression(
- n.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- dt
- );
- }
- function Jr(M) {
- E.assert(Z1(M), "import= for internal module references should be handled in an earlier transformer.");
- let Ae;
- return h !== 2 ? Gn(
- M,
- 32
- /* Export */
- ) ? Ae = wr(
- Ae,
- kn(
- lt(
- n.createExpressionStatement(
- De(
- M.name,
- Ri(M)
- )
- ),
- M
- ),
- M
- )
- ) : Ae = wr(
- Ae,
- kn(
- lt(
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList(
- [
- n.createVariableDeclaration(
- n.cloneNode(M.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ri(M)
- )
- ],
- /*flags*/
- g >= 2 ? 2 : 0
- /* None */
- )
- ),
- M
- ),
- M
- )
- ) : Gn(
- M,
- 32
- /* Export */
- ) && (Ae = wr(
- Ae,
- kn(
- lt(
- n.createExpressionStatement(
- De(n.getExportName(M), n.getLocalName(M))
- ),
- M
- ),
- M
- )
- )), Ae = Ws(Ae, M), Ym(Ae);
- }
- function ji(M) {
- if (!M.moduleSpecifier)
- return;
- const Ae = n.getGeneratedNameForNode(M);
- if (M.exportClause && pp(M.exportClause)) {
- const dt = [];
- h !== 2 && dt.push(
- kn(
- lt(
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList([
- n.createVariableDeclaration(
- Ae,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Ri(M)
- )
- ])
- ),
- /*location*/
- M
- ),
- /* original */
- M
- )
- );
- for (const U of M.exportClause.elements) {
- const be = U.propertyName || U.name, ht = !!Wg(_) && !(_d(M) & 2) && ng(be) ? i().createImportDefaultHelper(Ae) : Ae, Le = be.kind === 11 ? n.createElementAccessExpression(ht, be) : n.createPropertyAccessExpression(ht, be);
- dt.push(
- kn(
- lt(
- n.createExpressionStatement(
- De(
- U.name.kind === 11 ? n.cloneNode(U.name) : n.getExportName(U),
- Le,
- /*location*/
- void 0,
- /*liveBinding*/
- !0
- )
- ),
- U
- ),
- U
- )
- );
- }
- return Ym(dt);
- } else if (M.exportClause) {
- const dt = [];
- return dt.push(
- kn(
- lt(
- n.createExpressionStatement(
- De(
- n.cloneNode(M.exportClause.name),
- ki(
- M,
- h !== 2 ? Ri(M) : c7(M) || M.exportClause.name.kind === 11 ? Ae : n.createIdentifier(Nn(M.exportClause.name))
- )
- )
- ),
- M
- ),
- M
- )
- ), Ym(dt);
- } else
- return kn(
- lt(
- n.createExpressionStatement(
- i().createExportStarHelper(h !== 2 ? Ri(M) : Ae)
- ),
- M
- ),
- M
- );
- }
- function Fe(M) {
- if (!M.isExportEquals)
- return K(
- n.createIdentifier("default"),
- Ge(M.expression, ie, _t),
- /*location*/
- M,
- /*allowComments*/
- !0
- );
- }
- function Ot(M) {
- let Ae;
- return Gn(
- M,
- 32
- /* Export */
- ) ? Ae = wr(
- Ae,
- kn(
- lt(
- n.createFunctionDeclaration(
- Fr(M.modifiers, Ve, ra),
- M.asteriskToken,
- n.getDeclarationName(
- M,
- /*allowComments*/
- !0,
- /*allowSourceMaps*/
- !0
- ),
- /*typeParameters*/
- void 0,
- Fr(M.parameters, ie, Ii),
- /*type*/
- void 0,
- br(M.body, ie, e)
- ),
- /*location*/
- M
- ),
- /*original*/
- M
- )
- ) : Ae = wr(Ae, br(M, ie, e)), Ym(Ae);
- }
- function Ar(M) {
- let Ae;
- return Gn(
- M,
- 32
- /* Export */
- ) ? Ae = wr(
- Ae,
- kn(
- lt(
- n.createClassDeclaration(
- Fr(M.modifiers, Ve, Bo),
- n.getDeclarationName(
- M,
- /*allowComments*/
- !0,
- /*allowSourceMaps*/
- !0
- ),
- /*typeParameters*/
- void 0,
- Fr(M.heritageClauses, ie, ef),
- Fr(M.members, ie, _l)
- ),
- M
- ),
- M
- )
- ) : Ae = wr(Ae, br(M, ie, e)), Ae = Xe(Ae, M), Ym(Ae);
- }
- function mn(M) {
- let Ae, dt, U;
- if (Gn(
- M,
- 32
- /* Export */
- )) {
- let be, Z = !1;
- for (const ht of M.declarationList.declarations)
- if (Oe(ht.name) && Mh(ht.name))
- if (be || (be = Fr(M.modifiers, Ve, ra)), ht.initializer) {
- const Le = n.updateVariableDeclaration(
- ht,
- ht.name,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- De(
- ht.name,
- Ge(ht.initializer, ie, _t)
- )
- );
- dt = wr(dt, Le);
- } else
- dt = wr(dt, ht);
- else if (ht.initializer)
- if (!As(ht.name) && (Co(ht.initializer) || vo(ht.initializer) || $c(ht.initializer))) {
- const Le = n.createAssignment(
- lt(
- n.createPropertyAccessExpression(
- n.createIdentifier("exports"),
- ht.name
- ),
- /*location*/
- ht.name
- ),
- n.createIdentifier(Jp(ht.name))
- ), Ie = n.createVariableDeclaration(
- ht.name,
- ht.exclamationToken,
- ht.type,
- Ge(ht.initializer, ie, _t)
- );
- dt = wr(dt, Ie), U = wr(U, Le), Z = !0;
- } else
- U = wr(U, qn(ht));
- if (dt && (Ae = wr(Ae, n.updateVariableStatement(M, be, n.updateVariableDeclarationList(M.declarationList, dt)))), U) {
- const ht = kn(lt(n.createExpressionStatement(n.inlineExpressions(U)), M), M);
- Z && X3(ht), Ae = wr(Ae, ht);
- }
- } else
- Ae = wr(Ae, br(M, ie, e));
- return Ae = Hs(Ae, M), Ym(Ae);
- }
- function ti(M, Ae, dt) {
- const U = vn(M);
- if (U) {
- let be = oO(M) ? Ae : n.createAssignment(M, Ae);
- for (const Z of U)
- an(
- be,
- 8
- /* NoSubstitution */
- ), be = De(
- Z,
- be,
- /*location*/
- dt
- );
- return be;
- }
- return n.createAssignment(M, Ae);
- }
- function qn(M) {
- return As(M.name) ? DS(
- Ge(M, ie, O3),
- ie,
- e,
- 0,
- /*needsValue*/
- !1,
- ti
- ) : n.createAssignment(
- lt(
- n.createPropertyAccessExpression(
- n.createIdentifier("exports"),
- M.name
- ),
- /*location*/
- M.name
- ),
- M.initializer ? Ge(M.initializer, ie, _t) : n.createVoidZero()
- );
- }
- function Oi(M, Ae) {
- if (P.exportEquals)
- return M;
- const dt = Ae.importClause;
- if (!dt)
- return M;
- const U = new _6();
- dt.name && (M = Tt(M, U, dt));
- const be = dt.namedBindings;
- if (be)
- switch (be.kind) {
- case 274:
- M = Tt(M, U, be);
- break;
- case 275:
- for (const Z of be.elements)
- M = Tt(
- M,
- U,
- Z,
- /*liveBinding*/
- !0
- );
- break;
- }
- return M;
- }
- function Ws(M, Ae) {
- return P.exportEquals ? M : Tt(M, new _6(), Ae);
- }
- function Hs(M, Ae) {
- return rr(
- M,
- Ae.declarationList,
- /*isForInOrOfInitializer*/
- !1
- );
- }
- function rr(M, Ae, dt) {
- if (P.exportEquals)
- return M;
- for (const U of Ae.declarations)
- M = Ea(M, U, dt);
- return M;
- }
- function Ea(M, Ae, dt) {
- if (P.exportEquals)
- return M;
- if (As(Ae.name))
- for (const U of Ae.name.elements)
- ml(U) || (M = Ea(M, U, dt));
- else !jo(Ae.name) && (!ii(Ae) || Ae.initializer || dt) && (M = Tt(M, new _6(), Ae));
- return M;
- }
- function Xe(M, Ae) {
- if (P.exportEquals)
- return M;
- const dt = new _6();
- if (Gn(
- Ae,
- 32
- /* Export */
- )) {
- const U = Gn(
- Ae,
- 2048
- /* Default */
- ) ? n.createIdentifier("default") : n.getDeclarationName(Ae);
- M = te(
- M,
- dt,
- U,
- n.getLocalName(Ae),
- /*location*/
- Ae
- );
- }
- return Ae.name && (M = Tt(M, dt, Ae)), M;
- }
- function Tt(M, Ae, dt, U) {
- const be = n.getDeclarationName(dt), Z = P.exportSpecifiers.get(be);
- if (Z)
- for (const ht of Z)
- M = te(
- M,
- Ae,
- ht.name,
- be,
- /*location*/
- ht.name,
- /*allowComments*/
- void 0,
- U
- );
- return M;
- }
- function te(M, Ae, dt, U, be, Z, ht) {
- if (dt.kind !== 11) {
- if (Ae.has(dt))
- return M;
- Ae.set(dt, !0);
- }
- return M = wr(M, K(dt, U, be, Z, ht)), M;
- }
- function ze() {
- const M = n.createExpressionStatement(
- n.createCallExpression(
- n.createPropertyAccessExpression(n.createIdentifier("Object"), "defineProperty"),
- /*typeArguments*/
- void 0,
- [
- n.createIdentifier("exports"),
- n.createStringLiteral("__esModule"),
- n.createObjectLiteralExpression([
- n.createPropertyAssignment("value", n.createTrue())
- ])
- ]
- )
- );
- return an(
- M,
- 2097152
- /* CustomPrologue */
- ), M;
- }
- function K(M, Ae, dt, U, be) {
- const Z = lt(n.createExpressionStatement(De(
- M,
- Ae,
- /*location*/
- void 0,
- be
- )), dt);
- return bu(Z), U || an(
- Z,
- 3072
- /* NoComments */
- ), Z;
- }
- function De(M, Ae, dt, U) {
- return lt(
- U ? n.createCallExpression(
- n.createPropertyAccessExpression(
- n.createIdentifier("Object"),
- "defineProperty"
- ),
- /*typeArguments*/
- void 0,
- [
- n.createIdentifier("exports"),
- n.createStringLiteralFromNode(M),
- n.createObjectLiteralExpression([
- n.createPropertyAssignment("enumerable", n.createTrue()),
- n.createPropertyAssignment(
- "get",
- n.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- [],
- /*type*/
- void 0,
- n.createBlock([n.createReturnStatement(Ae)])
- )
- )
- ])
- ]
- ) : n.createAssignment(
- M.kind === 11 ? n.createElementAccessExpression(
- n.createIdentifier("exports"),
- n.cloneNode(M)
- ) : n.createPropertyAccessExpression(
- n.createIdentifier("exports"),
- n.cloneNode(M)
- ),
- Ae
- ),
- dt
- );
- }
- function Ve(M) {
- switch (M.kind) {
- case 95:
- case 90:
- return;
- }
- return M;
- }
- function Ke(M, Ae, dt) {
- Ae.kind === 307 ? (D = Ae, P = C[e_(D)], T(M, Ae, dt), D = void 0, P = void 0) : T(M, Ae, dt);
- }
- function xe(M, Ae) {
- return Ae = S(M, Ae), Ae.id && I[Ae.id] ? Ae : M === 1 ? $e(Ae) : uu(Ae) ? at(Ae) : Ae;
- }
- function at(M) {
- const Ae = M.name, dt = Vt(Ae);
- if (dt !== Ae) {
- if (M.objectAssignmentInitializer) {
- const U = n.createAssignment(dt, M.objectAssignmentInitializer);
- return lt(n.createPropertyAssignment(Ae, U), M);
- }
- return lt(n.createPropertyAssignment(Ae, dt), M);
- }
- return M;
- }
- function $e(M) {
- switch (M.kind) {
- case 80:
- return Vt(M);
- case 213:
- return bt(M);
- case 215:
- return He(M);
- case 226:
- return Zt(M);
- }
- return M;
- }
- function bt(M) {
- if (Oe(M.expression)) {
- const Ae = Vt(M.expression);
- if (I[Ma(Ae)] = !0, !Oe(Ae) && !(ya(M.expression) & 8192))
- return bx(
- n.updateCallExpression(
- M,
- Ae,
- /*typeArguments*/
- void 0,
- M.arguments
- ),
- 16
- /* IndirectCall */
- );
- }
- return M;
- }
- function He(M) {
- if (Oe(M.tag)) {
- const Ae = Vt(M.tag);
- if (I[Ma(Ae)] = !0, !Oe(Ae) && !(ya(M.tag) & 8192))
- return bx(
- n.updateTaggedTemplateExpression(
- M,
- Ae,
- /*typeArguments*/
- void 0,
- M.template
- ),
- 16
- /* IndirectCall */
- );
- }
- return M;
- }
- function Vt(M) {
- var Ae, dt;
- if (ya(M) & 8192) {
- const U = lO(D);
- return U ? n.createPropertyAccessExpression(U, M) : M;
- } else if (!(jo(M) && !(M.emitNode.autoGenerate.flags & 64)) && !Mh(M)) {
- const U = u.getReferencedExportContainer(M, oO(M));
- if (U && U.kind === 307)
- return lt(
- n.createPropertyAccessExpression(
- n.createIdentifier("exports"),
- n.cloneNode(M)
- ),
- /*location*/
- M
- );
- const be = u.getReferencedImportDeclaration(M);
- if (be) {
- if (Ad(be))
- return lt(
- n.createPropertyAccessExpression(
- n.getGeneratedNameForNode(be.parent),
- n.createIdentifier("default")
- ),
- /*location*/
- M
- );
- if (Zu(be)) {
- const Z = be.propertyName || be.name, ht = n.getGeneratedNameForNode(((dt = (Ae = be.parent) == null ? void 0 : Ae.parent) == null ? void 0 : dt.parent) || be);
- return lt(
- Z.kind === 11 ? n.createElementAccessExpression(ht, n.cloneNode(Z)) : n.createPropertyAccessExpression(ht, n.cloneNode(Z)),
- /*location*/
- M
- );
- }
- }
- }
- return M;
- }
- function Zt(M) {
- if (Ph(M.operatorToken.kind) && Oe(M.left) && (!jo(M.left) || Dw(M.left)) && !Mh(M.left)) {
- const Ae = vn(M.left);
- if (Ae) {
- let dt = M;
- for (const U of Ae)
- I[Ma(dt)] = !0, dt = De(
- U,
- dt,
- /*location*/
- M
- );
- return dt;
- }
- }
- return M;
- }
- function vn(M) {
- if (jo(M)) {
- if (Dw(M)) {
- const Ae = P?.exportSpecifiers.get(M);
- if (Ae) {
- const dt = [];
- for (const U of Ae)
- dt.push(U.name);
- return dt;
- }
- }
- } else {
- const Ae = u.getReferencedImportDeclaration(M);
- if (Ae)
- return P?.exportedBindings[e_(Ae)];
- const dt = /* @__PURE__ */ new Set(), U = u.getReferencedValueDeclarations(M);
- if (U) {
- for (const be of U) {
- const Z = P?.exportedBindings[e_(be)];
- if (Z)
- for (const ht of Z)
- dt.add(ht);
- }
- if (dt.size)
- return as(dt);
- }
- }
- }
- }
- var dRe = {
- name: "typescript:dynamicimport-sync-require",
- scoped: !0,
- text: `
- var __syncRequire = typeof module === "object" && typeof module.exports === "object";`
- };
- function vne(e) {
- const {
- factory: t,
- startLexicalEnvironment: n,
- endLexicalEnvironment: i,
- hoistVariableDeclaration: s
- } = e, o = e.getCompilerOptions(), c = e.getEmitResolver(), _ = e.getEmitHost(), u = e.onSubstituteNode, d = e.onEmitNode;
- e.onSubstituteNode = De, e.onEmitNode = K, e.enableSubstitution(
- 80
- /* Identifier */
- ), e.enableSubstitution(
- 304
- /* ShorthandPropertyAssignment */
- ), e.enableSubstitution(
- 226
- /* BinaryExpression */
- ), e.enableSubstitution(
- 236
- /* MetaProperty */
- ), e.enableEmitNotification(
- 307
- /* SourceFile */
- );
- const g = [], h = [], S = [], T = [];
- let C, D, P, I, F, O, B;
- return Fd(e, z);
- function z(M) {
- if (M.isDeclarationFile || !($T(M, o) || M.transformFlags & 8388608))
- return M;
- const Ae = e_(M);
- C = M, O = M, D = g[Ae] = aW(e, M), P = t.createUniqueName("exports"), h[Ae] = P, I = T[Ae] = t.createUniqueName("context");
- const dt = X(D.externalImports), U = q(M, dt), be = t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- P
- ),
- t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- I
- )
- ],
- /*type*/
- void 0,
- U
- ), Z = lA(t, M, _, o), ht = t.createArrayLiteralExpression(lr(dt, (Ie) => Ie.name)), Le = an(
- t.updateSourceFile(
- M,
- lt(
- t.createNodeArray([
- t.createExpressionStatement(
- t.createCallExpression(
- t.createPropertyAccessExpression(t.createIdentifier("System"), "register"),
- /*typeArguments*/
- void 0,
- Z ? [Z, ht, be] : [ht, be]
- )
- )
- ]),
- M.statements
- )
- ),
- 2048
- /* NoTrailingComments */
- );
- return o.outFile || Pee(Le, U, (Ie) => !Ie.scoped), B && (S[Ae] = B, B = void 0), C = void 0, D = void 0, P = void 0, I = void 0, F = void 0, O = void 0, Le;
- }
- function X(M) {
- const Ae = /* @__PURE__ */ new Map(), dt = [];
- for (const U of M) {
- const be = Rx(t, U, C, _, c, o);
- if (be) {
- const Z = be.text, ht = Ae.get(Z);
- ht !== void 0 ? dt[ht].externalImports.push(U) : (Ae.set(Z, dt.length), dt.push({
- name: be,
- externalImports: [U]
- }));
- }
- }
- return dt;
- }
- function q(M, Ae) {
- const dt = [];
- n();
- const U = cu(o, "alwaysStrict") || il(C), be = t.copyPrologue(M.statements, dt, U, G);
- dt.push(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- "__moduleName",
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createLogicalAnd(
- I,
- t.createPropertyAccessExpression(I, "id")
- )
- )
- ])
- )
- ), Ge(D.externalHelpersImportDeclaration, G, bi);
- const Z = Fr(M.statements, G, bi, be);
- Fn(dt, F), Mg(dt, i());
- const ht = V(dt), Le = M.transformFlags & 2097152 ? t.createModifiersFromModifierFlags(
- 1024
- /* Async */
- ) : void 0, Ie = t.createObjectLiteralExpression(
- [
- t.createPropertyAssignment("setters", ee(ht, Ae)),
- t.createPropertyAssignment(
- "execute",
- t.createFunctionExpression(
- Le,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- /*parameters*/
- [],
- /*type*/
- void 0,
- t.createBlock(
- Z,
- /*multiLine*/
- !0
- )
- )
- )
- ],
- /*multiLine*/
- !0
- );
- return dt.push(t.createReturnStatement(Ie)), t.createBlock(
- dt,
- /*multiLine*/
- !0
- );
- }
- function V(M) {
- if (!D.hasExportStarsToExportValues)
- return;
- if (!ut(D.exportedNames) && D.exportedFunctions.size === 0 && D.exportSpecifiers.size === 0) {
- let be = !1;
- for (const Z of D.externalImports)
- if (Z.kind === 278 && Z.exportClause) {
- be = !0;
- break;
- }
- if (!be) {
- const Z = ae(
- /*localNames*/
- void 0
- );
- return M.push(Z), Z.name;
- }
- }
- const Ae = [];
- if (D.exportedNames)
- for (const be of D.exportedNames)
- ng(be) || Ae.push(
- t.createPropertyAssignment(
- t.createStringLiteralFromNode(be),
- t.createTrue()
- )
- );
- for (const be of D.exportedFunctions)
- Gn(
- be,
- 2048
- /* Default */
- ) || (E.assert(!!be.name), Ae.push(
- t.createPropertyAssignment(
- t.createStringLiteralFromNode(be.name),
- t.createTrue()
- )
- ));
- const dt = t.createUniqueName("exportedNames");
- M.push(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- dt,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createObjectLiteralExpression(
- Ae,
- /*multiLine*/
- !0
- )
- )
- ])
- )
- );
- const U = ae(dt);
- return M.push(U), U.name;
- }
- function ae(M) {
- const Ae = t.createUniqueName("exportStar"), dt = t.createIdentifier("m"), U = t.createIdentifier("n"), be = t.createIdentifier("exports");
- let Z = t.createStrictInequality(U, t.createStringLiteral("default"));
- return M && (Z = t.createLogicalAnd(
- Z,
- t.createLogicalNot(
- t.createCallExpression(
- t.createPropertyAccessExpression(M, "hasOwnProperty"),
- /*typeArguments*/
- void 0,
- [U]
- )
- )
- )), t.createFunctionDeclaration(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- Ae,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- dt
- )],
- /*type*/
- void 0,
- t.createBlock(
- [
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList([
- t.createVariableDeclaration(
- be,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createObjectLiteralExpression([])
- )
- ])
- ),
- t.createForInStatement(
- t.createVariableDeclarationList([
- t.createVariableDeclaration(U)
- ]),
- dt,
- t.createBlock([
- an(
- t.createIfStatement(
- Z,
- t.createExpressionStatement(
- t.createAssignment(
- t.createElementAccessExpression(be, U),
- t.createElementAccessExpression(dt, U)
- )
- )
- ),
- 1
- /* SingleLine */
- )
- ])
- ),
- t.createExpressionStatement(
- t.createCallExpression(
- P,
- /*typeArguments*/
- void 0,
- [be]
- )
- )
- ],
- /*multiLine*/
- !0
- )
- );
- }
- function ee(M, Ae) {
- const dt = [];
- for (const U of Ae) {
- const be = ir(U.externalImports, (Le) => e6(t, Le, C)), Z = be ? t.getGeneratedNameForNode(be) : t.createUniqueName(""), ht = [];
- for (const Le of U.externalImports) {
- const Ie = e6(t, Le, C);
- switch (Le.kind) {
- case 272:
- if (!Le.importClause)
- break;
- case 271:
- E.assert(Ie !== void 0), ht.push(
- t.createExpressionStatement(
- t.createAssignment(Ie, Z)
- )
- ), Gn(
- Le,
- 32
- /* Export */
- ) && ht.push(
- t.createExpressionStatement(
- t.createCallExpression(
- P,
- /*typeArguments*/
- void 0,
- [
- t.createStringLiteral(Nn(Ie)),
- Z
- ]
- )
- )
- );
- break;
- case 278:
- if (E.assert(Ie !== void 0), Le.exportClause)
- if (pp(Le.exportClause)) {
- const At = [];
- for (const Dr of Le.exportClause.elements)
- At.push(
- t.createPropertyAssignment(
- t.createStringLiteral(Fy(Dr.name)),
- t.createElementAccessExpression(
- Z,
- t.createStringLiteral(Fy(Dr.propertyName || Dr.name))
- )
- )
- );
- ht.push(
- t.createExpressionStatement(
- t.createCallExpression(
- P,
- /*typeArguments*/
- void 0,
- [t.createObjectLiteralExpression(
- At,
- /*multiLine*/
- !0
- )]
- )
- )
- );
- } else
- ht.push(
- t.createExpressionStatement(
- t.createCallExpression(
- P,
- /*typeArguments*/
- void 0,
- [
- t.createStringLiteral(Fy(Le.exportClause.name)),
- Z
- ]
- )
- )
- );
- else
- ht.push(
- t.createExpressionStatement(
- t.createCallExpression(
- M,
- /*typeArguments*/
- void 0,
- [Z]
- )
- )
- );
- break;
- }
- }
- dt.push(
- t.createFunctionExpression(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- /*name*/
- void 0,
- /*typeParameters*/
- void 0,
- [t.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- Z
- )],
- /*type*/
- void 0,
- t.createBlock(
- ht,
- /*multiLine*/
- !0
- )
- )
- );
- }
- return t.createArrayLiteralExpression(
- dt,
- /*multiLine*/
- !0
- );
- }
- function G(M) {
- switch (M.kind) {
- case 272:
- return ue(M);
- case 271:
- return ne(M);
- case 278:
- return re(M);
- case 277:
- return ie(M);
- default:
- return _r(M);
- }
- }
- function ue(M) {
- let Ae;
- return M.importClause && s(e6(t, M, C)), Ym(Te(Ae, M));
- }
- function re(M) {
- E.assertIsDefined(M);
- }
- function ne(M) {
- E.assert(Z1(M), "import= for internal module references should be handled in an earlier transformer.");
- let Ae;
- return s(e6(t, M, C)), Ym(we(Ae, M));
- }
- function ie(M) {
- if (M.isExportEquals)
- return;
- const Ae = Ge(M.expression, qn, _t);
- return ft(
- t.createIdentifier("default"),
- Ae,
- /*allowComments*/
- !0
- );
- }
- function Se(M) {
- Gn(
- M,
- 32
- /* Export */
- ) ? F = wr(
- F,
- t.updateFunctionDeclaration(
- M,
- Fr(M.modifiers, ze, Bo),
- M.asteriskToken,
- t.getDeclarationName(
- M,
- /*allowComments*/
- !0,
- /*allowSourceMaps*/
- !0
- ),
- /*typeParameters*/
- void 0,
- Fr(M.parameters, qn, Ii),
- /*type*/
- void 0,
- Ge(M.body, qn, Cs)
- )
- ) : F = wr(F, br(M, qn, e)), F = Qe(F, M);
- }
- function J(M) {
- let Ae;
- const dt = t.getLocalName(M);
- return s(dt), Ae = wr(
- Ae,
- lt(
- t.createExpressionStatement(
- t.createAssignment(
- dt,
- lt(
- t.createClassExpression(
- Fr(M.modifiers, ze, Bo),
- M.name,
- /*typeParameters*/
- void 0,
- Fr(M.heritageClauses, qn, ef),
- Fr(M.members, qn, _l)
- ),
- M
- )
- )
- ),
- M
- )
- ), Ae = Qe(Ae, M), Ym(Ae);
- }
- function oe(M) {
- if (!he(M.declarationList))
- return Ge(M, qn, bi);
- let Ae;
- if (Hw(M.declarationList) || qw(M.declarationList)) {
- const dt = Fr(M.modifiers, ze, Bo), U = [];
- for (const Z of M.declarationList.declarations)
- U.push(t.updateVariableDeclaration(
- Z,
- t.getGeneratedNameForNode(Z.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- le(
- Z,
- /*isExportedDeclaration*/
- !1
- )
- ));
- const be = t.updateVariableDeclarationList(
- M.declarationList,
- U
- );
- Ae = wr(Ae, t.updateVariableStatement(M, dt, be));
- } else {
- let dt;
- const U = Gn(
- M,
- 32
- /* Export */
- );
- for (const be of M.declarationList.declarations)
- be.initializer ? dt = wr(dt, le(be, U)) : _e(be);
- dt && (Ae = wr(Ae, lt(t.createExpressionStatement(t.inlineExpressions(dt)), M)));
- }
- return Ae = fe(
- Ae,
- M,
- /*exportSelf*/
- !1
- ), Ym(Ae);
- }
- function _e(M) {
- if (As(M.name))
- for (const Ae of M.name.elements)
- ml(Ae) || _e(Ae);
- else
- s(t.cloneNode(M.name));
- }
- function he(M) {
- return (ya(M) & 4194304) === 0 && (O.kind === 307 || (Ho(M).flags & 7) === 0);
- }
- function le(M, Ae) {
- const dt = Ae ? me : ve;
- return As(M.name) ? DS(
- M,
- qn,
- e,
- 0,
- /*needsValue*/
- !1,
- dt
- ) : M.initializer ? dt(M.name, Ge(M.initializer, qn, _t)) : M.name;
- }
- function me(M, Ae, dt) {
- return tt(
- M,
- Ae,
- dt,
- /*isExportedDeclaration*/
- !0
- );
- }
- function ve(M, Ae, dt) {
- return tt(
- M,
- Ae,
- dt,
- /*isExportedDeclaration*/
- !1
- );
- }
- function tt(M, Ae, dt, U) {
- return s(t.cloneNode(M)), U ? Wt(M, Zt(lt(t.createAssignment(M, Ae), dt))) : Zt(lt(t.createAssignment(M, Ae), dt));
- }
- function Te(M, Ae) {
- if (D.exportEquals)
- return M;
- const dt = Ae.importClause;
- if (!dt)
- return M;
- dt.name && (M = et(M, dt));
- const U = dt.namedBindings;
- if (U)
- switch (U.kind) {
- case 274:
- M = et(M, U);
- break;
- case 275:
- for (const be of U.elements)
- M = et(M, be);
- break;
- }
- return M;
- }
- function we(M, Ae) {
- return D.exportEquals ? M : et(M, Ae);
- }
- function fe(M, Ae, dt) {
- if (D.exportEquals)
- return M;
- for (const U of Ae.declarationList.declarations)
- (U.initializer || dt) && (M = Me(M, U));
- return M;
- }
- function Me(M, Ae, dt) {
- if (D.exportEquals)
- return M;
- if (As(Ae.name))
- for (const U of Ae.name.elements)
- ml(U) || (M = Me(M, U));
- else jo(Ae.name) || (M = et(M, Ae, void 0));
- return M;
- }
- function Qe(M, Ae) {
- if (D.exportEquals)
- return M;
- let dt;
- if (Gn(
- Ae,
- 32
- /* Export */
- )) {
- const U = Gn(
- Ae,
- 2048
- /* Default */
- ) ? t.createStringLiteral("default") : Ae.name;
- M = Re(M, U, t.getLocalName(Ae)), dt = Jp(U);
- }
- return Ae.name && (M = et(M, Ae, dt)), M;
- }
- function et(M, Ae, dt) {
- if (D.exportEquals)
- return M;
- const U = t.getDeclarationName(Ae), be = D.exportSpecifiers.get(U);
- if (be)
- for (const Z of be)
- Fy(Z.name) !== dt && (M = Re(M, Z.name, U));
- return M;
- }
- function Re(M, Ae, dt, U) {
- return M = wr(M, ft(Ae, dt, U)), M;
- }
- function ft(M, Ae, dt) {
- const U = t.createExpressionStatement(Wt(M, Ae));
- return bu(U), dt || an(
- U,
- 3072
- /* NoComments */
- ), U;
- }
- function Wt(M, Ae) {
- const dt = Oe(M) ? t.createStringLiteralFromNode(M) : M;
- return an(
- Ae,
- ya(Ae) | 3072
- /* NoComments */
- ), nl(t.createCallExpression(
- P,
- /*typeArguments*/
- void 0,
- [dt, Ae]
- ), Ae);
- }
- function _r(M) {
- switch (M.kind) {
- case 243:
- return oe(M);
- case 262:
- return Se(M);
- case 263:
- return J(M);
- case 248:
- return Ir(
- M,
- /*isTopLevel*/
- !0
- );
- case 249:
- return jr(M);
- case 250:
- return Nt(M);
- case 246:
- return xr(M);
- case 247:
- return zn(M);
- case 256:
- return ki(M);
- case 254:
- return rs(M);
- case 245:
- return ei(M);
- case 255:
- return Ri(M);
- case 269:
- return Jr(M);
- case 296:
- return ji(M);
- case 297:
- return Fe(M);
- case 258:
- return Ot(M);
- case 299:
- return Ar(M);
- case 241:
- return mn(M);
- default:
- return qn(M);
- }
- }
- function Ir(M, Ae) {
- const dt = O;
- return O = M, M = t.updateForStatement(
- M,
- Ge(M.initializer, Ae ? Br : Oi, ip),
- Ge(M.condition, qn, _t),
- Ge(M.incrementor, Oi, _t),
- Ku(M.statement, Ae ? _r : qn, e)
- ), O = dt, M;
- }
- function jr(M) {
- const Ae = O;
- return O = M, M = t.updateForInStatement(
- M,
- Br(M.initializer),
- Ge(M.expression, qn, _t),
- Ku(M.statement, _r, e)
- ), O = Ae, M;
- }
- function Nt(M) {
- const Ae = O;
- return O = M, M = t.updateForOfStatement(
- M,
- M.awaitModifier,
- Br(M.initializer),
- Ge(M.expression, qn, _t),
- Ku(M.statement, _r, e)
- ), O = Ae, M;
- }
- function Qt(M) {
- return Fl(M) && he(M);
- }
- function Br(M) {
- if (Qt(M)) {
- let Ae;
- for (const dt of M.declarations)
- Ae = wr(Ae, le(
- dt,
- /*isExportedDeclaration*/
- !1
- )), dt.initializer || _e(dt);
- return Ae ? t.inlineExpressions(Ae) : t.createOmittedExpression();
- } else
- return Ge(M, Oi, ip);
- }
- function xr(M) {
- return t.updateDoStatement(
- M,
- Ku(M.statement, _r, e),
- Ge(M.expression, qn, _t)
- );
- }
- function zn(M) {
- return t.updateWhileStatement(
- M,
- Ge(M.expression, qn, _t),
- Ku(M.statement, _r, e)
- );
- }
- function ki(M) {
- return t.updateLabeledStatement(
- M,
- M.label,
- Ge(M.statement, _r, bi, t.liftToBlock) ?? t.createExpressionStatement(t.createIdentifier(""))
- );
- }
- function rs(M) {
- return t.updateWithStatement(
- M,
- Ge(M.expression, qn, _t),
- E.checkDefined(Ge(M.statement, _r, bi, t.liftToBlock))
- );
- }
- function ei(M) {
- return t.updateIfStatement(
- M,
- Ge(M.expression, qn, _t),
- Ge(M.thenStatement, _r, bi, t.liftToBlock) ?? t.createBlock([]),
- Ge(M.elseStatement, _r, bi, t.liftToBlock)
- );
- }
- function Ri(M) {
- return t.updateSwitchStatement(
- M,
- Ge(M.expression, qn, _t),
- E.checkDefined(Ge(M.caseBlock, _r, cD))
- );
- }
- function Jr(M) {
- const Ae = O;
- return O = M, M = t.updateCaseBlock(
- M,
- Fr(M.clauses, _r, XI)
- ), O = Ae, M;
- }
- function ji(M) {
- return t.updateCaseClause(
- M,
- Ge(M.expression, qn, _t),
- Fr(M.statements, _r, bi)
- );
- }
- function Fe(M) {
- return br(M, _r, e);
- }
- function Ot(M) {
- return br(M, _r, e);
- }
- function Ar(M) {
- const Ae = O;
- return O = M, M = t.updateCatchClause(
- M,
- M.variableDeclaration,
- E.checkDefined(Ge(M.block, _r, Cs))
- ), O = Ae, M;
- }
- function mn(M) {
- const Ae = O;
- return O = M, M = br(M, _r, e), O = Ae, M;
- }
- function ti(M, Ae) {
- if (!(M.transformFlags & 276828160))
- return M;
- switch (M.kind) {
- case 248:
- return Ir(
- M,
- /*isTopLevel*/
- !1
- );
- case 244:
- return Ws(M);
- case 217:
- return Hs(M, Ae);
- case 354:
- return rr(M, Ae);
- case 226:
- if (x0(M))
- return Xe(M, Ae);
- break;
- case 213:
- if (hf(M))
- return Ea(M);
- break;
- case 224:
- case 225:
- return te(M, Ae);
- }
- return br(M, qn, e);
- }
- function qn(M) {
- return ti(
- M,
- /*valueIsDiscarded*/
- !1
- );
- }
- function Oi(M) {
- return ti(
- M,
- /*valueIsDiscarded*/
- !0
- );
- }
- function Ws(M) {
- return t.updateExpressionStatement(M, Ge(M.expression, Oi, _t));
- }
- function Hs(M, Ae) {
- return t.updateParenthesizedExpression(M, Ge(M.expression, Ae ? Oi : qn, _t));
- }
- function rr(M, Ae) {
- return t.updatePartiallyEmittedExpression(M, Ge(M.expression, Ae ? Oi : qn, _t));
- }
- function Ea(M) {
- const Ae = Rx(t, M, C, _, c, o), dt = Ge(el(M.arguments), qn, _t), U = Ae && (!dt || !oa(dt) || dt.text !== Ae.text) ? Ae : dt;
- return t.createCallExpression(
- t.createPropertyAccessExpression(
- I,
- t.createIdentifier("import")
- ),
- /*typeArguments*/
- void 0,
- U ? [U] : []
- );
- }
- function Xe(M, Ae) {
- return Tt(M.left) ? DS(
- M,
- qn,
- e,
- 0,
- !Ae
- ) : br(M, qn, e);
- }
- function Tt(M) {
- if (Dl(
- M,
- /*excludeCompoundAssignment*/
- !0
- ))
- return Tt(M.left);
- if (fp(M))
- return Tt(M.expression);
- if (Ks(M))
- return ut(M.properties, Tt);
- if ($l(M))
- return ut(M.elements, Tt);
- if (uu(M))
- return Tt(M.name);
- if (Qc(M))
- return Tt(M.initializer);
- if (Oe(M)) {
- const Ae = c.getReferencedExportContainer(M);
- return Ae !== void 0 && Ae.kind === 307;
- } else
- return !1;
- }
- function te(M, Ae) {
- if ((M.operator === 46 || M.operator === 47) && Oe(M.operand) && !jo(M.operand) && !Mh(M.operand) && !WB(M.operand)) {
- const dt = He(M.operand);
- if (dt) {
- let U, be = Ge(M.operand, qn, _t);
- uv(M) ? be = t.updatePrefixUnaryExpression(M, be) : (be = t.updatePostfixUnaryExpression(M, be), Ae || (U = t.createTempVariable(s), be = t.createAssignment(U, be), lt(be, M)), be = t.createComma(be, t.cloneNode(M.operand)), lt(be, M));
- for (const Z of dt)
- be = Wt(Z, Zt(be));
- return U && (be = t.createComma(be, U), lt(be, M)), be;
- }
- }
- return br(M, qn, e);
- }
- function ze(M) {
- switch (M.kind) {
- case 95:
- case 90:
- return;
- }
- return M;
- }
- function K(M, Ae, dt) {
- if (Ae.kind === 307) {
- const U = e_(Ae);
- C = Ae, D = g[U], P = h[U], B = S[U], I = T[U], B && delete S[U], d(M, Ae, dt), C = void 0, D = void 0, P = void 0, I = void 0, B = void 0;
- } else
- d(M, Ae, dt);
- }
- function De(M, Ae) {
- return Ae = u(M, Ae), vn(Ae) ? Ae : M === 1 ? xe(Ae) : M === 4 ? Ve(Ae) : Ae;
- }
- function Ve(M) {
- switch (M.kind) {
- case 304:
- return Ke(M);
- }
- return M;
- }
- function Ke(M) {
- var Ae, dt;
- const U = M.name;
- if (!jo(U) && !Mh(U)) {
- const be = c.getReferencedImportDeclaration(U);
- if (be) {
- if (Ad(be))
- return lt(
- t.createPropertyAssignment(
- t.cloneNode(U),
- t.createPropertyAccessExpression(
- t.getGeneratedNameForNode(be.parent),
- t.createIdentifier("default")
- )
- ),
- /*location*/
- M
- );
- if (Zu(be)) {
- const Z = be.propertyName || be.name, ht = t.getGeneratedNameForNode(((dt = (Ae = be.parent) == null ? void 0 : Ae.parent) == null ? void 0 : dt.parent) || be);
- return lt(
- t.createPropertyAssignment(
- t.cloneNode(U),
- Z.kind === 11 ? t.createElementAccessExpression(ht, t.cloneNode(Z)) : t.createPropertyAccessExpression(ht, t.cloneNode(Z))
- ),
- /*location*/
- M
- );
- }
- }
- }
- return M;
- }
- function xe(M) {
- switch (M.kind) {
- case 80:
- return at(M);
- case 226:
- return $e(M);
- case 236:
- return bt(M);
- }
- return M;
- }
- function at(M) {
- var Ae, dt;
- if (ya(M) & 8192) {
- const U = lO(C);
- return U ? t.createPropertyAccessExpression(U, M) : M;
- }
- if (!jo(M) && !Mh(M)) {
- const U = c.getReferencedImportDeclaration(M);
- if (U) {
- if (Ad(U))
- return lt(
- t.createPropertyAccessExpression(
- t.getGeneratedNameForNode(U.parent),
- t.createIdentifier("default")
- ),
- /*location*/
- M
- );
- if (Zu(U)) {
- const be = U.propertyName || U.name, Z = t.getGeneratedNameForNode(((dt = (Ae = U.parent) == null ? void 0 : Ae.parent) == null ? void 0 : dt.parent) || U);
- return lt(
- be.kind === 11 ? t.createElementAccessExpression(Z, t.cloneNode(be)) : t.createPropertyAccessExpression(Z, t.cloneNode(be)),
- /*location*/
- M
- );
- }
- }
- }
- return M;
- }
- function $e(M) {
- if (Ph(M.operatorToken.kind) && Oe(M.left) && (!jo(M.left) || Dw(M.left)) && !Mh(M.left)) {
- const Ae = He(M.left);
- if (Ae) {
- let dt = M;
- for (const U of Ae)
- dt = Wt(U, Zt(dt));
- return dt;
- }
- }
- return M;
- }
- function bt(M) {
- return yC(M) ? t.createPropertyAccessExpression(I, t.createIdentifier("meta")) : M;
- }
- function He(M) {
- let Ae;
- const dt = Vt(M);
- if (dt) {
- const U = c.getReferencedExportContainer(
- M,
- /*prefixLocals*/
- !1
- );
- U && U.kind === 307 && (Ae = wr(Ae, t.getDeclarationName(dt))), Ae = Fn(Ae, D?.exportedBindings[e_(dt)]);
- } else if (jo(M) && Dw(M)) {
- const U = D?.exportSpecifiers.get(M);
- if (U) {
- const be = [];
- for (const Z of U)
- be.push(Z.name);
- return be;
- }
- }
- return Ae;
- }
- function Vt(M) {
- if (!jo(M)) {
- const Ae = c.getReferencedImportDeclaration(M);
- if (Ae) return Ae;
- const dt = c.getReferencedValueDeclaration(M);
- if (dt && D?.exportedBindings[e_(dt)]) return dt;
- const U = c.getReferencedValueDeclarations(M);
- if (U) {
- for (const be of U)
- if (be !== dt && D?.exportedBindings[e_(be)]) return be;
- }
- return dt;
- }
- }
- function Zt(M) {
- return B === void 0 && (B = []), B[Ma(M)] = !0, M;
- }
- function vn(M) {
- return B && M.id && B[M.id];
- }
- }
- function mW(e) {
- const {
- factory: t,
- getEmitHelperFactory: n
- } = e, i = e.getEmitHost(), s = e.getEmitResolver(), o = e.getCompilerOptions(), c = pa(o), _ = e.onEmitNode, u = e.onSubstituteNode;
- e.onEmitNode = B, e.onSubstituteNode = z, e.enableEmitNotification(
- 307
- /* SourceFile */
- ), e.enableSubstitution(
- 80
- /* Identifier */
- );
- let d, g, h;
- return Fd(e, S);
- function S(q) {
- if (q.isDeclarationFile)
- return q;
- if (il(q) || Wp(o)) {
- g = q, h = void 0;
- let V = T(q);
- return g = void 0, h && (V = t.updateSourceFile(
- V,
- lt(t.createNodeArray(Mj(V.statements.slice(), h)), V.statements)
- )), !il(q) || Ru(o) === 200 || ut(V.statements, Ow) ? V : t.updateSourceFile(
- V,
- lt(t.createNodeArray([...V.statements, aA(t)]), V.statements)
- );
- }
- return q;
- }
- function T(q) {
- const V = ez(t, n(), q, o);
- if (V) {
- const ae = [], ee = t.copyPrologue(q.statements, ae);
- return wr(ae, V), Fn(ae, Fr(q.statements, C, bi, ee)), t.updateSourceFile(
- q,
- lt(t.createNodeArray(ae), q.statements)
- );
- } else
- return br(q, C, e);
- }
- function C(q) {
- switch (q.kind) {
- case 271:
- return Ru(o) >= 100 ? P(q) : void 0;
- case 277:
- return F(q);
- case 278:
- return O(q);
- }
- return q;
- }
- function D(q) {
- const V = Rx(t, q, E.checkDefined(g), i, s, o), ae = [];
- if (V && ae.push(V), Ru(o) === 200)
- return t.createCallExpression(
- t.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- ae
- );
- if (!h) {
- const G = t.createUniqueName(
- "_createRequire",
- 48
- /* FileLevel */
- ), ue = t.createImportDeclaration(
- /*modifiers*/
- void 0,
- t.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- t.createNamedImports([
- t.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- t.createIdentifier("createRequire"),
- G
- )
- ])
- ),
- t.createStringLiteral("module"),
- /*attributes*/
- void 0
- ), re = t.createUniqueName(
- "__require",
- 48
- /* FileLevel */
- ), ne = t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- re,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- t.createCallExpression(
- t.cloneNode(G),
- /*typeArguments*/
- void 0,
- [
- t.createPropertyAccessExpression(t.createMetaProperty(102, t.createIdentifier("meta")), t.createIdentifier("url"))
- ]
- )
- )
- ],
- /*flags*/
- c >= 2 ? 2 : 0
- /* None */
- )
- );
- h = [ue, ne];
- }
- const ee = h[1].declarationList.declarations[0].name;
- return E.assertNode(ee, Oe), t.createCallExpression(
- t.cloneNode(ee),
- /*typeArguments*/
- void 0,
- ae
- );
- }
- function P(q) {
- E.assert(Z1(q), "import= for internal module references should be handled in an earlier transformer.");
- let V;
- return V = wr(
- V,
- kn(
- lt(
- t.createVariableStatement(
- /*modifiers*/
- void 0,
- t.createVariableDeclarationList(
- [
- t.createVariableDeclaration(
- t.cloneNode(q.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- D(q)
- )
- ],
- /*flags*/
- c >= 2 ? 2 : 0
- /* None */
- )
- ),
- q
- ),
- q
- )
- ), V = I(V, q), Ym(V);
- }
- function I(q, V) {
- return Gn(
- V,
- 32
- /* Export */
- ) && (q = wr(
- q,
- t.createExportDeclaration(
- /*modifiers*/
- void 0,
- V.isTypeOnly,
- t.createNamedExports([t.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- /*propertyName*/
- void 0,
- Nn(V.name)
- )])
- )
- )), q;
- }
- function F(q) {
- return q.isExportEquals ? Ru(o) === 200 ? kn(
- t.createExpressionStatement(
- t.createAssignment(
- t.createPropertyAccessExpression(
- t.createIdentifier("module"),
- "exports"
- ),
- q.expression
- )
- ),
- q
- ) : void 0 : q;
- }
- function O(q) {
- if (o.module !== void 0 && o.module > 5 || !q.exportClause || !ug(q.exportClause) || !q.moduleSpecifier)
- return q;
- const V = q.exportClause.name, ae = t.getGeneratedNameForNode(V), ee = t.createImportDeclaration(
- /*modifiers*/
- void 0,
- t.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- t.createNamespaceImport(
- ae
- )
- ),
- q.moduleSpecifier,
- q.attributes
- );
- kn(ee, q.exportClause);
- const G = c7(q) ? t.createExportDefault(ae) : t.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- t.createNamedExports([t.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- ae,
- V
- )])
- );
- return kn(G, q), [ee, G];
- }
- function B(q, V, ae) {
- Si(V) ? ((il(V) || Wp(o)) && o.importHelpers && (d = /* @__PURE__ */ new Map()), _(q, V, ae), d = void 0) : _(q, V, ae);
- }
- function z(q, V) {
- return V = u(q, V), d && Oe(V) && ya(V) & 8192 ? X(V) : V;
- }
- function X(q) {
- const V = Nn(q);
- let ae = d.get(V);
- return ae || d.set(V, ae = t.createUniqueName(
- V,
- 48
- /* FileLevel */
- )), ae;
- }
- }
- function bne(e) {
- const t = e.onSubstituteNode, n = e.onEmitNode, i = mW(e), s = e.onSubstituteNode, o = e.onEmitNode;
- e.onSubstituteNode = t, e.onEmitNode = n;
- const c = dW(e), _ = e.onSubstituteNode, u = e.onEmitNode, d = (I) => e.getEmitHost().getEmitModuleFormatOfFile(I);
- e.onSubstituteNode = h, e.onEmitNode = S, e.enableSubstitution(
- 307
- /* SourceFile */
- ), e.enableEmitNotification(
- 307
- /* SourceFile */
- );
- let g;
- return D;
- function h(I, F) {
- return Si(F) ? (g = F, t(I, F)) : g ? d(g) >= 5 ? s(I, F) : _(I, F) : t(I, F);
- }
- function S(I, F, O) {
- return Si(F) && (g = F), g ? d(g) >= 5 ? o(I, F, O) : u(I, F, O) : n(I, F, O);
- }
- function T(I) {
- return d(I) >= 5 ? i : c;
- }
- function C(I) {
- if (I.isDeclarationFile)
- return I;
- g = I;
- const F = T(I)(I);
- return g = void 0, E.assert(Si(F)), F;
- }
- function D(I) {
- return I.kind === 307 ? C(I) : P(I);
- }
- function P(I) {
- return e.factory.createBundle(lr(I.sourceFiles, C));
- }
- }
- function eF(e) {
- return ii(e) || cs(e) || m_(e) || va(e) || om(e) || d0(e) || tA(e) || Dx(e) || hc(e) || vm(e) || Ec(e) || Ii(e) || zo(e) || Oh(e) || gl(e) || Vp(e) || Qo(e) || Fb(e) || Cn(e) || ko(e) || dn(e) || Bp(e);
- }
- function Sne(e) {
- if (om(e) || d0(e))
- return t;
- return vm(e) || hc(e) ? i : I0(e);
- function t(o) {
- const c = n(o);
- return c !== void 0 ? {
- diagnosticMessage: c,
- errorNode: e,
- typeName: e.name
- } : void 0;
- }
- function n(o) {
- return zs(e) ? o.errorModuleName ? o.accessibility === 2 ? p.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 : e.parent.kind === 263 ? o.errorModuleName ? o.accessibility === 2 ? p.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_property_0_of_exported_class_has_or_is_using_private_name_1 : o.errorModuleName ? p.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Property_0_of_exported_interface_has_or_is_using_private_name_1;
- }
- function i(o) {
- const c = s(o);
- return c !== void 0 ? {
- diagnosticMessage: c,
- errorNode: e,
- typeName: e.name
- } : void 0;
- }
- function s(o) {
- return zs(e) ? o.errorModuleName ? o.accessibility === 2 ? p.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1 : e.parent.kind === 263 ? o.errorModuleName ? o.accessibility === 2 ? p.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_method_0_of_exported_class_has_or_is_using_private_name_1 : o.errorModuleName ? p.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Method_0_of_exported_interface_has_or_is_using_private_name_1;
- }
- }
- function I0(e) {
- if (ii(e) || cs(e) || m_(e) || Cn(e) || ko(e) || dn(e) || va(e) || Qo(e))
- return n;
- return om(e) || d0(e) ? i : tA(e) || Dx(e) || hc(e) || vm(e) || Ec(e) || Fb(e) ? s : Ii(e) ? G_(e, e.parent) && Gn(
- e.parent,
- 2
- /* Private */
- ) ? n : o : zo(e) ? _ : Oh(e) ? u : gl(e) ? d : Vp(e) || Bp(e) ? g : E.assertNever(e, `Attempted to set a declaration diagnostic context for unhandled node kind: ${E.formatSyntaxKind(e.kind)}`);
- function t(h) {
- if (e.kind === 260 || e.kind === 208)
- return h.errorModuleName ? h.accessibility === 2 ? p.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : p.Exported_variable_0_has_or_is_using_private_name_1;
- if (e.kind === 172 || e.kind === 211 || e.kind === 212 || e.kind === 226 || e.kind === 171 || e.kind === 169 && Gn(
- e.parent,
- 2
- /* Private */
- ))
- return zs(e) ? h.errorModuleName ? h.accessibility === 2 ? p.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 : e.parent.kind === 263 || e.kind === 169 ? h.errorModuleName ? h.accessibility === 2 ? p.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Public_property_0_of_exported_class_has_or_is_using_private_name_1 : h.errorModuleName ? p.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Property_0_of_exported_interface_has_or_is_using_private_name_1;
- }
- function n(h) {
- const S = t(h);
- return S !== void 0 ? {
- diagnosticMessage: S,
- errorNode: e,
- typeName: e.name
- } : void 0;
- }
- function i(h) {
- let S;
- return e.kind === 178 ? zs(e) ? S = h.errorModuleName ? p.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1 : S = h.errorModuleName ? p.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1 : zs(e) ? S = h.errorModuleName ? h.accessibility === 2 ? p.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1 : S = h.errorModuleName ? h.accessibility === 2 ? p.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1, {
- diagnosticMessage: S,
- errorNode: e.name,
- typeName: e.name
- };
- }
- function s(h) {
- let S;
- switch (e.kind) {
- case 180:
- S = h.errorModuleName ? p.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;
- break;
- case 179:
- S = h.errorModuleName ? p.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;
- break;
- case 181:
- S = h.errorModuleName ? p.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;
- break;
- case 174:
- case 173:
- zs(e) ? S = h.errorModuleName ? h.accessibility === 2 ? p.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : p.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0 : e.parent.kind === 263 ? S = h.errorModuleName ? h.accessibility === 2 ? p.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : p.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0 : S = h.errorModuleName ? p.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
- break;
- case 262:
- S = h.errorModuleName ? h.accessibility === 2 ? p.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : p.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : p.Return_type_of_exported_function_has_or_is_using_private_name_0;
- break;
- default:
- return E.fail("This is unknown kind for signature: " + e.kind);
- }
- return {
- diagnosticMessage: S,
- errorNode: e.name || e
- };
- }
- function o(h) {
- const S = c(h);
- return S !== void 0 ? {
- diagnosticMessage: S,
- errorNode: e,
- typeName: e.name
- } : void 0;
- }
- function c(h) {
- switch (e.parent.kind) {
- case 176:
- return h.errorModuleName ? h.accessibility === 2 ? p.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;
- case 180:
- case 185:
- return h.errorModuleName ? p.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 179:
- return h.errorModuleName ? p.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 181:
- return h.errorModuleName ? p.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;
- case 174:
- case 173:
- return zs(e.parent) ? h.errorModuleName ? h.accessibility === 2 ? p.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 : e.parent.parent.kind === 263 ? h.errorModuleName ? h.accessibility === 2 ? p.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 : h.errorModuleName ? p.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
- case 262:
- case 184:
- return h.errorModuleName ? h.accessibility === 2 ? p.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_exported_function_has_or_is_using_private_name_1;
- case 178:
- case 177:
- return h.errorModuleName ? h.accessibility === 2 ? p.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : p.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : p.Parameter_0_of_accessor_has_or_is_using_private_name_1;
- default:
- return E.fail(`Unknown parent for parameter: ${E.formatSyntaxKind(e.parent.kind)}`);
- }
- }
- function _() {
- let h;
- switch (e.parent.kind) {
- case 263:
- h = p.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
- break;
- case 264:
- h = p.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
- break;
- case 200:
- h = p.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;
- break;
- case 185:
- case 180:
- h = p.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
- break;
- case 179:
- h = p.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
- break;
- case 174:
- case 173:
- zs(e.parent) ? h = p.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 : e.parent.parent.kind === 263 ? h = p.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 : h = p.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;
- break;
- case 184:
- case 262:
- h = p.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
- break;
- case 195:
- h = p.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
- break;
- case 265:
- h = p.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
- break;
- default:
- return E.fail("This is unknown parent for type parameter: " + e.parent.kind);
- }
- return {
- diagnosticMessage: h,
- errorNode: e,
- typeName: e.name
- };
- }
- function u() {
- let h;
- return Xc(e.parent.parent) ? h = ef(e.parent) && e.parent.token === 119 ? p.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : e.parent.parent.name ? p.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 : p.extends_clause_of_exported_class_has_or_is_using_private_name_0 : h = p.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1, {
- diagnosticMessage: h,
- errorNode: e,
- typeName: os(e.parent.parent)
- };
- }
- function d() {
- return {
- diagnosticMessage: p.Import_declaration_0_is_using_private_name_1,
- errorNode: e,
- typeName: e.name
- };
- }
- function g(h) {
- return {
- diagnosticMessage: h.errorModuleName ? p.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 : p.Exported_type_alias_0_has_or_is_using_private_name_1,
- errorNode: Bp(e) ? E.checkDefined(e.typeExpression) : e.type,
- typeName: Bp(e) ? os(e) : e.name
- };
- }
- }
- function Tne(e) {
- const t = {
- 219: p.Add_a_return_type_to_the_function_expression,
- 218: p.Add_a_return_type_to_the_function_expression,
- 174: p.Add_a_return_type_to_the_method,
- 177: p.Add_a_return_type_to_the_get_accessor_declaration,
- 178: p.Add_a_type_to_parameter_of_the_set_accessor_declaration,
- 262: p.Add_a_return_type_to_the_function_declaration,
- 180: p.Add_a_return_type_to_the_function_declaration,
- 169: p.Add_a_type_annotation_to_the_parameter_0,
- 260: p.Add_a_type_annotation_to_the_variable_0,
- 172: p.Add_a_type_annotation_to_the_property_0,
- 171: p.Add_a_type_annotation_to_the_property_0,
- 277: p.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it
- }, n = {
- 218: p.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 262: p.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 219: p.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 174: p.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 180: p.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 177: p.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 178: p.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
- 169: p.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
- 260: p.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
- 172: p.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
- 171: p.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
- 167: p.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations,
- 305: p.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations,
- 304: p.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations,
- 209: p.Only_const_arrays_can_be_inferred_with_isolatedDeclarations,
- 277: p.Default_exports_can_t_be_inferred_with_isolatedDeclarations,
- 230: p.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations
- };
- return i;
- function i(P) {
- if (or(P, ef))
- return Kr(P, p.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations);
- if ((um(P) || Lb(P.parent)) && (l_(P) || yo(P)))
- return C(P);
- switch (E.type(P), P.kind) {
- case 177:
- case 178:
- return o(P);
- case 167:
- case 304:
- case 305:
- return _(P);
- case 209:
- case 230:
- return u(P);
- case 174:
- case 180:
- case 218:
- case 219:
- case 262:
- return d(P);
- case 208:
- return g(P);
- case 172:
- case 260:
- return h(P);
- case 169:
- return S(P);
- case 303:
- return D(P.initializer);
- case 231:
- return T(P);
- default:
- return D(P);
- }
- }
- function s(P) {
- const I = or(P, (F) => wo(F) || bi(F) || ii(F) || cs(F) || Ii(F));
- if (I)
- return wo(I) ? I : Up(I) ? or(I, (F) => no(F) && !Qo(F)) : bi(I) ? void 0 : I;
- }
- function o(P) {
- const { getAccessor: I, setAccessor: F } = My(P.symbol.declarations, P), O = (om(P) ? P.parameters[0] : P) ?? P, B = Kr(O, n[P.kind]);
- return F && Rs(B, Kr(F, t[F.kind])), I && Rs(B, Kr(I, t[I.kind])), B;
- }
- function c(P, I) {
- const F = s(P);
- if (F) {
- const O = wo(F) || !F.name ? "" : nc(
- F.name,
- /*includeTrivia*/
- !1
- );
- Rs(I, Kr(F, t[F.kind], O));
- }
- return I;
- }
- function _(P) {
- const I = Kr(P, n[P.kind]);
- return c(P, I), I;
- }
- function u(P) {
- const I = Kr(P, n[P.kind]);
- return c(P, I), I;
- }
- function d(P) {
- const I = Kr(P, n[P.kind]);
- return c(P, I), Rs(I, Kr(P, t[P.kind])), I;
- }
- function g(P) {
- return Kr(P, p.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations);
- }
- function h(P) {
- const I = Kr(P, n[P.kind]), F = nc(
- P.name,
- /*includeTrivia*/
- !1
- );
- return Rs(I, Kr(P, t[P.kind], F)), I;
- }
- function S(P) {
- if (om(P.parent))
- return o(P.parent);
- const I = e.requiresAddingImplicitUndefined(
- P,
- /*enclosingDeclaration*/
- void 0
- );
- if (!I && P.initializer)
- return D(P.initializer);
- const F = I ? p.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations : n[P.kind], O = Kr(P, F), B = nc(
- P.name,
- /*includeTrivia*/
- !1
- );
- return Rs(O, Kr(P, t[P.kind], B)), O;
- }
- function T(P) {
- return D(P, p.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations);
- }
- function C(P) {
- const I = Kr(P, p.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations, nc(
- P,
- /*includeTrivia*/
- !1
- ));
- return c(P, I), I;
- }
- function D(P, I) {
- const F = s(P);
- let O;
- if (F) {
- const B = wo(F) || !F.name ? "" : nc(
- F.name,
- /*includeTrivia*/
- !1
- ), z = or(P.parent, (X) => wo(X) || (bi(X) ? "quit" : !Yu(X) && !OJ(X) && !iD(X)));
- F === z ? (O = Kr(P, I ?? n[F.kind]), Rs(O, Kr(F, t[F.kind], B))) : (O = Kr(P, I ?? p.Expression_type_can_t_be_inferred_with_isolatedDeclarations), Rs(O, Kr(F, t[F.kind], B)), Rs(O, Kr(P, p.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit)));
- } else
- O = Kr(P, I ?? p.Expression_type_can_t_be_inferred_with_isolatedDeclarations);
- return O;
- }
- }
- function xne(e, t, n) {
- const i = e.getCompilerOptions(), s = Ln(V7(e, n), D7);
- return ss(s, n) ? LA(
- t,
- e,
- A,
- i,
- [n],
- [gW],
- /*allowDtsFiles*/
- !1
- ).diagnostics : void 0;
- }
- var IA = 531469, OA = 8;
- function gW(e) {
- const t = () => E.fail("Diagnostic emitted without context");
- let n = t, i = !0, s = !1, o = !1, c = !1, _ = !1, u, d, g, h;
- const { factory: S } = e, T = e.getEmitHost(), C = {
- trackSymbol: re,
- reportInaccessibleThisError: oe,
- reportInaccessibleUniqueSymbolError: Se,
- reportCyclicStructureError: J,
- reportPrivateInBaseOfClassExpression: ne,
- reportLikelyUnsafeImportRequiredError: _e,
- reportTruncationError: he,
- moduleResolverHost: T,
- reportNonlocalAugmentation: le,
- reportNonSerializableProperty: me,
- reportInferenceFallback: G
- };
- let D, P, I, F, O, B;
- const z = e.getEmitResolver(), X = e.getCompilerOptions(), q = Tne(z), { stripInternal: V, isolatedDeclarations: ae } = X;
- return tt;
- function ee(te) {
- z.getPropertiesOfContainerFunction(te).forEach((ze) => {
- if (vx(ze.valueDeclaration)) {
- const K = dn(ze.valueDeclaration) ? ze.valueDeclaration.left : ze.valueDeclaration;
- e.addDiagnostic(Kr(
- K,
- p.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function
- ));
- }
- });
- }
- function G(te) {
- !ae || Gu(I) || Tr(te) === I && (ii(te) && z.isExpandoFunctionDeclaration(te) ? ee(te) : e.addDiagnostic(q(te)));
- }
- function ue(te) {
- if (te.accessibility === 0) {
- if (te.aliasesToMakeVisible)
- if (!d)
- d = te.aliasesToMakeVisible;
- else
- for (const ze of te.aliasesToMakeVisible)
- tp(d, ze);
- } else if (te.accessibility !== 3) {
- const ze = n(te);
- if (ze)
- return ze.typeName ? e.addDiagnostic(Kr(te.errorNode || ze.errorNode, ze.diagnosticMessage, nc(ze.typeName), te.errorSymbolName, te.errorModuleName)) : e.addDiagnostic(Kr(te.errorNode || ze.errorNode, ze.diagnosticMessage, te.errorSymbolName, te.errorModuleName)), !0;
- }
- return !1;
- }
- function re(te, ze, K) {
- return te.flags & 262144 ? !1 : ue(z.isSymbolAccessible(
- te,
- ze,
- K,
- /*shouldComputeAliasToMarkVisible*/
- !0
- ));
- }
- function ne(te) {
- (D || P) && e.addDiagnostic(
- Rs(
- Kr(D || P, p.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected, te),
- ...ii((D || P).parent) ? [Kr(D || P, p.Add_a_type_annotation_to_the_variable_0, ie())] : []
- )
- );
- }
- function ie() {
- return D ? _o(D) : P && os(P) ? _o(os(P)) : P && wo(P) ? P.isExportEquals ? "export=" : "default" : "(Missing)";
- }
- function Se() {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ie(), "unique symbol"));
- }
- function J() {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, ie()));
- }
- function oe() {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ie(), "this"));
- }
- function _e(te) {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ie(), te));
- }
- function he() {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed));
- }
- function le(te, ze, K) {
- var De;
- const Ve = (De = ze.declarations) == null ? void 0 : De.find((xe) => Tr(xe) === te), Ke = Ln(K.declarations, (xe) => Tr(xe) !== te);
- if (Ve && Ke)
- for (const xe of Ke)
- e.addDiagnostic(Rs(
- Kr(xe, p.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),
- Kr(Ve, p.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)
- ));
- }
- function me(te) {
- (D || P) && e.addDiagnostic(Kr(D || P, p.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, te));
- }
- function ve(te) {
- const ze = n;
- n = (De) => De.errorNode && eF(De.errorNode) ? I0(De.errorNode)(De) : {
- diagnosticMessage: De.errorModuleName ? p.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit : p.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,
- errorNode: De.errorNode || te
- };
- const K = z.getDeclarationStatementsForSourceFile(te, IA, OA, C);
- return n = ze, K;
- }
- function tt(te) {
- if (te.kind === 307 && te.isDeclarationFile)
- return te;
- if (te.kind === 308) {
- s = !0, F = [], O = [], B = [];
- let $e = !1;
- const bt = S.createBundle(
- lr(te.sourceFiles, (Vt) => {
- if (Vt.isDeclarationFile) return;
- if ($e = $e || Vt.hasNoDefaultLib, I = Vt, u = Vt, d = void 0, h = !1, g = /* @__PURE__ */ new Map(), n = t, c = !1, _ = !1, De(Vt), X_(Vt) || Rp(Vt)) {
- o = !1, i = !1;
- const vn = Gu(Vt) ? S.createNodeArray(ve(Vt)) : Fr(Vt.statements, Jr, bi);
- return S.updateSourceFile(
- Vt,
- [S.createModuleDeclaration(
- [S.createModifier(
- 138
- /* DeclareKeyword */
- )],
- S.createStringLiteral(DB(e.getEmitHost(), Vt)),
- S.createModuleBlock(lt(S.createNodeArray(rs(vn)), Vt.statements))
- )],
- /*isDeclarationFile*/
- !0,
- /*referencedFiles*/
- [],
- /*typeReferences*/
- [],
- /*hasNoDefaultLib*/
- !1,
- /*libReferences*/
- []
- );
- }
- i = !0;
- const Zt = Gu(Vt) ? S.createNodeArray(ve(Vt)) : Fr(Vt.statements, Jr, bi);
- return S.updateSourceFile(
- Vt,
- rs(Zt),
- /*isDeclarationFile*/
- !0,
- /*referencedFiles*/
- [],
- /*typeReferences*/
- [],
- /*hasNoDefaultLib*/
- !1,
- /*libReferences*/
- []
- );
- })
- ), He = Xn(Wl(FD(
- te,
- T,
- /*forceDtsPaths*/
- !0
- ).declarationFilePath));
- return bt.syntheticFileReferences = at(He), bt.syntheticTypeReferences = Ke(), bt.syntheticLibReferences = xe(), bt.hasNoDefaultLib = $e, bt;
- }
- i = !0, c = !1, _ = !1, u = te, I = te, n = t, s = !1, o = !1, h = !1, d = void 0, g = /* @__PURE__ */ new Map(), F = [], O = [], B = [], De(I);
- let ze;
- if (Gu(I))
- ze = S.createNodeArray(ve(te));
- else {
- const $e = Fr(te.statements, Jr, bi);
- ze = lt(S.createNodeArray(rs($e)), te.statements), il(te) && (!o || c && !_) && (ze = lt(S.createNodeArray([...ze, aA(S)]), ze));
- }
- const K = Xn(Wl(FD(
- te,
- T,
- /*forceDtsPaths*/
- !0
- ).declarationFilePath));
- return S.updateSourceFile(
- te,
- ze,
- /*isDeclarationFile*/
- !0,
- at(K),
- Ke(),
- te.hasNoDefaultLib,
- xe()
- );
- function De($e) {
- F = Qi(F, lr($e.referencedFiles, (bt) => [$e, bt])), O = Qi(O, $e.typeReferenceDirectives), B = Qi(B, $e.libReferenceDirectives);
- }
- function Ve($e) {
- const bt = { ...$e };
- return bt.pos = -1, bt.end = -1, bt;
- }
- function Ke() {
- return Ai(O, ($e) => {
- if ($e.preserve)
- return Ve($e);
- });
- }
- function xe() {
- return Ai(B, ($e) => {
- if ($e.preserve)
- return Ve($e);
- });
- }
- function at($e) {
- return Ai(F, ([bt, He]) => {
- if (!He.preserve) return;
- const Vt = T.getSourceFileFromReference(bt, He);
- if (!Vt)
- return;
- let Zt;
- if (Vt.isDeclarationFile)
- Zt = Vt.fileName;
- else {
- if (s && ss(te.sourceFiles, Vt)) return;
- const Ae = FD(
- Vt,
- T,
- /*forceDtsPaths*/
- !0
- );
- Zt = Ae.declarationFilePath || Ae.jsFilePath || Vt.fileName;
- }
- if (!Zt) return;
- const vn = jT(
- $e,
- Zt,
- T.getCurrentDirectory(),
- T.getCanonicalFileName,
- /*isAbsolutePathAnUrl*/
- !1
- ), M = Ve(He);
- return M.fileName = vn, M;
- });
- }
- }
- function Te(te) {
- if (te.kind === 80)
- return te;
- return te.kind === 207 ? S.updateArrayBindingPattern(te, Fr(te.elements, ze, qI)) : S.updateObjectBindingPattern(te, Fr(te.elements, ze, va));
- function ze(K) {
- return K.kind === 232 ? K : (K.propertyName && ma(K.propertyName) && yo(K.propertyName.expression) && Nt(K.propertyName.expression, u), S.updateBindingElement(
- K,
- K.dotDotDotToken,
- K.propertyName,
- Te(K.name),
- /*initializer*/
- void 0
- ));
- }
- }
- function we(te, ze, K) {
- let De;
- h || (De = n, n = I0(te));
- const Ve = S.updateParameterDeclaration(
- te,
- gRe(S, te, ze),
- te.dotDotDotToken,
- Te(te.name),
- z.isOptionalParameter(te) ? te.questionToken || S.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- Qe(
- te,
- K || te.type,
- /*ignorePrivate*/
- !0
- ),
- // Ignore private param props, since this type is going straight back into a param
- Me(te)
- );
- return h || (n = De), Ve;
- }
- function fe(te) {
- return n1e(te) && !!te.initializer && z.isLiteralConstDeclaration(fs(te));
- }
- function Me(te) {
- if (fe(te)) {
- const ze = gee(te.initializer);
- return F5(ze) || G(te), z.createLiteralConstValue(fs(te, n1e), C);
- }
- }
- function Qe(te, ze, K) {
- if (!K && Z_(
- te,
- 2
- /* Private */
- ) || fe(te))
- return;
- const De = te.kind === 169 && z.requiresAddingImplicitUndefined(te, u);
- if (ze && !De)
- return Ge(ze, ei, fi);
- D = te.name;
- let Ve;
- h || (Ve = n, n = I0(te));
- let Ke;
- switch (te.kind) {
- case 169:
- case 171:
- case 172:
- case 208:
- case 260:
- Ke = z.createTypeOfDeclaration(te, u, IA, OA, C);
- break;
- case 262:
- case 180:
- case 173:
- case 174:
- case 177:
- case 179:
- Ke = z.createReturnTypeOfSignatureDeclaration(te, u, IA, OA, C);
- break;
- default:
- E.assertNever(te);
- }
- return D = void 0, h || (n = Ve), Ke ?? S.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- );
- }
- function et(te) {
- switch (te = fs(te), te.kind) {
- case 262:
- case 267:
- case 264:
- case 263:
- case 265:
- case 266:
- return !z.isDeclarationVisible(te);
- case 260:
- return !ft(te);
- case 271:
- case 272:
- case 278:
- case 277:
- return !1;
- case 175:
- return !0;
- }
- return !1;
- }
- function Re(te) {
- var ze;
- if (te.body)
- return !0;
- const K = (ze = te.symbol.declarations) == null ? void 0 : ze.filter((De) => Ec(De) && !De.body);
- return !K || K.indexOf(te) === K.length - 1;
- }
- function ft(te) {
- return ml(te) ? !1 : As(te.name) ? ut(te.name.elements, ft) : z.isDeclarationVisible(te);
- }
- function Wt(te, ze, K) {
- if (Z_(
- te,
- 2
- /* Private */
- ))
- return S.createNodeArray();
- const De = lr(ze, (Ve) => we(Ve, K));
- return De ? S.createNodeArray(De, ze.hasTrailingComma) : S.createNodeArray();
- }
- function _r(te, ze) {
- let K;
- if (!ze) {
- const De = Eb(te);
- De && (K = [we(De)]);
- }
- if (K_(te)) {
- let De;
- if (!ze) {
- const Ve = IC(te);
- if (Ve) {
- const Ke = Xe(te, My(Ks(te.parent) ? te.parent.properties : te.parent.members, te));
- De = we(
- Ve,
- /*modifierMask*/
- void 0,
- Ke
- );
- }
- }
- De || (De = S.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "value"
- )), K = wr(K, De);
- }
- return S.createNodeArray(K || Ue);
- }
- function Ir(te, ze) {
- return Z_(
- te,
- 2
- /* Private */
- ) ? void 0 : Fr(ze, ei, zo);
- }
- function jr(te) {
- return Si(te) || Vp(te) || zc(te) || Xc(te) || Xl(te) || ys(te) || Fb(te) || mS(te);
- }
- function Nt(te, ze) {
- const K = z.isEntityNameVisible(te, ze);
- ue(K);
- }
- function Qt(te, ze) {
- return gf(te) && gf(ze) && (te.jsDoc = ze.jsDoc), nl(te, ym(ze));
- }
- function Br(te, ze) {
- if (ze) {
- if (o = o || te.kind !== 267 && te.kind !== 205, Xa(ze) && s) {
- const K = rK(e.getEmitHost(), z, te);
- if (K)
- return S.createStringLiteral(K);
- }
- return ze;
- }
- }
- function xr(te) {
- if (z.isDeclarationVisible(te))
- if (te.moduleReference.kind === 283) {
- const ze = g4(te);
- return S.updateImportEqualsDeclaration(
- te,
- te.modifiers,
- te.isTypeOnly,
- te.name,
- S.updateExternalModuleReference(te.moduleReference, Br(te, ze))
- );
- } else {
- const ze = n;
- return n = I0(te), Nt(te.moduleReference, u), n = ze, te;
- }
- }
- function zn(te) {
- if (!te.importClause)
- return S.updateImportDeclaration(
- te,
- te.modifiers,
- te.importClause,
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- );
- const ze = te.importClause && te.importClause.name && z.isDeclarationVisible(te.importClause) ? te.importClause.name : void 0;
- if (!te.importClause.namedBindings)
- return ze && S.updateImportDeclaration(
- te,
- te.modifiers,
- S.updateImportClause(
- te.importClause,
- te.importClause.isTypeOnly,
- ze,
- /*namedBindings*/
- void 0
- ),
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- );
- if (te.importClause.namedBindings.kind === 274) {
- const De = z.isDeclarationVisible(te.importClause.namedBindings) ? te.importClause.namedBindings : (
- /*namedBindings*/
- void 0
- );
- return ze || De ? S.updateImportDeclaration(
- te,
- te.modifiers,
- S.updateImportClause(
- te.importClause,
- te.importClause.isTypeOnly,
- ze,
- De
- ),
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- ) : void 0;
- }
- const K = Ai(te.importClause.namedBindings.elements, (De) => z.isDeclarationVisible(De) ? De : void 0);
- if (K && K.length || ze)
- return S.updateImportDeclaration(
- te,
- te.modifiers,
- S.updateImportClause(
- te.importClause,
- te.importClause.isTypeOnly,
- ze,
- K && K.length ? S.updateNamedImports(te.importClause.namedBindings, K) : void 0
- ),
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- );
- if (z.isImportRequiredByAugmentation(te))
- return ae && e.addDiagnostic(Kr(te, p.Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations)), S.updateImportDeclaration(
- te,
- te.modifiers,
- /*importClause*/
- void 0,
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- );
- }
- function ki(te) {
- const ze = d6(te);
- return te && ze !== void 0 ? te : void 0;
- }
- function rs(te) {
- for (; Nr(d); ) {
- const K = d.shift();
- if (!u7(K))
- return E.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${E.formatSyntaxKind(K.kind)}`);
- const De = i;
- i = K.parent && Si(K.parent) && !(il(K.parent) && s);
- const Ve = Ot(K);
- i = De, g.set(e_(K), Ve);
- }
- return Fr(te, ze, bi);
- function ze(K) {
- if (u7(K)) {
- const De = e_(K);
- if (g.has(De)) {
- const Ve = g.get(De);
- return g.delete(De), Ve && ((us(Ve) ? ut(Ve, HI) : HI(Ve)) && (c = !0), Si(K.parent) && (us(Ve) ? ut(Ve, Ow) : Ow(Ve)) && (o = !0)), Ve;
- }
- }
- return K;
- }
- }
- function ei(te) {
- if (Oi(te)) return;
- if (ql(te)) {
- if (et(te)) return;
- if (Dh(te)) {
- if (ae) {
- if (!z.isDefinitelyReferenceToGlobalSymbolObject(te.name.expression)) {
- if (Xc(te.parent) || Ks(te.parent)) {
- e.addDiagnostic(Kr(te, p.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
- return;
- } else if (
- // Type declarations just need to double-check that the input computed name is an entity name expression
- (Xl(te.parent) || Qu(te.parent)) && !yo(te.name.expression)
- ) {
- e.addDiagnostic(Kr(te, p.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
- return;
- }
- }
- } else if (!z.isLateBound(fs(te)) || !yo(te.name.expression))
- return;
- }
- }
- if (ys(te) && z.isImplementationOfOverload(te) || $ee(te)) return;
- let ze;
- jr(te) && (ze = u, u = te);
- const K = n, De = eF(te), Ve = h;
- let Ke = (te.kind === 187 || te.kind === 200) && te.parent.kind !== 265;
- if ((hc(te) || vm(te)) && Z_(
- te,
- 2
- /* Private */
- ))
- return te.symbol && te.symbol.declarations && te.symbol.declarations[0] !== te ? void 0 : xe(S.createPropertyDeclaration(
- rr(te),
- te.name,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ));
- if (De && !h && (n = I0(te)), Lb(te) && Nt(te.exprName, u), Ke && (h = !0), yRe(te))
- switch (te.kind) {
- case 233: {
- (l_(te.expression) || yo(te.expression)) && Nt(te.expression, u);
- const at = br(te, ei, e);
- return xe(S.updateExpressionWithTypeArguments(at, at.expression, at.typeArguments));
- }
- case 183: {
- Nt(te.typeName, u);
- const at = br(te, ei, e);
- return xe(S.updateTypeReferenceNode(at, at.typeName, at.typeArguments));
- }
- case 180:
- return xe(S.updateConstructSignature(
- te,
- Ir(te, te.typeParameters),
- Wt(te, te.parameters),
- Qe(te, te.type)
- ));
- case 176: {
- const at = S.createConstructorDeclaration(
- /*modifiers*/
- rr(te),
- Wt(
- te,
- te.parameters,
- 0
- /* None */
- ),
- /*body*/
- void 0
- );
- return xe(at);
- }
- case 174: {
- if (Di(te.name))
- return xe(
- /*returnValue*/
- void 0
- );
- const at = S.createMethodDeclaration(
- rr(te),
- /*asteriskToken*/
- void 0,
- te.name,
- te.questionToken,
- Ir(te, te.typeParameters),
- Wt(te, te.parameters),
- Qe(te, te.type),
- /*body*/
- void 0
- );
- return xe(at);
- }
- case 177: {
- if (Di(te.name))
- return xe(
- /*returnValue*/
- void 0
- );
- const at = Xe(te, My(Ks(te.parent) ? te.parent.properties : te.parent.members, te));
- return xe(S.updateGetAccessorDeclaration(
- te,
- rr(te),
- te.name,
- _r(te, Z_(
- te,
- 2
- /* Private */
- )),
- Qe(te, at),
- /*body*/
- void 0
- ));
- }
- case 178:
- return Di(te.name) ? xe(
- /*returnValue*/
- void 0
- ) : xe(S.updateSetAccessorDeclaration(
- te,
- rr(te),
- te.name,
- _r(te, Z_(
- te,
- 2
- /* Private */
- )),
- /*body*/
- void 0
- ));
- case 172:
- return Di(te.name) ? xe(
- /*returnValue*/
- void 0
- ) : xe(S.updatePropertyDeclaration(
- te,
- rr(te),
- te.name,
- te.questionToken,
- Qe(te, te.type),
- Me(te)
- ));
- case 171:
- return Di(te.name) ? xe(
- /*returnValue*/
- void 0
- ) : xe(S.updatePropertySignature(
- te,
- rr(te),
- te.name,
- te.questionToken,
- Qe(te, te.type)
- ));
- case 173:
- return Di(te.name) ? xe(
- /*returnValue*/
- void 0
- ) : xe(S.updateMethodSignature(
- te,
- rr(te),
- te.name,
- te.questionToken,
- Ir(te, te.typeParameters),
- Wt(te, te.parameters),
- Qe(te, te.type)
- ));
- case 179:
- return xe(
- S.updateCallSignature(
- te,
- Ir(te, te.typeParameters),
- Wt(te, te.parameters),
- Qe(te, te.type)
- )
- );
- case 181:
- return xe(S.updateIndexSignature(
- te,
- rr(te),
- Wt(te, te.parameters),
- Ge(te.type, ei, fi) || S.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- ));
- case 260:
- return As(te.name) ? mn(te.name) : (Ke = !0, h = !0, xe(S.updateVariableDeclaration(
- te,
- te.name,
- /*exclamationToken*/
- void 0,
- Qe(te, te.type),
- Me(te)
- )));
- case 168:
- return Ri(te) && (te.default || te.constraint) ? xe(S.updateTypeParameterDeclaration(
- te,
- te.modifiers,
- te.name,
- /*constraint*/
- void 0,
- /*defaultType*/
- void 0
- )) : xe(br(te, ei, e));
- case 194: {
- const at = Ge(te.checkType, ei, fi), $e = Ge(te.extendsType, ei, fi), bt = u;
- u = te.trueType;
- const He = Ge(te.trueType, ei, fi);
- u = bt;
- const Vt = Ge(te.falseType, ei, fi);
- return E.assert(at), E.assert($e), E.assert(He), E.assert(Vt), xe(S.updateConditionalTypeNode(te, at, $e, He, Vt));
- }
- case 184:
- return xe(S.updateFunctionTypeNode(
- te,
- Fr(te.typeParameters, ei, zo),
- Wt(te, te.parameters),
- E.checkDefined(Ge(te.type, ei, fi))
- ));
- case 185:
- return xe(S.updateConstructorTypeNode(
- te,
- rr(te),
- Fr(te.typeParameters, ei, zo),
- Wt(te, te.parameters),
- E.checkDefined(Ge(te.type, ei, fi))
- ));
- case 205:
- return h0(te) ? xe(S.updateImportTypeNode(
- te,
- S.updateLiteralTypeNode(te.argument, Br(te, te.argument.literal)),
- te.attributes,
- te.qualifier,
- Fr(te.typeArguments, ei, fi),
- te.isTypeOf
- )) : xe(te);
- default:
- E.assertNever(te, `Attempted to process unhandled node kind: ${E.formatSyntaxKind(te.kind)}`);
- }
- return wx(te) && Qs(I, te.pos).line === Qs(I, te.end).line && an(
- te,
- 1
- /* SingleLine */
- ), xe(br(te, ei, e));
- function xe(at) {
- return at && De && Dh(te) && qn(te), jr(te) && (u = ze), De && !h && (n = K), Ke && (h = Ve), at === te ? at : at && kn(Qt(at, te), te);
- }
- }
- function Ri(te) {
- return te.parent.kind === 174 && Z_(
- te.parent,
- 2
- /* Private */
- );
- }
- function Jr(te) {
- if (!hRe(te) || Oi(te)) return;
- switch (te.kind) {
- case 278:
- return Si(te.parent) && (o = !0), _ = !0, S.updateExportDeclaration(
- te,
- te.modifiers,
- te.isTypeOnly,
- te.exportClause,
- Br(te, te.moduleSpecifier),
- ki(te.attributes)
- );
- case 277: {
- if (Si(te.parent) && (o = !0), _ = !0, te.expression.kind === 80)
- return te;
- {
- const K = S.createUniqueName(
- "_default",
- 16
- /* Optimistic */
- );
- n = () => ({
- diagnosticMessage: p.Default_export_of_the_module_has_or_is_using_private_name_0,
- errorNode: te
- }), P = te;
- const De = S.createVariableDeclaration(
- K,
- /*exclamationToken*/
- void 0,
- z.createTypeOfExpression(te.expression, te, IA, OA, C),
- /*initializer*/
- void 0
- );
- P = void 0;
- const Ve = S.createVariableStatement(i ? [S.createModifier(
- 138
- /* DeclareKeyword */
- )] : [], S.createVariableDeclarationList(
- [De],
- 2
- /* Const */
- ));
- return Qt(Ve, te), X3(te), [Ve, S.updateExportAssignment(te, te.modifiers, K)];
- }
- }
- }
- const ze = Ot(te);
- return g.set(e_(te), ze), te;
- }
- function ji(te) {
- if (gl(te) || Z_(
- te,
- 2048
- /* Default */
- ) || !Hp(te))
- return te;
- const ze = S.createModifiersFromModifierFlags(Mu(te) & 131039);
- return S.replaceModifiers(te, ze);
- }
- function Fe(te, ze, K, De) {
- const Ve = S.updateModuleDeclaration(te, ze, K, De);
- if (Fu(Ve) || Ve.flags & 32)
- return Ve;
- const Ke = S.createModuleDeclaration(
- Ve.modifiers,
- Ve.name,
- Ve.body,
- Ve.flags | 32
- /* Namespace */
- );
- return kn(Ke, Ve), lt(Ke, Ve), Ke;
- }
- function Ot(te) {
- if (d)
- for (; OE(d, te); ) ;
- if (Oi(te)) return;
- switch (te.kind) {
- case 271:
- return xr(te);
- case 272:
- return zn(te);
- }
- if (ql(te) && et(te) || Cm(te) || ys(te) && z.isImplementationOfOverload(te)) return;
- let ze;
- jr(te) && (ze = u, u = te);
- const K = eF(te), De = n;
- K && (n = I0(te));
- const Ve = i;
- switch (te.kind) {
- case 265: {
- i = !1;
- const xe = Ke(S.updateTypeAliasDeclaration(
- te,
- rr(te),
- te.name,
- Fr(te.typeParameters, ei, zo),
- E.checkDefined(Ge(te.type, ei, fi))
- ));
- return i = Ve, xe;
- }
- case 264:
- return Ke(S.updateInterfaceDeclaration(
- te,
- rr(te),
- te.name,
- Ir(te, te.typeParameters),
- Tt(te.heritageClauses),
- Fr(te.members, ei, db)
- ));
- case 262: {
- const xe = Ke(S.updateFunctionDeclaration(
- te,
- rr(te),
- /*asteriskToken*/
- void 0,
- te.name,
- Ir(te, te.typeParameters),
- Wt(te, te.parameters),
- Qe(te, te.type),
- /*body*/
- void 0
- ));
- if (xe && z.isExpandoFunctionDeclaration(te) && Re(te)) {
- const at = z.getPropertiesOfContainerFunction(te);
- ae && ee(te);
- const $e = gv.createModuleDeclaration(
- /*modifiers*/
- void 0,
- xe.name || S.createIdentifier("_default"),
- S.createModuleBlock([]),
- 32
- /* Namespace */
- );
- Aa($e, u), $e.locals = Js(at), $e.symbol = at[0].parent;
- const bt = [];
- let He = Ai(at, (dt) => {
- if (!vx(dt.valueDeclaration))
- return;
- const U = Ei(dt.escapedName);
- if (!k_(
- U,
- 99
- /* ESNext */
- ))
- return;
- n = I0(dt.valueDeclaration);
- const be = z.createTypeOfDeclaration(dt.valueDeclaration, $e, IA, OA | 2, C);
- n = De;
- const Z = ix(U), ht = Z ? S.getGeneratedNameForNode(dt.valueDeclaration) : S.createIdentifier(U);
- Z && bt.push([ht, U]);
- const Le = S.createVariableDeclaration(
- ht,
- /*exclamationToken*/
- void 0,
- be,
- /*initializer*/
- void 0
- );
- return S.createVariableStatement(Z ? void 0 : [S.createToken(
- 95
- /* ExportKeyword */
- )], S.createVariableDeclarationList([Le]));
- });
- bt.length ? He.push(S.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- S.createNamedExports(lr(bt, ([dt, U]) => S.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- dt,
- U
- )))
- )) : He = Ai(He, (dt) => S.replaceModifiers(
- dt,
- 0
- /* None */
- ));
- const Vt = S.createModuleDeclaration(
- rr(te),
- te.name,
- S.createModuleBlock(He),
- 32
- /* Namespace */
- );
- if (!Z_(
- xe,
- 2048
- /* Default */
- ))
- return [xe, Vt];
- const Zt = S.createModifiersFromModifierFlags(
- Mu(xe) & -2081 | 128
- /* Ambient */
- ), vn = S.updateFunctionDeclaration(
- xe,
- Zt,
- /*asteriskToken*/
- void 0,
- xe.name,
- xe.typeParameters,
- xe.parameters,
- xe.type,
- /*body*/
- void 0
- ), M = S.updateModuleDeclaration(
- Vt,
- Zt,
- Vt.name,
- Vt.body
- ), Ae = S.createExportAssignment(
- /*modifiers*/
- void 0,
- /*isExportEquals*/
- !1,
- Vt.name
- );
- return Si(te.parent) && (o = !0), _ = !0, [vn, M, Ae];
- } else
- return xe;
- }
- case 267: {
- i = !1;
- const xe = te.body;
- if (xe && xe.kind === 268) {
- const at = c, $e = _;
- _ = !1, c = !1;
- const bt = Fr(xe.statements, Jr, bi);
- let He = rs(bt);
- te.flags & 33554432 && (c = !1), !ig(te) && !Hs(He) && !_ && (c ? He = S.createNodeArray([...He, aA(S)]) : He = Fr(He, ji, bi));
- const Vt = S.updateModuleBlock(xe, He);
- i = Ve, c = at, _ = $e;
- const Zt = rr(te);
- return Ke(Fe(
- te,
- Zt,
- yb(te) ? Br(te, te.name) : te.name,
- Vt
- ));
- } else {
- i = Ve;
- const at = rr(te);
- i = !1, Ge(xe, Jr);
- const $e = e_(xe), bt = g.get($e);
- return g.delete($e), Ke(Fe(
- te,
- at,
- te.name,
- bt
- ));
- }
- }
- case 263: {
- D = te.name, P = te;
- const xe = S.createNodeArray(rr(te)), at = Ir(te, te.typeParameters), $e = Bg(te);
- let bt;
- if ($e) {
- const Ae = n;
- bt = tw(ta($e.parameters, (dt) => {
- if (!Gn(
- dt,
- 31
- /* ParameterPropertyModifier */
- ) || Oi(dt)) return;
- if (n = I0(dt), dt.name.kind === 80)
- return Qt(
- S.createPropertyDeclaration(
- rr(dt),
- dt.name,
- dt.questionToken,
- Qe(dt, dt.type),
- Me(dt)
- ),
- dt
- );
- return U(dt.name);
- function U(be) {
- let Z;
- for (const ht of be.elements)
- ml(ht) || (As(ht.name) && (Z = Qi(Z, U(ht.name))), Z = Z || [], Z.push(S.createPropertyDeclaration(
- rr(dt),
- ht.name,
- /*questionOrExclamationToken*/
- void 0,
- Qe(
- ht,
- /*type*/
- void 0
- ),
- /*initializer*/
- void 0
- )));
- return Z;
- }
- })), n = Ae;
- }
- const Vt = ut(te.members, (Ae) => !!Ae.name && Di(Ae.name)) ? [
- S.createPropertyDeclaration(
- /*modifiers*/
- void 0,
- S.createPrivateIdentifier("#private"),
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- )
- ] : void 0, Zt = Qi(Qi(Vt, bt), Fr(te.members, ei, _l)), vn = S.createNodeArray(Zt), M = _m(te);
- if (M && !yo(M.expression) && M.expression.kind !== 106) {
- const Ae = te.name ? Ei(te.name.escapedText) : "default", dt = S.createUniqueName(
- `${Ae}_base`,
- 16
- /* Optimistic */
- );
- n = () => ({
- diagnosticMessage: p.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
- errorNode: M,
- typeName: te.name
- });
- const U = S.createVariableDeclaration(
- dt,
- /*exclamationToken*/
- void 0,
- z.createTypeOfExpression(M.expression, te, IA, OA, C),
- /*initializer*/
- void 0
- ), be = S.createVariableStatement(i ? [S.createModifier(
- 138
- /* DeclareKeyword */
- )] : [], S.createVariableDeclarationList(
- [U],
- 2
- /* Const */
- )), Z = S.createNodeArray(lr(te.heritageClauses, (ht) => {
- if (ht.token === 96) {
- const Le = n;
- n = I0(ht.types[0]);
- const Ie = S.updateHeritageClause(ht, lr(ht.types, (At) => S.updateExpressionWithTypeArguments(At, dt, Fr(At.typeArguments, ei, fi))));
- return n = Le, Ie;
- }
- return S.updateHeritageClause(ht, Fr(S.createNodeArray(Ln(
- ht.types,
- (Le) => yo(Le.expression) || Le.expression.kind === 106
- /* NullKeyword */
- )), ei, Oh));
- }));
- return [
- be,
- Ke(S.updateClassDeclaration(
- te,
- xe,
- te.name,
- at,
- Z,
- vn
- ))
- ];
- } else {
- const Ae = Tt(te.heritageClauses);
- return Ke(S.updateClassDeclaration(
- te,
- xe,
- te.name,
- at,
- Ae,
- vn
- ));
- }
- }
- case 243:
- return Ke(Ar(te));
- case 266:
- return Ke(S.updateEnumDeclaration(
- te,
- S.createNodeArray(rr(te)),
- te.name,
- S.createNodeArray(Ai(te.members, (xe) => {
- if (Oi(xe)) return;
- const at = z.getEnumMemberValue(xe), $e = at?.value;
- ae && xe.initializer && at?.hasExternalReferences && // This will be its own compiler error instead, so don't report.
- !ma(xe.name) && e.addDiagnostic(Kr(xe, p.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations));
- const bt = $e === void 0 ? void 0 : typeof $e == "string" ? S.createStringLiteral($e) : $e < 0 ? S.createPrefixUnaryExpression(41, S.createNumericLiteral(-$e)) : S.createNumericLiteral($e);
- return Qt(S.updateEnumMember(xe, xe.name, bt), xe);
- }))
- ));
- }
- return E.assertNever(te, `Unhandled top-level node in declaration emit: ${E.formatSyntaxKind(te.kind)}`);
- function Ke(xe) {
- return jr(te) && (u = ze), K && (n = De), te.kind === 267 && (i = Ve), xe === te ? xe : (P = void 0, D = void 0, xe && kn(Qt(xe, te), te));
- }
- }
- function Ar(te) {
- if (!ir(te.declarationList.declarations, ft)) return;
- const ze = Fr(te.declarationList.declarations, ei, ii);
- if (!Nr(ze)) return;
- const K = S.createNodeArray(rr(te));
- let De;
- return Hw(te.declarationList) || qw(te.declarationList) ? (De = S.createVariableDeclarationList(
- ze,
- 2
- /* Const */
- ), kn(De, te.declarationList), lt(De, te.declarationList), nl(De, te.declarationList)) : De = S.updateVariableDeclarationList(te.declarationList, ze), S.updateVariableStatement(te, K, De);
- }
- function mn(te) {
- return Np(Ai(te.elements, (ze) => ti(ze)));
- }
- function ti(te) {
- if (te.kind !== 232 && te.name)
- return ft(te) ? As(te.name) ? mn(te.name) : S.createVariableDeclaration(
- te.name,
- /*exclamationToken*/
- void 0,
- Qe(
- te,
- /*type*/
- void 0
- ),
- /*initializer*/
- void 0
- ) : void 0;
- }
- function qn(te) {
- let ze;
- h || (ze = n, n = Sne(te)), D = te.name, E.assert(Dh(te));
- const De = te.name.expression;
- Nt(De, u), h || (n = ze), D = void 0;
- }
- function Oi(te) {
- return !!V && !!te && QY(te, I);
- }
- function Ws(te) {
- return wo(te) || Nc(te);
- }
- function Hs(te) {
- return ut(te, Ws);
- }
- function rr(te) {
- const ze = Mu(te), K = Ea(te);
- return ze === K ? wA(te.modifiers, (De) => Wn(De, ra), ra) : S.createModifiersFromModifierFlags(K);
- }
- function Ea(te) {
- let ze = 130030, K = i && !mRe(te) ? 128 : 0;
- const De = te.parent.kind === 307;
- return (!De || s && De && il(te.parent)) && (ze ^= 128, K = 0), r1e(te, ze, K);
- }
- function Xe(te, ze) {
- let K = kne(te);
- return !K && te !== ze.firstAccessor && (K = kne(ze.firstAccessor), n = I0(ze.firstAccessor)), !K && ze.secondAccessor && te !== ze.secondAccessor && (K = kne(ze.secondAccessor), n = I0(ze.secondAccessor)), K;
- }
- function Tt(te) {
- return S.createNodeArray(Ln(
- lr(te, (ze) => S.updateHeritageClause(
- ze,
- Fr(
- S.createNodeArray(Ln(ze.types, (K) => yo(K.expression) || ze.token === 96 && K.expression.kind === 106)),
- ei,
- Oh
- )
- )),
- (ze) => ze.types && !!ze.types.length
- ));
- }
- }
- function mRe(e) {
- return e.kind === 264;
- }
- function gRe(e, t, n, i) {
- return e.createModifiersFromModifierFlags(r1e(t, n, i));
- }
- function r1e(e, t = 131070, n = 0) {
- let i = Mu(e) & t | n;
- return i & 2048 && !(i & 32) && (i ^= 32), i & 2048 && i & 128 && (i ^= 128), i;
- }
- function kne(e) {
- if (e)
- return e.kind === 177 ? e.type : e.parameters.length > 0 ? e.parameters[0].type : void 0;
- }
- function n1e(e) {
- switch (e.kind) {
- case 172:
- case 171:
- return !Z_(
- e,
- 2
- /* Private */
- );
- case 169:
- case 260:
- return !0;
- }
- return !1;
- }
- function hRe(e) {
- switch (e.kind) {
- case 262:
- case 267:
- case 271:
- case 264:
- case 263:
- case 265:
- case 266:
- case 243:
- case 272:
- case 278:
- case 277:
- return !0;
- }
- return !1;
- }
- function yRe(e) {
- switch (e.kind) {
- case 180:
- case 176:
- case 174:
- case 177:
- case 178:
- case 172:
- case 171:
- case 173:
- case 179:
- case 181:
- case 260:
- case 168:
- case 233:
- case 183:
- case 194:
- case 184:
- case 185:
- case 205:
- return !0;
- }
- return !1;
- }
- function vRe(e) {
- switch (e) {
- case 200:
- return mW;
- case 99:
- case 7:
- case 6:
- case 5:
- case 100:
- case 199:
- case 1:
- return bne;
- case 4:
- return vne;
- default:
- return dW;
- }
- }
- var Cne = { scriptTransformers: Ue, declarationTransformers: Ue };
- function Ene(e, t, n) {
- return {
- scriptTransformers: bRe(e, t, n),
- declarationTransformers: SRe(t)
- };
- }
- function bRe(e, t, n) {
- if (n) return Ue;
- const i = pa(e), s = Ru(e), o = R3(e), c = [];
- return Fn(c, t && lr(t.before, s1e)), c.push(rne), e.experimentalDecorators && c.push(sne), p5(e) && c.push(mne), i < 99 && c.push(fne), !e.experimentalDecorators && (i < 99 || !o) && c.push(ane), c.push(nne), i < 8 && c.push(_ne), i < 7 && c.push(une), i < 6 && c.push(lne), i < 5 && c.push(cne), i < 4 && c.push(one), i < 3 && c.push(gne), i < 2 && (c.push(hne), c.push(yne)), c.push(vRe(s)), Fn(c, t && lr(t.after, s1e)), c;
- }
- function SRe(e) {
- const t = [];
- return t.push(gW), Fn(t, e && lr(e.afterDeclarations, xRe)), t;
- }
- function TRe(e) {
- return (t) => ete(t) ? e.transformBundle(t) : e.transformSourceFile(t);
- }
- function i1e(e, t) {
- return (n) => {
- const i = e(n);
- return typeof i == "function" ? t(n, i) : TRe(i);
- };
- }
- function s1e(e) {
- return i1e(e, Fd);
- }
- function xRe(e) {
- return i1e(e, (t, n) => n);
- }
- function OD(e, t) {
- return t;
- }
- function FA(e, t, n) {
- n(e, t);
- }
- function LA(e, t, n, i, s, o, c) {
- var _, u;
- const d = new Array(
- 357
- /* Count */
- );
- let g, h, S, T = 0, C = [], D = [], P = [], I = [], F = 0, O = !1, B = [], z = 0, X, q, V = OD, ae = FA, ee = 0;
- const G = [], ue = {
- factory: n,
- getCompilerOptions: () => i,
- getEmitResolver: () => e,
- // TODO: GH#18217
- getEmitHost: () => t,
- // TODO: GH#18217
- getEmitHelperFactory: Iu(() => Fee(ue)),
- startLexicalEnvironment: we,
- suspendLexicalEnvironment: fe,
- resumeLexicalEnvironment: Me,
- endLexicalEnvironment: Qe,
- setLexicalEnvironmentFlags: et,
- getLexicalEnvironmentFlags: Re,
- hoistVariableDeclaration: ve,
- hoistFunctionDeclaration: tt,
- addInitializationStatement: Te,
- startBlockScope: ft,
- endBlockScope: Wt,
- addBlockScopedVariable: _r,
- requestEmitHelper: Ir,
- readEmitHelpers: jr,
- enableSubstitution: J,
- enableEmitNotification: he,
- isSubstitutionEnabled: oe,
- isEmitNotificationEnabled: le,
- get onSubstituteNode() {
- return V;
- },
- set onSubstituteNode(Qt) {
- E.assert(ee < 1, "Cannot modify transformation hooks after initialization has completed."), E.assert(Qt !== void 0, "Value must not be 'undefined'"), V = Qt;
- },
- get onEmitNode() {
- return ae;
- },
- set onEmitNode(Qt) {
- E.assert(ee < 1, "Cannot modify transformation hooks after initialization has completed."), E.assert(Qt !== void 0, "Value must not be 'undefined'"), ae = Qt;
- },
- addDiagnostic(Qt) {
- G.push(Qt);
- }
- };
- for (const Qt of s)
- xJ(Tr(fs(Qt)));
- Ko("beforeTransform");
- const re = o.map((Qt) => Qt(ue)), ne = (Qt) => {
- for (const Br of re)
- Qt = Br(Qt);
- return Qt;
- };
- ee = 1;
- const ie = [];
- for (const Qt of s)
- (_ = rn) == null || _.push(rn.Phase.Emit, "transformNodes", Qt.kind === 307 ? { path: Qt.path } : { kind: Qt.kind, pos: Qt.pos, end: Qt.end }), ie.push((c ? ne : Se)(Qt)), (u = rn) == null || u.pop();
- return ee = 2, Ko("afterTransform"), rp("transformTime", "beforeTransform", "afterTransform"), {
- transformed: ie,
- substituteNode: _e,
- emitNodeWithNotification: me,
- isEmitNotificationEnabled: le,
- dispose: Nt,
- diagnostics: G
- };
- function Se(Qt) {
- return Qt && (!Si(Qt) || !Qt.isDeclarationFile) ? ne(Qt) : Qt;
- }
- function J(Qt) {
- E.assert(ee < 2, "Cannot modify the transformation context after transformation has completed."), d[Qt] |= 1;
- }
- function oe(Qt) {
- return (d[Qt.kind] & 1) !== 0 && (ya(Qt) & 8) === 0;
- }
- function _e(Qt, Br) {
- return E.assert(ee < 3, "Cannot substitute a node after the result is disposed."), Br && oe(Br) && V(Qt, Br) || Br;
- }
- function he(Qt) {
- E.assert(ee < 2, "Cannot modify the transformation context after transformation has completed."), d[Qt] |= 2;
- }
- function le(Qt) {
- return (d[Qt.kind] & 2) !== 0 || (ya(Qt) & 4) !== 0;
- }
- function me(Qt, Br, xr) {
- E.assert(ee < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."), Br && (le(Br) ? ae(Qt, Br, xr) : xr(Qt, Br));
- }
- function ve(Qt) {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed.");
- const Br = an(
- n.createVariableDeclaration(Qt),
- 128
- /* NoNestedSourceMaps */
- );
- g ? g.push(Br) : g = [Br], T & 1 && (T |= 2);
- }
- function tt(Qt) {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), an(
- Qt,
- 2097152
- /* CustomPrologue */
- ), h ? h.push(Qt) : h = [Qt];
- }
- function Te(Qt) {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), an(
- Qt,
- 2097152
- /* CustomPrologue */
- ), S ? S.push(Qt) : S = [Qt];
- }
- function we() {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), E.assert(!O, "Lexical environment is suspended."), C[F] = g, D[F] = h, P[F] = S, I[F] = T, F++, g = void 0, h = void 0, S = void 0, T = 0;
- }
- function fe() {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), E.assert(!O, "Lexical environment is already suspended."), O = !0;
- }
- function Me() {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), E.assert(O, "Lexical environment is not suspended."), O = !1;
- }
- function Qe() {
- E.assert(ee > 0, "Cannot modify the lexical environment during initialization."), E.assert(ee < 2, "Cannot modify the lexical environment after transformation has completed."), E.assert(!O, "Lexical environment is suspended.");
- let Qt;
- if (g || h || S) {
- if (h && (Qt = [...h]), g) {
- const Br = n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList(g)
- );
- an(
- Br,
- 2097152
- /* CustomPrologue */
- ), Qt ? Qt.push(Br) : Qt = [Br];
- }
- S && (Qt ? Qt = [...Qt, ...S] : Qt = [...S]);
- }
- return F--, g = C[F], h = D[F], S = P[F], T = I[F], F === 0 && (C = [], D = [], P = [], I = []), Qt;
- }
- function et(Qt, Br) {
- T = Br ? T | Qt : T & ~Qt;
- }
- function Re() {
- return T;
- }
- function ft() {
- E.assert(ee > 0, "Cannot start a block scope during initialization."), E.assert(ee < 2, "Cannot start a block scope after transformation has completed."), B[z] = X, z++, X = void 0;
- }
- function Wt() {
- E.assert(ee > 0, "Cannot end a block scope during initialization."), E.assert(ee < 2, "Cannot end a block scope after transformation has completed.");
- const Qt = ut(X) ? [
- n.createVariableStatement(
- /*modifiers*/
- void 0,
- n.createVariableDeclarationList(
- X.map((Br) => n.createVariableDeclaration(Br)),
- 1
- /* Let */
- )
- )
- ] : void 0;
- return z--, X = B[z], z === 0 && (B = []), Qt;
- }
- function _r(Qt) {
- E.assert(z > 0, "Cannot add a block scoped variable outside of an iteration body."), (X || (X = [])).push(Qt);
- }
- function Ir(Qt) {
- if (E.assert(ee > 0, "Cannot modify the transformation context during initialization."), E.assert(ee < 2, "Cannot modify the transformation context after transformation has completed."), E.assert(!Qt.scoped, "Cannot request a scoped emit helper."), Qt.dependencies)
- for (const Br of Qt.dependencies)
- Ir(Br);
- q = wr(q, Qt);
- }
- function jr() {
- E.assert(ee > 0, "Cannot modify the transformation context during initialization."), E.assert(ee < 2, "Cannot modify the transformation context after transformation has completed.");
- const Qt = q;
- return q = void 0, Qt;
- }
- function Nt() {
- if (ee < 3) {
- for (const Qt of s)
- xJ(Tr(fs(Qt)));
- g = void 0, C = void 0, h = void 0, D = void 0, V = void 0, ae = void 0, q = void 0, ee = 3;
- }
- }
- }
- var MA = {
- factory: A,
- // eslint-disable-line object-shorthand
- getCompilerOptions: () => ({}),
- getEmitResolver: Vs,
- getEmitHost: Vs,
- getEmitHelperFactory: Vs,
- startLexicalEnvironment: ja,
- resumeLexicalEnvironment: ja,
- suspendLexicalEnvironment: ja,
- endLexicalEnvironment: lb,
- setLexicalEnvironmentFlags: ja,
- getLexicalEnvironmentFlags: () => 0,
- hoistVariableDeclaration: ja,
- hoistFunctionDeclaration: ja,
- addInitializationStatement: ja,
- startBlockScope: ja,
- endBlockScope: lb,
- addBlockScopedVariable: ja,
- requestEmitHelper: ja,
- readEmitHelpers: Vs,
- enableSubstitution: ja,
- enableEmitNotification: ja,
- isSubstitutionEnabled: Vs,
- isEmitNotificationEnabled: Vs,
- onSubstituteNode: OD,
- onEmitNode: FA,
- addDiagnostic: ja
- }, a1e = CRe();
- function Dne(e) {
- return qo(
- e,
- ".tsbuildinfo"
- /* TsBuildInfo */
- );
- }
- function hW(e, t, n, i = !1, s, o) {
- const c = us(n) ? n : V7(e, n, i), _ = e.getCompilerOptions();
- if (!s)
- if (_.outFile) {
- if (c.length) {
- const u = A.createBundle(c), d = t(FD(u, e, i), u);
- if (d)
- return d;
- }
- } else
- for (const u of c) {
- const d = t(FD(u, e, i), u);
- if (d)
- return d;
- }
- if (o) {
- const u = bv(_);
- if (u) return t(
- { buildInfoPath: u },
- /*sourceFileOrBundle*/
- void 0
- );
- }
- }
- function bv(e) {
- const t = e.configFilePath;
- if (!kRe(e)) return;
- if (e.tsBuildInfoFile) return e.tsBuildInfoFile;
- const n = e.outFile;
- let i;
- if (n)
- i = $u(n);
- else {
- if (!t) return;
- const s = $u(t);
- i = e.outDir ? e.rootDir ? z1(e.outDir, ld(
- e.rootDir,
- s,
- /*ignoreCase*/
- !0
- )) : Bn(e.outDir, Hc(s)) : s;
- }
- return i + ".tsbuildinfo";
- }
- function kRe(e) {
- return Nb(e) || !!e.tscBuild;
- }
- function Pne(e, t) {
- const n = e.outFile, i = e.emitDeclarationOnly ? void 0 : n, s = i && o1e(i, e), o = t || P_(e) ? $u(n) + ".d.ts" : void 0, c = o && l5(e) ? o + ".map" : void 0;
- return { jsFilePath: i, sourceMapFilePath: s, declarationFilePath: o, declarationMapPath: c };
- }
- function FD(e, t, n) {
- const i = t.getCompilerOptions();
- if (e.kind === 308)
- return Pne(i, n);
- {
- const s = nK(e.fileName, t, tF(e.fileName, i)), o = Rp(e), c = o && Sh(e.fileName, s, t.getCurrentDirectory(), !t.useCaseSensitiveFileNames()) === 0, _ = i.emitDeclarationOnly || c ? void 0 : s, u = !_ || Rp(e) ? void 0 : o1e(_, i), d = n || P_(i) && !o ? iK(e.fileName, t) : void 0, g = d && l5(i) ? d + ".map" : void 0;
- return { jsFilePath: _, sourceMapFilePath: u, declarationFilePath: d, declarationMapPath: g };
- }
- }
- function o1e(e, t) {
- return t.sourceMap && !t.inlineSourceMap ? e + ".map" : void 0;
- }
- function tF(e, t) {
- return qo(
- e,
- ".json"
- /* Json */
- ) ? ".json" : t.jsx === 1 && xc(e, [
- ".jsx",
- ".tsx"
- /* Tsx */
- ]) ? ".jsx" : xc(e, [
- ".mts",
- ".mjs"
- /* Mjs */
- ]) ? ".mjs" : xc(e, [
- ".cts",
- ".cjs"
- /* Cjs */
- ]) ? ".cjs" : ".js";
- }
- function c1e(e, t, n, i) {
- return n ? z1(
- n,
- ld(i(), e, t)
- ) : e;
- }
- function p6(e, t, n, i = () => Gx(t, n)) {
- return yW(e, t.options, n, i);
- }
- function yW(e, t, n, i) {
- return zy(
- c1e(e, n, t.declarationDir || t.outDir, i),
- W7(e)
- );
- }
- function l1e(e, t, n, i = () => Gx(t, n)) {
- if (t.options.emitDeclarationOnly) return;
- const s = qo(
- e,
- ".json"
- /* Json */
- ), o = vW(e, t.options, n, i);
- return !s || Sh(e, o, E.checkDefined(t.options.configFilePath), n) !== 0 ? o : void 0;
- }
- function vW(e, t, n, i) {
- return zy(
- c1e(e, n, t.outDir, i),
- tF(e, t)
- );
- }
- function u1e() {
- let e;
- return { addOutput: t, getOutputs: n };
- function t(i) {
- i && (e || (e = [])).push(i);
- }
- function n() {
- return e || Ue;
- }
- }
- function _1e(e, t) {
- const { jsFilePath: n, sourceMapFilePath: i, declarationFilePath: s, declarationMapPath: o } = Pne(
- e.options,
- /*forceDtsPaths*/
- !1
- );
- t(n), t(i), t(s), t(o);
- }
- function f1e(e, t, n, i, s) {
- if (wl(t)) return;
- const o = l1e(t, e, n, s);
- if (i(o), !qo(
- t,
- ".json"
- /* Json */
- ) && (o && e.options.sourceMap && i(`${o}.map`), P_(e.options))) {
- const c = p6(t, e, n, s);
- i(c), e.options.declarationMap && i(`${c}.map`);
- }
- }
- function LD(e, t, n, i, s) {
- let o;
- return e.rootDir ? (o = es(e.rootDir, n), s?.(e.rootDir)) : e.composite && e.configFilePath ? (o = Xn(Wl(e.configFilePath)), s?.(o)) : o = Mne(t(), n, i), o && o[o.length - 1] !== Vo && (o += Vo), o;
- }
- function Gx({ options: e, fileNames: t }, n) {
- return LD(
- e,
- () => Ln(t, (i) => !(e.noEmitForJsFiles && xc(i, jC)) && !wl(i)),
- Xn(Wl(E.checkDefined(e.configFilePath))),
- zl(!n)
- );
- }
- function rF(e, t) {
- const { addOutput: n, getOutputs: i } = u1e();
- if (e.options.outFile)
- _1e(e, n);
- else {
- const s = Iu(() => Gx(e, t));
- for (const o of e.fileNames)
- f1e(e, o, t, n, s);
- }
- return n(bv(e.options)), i();
- }
- function p1e(e, t, n) {
- t = Os(t), E.assert(ss(e.fileNames, t), "Expected fileName to be present in command line");
- const { addOutput: i, getOutputs: s } = u1e();
- return e.options.outFile ? _1e(e, i) : f1e(e, t, n, i), s();
- }
- function bW(e, t) {
- if (e.options.outFile) {
- const { jsFilePath: s, declarationFilePath: o } = Pne(
- e.options,
- /*forceDtsPaths*/
- !1
- );
- return E.checkDefined(s || o, `project ${e.options.configFilePath} expected to have at least one output`);
- }
- const n = Iu(() => Gx(e, t));
- for (const s of e.fileNames) {
- if (wl(s)) continue;
- const o = l1e(s, e, t, n);
- if (o) return o;
- if (!qo(
- s,
- ".json"
- /* Json */
- ) && P_(e.options))
- return p6(s, e, t, n);
- }
- const i = bv(e.options);
- return i || E.fail(`project ${e.options.configFilePath} expected to have at least one output`);
- }
- function SW(e, t) {
- return !!t && !!e;
- }
- function TW(e, t, n, { scriptTransformers: i, declarationTransformers: s }, o, c, _, u) {
- var d = t.getCompilerOptions(), g = d.sourceMap || d.inlineSourceMap || l5(d) ? [] : void 0, h = d.listEmittedFiles ? [] : void 0, S = x3(), T = k0(d), C = E3(T), { enter: D, exit: P } = ER("printTime", "beforePrint", "afterPrint"), I = !1;
- return D(), hW(
- t,
- F,
- V7(t, n, _),
- _,
- c,
- !n && !u
- ), P(), {
- emitSkipped: I,
- diagnostics: S.getDiagnostics(),
- emittedFiles: h,
- sourceMaps: g
- };
- function F({ jsFilePath: re, sourceMapFilePath: ne, declarationFilePath: ie, declarationMapPath: Se, buildInfoPath: J }, oe) {
- var _e, he, le, me, ve, tt;
- (_e = rn) == null || _e.push(rn.Phase.Emit, "emitJsFileOrBundle", { jsFilePath: re }), B(oe, re, ne), (he = rn) == null || he.pop(), (le = rn) == null || le.push(rn.Phase.Emit, "emitDeclarationFileOrBundle", { declarationFilePath: ie }), z(oe, ie, Se), (me = rn) == null || me.pop(), (ve = rn) == null || ve.push(rn.Phase.Emit, "emitBuildInfo", { buildInfoPath: J }), O(J), (tt = rn) == null || tt.pop();
- }
- function O(re) {
- if (!re || n) return;
- if (t.isEmitBlocked(re)) {
- I = !0;
- return;
- }
- const ne = t.getBuildInfo() || { version: U_ };
- H7(
- t,
- S,
- re,
- wne(ne),
- /*writeByteOrderMark*/
- !1,
- /*sourceFiles*/
- void 0,
- { buildInfo: ne }
- ), h?.push(re);
- }
- function B(re, ne, ie) {
- if (!re || o || !ne)
- return;
- if (t.isEmitBlocked(ne) || d.noEmit) {
- I = !0;
- return;
- }
- (Si(re) ? [re] : Ln(re.sourceFiles, D7)).forEach(
- (_e) => {
- (d.noCheck || !U4(_e, d)) && q(_e);
- }
- );
- const Se = LA(
- e,
- t,
- A,
- d,
- [re],
- i,
- /*allowDtsFiles*/
- !1
- ), J = {
- removeComments: d.removeComments,
- newLine: d.newLine,
- noEmitHelpers: d.noEmitHelpers,
- module: Ru(d),
- moduleResolution: yu(d),
- target: pa(d),
- sourceMap: d.sourceMap,
- inlineSourceMap: d.inlineSourceMap,
- inlineSources: d.inlineSources,
- extendedDiagnostics: d.extendedDiagnostics
- }, oe = Ky(J, {
- // resolver hooks
- hasGlobalName: e.hasGlobalName,
- // transform hooks
- onEmitNode: Se.emitNodeWithNotification,
- isEmitNotificationEnabled: Se.isEmitNotificationEnabled,
- substituteNode: Se.substituteNode
- });
- E.assert(Se.transformed.length === 1, "Should only see one output from the transform"), V(ne, ie, Se, oe, d), Se.dispose(), h && (h.push(ne), ie && h.push(ie));
- }
- function z(re, ne, ie) {
- if (!re || o === 0) return;
- if (!ne) {
- (o || d.emitDeclarationOnly) && (I = !0);
- return;
- }
- const Se = Si(re) ? [re] : re.sourceFiles, J = _ ? Se : Ln(Se, D7), oe = d.outFile ? [A.createBundle(J)] : J;
- J.forEach((le) => {
- (o && !P_(d) || d.noCheck || SW(o, _) || !U4(le, d)) && X(le);
- });
- const _e = LA(
- e,
- t,
- A,
- d,
- oe,
- s,
- /*allowDtsFiles*/
- !1
- );
- if (Nr(_e.diagnostics))
- for (const le of _e.diagnostics)
- S.add(le);
- const he = !!_e.diagnostics && !!_e.diagnostics.length || !!t.isEmitBlocked(ne) || !!d.noEmit;
- if (I = I || he, !he || _) {
- E.assert(_e.transformed.length === 1, "Should only see one output from the decl transform");
- const le = {
- removeComments: d.removeComments,
- newLine: d.newLine,
- noEmitHelpers: !0,
- module: d.module,
- moduleResolution: d.moduleResolution,
- target: d.target,
- sourceMap: o !== 2 && d.declarationMap,
- inlineSourceMap: d.inlineSourceMap,
- extendedDiagnostics: d.extendedDiagnostics,
- onlyPrintJsDocStyle: !0,
- omitBraceSourceMapPositions: !0
- }, me = Ky(le, {
- // resolver hooks
- hasGlobalName: e.hasGlobalName,
- // transform hooks
- onEmitNode: _e.emitNodeWithNotification,
- isEmitNotificationEnabled: _e.isEmitNotificationEnabled,
- substituteNode: _e.substituteNode
- }), ve = V(
- ne,
- ie,
- _e,
- me,
- {
- sourceMap: le.sourceMap,
- sourceRoot: d.sourceRoot,
- mapRoot: d.mapRoot,
- extendedDiagnostics: d.extendedDiagnostics
- // Explicitly do not passthru either `inline` option
- }
- );
- h && (ve && h.push(ne), ie && h.push(ie));
- }
- _e.dispose();
- }
- function X(re) {
- if (wo(re)) {
- re.expression.kind === 80 && e.collectLinkedAliases(
- re.expression,
- /*setVisibility*/
- !0
- );
- return;
- } else if (vu(re)) {
- e.collectLinkedAliases(
- re.propertyName || re.name,
- /*setVisibility*/
- !0
- );
- return;
- }
- bs(re, X);
- }
- function q(re) {
- Gu(re) || jx(re, (ne) => {
- if (gl(ne) && !(T0(ne) & 32) || ic(ne)) return "skip";
- e.markLinkedReferences(ne);
- });
- }
- function V(re, ne, ie, Se, J) {
- const oe = ie.transformed[0], _e = oe.kind === 308 ? oe : void 0, he = oe.kind === 307 ? oe : void 0, le = _e ? _e.sourceFiles : [he];
- let me;
- ae(J, oe) && (me = jre(
- t,
- Hc(Wl(re)),
- ee(J),
- G(J, re, he),
- J
- )), _e ? Se.writeBundle(_e, C, me) : Se.writeFile(he, C, me);
- let ve;
- if (me) {
- g && g.push({
- inputSourceFileNames: me.getSources(),
- sourceMap: me.toJSON()
- });
- const we = ue(
- J,
- me,
- re,
- ne,
- he
- );
- if (we && (C.isAtStartOfLine() || C.rawWrite(T), ve = C.getTextPos(), C.writeComment(`//# sourceMappingURL=${we}`)), ne) {
- const fe = me.toString();
- H7(
- t,
- S,
- ne,
- fe,
- /*writeByteOrderMark*/
- !1,
- le
- );
- }
- } else
- C.writeLine();
- const tt = C.getText(), Te = { sourceMapUrlPos: ve, diagnostics: ie.diagnostics };
- return H7(t, S, re, tt, !!d.emitBOM, le, Te), C.clear(), !Te.skippedDtsWrite;
- }
- function ae(re, ne) {
- return (re.sourceMap || re.inlineSourceMap) && (ne.kind !== 307 || !qo(
- ne.fileName,
- ".json"
- /* Json */
- ));
- }
- function ee(re) {
- const ne = Wl(re.sourceRoot || "");
- return ne && ul(ne);
- }
- function G(re, ne, ie) {
- if (re.sourceRoot) return t.getCommonSourceDirectory();
- if (re.mapRoot) {
- let Se = Wl(re.mapRoot);
- return ie && (Se = Xn(q7(ie.fileName, t, Se))), Km(Se) === 0 && (Se = Bn(t.getCommonSourceDirectory(), Se)), Se;
- }
- return Xn(Os(ne));
- }
- function ue(re, ne, ie, Se, J) {
- if (re.inlineSourceMap) {
- const _e = ne.toString();
- return `data:application/json;base64,${TK(ll, _e)}`;
- }
- const oe = Hc(Wl(E.checkDefined(Se)));
- if (re.mapRoot) {
- let _e = Wl(re.mapRoot);
- return J && (_e = Xn(q7(J.fileName, t, _e))), Km(_e) === 0 ? (_e = Bn(t.getCommonSourceDirectory(), _e), encodeURI(
- jT(
- Xn(Os(ie)),
- // get the relative sourceMapDir path based on jsFilePath
- Bn(_e, oe),
- // this is where user expects to see sourceMap
- t.getCurrentDirectory(),
- t.getCanonicalFileName,
- /*isAbsolutePathAnUrl*/
- !0
- )
- )) : encodeURI(Bn(_e, oe));
- }
- return encodeURI(oe);
- }
- }
- function wne(e) {
- return JSON.stringify(e);
- }
- function xW(e, t) {
- return BB(e, t);
- }
- var Ane = {
- hasGlobalName: Vs,
- getReferencedExportContainer: Vs,
- getReferencedImportDeclaration: Vs,
- getReferencedDeclarationWithCollidingName: Vs,
- isDeclarationWithCollidingName: Vs,
- isValueAliasDeclaration: Vs,
- isReferencedAliasDeclaration: Vs,
- isTopLevelValueImportEqualsWithEntityName: Vs,
- hasNodeCheckFlag: Vs,
- isDeclarationVisible: Vs,
- isLateBound: (e) => !1,
- collectLinkedAliases: Vs,
- markLinkedReferences: Vs,
- isImplementationOfOverload: Vs,
- requiresAddingImplicitUndefined: Vs,
- isExpandoFunctionDeclaration: Vs,
- getPropertiesOfContainerFunction: Vs,
- createTypeOfDeclaration: Vs,
- createReturnTypeOfSignatureDeclaration: Vs,
- createTypeOfExpression: Vs,
- createLiteralConstValue: Vs,
- isSymbolAccessible: Vs,
- isEntityNameVisible: Vs,
- // Returns the constant value this property access resolves to: notImplemented, or 'undefined' for a non-constant
- getConstantValue: Vs,
- getEnumMemberValue: Vs,
- getReferencedValueDeclaration: Vs,
- getReferencedValueDeclarations: Vs,
- getTypeReferenceSerializationKind: Vs,
- isOptionalParameter: Vs,
- isArgumentsLocalBinding: Vs,
- getExternalModuleFileFromDeclaration: Vs,
- isLiteralConstDeclaration: Vs,
- getJsxFactoryEntity: Vs,
- getJsxFragmentFactoryEntity: Vs,
- isBindingCapturedByNode: Vs,
- getDeclarationStatementsForSourceFile: Vs,
- isImportRequiredByAugmentation: Vs,
- isDefinitelyReferenceToGlobalSymbolObject: Vs
- }, Nne = /* @__PURE__ */ Iu(() => Ky({})), $b = /* @__PURE__ */ Iu(() => Ky({ removeComments: !0 })), Ine = /* @__PURE__ */ Iu(() => Ky({ removeComments: !0, neverAsciiEscape: !0 })), kW = /* @__PURE__ */ Iu(() => Ky({ removeComments: !0, omitTrailingSemicolon: !0 }));
- function Ky(e = {}, t = {}) {
- var {
- hasGlobalName: n,
- onEmitNode: i = FA,
- isEmitNotificationEnabled: s,
- substituteNode: o = OD,
- onBeforeEmitNode: c,
- onAfterEmitNode: _,
- onBeforeEmitNodeArray: u,
- onAfterEmitNodeArray: d,
- onBeforeEmitToken: g,
- onAfterEmitToken: h
- } = t, S = !!e.extendedDiagnostics, T = !!e.omitBraceSourceMapPositions, C = k0(e), D = Ru(e), P = /* @__PURE__ */ new Map(), I, F, O, B, z, X, q, V, ae, ee, G, ue, re, ne, ie, Se = e.preserveSourceNewlines, J, oe, _e, he = q6, le, me = !0, ve, tt, Te = -1, we, fe = -1, Me = -1, Qe = -1, et = -1, Re, ft, Wt = !1, _r = !!e.removeComments, Ir, jr, { enter: Nt, exit: Qt } = kme(S, "commentTime", "beforeComment", "afterComment"), Br = A.parenthesizer, xr = {
- select: (k) => k === 0 ? Br.parenthesizeLeadingTypeArgument : void 0
- }, zn = yl();
- return Ws(), {
- // public API
- printNode: ki,
- printList: rs,
- printFile: Ri,
- printBundle: ei,
- // internal API
- writeNode: Jr,
- writeList: ji,
- writeFile: Ot,
- writeBundle: Fe
- };
- function ki(k, ce, pt) {
- switch (k) {
- case 0:
- E.assert(Si(ce), "Expected a SourceFile node.");
- break;
- case 2:
- E.assert(Oe(ce), "Expected an Identifier node.");
- break;
- case 1:
- E.assert(_t(ce), "Expected an Expression node.");
- break;
- }
- switch (ce.kind) {
- case 307:
- return Ri(ce);
- case 308:
- return ei(ce);
- }
- return Jr(k, ce, pt, Ar()), mn();
- }
- function rs(k, ce, pt) {
- return ji(k, ce, pt, Ar()), mn();
- }
- function ei(k) {
- return Fe(
- k,
- Ar(),
- /*sourceMapGenerator*/
- void 0
- ), mn();
- }
- function Ri(k) {
- return Ot(
- k,
- Ar(),
- /*sourceMapGenerator*/
- void 0
- ), mn();
- }
- function Jr(k, ce, pt, Yt) {
- const ai = oe;
- Oi(
- Yt,
- /*_sourceMapGenerator*/
- void 0
- ), ti(k, ce, pt), Ws(), oe = ai;
- }
- function ji(k, ce, pt, Yt) {
- const ai = oe;
- Oi(
- Yt,
- /*_sourceMapGenerator*/
- void 0
- ), pt && qn(pt), Do(
- /*parentNode*/
- void 0,
- ce,
- k
- ), Ws(), oe = ai;
- }
- function Fe(k, ce, pt) {
- le = !1;
- const Yt = oe;
- Oi(ce, pt), H0(k), gd(k), Zt(k), Rv(k);
- for (const ai of k.sourceFiles)
- ti(0, ai, ai);
- Ws(), oe = Yt;
- }
- function Ot(k, ce, pt) {
- le = !0;
- const Yt = oe;
- Oi(ce, pt), H0(k), gd(k), ti(0, k, k), Ws(), oe = Yt;
- }
- function Ar() {
- return _e || (_e = E3(C));
- }
- function mn() {
- const k = _e.getText();
- return _e.clear(), k;
- }
- function ti(k, ce, pt) {
- pt && qn(pt), K(
- k,
- ce,
- /*parenthesizerRule*/
- void 0
- );
- }
- function qn(k) {
- I = k, Re = void 0, ft = void 0, k && rT(k);
- }
- function Oi(k, ce) {
- k && e.omitTrailingSemicolon && (k = EB(k)), oe = k, ve = ce, me = !oe || !ve;
- }
- function Ws() {
- F = [], O = [], B = [], z = /* @__PURE__ */ new Set(), X = [], q = /* @__PURE__ */ new Map(), V = [], ae = 0, ee = [], G = 0, ue = [], re = void 0, ne = [], ie = void 0, I = void 0, Re = void 0, ft = void 0, Oi(
- /*output*/
- void 0,
- /*_sourceMapGenerator*/
- void 0
- );
- }
- function Hs() {
- return Re || (Re = Ag(E.checkDefined(I)));
- }
- function rr(k, ce) {
- k !== void 0 && K(4, k, ce);
- }
- function Ea(k) {
- k !== void 0 && K(
- 2,
- k,
- /*parenthesizerRule*/
- void 0
- );
- }
- function Xe(k, ce) {
- k !== void 0 && K(1, k, ce);
- }
- function Tt(k) {
- K(oa(k) ? 6 : 4, k);
- }
- function te(k) {
- Se && _d(k) & 4 && (Se = !1);
- }
- function ze(k) {
- Se = k;
- }
- function K(k, ce, pt) {
- jr = pt, Ke(0, k, ce)(k, ce), jr = void 0;
- }
- function De(k) {
- return !_r && !Si(k);
- }
- function Ve(k) {
- return !me && !Si(k) && !E7(k);
- }
- function Ke(k, ce, pt) {
- switch (k) {
- case 0:
- if (i !== FA && (!s || s(pt)))
- return at;
- case 1:
- if (o !== OD && (Ir = o(ce, pt) || pt) !== pt)
- return jr && (Ir = jr(Ir)), Vt;
- case 2:
- if (De(pt))
- return bk;
- case 3:
- if (Ve(pt))
- return h2;
- case 4:
- return $e;
- default:
- return E.assertNever(k);
- }
- }
- function xe(k, ce, pt) {
- return Ke(k + 1, ce, pt);
- }
- function at(k, ce) {
- const pt = xe(0, k, ce);
- i(k, ce, pt);
- }
- function $e(k, ce) {
- if (c?.(ce), Se) {
- const pt = Se;
- te(ce), bt(k, ce), ze(pt);
- } else
- bt(k, ce);
- _?.(ce), jr = void 0;
- }
- function bt(k, ce, pt = !0) {
- if (pt) {
- const Yt = kJ(ce);
- if (Yt)
- return dt(k, ce, Yt);
- }
- if (k === 0) return Im(Bs(ce, Si));
- if (k === 2) return Z(Bs(ce, Oe));
- if (k === 6) return Ae(
- Bs(ce, oa),
- /*jsxAttributeEscape*/
- !0
- );
- if (k === 3) return He(Bs(ce, zo));
- if (k === 7) return fr(Bs(ce, hS));
- if (k === 5)
- return E.assertNode(ce, MJ), r_(
- /*isEmbeddedStatement*/
- !0
- );
- if (k === 4) {
- switch (ce.kind) {
- case 16:
- case 17:
- case 18:
- return Ae(
- ce,
- /*jsxAttributeEscape*/
- !1
- );
- case 80:
- return Z(ce);
- case 81:
- return ht(ce);
- case 166:
- return Le(ce);
- case 167:
- return At(ce);
- case 168:
- return Dr(ce);
- case 169:
- return yr(ce);
- case 170:
- return $r(ce);
- case 171:
- return nt(ce);
- case 172:
- return ot(ce);
- case 173:
- return wt(ce);
- case 174:
- return jt(ce);
- case 175:
- return Xt(ce);
- case 176:
- return Ht(ce);
- case 177:
- case 178:
- return en(ce);
- case 179:
- return zt(ce);
- case 180:
- return mr(ce);
- case 181:
- return Kt(ce);
- case 182:
- return Ss(ce);
- case 183:
- return gs(ce);
- case 184:
- return Ts(ce);
- case 185:
- return Ll(ce);
- case 186:
- return xs(ce);
- case 187:
- return Cu(ce);
- case 188:
- return Zc(ce);
- case 189:
- return Na(ce);
- case 190:
- return Vi(ce);
- case 192:
- return ba(ce);
- case 193:
- return Bt(ce);
- case 194:
- return to(ce);
- case 195:
- return _u(ce);
- case 196:
- return Wc(ce);
- case 233:
- return A_(ce);
- case 197:
- return of();
- case 198:
- return Ao(ce);
- case 199:
- return ge(ce);
- case 200:
- return $(ce);
- case 201:
- return rt(ce);
- case 202:
- return Ia(ce);
- case 203:
- return Ct(ce);
- case 204:
- return hr(ce);
- case 205:
- return $t(ce);
- case 206:
- return zr(ce);
- case 207:
- return $n(ce);
- case 208:
- return ar(ce);
- case 239:
- return Qp(ce);
- case 240:
- return Ft();
- case 241:
- return y_(ce);
- case 243:
- return Uh(ce);
- case 242:
- return r_(
- /*isEmbeddedStatement*/
- !1
- );
- case 244:
- return Zg(ce);
- case 245:
- return Vf(ce);
- case 246:
- return st(ce);
- case 247:
- return It(ce);
- case 248:
- return Mt(ce);
- case 249:
- return Sr(ce);
- case 250:
- return Vr(ce);
- case 251:
- return si(ce);
- case 252:
- return L(ce);
- case 253:
- return ns(ce);
- case 254:
- return Ds(ce);
- case 255:
- return Pa(ce);
- case 256:
- return ga(ce);
- case 257:
- return $o(ce);
- case 258:
- return vp(ce);
- case 259:
- return dd(ce);
- case 260:
- return jd(ce);
- case 261:
- return Kg(ce);
- case 262:
- return J0(ce);
- case 263:
- return dg(ce);
- case 264:
- return z0(ce);
- case 265:
- return Zp(ce);
- case 266:
- return Nv(ce);
- case 267:
- return qf(ce);
- case 268:
- return Kp(ce);
- case 269:
- return qh(ce);
- case 270:
- return Dn(ce);
- case 271:
- return Iv(ce);
- case 272:
- return rh(ce);
- case 273:
- return Ov(ce);
- case 274:
- return n1(ce);
- case 280:
- return di(ce);
- case 275:
- return Ne(ce);
- case 276:
- return qe(ce);
- case 277:
- return vt(ce);
- case 278:
- return qt(ce);
- case 279:
- return _n(ce);
- case 281:
- return yi(ce);
- case 300:
- return qr(ce);
- case 301:
- return kr(ce);
- case 282:
- return;
- case 283:
- return po(ce);
- case 12:
- return zu(ce);
- case 286:
- case 289:
- return td(ce);
- case 287:
- case 290:
- return o2(ce);
- case 291:
- return nh(ce);
- case 292:
- return i1(ce);
- case 293:
- return Hh(ce);
- case 294:
- return s1(ce);
- case 295:
- return a1(ce);
- case 296:
- return jS(ce);
- case 297:
- return Fv(ce);
- case 298:
- return c2(ce);
- case 299:
- return BS(ce);
- case 303:
- return Lv(ce);
- case 304:
- return ih(ce);
- case 305:
- return sh(ce);
- case 306:
- return Hf(ce);
- case 307:
- return Im(ce);
- case 308:
- return E.fail("Bundles should be printed using printBundle");
- case 309:
- return zd(ce);
- case 310:
- return V6(ce);
- case 312:
- return Sn("*");
- case 313:
- return Sn("?");
- case 314:
- return io(ce);
- case 315:
- return vi(ce);
- case 316:
- return ca(ce);
- case 317:
- return Ic(ce);
- case 191:
- case 318:
- return Yi(ce);
- case 319:
- return;
- case 320:
- return lf(ce);
- case 322:
- return Gh(ce);
- case 323:
- return O_(ce);
- case 327:
- case 332:
- case 337:
- return fu(ce);
- case 328:
- case 329:
- return xl(ce);
- case 330:
- case 331:
- return;
- case 333:
- case 334:
- case 335:
- case 336:
- return;
- case 338:
- return gg(ce);
- case 339:
- return fk(ce);
- case 341:
- case 348:
- return Mv(ce);
- case 340:
- case 342:
- case 343:
- case 344:
- case 349:
- case 350:
- return uf(ce);
- case 345:
- return Jd(ce);
- case 346:
- return V0(ce);
- case 347:
- return I_(ce);
- case 351:
- return c1(ce);
- case 353:
- return;
- }
- if (_t(ce) && (k = 1, o !== OD)) {
- const Yt = o(k, ce) || ce;
- Yt !== ce && (ce = Yt, jr && (ce = jr(ce)));
- }
- }
- if (k === 1)
- switch (ce.kind) {
- case 9:
- case 10:
- return M(ce);
- case 11:
- case 14:
- case 15:
- return Ae(
- ce,
- /*jsxAttributeEscape*/
- !1
- );
- case 80:
- return Z(ce);
- case 81:
- return ht(ce);
- case 209:
- return An(ce);
- case 210:
- return ri(ce);
- case 211:
- return Fi(ce);
- case 212:
- return Uo(ce);
- case 213:
- return vc(ce);
- case 214:
- return Oc(ce);
- case 215:
- return Fc(ce);
- case 216:
- return Lo(ce);
- case 217:
- return _c(ce);
- case 218:
- return Wf(ce);
- case 219:
- return Lc(ce);
- case 220:
- return Pe(ce);
- case 221:
- return Et(ce);
- case 222:
- return Lr(ce);
- case 223:
- return $i(ce);
- case 224:
- return Sa(ce);
- case 225:
- return Pc(ce);
- case 226:
- return zn(ce);
- case 227:
- return so(ce);
- case 228:
- return Va(ce);
- case 229:
- return Uc(ce);
- case 230:
- return cf(ce);
- case 231:
- return Xp(ce);
- case 232:
- return;
- case 234:
- return Sf(ce);
- case 235:
- return Uf(ce);
- case 233:
- return A_(ce);
- case 238:
- return yp(ce);
- case 236:
- return Yg(ce);
- case 237:
- return E.fail("SyntheticExpression should never be printed.");
- case 282:
- return;
- case 284:
- return Bu(ce);
- case 285:
- return ed(ce);
- case 288:
- return Ju(ce);
- case 352:
- return E.fail("SyntaxList should not be printed");
- case 353:
- return;
- case 354:
- return Xh(ce);
- case 355:
- return dk(ce);
- case 356:
- return E.fail("SyntheticReferenceExpression should not be printed");
- }
- if (p_(ce.kind)) return VS(ce, hs);
- if (yj(ce.kind)) return VS(ce, Sn);
- E.fail(`Unhandled SyntaxKind: ${E.formatSyntaxKind(ce.kind)}.`);
- }
- function He(k) {
- rr(k.name), ln(), hs("in"), ln(), rr(k.constraint);
- }
- function Vt(k, ce) {
- const pt = xe(1, k, ce);
- E.assertIsDefined(Ir), ce = Ir, Ir = void 0, pt(k, ce);
- }
- function Zt(k) {
- let ce = !1;
- const pt = k.kind === 308 ? k : void 0;
- if (pt && D === 0)
- return;
- const Yt = pt ? pt.sourceFiles.length : 1;
- for (let ai = 0; ai < Yt; ai++) {
- const qi = pt ? pt.sourceFiles[ai] : k, Ki = Si(qi) ? qi : I, Hi = e.noEmitHelpers || !!Ki && gte(Ki), Li = Si(qi) && !le, Wu = vn(qi);
- if (Wu)
- for (const Ml of Wu) {
- if (Ml.scoped) {
- if (pt)
- continue;
- } else {
- if (Hi) continue;
- if (Li) {
- if (P.get(Ml.name))
- continue;
- P.set(Ml.name, !0);
- }
- }
- typeof Ml.text == "string" ? Om(Ml.text) : Om(Ml.text(yk)), ce = !0;
- }
- }
- return ce;
- }
- function vn(k) {
- const ce = B5(k);
- return ce && V_(ce, Lee);
- }
- function M(k) {
- Ae(
- k,
- /*jsxAttributeEscape*/
- !1
- );
- }
- function Ae(k, ce) {
- const pt = ch(
- k,
- /*sourceFile*/
- void 0,
- e.neverAsciiEscape,
- ce
- );
- (e.sourceMap || e.inlineSourceMap) && (k.kind === 11 || Dy(k.kind)) ? u2(pt) : WS(pt);
- }
- function dt(k, ce, pt) {
- switch (pt.kind) {
- case 1:
- U(k, ce, pt);
- break;
- case 0:
- be(k, ce, pt);
- break;
- }
- }
- function U(k, ce, pt) {
- US(`\${${pt.order}:`), bt(
- k,
- ce,
- /*allowSnippets*/
- !1
- ), US("}");
- }
- function be(k, ce, pt) {
- E.assert(ce.kind === 242, `A tab stop cannot be attached to a node of kind ${E.formatSyntaxKind(ce.kind)}.`), E.assert(k !== 5, "A tab stop cannot be attached to an embedded statement."), US(`$${pt.order}`);
- }
- function Z(k) {
- (k.symbol ? H6 : he)(f1(
- k,
- /*includeTrivia*/
- !1
- ), k.symbol), Do(
- k,
- _S(k),
- 53776
- /* TypeParameters */
- );
- }
- function ht(k) {
- he(f1(
- k,
- /*includeTrivia*/
- !1
- ));
- }
- function Le(k) {
- Ie(k.left), Sn("."), rr(k.right);
- }
- function Ie(k) {
- k.kind === 80 ? Xe(k) : rr(k);
- }
- function At(k) {
- Sn("["), Xe(k.expression, Br.parenthesizeExpressionOfComputedPropertyName), Sn("]");
- }
- function Dr(k) {
- ah(k, k.modifiers), rr(k.name), k.constraint && (ln(), hs("extends"), ln(), rr(k.constraint)), k.default && (ln(), X0("="), ln(), rr(k.default));
- }
- function yr(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !0
- ), rr(k.dotDotDotToken), jv(k.name, hk), rr(k.questionToken), k.parent && k.parent.kind === 317 && !k.name ? rr(k.type) : Wd(k.type), hg(k.initializer, k.type ? k.type.end : k.questionToken ? k.questionToken.end : k.name ? k.name.end : k.modifiers ? k.modifiers.end : k.pos, k, Br.parenthesizeExpressionForDisallowedComma);
- }
- function $r(k) {
- Sn("@"), Xe(k.expression, Br.parenthesizeLeftSideOfAccess);
- }
- function nt(k) {
- ah(k, k.modifiers), jv(k.name, G6), rr(k.questionToken), Wd(k.type), pu();
- }
- function ot(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !0
- ), rr(k.name), rr(k.questionToken), rr(k.exclamationToken), Wd(k.type), hg(k.initializer, k.type ? k.type.end : k.questionToken ? k.questionToken.end : k.name.end, k), pu();
- }
- function wt(k) {
- ah(k, k.modifiers), rr(k.name), rr(k.questionToken), bp(k, Tf, Mo);
- }
- function jt(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !0
- ), rr(k.asteriskToken), rr(k.name), rr(k.questionToken), bp(k, Tf, Sp);
- }
- function Xt(k) {
- hs("static"), Zh(k), Bd(k.body), hd(k);
- }
- function Ht(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), hs("constructor"), bp(k, Tf, Sp);
- }
- function en(k) {
- const ce = xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !0
- ), pt = k.kind === 177 ? 139 : 153;
- Ce(pt, ce, hs, k), ln(), rr(k.name), bp(k, Tf, Sp);
- }
- function zt(k) {
- bp(k, Tf, Mo);
- }
- function mr(k) {
- hs("new"), ln(), bp(k, Tf, Mo);
- }
- function Kt(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), u1(k, k.parameters), Wd(k.type), pu();
- }
- function hr(k) {
- rr(k.type), rr(k.literal);
- }
- function Ft() {
- pu();
- }
- function Ss(k) {
- k.assertsModifier && (rr(k.assertsModifier), ln()), rr(k.parameterName), k.type && (ln(), hs("is"), ln(), rr(k.type));
- }
- function gs(k) {
- rr(k.typeName), bn(k, k.typeArguments);
- }
- function Ts(k) {
- bp(k, Ua, lc);
- }
- function Ua(k) {
- Al(k, k.typeParameters), JS(k, k.parameters), ln(), Sn("=>");
- }
- function lc(k) {
- ln(), rr(k.type);
- }
- function Ic(k) {
- hs("function"), Qh(k, k.parameters), Sn(":"), rr(k.type);
- }
- function io(k) {
- Sn("?"), rr(k.type);
- }
- function vi(k) {
- Sn("!"), rr(k.type);
- }
- function ca(k) {
- rr(k.type), Sn("=");
- }
- function Ll(k) {
- ah(k, k.modifiers), hs("new"), ln(), bp(k, Ua, lc);
- }
- function xs(k) {
- hs("typeof"), ln(), rr(k.exprName), bn(k, k.typeArguments);
- }
- function Cu(k) {
- Zh(k), ir(k.members, QS), Sn("{");
- const ce = ya(k) & 1 ? 768 : 32897;
- Do(
- k,
- k.members,
- ce | 524288
- /* NoSpaceIfEmpty */
- ), Sn("}"), hd(k);
- }
- function Zc(k) {
- rr(k.elementType, Br.parenthesizeNonArrayTypeOfPostfixType), Sn("["), Sn("]");
- }
- function Yi(k) {
- Sn("..."), rr(k.type);
- }
- function Na(k) {
- Ce(23, k.pos, Sn, k);
- const ce = ya(k) & 1 ? 528 : 657;
- Do(k, k.elements, ce | 524288, Br.parenthesizeElementTypeOfTupleType), Ce(24, k.elements.end, Sn, k);
- }
- function Ia(k) {
- rr(k.dotDotDotToken), rr(k.name), rr(k.questionToken), Ce(59, k.name.end, Sn, k), ln(), rr(k.type);
- }
- function Vi(k) {
- rr(k.type, Br.parenthesizeTypeOfOptionalType), Sn("?");
- }
- function ba(k) {
- Do(k, k.types, 516, Br.parenthesizeConstituentTypeOfUnionType);
- }
- function Bt(k) {
- Do(k, k.types, 520, Br.parenthesizeConstituentTypeOfIntersectionType);
- }
- function to(k) {
- rr(k.checkType, Br.parenthesizeCheckTypeOfConditionalType), ln(), hs("extends"), ln(), rr(k.extendsType, Br.parenthesizeExtendsTypeOfConditionalType), ln(), Sn("?"), ln(), rr(k.trueType), ln(), Sn(":"), ln(), rr(k.falseType);
- }
- function _u(k) {
- hs("infer"), ln(), rr(k.typeParameter);
- }
- function Wc(k) {
- Sn("("), rr(k.type), Sn(")");
- }
- function of() {
- hs("this");
- }
- function Ao(k) {
- oh(k.operator, hs), ln();
- const ce = k.operator === 148 ? Br.parenthesizeOperandOfReadonlyTypeOperator : Br.parenthesizeOperandOfTypeOperator;
- rr(k.type, ce);
- }
- function ge(k) {
- rr(k.objectType, Br.parenthesizeNonArrayTypeOfPostfixType), Sn("["), rr(k.indexType), Sn("]");
- }
- function $(k) {
- const ce = ya(k);
- Sn("{"), ce & 1 ? ln() : (Eu(), Du()), k.readonlyToken && (rr(k.readonlyToken), k.readonlyToken.kind !== 148 && hs("readonly"), ln()), Sn("["), K(3, k.typeParameter), k.nameType && (ln(), hs("as"), ln(), rr(k.nameType)), Sn("]"), k.questionToken && (rr(k.questionToken), k.questionToken.kind !== 58 && Sn("?")), Sn(":"), ln(), rr(k.type), pu(), ce & 1 ? ln() : (Eu(), kf()), Do(
- k,
- k.members,
- 2
- /* PreserveLines */
- ), Sn("}");
- }
- function rt(k) {
- Xe(k.literal);
- }
- function Ct(k) {
- rr(k.head), Do(
- k,
- k.templateSpans,
- 262144
- /* TemplateExpressionSpans */
- );
- }
- function $t(k) {
- k.isTypeOf && (hs("typeof"), ln()), hs("import"), Sn("("), rr(k.argument), k.attributes && (Sn(","), ln(), K(7, k.attributes)), Sn(")"), k.qualifier && (Sn("."), rr(k.qualifier)), bn(k, k.typeArguments);
- }
- function zr(k) {
- Sn("{"), Do(
- k,
- k.elements,
- 525136
- /* ObjectBindingPatternElements */
- ), Sn("}");
- }
- function $n(k) {
- Sn("["), Do(
- k,
- k.elements,
- 524880
- /* ArrayBindingPatternElements */
- ), Sn("]");
- }
- function ar(k) {
- rr(k.dotDotDotToken), k.propertyName && (rr(k.propertyName), Sn(":"), ln()), rr(k.name), hg(k.initializer, k.name.end, k, Br.parenthesizeExpressionForDisallowedComma);
- }
- function An(k) {
- const ce = k.elements, pt = k.multiLine ? 65536 : 0;
- Yh(k, ce, 8914 | pt, Br.parenthesizeExpressionForDisallowedComma);
- }
- function ri(k) {
- Zh(k), ir(k.properties, QS);
- const ce = ya(k) & 131072;
- ce && Du();
- const pt = k.multiLine ? 65536 : 0, Yt = I && I.languageVersion >= 1 && !Rp(I) ? 64 : 0;
- Do(k, k.properties, 526226 | Yt | pt), ce && kf(), hd(k);
- }
- function Fi(k) {
- Xe(k.expression, Br.parenthesizeLeftSideOfAccess);
- const ce = k.questionDotToken || wd(A.createToken(
- 25
- /* DotToken */
- ), k.expression.end, k.name.pos), pt = Ud(k, k.expression, ce), Yt = Ud(k, ce, k.name);
- Gf(
- pt,
- /*writeSpaceIfNotIndenting*/
- !1
- ), ce.kind !== 29 && za(k.expression) && !oe.hasTrailingComment() && !oe.hasTrailingWhitespace() && Sn("."), k.questionDotToken ? rr(ce) : Ce(ce.kind, k.expression.end, Sn, k), Gf(
- Yt,
- /*writeSpaceIfNotIndenting*/
- !1
- ), rr(k.name), Q0(pt, Yt);
- }
- function za(k) {
- if (k = ud(k), d_(k)) {
- const ce = ch(
- k,
- /*sourceFile*/
- void 0,
- /*neverAsciiEscape*/
- !0,
- /*jsxAttributeEscape*/
- !1
- );
- return !(k.numericLiteralFlags & 448) && !ce.includes(qs(
- 25
- /* DotToken */
- )) && !ce.includes("E") && !ce.includes("e");
- } else if (xo(k)) {
- const ce = Eee(k);
- return typeof ce == "number" && isFinite(ce) && ce >= 0 && Math.floor(ce) === ce;
- }
- }
- function Uo(k) {
- Xe(k.expression, Br.parenthesizeLeftSideOfAccess), rr(k.questionDotToken), Ce(23, k.expression.end, Sn, k), Xe(k.argumentExpression), Ce(24, k.argumentExpression.end, Sn, k);
- }
- function vc(k) {
- const ce = _d(k) & 16;
- ce && (Sn("("), u2("0"), Sn(","), ln()), Xe(k.expression, Br.parenthesizeLeftSideOfAccess), ce && Sn(")"), rr(k.questionDotToken), bn(k, k.typeArguments), Yh(k, k.arguments, 2576, Br.parenthesizeExpressionForDisallowedComma);
- }
- function Oc(k) {
- Ce(105, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeExpressionOfNew), bn(k, k.typeArguments), Yh(k, k.arguments, 18960, Br.parenthesizeExpressionForDisallowedComma);
- }
- function Fc(k) {
- const ce = _d(k) & 16;
- ce && (Sn("("), u2("0"), Sn(","), ln()), Xe(k.tag, Br.parenthesizeLeftSideOfAccess), ce && Sn(")"), bn(k, k.typeArguments), ln(), Xe(k.template);
- }
- function Lo(k) {
- Sn("<"), rr(k.type), Sn(">"), Xe(k.expression, Br.parenthesizeOperandOfPrefixUnary);
- }
- function _c(k) {
- const ce = Ce(21, k.pos, Sn, k), pt = HS(k.expression, k);
- Xe(
- k.expression,
- /*parenthesizerRule*/
- void 0
- ), GS(k.expression, k), Q0(pt), Ce(22, k.expression ? k.expression.end : ce, Sn, k);
- }
- function Wf(k) {
- yg(k.name), eh(k);
- }
- function Lc(k) {
- ah(k, k.modifiers), bp(k, al, hp);
- }
- function al(k) {
- Al(k, k.typeParameters), JS(k, k.parameters), Wd(k.type), ln(), rr(k.equalsGreaterThanToken);
- }
- function hp(k) {
- Cs(k.body) ? Bd(k.body) : (ln(), Xe(k.body, Br.parenthesizeConciseBodyOfArrowFunction));
- }
- function Pe(k) {
- Ce(91, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeOperandOfPrefixUnary);
- }
- function Et(k) {
- Ce(114, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeOperandOfPrefixUnary);
- }
- function Lr(k) {
- Ce(116, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeOperandOfPrefixUnary);
- }
- function $i(k) {
- Ce(135, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeOperandOfPrefixUnary);
- }
- function Sa(k) {
- oh(k.operator, X0), ka(k) && ln(), Xe(k.operand, Br.parenthesizeOperandOfPrefixUnary);
- }
- function ka(k) {
- const ce = k.operand;
- return ce.kind === 224 && (k.operator === 40 && (ce.operator === 40 || ce.operator === 46) || k.operator === 41 && (ce.operator === 41 || ce.operator === 47));
- }
- function Pc(k) {
- Xe(k.operand, Br.parenthesizeOperandOfPostfixUnary), oh(k.operator, X0);
- }
- function yl() {
- return fO(
- k,
- ce,
- pt,
- Yt,
- ai,
- /*foldState*/
- void 0
- );
- function k(Ki, Hi) {
- if (Hi) {
- Hi.stackIndex++, Hi.preserveSourceNewlinesStack[Hi.stackIndex] = Se, Hi.containerPosStack[Hi.stackIndex] = Me, Hi.containerEndStack[Hi.stackIndex] = Qe, Hi.declarationListContainerEndStack[Hi.stackIndex] = et;
- const Li = Hi.shouldEmitCommentsStack[Hi.stackIndex] = De(Ki), Wu = Hi.shouldEmitSourceMapsStack[Hi.stackIndex] = Ve(Ki);
- c?.(Ki), Li && d1(Ki), Wu && y2(Ki), te(Ki);
- } else
- Hi = {
- stackIndex: 0,
- preserveSourceNewlinesStack: [void 0],
- containerPosStack: [-1],
- containerEndStack: [-1],
- declarationListContainerEndStack: [-1],
- shouldEmitCommentsStack: [!1],
- shouldEmitSourceMapsStack: [!1]
- };
- return Hi;
- }
- function ce(Ki, Hi, Li) {
- return qi(Ki, Li, "left");
- }
- function pt(Ki, Hi, Li) {
- const Wu = Ki.kind !== 28, Ml = Ud(Li, Li.left, Ki), qd = Ud(Li, Ki, Li.right);
- Gf(Ml, Wu), ey(Ki.pos), VS(Ki, Ki.kind === 103 ? hs : X0), uh(
- Ki.end,
- /*prefixSpace*/
- !0
- ), Gf(
- qd,
- /*writeSpaceIfNotIndenting*/
- !0
- );
- }
- function Yt(Ki, Hi, Li) {
- return qi(Ki, Li, "right");
- }
- function ai(Ki, Hi) {
- const Li = Ud(Ki, Ki.left, Ki.operatorToken), Wu = Ud(Ki, Ki.operatorToken, Ki.right);
- if (Q0(Li, Wu), Hi.stackIndex > 0) {
- const Ml = Hi.preserveSourceNewlinesStack[Hi.stackIndex], qd = Hi.containerPosStack[Hi.stackIndex], ty = Hi.containerEndStack[Hi.stackIndex], pf = Hi.declarationListContainerEndStack[Hi.stackIndex], v2 = Hi.shouldEmitCommentsStack[Hi.stackIndex], Vv = Hi.shouldEmitSourceMapsStack[Hi.stackIndex];
- ze(Ml), Vv && nd(Ki), v2 && KS(Ki, qd, ty, pf), _?.(Ki), Hi.stackIndex--;
- }
- }
- function qi(Ki, Hi, Li) {
- const Wu = Li === "left" ? Br.getParenthesizeLeftSideOfBinaryForOperator(Hi.operatorToken.kind) : Br.getParenthesizeRightSideOfBinaryForOperator(Hi.operatorToken.kind);
- let Ml = Ke(0, 1, Ki);
- if (Ml === Vt && (E.assertIsDefined(Ir), Ki = Wu(Bs(Ir, _t)), Ml = xe(1, 1, Ki), Ir = void 0), (Ml === bk || Ml === h2 || Ml === $e) && dn(Ki))
- return Ki;
- jr = Wu, Ml(1, Ki);
- }
- }
- function so(k) {
- const ce = Ud(k, k.condition, k.questionToken), pt = Ud(k, k.questionToken, k.whenTrue), Yt = Ud(k, k.whenTrue, k.colonToken), ai = Ud(k, k.colonToken, k.whenFalse);
- Xe(k.condition, Br.parenthesizeConditionOfConditionalExpression), Gf(
- ce,
- /*writeSpaceIfNotIndenting*/
- !0
- ), rr(k.questionToken), Gf(
- pt,
- /*writeSpaceIfNotIndenting*/
- !0
- ), Xe(k.whenTrue, Br.parenthesizeBranchOfConditionalExpression), Q0(ce, pt), Gf(
- Yt,
- /*writeSpaceIfNotIndenting*/
- !0
- ), rr(k.colonToken), Gf(
- ai,
- /*writeSpaceIfNotIndenting*/
- !0
- ), Xe(k.whenFalse, Br.parenthesizeBranchOfConditionalExpression), Q0(Yt, ai);
- }
- function Va(k) {
- rr(k.head), Do(
- k,
- k.templateSpans,
- 262144
- /* TemplateExpressionSpans */
- );
- }
- function Uc(k) {
- Ce(127, k.pos, hs, k), rr(k.asteriskToken), rd(k.expression && hi(k.expression), Es);
- }
- function cf(k) {
- Ce(26, k.pos, Sn, k), Xe(k.expression, Br.parenthesizeExpressionForDisallowedComma);
- }
- function Xp(k) {
- yg(k.name), Vh(k);
- }
- function A_(k) {
- Xe(k.expression, Br.parenthesizeLeftSideOfAccess), bn(k, k.typeArguments);
- }
- function Sf(k) {
- Xe(
- k.expression,
- /*parenthesizerRule*/
- void 0
- ), k.type && (ln(), hs("as"), ln(), rr(k.type));
- }
- function Uf(k) {
- Xe(k.expression, Br.parenthesizeLeftSideOfAccess), X0("!");
- }
- function yp(k) {
- Xe(
- k.expression,
- /*parenthesizerRule*/
- void 0
- ), k.type && (ln(), hs("satisfies"), ln(), rr(k.type));
- }
- function Yg(k) {
- Jv(k.keywordToken, k.pos, Sn), Sn("."), rr(k.name);
- }
- function Qp(k) {
- Xe(k.expression), rr(k.literal);
- }
- function y_(k) {
- vl(
- k,
- /*forceSingleLine*/
- !k.multiLine && $6(k)
- );
- }
- function vl(k, ce) {
- Ce(
- 19,
- k.pos,
- Sn,
- /*contextNode*/
- k
- );
- const pt = ce || ya(k) & 1 ? 768 : 129;
- Do(k, k.statements, pt), Ce(
- 20,
- k.statements.end,
- Sn,
- /*contextNode*/
- k,
- /*indentLeading*/
- !!(pt & 1)
- );
- }
- function Uh(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), rr(k.declarationList), pu();
- }
- function r_(k) {
- k ? Sn(";") : pu();
- }
- function Zg(k) {
- Xe(k.expression, Br.parenthesizeExpressionOfExpressionStatement), (!I || !Rp(I) || fo(k.expression)) && pu();
- }
- function Vf(k) {
- const ce = Ce(101, k.pos, hs, k);
- ln(), Ce(21, ce, Sn, k), Xe(k.expression), Ce(22, k.expression.end, Sn, k), G0(k, k.thenStatement), k.elseStatement && (F_(k, k.thenStatement, k.elseStatement), Ce(93, k.thenStatement.end, hs, k), k.elseStatement.kind === 245 ? (ln(), rr(k.elseStatement)) : G0(k, k.elseStatement));
- }
- function Y(k, ce) {
- const pt = Ce(117, ce, hs, k);
- ln(), Ce(21, pt, Sn, k), Xe(k.expression), Ce(22, k.expression.end, Sn, k);
- }
- function st(k) {
- Ce(92, k.pos, hs, k), G0(k, k.statement), Cs(k.statement) && !Se ? ln() : F_(k, k.statement, k.expression), Y(k, k.statement.end), pu();
- }
- function It(k) {
- Y(k, k.pos), G0(k, k.statement);
- }
- function Mt(k) {
- const ce = Ce(99, k.pos, hs, k);
- ln();
- let pt = Ce(
- 21,
- ce,
- Sn,
- /*contextNode*/
- k
- );
- En(k.initializer), pt = Ce(27, k.initializer ? k.initializer.end : pt, Sn, k), rd(k.condition), pt = Ce(27, k.condition ? k.condition.end : pt, Sn, k), rd(k.incrementor), Ce(22, k.incrementor ? k.incrementor.end : pt, Sn, k), G0(k, k.statement);
- }
- function Sr(k) {
- const ce = Ce(99, k.pos, hs, k);
- ln(), Ce(21, ce, Sn, k), En(k.initializer), ln(), Ce(103, k.initializer.end, hs, k), ln(), Xe(k.expression), Ce(22, k.expression.end, Sn, k), G0(k, k.statement);
- }
- function Vr(k) {
- const ce = Ce(99, k.pos, hs, k);
- ln(), gk(k.awaitModifier), Ce(21, ce, Sn, k), En(k.initializer), ln(), Ce(165, k.initializer.end, hs, k), ln(), Xe(k.expression), Ce(22, k.expression.end, Sn, k), G0(k, k.statement);
- }
- function En(k) {
- k !== void 0 && (k.kind === 261 ? rr(k) : Xe(k));
- }
- function si(k) {
- Ce(88, k.pos, hs, k), l1(k.label), pu();
- }
- function L(k) {
- Ce(83, k.pos, hs, k), l1(k.label), pu();
- }
- function Ce(k, ce, pt, Yt, ai) {
- const qi = fs(Yt), Ki = qi && qi.kind === Yt.kind, Hi = ce;
- if (Ki && I && (ce = aa(I.text, ce)), Ki && Yt.pos !== Hi) {
- const Li = ai && I && !cp(Hi, ce, I);
- Li && Du(), ey(Hi), Li && kf();
- }
- if (!T && (k === 19 || k === 20) ? ce = Jv(k, ce, pt, Yt) : ce = oh(k, pt, ce), Ki && Yt.end !== ce) {
- const Li = Yt.kind === 294;
- uh(
- ce,
- /*prefixSpace*/
- !Li,
- /*forceNoNewline*/
- Li
- );
- }
- return ce;
- }
- function yt(k) {
- return k.kind === 2 || !!k.hasTrailingNewLine;
- }
- function Mr(k) {
- if (!I) return !1;
- const ce = Ig(I.text, k.pos);
- if (ce) {
- const pt = fs(k);
- if (pt && Yu(pt.parent))
- return !0;
- }
- return ut(ce, yt) || ut(UC(k), yt) ? !0 : LJ(k) ? k.pos !== k.expression.pos && ut(ky(I.text, k.expression.pos), yt) ? !0 : Mr(k.expression) : !1;
- }
- function hi(k) {
- if (!_r && LJ(k) && Mr(k)) {
- const ce = fs(k);
- if (ce && Yu(ce)) {
- const pt = A.createParenthesizedExpression(k.expression);
- return kn(pt, k), lt(pt, ce), pt;
- }
- return A.createParenthesizedExpression(k);
- }
- return k;
- }
- function Es(k) {
- return hi(Br.parenthesizeExpressionForDisallowedComma(k));
- }
- function ns(k) {
- Ce(
- 107,
- k.pos,
- hs,
- /*contextNode*/
- k
- ), rd(k.expression && hi(k.expression), hi), pu();
- }
- function Ds(k) {
- const ce = Ce(118, k.pos, hs, k);
- ln(), Ce(21, ce, Sn, k), Xe(k.expression), Ce(22, k.expression.end, Sn, k), G0(k, k.statement);
- }
- function Pa(k) {
- const ce = Ce(109, k.pos, hs, k);
- ln(), Ce(21, ce, Sn, k), Xe(k.expression), Ce(22, k.expression.end, Sn, k), ln(), rr(k.caseBlock);
- }
- function ga(k) {
- rr(k.label), Ce(59, k.label.end, Sn, k), ln(), rr(k.statement);
- }
- function $o(k) {
- Ce(111, k.pos, hs, k), rd(hi(k.expression), hi), pu();
- }
- function vp(k) {
- Ce(113, k.pos, hs, k), ln(), rr(k.tryBlock), k.catchClause && (F_(k, k.tryBlock, k.catchClause), rr(k.catchClause)), k.finallyBlock && (F_(k, k.catchClause || k.tryBlock, k.finallyBlock), Ce(98, (k.catchClause || k.tryBlock).end, hs, k), ln(), rr(k.finallyBlock));
- }
- function dd(k) {
- Jv(89, k.pos, hs), pu();
- }
- function jd(k) {
- var ce, pt, Yt;
- rr(k.name), rr(k.exclamationToken), Wd(k.type), hg(k.initializer, ((ce = k.type) == null ? void 0 : ce.end) ?? ((Yt = (pt = k.name.emitNode) == null ? void 0 : pt.typeNode) == null ? void 0 : Yt.end) ?? k.name.end, k, Br.parenthesizeExpressionForDisallowedComma);
- }
- function Kg(k) {
- if (qw(k))
- hs("await"), ln(), hs("using");
- else {
- const ce = p7(k) ? "let" : hC(k) ? "const" : Hw(k) ? "using" : "var";
- hs(ce);
- }
- ln(), Do(
- k,
- k.declarations,
- 528
- /* VariableDeclarationList */
- );
- }
- function J0(k) {
- eh(k);
- }
- function eh(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), hs("function"), rr(k.asteriskToken), ln(), Ea(k.name), bp(k, Tf, Sp);
- }
- function bp(k, ce, pt) {
- const Yt = ya(k) & 131072;
- Yt && Du(), Zh(k), ir(k.parameters, kl), ce(k), pt(k), hd(k), Yt && kf();
- }
- function Sp(k) {
- const ce = k.body;
- ce ? Bd(ce) : pu();
- }
- function Mo(k) {
- pu();
- }
- function Tf(k) {
- Al(k, k.typeParameters), Qh(k, k.parameters), Wd(k.type);
- }
- function N_(k) {
- if (ya(k) & 1)
- return !0;
- if (k.multiLine || !fo(k) && I && !lS(k, I) || Y0(
- k,
- el(k.statements),
- 2
- /* PreserveLines */
- ) || qS(k, Ro(k.statements), 2, k.statements))
- return !1;
- let ce;
- for (const pt of k.statements) {
- if (_2(
- ce,
- pt,
- 2
- /* PreserveLines */
- ) > 0)
- return !1;
- ce = pt;
- }
- return !0;
- }
- function Bd(k) {
- kl(k), c?.(k), ln(), Sn("{"), Du();
- const ce = N_(k) ? th : Yp;
- m1(k, k.statements, ce), kf(), Jv(20, k.statements.end, Sn, k), _?.(k);
- }
- function th(k) {
- Yp(
- k,
- /*emitBlockFunctionBodyOnSingleLine*/
- !0
- );
- }
- function Yp(k, ce) {
- const pt = fa(k.statements), Yt = oe.getTextPos();
- Zt(k), pt === 0 && Yt === oe.getTextPos() && ce ? (kf(), Do(
- k,
- k.statements,
- 768
- /* SingleLineFunctionBodyStatements */
- ), Du()) : Do(
- k,
- k.statements,
- 1,
- /*parenthesizerRule*/
- void 0,
- pt
- );
- }
- function dg(k) {
- Vh(k);
- }
- function Vh(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !0
- ), Ce(86, gm(k).pos, hs, k), k.name && (ln(), Ea(k.name));
- const ce = ya(k) & 131072;
- ce && Du(), Al(k, k.typeParameters), Do(
- k,
- k.heritageClauses,
- 0
- /* ClassHeritageClauses */
- ), ln(), Sn("{"), Zh(k), ir(k.members, QS), Do(
- k,
- k.members,
- 129
- /* ClassMembers */
- ), hd(k), Sn("}"), ce && kf();
- }
- function z0(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), hs("interface"), ln(), rr(k.name), Al(k, k.typeParameters), Do(
- k,
- k.heritageClauses,
- 512
- /* HeritageClauses */
- ), ln(), Sn("{"), Zh(k), ir(k.members, QS), Do(
- k,
- k.members,
- 129
- /* InterfaceMembers */
- ), hd(k), Sn("}");
- }
- function Zp(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), hs("type"), ln(), rr(k.name), Al(k, k.typeParameters), ln(), Sn("="), ln(), rr(k.type), pu();
- }
- function Nv(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), hs("enum"), ln(), rr(k.name), ln(), Sn("{"), Do(
- k,
- k.members,
- 145
- /* EnumMembers */
- ), Sn("}");
- }
- function qf(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), ~k.flags & 2048 && (hs(k.flags & 32 ? "namespace" : "module"), ln()), rr(k.name);
- let ce = k.body;
- if (!ce) return pu();
- for (; ce && zc(ce); )
- Sn("."), rr(ce.name), ce = ce.body;
- ln(), rr(ce);
- }
- function Kp(k) {
- Zh(k), ir(k.statements, kl), vl(
- k,
- /*forceSingleLine*/
- $6(k)
- ), hd(k);
- }
- function qh(k) {
- Ce(19, k.pos, Sn, k), Do(
- k,
- k.clauses,
- 129
- /* CaseBlockClauses */
- ), Ce(
- 20,
- k.clauses.end,
- Sn,
- k,
- /*indentLeading*/
- !0
- );
- }
- function Iv(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), Ce(102, k.modifiers ? k.modifiers.end : k.pos, hs, k), ln(), k.isTypeOnly && (Ce(156, k.pos, hs, k), ln()), rr(k.name), ln(), Ce(64, k.name.end, Sn, k), ln(), mg(k.moduleReference), pu();
- }
- function mg(k) {
- k.kind === 80 ? Xe(k) : rr(k);
- }
- function rh(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- ), Ce(102, k.modifiers ? k.modifiers.end : k.pos, hs, k), ln(), k.importClause && (rr(k.importClause), ln(), Ce(161, k.importClause.end, hs, k), ln()), Xe(k.moduleSpecifier), k.attributes && l1(k.attributes), pu();
- }
- function Ov(k) {
- k.isTypeOnly && (Ce(156, k.pos, hs, k), ln()), rr(k.name), k.name && k.namedBindings && (Ce(28, k.name.end, Sn, k), ln()), rr(k.namedBindings);
- }
- function n1(k) {
- const ce = Ce(42, k.pos, Sn, k);
- ln(), Ce(130, ce, hs, k), ln(), rr(k.name);
- }
- function Ne(k) {
- fn(k);
- }
- function qe(k) {
- ks(k);
- }
- function vt(k) {
- const ce = Ce(95, k.pos, hs, k);
- ln(), k.isExportEquals ? Ce(64, ce, X0, k) : Ce(90, ce, hs, k), ln(), Xe(
- k.expression,
- k.isExportEquals ? Br.getParenthesizeRightSideOfBinaryForOperator(
- 64
- /* EqualsToken */
- ) : Br.parenthesizeExpressionOfExportDefault
- ), pu();
- }
- function qt(k) {
- xf(
- k,
- k.modifiers,
- /*allowDecorators*/
- !1
- );
- let ce = Ce(95, k.pos, hs, k);
- if (ln(), k.isTypeOnly && (ce = Ce(156, ce, hs, k), ln()), k.exportClause ? rr(k.exportClause) : ce = Ce(42, ce, Sn, k), k.moduleSpecifier) {
- ln();
- const pt = k.exportClause ? k.exportClause.end : ce;
- Ce(161, pt, hs, k), ln(), Xe(k.moduleSpecifier);
- }
- k.attributes && l1(k.attributes), pu();
- }
- function fr(k) {
- Sn("{"), ln(), hs(k.token === 132 ? "assert" : "with"), Sn(":"), ln();
- const ce = k.elements;
- Do(
- k,
- ce,
- 526226
- /* ImportAttributes */
- ), ln(), Sn("}");
- }
- function qr(k) {
- Ce(k.token, k.pos, hs, k), ln();
- const ce = k.elements;
- Do(
- k,
- ce,
- 526226
- /* ImportAttributes */
- );
- }
- function kr(k) {
- rr(k.name), Sn(":"), ln();
- const ce = k.value;
- if (!(ya(ce) & 1024)) {
- const pt = ym(ce);
- uh(pt.pos);
- }
- rr(ce);
- }
- function Dn(k) {
- let ce = Ce(95, k.pos, hs, k);
- ln(), ce = Ce(130, ce, hs, k), ln(), ce = Ce(145, ce, hs, k), ln(), rr(k.name), pu();
- }
- function di(k) {
- const ce = Ce(42, k.pos, Sn, k);
- ln(), Ce(130, ce, hs, k), ln(), rr(k.name);
- }
- function _n(k) {
- fn(k);
- }
- function yi(k) {
- ks(k);
- }
- function fn(k) {
- Sn("{"), Do(
- k,
- k.elements,
- 525136
- /* NamedImportsOrExportsElements */
- ), Sn("}");
- }
- function ks(k) {
- k.isTypeOnly && (hs("type"), ln()), k.propertyName && (rr(k.propertyName), ln(), Ce(130, k.propertyName.end, hs, k), ln()), rr(k.name);
- }
- function po(k) {
- hs("require"), Sn("("), Xe(k.expression), Sn(")");
- }
- function Bu(k) {
- rr(k.openingElement), Do(
- k,
- k.children,
- 262144
- /* JsxElementOrFragmentChildren */
- ), rr(k.closingElement);
- }
- function ed(k) {
- Sn("<"), o1(k.tagName), bn(k, k.typeArguments), ln(), rr(k.attributes), Sn("/>");
- }
- function Ju(k) {
- rr(k.openingFragment), Do(
- k,
- k.children,
- 262144
- /* JsxElementOrFragmentChildren */
- ), rr(k.closingFragment);
- }
- function td(k) {
- if (Sn("<"), xm(k)) {
- const ce = HS(k.tagName, k);
- o1(k.tagName), bn(k, k.typeArguments), k.attributes.properties && k.attributes.properties.length > 0 && ln(), rr(k.attributes), GS(k.attributes, k), Q0(ce);
- }
- Sn(">");
- }
- function zu(k) {
- oe.writeLiteral(k.text);
- }
- function o2(k) {
- Sn(""), Jb(k) && o1(k.tagName), Sn(">");
- }
- function i1(k) {
- Do(
- k,
- k.properties,
- 262656
- /* JsxElementAttributes */
- );
- }
- function nh(k) {
- rr(k.name), mk("=", Sn, k.initializer, Tt);
- }
- function Hh(k) {
- Sn("{..."), Xe(k.expression), Sn("}");
- }
- function W0(k) {
- let ce = !1;
- return gw(I?.text || "", k + 1, () => ce = !0), ce;
- }
- function md(k) {
- let ce = !1;
- return mw(I?.text || "", k + 1, () => ce = !0), ce;
- }
- function U0(k) {
- return W0(k) || md(k);
- }
- function s1(k) {
- var ce;
- if (k.expression || !_r && !fo(k) && U0(k.pos)) {
- const pt = I && !fo(k) && Qs(I, k.pos).line !== Qs(I, k.end).line;
- pt && oe.increaseIndent();
- const Yt = Ce(19, k.pos, Sn, k);
- rr(k.dotDotDotToken), Xe(k.expression), Ce(20, ((ce = k.expression) == null ? void 0 : ce.end) || Yt, Sn, k), pt && oe.decreaseIndent();
- }
- }
- function a1(k) {
- Ea(k.namespace), Sn(":"), Ea(k.name);
- }
- function o1(k) {
- k.kind === 80 ? Xe(k) : rr(k);
- }
- function jS(k) {
- Ce(84, k.pos, hs, k), ln(), Xe(k.expression, Br.parenthesizeExpressionForDisallowedComma), Da(k, k.statements, k.expression.end);
- }
- function Fv(k) {
- const ce = Ce(90, k.pos, hs, k);
- Da(k, k.statements, ce);
- }
- function Da(k, ce, pt) {
- const Yt = ce.length === 1 && // treat synthesized nodes as located on the same line for emit purposes
- (!I || fo(k) || fo(ce[0]) || t5(k, ce[0], I));
- let ai = 163969;
- Yt ? (Jv(59, pt, Sn, k), ln(), ai &= -130) : Ce(59, pt, Sn, k), Do(k, ce, ai);
- }
- function c2(k) {
- ln(), oh(k.token, hs), ln(), Do(
- k,
- k.types,
- 528
- /* HeritageClauseTypes */
- );
- }
- function BS(k) {
- const ce = Ce(85, k.pos, hs, k);
- ln(), k.variableDeclaration && (Ce(21, ce, Sn, k), rr(k.variableDeclaration), Ce(22, k.variableDeclaration.end, Sn, k), ln()), rr(k.block);
- }
- function Lv(k) {
- rr(k.name), Sn(":"), ln();
- const ce = k.initializer;
- if (!(ya(ce) & 1024)) {
- const pt = ym(ce);
- uh(pt.pos);
- }
- Xe(ce, Br.parenthesizeExpressionForDisallowedComma);
- }
- function ih(k) {
- rr(k.name), k.objectAssignmentInitializer && (ln(), Sn("="), ln(), Xe(k.objectAssignmentInitializer, Br.parenthesizeExpressionForDisallowedComma));
- }
- function sh(k) {
- k.expression && (Ce(26, k.pos, Sn, k), Xe(k.expression, Br.parenthesizeExpressionForDisallowedComma));
- }
- function Hf(k) {
- rr(k.name), hg(k.initializer, k.name.end, k, Br.parenthesizeExpressionForDisallowedComma);
- }
- function lf(k) {
- if (he("/**"), k.comment) {
- const ce = Cw(k.comment);
- if (ce) {
- const pt = ce.split(/\r\n?|\n/);
- for (const Yt of pt)
- Eu(), ln(), Sn("*"), ln(), he(Yt);
- }
- }
- k.tags && (k.tags.length === 1 && k.tags[0].kind === 344 && !k.comment ? (ln(), rr(k.tags[0])) : Do(
- k,
- k.tags,
- 33
- /* JSDocComment */
- )), ln(), he("*/");
- }
- function uf(k) {
- Nm(k.tagName), zd(k.typeExpression), je(k.comment);
- }
- function I_(k) {
- Nm(k.tagName), rr(k.name), je(k.comment);
- }
- function c1(k) {
- Nm(k.tagName), ln(), k.importClause && (rr(k.importClause), ln(), Ce(161, k.importClause.end, hs, k), ln()), Xe(k.moduleSpecifier), k.attributes && l1(k.attributes), je(k.comment);
- }
- function V6(k) {
- ln(), Sn("{"), rr(k.name), Sn("}");
- }
- function xl(k) {
- Nm(k.tagName), ln(), Sn("{"), rr(k.class), Sn("}"), je(k.comment);
- }
- function Jd(k) {
- Nm(k.tagName), zd(k.constraint), ln(), Do(
- k,
- k.typeParameters,
- 528
- /* CommaListElements */
- ), je(k.comment);
- }
- function V0(k) {
- Nm(k.tagName), k.typeExpression && (k.typeExpression.kind === 309 ? zd(k.typeExpression) : (ln(), Sn("{"), he("Object"), k.typeExpression.isArrayType && (Sn("["), Sn("]")), Sn("}"))), k.fullName && (ln(), rr(k.fullName)), je(k.comment), k.typeExpression && k.typeExpression.kind === 322 && Gh(k.typeExpression);
- }
- function gg(k) {
- Nm(k.tagName), k.name && (ln(), rr(k.name)), je(k.comment), O_(k.typeExpression);
- }
- function fk(k) {
- je(k.comment), O_(k.typeExpression);
- }
- function fu(k) {
- Nm(k.tagName), je(k.comment);
- }
- function Gh(k) {
- Do(
- k,
- A.createNodeArray(k.jsDocPropertyTags),
- 33
- /* JSDocComment */
- );
- }
- function O_(k) {
- k.typeParameters && Do(
- k,
- A.createNodeArray(k.typeParameters),
- 33
- /* JSDocComment */
- ), k.parameters && Do(
- k,
- A.createNodeArray(k.parameters),
- 33
- /* JSDocComment */
- ), k.type && (Eu(), ln(), Sn("*"), ln(), rr(k.type));
- }
- function Mv(k) {
- Nm(k.tagName), zd(k.typeExpression), ln(), k.isBracketed && Sn("["), rr(k.name), k.isBracketed && Sn("]"), je(k.comment);
- }
- function Nm(k) {
- Sn("@"), rr(k);
- }
- function je(k) {
- const ce = Cw(k);
- ce && (ln(), he(ce));
- }
- function zd(k) {
- k && (ln(), Sn("{"), rr(k.type), Sn("}"));
- }
- function Im(k) {
- Eu();
- const ce = k.statements;
- if (ce.length === 0 || !lm(ce[0]) || fo(ce[0])) {
- m1(k, ce, q0);
- return;
- }
- q0(k);
- }
- function Rv(k) {
- $h(!!k.hasNoDefaultLib, k.syntheticFileReferences || [], k.syntheticTypeReferences || [], k.syntheticLibReferences || []);
- }
- function pk(k) {
- k.isDeclarationFile && $h(k.hasNoDefaultLib, k.referencedFiles, k.typeReferenceDirectives, k.libReferenceDirectives);
- }
- function $h(k, ce, pt, Yt) {
- if (k && (Bv('/// '), Eu()), I && I.moduleName && (Bv(`/// `), Eu()), I && I.amdDependencies)
- for (const qi of I.amdDependencies)
- qi.name ? Bv(`/// `) : Bv(`/// `), Eu();
- function ai(qi, Ki) {
- for (const Hi of Ki) {
- const Li = Hi.resolutionMode ? `resolution-mode="${Hi.resolutionMode === 99 ? "import" : "require"}" ` : "", Wu = Hi.preserve ? 'preserve="true" ' : "";
- Bv(`/// `), Eu();
- }
- }
- ai("path", ce), ai("types", pt), ai("lib", Yt);
- }
- function q0(k) {
- const ce = k.statements;
- Zh(k), ir(k.statements, kl), Zt(k);
- const pt = ac(ce, (Yt) => !lm(Yt));
- pk(k), Do(
- k,
- ce,
- 1,
- /*parenthesizerRule*/
- void 0,
- pt === -1 ? ce.length : pt
- ), hd(k);
- }
- function Xh(k) {
- const ce = ya(k);
- !(ce & 1024) && k.pos !== k.expression.pos && uh(k.expression.pos), Xe(k.expression), !(ce & 2048) && k.end !== k.expression.end && ey(k.expression.end);
- }
- function dk(k) {
- Yh(
- k,
- k.elements,
- 528,
- /*parenthesizerRule*/
- void 0
- );
- }
- function fa(k, ce, pt) {
- let Yt = !!ce;
- for (let ai = 0; ai < k.length; ai++) {
- const qi = k[ai];
- if (lm(qi))
- (pt ? !pt.has(qi.expression.text) : !0) && (Yt && (Yt = !1, qn(ce)), Eu(), rr(qi), pt && pt.add(qi.expression.text));
- else
- return ai;
- }
- return k.length;
- }
- function gd(k) {
- if (Si(k))
- fa(k.statements, k);
- else {
- const ce = /* @__PURE__ */ new Set();
- for (const pt of k.sourceFiles)
- fa(pt.statements, pt, ce);
- qn(void 0);
- }
- }
- function H0(k) {
- if (Si(k)) {
- const ce = II(k.text);
- if (ce)
- return Bv(ce), Eu(), !0;
- } else
- for (const ce of k.sourceFiles)
- if (H0(ce))
- return !0;
- }
- function jv(k, ce) {
- if (!k) return;
- const pt = he;
- he = ce, rr(k), he = pt;
- }
- function xf(k, ce, pt) {
- if (ce?.length) {
- if (Mi(ce, ra))
- return ah(k, ce);
- if (Mi(ce, dl))
- return pt ? Bi(k, ce) : k.pos;
- u?.(ce);
- let Yt, ai, qi = 0, Ki = 0, Hi;
- for (; qi < ce.length; ) {
- for (; Ki < ce.length; ) {
- if (Hi = ce[Ki], ai = dl(Hi) ? "decorators" : "modifiers", Yt === void 0)
- Yt = ai;
- else if (ai !== Yt)
- break;
- Ki++;
- }
- const Li = { pos: -1, end: -1 };
- qi === 0 && (Li.pos = ce.pos), Ki === ce.length - 1 && (Li.end = ce.end), (Yt === "modifiers" || pt) && Tp(
- rr,
- k,
- ce,
- Yt === "modifiers" ? 2359808 : 2146305,
- /*parenthesizerRule*/
- void 0,
- qi,
- Ki - qi,
- /*hasTrailingComma*/
- !1,
- Li
- ), qi = Ki, Yt = ai, Ki++;
- }
- if (d?.(ce), Hi && !Pd(Hi.end))
- return Hi.end;
- }
- return k.pos;
- }
- function ah(k, ce) {
- Do(
- k,
- ce,
- 2359808
- /* Modifiers */
- );
- const pt = Ro(ce);
- return pt && !Pd(pt.end) ? pt.end : k.pos;
- }
- function Wd(k) {
- k && (Sn(":"), ln(), rr(k));
- }
- function hg(k, ce, pt, Yt) {
- k && (ln(), Ce(64, ce, X0, pt), ln(), Xe(k, Yt));
- }
- function mk(k, ce, pt, Yt) {
- pt && (ce(k), Yt(pt));
- }
- function l1(k) {
- k && (ln(), rr(k));
- }
- function rd(k, ce) {
- k && (ln(), Xe(k, ce));
- }
- function gk(k) {
- k && (rr(k), ln());
- }
- function G0(k, ce) {
- Cs(ce) || ya(k) & 1 || Se && !Y0(
- k,
- ce,
- 0
- /* None */
- ) ? (ln(), rr(ce)) : (Eu(), Du(), MJ(ce) ? K(5, ce) : rr(ce), kf());
- }
- function Bi(k, ce) {
- Do(
- k,
- ce,
- 2146305
- /* Decorators */
- );
- const pt = Ro(ce);
- return pt && !Pd(pt.end) ? pt.end : k.pos;
- }
- function bn(k, ce) {
- Do(k, ce, 53776, xr);
- }
- function Al(k, ce) {
- if (ys(k) && k.typeArguments)
- return bn(k, k.typeArguments);
- Do(k, ce, 53776 | (Co(k) ? 64 : 0));
- }
- function Qh(k, ce) {
- Do(
- k,
- ce,
- 2576
- /* Parameters */
- );
- }
- function $0(k, ce) {
- const pt = Qm(ce);
- return pt && pt.pos === k.pos && Co(k) && !k.type && !ut(k.modifiers) && !ut(k.typeParameters) && !ut(pt.modifiers) && !pt.dotDotDotToken && !pt.questionToken && !pt.type && !pt.initializer && Oe(pt.name);
- }
- function JS(k, ce) {
- $0(k, ce) ? Do(
- k,
- ce,
- 528
- /* Parenthesis */
- ) : Qh(k, ce);
- }
- function u1(k, ce) {
- Do(
- k,
- ce,
- 8848
- /* IndexSignatureParameters */
- );
- }
- function zS(k) {
- switch (k & 60) {
- case 0:
- break;
- case 16:
- Sn(",");
- break;
- case 4:
- ln(), Sn("|");
- break;
- case 32:
- ln(), Sn("*"), ln();
- break;
- case 8:
- ln(), Sn("&");
- break;
- }
- }
- function Do(k, ce, pt, Yt, ai, qi) {
- l2(
- rr,
- k,
- ce,
- pt | (k && ya(k) & 2 ? 65536 : 0),
- Yt,
- ai,
- qi
- );
- }
- function Yh(k, ce, pt, Yt, ai, qi) {
- l2(Xe, k, ce, pt, Yt, ai, qi);
- }
- function l2(k, ce, pt, Yt, ai, qi = 0, Ki = pt ? pt.length - qi : 0) {
- if (pt === void 0 && Yt & 16384)
- return;
- const Li = pt === void 0 || qi >= pt.length || Ki === 0;
- if (Li && Yt & 32768) {
- u?.(pt), d?.(pt);
- return;
- }
- Yt & 15360 && (Sn(ERe(Yt)), Li && pt && uh(
- pt.pos,
- /*prefixSpace*/
- !0
- )), u?.(pt), Li ? Yt & 1 && !(Se && (!ce || I && lS(ce, I))) ? Eu() : Yt & 256 && !(Yt & 524288) && ln() : Tp(k, ce, pt, Yt, ai, qi, Ki, pt.hasTrailingComma, pt), d?.(pt), Yt & 15360 && (Li && pt && ey(pt.end), Sn(DRe(Yt)));
- }
- function Tp(k, ce, pt, Yt, ai, qi, Ki, Hi, Li) {
- const Wu = (Yt & 262144) === 0;
- let Ml = Wu;
- const qd = Y0(ce, pt[qi], Yt);
- qd ? (Eu(qd), Ml = !1) : Yt & 256 && ln(), Yt & 128 && Du();
- const ty = NRe(k, ai);
- let pf, v2 = !1;
- for (let Hd = 0; Hd < Ki; Hd++) {
- const _h = pt[qi + Hd];
- if (Yt & 32)
- Eu(), zS(Yt);
- else if (pf) {
- Yt & 60 && pf.end !== (ce ? ce.end : -1) && (ya(pf) & 2048 || ey(pf.end)), zS(Yt);
- const ry = _2(pf, _h, Yt);
- if (ry > 0) {
- if (Yt & 131 || (Du(), v2 = !0), Ml && Yt & 60 && !Pd(_h.pos)) {
- const Dk = ym(_h);
- uh(
- Dk.pos,
- /*prefixSpace*/
- !!(Yt & 512),
- /*forceNoNewline*/
- !0
- );
- }
- Eu(ry), Ml = !1;
- } else pf && Yt & 512 && ln();
- }
- if (Ml) {
- const ry = ym(_h);
- uh(ry.pos);
- } else
- Ml = Wu;
- J = _h.pos, ty(_h, k, ai, Hd), v2 && (kf(), v2 = !1), pf = _h;
- }
- const Vv = pf ? ya(pf) : 0, b2 = _r || !!(Vv & 2048), Ek = Hi && Yt & 64 && Yt & 16;
- Ek && (pf && !b2 ? Ce(28, pf.end, Sn, pf) : Sn(",")), pf && (ce ? ce.end : -1) !== pf.end && Yt & 60 && !b2 && ey(Ek && Li?.end ? Li.end : pf.end), Yt & 128 && kf();
- const nT = qS(ce, pt[qi + Ki - 1], Yt, Li);
- nT ? Eu(nT) : Yt & 2097408 && ln();
- }
- function u2(k) {
- oe.writeLiteral(k);
- }
- function WS(k) {
- oe.writeStringLiteral(k);
- }
- function q6(k) {
- oe.write(k);
- }
- function H6(k, ce) {
- oe.writeSymbol(k, ce);
- }
- function Sn(k) {
- oe.writePunctuation(k);
- }
- function pu() {
- oe.writeTrailingSemicolon(";");
- }
- function hs(k) {
- oe.writeKeyword(k);
- }
- function X0(k) {
- oe.writeOperator(k);
- }
- function hk(k) {
- oe.writeParameter(k);
- }
- function Bv(k) {
- oe.writeComment(k);
- }
- function ln() {
- oe.writeSpace(" ");
- }
- function G6(k) {
- oe.writeProperty(k);
- }
- function US(k) {
- oe.nonEscapingWrite ? oe.nonEscapingWrite(k) : oe.write(k);
- }
- function Eu(k = 1) {
- for (let ce = 0; ce < k; ce++)
- oe.writeLine(ce > 0);
- }
- function Du() {
- oe.increaseIndent();
- }
- function kf() {
- oe.decreaseIndent();
- }
- function Jv(k, ce, pt, Yt) {
- return me ? oh(k, pt, ce) : id(Yt, k, pt, ce, oh);
- }
- function VS(k, ce) {
- g && g(k), ce(qs(k.kind)), h && h(k);
- }
- function oh(k, ce, pt) {
- const Yt = qs(k);
- return ce(Yt), pt < 0 ? pt : pt + Yt.length;
- }
- function F_(k, ce, pt) {
- if (ya(k) & 1)
- ln();
- else if (Se) {
- const Yt = Ud(k, ce, pt);
- Yt ? Eu(Yt) : ln();
- } else
- Eu();
- }
- function Om(k) {
- const ce = k.split(/\r\n?|\n/), pt = XY(ce);
- for (const Yt of ce) {
- const ai = pt ? Yt.slice(pt) : Yt;
- ai.length && (Eu(), he(ai));
- }
- }
- function Gf(k, ce) {
- k ? (Du(), Eu(k)) : ce && ln();
- }
- function Q0(k, ce) {
- k && kf(), ce && kf();
- }
- function Y0(k, ce, pt) {
- if (pt & 2 || Se) {
- if (pt & 65536)
- return 1;
- if (ce === void 0)
- return !k || I && lS(k, I) ? 0 : 1;
- if (ce.pos === J || ce.kind === 12)
- return 0;
- if (I && k && !Pd(k.pos) && !fo(ce) && (!ce.parent || Ho(ce.parent) === Ho(k)))
- return Se ? _1(
- (Yt) => DK(
- ce.pos,
- k.pos,
- I,
- Yt
- )
- ) : t5(k, ce, I) ? 0 : 1;
- if ($S(ce, pt))
- return 1;
- }
- return pt & 1 ? 1 : 0;
- }
- function _2(k, ce, pt) {
- if (pt & 2 || Se) {
- if (k === void 0 || ce === void 0 || ce.kind === 12)
- return 0;
- if (I && !fo(k) && !fo(ce))
- return Se && eT(k, ce) ? _1(
- (Yt) => zB(
- k,
- ce,
- I,
- Yt
- )
- ) : !Se && $f(k, ce) ? I3(k, ce, I) ? 0 : 1 : pt & 65536 ? 1 : 0;
- if ($S(k, pt) || $S(ce, pt))
- return 1;
- } else if (Y4(ce))
- return 1;
- return pt & 1 ? 1 : 0;
- }
- function qS(k, ce, pt, Yt) {
- if (pt & 2 || Se) {
- if (pt & 65536)
- return 1;
- if (ce === void 0)
- return !k || I && lS(k, I) ? 0 : 1;
- if (I && k && !Pd(k.pos) && !fo(ce) && (!ce.parent || ce.parent === k)) {
- if (Se) {
- const ai = Yt && !Pd(Yt.end) ? Yt.end : ce.end;
- return _1(
- (qi) => PK(
- ai,
- k.end,
- I,
- qi
- )
- );
- }
- return kK(k, ce, I) ? 0 : 1;
- }
- if ($S(ce, pt))
- return 1;
- }
- return pt & 1 && !(pt & 131072) ? 1 : 0;
- }
- function _1(k) {
- E.assert(!!Se);
- const ce = k(
- /*includeComments*/
- !0
- );
- return ce === 0 ? k(
- /*includeComments*/
- !1
- ) : ce;
- }
- function HS(k, ce) {
- const pt = Se && Y0(
- ce,
- k,
- 0
- /* None */
- );
- return pt && Gf(
- pt,
- /*writeSpaceIfNotIndenting*/
- !1
- ), !!pt;
- }
- function GS(k, ce) {
- const pt = Se && qS(
- ce,
- k,
- 0,
- /*childrenTextRange*/
- void 0
- );
- pt && Eu(pt);
- }
- function $S(k, ce) {
- if (fo(k)) {
- const pt = Y4(k);
- return pt === void 0 ? (ce & 65536) !== 0 : pt;
- }
- return (ce & 65536) !== 0;
- }
- function Ud(k, ce, pt) {
- return ya(k) & 262144 ? 0 : (k = zv(k), ce = zv(ce), pt = zv(pt), Y4(pt) ? 1 : I && !fo(k) && !fo(ce) && !fo(pt) ? Se ? _1(
- (Yt) => zB(
- ce,
- pt,
- I,
- Yt
- )
- ) : I3(ce, pt, I) ? 0 : 1 : 0);
- }
- function $6(k) {
- return k.statements.length === 0 && (!I || I3(k, k, I));
- }
- function zv(k) {
- for (; k.kind === 217 && fo(k); )
- k = k.expression;
- return k;
- }
- function f1(k, ce) {
- if (jo(k) || Q2(k))
- return YS(k);
- if (oa(k) && k.textSourceNode)
- return f1(k.textSourceNode, ce);
- const pt = I, Yt = !!pt && !!k.parent && !fo(k);
- if (Fg(k)) {
- if (!Yt || Tr(k) !== Ho(pt))
- return Nn(k);
- } else if (Nd(k)) {
- if (!Yt || Tr(k) !== Ho(pt))
- return Q4(k);
- } else if (E.assertNode(k, X2), !Yt)
- return k.text;
- return gb(pt, k, ce);
- }
- function ch(k, ce = I, pt, Yt) {
- if (k.kind === 11 && k.textSourceNode) {
- const qi = k.textSourceNode;
- if (Oe(qi) || Di(qi) || d_(qi) || Nd(qi)) {
- const Ki = d_(qi) ? qi.text : f1(qi);
- return Yt ? `"${CB(Ki)}"` : pt || ya(k) & 16777216 ? `"${cg(Ki)}"` : `"${B7(Ki)}"`;
- } else
- return ch(qi, Tr(qi), pt, Yt);
- }
- const ai = (pt ? 1 : 0) | (Yt ? 2 : 0) | (e.terminateUnterminatedLiterals ? 4 : 0) | (e.target && e.target >= 8 ? 8 : 0);
- return oZ(k, ce, ai);
- }
- function Zh(k) {
- V.push(ae), ae = 0, ne.push(ie), !(k && ya(k) & 1048576) && (ee.push(G), G = 0, X.push(q), q = void 0, ue.push(re));
- }
- function hd(k) {
- ae = V.pop(), ie = ne.pop(), !(k && ya(k) & 1048576) && (G = ee.pop(), q = X.pop(), re = ue.pop());
- }
- function Z0(k) {
- (!re || re === Ro(ue)) && (re = /* @__PURE__ */ new Set()), re.add(k);
- }
- function XS(k) {
- (!ie || ie === Ro(ne)) && (ie = /* @__PURE__ */ new Set()), ie.add(k);
- }
- function kl(k) {
- if (k)
- switch (k.kind) {
- case 241:
- ir(k.statements, kl);
- break;
- case 256:
- case 254:
- case 246:
- case 247:
- kl(k.statement);
- break;
- case 245:
- kl(k.thenStatement), kl(k.elseStatement);
- break;
- case 248:
- case 250:
- case 249:
- kl(k.initializer), kl(k.statement);
- break;
- case 255:
- kl(k.caseBlock);
- break;
- case 269:
- ir(k.clauses, kl);
- break;
- case 296:
- case 297:
- ir(k.statements, kl);
- break;
- case 258:
- kl(k.tryBlock), kl(k.catchClause), kl(k.finallyBlock);
- break;
- case 299:
- kl(k.variableDeclaration), kl(k.block);
- break;
- case 243:
- kl(k.declarationList);
- break;
- case 261:
- ir(k.declarations, kl);
- break;
- case 260:
- case 169:
- case 208:
- case 263:
- yg(k.name);
- break;
- case 262:
- yg(k.name), ya(k) & 1048576 && (ir(k.parameters, kl), kl(k.body));
- break;
- case 206:
- case 207:
- ir(k.elements, kl);
- break;
- case 272:
- kl(k.importClause);
- break;
- case 273:
- yg(k.name), kl(k.namedBindings);
- break;
- case 274:
- yg(k.name);
- break;
- case 280:
- yg(k.name);
- break;
- case 275:
- ir(k.elements, kl);
- break;
- case 276:
- yg(k.propertyName || k.name);
- break;
- }
- }
- function QS(k) {
- if (k)
- switch (k.kind) {
- case 303:
- case 304:
- case 172:
- case 171:
- case 174:
- case 173:
- case 177:
- case 178:
- yg(k.name);
- break;
- }
- }
- function yg(k) {
- k && (jo(k) || Q2(k) ? YS(k) : As(k) && kl(k));
- }
- function YS(k) {
- const ce = k.emitNode.autoGenerate;
- if ((ce.flags & 7) === 4)
- return Wv(fA(k), Di(k), ce.flags, ce.prefix, ce.suffix);
- {
- const pt = ce.id;
- return B[pt] || (B[pt] = Q6(k));
- }
- }
- function Wv(k, ce, pt, Yt, ai) {
- const qi = Ma(k), Ki = ce ? O : F;
- return Ki[qi] || (Ki[qi] = Yo(k, ce, pt ?? 0, r6(Yt, YS), r6(ai)));
- }
- function Kh(k, ce) {
- return f2(k) && !p1(k, ce) && !z.has(k);
- }
- function p1(k, ce) {
- let pt, Yt;
- if (ce ? (pt = ie, Yt = ne) : (pt = re, Yt = ue), pt?.has(k))
- return !0;
- for (let ai = Yt.length - 1; ai >= 0; ai--)
- if (pt !== Yt[ai] && (pt = Yt[ai], pt?.has(k)))
- return !0;
- return !1;
- }
- function f2(k, ce) {
- return I ? a7(I, k, n) : !0;
- }
- function Mc(k, ce) {
- for (let pt = ce; pt && kb(pt, ce); pt = pt.nextContainer)
- if (tg(pt) && pt.locals) {
- const Yt = pt.locals.get(tc(k));
- if (Yt && Yt.flags & 3257279)
- return !1;
- }
- return !0;
- }
- function Zl(k) {
- switch (k) {
- case "":
- return G;
- case "#":
- return ae;
- default:
- return q?.get(k) ?? 0;
- }
- }
- function X6(k, ce) {
- switch (k) {
- case "":
- G = ce;
- break;
- case "#":
- ae = ce;
- break;
- default:
- q ?? (q = /* @__PURE__ */ new Map()), q.set(k, ce);
- break;
- }
- }
- function Pu(k, ce, pt, Yt, ai) {
- Yt.length > 0 && Yt.charCodeAt(0) === 35 && (Yt = Yt.slice(1));
- const qi = mv(pt, Yt, "", ai);
- let Ki = Zl(qi);
- if (k && !(Ki & k)) {
- const Li = mv(pt, Yt, k === 268435456 ? "_i" : "_n", ai);
- if (Kh(Li, pt))
- return Ki |= k, pt ? XS(Li) : ce && Z0(Li), X6(qi, Ki), Li;
- }
- for (; ; ) {
- const Hi = Ki & 268435455;
- if (Ki++, Hi !== 8 && Hi !== 13) {
- const Li = Hi < 26 ? "_" + String.fromCharCode(97 + Hi) : "_" + (Hi - 26), Wu = mv(pt, Yt, Li, ai);
- if (Kh(Wu, pt))
- return pt ? XS(Wu) : ce && Z0(Wu), X6(qi, Ki), Wu;
- }
- }
- }
- function L_(k, ce = Kh, pt, Yt, ai, qi, Ki) {
- if (k.length > 0 && k.charCodeAt(0) === 35 && (k = k.slice(1)), qi.length > 0 && qi.charCodeAt(0) === 35 && (qi = qi.slice(1)), pt) {
- const Li = mv(ai, qi, k, Ki);
- if (ce(Li, ai))
- return ai ? XS(Li) : Yt ? Z0(Li) : z.add(Li), Li;
- }
- k.charCodeAt(k.length - 1) !== 95 && (k += "_");
- let Hi = 1;
- for (; ; ) {
- const Li = mv(ai, qi, k + Hi, Ki);
- if (ce(Li, ai))
- return ai ? XS(Li) : Yt ? Z0(Li) : z.add(Li), Li;
- Hi++;
- }
- }
- function yk(k) {
- return L_(
- k,
- f2,
- /*optimistic*/
- !0,
- /*scoped*/
- !1,
- /*privateName*/
- !1,
- /*prefix*/
- "",
- /*suffix*/
- ""
- );
- }
- function Fm(k) {
- const ce = f1(k.name);
- return Mc(ce, Wn(k, tg)) ? ce : L_(
- ce,
- Kh,
- /*optimistic*/
- !1,
- /*scoped*/
- !1,
- /*privateName*/
- !1,
- /*prefix*/
- "",
- /*suffix*/
- ""
- );
- }
- function vk(k) {
- const ce = KT(k), pt = oa(ce) ? lZ(ce.text) : "module";
- return L_(
- pt,
- Kh,
- /*optimistic*/
- !1,
- /*scoped*/
- !1,
- /*privateName*/
- !1,
- /*prefix*/
- "",
- /*suffix*/
- ""
- );
- }
- function K0() {
- return L_(
- "default",
- Kh,
- /*optimistic*/
- !1,
- /*scoped*/
- !1,
- /*privateName*/
- !1,
- /*prefix*/
- "",
- /*suffix*/
- ""
- );
- }
- function ZS() {
- return L_(
- "class",
- Kh,
- /*optimistic*/
- !1,
- /*scoped*/
- !1,
- /*privateName*/
- !1,
- /*prefix*/
- "",
- /*suffix*/
- ""
- );
- }
- function gP(k, ce, pt, Yt) {
- return Oe(k.name) ? Wv(k.name, ce) : Pu(
- 0,
- /*reservedInNestedScopes*/
- !1,
- ce,
- pt,
- Yt
- );
- }
- function Yo(k, ce, pt, Yt, ai) {
- switch (k.kind) {
- case 80:
- case 81:
- return L_(
- f1(k),
- Kh,
- !!(pt & 16),
- !!(pt & 8),
- ce,
- Yt,
- ai
- );
- case 267:
- case 266:
- return E.assert(!Yt && !ai && !ce), Fm(k);
- case 272:
- case 278:
- return E.assert(!Yt && !ai && !ce), vk(k);
- case 262:
- case 263: {
- E.assert(!Yt && !ai && !ce);
- const qi = k.name;
- return qi && !jo(qi) ? Yo(
- qi,
- /*privateName*/
- !1,
- pt,
- Yt,
- ai
- ) : K0();
- }
- case 277:
- return E.assert(!Yt && !ai && !ce), K0();
- case 231:
- return E.assert(!Yt && !ai && !ce), ZS();
- case 174:
- case 177:
- case 178:
- return gP(k, ce, Yt, ai);
- case 167:
- return Pu(
- 0,
- /*reservedInNestedScopes*/
- !0,
- ce,
- Yt,
- ai
- );
- default:
- return Pu(
- 0,
- /*reservedInNestedScopes*/
- !1,
- ce,
- Yt,
- ai
- );
- }
- }
- function Q6(k) {
- const ce = k.emitNode.autoGenerate, pt = r6(ce.prefix, YS), Yt = r6(ce.suffix);
- switch (ce.flags & 7) {
- case 1:
- return Pu(0, !!(ce.flags & 8), Di(k), pt, Yt);
- case 2:
- return E.assertNode(k, Oe), Pu(
- 268435456,
- !!(ce.flags & 8),
- /*privateName*/
- !1,
- pt,
- Yt
- );
- case 3:
- return L_(
- Nn(k),
- ce.flags & 32 ? f2 : Kh,
- !!(ce.flags & 16),
- !!(ce.flags & 8),
- Di(k),
- pt,
- Yt
- );
- }
- return E.fail(`Unsupported GeneratedIdentifierKind: ${E.formatEnum(
- ce.flags & 7,
- OR,
- /*isFlags*/
- !0
- )}.`);
- }
- function bk(k, ce) {
- const pt = xe(2, k, ce), Yt = Me, ai = Qe, qi = et;
- d1(ce), pt(k, ce), KS(ce, Yt, ai, qi);
- }
- function d1(k) {
- const ce = ya(k), pt = ym(k);
- v_(k, ce, pt.pos, pt.end), ce & 4096 && (_r = !0);
- }
- function KS(k, ce, pt, Yt) {
- const ai = ya(k), qi = ym(k);
- ai & 4096 && (_r = !1), p2(k, ai, qi.pos, qi.end, ce, pt, Yt);
- const Ki = Aee(k);
- Ki && p2(k, ai, Ki.pos, Ki.end, ce, pt, Yt);
- }
- function v_(k, ce, pt, Yt) {
- Nt(), Wt = !1;
- const ai = pt < 0 || (ce & 1024) !== 0 || k.kind === 12, qi = Yt < 0 || (ce & 2048) !== 0 || k.kind === 12;
- (pt > 0 || Yt > 0) && pt !== Yt && (ai || g1(
- pt,
- /*isEmittedNode*/
- k.kind !== 353
- /* NotEmittedStatement */
- ), (!ai || pt >= 0 && ce & 1024) && (Me = pt), (!qi || Yt >= 0 && ce & 2048) && (Qe = Yt, k.kind === 261 && (et = Yt))), ir(UC(k), Sk), Qt();
- }
- function p2(k, ce, pt, Yt, ai, qi, Ki) {
- Nt();
- const Hi = Yt < 0 || (ce & 2048) !== 0 || k.kind === 12;
- ir(Y3(k), d2), (pt > 0 || Yt > 0) && pt !== Yt && (Me = ai, Qe = qi, et = Ki, !Hi && k.kind !== 353 && n_(Yt)), Qt();
- }
- function Sk(k) {
- (k.hasLeadingNewline || k.kind === 2) && oe.writeLine(), M_(k), k.hasTrailingNewLine || k.kind === 2 ? oe.writeLine() : oe.writeSpace(" ");
- }
- function d2(k) {
- oe.isAtStartOfLine() || oe.writeSpace(" "), M_(k), k.hasTrailingNewLine && oe.writeLine();
- }
- function M_(k) {
- const ce = Tk(k), pt = k.kind === 3 ? BT(ce) : void 0;
- OC(ce, pt, oe, 0, ce.length, C);
- }
- function Tk(k) {
- return k.kind === 3 ? `/*${k.text}*/` : `//${k.text}`;
- }
- function m1(k, ce, pt) {
- Nt();
- const { pos: Yt, end: ai } = ce, qi = ya(k), Ki = Yt < 0 || (qi & 1024) !== 0, Hi = _r || ai < 0 || (qi & 2048) !== 0;
- Ki || Z6(ce), Qt(), qi & 4096 && !_r ? (_r = !0, pt(k), _r = !1) : pt(k), Nt(), Hi || (g1(
- ce.end,
- /*isEmittedNode*/
- !0
- ), Wt && !oe.isAtStartOfLine() && oe.writeLine()), Qt();
- }
- function $f(k, ce) {
- return k = Ho(k), k.parent && k.parent === Ho(ce).parent;
- }
- function eT(k, ce) {
- if (ce.pos < k.end)
- return !1;
- k = Ho(k), ce = Ho(ce);
- const pt = k.parent;
- if (!pt || pt !== ce.parent)
- return !1;
- const Yt = cee(k), ai = Yt?.indexOf(k);
- return ai !== void 0 && ai > -1 && Yt.indexOf(ce) === ai + 1;
- }
- function g1(k, ce) {
- Wt = !1, ce ? k === 0 && I?.isDeclarationFile ? Tn(k, m2) : Tn(k, xk) : k === 0 && Tn(k, hP);
- }
- function hP(k, ce, pt, Yt, ai) {
- Uv(k, ce) && xk(k, ce, pt, Yt, ai);
- }
- function m2(k, ce, pt, Yt, ai) {
- Uv(k, ce) || xk(k, ce, pt, Yt, ai);
- }
- function tT(k, ce) {
- return e.onlyPrintJsDocStyle ? oz(k, ce) || o7(k, ce) : !0;
- }
- function xk(k, ce, pt, Yt, ai) {
- !I || !tT(I.text, k) || (Wt || (uK(Hs(), oe, ai, k), Wt = !0), ff(k), OC(I.text, Hs(), oe, k, ce, C), ff(ce), Yt ? oe.writeLine() : pt === 3 && oe.writeSpace(" "));
- }
- function ey(k) {
- _r || k === -1 || g1(
- k,
- /*isEmittedNode*/
- !0
- );
- }
- function n_(k) {
- i_(k, lh);
- }
- function lh(k, ce, pt, Yt) {
- !I || !tT(I.text, k) || (oe.isAtStartOfLine() || oe.writeSpace(" "), ff(k), OC(I.text, Hs(), oe, k, ce, C), ff(ce), Yt && oe.writeLine());
- }
- function uh(k, ce, pt) {
- _r || (Nt(), i_(k, ce ? lh : pt ? Y6 : Ra), Qt());
- }
- function Y6(k, ce, pt) {
- I && (ff(k), OC(I.text, Hs(), oe, k, ce, C), ff(ce), pt === 2 && oe.writeLine());
- }
- function Ra(k, ce, pt, Yt) {
- I && (ff(k), OC(I.text, Hs(), oe, k, ce, C), ff(ce), Yt ? oe.writeLine() : oe.writeSpace(" "));
- }
- function Tn(k, ce) {
- I && (Me === -1 || k !== Me) && (Cf(k) ? g2(ce) : mw(
- I.text,
- k,
- ce,
- /*state*/
- k
- ));
- }
- function i_(k, ce) {
- I && (Qe === -1 || k !== Qe && k !== et) && gw(I.text, k, ce);
- }
- function Cf(k) {
- return ft !== void 0 && _a(ft).nodePos === k;
- }
- function g2(k) {
- if (!I) return;
- const ce = _a(ft).detachedCommentEndPos;
- ft.length - 1 ? ft.pop() : ft = void 0, mw(
- I.text,
- ce,
- k,
- /*state*/
- ce
- );
- }
- function Z6(k) {
- const ce = I && _K(I.text, Hs(), oe, kk, k, C, _r);
- ce && (ft ? ft.push(ce) : ft = [ce]);
- }
- function kk(k, ce, pt, Yt, ai, qi) {
- !I || !tT(I.text, Yt) || (ff(Yt), OC(k, ce, pt, Yt, ai, qi), ff(ai));
- }
- function Uv(k, ce) {
- return !!I && Rj(I.text, k, ce);
- }
- function h2(k, ce) {
- const pt = xe(3, k, ce);
- y2(ce), pt(k, ce), nd(ce);
- }
- function y2(k) {
- const ce = ya(k), pt = E0(k), Yt = pt.source || tt;
- k.kind !== 353 && !(ce & 32) && pt.pos >= 0 && Vd(pt.source || tt, _f(Yt, pt.pos)), ce & 128 && (me = !0);
- }
- function nd(k) {
- const ce = ya(k), pt = E0(k);
- ce & 128 && (me = !1), k.kind !== 353 && !(ce & 64) && pt.end >= 0 && Vd(pt.source || tt, pt.end);
- }
- function _f(k, ce) {
- return k.skipTrivia ? k.skipTrivia(ce) : aa(k.text, ce);
- }
- function ff(k) {
- if (me || Pd(k) || Ck(tt))
- return;
- const { line: ce, character: pt } = Qs(tt, k);
- ve.addMapping(
- oe.getLine(),
- oe.getColumn(),
- Te,
- ce,
- pt,
- /*nameIndex*/
- void 0
- );
- }
- function Vd(k, ce) {
- if (k !== tt) {
- const pt = tt, Yt = Te;
- rT(k), ff(ce), ol(pt, Yt);
- } else
- ff(ce);
- }
- function id(k, ce, pt, Yt, ai) {
- if (me || k && E7(k))
- return ai(ce, pt, Yt);
- const qi = k && k.emitNode, Ki = qi && qi.flags || 0, Hi = qi && qi.tokenSourceMapRanges && qi.tokenSourceMapRanges[ce], Li = Hi && Hi.source || tt;
- return Yt = _f(Li, Hi ? Hi.pos : Yt), !(Ki & 256) && Yt >= 0 && Vd(Li, Yt), Yt = ai(ce, pt, Yt), Hi && (Yt = Hi.end), !(Ki & 512) && Yt >= 0 && Vd(Li, Yt), Yt;
- }
- function rT(k) {
- if (!me) {
- if (tt = k, k === we) {
- Te = fe;
- return;
- }
- Ck(k) || (Te = ve.addSource(k.fileName), e.inlineSources && ve.setSourceContent(Te, k.text), we = k, fe = Te);
- }
- }
- function ol(k, ce) {
- tt = k, Te = ce;
- }
- function Ck(k) {
- return qo(
- k.fileName,
- ".json"
- /* Json */
- );
- }
- }
- function CRe() {
- const e = [];
- return e[
- 1024
- /* Braces */
- ] = ["{", "}"], e[
- 2048
- /* Parenthesis */
- ] = ["(", ")"], e[
- 4096
- /* AngleBrackets */
- ] = ["<", ">"], e[
- 8192
- /* SquareBrackets */
- ] = ["[", "]"], e;
- }
- function ERe(e) {
- return a1e[
- e & 15360
- /* BracketsMask */
- ][0];
- }
- function DRe(e) {
- return a1e[
- e & 15360
- /* BracketsMask */
- ][1];
- }
- function PRe(e, t, n, i) {
- t(e);
- }
- function wRe(e, t, n, i) {
- t(e, n.select(i));
- }
- function ARe(e, t, n, i) {
- t(e, n);
- }
- function NRe(e, t) {
- return e.length === 1 ? PRe : typeof t == "object" ? wRe : ARe;
- }
- function nF(e, t, n) {
- if (!e.getDirectories || !e.readDirectory)
- return;
- const i = /* @__PURE__ */ new Map(), s = zl(n);
- return {
- useCaseSensitiveFileNames: n,
- fileExists: T,
- readFile: (V, ae) => e.readFile(V, ae),
- directoryExists: e.directoryExists && C,
- getDirectories: P,
- readDirectory: I,
- createDirectory: e.createDirectory && D,
- writeFile: e.writeFile && S,
- addOrDeleteFileOrDirectory: B,
- addOrDeleteFile: z,
- clearCache: q,
- realpath: e.realpath && F
- };
- function o(V) {
- return uo(V, t, s);
- }
- function c(V) {
- return i.get(ul(V));
- }
- function _(V) {
- const ae = c(Xn(V));
- return ae && (ae.sortedAndCanonicalizedFiles || (ae.sortedAndCanonicalizedFiles = ae.files.map(s).sort(), ae.sortedAndCanonicalizedDirectories = ae.directories.map(s).sort()), ae);
- }
- function u(V) {
- return Hc(Os(V));
- }
- function d(V, ae) {
- var ee;
- if (!e.realpath || ul(o(e.realpath(V))) === ae) {
- const G = {
- files: lr(e.readDirectory(
- V,
- /*extensions*/
- void 0,
- /*exclude*/
- void 0,
- /*include*/
- ["*.*"]
- ), u) || [],
- directories: e.getDirectories(V) || []
- };
- return i.set(ul(ae), G), G;
- }
- if ((ee = e.directoryExists) != null && ee.call(e, V))
- return i.set(ae, !1), !1;
- }
- function g(V, ae) {
- ae = ul(ae);
- const ee = c(ae);
- if (ee)
- return ee;
- try {
- return d(V, ae);
- } catch {
- E.assert(!i.has(ul(ae)));
- return;
- }
- }
- function h(V, ae) {
- return hy(V, ae, go, au) >= 0;
- }
- function S(V, ae, ee) {
- const G = o(V), ue = _(G);
- return ue && X(
- ue,
- u(V),
- /*fileExists*/
- !0
- ), e.writeFile(V, ae, ee);
- }
- function T(V) {
- const ae = o(V), ee = _(ae);
- return ee && h(ee.sortedAndCanonicalizedFiles, s(u(V))) || e.fileExists(V);
- }
- function C(V) {
- const ae = o(V);
- return i.has(ul(ae)) || e.directoryExists(V);
- }
- function D(V) {
- const ae = o(V), ee = _(ae);
- if (ee) {
- const G = u(V), ue = s(G), re = ee.sortedAndCanonicalizedDirectories;
- my(re, ue, au) && ee.directories.push(G);
- }
- e.createDirectory(V);
- }
- function P(V) {
- const ae = o(V), ee = g(V, ae);
- return ee ? ee.directories.slice() : e.getDirectories(V);
- }
- function I(V, ae, ee, G, ue) {
- const re = o(V), ne = g(V, re);
- let ie;
- if (ne !== void 0)
- return nJ(V, ae, ee, G, n, t, ue, Se, F);
- return e.readDirectory(V, ae, ee, G, ue);
- function Se(oe) {
- const _e = o(oe);
- if (_e === re)
- return ne || J(oe, _e);
- const he = g(oe, _e);
- return he !== void 0 ? he || J(oe, _e) : aJ;
- }
- function J(oe, _e) {
- if (ie && _e === re) return ie;
- const he = {
- files: lr(e.readDirectory(
- oe,
- /*extensions*/
- void 0,
- /*exclude*/
- void 0,
- /*include*/
- ["*.*"]
- ), u) || Ue,
- directories: e.getDirectories(oe) || Ue
- };
- return _e === re && (ie = he), he;
- }
- }
- function F(V) {
- return e.realpath ? e.realpath(V) : V;
- }
- function O(V) {
- Fp(
- Xn(V),
- (ae) => i.delete(ul(ae)) ? !0 : void 0
- );
- }
- function B(V, ae) {
- if (c(ae) !== void 0) {
- q();
- return;
- }
- const G = _(ae);
- if (!G) {
- O(ae);
- return;
- }
- if (!e.directoryExists) {
- q();
- return;
- }
- const ue = u(V), re = {
- fileExists: e.fileExists(V),
- directoryExists: e.directoryExists(V)
- };
- return re.directoryExists || h(G.sortedAndCanonicalizedDirectories, s(ue)) ? q() : X(G, ue, re.fileExists), re;
- }
- function z(V, ae, ee) {
- if (ee === 1)
- return;
- const G = _(ae);
- G ? X(
- G,
- u(V),
- ee === 0
- /* Created */
- ) : O(ae);
- }
- function X(V, ae, ee) {
- const G = V.sortedAndCanonicalizedFiles, ue = s(ae);
- if (ee)
- my(G, ue, au) && V.files.push(ae);
- else {
- const re = hy(G, ue, go, au);
- if (re >= 0) {
- G.splice(re, 1);
- const ne = V.files.findIndex((ie) => s(ie) === ue);
- V.files.splice(ne, 1);
- }
- }
- }
- function q() {
- i.clear();
- }
- }
- var One = /* @__PURE__ */ ((e) => (e[e.Update = 0] = "Update", e[e.RootNamesAndUpdate = 1] = "RootNamesAndUpdate", e[e.Full = 2] = "Full", e))(One || {});
- function iF(e, t, n, i, s) {
- var o;
- const c = Yk(((o = t?.configFile) == null ? void 0 : o.extendedSourceFiles) || Ue, s);
- n.forEach((_, u) => {
- c.has(u) || (_.projects.delete(e), _.close());
- }), c.forEach((_, u) => {
- const d = n.get(u);
- d ? d.projects.add(e) : n.set(u, {
- projects: /* @__PURE__ */ new Set([e]),
- watcher: i(_, u),
- close: () => {
- const g = n.get(u);
- !g || g.projects.size !== 0 || (g.watcher.close(), n.delete(u));
- }
- });
- });
- }
- function CW(e, t) {
- t.forEach((n) => {
- n.projects.delete(e) && n.close();
- });
- }
- function sF(e, t, n) {
- e.delete(t) && e.forEach(({ extendedResult: i }, s) => {
- var o;
- (o = i.extendedSourceFiles) != null && o.some((c) => n(c) === t) && sF(e, s, n);
- });
- }
- function EW(e, t, n) {
- M4(
- t,
- e.getMissingFilePaths(),
- {
- // Watch the missing files
- createNewValue: n,
- // Files that are no longer missing (e.g. because they are no longer required)
- // should no longer be watched.
- onDeleteValue: fd
- }
- );
- }
- function RA(e, t, n) {
- t ? M4(
- e,
- new Map(Object.entries(t)),
- {
- // Create new watch and recursive info
- createNewValue: i,
- // Close existing watch thats not needed any more
- onDeleteValue: mp,
- // Close existing watch that doesnt match in the flags
- onExistingValue: s
- }
- ) : D_(e, mp);
- function i(o, c) {
- return {
- watcher: n(o, c),
- flags: c
- };
- }
- function s(o, c, _) {
- o.flags !== c && (o.watcher.close(), e.set(_, i(_, c)));
- }
- }
- function jA({
- watchedDirPath: e,
- fileOrDirectory: t,
- fileOrDirectoryPath: n,
- configFileName: i,
- options: s,
- program: o,
- extraFileExtensions: c,
- currentDirectory: _,
- useCaseSensitiveFileNames: u,
- writeLog: d,
- toPath: g,
- getScriptKind: h
- }) {
- const S = vF(n);
- if (!S)
- return d(`Project: ${i} Detected ignored path: ${t}`), !0;
- if (n = S, n === e) return !1;
- if (tC(n) && !(ZK(t, s, c) || I()))
- return d(`Project: ${i} Detected file add/remove of non supported extension: ${t}`), !0;
- if (tre(t, s.configFile.configFileSpecs, es(Xn(i), _), u, _))
- return d(`Project: ${i} Detected excluded file: ${t}`), !0;
- if (!o || s.outFile || s.outDir) return !1;
- if (wl(n)) {
- if (s.declarationDir) return !1;
- } else if (!xc(n, jC))
- return !1;
- const T = $u(n), C = us(o) ? void 0 : nU(o) ? o.getProgramOrUndefined() : o, D = !C && !us(o) ? o : void 0;
- if (P(
- T + ".ts"
- /* Ts */
- ) || P(
- T + ".tsx"
- /* Tsx */
- ))
- return d(`Project: ${i} Detected output file: ${t}`), !0;
- return !1;
- function P(F) {
- return C ? !!C.getSourceFileByPath(F) : D ? D.state.fileInfos.has(F) : !!On(o, (O) => g(O) === F);
- }
- function I() {
- if (!h) return !1;
- switch (h(t)) {
- case 3:
- case 4:
- case 7:
- case 5:
- return !0;
- case 1:
- case 2:
- return By(s);
- case 6:
- return Ab(s);
- case 0:
- return !1;
- }
- }
- }
- function Fne(e, t) {
- return e ? e.isEmittedFile(t) : !1;
- }
- var Lne = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.TriggerOnly = 1] = "TriggerOnly", e[e.Verbose = 2] = "Verbose", e))(Lne || {});
- function DW(e, t, n, i) {
- VQ(t === 2 ? n : ja);
- const s = {
- watchFile: (D, P, I, F) => e.watchFile(D, P, I, F),
- watchDirectory: (D, P, I, F) => e.watchDirectory(D, P, (I & 1) !== 0, F)
- }, o = t !== 0 ? {
- watchFile: T("watchFile"),
- watchDirectory: T("watchDirectory")
- } : void 0, c = t === 2 ? {
- watchFile: h,
- watchDirectory: S
- } : o || s, _ = t === 2 ? g : zD;
- return {
- watchFile: u("watchFile"),
- watchDirectory: u("watchDirectory")
- };
- function u(D) {
- return (P, I, F, O, B, z) => {
- var X;
- return PO(P, D === "watchFile" ? O?.excludeFiles : O?.excludeDirectories, d(), ((X = e.getCurrentDirectory) == null ? void 0 : X.call(e)) || "") ? _(P, F, O, B, z) : c[D].call(
- /*thisArgs*/
- void 0,
- P,
- I,
- F,
- O,
- B,
- z
- );
- };
- }
- function d() {
- return typeof e.useCaseSensitiveFileNames == "boolean" ? e.useCaseSensitiveFileNames : e.useCaseSensitiveFileNames();
- }
- function g(D, P, I, F, O) {
- return n(`ExcludeWatcher:: Added:: ${C(D, P, I, F, O, i)}`), {
- close: () => n(`ExcludeWatcher:: Close:: ${C(D, P, I, F, O, i)}`)
- };
- }
- function h(D, P, I, F, O, B) {
- n(`FileWatcher:: Added:: ${C(D, I, F, O, B, i)}`);
- const z = o.watchFile(D, P, I, F, O, B);
- return {
- close: () => {
- n(`FileWatcher:: Close:: ${C(D, I, F, O, B, i)}`), z.close();
- }
- };
- }
- function S(D, P, I, F, O, B) {
- const z = `DirectoryWatcher:: Added:: ${C(D, I, F, O, B, i)}`;
- n(z);
- const X = lo(), q = o.watchDirectory(D, P, I, F, O, B), V = lo() - X;
- return n(`Elapsed:: ${V}ms ${z}`), {
- close: () => {
- const ae = `DirectoryWatcher:: Close:: ${C(D, I, F, O, B, i)}`;
- n(ae);
- const ee = lo();
- q.close();
- const G = lo() - ee;
- n(`Elapsed:: ${G}ms ${ae}`);
- }
- };
- }
- function T(D) {
- return (P, I, F, O, B, z) => s[D].call(
- /*thisArgs*/
- void 0,
- P,
- (...X) => {
- const q = `${D === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${X[0]} ${X[1] !== void 0 ? X[1] : ""}:: ${C(P, F, O, B, z, i)}`;
- n(q);
- const V = lo();
- I.call(
- /*thisArg*/
- void 0,
- ...X
- );
- const ae = lo() - V;
- n(`Elapsed:: ${ae}ms ${q}`);
- },
- F,
- O,
- B,
- z
- );
- }
- function C(D, P, I, F, O, B) {
- return `WatchInfo: ${D} ${P} ${JSON.stringify(I)} ${B ? B(F, O) : O === void 0 ? F : `${F} ${O}`}`;
- }
- }
- function BA(e) {
- const t = e?.fallbackPolling;
- return {
- watchFile: t !== void 0 ? t : 1
- /* PriorityPollingInterval */
- };
- }
- function mp(e) {
- e.watcher.close();
- }
- function PW(e, t, n = "tsconfig.json") {
- return Fp(e, (i) => {
- const s = Bn(i, n);
- return t(s) ? s : void 0;
- });
- }
- function wW(e, t) {
- const n = Xn(t), i = H_(e) ? e : Bn(n, e);
- return Os(i);
- }
- function Mne(e, t, n) {
- let i;
- return ir(e, (o) => {
- const c = _w(o, t);
- if (c.pop(), !i) {
- i = c;
- return;
- }
- const _ = Math.min(i.length, c.length);
- for (let u = 0; u < _; u++)
- if (n(i[u]) !== n(c[u])) {
- if (u === 0)
- return !0;
- i.length = u;
- break;
- }
- c.length < i.length && (i.length = c.length);
- }) ? "" : i ? p0(i) : t;
- }
- function Rne(e, t) {
- return aF(e, t);
- }
- function AW(e, t) {
- return (n, i, s) => {
- let o;
- try {
- Ko("beforeIORead"), o = e(n), Ko("afterIORead"), rp("I/O Read", "beforeIORead", "afterIORead");
- } catch (c) {
- s && s(c.message), o = "";
- }
- return o !== void 0 ? Bx(n, o, i, t) : void 0;
- };
- }
- function NW(e, t, n) {
- return (i, s, o, c) => {
- try {
- Ko("beforeIOWrite"), wB(
- i,
- s,
- o,
- e,
- t,
- n
- ), Ko("afterIOWrite"), rp("I/O Write", "beforeIOWrite", "afterIOWrite");
- } catch (_) {
- c && c(_.message);
- }
- };
- }
- function aF(e, t, n = ll) {
- const i = /* @__PURE__ */ new Map(), s = zl(n.useCaseSensitiveFileNames);
- function o(g) {
- return i.has(g) ? !0 : (d.directoryExists || n.directoryExists)(g) ? (i.set(g, !0), !0) : !1;
- }
- function c() {
- return Xn(Os(n.getExecutingFilePath()));
- }
- const _ = k0(e), u = n.realpath && ((g) => n.realpath(g)), d = {
- getSourceFile: AW((g) => d.readFile(g), t),
- getDefaultLibLocation: c,
- getDefaultLibFileName: (g) => Bn(c(), yw(g)),
- writeFile: NW(
- (g, h, S) => n.writeFile(g, h, S),
- (g) => (d.createDirectory || n.createDirectory)(g),
- (g) => o(g)
- ),
- getCurrentDirectory: Iu(() => n.getCurrentDirectory()),
- useCaseSensitiveFileNames: () => n.useCaseSensitiveFileNames,
- getCanonicalFileName: s,
- getNewLine: () => _,
- fileExists: (g) => n.fileExists(g),
- readFile: (g) => n.readFile(g),
- trace: (g) => n.write(g + _),
- directoryExists: (g) => n.directoryExists(g),
- getEnvironmentVariable: (g) => n.getEnvironmentVariable ? n.getEnvironmentVariable(g) : "",
- getDirectories: (g) => n.getDirectories(g),
- realpath: u,
- readDirectory: (g, h, S, T, C) => n.readDirectory(g, h, S, T, C),
- createDirectory: (g) => n.createDirectory(g),
- createHash: Ms(n, n.createHash)
- };
- return d;
- }
- function MD(e, t, n) {
- const i = e.readFile, s = e.fileExists, o = e.directoryExists, c = e.createDirectory, _ = e.writeFile, u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), S = (D) => {
- const P = t(D), I = u.get(P);
- return I !== void 0 ? I !== !1 ? I : void 0 : T(P, D);
- }, T = (D, P) => {
- const I = i.call(e, P);
- return u.set(D, I !== void 0 ? I : !1), I;
- };
- e.readFile = (D) => {
- const P = t(D), I = u.get(P);
- return I !== void 0 ? I !== !1 ? I : void 0 : !qo(
- D,
- ".json"
- /* Json */
- ) && !Dne(D) ? i.call(e, D) : T(P, D);
- };
- const C = n ? (D, P, I, F) => {
- const O = t(D), B = typeof P == "object" ? P.impliedNodeFormat : void 0, z = h.get(B), X = z?.get(O);
- if (X) return X;
- const q = n(D, P, I, F);
- return q && (wl(D) || qo(
- D,
- ".json"
- /* Json */
- )) && h.set(B, (z || /* @__PURE__ */ new Map()).set(O, q)), q;
- } : void 0;
- return e.fileExists = (D) => {
- const P = t(D), I = d.get(P);
- if (I !== void 0) return I;
- const F = s.call(e, D);
- return d.set(P, !!F), F;
- }, _ && (e.writeFile = (D, P, ...I) => {
- const F = t(D);
- d.delete(F);
- const O = u.get(F);
- O !== void 0 && O !== P ? (u.delete(F), h.forEach((B) => B.delete(F))) : C && h.forEach((B) => {
- const z = B.get(F);
- z && z.text !== P && B.delete(F);
- }), _.call(e, D, P, ...I);
- }), o && (e.directoryExists = (D) => {
- const P = t(D), I = g.get(P);
- if (I !== void 0) return I;
- const F = o.call(e, D);
- return g.set(P, !!F), F;
- }, c && (e.createDirectory = (D) => {
- const P = t(D);
- g.delete(P), c.call(e, D);
- })), {
- originalReadFile: i,
- originalFileExists: s,
- originalDirectoryExists: o,
- originalCreateDirectory: c,
- originalWriteFile: _,
- getSourceFileWithCache: C,
- readFileWithCache: S
- };
- }
- function d1e(e, t, n) {
- let i;
- return i = Fn(i, e.getConfigFileParsingDiagnostics()), i = Fn(i, e.getOptionsDiagnostics(n)), i = Fn(i, e.getSyntacticDiagnostics(t, n)), i = Fn(i, e.getGlobalDiagnostics(n)), i = Fn(i, e.getSemanticDiagnostics(t, n)), P_(e.getCompilerOptions()) && (i = Fn(i, e.getDeclarationDiagnostics(t, n))), sC(i || Ue);
- }
- function m1e(e, t) {
- let n = "";
- for (const i of e)
- n += IW(i, t);
- return n;
- }
- function IW(e, t) {
- const n = `${U2(e)} TS${e.code}: ${Em(e.messageText, t.getNewLine())}${t.getNewLine()}`;
- if (e.file) {
- const { line: i, character: s } = Qs(e.file, e.start), o = e.file.fileName;
- return `${VE(o, t.getCurrentDirectory(), (_) => t.getCanonicalFileName(_))}(${i + 1},${s + 1}): ` + n;
- }
- return n;
- }
- var jne = /* @__PURE__ */ ((e) => (e.Grey = "\x1B[90m", e.Red = "\x1B[91m", e.Yellow = "\x1B[93m", e.Blue = "\x1B[94m", e.Cyan = "\x1B[96m", e))(jne || {}), Bne = "\x1B[7m", Jne = " ", g1e = "\x1B[0m", h1e = "...", IRe = " ", y1e = " ";
- function v1e(e) {
- switch (e) {
- case 1:
- return "\x1B[91m";
- case 0:
- return "\x1B[93m";
- case 2:
- return E.fail("Should never get an Info diagnostic on the command line.");
- case 3:
- return "\x1B[94m";
- }
- }
- function Xb(e, t) {
- return t + e + g1e;
- }
- function b1e(e, t, n, i, s, o) {
- const { line: c, character: _ } = Qs(e, t), { line: u, character: d } = Qs(e, t + n), g = Qs(e, e.text.length).line, h = u - c >= 4;
- let S = (u + 1 + "").length;
- h && (S = Math.max(h1e.length, S));
- let T = "";
- for (let C = c; C <= u; C++) {
- T += o.getNewLine(), h && c + 1 < C && C < u - 1 && (T += i + Xb(h1e.padStart(S), Bne) + Jne + o.getNewLine(), C = u - 1);
- const D = pw(e, C, 0), P = C < g ? pw(e, C + 1, 0) : e.text.length;
- let I = e.text.slice(D, P);
- if (I = I.trimEnd(), I = I.replace(/\t/g, " "), T += i + Xb((C + 1 + "").padStart(S), Bne) + Jne, T += I + o.getNewLine(), T += i + Xb("".padStart(S), Bne) + Jne, T += s, C === c) {
- const F = C === u ? d : void 0;
- T += I.slice(0, _).replace(/\S/g, " "), T += I.slice(_, F).replace(/./g, "~");
- } else C === u ? T += I.slice(0, d).replace(/./g, "~") : T += I.replace(/./g, "~");
- T += g1e;
- }
- return T;
- }
- function OW(e, t, n, i = Xb) {
- const { line: s, character: o } = Qs(e, t), c = n ? VE(e.fileName, n.getCurrentDirectory(), (u) => n.getCanonicalFileName(u)) : e.fileName;
- let _ = "";
- return _ += i(
- c,
- "\x1B[96m"
- /* Cyan */
- ), _ += ":", _ += i(
- `${s + 1}`,
- "\x1B[93m"
- /* Yellow */
- ), _ += ":", _ += i(
- `${o + 1}`,
- "\x1B[93m"
- /* Yellow */
- ), _;
- }
- function zne(e, t) {
- let n = "";
- for (const i of e) {
- if (i.file) {
- const { file: s, start: o } = i;
- n += OW(s, o, t), n += " - ";
- }
- if (n += Xb(U2(i), v1e(i.category)), n += Xb(
- ` TS${i.code}: `,
- "\x1B[90m"
- /* Grey */
- ), n += Em(i.messageText, t.getNewLine()), i.file && i.code !== p.File_appears_to_be_binary.code && (n += t.getNewLine(), n += b1e(i.file, i.start, i.length, "", v1e(i.category), t)), i.relatedInformation) {
- n += t.getNewLine();
- for (const { file: s, start: o, length: c, messageText: _ } of i.relatedInformation)
- s && (n += t.getNewLine(), n += IRe + OW(s, o, t), n += b1e(s, o, c, y1e, "\x1B[96m", t)), n += t.getNewLine(), n += y1e + Em(_, t.getNewLine());
- }
- n += t.getNewLine();
- }
- return n;
- }
- function Em(e, t, n = 0) {
- if (_s(e))
- return e;
- if (e === void 0)
- return "";
- let i = "";
- if (n) {
- i += t;
- for (let s = 0; s < n; s++)
- i += " ";
- }
- if (i += e.messageText, n++, e.next)
- for (const s of e.next)
- i += Em(s, t, n);
- return i;
- }
- function oF(e, t) {
- return (_s(e) ? t : e.resolutionMode) || t;
- }
- function S1e(e, t, n) {
- return MW(e, UA(e, t), n);
- }
- function FW(e) {
- var t;
- return Nc(e) ? e.isTypeOnly : !!((t = e.importClause) != null && t.isTypeOnly);
- }
- function LW(e, t, n) {
- return MW(e, t, n);
- }
- function MW(e, t, n) {
- if ((ic(t.parent) || Nc(t.parent) || Cm(t.parent)) && FW(t.parent)) {
- const s = d6(t.parent.attributes);
- if (s)
- return s;
- }
- if (t.parent.parent && bm(t.parent.parent)) {
- const i = d6(t.parent.parent.attributes);
- if (i)
- return i;
- }
- if (n && YB(n))
- return T1e(e, t, n);
- }
- function T1e(e, t, n) {
- var i;
- if (!n)
- return;
- const s = (i = ag(t.parent)) == null ? void 0 : i.parent;
- if (s && gl(s) || f_(
- t.parent,
- /*requireStringLiteralLikeArgument*/
- !1
- ))
- return 1;
- if (hf(ag(t.parent)))
- return P1e(e, n) ? 1 : 99;
- const o = BD(e, n);
- return o === 1 ? 1 : j3(o) || o === 200 ? 99 : void 0;
- }
- function d6(e, t) {
- if (!e) return;
- if (Nr(e.elements) !== 1) {
- t?.(
- e,
- e.token === 118 ? p.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : p.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require
- );
- return;
- }
- const n = e.elements[0];
- if (Xa(n.name)) {
- if (n.name.text !== "resolution-mode") {
- t?.(
- n.name,
- e.token === 118 ? p.resolution_mode_is_the_only_valid_key_for_type_import_attributes : p.resolution_mode_is_the_only_valid_key_for_type_import_assertions
- );
- return;
- }
- if (Xa(n.value)) {
- if (n.value.text !== "import" && n.value.text !== "require") {
- t?.(n.value, p.resolution_mode_should_be_either_require_or_import);
- return;
- }
- return n.value.text === "import" ? 99 : 1;
- }
- }
- }
- var x1e = {
- resolvedModule: void 0,
- resolvedTypeReferenceDirective: void 0
- };
- function Wne(e) {
- return e.text;
- }
- var cF = {
- getName: Wne,
- getMode: (e, t, n) => LW(t, e, n)
- };
- function RW(e, t, n, i, s) {
- return {
- nameAndMode: cF,
- resolve: (o, c) => Vx(
- o,
- e,
- n,
- i,
- s,
- t,
- c
- )
- };
- }
- function Une(e) {
- return _s(e) ? e : e.fileName;
- }
- var k1e = {
- getName: Une,
- getMode: (e, t, n) => oF(e, t && pF(t, n))
- };
- function lF(e, t, n, i, s) {
- return {
- nameAndMode: k1e,
- resolve: (o, c) => _re(
- o,
- e,
- n,
- i,
- t,
- s,
- c
- )
- };
- }
- function JA(e, t, n, i, s, o, c, _) {
- if (e.length === 0) return Ue;
- const u = [], d = /* @__PURE__ */ new Map(), g = _(t, n, i, o, c);
- for (const h of e) {
- const S = g.nameAndMode.getName(h), T = g.nameAndMode.getMode(h, s, n?.commandLine.options || i), C = xD(S, T);
- let D = d.get(C);
- D || d.set(C, D = g.resolve(S, T)), u.push(D);
- }
- return u;
- }
- function jW(e, t) {
- return uF(
- /*projectReferences*/
- void 0,
- e,
- (n, i) => n && t(n, i)
- );
- }
- function uF(e, t, n, i) {
- let s;
- return o(
- e,
- t,
- /*parent*/
- void 0
- );
- function o(c, _, u) {
- if (i) {
- const d = i(c, u);
- if (d) return d;
- }
- return ir(_, (d, g) => {
- if (d && s?.has(d.sourceFile.path))
- return;
- const h = n(d, u, g);
- return h || !d ? h : ((s || (s = /* @__PURE__ */ new Set())).add(d.sourceFile.path), o(d.commandLine.projectReferences, d.references, d));
- });
- }
- }
- var RD = "__inferred type names__.ts";
- function _F(e, t, n) {
- const i = e.configFilePath ? Xn(e.configFilePath) : t;
- return Bn(i, `__lib_node_modules_lookup_${n}__.ts`);
- }
- function BW(e) {
- const t = e.split(".");
- let n = t[1], i = 2;
- for (; t[i] && t[i] !== "d"; )
- n += (i === 2 ? "/" : "-") + t[i], i++;
- return "@typescript/lib-" + n;
- }
- function C1e(e) {
- return vy(e.fileName);
- }
- function E1e(e) {
- const t = C1e(e);
- return pz.get(t);
- }
- function Sv(e) {
- switch (e?.kind) {
- case 3:
- case 4:
- case 5:
- case 7:
- return !0;
- default:
- return !1;
- }
- }
- function m6(e) {
- return e.pos !== void 0;
- }
- function jD(e, t) {
- var n, i, s, o;
- const c = E.checkDefined(e.getSourceFileByPath(t.file)), { kind: _, index: u } = t;
- let d, g, h;
- switch (_) {
- case 3:
- const S = UA(c, u);
- if (h = (i = (n = e.getResolvedModuleFromModuleSpecifier(S, c)) == null ? void 0 : n.resolvedModule) == null ? void 0 : i.packageId, S.pos === -1) return { file: c, packageId: h, text: S.text };
- d = aa(c.text, S.pos), g = S.end;
- break;
- case 4:
- ({ pos: d, end: g } = c.referencedFiles[u]);
- break;
- case 5:
- ({ pos: d, end: g } = c.typeReferenceDirectives[u]), h = (o = (s = e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(c.typeReferenceDirectives[u], c)) == null ? void 0 : s.resolvedTypeReferenceDirective) == null ? void 0 : o.packageId;
- break;
- case 7:
- ({ pos: d, end: g } = c.libReferenceDirectives[u]);
- break;
- default:
- return E.assertNever(_);
- }
- return { file: c, pos: d, end: g, packageId: h };
- }
- function JW(e, t, n, i, s, o, c, _, u, d) {
- if (!e || _?.() || !Af(e.getRootFileNames(), t)) return !1;
- let g;
- if (!Af(e.getProjectReferences(), d, D) || e.getSourceFiles().some(T)) return !1;
- const h = e.getMissingFilePaths();
- if (h && El(h, s)) return !1;
- const S = e.getCompilerOptions();
- if (!VB(S, n) || e.resolvedLibReferences && El(e.resolvedLibReferences, (I, F) => c(F))) return !1;
- if (S.configFile && n.configFile) return S.configFile.text === n.configFile.text;
- return !0;
- function T(I) {
- return !C(I) || o(I.path);
- }
- function C(I) {
- return I.version === i(I.resolvedPath, I.fileName);
- }
- function D(I, F, O) {
- return Oj(I, F) && P(e.getResolvedProjectReferences()[O], I);
- }
- function P(I, F) {
- if (I) {
- if (ss(g, I)) return !0;
- const B = g6(F), z = u(B);
- return !z || I.commandLine.options.configFile !== z.options.configFile || !Af(I.commandLine.fileNames, z.fileNames) ? !1 : ((g || (g = [])).push(I), !ir(I.references, (X, q) => !P(X, I.commandLine.projectReferences[q])));
- }
- const O = g6(F);
- return !u(O);
- }
- }
- function Qb(e) {
- return e.options.configFile ? [...e.options.configFile.parseDiagnostics, ...e.errors] : e.errors;
- }
- function zA(e, t, n, i) {
- const s = fF(e, t, n, i);
- return typeof s == "object" ? s.impliedNodeFormat : s;
- }
- function fF(e, t, n, i) {
- const s = yu(i), o = 3 <= s && s <= 99 || Yy(e);
- return xc(e, [
- ".d.mts",
- ".mts",
- ".mjs"
- /* Mjs */
- ]) ? 99 : xc(e, [
- ".d.cts",
- ".cts",
- ".cjs"
- /* Cjs */
- ]) ? 1 : o && xc(e, [
- ".d.ts",
- ".ts",
- ".tsx",
- ".js",
- ".jsx"
- /* Jsx */
- ]) ? c() : void 0;
- function c() {
- const _ = kD(t, n, i), u = [];
- _.failedLookupLocations = u, _.affectingLocations = u;
- const d = CD(Xn(e), _);
- return { impliedNodeFormat: d?.contents.packageJsonContent.type === "module" ? 99 : 1, packageJsonLocations: u, packageJsonScope: d };
- }
- }
- var D1e = /* @__PURE__ */ new Set([
- // binder errors
- p.Cannot_redeclare_block_scoped_variable_0.code,
- p.A_module_cannot_have_multiple_default_exports.code,
- p.Another_export_default_is_here.code,
- p.The_first_export_default_is_here.code,
- p.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
- p.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
- p.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
- p.constructor_is_a_reserved_word.code,
- p.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,
- p.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,
- p.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,
- p.Invalid_use_of_0_in_strict_mode.code,
- p.A_label_is_not_allowed_here.code,
- p.with_statements_are_not_allowed_in_strict_mode.code,
- // grammar errors
- p.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
- p.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
- p.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
- p.A_class_member_cannot_have_the_0_keyword.code,
- p.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
- p.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
- p.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
- p.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
- p.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
- p.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
- p.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
- p.A_destructuring_declaration_must_have_an_initializer.code,
- p.A_get_accessor_cannot_have_parameters.code,
- p.A_rest_element_cannot_contain_a_binding_pattern.code,
- p.A_rest_element_cannot_have_a_property_name.code,
- p.A_rest_element_cannot_have_an_initializer.code,
- p.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
- p.A_rest_parameter_cannot_have_an_initializer.code,
- p.A_rest_parameter_must_be_last_in_a_parameter_list.code,
- p.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
- p.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
- p.A_set_accessor_cannot_have_rest_parameter.code,
- p.A_set_accessor_must_have_exactly_one_parameter.code,
- p.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
- p.An_export_declaration_cannot_have_modifiers.code,
- p.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
- p.An_import_declaration_cannot_have_modifiers.code,
- p.An_object_member_cannot_be_declared_optional.code,
- p.Argument_of_dynamic_import_cannot_be_spread_element.code,
- p.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
- p.Cannot_redeclare_identifier_0_in_catch_clause.code,
- p.Catch_clause_variable_cannot_have_an_initializer.code,
- p.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
- p.Classes_can_only_extend_a_single_class.code,
- p.Classes_may_not_have_a_field_named_constructor.code,
- p.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
- p.Duplicate_label_0.code,
- p.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
- p.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
- p.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
- p.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
- p.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
- p.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
- p.Jump_target_cannot_cross_function_boundary.code,
- p.Line_terminator_not_permitted_before_arrow.code,
- p.Modifiers_cannot_appear_here.code,
- p.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
- p.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
- p.Private_identifiers_are_not_allowed_outside_class_bodies.code,
- p.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
- p.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
- p.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
- p.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
- p.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
- p.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
- p.Trailing_comma_not_allowed.code,
- p.Variable_declaration_list_cannot_be_empty.code,
- p._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
- p._0_expected.code,
- p._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
- p._0_list_cannot_be_empty.code,
- p._0_modifier_already_seen.code,
- p._0_modifier_cannot_appear_on_a_constructor_declaration.code,
- p._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
- p._0_modifier_cannot_appear_on_a_parameter.code,
- p._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
- p._0_modifier_cannot_be_used_here.code,
- p._0_modifier_must_precede_1_modifier.code,
- p._0_declarations_can_only_be_declared_inside_a_block.code,
- p._0_declarations_must_be_initialized.code,
- p.extends_clause_already_seen.code,
- p.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
- p.Class_constructor_may_not_be_a_generator.code,
- p.Class_constructor_may_not_be_an_accessor.code,
- p.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
- p.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
- p.Private_field_0_must_be_declared_in_an_enclosing_class.code,
- // Type errors
- p.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code
- ]);
- function ORe(e, t) {
- return e ? pC(e.getCompilerOptions(), t, gz) : !1;
- }
- function FRe(e, t, n, i, s, o) {
- return {
- rootNames: e,
- options: t,
- host: n,
- oldProgram: i,
- configFileParsingDiagnostics: s,
- typeScriptVersion: o
- };
- }
- function WA(e, t, n, i, s) {
- var o, c, _, u, d, g, h, S, T, C, D, P, I, F, O, B;
- const z = us(e) ? FRe(e, t, n, i, s) : e, { rootNames: X, options: q, configFileParsingDiagnostics: V, projectReferences: ae, typeScriptVersion: ee } = z;
- let { oldProgram: G } = z;
- for (const Ne of Wte)
- if (co(q, Ne.name) && typeof q[Ne.name] == "string")
- throw new Error(`${Ne.name} is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram`);
- const ue = Iu(() => Tf("ignoreDeprecations", p.Invalid_value_for_ignoreDeprecations));
- let re, ne, ie, Se, J, oe, _e, he = Ip(), le, me, ve, tt, Te, we, fe, Me, Qe, et, Re, ft, Wt, _r, Ir;
- const jr = typeof q.maxNodeModuleJsDepth == "number" ? q.maxNodeModuleJsDepth : 0;
- let Nt = 0;
- const Qt = /* @__PURE__ */ new Map(), Br = /* @__PURE__ */ new Map();
- (o = rn) == null || o.push(
- rn.Phase.Program,
- "createProgram",
- { configFilePath: q.configFilePath, rootDir: q.rootDir },
- /*separateBeginAndEnd*/
- !0
- ), Ko("beforeProgram");
- const xr = z.host || Rne(q), zn = mF(xr);
- let ki = q.noLib;
- const rs = Iu(() => xr.getDefaultLibFileName(q)), ei = xr.getDefaultLibLocation ? xr.getDefaultLibLocation() : Xn(rs()), Ri = x3();
- let Jr = [];
- const ji = xr.getCurrentDirectory(), Fe = B4(q), Ot = J3(q, Fe), Ar = /* @__PURE__ */ new Map();
- let mn, ti, qn, Oi;
- const Ws = xr.hasInvalidatedResolutions || nm;
- xr.resolveModuleNameLiterals ? (Oi = xr.resolveModuleNameLiterals.bind(xr), qn = (c = xr.getModuleResolutionCache) == null ? void 0 : c.call(xr)) : xr.resolveModuleNames ? (Oi = (Ne, qe, vt, qt, fr, qr) => xr.resolveModuleNames(
- Ne.map(Wne),
- qe,
- qr?.map(Wne),
- vt,
- qt,
- fr
- ).map(
- (kr) => kr ? kr.extension !== void 0 ? { resolvedModule: kr } : (
- // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
- { resolvedModule: { ...kr, extension: z4(kr.resolvedFileName) } }
- ) : x1e
- ), qn = (_ = xr.getModuleResolutionCache) == null ? void 0 : _.call(xr)) : (qn = o6(ji, En, q), Oi = (Ne, qe, vt, qt, fr) => JA(
- Ne,
- qe,
- vt,
- qt,
- fr,
- xr,
- qn,
- RW
- ));
- let Hs;
- if (xr.resolveTypeReferenceDirectiveReferences)
- Hs = xr.resolveTypeReferenceDirectiveReferences.bind(xr);
- else if (xr.resolveTypeReferenceDirectives)
- Hs = (Ne, qe, vt, qt, fr) => xr.resolveTypeReferenceDirectives(
- Ne.map(Une),
- qe,
- vt,
- qt,
- fr?.impliedNodeFormat
- ).map((qr) => ({ resolvedTypeReferenceDirective: qr }));
- else {
- const Ne = OO(
- ji,
- En,
- /*options*/
- void 0,
- qn?.getPackageJsonInfoCache(),
- qn?.optionsToRedirectsKey
- );
- Hs = (qe, vt, qt, fr, qr) => JA(
- qe,
- vt,
- qt,
- fr,
- qr,
- xr,
- Ne,
- lF
- );
- }
- const rr = xr.hasInvalidatedLibResolutions || nm;
- let Ea;
- if (xr.resolveLibrary)
- Ea = xr.resolveLibrary.bind(xr);
- else {
- const Ne = o6(ji, En, q, qn?.getPackageJsonInfoCache());
- Ea = (qe, vt, qt) => FO(qe, vt, qt, xr, Ne);
- }
- const Xe = /* @__PURE__ */ new Map();
- let Tt = /* @__PURE__ */ new Map(), te = Ip(), ze = !1;
- const K = /* @__PURE__ */ new Map();
- let De = /* @__PURE__ */ new Map();
- const Ve = xr.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
- let Ke, xe, at, $e;
- const bt = !!((u = xr.useSourceOfProjectReferenceRedirect) != null && u.call(xr)) && !q.disableSourceOfProjectReferenceRedirect, { onProgramCreateComplete: He, fileExists: Vt, directoryExists: Zt } = LRe({
- compilerHost: xr,
- getSymlinkCache: qf,
- useSourceOfProjectReferenceRedirect: bt,
- toPath: hr,
- getResolvedProjectReferences: Ll,
- getSourceOfProjectReferenceRedirect: vl,
- forEachResolvedProjectReference: y_
- }), vn = xr.readFile.bind(xr);
- (d = rn) == null || d.push(rn.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!G });
- const M = ORe(G, q);
- (g = rn) == null || g.pop();
- let Ae;
- if ((h = rn) == null || h.push(rn.Phase.Program, "tryReuseStructureFromOldProgram", {}), Ae = Ic(), (S = rn) == null || S.pop(), Ae !== 2) {
- if (re = [], ne = [], ae && (Ke || (Ke = ae.map(Ce)), X.length && Ke?.forEach((Ne, qe) => {
- if (!Ne) return;
- const vt = Ne.commandLine.options.outFile;
- if (bt) {
- if (vt || Ru(Ne.commandLine.options) === 0)
- for (const qt of Ne.commandLine.fileNames)
- Pc(qt, { kind: 1, index: qe });
- } else if (vt)
- Pc(zy(vt, ".d.ts"), { kind: 2, index: qe });
- else if (Ru(Ne.commandLine.options) === 0) {
- const qt = Iu(() => Gx(Ne.commandLine, !xr.useCaseSensitiveFileNames()));
- for (const fr of Ne.commandLine.fileNames)
- !wl(fr) && !qo(
- fr,
- ".json"
- /* Json */
- ) && Pc(p6(fr, Ne.commandLine, !xr.useCaseSensitiveFileNames(), qt), { kind: 2, index: qe });
- }
- })), (T = rn) == null || T.push(rn.Phase.Program, "processRootFiles", { count: X.length }), ir(X, (Ne, qe) => Lc(
- Ne,
- /*isDefaultLib*/
- !1,
- /*ignoreNoDefaultLib*/
- !1,
- { kind: 0, index: qe }
- )), (C = rn) == null || C.pop(), fe ?? (fe = X.length ? NO(q, xr) : Ue), Me = a6(), fe.length) {
- (D = rn) == null || D.push(rn.Phase.Program, "processTypeReferences", { count: fe.length });
- const Ne = q.configFilePath ? Xn(q.configFilePath) : ji, qe = Bn(Ne, RD), vt = Ts(fe, qe);
- for (let qt = 0; qt < fe.length; qt++)
- Me.set(
- fe[qt],
- /*mode*/
- void 0,
- vt[qt]
- ), st(
- fe[qt],
- /*mode*/
- void 0,
- vt[qt],
- {
- kind: 8,
- typeReference: fe[qt],
- packageId: (I = (P = vt[qt]) == null ? void 0 : P.resolvedTypeReferenceDirective) == null ? void 0 : I.packageId
- }
- );
- (F = rn) == null || F.pop();
- }
- if (X.length && !ki) {
- const Ne = rs();
- !q.lib && Ne ? Lc(
- Ne,
- /*isDefaultLib*/
- !0,
- /*ignoreNoDefaultLib*/
- !1,
- {
- kind: 6
- /* LibFile */
- }
- ) : ir(q.lib, (qe, vt) => {
- Lc(
- Mt(qe),
- /*isDefaultLib*/
- !0,
- /*ignoreNoDefaultLib*/
- !1,
- { kind: 6, index: vt }
- );
- });
- }
- ie = V_(re, mr).concat(ne), re = void 0, ne = void 0, le = void 0;
- }
- if (G && xr.onReleaseOldSourceFile) {
- const Ne = G.getSourceFiles();
- for (const qe of Ne) {
- const vt = Bt(qe.resolvedPath);
- (M || !vt || vt.impliedNodeFormat !== qe.impliedNodeFormat || // old file wasn't redirect but new file is
- qe.resolvedPath === qe.path && vt.resolvedPath !== qe.path) && xr.onReleaseOldSourceFile(qe, G.getCompilerOptions(), !!Bt(qe.path), vt);
- }
- xr.getParsedCommandLine || G.forEachResolvedProjectReference((qe) => {
- r_(qe.sourceFile.path) || xr.onReleaseOldSourceFile(
- qe.sourceFile,
- G.getCompilerOptions(),
- /*hasSourceFileByPath*/
- !1,
- /*newSourceFileByResolvedPath*/
- void 0
- );
- });
- }
- G && xr.onReleaseParsedCommandLine && uF(
- G.getProjectReferences(),
- G.getResolvedProjectReferences(),
- (Ne, qe, vt) => {
- const qt = qe?.commandLine.projectReferences[vt] || G.getProjectReferences()[vt], fr = g6(qt);
- xe?.has(hr(fr)) || xr.onReleaseParsedCommandLine(fr, Ne, G.getCompilerOptions());
- }
- ), G = void 0, et = void 0, ft = void 0, _r = void 0;
- const dt = {
- getRootFileNames: () => X,
- getSourceFile: ba,
- getSourceFileByPath: Bt,
- getSourceFiles: () => ie,
- getMissingFilePaths: () => De,
- getModuleResolutionCache: () => qn,
- getFilesByNameMap: () => K,
- getCompilerOptions: () => q,
- getSyntacticDiagnostics: _u,
- getOptionsDiagnostics: Fc,
- getGlobalDiagnostics: _c,
- getSemanticDiagnostics: Wc,
- getCachedSemanticDiagnostics: of,
- getSuggestionDiagnostics: ri,
- getDeclarationDiagnostics: $,
- getBindAndCheckDiagnostics: Ao,
- getProgramDiagnostics: ge,
- getTypeChecker: Yi,
- getClassifiableNames: Ss,
- getCommonSourceDirectory: Ft,
- emit: Na,
- getCurrentDirectory: () => ji,
- getNodeCount: () => Yi().getNodeCount(),
- getIdentifierCount: () => Yi().getIdentifierCount(),
- getSymbolCount: () => Yi().getSymbolCount(),
- getTypeCount: () => Yi().getTypeCount(),
- getInstantiationCount: () => Yi().getInstantiationCount(),
- getRelationCacheSizes: () => Yi().getRelationCacheSizes(),
- getFileProcessingDiagnostics: () => we,
- getAutomaticTypeDirectiveNames: () => fe,
- getAutomaticTypeDirectiveResolutions: () => Me,
- isSourceFileFromExternalLibrary: Cu,
- isSourceFileDefaultLibrary: Zc,
- getModeForUsageLocation: Kp,
- getEmitSyntaxForUsageLocation: qh,
- getModeForResolutionAtIndex: Iv,
- getSourceFileFromReference: $i,
- getLibFileFromReference: Lr,
- sourceFileToPackageName: Tt,
- redirectTargetsMap: te,
- usesUriStyleNodeCoreModules: ze,
- resolvedModules: Re,
- resolvedTypeReferenceDirectiveNames: Wt,
- resolvedLibReferences: Qe,
- getResolvedModule: Z,
- getResolvedModuleFromModuleSpecifier: ht,
- getResolvedTypeReferenceDirective: Le,
- getResolvedTypeReferenceDirectiveFromTypeReferenceDirective: Ie,
- forEachResolvedModule: At,
- forEachResolvedTypeReferenceDirective: Dr,
- getCurrentPackagesMap: () => Ir,
- typesPackageExists: nt,
- packageBundlesTypes: ot,
- isEmittedFile: Zp,
- getConfigFileParsingDiagnostics: Wf,
- getProjectReferences: xs,
- getResolvedProjectReferences: Ll,
- getProjectReferenceRedirect: Uf,
- getResolvedProjectReferenceToRedirect: Qp,
- getResolvedProjectReferenceByPath: r_,
- forEachResolvedProjectReference: y_,
- isSourceOfProjectReferenceRedirect: Uh,
- getRedirectReferenceForResolutionFromSourceOfProject: zt,
- getCompilerOptionsForFile: Y,
- getDefaultResolutionModeForFile: mg,
- getEmitModuleFormatOfFile: Ov,
- getImpliedNodeFormatForEmit: rh,
- shouldTransformImportCall: n1,
- emitBuildInfo: ca,
- fileExists: Vt,
- readFile: vn,
- directoryExists: Zt,
- getSymlinkCache: qf,
- realpath: (O = xr.realpath) == null ? void 0 : O.bind(xr),
- useCaseSensitiveFileNames: () => xr.useCaseSensitiveFileNames(),
- getCanonicalFileName: En,
- getFileIncludeReasons: () => he,
- structureIsReused: Ae,
- writeFile: vi
- };
- return He(), yt(), Ko("afterProgram"), rp("Program", "beforeProgram", "afterProgram"), (B = rn) == null || B.pop(), dt;
- function U() {
- return Jr && (we?.forEach((Ne) => {
- switch (Ne.kind) {
- case 1:
- return Ri.add(
- Ds(
- Ne.file && Bt(Ne.file),
- Ne.fileProcessingReason,
- Ne.diagnostic,
- Ne.args || Ue
- )
- );
- case 0:
- return Ri.add(be(Ne));
- case 2:
- return Ne.diagnostics.forEach((qe) => Ri.add(qe));
- default:
- E.assertNever(Ne);
- }
- }), Jr.forEach(
- ({ file: Ne, diagnostic: qe, args: vt }) => Ri.add(
- Ds(
- Ne,
- /*fileProcessingReason*/
- void 0,
- qe,
- vt
- )
- )
- ), Jr = void 0, me = void 0, ve = void 0), Ri;
- }
- function be({ reason: Ne }) {
- const { file: qe, pos: vt, end: qt } = jD(dt, Ne), fr = qe.libReferenceDirectives[Ne.index], qr = C1e(fr), kr = eC(FE(qr, "lib."), ".d.ts"), Dn = _b(kr, mO, go);
- return fl(
- qe,
- E.checkDefined(vt),
- E.checkDefined(qt) - vt,
- Dn ? p.Cannot_find_lib_definition_for_0_Did_you_mean_1 : p.Cannot_find_lib_definition_for_0,
- qr,
- Dn
- );
- }
- function Z(Ne, qe, vt) {
- var qt;
- return (qt = Re?.get(Ne.path)) == null ? void 0 : qt.get(qe, vt);
- }
- function ht(Ne, qe) {
- return qe ?? (qe = Tr(Ne)), E.assertIsDefined(qe, "`moduleSpecifier` must have a `SourceFile` ancestor. Use `program.getResolvedModule` instead to provide the containing file and resolution mode."), Z(qe, Ne.text, Kp(qe, Ne));
- }
- function Le(Ne, qe, vt) {
- var qt;
- return (qt = Wt?.get(Ne.path)) == null ? void 0 : qt.get(qe, vt);
- }
- function Ie(Ne, qe) {
- return Le(qe, Ne.fileName, Ne.resolutionMode || qe.impliedNodeFormat);
- }
- function At(Ne, qe) {
- yr(Re, Ne, qe);
- }
- function Dr(Ne, qe) {
- yr(Wt, Ne, qe);
- }
- function yr(Ne, qe, vt) {
- var qt;
- vt ? (qt = Ne?.get(vt.path)) == null || qt.forEach((fr, qr, kr) => qe(fr, qr, kr, vt.path)) : Ne?.forEach((fr, qr) => fr.forEach((kr, Dn, di) => qe(kr, Dn, di, qr)));
- }
- function $r() {
- return Ir || (Ir = /* @__PURE__ */ new Map(), At(({ resolvedModule: Ne }) => {
- Ne?.packageId && Ir.set(Ne.packageId.name, Ne.extension === ".d.ts" || !!Ir.get(Ne.packageId.name));
- }), Ir);
- }
- function nt(Ne) {
- return $r().has(jO(Ne));
- }
- function ot(Ne) {
- return !!$r().get(Ne);
- }
- function wt(Ne) {
- var qe;
- (qe = Ne.resolutionDiagnostics) != null && qe.length && (we ?? (we = [])).push({
- kind: 2,
- diagnostics: Ne.resolutionDiagnostics
- });
- }
- function jt(Ne, qe, vt, qt) {
- if (xr.resolveModuleNameLiterals || !xr.resolveModuleNames) return wt(vt);
- if (!qn || Sl(qe)) return;
- const fr = es(Ne.originalFileName, ji), qr = Xn(fr), kr = en(Ne), Dn = qn.getFromNonRelativeNameCache(qe, qt, qr, kr);
- Dn && wt(Dn);
- }
- function Xt(Ne, qe, vt) {
- var qt, fr;
- const qr = es(qe.originalFileName, ji), kr = en(qe);
- (qt = rn) == null || qt.push(rn.Phase.Program, "resolveModuleNamesWorker", { containingFileName: qr }), Ko("beforeResolveModule");
- const Dn = Oi(
- Ne,
- qr,
- kr,
- q,
- qe,
- vt
- );
- return Ko("afterResolveModule"), rp("ResolveModule", "beforeResolveModule", "afterResolveModule"), (fr = rn) == null || fr.pop(), Dn;
- }
- function Ht(Ne, qe, vt) {
- var qt, fr;
- const qr = _s(qe) ? void 0 : qe, kr = _s(qe) ? qe : es(qe.originalFileName, ji), Dn = qr && en(qr);
- (qt = rn) == null || qt.push(rn.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: kr }), Ko("beforeResolveTypeReference");
- const di = Hs(
- Ne,
- kr,
- Dn,
- q,
- qr,
- vt
- );
- return Ko("afterResolveTypeReference"), rp("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"), (fr = rn) == null || fr.pop(), di;
- }
- function en(Ne) {
- const qe = Qp(Ne.originalFileName);
- if (qe || !wl(Ne.originalFileName)) return qe;
- const vt = zt(Ne.path);
- if (vt) return vt;
- if (!xr.realpath || !q.preserveSymlinks || !Ne.originalFileName.includes(Xg)) return;
- const qt = hr(xr.realpath(Ne.originalFileName));
- return qt === Ne.path ? void 0 : zt(qt);
- }
- function zt(Ne) {
- const qe = vl(Ne);
- if (_s(qe)) return Qp(qe);
- if (qe)
- return y_((vt) => {
- const qt = vt.commandLine.options.outFile;
- if (qt)
- return hr(qt) === Ne ? vt : void 0;
- });
- }
- function mr(Ne, qe) {
- return ho(Kt(Ne), Kt(qe));
- }
- function Kt(Ne) {
- if (np(
- ei,
- Ne.fileName,
- /*ignoreCase*/
- !1
- )) {
- const qe = Hc(Ne.fileName);
- if (qe === "lib.d.ts" || qe === "lib.es6.d.ts") return 0;
- const vt = eC(FE(qe, "lib."), ".d.ts"), qt = mO.indexOf(vt);
- if (qt !== -1) return qt + 1;
- }
- return mO.length + 2;
- }
- function hr(Ne) {
- return uo(Ne, ji, En);
- }
- function Ft() {
- if (J === void 0) {
- const Ne = Ln(ie, (qe) => cS(qe, dt));
- J = LD(
- q,
- () => Ai(Ne, (qe) => qe.isDeclarationFile ? void 0 : qe.fileName),
- ji,
- En,
- (qe) => L(Ne, qe)
- );
- }
- return J;
- }
- function Ss() {
- var Ne;
- if (!_e) {
- Yi(), _e = /* @__PURE__ */ new Set();
- for (const qe of ie)
- (Ne = qe.classifiableNames) == null || Ne.forEach((vt) => _e.add(vt));
- }
- return _e;
- }
- function gs(Ne, qe) {
- return Ua({
- entries: Ne,
- containingFile: qe,
- containingSourceFile: qe,
- redirectedReference: en(qe),
- nameAndModeGetter: cF,
- resolutionWorker: Xt,
- getResolutionFromOldProgram: (vt, qt) => G?.getResolvedModule(qe, vt, qt),
- getResolved: HT,
- canReuseResolutionsInFile: () => qe === G?.getSourceFile(qe.fileName) && !Ws(qe.path),
- resolveToOwnAmbientModule: !0
- });
- }
- function Ts(Ne, qe) {
- const vt = _s(qe) ? void 0 : qe;
- return Ua({
- entries: Ne,
- containingFile: qe,
- containingSourceFile: vt,
- redirectedReference: vt && en(vt),
- nameAndModeGetter: k1e,
- resolutionWorker: Ht,
- getResolutionFromOldProgram: (qt, fr) => {
- var qr;
- return vt ? G?.getResolvedTypeReferenceDirective(vt, qt, fr) : (qr = G?.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : qr.get(qt, fr);
- },
- getResolved: r7,
- canReuseResolutionsInFile: () => vt ? vt === G?.getSourceFile(vt.fileName) && !Ws(vt.path) : !Ws(hr(qe))
- });
- }
- function Ua({
- entries: Ne,
- containingFile: qe,
- containingSourceFile: vt,
- redirectedReference: qt,
- nameAndModeGetter: fr,
- resolutionWorker: qr,
- getResolutionFromOldProgram: kr,
- getResolved: Dn,
- canReuseResolutionsInFile: di,
- resolveToOwnAmbientModule: _n
- }) {
- if (!Ne.length) return Ue;
- if (Ae === 0 && (!_n || !vt.ambientModuleNames.length))
- return qr(
- Ne,
- qe,
- /*reusedNames*/
- void 0
- );
- let yi, fn, ks, po;
- const Bu = di();
- for (let Ju = 0; Ju < Ne.length; Ju++) {
- const td = Ne[Ju];
- if (Bu) {
- const zu = fr.getName(td), o2 = fr.getMode(td, vt, qt?.commandLine.options ?? q), i1 = kr(zu, o2), nh = i1 && Dn(i1);
- if (nh) {
- Xy(q, xr) && Zi(
- xr,
- qr === Xt ? nh.packageId ? p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : nh.packageId ? p.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2,
- zu,
- vt ? es(vt.originalFileName, ji) : qe,
- nh.resolvedFileName,
- nh.packageId && Q1(nh.packageId)
- ), (ks ?? (ks = new Array(Ne.length)))[Ju] = i1, (po ?? (po = [])).push(td);
- continue;
- }
- }
- if (_n) {
- const zu = fr.getName(td);
- if (ss(vt.ambientModuleNames, zu)) {
- Xy(q, xr) && Zi(
- xr,
- p.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1,
- zu,
- es(vt.originalFileName, ji)
- ), (ks ?? (ks = new Array(Ne.length)))[Ju] = x1e;
- continue;
- }
- }
- (yi ?? (yi = [])).push(td), (fn ?? (fn = [])).push(Ju);
- }
- if (!yi) return ks;
- const ed = qr(yi, qe, po);
- return ks ? (ed.forEach((Ju, td) => ks[fn[td]] = Ju), ks) : ed;
- }
- function lc() {
- return !uF(
- G.getProjectReferences(),
- G.getResolvedProjectReferences(),
- (Ne, qe, vt) => {
- const qt = (qe ? qe.commandLine.projectReferences : ae)[vt], fr = Ce(qt);
- return Ne ? !fr || fr.sourceFile !== Ne.sourceFile || !Af(Ne.commandLine.fileNames, fr.commandLine.fileNames) : fr !== void 0;
- },
- (Ne, qe) => {
- const vt = qe ? r_(qe.sourceFile.path).commandLine.projectReferences : ae;
- return !Af(Ne, vt, Oj);
- }
- );
- }
- function Ic() {
- var Ne;
- if (!G)
- return 0;
- const qe = G.getCompilerOptions();
- if (e7(qe, q))
- return 0;
- const vt = G.getRootFileNames();
- if (!Af(vt, X) || !lc())
- return 0;
- ae && (Ke = ae.map(Ce));
- const qt = [], fr = [];
- if (Ae = 2, El(G.getMissingFilePaths(), (_n) => xr.fileExists(_n)))
- return 0;
- const qr = G.getSourceFiles();
- let kr;
- ((_n) => {
- _n[_n.Exists = 0] = "Exists", _n[_n.Modified = 1] = "Modified";
- })(kr || (kr = {}));
- const Dn = /* @__PURE__ */ new Map();
- for (const _n of qr) {
- const yi = Uc(_n.fileName, qn, xr, q);
- let fn = xr.getSourceFileByPath ? xr.getSourceFileByPath(
- _n.fileName,
- _n.resolvedPath,
- yi,
- /*onError*/
- void 0,
- M
- ) : xr.getSourceFile(
- _n.fileName,
- yi,
- /*onError*/
- void 0,
- M
- );
- if (!fn)
- return 0;
- fn.packageJsonLocations = (Ne = yi.packageJsonLocations) != null && Ne.length ? yi.packageJsonLocations : void 0, fn.packageJsonScope = yi.packageJsonScope, E.assert(!fn.redirectInfo, "Host should not return a redirect source file from `getSourceFile`");
- let ks;
- if (_n.redirectInfo) {
- if (fn !== _n.redirectInfo.unredirected)
- return 0;
- ks = !1, fn = _n;
- } else if (G.redirectTargetsMap.has(_n.path)) {
- if (fn !== _n)
- return 0;
- ks = !1;
- } else
- ks = fn !== _n;
- fn.path = _n.path, fn.originalFileName = _n.originalFileName, fn.resolvedPath = _n.resolvedPath, fn.fileName = _n.fileName;
- const po = G.sourceFileToPackageName.get(_n.path);
- if (po !== void 0) {
- const Bu = Dn.get(po), ed = ks ? 1 : 0;
- if (Bu !== void 0 && ed === 1 || Bu === 1)
- return 0;
- Dn.set(po, ed);
- }
- ks ? (_n.impliedNodeFormat !== fn.impliedNodeFormat ? Ae = 1 : Af(_n.libReferenceDirectives, fn.libReferenceDirectives, al) ? _n.hasNoDefaultLib !== fn.hasNoDefaultLib ? Ae = 1 : Af(_n.referencedFiles, fn.referencedFiles, al) ? (Et(fn), Af(_n.imports, fn.imports, hp) && Af(_n.moduleAugmentations, fn.moduleAugmentations, hp) ? (_n.flags & 12582912) !== (fn.flags & 12582912) ? Ae = 1 : Af(_n.typeReferenceDirectives, fn.typeReferenceDirectives, al) || (Ae = 1) : Ae = 1) : Ae = 1 : Ae = 1, fr.push(fn)) : Ws(_n.path) && (Ae = 1, fr.push(fn)), qt.push(fn);
- }
- if (Ae !== 2)
- return Ae;
- for (const _n of fr) {
- const yi = w1e(_n), fn = gs(yi, _n);
- (ft ?? (ft = /* @__PURE__ */ new Map())).set(_n.path, fn), Lj(
- yi,
- fn,
- (Ju) => G.getResolvedModule(_n, Ju.text, Kp(_n, Ju)),
- eZ
- ) && (Ae = 1);
- const po = _n.typeReferenceDirectives, Bu = Ts(po, _n);
- (_r ?? (_r = /* @__PURE__ */ new Map())).set(_n.path, Bu), Lj(
- po,
- Bu,
- (Ju) => G.getResolvedTypeReferenceDirective(_n, Une(Ju), oF(Ju, _n.impliedNodeFormat)),
- tZ
- ) && (Ae = 1);
- }
- if (Ae !== 2)
- return Ae;
- if (ZY(qe, q) || G.resolvedLibReferences && El(G.resolvedLibReferences, (_n, yi) => Sr(yi).actual !== _n.actual))
- return 1;
- if (xr.hasChangedAutomaticTypeDirectiveNames) {
- if (xr.hasChangedAutomaticTypeDirectiveNames()) return 1;
- } else if (fe = NO(q, xr), !Af(G.getAutomaticTypeDirectiveNames(), fe)) return 1;
- De = G.getMissingFilePaths(), E.assert(qt.length === G.getSourceFiles().length);
- for (const _n of qt)
- K.set(_n.path, _n);
- return G.getFilesByNameMap().forEach((_n, yi) => {
- if (!_n) {
- K.set(yi, _n);
- return;
- }
- if (_n.path === yi) {
- G.isSourceFileFromExternalLibrary(_n) && Br.set(_n.path, !0);
- return;
- }
- K.set(yi, K.get(_n.path));
- }), ie = qt, he = G.getFileIncludeReasons(), we = G.getFileProcessingDiagnostics(), fe = G.getAutomaticTypeDirectiveNames(), Me = G.getAutomaticTypeDirectiveResolutions(), Tt = G.sourceFileToPackageName, te = G.redirectTargetsMap, ze = G.usesUriStyleNodeCoreModules, Re = G.resolvedModules, Wt = G.resolvedTypeReferenceDirectiveNames, Qe = G.resolvedLibReferences, Ir = G.getCurrentPackagesMap(), 2;
- }
- function io(Ne) {
- return {
- getCanonicalFileName: En,
- getCommonSourceDirectory: dt.getCommonSourceDirectory,
- getCompilerOptions: dt.getCompilerOptions,
- getCurrentDirectory: () => ji,
- getSourceFile: dt.getSourceFile,
- getSourceFileByPath: dt.getSourceFileByPath,
- getSourceFiles: dt.getSourceFiles,
- isSourceFileFromExternalLibrary: Cu,
- getResolvedProjectReferenceToRedirect: Qp,
- getProjectReferenceRedirect: Uf,
- isSourceOfProjectReferenceRedirect: Uh,
- getSymlinkCache: qf,
- writeFile: Ne || vi,
- isEmitBlocked: Ia,
- shouldTransformImportCall: n1,
- getEmitModuleFormatOfFile: Ov,
- getDefaultResolutionModeForFile: mg,
- getModeForResolutionAtIndex: Iv,
- readFile: (qe) => xr.readFile(qe),
- fileExists: (qe) => {
- const vt = hr(qe);
- return Bt(vt) ? !0 : De.has(vt) ? !1 : xr.fileExists(qe);
- },
- realpath: Ms(xr, xr.realpath),
- useCaseSensitiveFileNames: () => xr.useCaseSensitiveFileNames(),
- getBuildInfo: () => {
- var qe;
- return (qe = dt.getBuildInfo) == null ? void 0 : qe.call(dt);
- },
- getSourceFileFromReference: (qe, vt) => dt.getSourceFileFromReference(qe, vt),
- redirectTargetsMap: te,
- getFileIncludeReasons: dt.getFileIncludeReasons,
- createHash: Ms(xr, xr.createHash),
- getModuleResolutionCache: () => dt.getModuleResolutionCache(),
- trace: Ms(xr, xr.trace)
- };
- }
- function vi(Ne, qe, vt, qt, fr, qr) {
- xr.writeFile(Ne, qe, vt, qt, fr, qr);
- }
- function ca(Ne) {
- var qe, vt;
- (qe = rn) == null || qe.push(
- rn.Phase.Emit,
- "emitBuildInfo",
- {},
- /*separateBeginAndEnd*/
- !0
- ), Ko("beforeEmit");
- const qt = TW(
- Ane,
- io(Ne),
- /*targetSourceFile*/
- void 0,
- /*transformers*/
- Cne,
- /*emitOnly*/
- !1,
- /*onlyBuildInfo*/
- !0
- );
- return Ko("afterEmit"), rp("Emit", "beforeEmit", "afterEmit"), (vt = rn) == null || vt.pop(), qt;
- }
- function Ll() {
- return Ke;
- }
- function xs() {
- return ae;
- }
- function Cu(Ne) {
- return !!Br.get(Ne.path);
- }
- function Zc(Ne) {
- if (!Ne.isDeclarationFile)
- return !1;
- if (Ne.hasNoDefaultLib)
- return !0;
- if (q.noLib)
- return !1;
- const qe = xr.useCaseSensitiveFileNames() ? ub : Sy;
- return q.lib ? ut(q.lib, (vt) => {
- const qt = Qe.get(vt);
- return !!qt && qe(Ne.fileName, qt.actual);
- }) : qe(Ne.fileName, rs());
- }
- function Yi() {
- return oe || (oe = Mre(dt));
- }
- function Na(Ne, qe, vt, qt, fr, qr, kr) {
- var Dn, di;
- (Dn = rn) == null || Dn.push(
- rn.Phase.Emit,
- "emit",
- { path: Ne?.path },
- /*separateBeginAndEnd*/
- !0
- );
- const _n = Ct(
- () => Vi(
- dt,
- Ne,
- qe,
- vt,
- qt,
- fr,
- qr,
- kr
- )
- );
- return (di = rn) == null || di.pop(), _n;
- }
- function Ia(Ne) {
- return Ar.has(hr(Ne));
- }
- function Vi(Ne, qe, vt, qt, fr, qr, kr, Dn) {
- if (!kr) {
- const fn = WW(Ne, qe, vt, qt);
- if (fn) return fn;
- }
- const di = Yi(), _n = di.getEmitResolver(
- q.outFile ? void 0 : qe,
- qt,
- SW(fr, kr)
- );
- Ko("beforeEmit");
- const yi = di.runWithCancellationToken(
- qt,
- () => TW(
- _n,
- io(vt),
- qe,
- Ene(q, qr, fr),
- fr,
- /*onlyBuildInfo*/
- !1,
- kr,
- Dn
- )
- );
- return Ko("afterEmit"), rp("Emit", "beforeEmit", "afterEmit"), yi;
- }
- function ba(Ne) {
- return Bt(hr(Ne));
- }
- function Bt(Ne) {
- return K.get(Ne) || void 0;
- }
- function to(Ne, qe, vt) {
- return sC(Ne ? qe(Ne, vt) : ta(dt.getSourceFiles(), (qt) => (vt && vt.throwIfCancellationRequested(), qe(qt, vt))));
- }
- function _u(Ne, qe) {
- return to(Ne, rt, qe);
- }
- function Wc(Ne, qe, vt) {
- return to(
- Ne,
- (qt, fr) => $t(qt, fr, vt),
- qe
- );
- }
- function of(Ne) {
- return tt?.get(Ne.path);
- }
- function Ao(Ne, qe) {
- return zr(
- Ne,
- qe,
- /*nodesToCheck*/
- void 0
- );
- }
- function ge(Ne) {
- var qe;
- if (JC(Ne, q, dt))
- return Ue;
- const vt = U().getDiagnostics(Ne.fileName);
- return (qe = Ne.commentDirectives) != null && qe.length ? An(Ne, Ne.commentDirectives, vt).diagnostics : vt;
- }
- function $(Ne, qe) {
- return to(Ne, Oc, qe);
- }
- function rt(Ne) {
- return Gu(Ne) ? (Ne.additionalSyntacticDiagnostics || (Ne.additionalSyntacticDiagnostics = za(Ne)), Qi(Ne.additionalSyntacticDiagnostics, Ne.parseDiagnostics)) : Ne.parseDiagnostics;
- }
- function Ct(Ne) {
- try {
- return Ne();
- } catch (qe) {
- throw qe instanceof JE && (oe = void 0), qe;
- }
- }
- function $t(Ne, qe, vt) {
- return Qi(
- dF(zr(Ne, qe, vt), q),
- ge(Ne)
- );
- }
- function zr(Ne, qe, vt) {
- if (vt)
- return $n(Ne, qe, vt);
- let qt = tt?.get(Ne.path);
- return qt || (tt ?? (tt = /* @__PURE__ */ new Map())).set(
- Ne.path,
- qt = $n(Ne, qe)
- ), qt;
- }
- function $n(Ne, qe, vt) {
- return Ct(() => {
- if (JC(Ne, q, dt))
- return Ue;
- const qt = Yi();
- E.assert(!!Ne.bindDiagnostics);
- const fr = Ne.scriptKind === 1 || Ne.scriptKind === 2, qr = u4(Ne, q.checkJs), kr = fr && W4(Ne, q);
- let Dn = Ne.bindDiagnostics, di = qt.getDiagnostics(Ne, qe, vt);
- return qr && (Dn = Ln(Dn, (_n) => D1e.has(_n.code)), di = Ln(di, (_n) => D1e.has(_n.code))), ar(
- Ne,
- !qr,
- !!vt,
- Dn,
- di,
- kr ? Ne.jsDocDiagnostics : void 0
- );
- });
- }
- function ar(Ne, qe, vt, ...qt) {
- var fr;
- const qr = Np(qt);
- if (!qe || !((fr = Ne.commentDirectives) != null && fr.length))
- return qr;
- const { diagnostics: kr, directives: Dn } = An(Ne, Ne.commentDirectives, qr);
- if (vt)
- return kr;
- for (const di of Dn.getUnusedExpectations())
- kr.push(yZ(Ne, di.range, p.Unused_ts_expect_error_directive));
- return kr;
- }
- function An(Ne, qe, vt) {
- const qt = iZ(Ne, qe);
- return { diagnostics: vt.filter((qr) => Fi(qr, qt) === -1), directives: qt };
- }
- function ri(Ne, qe) {
- return Ct(() => Yi().getSuggestionDiagnostics(Ne, qe));
- }
- function Fi(Ne, qe) {
- const { file: vt, start: qt } = Ne;
- if (!vt)
- return -1;
- const fr = Ag(vt);
- let qr = nC(fr, qt).line - 1;
- for (; qr >= 0; ) {
- if (qe.markUsed(qr))
- return qr;
- const kr = vt.text.slice(fr[qr], fr[qr + 1]).trim();
- if (kr !== "" && !/^\s*\/\/.*$/.test(kr))
- return -1;
- qr--;
- }
- return -1;
- }
- function za(Ne) {
- return Ct(() => {
- const qe = [];
- return vt(Ne, Ne), jx(Ne, vt, qt), qe;
- function vt(Dn, di) {
- switch (di.kind) {
- case 169:
- case 172:
- case 174:
- if (di.questionToken === Dn)
- return qe.push(kr(Dn, p.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")), "skip";
- case 173:
- case 176:
- case 177:
- case 178:
- case 218:
- case 262:
- case 219:
- case 260:
- if (di.type === Dn)
- return qe.push(kr(Dn, p.Type_annotations_can_only_be_used_in_TypeScript_files)), "skip";
- }
- switch (Dn.kind) {
- case 273:
- if (Dn.isTypeOnly)
- return qe.push(kr(di, p._0_declarations_can_only_be_used_in_TypeScript_files, "import type")), "skip";
- break;
- case 278:
- if (Dn.isTypeOnly)
- return qe.push(kr(Dn, p._0_declarations_can_only_be_used_in_TypeScript_files, "export type")), "skip";
- break;
- case 276:
- case 281:
- if (Dn.isTypeOnly)
- return qe.push(kr(Dn, p._0_declarations_can_only_be_used_in_TypeScript_files, Zu(Dn) ? "import...type" : "export...type")), "skip";
- break;
- case 271:
- return qe.push(kr(Dn, p.import_can_only_be_used_in_TypeScript_files)), "skip";
- case 277:
- if (Dn.isExportEquals)
- return qe.push(kr(Dn, p.export_can_only_be_used_in_TypeScript_files)), "skip";
- break;
- case 298:
- if (Dn.token === 119)
- return qe.push(kr(Dn, p.implements_clauses_can_only_be_used_in_TypeScript_files)), "skip";
- break;
- case 264:
- const yi = qs(
- 120
- /* InterfaceKeyword */
- );
- return E.assertIsDefined(yi), qe.push(kr(Dn, p._0_declarations_can_only_be_used_in_TypeScript_files, yi)), "skip";
- case 267:
- const fn = Dn.flags & 32 ? qs(
- 145
- /* NamespaceKeyword */
- ) : qs(
- 144
- /* ModuleKeyword */
- );
- return E.assertIsDefined(fn), qe.push(kr(Dn, p._0_declarations_can_only_be_used_in_TypeScript_files, fn)), "skip";
- case 265:
- return qe.push(kr(Dn, p.Type_aliases_can_only_be_used_in_TypeScript_files)), "skip";
- case 176:
- case 174:
- case 262:
- return Dn.body ? void 0 : (qe.push(kr(Dn, p.Signature_declarations_can_only_be_used_in_TypeScript_files)), "skip");
- case 266:
- const ks = E.checkDefined(qs(
- 94
- /* EnumKeyword */
- ));
- return qe.push(kr(Dn, p._0_declarations_can_only_be_used_in_TypeScript_files, ks)), "skip";
- case 235:
- return qe.push(kr(Dn, p.Non_null_assertions_can_only_be_used_in_TypeScript_files)), "skip";
- case 234:
- return qe.push(kr(Dn.type, p.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)), "skip";
- case 238:
- return qe.push(kr(Dn.type, p.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)), "skip";
- case 216:
- E.fail();
- }
- }
- function qt(Dn, di) {
- if (nz(di)) {
- const _n = On(di.modifiers, dl);
- _n && qe.push(kr(_n, p.Decorators_are_not_valid_here));
- } else if (Vb(di) && di.modifiers) {
- const _n = ac(di.modifiers, dl);
- if (_n >= 0) {
- if (Ii(di) && !q.experimentalDecorators)
- qe.push(kr(di.modifiers[_n], p.Decorators_are_not_valid_here));
- else if (Xc(di)) {
- const yi = ac(di.modifiers, Cx);
- if (yi >= 0) {
- const fn = ac(di.modifiers, H5);
- if (_n > yi && fn >= 0 && _n < fn)
- qe.push(kr(di.modifiers[_n], p.Decorators_are_not_valid_here));
- else if (yi >= 0 && _n < yi) {
- const ks = ac(di.modifiers, dl, yi);
- ks >= 0 && qe.push(Rs(
- kr(di.modifiers[ks], p.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
- kr(di.modifiers[_n], p.Decorator_used_before_export_here)
- ));
- }
- }
- }
- }
- }
- switch (di.kind) {
- case 263:
- case 231:
- case 174:
- case 176:
- case 177:
- case 178:
- case 218:
- case 262:
- case 219:
- if (Dn === di.typeParameters)
- return qe.push(qr(Dn, p.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)), "skip";
- case 243:
- if (Dn === di.modifiers)
- return fr(
- di.modifiers,
- di.kind === 243
- /* VariableStatement */
- ), "skip";
- break;
- case 172:
- if (Dn === di.modifiers) {
- for (const _n of Dn)
- ra(_n) && _n.kind !== 126 && _n.kind !== 129 && qe.push(kr(_n, p.The_0_modifier_can_only_be_used_in_TypeScript_files, qs(_n.kind)));
- return "skip";
- }
- break;
- case 169:
- if (Dn === di.modifiers && ut(Dn, ra))
- return qe.push(qr(Dn, p.Parameter_modifiers_can_only_be_used_in_TypeScript_files)), "skip";
- break;
- case 213:
- case 214:
- case 233:
- case 285:
- case 286:
- case 215:
- if (Dn === di.typeArguments)
- return qe.push(qr(Dn, p.Type_arguments_can_only_be_used_in_TypeScript_files)), "skip";
- break;
- }
- }
- function fr(Dn, di) {
- for (const _n of Dn)
- switch (_n.kind) {
- case 87:
- if (di)
- continue;
- case 125:
- case 123:
- case 124:
- case 148:
- case 138:
- case 128:
- case 164:
- case 103:
- case 147:
- qe.push(kr(_n, p.The_0_modifier_can_only_be_used_in_TypeScript_files, qs(_n.kind)));
- break;
- case 126:
- case 95:
- case 90:
- case 129:
- }
- }
- function qr(Dn, di, ..._n) {
- const yi = Dn.pos;
- return fl(Ne, yi, Dn.end - yi, di, ..._n);
- }
- function kr(Dn, di, ..._n) {
- return sp(Ne, Dn, di, ..._n);
- }
- });
- }
- function Uo(Ne, qe) {
- let vt = Te?.get(Ne.path);
- return vt || (Te ?? (Te = /* @__PURE__ */ new Map())).set(
- Ne.path,
- vt = vc(Ne, qe)
- ), vt;
- }
- function vc(Ne, qe) {
- return Ct(() => {
- const vt = Yi().getEmitResolver(Ne, qe);
- return xne(io(ja), vt, Ne) || Ue;
- });
- }
- function Oc(Ne, qe) {
- return Ne.isDeclarationFile ? Ue : Uo(Ne, qe);
- }
- function Fc() {
- return sC(Qi(
- U().getGlobalDiagnostics(),
- Lo()
- ));
- }
- function Lo() {
- if (!q.configFile) return Ue;
- let Ne = U().getDiagnostics(q.configFile.fileName);
- return y_((qe) => {
- Ne = Qi(Ne, U().getDiagnostics(qe.sourceFile.fileName));
- }), Ne;
- }
- function _c() {
- return X.length ? sC(Yi().getGlobalDiagnostics().slice()) : Ue;
- }
- function Wf() {
- return V || Ue;
- }
- function Lc(Ne, qe, vt, qt) {
- ka(
- Os(Ne),
- qe,
- vt,
- /*packageId*/
- void 0,
- qt
- );
- }
- function al(Ne, qe) {
- return Ne.fileName === qe.fileName;
- }
- function hp(Ne, qe) {
- return Ne.kind === 80 ? qe.kind === 80 && Ne.escapedText === qe.escapedText : qe.kind === 11 && Ne.text === qe.text;
- }
- function Pe(Ne, qe) {
- const vt = A.createStringLiteral(Ne), qt = A.createImportDeclaration(
- /*modifiers*/
- void 0,
- /*importClause*/
- void 0,
- vt
- );
- return bx(
- qt,
- 2
- /* NeverApplyImportHelper */
- ), Aa(vt, qt), Aa(qt, qe), vt.flags &= -17, qt.flags &= -17, vt;
- }
- function Et(Ne) {
- if (Ne.imports)
- return;
- const qe = Gu(Ne), vt = il(Ne);
- let qt, fr, qr;
- if (qe || !Ne.isDeclarationFile && (Wp(q) || il(Ne))) {
- q.importHelpers && (qt = [Pe(X1, Ne)]);
- const _n = m5(d5(q, Ne), q);
- _n && (qt || (qt = [])).push(Pe(_n, Ne));
- }
- for (const _n of Ne.statements)
- kr(
- _n,
- /*inAmbientModule*/
- !1
- );
- (Ne.flags & 4194304 || qe) && Dn(Ne), Ne.imports = qt || Ue, Ne.moduleAugmentations = fr || Ue, Ne.ambientModuleNames = qr || Ue;
- return;
- function kr(_n, yi) {
- if (zw(_n)) {
- const fn = KT(_n);
- fn && oa(fn) && fn.text && (!yi || !Sl(fn.text)) && (Nh(
- _n,
- /*incremental*/
- !1
- ), qt = wr(qt, fn), !ze && Nt === 0 && !Ne.isDeclarationFile && (ze = Ui(fn.text, "node:")));
- } else if (zc(_n) && Fu(_n) && (yi || Gn(
- _n,
- 128
- /* Ambient */
- ) || Ne.isDeclarationFile)) {
- _n.name.parent = _n;
- const fn = Jp(_n.name);
- if (vt || yi && !Sl(fn))
- (fr || (fr = [])).push(_n.name);
- else if (!yi) {
- Ne.isDeclarationFile && (qr || (qr = [])).push(fn);
- const ks = _n.body;
- if (ks)
- for (const po of ks.statements)
- kr(
- po,
- /*inAmbientModule*/
- !0
- );
- }
- }
- }
- function Dn(_n) {
- const yi = /import|require/g;
- for (; yi.exec(_n.text) !== null; ) {
- const fn = di(_n, yi.lastIndex);
- if (qe && f_(
- fn,
- /*requireStringLiteralLikeArgument*/
- !0
- ))
- Nh(
- fn,
- /*incremental*/
- !1
- ), qt = wr(qt, fn.arguments[0]);
- else if (hf(fn) && fn.arguments.length >= 1 && Xa(fn.arguments[0]))
- Nh(
- fn,
- /*incremental*/
- !1
- ), qt = wr(qt, fn.arguments[0]);
- else if (h0(fn))
- Nh(
- fn,
- /*incremental*/
- !1
- ), qt = wr(qt, fn.argument.literal);
- else if (qe && Cm(fn)) {
- const ks = KT(fn);
- ks && oa(ks) && ks.text && (Nh(
- fn,
- /*incremental*/
- !1
- ), qt = wr(qt, ks));
- }
- }
- }
- function di(_n, yi) {
- let fn = _n;
- const ks = (po) => {
- if (po.pos <= yi && (yi < po.end || yi === po.end && po.kind === 1))
- return po;
- };
- for (; ; ) {
- const po = qe && gf(fn) && ir(fn.jsDoc, ks) || bs(fn, ks);
- if (!po)
- return fn;
- fn = po;
- }
- }
- }
- function Lr(Ne) {
- var qe;
- const vt = E1e(Ne), qt = vt && ((qe = Qe?.get(vt)) == null ? void 0 : qe.actual);
- return qt !== void 0 ? ba(qt) : void 0;
- }
- function $i(Ne, qe) {
- return Sa(wW(qe.fileName, Ne.fileName), ba);
- }
- function Sa(Ne, qe, vt, qt) {
- if (tC(Ne)) {
- const fr = xr.getCanonicalFileName(Ne);
- if (!q.allowNonTsExtensions && !ir(Np(Ot), (kr) => qo(fr, kr))) {
- vt && (Ug(fr) ? vt(p.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, Ne) : vt(p.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, Ne, "'" + Np(Fe).join("', '") + "'"));
- return;
- }
- const qr = qe(Ne);
- if (vt)
- if (qr)
- Sv(qt) && fr === xr.getCanonicalFileName(Bt(qt.file).fileName) && vt(p.A_file_cannot_have_a_reference_to_itself);
- else {
- const kr = Uf(Ne);
- kr ? vt(p.Output_file_0_has_not_been_built_from_source_file_1, kr, Ne) : vt(p.File_0_not_found, Ne);
- }
- return qr;
- } else {
- const fr = q.allowNonTsExtensions && qe(Ne);
- if (fr) return fr;
- if (vt && q.allowNonTsExtensions) {
- vt(p.File_0_not_found, Ne);
- return;
- }
- const qr = ir(Fe[0], (kr) => qe(Ne + kr));
- return vt && !qr && vt(p.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, Ne, "'" + Np(Fe).join("', '") + "'"), qr;
- }
- }
- function ka(Ne, qe, vt, qt, fr) {
- Sa(
- Ne,
- (qr) => Va(qr, qe, vt, fr, qt),
- // TODO: GH#18217
- (qr, ...kr) => Pa(
- /*file*/
- void 0,
- fr,
- qr,
- kr
- ),
- fr
- );
- }
- function Pc(Ne, qe) {
- return ka(
- Ne,
- /*isDefaultLib*/
- !1,
- /*ignoreNoDefaultLib*/
- !1,
- /*packageId*/
- void 0,
- qe
- );
- }
- function yl(Ne, qe, vt) {
- !Sv(vt) && ut(he.get(qe.path), Sv) ? Pa(qe, vt, p.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [qe.fileName, Ne]) : Pa(qe, vt, p.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [Ne, qe.fileName]);
- }
- function so(Ne, qe, vt, qt, fr, qr, kr) {
- var Dn;
- const di = gv.createRedirectedSourceFile({ redirectTarget: Ne, unredirected: qe });
- return di.fileName = vt, di.path = qt, di.resolvedPath = fr, di.originalFileName = qr, di.packageJsonLocations = (Dn = kr.packageJsonLocations) != null && Dn.length ? kr.packageJsonLocations : void 0, di.packageJsonScope = kr.packageJsonScope, Br.set(qt, Nt > 0), di;
- }
- function Va(Ne, qe, vt, qt, fr) {
- var qr, kr;
- (qr = rn) == null || qr.push(rn.Phase.Program, "findSourceFile", {
- fileName: Ne,
- isDefaultLib: qe || void 0,
- fileIncludeKind: FR[qt.kind]
- });
- const Dn = cf(Ne, qe, vt, qt, fr);
- return (kr = rn) == null || kr.pop(), Dn;
- }
- function Uc(Ne, qe, vt, qt) {
- const fr = fF(es(Ne, ji), qe?.getPackageJsonInfoCache(), vt, qt), qr = pa(qt), kr = L3(qt);
- return typeof fr == "object" ? { ...fr, languageVersion: qr, setExternalModuleIndicator: kr, jsDocParsingMode: vt.jsDocParsingMode } : { languageVersion: qr, impliedNodeFormat: fr, setExternalModuleIndicator: kr, jsDocParsingMode: vt.jsDocParsingMode };
- }
- function cf(Ne, qe, vt, qt, fr) {
- var qr;
- const kr = hr(Ne);
- if (bt) {
- let fn = vl(kr);
- if (!fn && xr.realpath && q.preserveSymlinks && wl(Ne) && Ne.includes(Xg)) {
- const ks = hr(xr.realpath(Ne));
- ks !== kr && (fn = vl(ks));
- }
- if (fn) {
- const ks = _s(fn) ? Va(fn, qe, vt, qt, fr) : void 0;
- return ks && A_(
- ks,
- kr,
- Ne,
- /*redirectedPath*/
- void 0
- ), ks;
- }
- }
- const Dn = Ne;
- if (K.has(kr)) {
- const fn = K.get(kr), ks = Xp(
- fn || void 0,
- qt,
- /*checkExisting*/
- !0
- );
- if (fn && ks && q.forceConsistentCasingInFileNames !== !1) {
- const po = fn.fileName;
- hr(po) !== hr(Ne) && (Ne = Uf(Ne) || Ne);
- const ed = ZR(po, ji), Ju = ZR(Ne, ji);
- ed !== Ju && yl(Ne, fn, qt);
- }
- return fn && Br.get(fn.path) && Nt === 0 ? (Br.set(fn.path, !1), q.noResolve || (Zg(fn, qe), Vf(fn)), q.noLib || Vr(fn), Qt.set(fn.path, !1), si(fn)) : fn && Qt.get(fn.path) && Nt < jr && (Qt.set(fn.path, !1), si(fn)), fn || void 0;
- }
- let di;
- if (!bt) {
- const fn = yp(Ne);
- if (fn) {
- if (fn.commandLine.options.outFile)
- return;
- const ks = Yg(fn, Ne);
- Ne = ks, di = hr(ks);
- }
- }
- const _n = Uc(Ne, qn, xr, q), yi = xr.getSourceFile(
- Ne,
- _n,
- (fn) => Pa(
- /*file*/
- void 0,
- qt,
- p.Cannot_read_file_0_Colon_1,
- [Ne, fn]
- ),
- M
- );
- if (fr) {
- const fn = Q1(fr), ks = Xe.get(fn);
- if (ks) {
- const po = so(ks, yi, Ne, kr, hr(Ne), Dn, _n);
- return te.add(ks.path, Ne), A_(po, kr, Ne, di), Xp(
- po,
- qt,
- /*checkExisting*/
- !1
- ), Tt.set(kr, i7(fr)), ne.push(po), po;
- } else yi && (Xe.set(fn, yi), Tt.set(kr, i7(fr)));
- }
- if (A_(yi, kr, Ne, di), yi) {
- if (Br.set(kr, Nt > 0), yi.fileName = Ne, yi.path = kr, yi.resolvedPath = hr(Ne), yi.originalFileName = Dn, yi.packageJsonLocations = (qr = _n.packageJsonLocations) != null && qr.length ? _n.packageJsonLocations : void 0, yi.packageJsonScope = _n.packageJsonScope, Xp(
- yi,
- qt,
- /*checkExisting*/
- !1
- ), xr.useCaseSensitiveFileNames()) {
- const fn = vy(kr), ks = Ve.get(fn);
- ks ? yl(Ne, ks, qt) : Ve.set(fn, yi);
- }
- ki = ki || yi.hasNoDefaultLib && !vt, q.noResolve || (Zg(yi, qe), Vf(yi)), q.noLib || Vr(yi), si(yi), qe ? re.push(yi) : ne.push(yi), (le ?? (le = /* @__PURE__ */ new Set())).add(yi.path);
- }
- return yi;
- }
- function Xp(Ne, qe, vt) {
- return Ne && (!vt || !Sv(qe) || !le?.has(qe.file)) ? (he.add(Ne.path, qe), !0) : !1;
- }
- function A_(Ne, qe, vt, qt) {
- qt ? (Sf(vt, qt, Ne), Sf(vt, qe, Ne || !1)) : Sf(vt, qe, Ne);
- }
- function Sf(Ne, qe, vt) {
- K.set(qe, vt), vt !== void 0 ? De.delete(qe) : De.set(qe, Ne);
- }
- function Uf(Ne) {
- const qe = yp(Ne);
- return qe && Yg(qe, Ne);
- }
- function yp(Ne) {
- if (!(!Ke || !Ke.length || wl(Ne) || qo(
- Ne,
- ".json"
- /* Json */
- )))
- return Qp(Ne);
- }
- function Yg(Ne, qe) {
- const vt = Ne.commandLine.options.outFile;
- return vt ? zy(
- vt,
- ".d.ts"
- /* Dts */
- ) : p6(qe, Ne.commandLine, !xr.useCaseSensitiveFileNames());
- }
- function Qp(Ne) {
- at === void 0 && (at = /* @__PURE__ */ new Map(), y_((vt) => {
- hr(q.configFilePath) !== vt.sourceFile.path && vt.commandLine.fileNames.forEach((qt) => at.set(hr(qt), vt.sourceFile.path));
- }));
- const qe = at.get(hr(Ne));
- return qe && r_(qe);
- }
- function y_(Ne) {
- return jW(Ke, Ne);
- }
- function vl(Ne) {
- if (wl(Ne))
- return $e === void 0 && ($e = /* @__PURE__ */ new Map(), y_((qe) => {
- const vt = qe.commandLine.options.outFile;
- if (vt) {
- const qt = zy(
- vt,
- ".d.ts"
- /* Dts */
- );
- $e.set(hr(qt), !0);
- } else {
- const qt = Iu(() => Gx(qe.commandLine, !xr.useCaseSensitiveFileNames()));
- ir(qe.commandLine.fileNames, (fr) => {
- if (!wl(fr) && !qo(
- fr,
- ".json"
- /* Json */
- )) {
- const qr = p6(fr, qe.commandLine, !xr.useCaseSensitiveFileNames(), qt);
- $e.set(hr(qr), fr);
- }
- });
- }
- })), $e.get(Ne);
- }
- function Uh(Ne) {
- return bt && !!Qp(Ne);
- }
- function r_(Ne) {
- if (xe)
- return xe.get(Ne) || void 0;
- }
- function Zg(Ne, qe) {
- ir(Ne.referencedFiles, (vt, qt) => {
- ka(
- wW(vt.fileName, Ne.fileName),
- qe,
- /*ignoreNoDefaultLib*/
- !1,
- /*packageId*/
- void 0,
- { kind: 4, file: Ne.path, index: qt }
- );
- });
- }
- function Vf(Ne) {
- const qe = Ne.typeReferenceDirectives;
- if (!qe.length) return;
- const vt = _r?.get(Ne.path) || Ts(qe, Ne), qt = a6();
- (Wt ?? (Wt = /* @__PURE__ */ new Map())).set(Ne.path, qt);
- for (let fr = 0; fr < qe.length; fr++) {
- const qr = Ne.typeReferenceDirectives[fr], kr = vt[fr], Dn = qr.fileName;
- qt.set(Dn, oF(qr, Ne.impliedNodeFormat), kr);
- const di = qr.resolutionMode || mg(Ne);
- st(Dn, di, kr, { kind: 5, file: Ne.path, index: fr });
- }
- }
- function Y(Ne) {
- var qe;
- return ((qe = en(Ne)) == null ? void 0 : qe.commandLine.options) || q;
- }
- function st(Ne, qe, vt, qt) {
- var fr, qr;
- (fr = rn) == null || fr.push(rn.Phase.Program, "processTypeReferenceDirective", { directive: Ne, hasResolved: !!vt.resolvedTypeReferenceDirective, refKind: qt.kind, refPath: Sv(qt) ? qt.file : void 0 }), It(Ne, qe, vt, qt), (qr = rn) == null || qr.pop();
- }
- function It(Ne, qe, vt, qt) {
- wt(vt);
- const { resolvedTypeReferenceDirective: fr } = vt;
- fr ? (fr.isExternalLibraryImport && Nt++, ka(
- fr.resolvedFileName,
- /*isDefaultLib*/
- !1,
- /*ignoreNoDefaultLib*/
- !1,
- fr.packageId,
- qt
- ), fr.isExternalLibraryImport && Nt--) : Pa(
- /*file*/
- void 0,
- qt,
- p.Cannot_find_type_definition_file_for_0,
- [Ne]
- );
- }
- function Mt(Ne) {
- const qe = Qe?.get(Ne);
- if (qe) return qe.actual;
- const vt = Sr(Ne);
- return (Qe ?? (Qe = /* @__PURE__ */ new Map())).set(Ne, vt), vt.actual;
- }
- function Sr(Ne) {
- var qe, vt, qt, fr, qr;
- const kr = et?.get(Ne);
- if (kr) return kr;
- if (Ae !== 0 && G && !rr(Ne)) {
- const fn = (qe = G.resolvedLibReferences) == null ? void 0 : qe.get(Ne);
- if (fn) {
- if (fn.resolution && Xy(q, xr)) {
- const ks = BW(Ne), po = _F(q, ji, Ne);
- Zi(
- xr,
- fn.resolution.resolvedModule ? fn.resolution.resolvedModule.packageId ? p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,
- ks,
- es(po, ji),
- (vt = fn.resolution.resolvedModule) == null ? void 0 : vt.resolvedFileName,
- ((qt = fn.resolution.resolvedModule) == null ? void 0 : qt.packageId) && Q1(fn.resolution.resolvedModule.packageId)
- );
- }
- return (et ?? (et = /* @__PURE__ */ new Map())).set(Ne, fn), fn;
- }
- }
- const Dn = BW(Ne), di = _F(q, ji, Ne);
- (fr = rn) == null || fr.push(rn.Phase.Program, "resolveLibrary", { resolveFrom: di }), Ko("beforeResolveLibrary");
- const _n = Ea(Dn, di, q, Ne);
- Ko("afterResolveLibrary"), rp("ResolveLibrary", "beforeResolveLibrary", "afterResolveLibrary"), (qr = rn) == null || qr.pop();
- const yi = {
- resolution: _n,
- actual: _n.resolvedModule ? _n.resolvedModule.resolvedFileName : Bn(ei, Ne)
- };
- return (et ?? (et = /* @__PURE__ */ new Map())).set(Ne, yi), yi;
- }
- function Vr(Ne) {
- ir(Ne.libReferenceDirectives, (qe, vt) => {
- const qt = E1e(qe);
- qt ? Lc(
- Mt(qt),
- /*isDefaultLib*/
- !0,
- /*ignoreNoDefaultLib*/
- !0,
- { kind: 7, file: Ne.path, index: vt }
- ) : (we || (we = [])).push({
- kind: 0,
- reason: { kind: 7, file: Ne.path, index: vt }
- });
- });
- }
- function En(Ne) {
- return xr.getCanonicalFileName(Ne);
- }
- function si(Ne) {
- if (Et(Ne), Ne.imports.length || Ne.moduleAugmentations.length) {
- const qe = w1e(Ne), vt = ft?.get(Ne.path) || gs(qe, Ne);
- E.assert(vt.length === qe.length);
- const qt = Y(Ne), fr = a6();
- (Re ?? (Re = /* @__PURE__ */ new Map())).set(Ne.path, fr);
- for (let qr = 0; qr < qe.length; qr++) {
- const kr = vt[qr].resolvedModule, Dn = qe[qr].text, di = MW(Ne, qe[qr], qt);
- if (fr.set(Dn, di, vt[qr]), jt(Ne, Dn, vt[qr], di), !kr)
- continue;
- const _n = kr.isExternalLibraryImport, yi = !J4(kr.extension) && !yp(kr.resolvedFileName), fn = _n && yi && (!kr.originalPath || Yy(kr.resolvedFileName)), ks = kr.resolvedFileName;
- _n && Nt++;
- const po = fn && Nt > jr, Bu = ks && !UW(qt, kr, Ne) && !qt.noResolve && qr < Ne.imports.length && !po && !(yi && !By(qt)) && (cn(Ne.imports[qr]) || !(Ne.imports[qr].flags & 16777216));
- po ? Qt.set(Ne.path, !0) : Bu && Va(
- ks,
- /*isDefaultLib*/
- !1,
- /*ignoreNoDefaultLib*/
- !1,
- { kind: 3, file: Ne.path, index: qr },
- kr.packageId
- ), _n && Nt--;
- }
- }
- }
- function L(Ne, qe) {
- let vt = !0;
- const qt = xr.getCanonicalFileName(es(qe, ji));
- for (const fr of Ne)
- fr.isDeclarationFile || xr.getCanonicalFileName(es(fr.fileName, ji)).indexOf(qt) !== 0 && (ga(
- fr,
- p.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
- [fr.fileName, qe]
- ), vt = !1);
- return vt;
- }
- function Ce(Ne) {
- xe || (xe = /* @__PURE__ */ new Map());
- const qe = g6(Ne), vt = hr(qe), qt = xe.get(vt);
- if (qt !== void 0)
- return qt || void 0;
- let fr, qr;
- if (xr.getParsedCommandLine) {
- if (fr = xr.getParsedCommandLine(qe), !fr) {
- A_(
- /*file*/
- void 0,
- vt,
- qe,
- /*redirectedPath*/
- void 0
- ), xe.set(vt, !1);
- return;
- }
- qr = E.checkDefined(fr.options.configFile), E.assert(!qr.path || qr.path === vt), A_(
- qr,
- vt,
- qe,
- /*redirectedPath*/
- void 0
- );
- } else {
- const Dn = es(Xn(qe), ji);
- if (qr = xr.getSourceFile(
- qe,
- 100
- /* JSON */
- ), A_(
- qr,
- vt,
- qe,
- /*redirectedPath*/
- void 0
- ), qr === void 0) {
- xe.set(vt, !1);
- return;
- }
- fr = SA(
- qr,
- zn,
- Dn,
- /*existingOptions*/
- void 0,
- qe
- );
- }
- qr.fileName = qe, qr.path = vt, qr.resolvedPath = vt, qr.originalFileName = qe;
- const kr = { commandLine: fr, sourceFile: qr };
- return xe.set(vt, kr), fr.projectReferences && (kr.references = fr.projectReferences.map(Ce)), kr;
- }
- function yt() {
- q.strictPropertyInitialization && !cu(q, "strictNullChecks") && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks"), q.exactOptionalPropertyTypes && !cu(q, "strictNullChecks") && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"), (q.isolatedModules || q.verbatimModuleSyntax) && q.outFile && Mo(p.Option_0_cannot_be_specified_with_option_1, "outFile", q.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"), q.isolatedDeclarations && (By(q) && Mo(p.Option_0_cannot_be_specified_with_option_1, "allowJs", "isolatedDeclarations"), P_(q) || Mo(p.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "isolatedDeclarations", "declaration", "composite")), q.inlineSourceMap && (q.sourceMap && Mo(p.Option_0_cannot_be_specified_with_option_1, "sourceMap", "inlineSourceMap"), q.mapRoot && Mo(p.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap")), q.composite && (q.declaration === !1 && Mo(p.Composite_projects_may_not_disable_declaration_emit, "declaration"), q.incremental === !1 && Mo(p.Composite_projects_may_not_disable_incremental_compilation, "declaration"));
- const Ne = q.outFile;
- if (!q.tsBuildInfoFile && q.incremental && !Ne && !q.configFilePath && Ri.add(Go(p.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)), Es(), dd(), q.composite) {
- const kr = new Set(X.map(hr));
- for (const Dn of ie)
- cS(Dn, dt) && !kr.has(Dn.path) && ga(
- Dn,
- p.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
- [Dn.fileName, q.configFilePath || ""]
- );
- }
- if (q.paths) {
- for (const kr in q.paths)
- if (co(q.paths, kr))
- if (KB(kr) || Kg(
- /*onKey*/
- !0,
- kr,
- p.Pattern_0_can_have_at_most_one_Asterisk_character,
- kr
- ), us(q.paths[kr])) {
- const Dn = q.paths[kr].length;
- Dn === 0 && Kg(
- /*onKey*/
- !1,
- kr,
- p.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array,
- kr
- );
- for (let di = 0; di < Dn; di++) {
- const _n = q.paths[kr][di], yi = typeof _n;
- yi === "string" ? (KB(_n) || jd(kr, di, p.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, _n, kr), !q.baseUrl && !If(_n) && !UE(_n) && jd(kr, di, p.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash)) : jd(kr, di, p.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, _n, kr, yi);
- }
- } else
- Kg(
- /*onKey*/
- !1,
- kr,
- p.Substitutions_for_pattern_0_should_be_an_array,
- kr
- );
- }
- !q.sourceMap && !q.inlineSourceMap && (q.inlineSources && Mo(p.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "inlineSources"), q.sourceRoot && Mo(p.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "sourceRoot")), q.mapRoot && !(q.sourceMap || q.declarationMap) && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "mapRoot", "sourceMap", "declarationMap"), q.declarationDir && (P_(q) || Mo(p.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"), Ne && Mo(p.Option_0_cannot_be_specified_with_option_1, "declarationDir", "outFile")), q.declarationMap && !P_(q) && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationMap", "declaration", "composite"), q.lib && q.noLib && Mo(p.Option_0_cannot_be_specified_with_option_1, "lib", "noLib");
- const qe = pa(q), vt = On(ie, (kr) => il(kr) && !kr.isDeclarationFile);
- if (q.isolatedModules || q.verbatimModuleSyntax)
- q.module === 0 && qe < 2 && q.isolatedModules && Mo(p.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"), q.preserveConstEnums === !1 && Mo(p.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, q.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums");
- else if (vt && qe < 2 && q.module === 0) {
- const kr = tS(vt, typeof vt.externalModuleIndicator == "boolean" ? vt : vt.externalModuleIndicator);
- Ri.add(fl(vt, kr.start, kr.length, p.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
- }
- if (Ne && !q.emitDeclarationOnly) {
- if (q.module && !(q.module === 2 || q.module === 4))
- Mo(p.Only_amd_and_system_modules_are_supported_alongside_0, "outFile", "module");
- else if (q.module === void 0 && vt) {
- const kr = tS(vt, typeof vt.externalModuleIndicator == "boolean" ? vt : vt.externalModuleIndicator);
- Ri.add(fl(vt, kr.start, kr.length, p.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile"));
- }
- }
- if (Ab(q) && (yu(q) === 1 ? Mo(p.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule") : u5(q) || Mo(p.Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd, "resolveJsonModule", "module")), q.outDir || // there is --outDir specified
- q.rootDir || // there is --rootDir specified
- q.sourceRoot || // there is --sourceRoot specified
- q.mapRoot || // there is --mapRoot specified
- P_(q) && q.declarationDir) {
- const kr = Ft();
- q.outDir && kr === "" && ie.some((Dn) => Km(Dn.fileName) > 1) && Mo(p.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
- }
- q.checkJs && !By(q) && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs"), q.emitDeclarationOnly && (P_(q) || Mo(p.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite")), q.emitDecoratorMetadata && !q.experimentalDecorators && Mo(p.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"), q.jsxFactory ? (q.reactNamespace && Mo(p.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"), (q.jsx === 4 || q.jsx === 5) && Mo(p.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", gA.get("" + q.jsx)), Jx(q.jsxFactory, qe) || Tf("jsxFactory", p.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, q.jsxFactory)) : q.reactNamespace && !k_(q.reactNamespace, qe) && Tf("reactNamespace", p.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier, q.reactNamespace), q.jsxFragmentFactory && (q.jsxFactory || Mo(p.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"), (q.jsx === 4 || q.jsx === 5) && Mo(p.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", gA.get("" + q.jsx)), Jx(q.jsxFragmentFactory, qe) || Tf("jsxFragmentFactory", p.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, q.jsxFragmentFactory)), q.reactNamespace && (q.jsx === 4 || q.jsx === 5) && Mo(p.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", gA.get("" + q.jsx)), q.jsxImportSource && q.jsx === 2 && Mo(p.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", gA.get("" + q.jsx));
- const qt = Ru(q);
- q.verbatimModuleSyntax && (qt === 2 || qt === 3 || qt === 4) && Mo(p.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"), q.allowImportingTsExtensions && !(q.noEmit || q.emitDeclarationOnly) && Tf("allowImportingTsExtensions", p.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
- const fr = yu(q);
- if (q.resolvePackageJsonExports && !RC(fr) && Mo(p.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"), q.resolvePackageJsonImports && !RC(fr) && Mo(p.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"), q.customConditions && !RC(fr) && Mo(p.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"), fr === 100 && !j3(qt) && qt !== 200 && Tf("moduleResolution", p.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler"), lw[qt] && 100 <= qt && qt <= 199 && !(3 <= fr && fr <= 99)) {
- const kr = lw[qt];
- Tf("moduleResolution", p.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, kr, kr);
- } else if (zE[fr] && 3 <= fr && fr <= 99 && !(100 <= qt && qt <= 199)) {
- const kr = zE[fr];
- Tf("module", p.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, kr, kr);
- }
- if (!q.noEmit && !q.suppressOutputPathCheck) {
- const kr = io(), Dn = /* @__PURE__ */ new Set();
- hW(kr, (di) => {
- q.emitDeclarationOnly || qr(di.jsFilePath, Dn), qr(di.declarationFilePath, Dn);
- });
- }
- function qr(kr, Dn) {
- if (kr) {
- const di = hr(kr);
- if (K.has(di)) {
- let yi;
- q.configFilePath || (yi = vs(
- /*details*/
- void 0,
- p.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig
- )), yi = vs(yi, p.Cannot_write_file_0_because_it_would_overwrite_input_file, kr), z0(kr, a5(yi));
- }
- const _n = xr.useCaseSensitiveFileNames() ? di : vy(di);
- Dn.has(_n) ? z0(kr, Go(p.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, kr)) : Dn.add(_n);
- }
- }
- }
- function Mr() {
- const Ne = q.ignoreDeprecations;
- if (Ne) {
- if (Ne === "5.0")
- return new Sd(Ne);
- ue();
- }
- return Sd.zero;
- }
- function hi(Ne, qe, vt, qt) {
- const fr = new Sd(Ne), qr = new Sd(qe), kr = new Sd(ee || wf), Dn = Mr(), di = qr.compareTo(kr) !== 1, _n = !di && Dn.compareTo(fr) === -1;
- (di || _n) && qt((yi, fn, ks) => {
- di ? fn === void 0 ? vt(yi, fn, ks, p.Option_0_has_been_removed_Please_remove_it_from_your_configuration, yi) : vt(yi, fn, ks, p.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, yi, fn) : fn === void 0 ? vt(yi, fn, ks, p.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, yi, qe, Ne) : vt(yi, fn, ks, p.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, yi, fn, qe, Ne);
- });
- }
- function Es() {
- function Ne(qe, vt, qt, fr, ...qr) {
- if (qt) {
- const kr = vs(
- /*details*/
- void 0,
- p.Use_0_instead,
- qt
- ), Dn = vs(kr, fr, ...qr);
- Bd(
- /*onKey*/
- !vt,
- qe,
- /*option2*/
- void 0,
- Dn
- );
- } else
- Bd(
- /*onKey*/
- !vt,
- qe,
- /*option2*/
- void 0,
- fr,
- ...qr
- );
- }
- hi("5.0", "5.5", Ne, (qe) => {
- q.target === 0 && qe("target", "ES3"), q.noImplicitUseStrict && qe("noImplicitUseStrict"), q.keyofStringsOnly && qe("keyofStringsOnly"), q.suppressExcessPropertyErrors && qe("suppressExcessPropertyErrors"), q.suppressImplicitAnyIndexErrors && qe("suppressImplicitAnyIndexErrors"), q.noStrictGenericChecks && qe("noStrictGenericChecks"), q.charset && qe("charset"), q.out && qe(
- "out",
- /*value*/
- void 0,
- "outFile"
- ), q.importsNotUsedAsValues && qe(
- "importsNotUsedAsValues",
- /*value*/
- void 0,
- "verbatimModuleSyntax"
- ), q.preserveValueImports && qe(
- "preserveValueImports",
- /*value*/
- void 0,
- "verbatimModuleSyntax"
- );
- });
- }
- function ns(Ne, qe, vt) {
- function qt(fr, qr, kr, Dn, ...di) {
- N_(qe, vt, Dn, ...di);
- }
- hi("5.0", "5.5", qt, (fr) => {
- Ne.prepend && fr("prepend");
- });
- }
- function Ds(Ne, qe, vt, qt) {
- let fr;
- const qr = Ne && he.get(Ne.path);
- let kr, Dn, di = Sv(qe) ? qe : void 0, _n, yi, fn = Ne && me?.get(Ne.path), ks;
- fn ? (fn.fileIncludeReasonDetails ? (fr = new Set(qr), qr?.forEach(Ju)) : qr?.forEach(ed), yi = fn.redirectInfo) : (qr?.forEach(ed), yi = Ne && sU(Ne, Y(Ne))), qe && ed(qe);
- const po = fr?.size !== qr?.length;
- di && fr?.size === 1 && (fr = void 0), fr && fn && (fn.details && !po ? ks = vs(fn.details, vt, ...qt || Ue) : fn.fileIncludeReasonDetails && (po ? td() ? kr = wr(fn.fileIncludeReasonDetails.next.slice(0, qr.length), kr[0]) : kr = [...fn.fileIncludeReasonDetails.next, kr[0]] : td() ? kr = fn.fileIncludeReasonDetails.next.slice(0, qr.length) : _n = fn.fileIncludeReasonDetails)), ks || (_n || (_n = fr && vs(kr, p.The_file_is_in_the_program_because_Colon)), ks = vs(
- yi ? _n ? [_n, ...yi] : yi : _n,
- vt,
- ...qt || Ue
- )), Ne && (fn ? (!fn.fileIncludeReasonDetails || !po && _n) && (fn.fileIncludeReasonDetails = _n) : (me ?? (me = /* @__PURE__ */ new Map())).set(Ne.path, fn = { fileIncludeReasonDetails: _n, redirectInfo: yi }), !fn.details && !po && (fn.details = ks.next));
- const Bu = di && jD(dt, di);
- return Bu && m6(Bu) ? f7(Bu.file, Bu.pos, Bu.end - Bu.pos, ks, Dn) : a5(ks, Dn);
- function ed(zu) {
- fr?.has(zu) || ((fr ?? (fr = /* @__PURE__ */ new Set())).add(zu), (kr ?? (kr = [])).push(cU(dt, zu)), Ju(zu));
- }
- function Ju(zu) {
- !di && Sv(zu) ? di = zu : di !== zu && (Dn = wr(Dn, $o(zu)));
- }
- function td() {
- var zu;
- return ((zu = fn.fileIncludeReasonDetails.next) == null ? void 0 : zu.length) !== qr?.length;
- }
- }
- function Pa(Ne, qe, vt, qt) {
- (we || (we = [])).push({
- kind: 1,
- file: Ne && Ne.path,
- fileProcessingReason: qe,
- diagnostic: vt,
- args: qt
- });
- }
- function ga(Ne, qe, vt) {
- Jr.push({ file: Ne, diagnostic: qe, args: vt });
- }
- function $o(Ne) {
- let qe = ve?.get(Ne);
- return qe === void 0 && (ve ?? (ve = /* @__PURE__ */ new Map())).set(Ne, qe = vp(Ne) ?? !1), qe || void 0;
- }
- function vp(Ne) {
- if (Sv(Ne)) {
- const qt = jD(dt, Ne);
- let fr;
- switch (Ne.kind) {
- case 3:
- fr = p.File_is_included_via_import_here;
- break;
- case 4:
- fr = p.File_is_included_via_reference_here;
- break;
- case 5:
- fr = p.File_is_included_via_type_library_reference_here;
- break;
- case 7:
- fr = p.File_is_included_via_library_reference_here;
- break;
- default:
- E.assertNever(Ne);
- }
- return m6(qt) ? fl(
- qt.file,
- qt.pos,
- qt.end - qt.pos,
- fr
- ) : void 0;
- }
- if (!q.configFile) return;
- let qe, vt;
- switch (Ne.kind) {
- case 0:
- if (!q.configFile.configFileSpecs) return;
- const qt = es(X[Ne.index], ji), fr = aU(dt, qt);
- if (fr) {
- qe = y7(q.configFile, "files", fr), vt = p.File_is_matched_by_files_list_specified_here;
- break;
- }
- const qr = oU(dt, qt);
- if (!qr || !_s(qr)) return;
- qe = y7(q.configFile, "include", qr), vt = p.File_is_matched_by_include_pattern_specified_here;
- break;
- case 1:
- case 2:
- const kr = E.checkDefined(Ke?.[Ne.index]), Dn = uF(ae, Ke, (ks, po, Bu) => ks === kr ? { sourceFile: po?.sourceFile || q.configFile, index: Bu } : void 0);
- if (!Dn) return;
- const { sourceFile: di, index: _n } = Dn, yi = $w(di, "references", (ks) => $l(ks.initializer) ? ks.initializer : void 0);
- return yi && yi.elements.length > _n ? sp(
- di,
- yi.elements[_n],
- Ne.kind === 2 ? p.File_is_output_from_referenced_project_specified_here : p.File_is_source_from_referenced_project_specified_here
- ) : void 0;
- case 8:
- if (!q.types) return;
- qe = Sp("types", Ne.typeReference), vt = p.File_is_entry_point_of_type_library_specified_here;
- break;
- case 6:
- if (Ne.index !== void 0) {
- qe = Sp("lib", q.lib[Ne.index]), vt = p.File_is_library_specified_here;
- break;
- }
- const fn = _5(pa(q));
- qe = fn ? bp("target", fn) : void 0, vt = p.File_is_default_library_for_target_specified_here;
- break;
- default:
- E.assertNever(Ne);
- }
- return qe && sp(
- q.configFile,
- qe,
- vt
- );
- }
- function dd() {
- const Ne = q.suppressOutputPathCheck ? void 0 : bv(q);
- uF(ae, Ke, (qe, vt, qt) => {
- const fr = (vt ? vt.commandLine.projectReferences : ae)[qt], qr = vt && vt.sourceFile;
- if (ns(fr, qr, qt), !qe) {
- N_(qr, qt, p.File_0_not_found, fr.path);
- return;
- }
- const kr = qe.commandLine.options;
- (!kr.composite || kr.noEmit) && (vt ? vt.commandLine.fileNames : X).length && (kr.composite || N_(qr, qt, p.Referenced_project_0_must_have_setting_composite_Colon_true, fr.path), kr.noEmit && N_(qr, qt, p.Referenced_project_0_may_not_disable_emit, fr.path)), !vt && Ne && Ne === bv(kr) && (N_(qr, qt, p.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, Ne, fr.path), Ar.set(hr(Ne), !0));
- });
- }
- function jd(Ne, qe, vt, ...qt) {
- let fr = !0;
- eh((qr) => {
- Ks(qr.initializer) && vC(qr.initializer, Ne, (kr) => {
- const Dn = kr.initializer;
- $l(Dn) && Dn.elements.length > qe && (Ri.add(sp(q.configFile, Dn.elements[qe], vt, ...qt)), fr = !1);
- });
- }), fr && th(vt, ...qt);
- }
- function Kg(Ne, qe, vt, ...qt) {
- let fr = !0;
- eh((qr) => {
- Ks(qr.initializer) && Vh(
- qr.initializer,
- Ne,
- qe,
- /*key2*/
- void 0,
- vt,
- ...qt
- ) && (fr = !1);
- }), fr && th(vt, ...qt);
- }
- function J0(Ne, qe) {
- return vC(Yp(), Ne, qe);
- }
- function eh(Ne) {
- return J0("paths", Ne);
- }
- function bp(Ne, qe) {
- return J0(Ne, (vt) => oa(vt.initializer) && vt.initializer.text === qe ? vt.initializer : void 0);
- }
- function Sp(Ne, qe) {
- const vt = Yp();
- return vt && AZ(vt, Ne, qe);
- }
- function Mo(Ne, qe, vt, qt) {
- Bd(
- /*onKey*/
- !0,
- qe,
- vt,
- Ne,
- qe,
- vt,
- qt
- );
- }
- function Tf(Ne, qe, ...vt) {
- Bd(
- /*onKey*/
- !1,
- Ne,
- /*option2*/
- void 0,
- qe,
- ...vt
- );
- }
- function N_(Ne, qe, vt, ...qt) {
- const fr = $w(Ne || q.configFile, "references", (qr) => $l(qr.initializer) ? qr.initializer : void 0);
- fr && fr.elements.length > qe ? Ri.add(sp(Ne || q.configFile, fr.elements[qe], vt, ...qt)) : Ri.add(Go(vt, ...qt));
- }
- function Bd(Ne, qe, vt, qt, ...fr) {
- const qr = Yp();
- (!qr || !Vh(qr, Ne, qe, vt, qt, ...fr)) && th(qt, ...fr);
- }
- function th(Ne, ...qe) {
- const vt = dg();
- vt ? "messageText" in Ne ? Ri.add(Rg(q.configFile, vt.name, Ne)) : Ri.add(sp(q.configFile, vt.name, Ne, ...qe)) : "messageText" in Ne ? Ri.add(a5(Ne)) : Ri.add(Go(Ne, ...qe));
- }
- function Yp() {
- if (mn === void 0) {
- const Ne = dg();
- mn = Ne && Wn(Ne.initializer, Ks) || !1;
- }
- return mn || void 0;
- }
- function dg() {
- return ti === void 0 && (ti = vC(
- d4(q.configFile),
- "compilerOptions",
- go
- ) || !1), ti || void 0;
- }
- function Vh(Ne, qe, vt, qt, fr, ...qr) {
- let kr = !1;
- return vC(Ne, vt, (Dn) => {
- "messageText" in fr ? Ri.add(Rg(q.configFile, qe ? Dn.name : Dn.initializer, fr)) : Ri.add(sp(q.configFile, qe ? Dn.name : Dn.initializer, fr, ...qr)), kr = !0;
- }, qt), kr;
- }
- function z0(Ne, qe) {
- Ar.set(hr(Ne), !0), Ri.add(qe);
- }
- function Zp(Ne) {
- if (q.noEmit)
- return !1;
- const qe = hr(Ne);
- if (Bt(qe))
- return !1;
- const vt = q.outFile;
- if (vt)
- return Nv(qe, vt) || Nv(
- qe,
- $u(vt) + ".d.ts"
- /* Dts */
- );
- if (q.declarationDir && np(q.declarationDir, qe, ji, !xr.useCaseSensitiveFileNames()))
- return !0;
- if (q.outDir)
- return np(q.outDir, qe, ji, !xr.useCaseSensitiveFileNames());
- if (xc(qe, jC) || wl(qe)) {
- const qt = $u(qe);
- return !!Bt(
- qt + ".ts"
- /* Ts */
- ) || !!Bt(
- qt + ".tsx"
- /* Tsx */
- );
- }
- return !1;
- }
- function Nv(Ne, qe) {
- return Sh(Ne, qe, ji, !xr.useCaseSensitiveFileNames()) === 0;
- }
- function qf() {
- return xr.getSymlinkCache ? xr.getSymlinkCache() : (Se || (Se = eJ(ji, En)), ie && !Se.hasProcessedResolutions() && Se.setSymlinksFromResolutions(At, Dr, Me), Se);
- }
- function Kp(Ne, qe) {
- return MW(Ne, qe, Y(Ne));
- }
- function qh(Ne, qe) {
- return T1e(Ne, qe, Y(Ne));
- }
- function Iv(Ne, qe) {
- return Kp(Ne, UA(Ne, qe));
- }
- function mg(Ne) {
- return pF(Ne, Y(Ne));
- }
- function rh(Ne) {
- return PS(Ne, Y(Ne));
- }
- function Ov(Ne) {
- return BD(Ne, Y(Ne));
- }
- function n1(Ne) {
- return P1e(Ne, Y(Ne));
- }
- }
- function P1e(e, t) {
- const n = Ru(t);
- return 100 <= n && n <= 199 || n === 200 ? !1 : BD(e, t) < 5;
- }
- function BD(e, t) {
- return PS(e, t) ?? Ru(t);
- }
- function PS(e, t) {
- var n, i;
- const s = Ru(t);
- if (100 <= s && s <= 199)
- return e.impliedNodeFormat;
- if (e.impliedNodeFormat === 1 && (((n = e.packageJsonScope) == null ? void 0 : n.contents.packageJsonContent.type) === "commonjs" || xc(e.fileName, [
- ".cjs",
- ".cts"
- /* Cts */
- ])))
- return 1;
- if (e.impliedNodeFormat === 99 && (((i = e.packageJsonScope) == null ? void 0 : i.contents.packageJsonContent.type) === "module" || xc(e.fileName, [
- ".mjs",
- ".mts"
- /* Mts */
- ])))
- return 99;
- }
- function pF(e, t) {
- return YB(t) ? PS(e, t) : void 0;
- }
- function LRe(e) {
- let t;
- const n = e.compilerHost.fileExists, i = e.compilerHost.directoryExists, s = e.compilerHost.getDirectories, o = e.compilerHost.realpath;
- if (!e.useSourceOfProjectReferenceRedirect) return { onProgramCreateComplete: ja, fileExists: u };
- e.compilerHost.fileExists = u;
- let c;
- return i && (c = e.compilerHost.directoryExists = (T) => i.call(e.compilerHost, T) ? (h(T), !0) : e.getResolvedProjectReferences() ? (t || (t = /* @__PURE__ */ new Set(), e.forEachResolvedProjectReference((C) => {
- const D = C.commandLine.options.outFile;
- if (D)
- t.add(Xn(e.toPath(D)));
- else {
- const P = C.commandLine.options.declarationDir || C.commandLine.options.outDir;
- P && t.add(e.toPath(P));
- }
- })), S(
- T,
- /*isFile*/
- !1
- )) : !1), s && (e.compilerHost.getDirectories = (T) => !e.getResolvedProjectReferences() || i && i.call(e.compilerHost, T) ? s.call(e.compilerHost, T) : []), o && (e.compilerHost.realpath = (T) => {
- var C;
- return ((C = e.getSymlinkCache().getSymlinkedFiles()) == null ? void 0 : C.get(e.toPath(T))) || o.call(e.compilerHost, T);
- }), { onProgramCreateComplete: _, fileExists: u, directoryExists: c };
- function _() {
- e.compilerHost.fileExists = n, e.compilerHost.directoryExists = i, e.compilerHost.getDirectories = s;
- }
- function u(T) {
- return n.call(e.compilerHost, T) ? !0 : !e.getResolvedProjectReferences() || !wl(T) ? !1 : S(
- T,
- /*isFile*/
- !0
- );
- }
- function d(T) {
- const C = e.getSourceOfProjectReferenceRedirect(e.toPath(T));
- return C !== void 0 ? _s(C) ? n.call(e.compilerHost, C) : !0 : void 0;
- }
- function g(T) {
- const C = e.toPath(T), D = `${C}${Vo}`;
- return Ch(
- t,
- (P) => C === P || // Any parent directory of declaration dir
- Ui(P, D) || // Any directory inside declaration dir
- Ui(C, `${P}/`)
- );
- }
- function h(T) {
- var C;
- if (!e.getResolvedProjectReferences() || H4(T) || !o || !T.includes(Xg)) return;
- const D = e.getSymlinkCache(), P = ul(e.toPath(T));
- if ((C = D.getSymlinkedDirectories()) != null && C.has(P)) return;
- const I = Os(o.call(e.compilerHost, T));
- let F;
- if (I === T || (F = ul(e.toPath(I))) === P) {
- D.setSymlinkedDirectory(P, !1);
- return;
- }
- D.setSymlinkedDirectory(T, {
- real: ul(I),
- realPath: F
- });
- }
- function S(T, C) {
- var D;
- const P = C ? (z) => d(z) : (z) => g(z), I = P(T);
- if (I !== void 0) return I;
- const F = e.getSymlinkCache(), O = F.getSymlinkedDirectories();
- if (!O) return !1;
- const B = e.toPath(T);
- return B.includes(Xg) ? C && ((D = F.getSymlinkedFiles()) != null && D.has(B)) ? !0 : ew(
- O.entries(),
- ([z, X]) => {
- if (!X || !Ui(B, z)) return;
- const q = P(B.replace(z, X.realPath));
- if (C && q) {
- const V = es(T, e.compilerHost.getCurrentDirectory());
- F.setSymlinkedFile(
- B,
- `${X.real}${V.replace(new RegExp(z, "i"), "")}`
- );
- }
- return q;
- }
- ) || !1 : !1;
- }
- }
- var zW = { diagnostics: Ue, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: !0 };
- function WW(e, t, n, i) {
- const s = e.getCompilerOptions();
- if (s.noEmit)
- return t ? zW : e.emitBuildInfo(n, i);
- if (!s.noEmitOnError) return;
- let o = [
- ...e.getOptionsDiagnostics(i),
- ...e.getSyntacticDiagnostics(t, i),
- ...e.getGlobalDiagnostics(i),
- ...e.getSemanticDiagnostics(t, i)
- ];
- if (o.length === 0 && P_(e.getCompilerOptions()) && (o = e.getDeclarationDiagnostics(
- /*sourceFile*/
- void 0,
- i
- )), !o.length) return;
- let c;
- if (!t) {
- const _ = e.emitBuildInfo(n, i);
- _.diagnostics && (o = [...o, ..._.diagnostics]), c = _.emittedFiles;
- }
- return { diagnostics: o, sourceMaps: void 0, emittedFiles: c, emitSkipped: !0 };
- }
- function dF(e, t) {
- return Ln(e, (n) => !n.skippedOn || !t[n.skippedOn]);
- }
- function mF(e, t = e) {
- return {
- fileExists: (n) => t.fileExists(n),
- readDirectory(n, i, s, o, c) {
- return E.assertIsDefined(t.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"), t.readDirectory(n, i, s, o, c);
- },
- readFile: (n) => t.readFile(n),
- directoryExists: Ms(t, t.directoryExists),
- getDirectories: Ms(t, t.getDirectories),
- realpath: Ms(t, t.realpath),
- useCaseSensitiveFileNames: e.useCaseSensitiveFileNames(),
- getCurrentDirectory: () => e.getCurrentDirectory(),
- onUnRecoverableConfigFileDiagnostic: e.onUnRecoverableConfigFileDiagnostic || lb,
- trace: e.trace ? (n) => e.trace(n) : void 0
- };
- }
- function g6(e) {
- return hU(e.path);
- }
- function UW(e, { extension: t }, { isDeclarationFile: n }) {
- switch (t) {
- case ".ts":
- case ".d.ts":
- case ".mts":
- case ".d.mts":
- case ".cts":
- case ".d.cts":
- return;
- case ".tsx":
- return i();
- case ".jsx":
- return i() || s();
- case ".js":
- case ".mjs":
- case ".cjs":
- return s();
- case ".json":
- return o();
- default:
- return c();
- }
- function i() {
- return e.jsx ? void 0 : p.Module_0_was_resolved_to_1_but_jsx_is_not_set;
- }
- function s() {
- return By(e) || !cu(e, "noImplicitAny") ? void 0 : p.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type;
- }
- function o() {
- return Ab(e) ? void 0 : p.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;
- }
- function c() {
- return n || e.allowArbitraryExtensions ? void 0 : p.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set;
- }
- }
- function w1e({ imports: e, moduleAugmentations: t }) {
- const n = e.map((i) => i);
- for (const i of t)
- i.kind === 11 && n.push(i);
- return n;
- }
- function UA({ imports: e, moduleAugmentations: t }, n) {
- if (n < e.length) return e[n];
- let i = e.length;
- for (const s of t)
- if (s.kind === 11) {
- if (n === i) return s;
- i++;
- }
- E.fail("should never ask for module name at index higher than possible module name");
- }
- function Vne(e, t, n, i, s, o) {
- const c = [], { emitSkipped: _, diagnostics: u } = e.emit(t, d, i, n, s, o);
- return { outputFiles: c, emitSkipped: _, diagnostics: u };
- function d(g, h, S) {
- c.push({ name: g, writeByteOrderMark: S, text: h });
- }
- }
- var qne = /* @__PURE__ */ ((e) => (e[e.ComputedDts = 0] = "ComputedDts", e[e.StoredSignatureAtEmit = 1] = "StoredSignatureAtEmit", e[e.UsedVersion = 2] = "UsedVersion", e))(qne || {}), Ld;
- ((e) => {
- function t() {
- function ee(G, ue, re) {
- const ne = {
- getKeys: (ie) => ue.get(ie),
- getValues: (ie) => G.get(ie),
- keys: () => G.keys(),
- size: () => G.size,
- deleteKey: (ie) => {
- (re || (re = /* @__PURE__ */ new Set())).add(ie);
- const Se = G.get(ie);
- return Se ? (Se.forEach((J) => i(ue, J, ie)), G.delete(ie), !0) : !1;
- },
- set: (ie, Se) => {
- re?.delete(ie);
- const J = G.get(ie);
- return G.set(ie, Se), J?.forEach((oe) => {
- Se.has(oe) || i(ue, oe, ie);
- }), Se.forEach((oe) => {
- J?.has(oe) || n(ue, oe, ie);
- }), ne;
- }
- };
- return ne;
- }
- return ee(
- /* @__PURE__ */ new Map(),
- /* @__PURE__ */ new Map(),
- /*deleted*/
- void 0
- );
- }
- e.createManyToManyPathMap = t;
- function n(ee, G, ue) {
- let re = ee.get(G);
- re || (re = /* @__PURE__ */ new Set(), ee.set(G, re)), re.add(ue);
- }
- function i(ee, G, ue) {
- const re = ee.get(G);
- return re?.delete(ue) ? (re.size || ee.delete(G), !0) : !1;
- }
- function s(ee) {
- return Ai(ee.declarations, (G) => {
- var ue;
- return (ue = Tr(G)) == null ? void 0 : ue.resolvedPath;
- });
- }
- function o(ee, G) {
- const ue = ee.getSymbolAtLocation(G);
- return ue && s(ue);
- }
- function c(ee, G, ue, re) {
- return uo(ee.getProjectReferenceRedirect(G) || G, ue, re);
- }
- function _(ee, G, ue) {
- let re;
- if (G.imports && G.imports.length > 0) {
- const J = ee.getTypeChecker();
- for (const oe of G.imports) {
- const _e = o(J, oe);
- _e?.forEach(Se);
- }
- }
- const ne = Xn(G.resolvedPath);
- if (G.referencedFiles && G.referencedFiles.length > 0)
- for (const J of G.referencedFiles) {
- const oe = c(ee, J.fileName, ne, ue);
- Se(oe);
- }
- if (ee.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective: J }) => {
- if (!J)
- return;
- const oe = J.resolvedFileName, _e = c(ee, oe, ne, ue);
- Se(_e);
- }, G), G.moduleAugmentations.length) {
- const J = ee.getTypeChecker();
- for (const oe of G.moduleAugmentations) {
- if (!oa(oe)) continue;
- const _e = J.getSymbolAtLocation(oe);
- _e && ie(_e);
- }
- }
- for (const J of ee.getTypeChecker().getAmbientModules())
- J.declarations && J.declarations.length > 1 && ie(J);
- return re;
- function ie(J) {
- if (J.declarations)
- for (const oe of J.declarations) {
- const _e = Tr(oe);
- _e && _e !== G && Se(_e.resolvedPath);
- }
- }
- function Se(J) {
- (re || (re = /* @__PURE__ */ new Set())).add(J);
- }
- }
- function u(ee, G) {
- return G && !G.referencedMap == !ee;
- }
- e.canReuseOldState = u;
- function d(ee) {
- return ee.module !== 0 && !ee.outFile ? t() : void 0;
- }
- e.createReferencedMap = d;
- function g(ee, G, ue) {
- var re, ne;
- const ie = /* @__PURE__ */ new Map(), Se = ee.getCompilerOptions(), J = d(Se), oe = u(J, G);
- ee.getTypeChecker();
- for (const _e of ee.getSourceFiles()) {
- const he = E.checkDefined(_e.version, "Program intended to be used with Builder should have source files with versions set"), le = oe ? (re = G.oldSignatures) == null ? void 0 : re.get(_e.resolvedPath) : void 0, me = le === void 0 ? oe ? (ne = G.fileInfos.get(_e.resolvedPath)) == null ? void 0 : ne.signature : void 0 : le || void 0;
- if (J) {
- const ve = _(ee, _e, ee.getCanonicalFileName);
- ve && J.set(_e.resolvedPath, ve);
- }
- ie.set(_e.resolvedPath, {
- version: he,
- signature: me,
- // No need to calculate affectsGlobalScope with --out since its not used at all
- affectsGlobalScope: Se.outFile ? void 0 : X(_e) || void 0,
- impliedFormat: _e.impliedNodeFormat
- });
- }
- return {
- fileInfos: ie,
- referencedMap: J,
- useFileVersionAsSignature: !ue && !oe
- };
- }
- e.create = g;
- function h(ee) {
- ee.allFilesExcludingDefaultLibraryFile = void 0, ee.allFileNames = void 0;
- }
- e.releaseCache = h;
- function S(ee, G, ue, re, ne) {
- var ie;
- const Se = T(
- ee,
- G,
- ue,
- re,
- ne
- );
- return (ie = ee.oldSignatures) == null || ie.clear(), Se;
- }
- e.getFilesAffectedBy = S;
- function T(ee, G, ue, re, ne) {
- const ie = G.getSourceFileByPath(ue);
- return ie ? P(ee, G, ie, re, ne) ? (ee.referencedMap ? ae : V)(ee, G, ie, re, ne) : [ie] : Ue;
- }
- e.getFilesAffectedByWithOldState = T;
- function C(ee, G, ue) {
- ee.fileInfos.get(ue).signature = G, (ee.hasCalledUpdateShapeSignature || (ee.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(ue);
- }
- e.updateSignatureOfFile = C;
- function D(ee, G, ue, re, ne) {
- ee.emit(
- G,
- (ie, Se, J, oe, _e, he) => {
- E.assert(wl(ie), `File extension for signature expected to be dts: Got:: ${ie}`), ne(
- HW(
- ee,
- G,
- Se,
- re,
- he
- ),
- _e
- );
- },
- ue,
- 2,
- /*customTransformers*/
- void 0,
- /*forceDtsEmit*/
- !0
- );
- }
- e.computeDtsSignature = D;
- function P(ee, G, ue, re, ne, ie = ee.useFileVersionAsSignature) {
- var Se;
- if ((Se = ee.hasCalledUpdateShapeSignature) != null && Se.has(ue.resolvedPath)) return !1;
- const J = ee.fileInfos.get(ue.resolvedPath), oe = J.signature;
- let _e;
- return !ue.isDeclarationFile && !ie && D(G, ue, re, ne, (he) => {
- _e = he, ne.storeSignatureInfo && (ee.signatureInfo ?? (ee.signatureInfo = /* @__PURE__ */ new Map())).set(
- ue.resolvedPath,
- 0
- /* ComputedDts */
- );
- }), _e === void 0 && (_e = ue.version, ne.storeSignatureInfo && (ee.signatureInfo ?? (ee.signatureInfo = /* @__PURE__ */ new Map())).set(
- ue.resolvedPath,
- 2
- /* UsedVersion */
- )), (ee.oldSignatures || (ee.oldSignatures = /* @__PURE__ */ new Map())).set(ue.resolvedPath, oe || !1), (ee.hasCalledUpdateShapeSignature || (ee.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(ue.resolvedPath), J.signature = _e, _e !== oe;
- }
- e.updateShapeSignature = P;
- function I(ee, G, ue) {
- if (G.getCompilerOptions().outFile || !ee.referencedMap || X(ue))
- return F(ee, G);
- const ne = /* @__PURE__ */ new Set(), ie = [ue.resolvedPath];
- for (; ie.length; ) {
- const Se = ie.pop();
- if (!ne.has(Se)) {
- ne.add(Se);
- const J = ee.referencedMap.getValues(Se);
- if (J)
- for (const oe of J.keys())
- ie.push(oe);
- }
- }
- return as(dy(ne.keys(), (Se) => {
- var J;
- return ((J = G.getSourceFileByPath(Se)) == null ? void 0 : J.fileName) ?? Se;
- }));
- }
- e.getAllDependencies = I;
- function F(ee, G) {
- if (!ee.allFileNames) {
- const ue = G.getSourceFiles();
- ee.allFileNames = ue === Ue ? Ue : ue.map((re) => re.fileName);
- }
- return ee.allFileNames;
- }
- function O(ee, G) {
- const ue = ee.referencedMap.getKeys(G);
- return ue ? as(ue.keys()) : [];
- }
- e.getReferencedByPaths = O;
- function B(ee) {
- for (const G of ee.statements)
- if (!l7(G))
- return !1;
- return !0;
- }
- function z(ee) {
- return ut(ee.moduleAugmentations, (G) => ig(G.parent));
- }
- function X(ee) {
- return z(ee) || !X_(ee) && !Rp(ee) && !B(ee);
- }
- function q(ee, G, ue) {
- if (ee.allFilesExcludingDefaultLibraryFile)
- return ee.allFilesExcludingDefaultLibraryFile;
- let re;
- ue && ne(ue);
- for (const ie of G.getSourceFiles())
- ie !== ue && ne(ie);
- return ee.allFilesExcludingDefaultLibraryFile = re || Ue, ee.allFilesExcludingDefaultLibraryFile;
- function ne(ie) {
- G.isSourceFileDefaultLibrary(ie) || (re || (re = [])).push(ie);
- }
- }
- e.getAllFilesExcludingDefaultLibraryFile = q;
- function V(ee, G, ue) {
- const re = G.getCompilerOptions();
- return re && re.outFile ? [ue] : q(ee, G, ue);
- }
- function ae(ee, G, ue, re, ne) {
- if (X(ue))
- return q(ee, G, ue);
- const ie = G.getCompilerOptions();
- if (ie && (Wp(ie) || ie.outFile))
- return [ue];
- const Se = /* @__PURE__ */ new Map();
- Se.set(ue.resolvedPath, ue);
- const J = O(ee, ue.resolvedPath);
- for (; J.length > 0; ) {
- const oe = J.pop();
- if (!Se.has(oe)) {
- const _e = G.getSourceFileByPath(oe);
- Se.set(oe, _e), _e && P(ee, G, _e, re, ne) && J.push(...O(ee, _e.resolvedPath));
- }
- }
- return as(dy(Se.values(), (oe) => oe));
- }
- })(Ld || (Ld = {}));
- var Hne = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Js = 1] = "Js", e[e.JsMap = 2] = "JsMap", e[e.JsInlineMap = 4] = "JsInlineMap", e[e.DtsErrors = 8] = "DtsErrors", e[e.DtsEmit = 16] = "DtsEmit", e[e.DtsMap = 32] = "DtsMap", e[e.Dts = 24] = "Dts", e[e.AllJs = 7] = "AllJs", e[e.AllDtsEmit = 48] = "AllDtsEmit", e[e.AllDts = 56] = "AllDts", e[e.All = 63] = "All", e))(Hne || {});
- function h6(e) {
- return e.program !== void 0;
- }
- function MRe(e) {
- return E.assert(h6(e)), e;
- }
- function e1(e) {
- let t = 1;
- return e.sourceMap && (t = t | 2), e.inlineSourceMap && (t = t | 4), P_(e) && (t = t | 24), e.declarationMap && (t = t | 32), e.emitDeclarationOnly && (t = t & 56), t;
- }
- function gF(e, t) {
- const n = t && (yy(t) ? t : e1(t)), i = yy(e) ? e : e1(e);
- if (n === i) return 0;
- if (!n || !i) return i;
- const s = n ^ i;
- let o = 0;
- return s & 7 && (o = i & 7), s & 8 && (o = o | i & 8), s & 48 && (o = o | i & 48), o;
- }
- function RRe(e, t) {
- return e === t || e !== void 0 && t !== void 0 && e.size === t.size && !Ch(e, (n) => !t.has(n));
- }
- function jRe(e, t) {
- var n, i;
- const s = Ld.create(
- e,
- t,
- /*disableUseFileVersionAsSignature*/
- !1
- );
- s.program = e;
- const o = e.getCompilerOptions();
- s.compilerOptions = o;
- const c = o.outFile;
- s.semanticDiagnosticsPerFile = /* @__PURE__ */ new Map(), c && o.composite && t?.outSignature && c === t.compilerOptions.outFile && (s.outSignature = t.outSignature && A1e(o, t.compilerOptions, t.outSignature)), s.changedFilesSet = /* @__PURE__ */ new Set(), s.latestChangedDtsFile = o.composite ? t?.latestChangedDtsFile : void 0, s.checkPending = s.compilerOptions.noCheck ? !0 : void 0;
- const _ = Ld.canReuseOldState(s.referencedMap, t), u = _ ? t.compilerOptions : void 0;
- let d = _ && !zK(o, u);
- const g = o.composite && t?.emitSignatures && !c && !UK(o, t.compilerOptions);
- let h = !0;
- _ ? ((n = t.changedFilesSet) == null || n.forEach((I) => s.changedFilesSet.add(I)), !c && ((i = t.affectedFilesPendingEmit) != null && i.size) && (s.affectedFilesPendingEmit = new Map(t.affectedFilesPendingEmit), s.seenAffectedFiles = /* @__PURE__ */ new Set()), s.programEmitPending = t.programEmitPending, c && s.changedFilesSet.size && (d = !1, h = !1), s.hasErrorsFromOldState = t.hasErrors) : s.buildInfoEmitPending = Nb(o);
- const S = s.referencedMap, T = _ ? t.referencedMap : void 0, C = d && !o.skipLibCheck == !u.skipLibCheck, D = C && !o.skipDefaultLibCheck == !u.skipDefaultLibCheck;
- if (s.fileInfos.forEach((I, F) => {
- var O;
- let B, z;
- if (!_ || // File wasn't present in old state
- !(B = t.fileInfos.get(F)) || // versions dont match
- B.version !== I.version || // Implied formats dont match
- B.impliedFormat !== I.impliedFormat || // Referenced files changed
- !RRe(z = S && S.getValues(F), T && T.getValues(F)) || // Referenced file was deleted in the new program
- z && Ch(z, (X) => !s.fileInfos.has(X) && t.fileInfos.has(X)))
- P(F);
- else {
- const X = e.getSourceFileByPath(F), q = h ? (O = t.emitDiagnosticsPerFile) == null ? void 0 : O.get(F) : void 0;
- if (q && (s.emitDiagnosticsPerFile ?? (s.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(
- F,
- t.hasReusableDiagnostic ? I1e(q, F, e) : N1e(q, e)
- ), d) {
- if (X.isDeclarationFile && !C || X.hasNoDefaultLib && !D) return;
- const V = t.semanticDiagnosticsPerFile.get(F);
- V && (s.semanticDiagnosticsPerFile.set(
- F,
- t.hasReusableDiagnostic ? I1e(V, F, e) : N1e(V, e)
- ), (s.semanticDiagnosticsFromOldState ?? (s.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(F));
- }
- }
- if (g) {
- const X = t.emitSignatures.get(F);
- X && (s.emitSignatures ?? (s.emitSignatures = /* @__PURE__ */ new Map())).set(F, A1e(o, t.compilerOptions, X));
- }
- }), _ && El(t.fileInfos, (I, F) => s.fileInfos.has(F) ? !1 : I.affectsGlobalScope ? !0 : (s.buildInfoEmitPending = !0, !!c)))
- Ld.getAllFilesExcludingDefaultLibraryFile(
- s,
- e,
- /*firstSourceFile*/
- void 0
- ).forEach((I) => P(I.resolvedPath));
- else if (u) {
- const I = WK(o, u) ? e1(o) : gF(o, u);
- I !== 0 && (c ? s.changedFilesSet.size || (s.programEmitPending = s.programEmitPending ? s.programEmitPending | I : I) : (e.getSourceFiles().forEach((F) => {
- s.changedFilesSet.has(F.resolvedPath) || $W(
- s,
- F.resolvedPath,
- I
- );
- }), E.assert(!s.seenAffectedFiles || !s.seenAffectedFiles.size), s.seenAffectedFiles = s.seenAffectedFiles || /* @__PURE__ */ new Set()), s.buildInfoEmitPending = !0);
- }
- return _ && s.semanticDiagnosticsPerFile.size !== s.fileInfos.size && t.checkPending !== s.checkPending && (s.buildInfoEmitPending = !0), s;
- function P(I) {
- s.changedFilesSet.add(I), c && (d = !1, h = !1, s.semanticDiagnosticsFromOldState = void 0, s.semanticDiagnosticsPerFile.clear(), s.emitDiagnosticsPerFile = void 0), s.buildInfoEmitPending = !0, s.programEmitPending = void 0;
- }
- }
- function A1e(e, t, n) {
- return !!e.declarationMap == !!t.declarationMap ? (
- // Use same format of signature
- n
- ) : (
- // Convert to different format
- _s(n) ? [n] : n[0]
- );
- }
- function N1e(e, t) {
- return e.length ? qc(e, (n) => {
- if (_s(n.messageText)) return n;
- const i = Gne(n.messageText, n.file, t, (s) => {
- var o;
- return (o = s.repopulateInfo) == null ? void 0 : o.call(s);
- });
- return i === n.messageText ? n : { ...n, messageText: i };
- }) : e;
- }
- function Gne(e, t, n, i) {
- const s = i(e);
- if (s === !0)
- return {
- ...Fj(t),
- next: $ne(e.next, t, n, i)
- };
- if (s)
- return {
- ...n7(t, n, s.moduleReference, s.mode, s.packageName || s.moduleReference),
- next: $ne(e.next, t, n, i)
- };
- const o = $ne(e.next, t, n, i);
- return o === e.next ? e : { ...e, next: o };
- }
- function $ne(e, t, n, i) {
- return qc(e, (s) => Gne(s, t, n, i));
- }
- function I1e(e, t, n) {
- if (!e.length) return Ue;
- let i;
- return e.map((o) => {
- const c = O1e(o, t, n, s);
- c.reportsUnnecessary = o.reportsUnnecessary, c.reportsDeprecated = o.reportDeprecated, c.source = o.source, c.skippedOn = o.skippedOn;
- const { relatedInformation: _ } = o;
- return c.relatedInformation = _ ? _.length ? _.map((u) => O1e(u, t, n, s)) : [] : void 0, c;
- });
- function s(o) {
- return i ?? (i = Xn(es(bv(n.getCompilerOptions()), n.getCurrentDirectory()))), uo(o, i, n.getCanonicalFileName);
- }
- }
- function O1e(e, t, n, i) {
- const { file: s } = e, o = s !== !1 ? n.getSourceFileByPath(s ? i(s) : t) : void 0;
- return {
- ...e,
- file: o,
- messageText: _s(e.messageText) ? e.messageText : Gne(e.messageText, o, n, (c) => c.info)
- };
- }
- function BRe(e) {
- Ld.releaseCache(e), e.program = void 0;
- }
- function Xne(e, t) {
- E.assert(!t || !e.affectedFiles || e.affectedFiles[e.affectedFilesIndex - 1] !== t || !e.semanticDiagnosticsPerFile.has(t.resolvedPath));
- }
- function F1e(e, t, n) {
- for (var i; ; ) {
- const { affectedFiles: s } = e;
- if (s) {
- const _ = e.seenAffectedFiles;
- let u = e.affectedFilesIndex;
- for (; u < s.length; ) {
- const d = s[u];
- if (!_.has(d.resolvedPath))
- return e.affectedFilesIndex = u, $W(
- e,
- d.resolvedPath,
- e1(e.compilerOptions)
- ), WRe(
- e,
- d,
- t,
- n
- ), d;
- u++;
- }
- e.changedFilesSet.delete(e.currentChangedFilePath), e.currentChangedFilePath = void 0, (i = e.oldSignatures) == null || i.clear(), e.affectedFiles = void 0;
- }
- const o = e.changedFilesSet.keys().next();
- if (o.done)
- return;
- if (e.program.getCompilerOptions().outFile) return e.program;
- e.affectedFiles = Ld.getFilesAffectedByWithOldState(
- e,
- e.program,
- o.value,
- t,
- n
- ), e.currentChangedFilePath = o.value, e.affectedFilesIndex = 0, e.seenAffectedFiles || (e.seenAffectedFiles = /* @__PURE__ */ new Set());
- }
- }
- function L1e(e, t, n) {
- var i, s;
- if (!(!((i = e.affectedFilesPendingEmit) != null && i.size) && !e.programEmitPending) && (!t && !n && (e.affectedFilesPendingEmit = void 0, e.programEmitPending = void 0), (s = e.affectedFilesPendingEmit) == null || s.forEach((o, c) => {
- const _ = n ? o & 55 : o & 7;
- _ ? e.affectedFilesPendingEmit.set(c, _) : e.affectedFilesPendingEmit.delete(c);
- }), e.programEmitPending)) {
- const o = n ? e.programEmitPending & 55 : e.programEmitPending & 7;
- o ? e.programEmitPending = o : e.programEmitPending = void 0;
- }
- }
- function hF(e, t, n, i) {
- let s = gF(e, t);
- return n && (s = s & 56), i && (s = s & 8), s;
- }
- function VW(e) {
- return e ? 8 : 56;
- }
- function JRe(e, t, n) {
- var i;
- if ((i = e.affectedFilesPendingEmit) != null && i.size)
- return El(e.affectedFilesPendingEmit, (s, o) => {
- var c;
- const _ = e.program.getSourceFileByPath(o);
- if (!_ || !cS(_, e.program)) {
- e.affectedFilesPendingEmit.delete(o);
- return;
- }
- const u = (c = e.seenEmittedFiles) == null ? void 0 : c.get(_.resolvedPath), d = hF(
- s,
- u,
- t,
- n
- );
- if (d) return { affectedFile: _, emitKind: d };
- });
- }
- function zRe(e, t) {
- var n;
- if ((n = e.emitDiagnosticsPerFile) != null && n.size)
- return El(e.emitDiagnosticsPerFile, (i, s) => {
- var o;
- const c = e.program.getSourceFileByPath(s);
- if (!c || !cS(c, e.program)) {
- e.emitDiagnosticsPerFile.delete(s);
- return;
- }
- const _ = ((o = e.seenEmittedFiles) == null ? void 0 : o.get(c.resolvedPath)) || 0;
- if (!(_ & VW(t))) return { affectedFile: c, diagnostics: i, seenKind: _ };
- });
- }
- function M1e(e) {
- if (!e.cleanedDiagnosticsOfLibFiles) {
- e.cleanedDiagnosticsOfLibFiles = !0;
- const t = e.program.getCompilerOptions();
- ir(e.program.getSourceFiles(), (n) => e.program.isSourceFileDefaultLibrary(n) && !ree(n, t, e.program) && Yne(e, n.resolvedPath));
- }
- }
- function WRe(e, t, n, i) {
- if (Yne(e, t.resolvedPath), e.allFilesExcludingDefaultLibraryFile === e.affectedFiles) {
- M1e(e), Ld.updateShapeSignature(
- e,
- e.program,
- t,
- n,
- i
- );
- return;
- }
- e.compilerOptions.assumeChangesOnlyAffectDirectDependencies || URe(
- e,
- t,
- n,
- i
- );
- }
- function Qne(e, t, n, i, s) {
- if (Yne(e, t), !e.changedFilesSet.has(t)) {
- const o = e.program.getSourceFileByPath(t);
- o && (Ld.updateShapeSignature(
- e,
- e.program,
- o,
- i,
- s,
- /*useFileVersionAsSignature*/
- !0
- ), n ? $W(
- e,
- t,
- e1(e.compilerOptions)
- ) : P_(e.compilerOptions) && $W(
- e,
- t,
- e.compilerOptions.declarationMap ? 56 : 24
- /* Dts */
- ));
- }
- }
- function Yne(e, t) {
- return e.semanticDiagnosticsFromOldState ? (e.semanticDiagnosticsFromOldState.delete(t), e.semanticDiagnosticsPerFile.delete(t), !e.semanticDiagnosticsFromOldState.size) : !0;
- }
- function R1e(e, t) {
- const n = E.checkDefined(e.oldSignatures).get(t) || void 0;
- return E.checkDefined(e.fileInfos.get(t)).signature !== n;
- }
- function Zne(e, t, n, i, s) {
- var o;
- return (o = e.fileInfos.get(t)) != null && o.affectsGlobalScope ? (Ld.getAllFilesExcludingDefaultLibraryFile(
- e,
- e.program,
- /*firstSourceFile*/
- void 0
- ).forEach(
- (c) => Qne(
- e,
- c.resolvedPath,
- n,
- i,
- s
- )
- ), M1e(e), !0) : !1;
- }
- function URe(e, t, n, i) {
- var s, o;
- if (!e.referencedMap || !e.changedFilesSet.has(t.resolvedPath) || !R1e(e, t.resolvedPath)) return;
- if (Wp(e.compilerOptions)) {
- const u = /* @__PURE__ */ new Map();
- u.set(t.resolvedPath, !0);
- const d = Ld.getReferencedByPaths(e, t.resolvedPath);
- for (; d.length > 0; ) {
- const g = d.pop();
- if (!u.has(g)) {
- if (u.set(g, !0), Zne(
- e,
- g,
- /*invalidateJsFiles*/
- !1,
- n,
- i
- )) return;
- if (Qne(
- e,
- g,
- /*invalidateJsFiles*/
- !1,
- n,
- i
- ), R1e(e, g)) {
- const h = e.program.getSourceFileByPath(g);
- d.push(...Ld.getReferencedByPaths(e, h.resolvedPath));
- }
- }
- }
- }
- const c = /* @__PURE__ */ new Set(), _ = !!((s = t.symbol) != null && s.exports) && !!El(
- t.symbol.exports,
- (u) => {
- if (u.flags & 128) return !0;
- const d = Hl(u, e.program.getTypeChecker());
- return d === u ? !1 : (d.flags & 128) !== 0 && ut(d.declarations, (g) => Tr(g) === t);
- }
- );
- (o = e.referencedMap.getKeys(t.resolvedPath)) == null || o.forEach((u) => {
- if (Zne(e, u, _, n, i)) return !0;
- const d = e.referencedMap.getKeys(u);
- return d && Ch(d, (g) => j1e(
- e,
- g,
- _,
- c,
- n,
- i
- ));
- });
- }
- function j1e(e, t, n, i, s, o) {
- var c;
- if (Xm(i, t)) {
- if (Zne(e, t, n, s, o)) return !0;
- Qne(e, t, n, s, o), (c = e.referencedMap.getKeys(t)) == null || c.forEach(
- (_) => j1e(
- e,
- _,
- n,
- i,
- s,
- o
- )
- );
- }
- }
- function qW(e, t, n, i) {
- return e.compilerOptions.noCheck ? Ue : Qi(
- VRe(e, t, n, i),
- e.program.getProgramDiagnostics(t)
- );
- }
- function VRe(e, t, n, i) {
- i ?? (i = e.semanticDiagnosticsPerFile);
- const s = t.resolvedPath, o = i.get(s);
- if (o)
- return dF(o, e.compilerOptions);
- const c = e.program.getBindAndCheckDiagnostics(t, n);
- return i.set(s, c), e.buildInfoEmitPending = !0, dF(c, e.compilerOptions);
- }
- function Kne(e) {
- var t;
- return !!((t = e.options) != null && t.outFile);
- }
- function VA(e) {
- return !!e.fileNames;
- }
- function qRe(e) {
- return !VA(e) && !!e.root;
- }
- function B1e(e) {
- e.hasErrors === void 0 && (Nb(e.compilerOptions) ? e.hasErrors = !ut(e.program.getSourceFiles(), (t) => {
- var n, i;
- const s = e.semanticDiagnosticsPerFile.get(t.resolvedPath);
- return s === void 0 || // Missing semantic diagnostics in cache will be encoded in buildInfo
- !!s.length || // cached semantic diagnostics will be encoded in buildInfo
- !!((i = (n = e.emitDiagnosticsPerFile) == null ? void 0 : n.get(t.resolvedPath)) != null && i.length);
- }) && (J1e(e) || ut(e.program.getSourceFiles(), (t) => !!e.program.getProgramDiagnostics(t).length)) : e.hasErrors = ut(e.program.getSourceFiles(), (t) => {
- var n, i;
- const s = e.semanticDiagnosticsPerFile.get(t.resolvedPath);
- return !!s?.length || // If has semantic diagnostics
- !!((i = (n = e.emitDiagnosticsPerFile) == null ? void 0 : n.get(t.resolvedPath)) != null && i.length);
- }) || J1e(e));
- }
- function J1e(e) {
- return !!e.program.getConfigFileParsingDiagnostics().length || !!e.program.getSyntacticDiagnostics().length || !!e.program.getOptionsDiagnostics().length || !!e.program.getGlobalDiagnostics().length;
- }
- function z1e(e) {
- return B1e(e), e.buildInfoEmitPending ?? (e.buildInfoEmitPending = !!e.hasErrorsFromOldState != !!e.hasErrors);
- }
- function HRe(e) {
- var t, n;
- const i = e.program.getCurrentDirectory(), s = Xn(es(bv(e.compilerOptions), i)), o = e.latestChangedDtsFile ? F(e.latestChangedDtsFile) : void 0, c = [], _ = /* @__PURE__ */ new Map(), u = new Set(e.program.getRootFileNames().map((J) => uo(J, i, e.program.getCanonicalFileName)));
- if (B1e(e), !Nb(e.compilerOptions))
- return {
- root: as(u, (oe) => O(oe)),
- errors: e.hasErrors ? !0 : void 0,
- checkPending: e.checkPending,
- version: U_
- };
- const d = [];
- if (e.compilerOptions.outFile) {
- const J = as(e.fileInfos.entries(), ([_e, he]) => {
- const le = B(_e);
- return X(_e, le), he.impliedFormat ? { version: he.version, impliedFormat: he.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : he.version;
- });
- return {
- fileNames: c,
- fileInfos: J,
- root: d,
- resolvedRoot: q(),
- options: V(e.compilerOptions),
- semanticDiagnosticsPerFile: e.changedFilesSet.size ? void 0 : ee(),
- emitDiagnosticsPerFile: G(),
- changeFileSet: Se(),
- outSignature: e.outSignature,
- latestChangedDtsFile: o,
- pendingEmit: e.programEmitPending ? (
- // Pending is undefined or None is encoded as undefined
- e.programEmitPending === e1(e.compilerOptions) ? !1 : (
- // Pending emit is same as deteremined by compilerOptions
- e.programEmitPending
- )
- ) : void 0,
- // Actual value
- errors: e.hasErrors ? !0 : void 0,
- checkPending: e.checkPending,
- version: U_
- };
- }
- let g, h, S;
- const T = as(e.fileInfos.entries(), ([J, oe]) => {
- var _e, he;
- const le = B(J);
- X(J, le), E.assert(c[le - 1] === O(J));
- const me = (_e = e.oldSignatures) == null ? void 0 : _e.get(J), ve = me !== void 0 ? me || void 0 : oe.signature;
- if (e.compilerOptions.composite) {
- const tt = e.program.getSourceFileByPath(J);
- if (!Rp(tt) && cS(tt, e.program)) {
- const Te = (he = e.emitSignatures) == null ? void 0 : he.get(J);
- Te !== ve && (S = wr(
- S,
- Te === void 0 ? le : (
- // There is no emit, encode as false
- // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature
- [le, !_s(Te) && Te[0] === ve ? Ue : Te]
- )
- ));
- }
- }
- return oe.version === ve ? oe.affectsGlobalScope || oe.impliedFormat ? (
- // If file version is same as signature, dont serialize signature
- { version: oe.version, signature: void 0, affectsGlobalScope: oe.affectsGlobalScope, impliedFormat: oe.impliedFormat }
- ) : (
- // If file info only contains version and signature and both are same we can just write string
- oe.version
- ) : ve !== void 0 ? (
- // If signature is not same as version, encode signature in the fileInfo
- me === void 0 ? (
- // If we havent computed signature, use fileInfo as is
- oe
- ) : (
- // Serialize fileInfo with new updated signature
- { version: oe.version, signature: ve, affectsGlobalScope: oe.affectsGlobalScope, impliedFormat: oe.impliedFormat }
- )
- ) : (
- // Signature of the FileInfo is undefined, serialize it as false
- { version: oe.version, signature: !1, affectsGlobalScope: oe.affectsGlobalScope, impliedFormat: oe.impliedFormat }
- );
- });
- let C;
- (t = e.referencedMap) != null && t.size() && (C = as(e.referencedMap.keys()).sort(au).map((J) => [
- B(J),
- z(e.referencedMap.getValues(J))
- ]));
- const D = ee();
- let P;
- if ((n = e.affectedFilesPendingEmit) != null && n.size) {
- const J = e1(e.compilerOptions), oe = /* @__PURE__ */ new Set();
- for (const _e of as(e.affectedFilesPendingEmit.keys()).sort(au))
- if (Xm(oe, _e)) {
- const he = e.program.getSourceFileByPath(_e);
- if (!he || !cS(he, e.program)) continue;
- const le = B(_e), me = e.affectedFilesPendingEmit.get(_e);
- P = wr(
- P,
- me === J ? le : (
- // Pending full emit per options
- me === 24 ? [le] : (
- // Pending on Dts only
- [le, me]
- )
- )
- // Anything else
- );
- }
- }
- return {
- fileNames: c,
- fileIdsList: g,
- fileInfos: T,
- root: d,
- resolvedRoot: q(),
- options: V(e.compilerOptions),
- referencedMap: C,
- semanticDiagnosticsPerFile: D,
- emitDiagnosticsPerFile: G(),
- changeFileSet: Se(),
- affectedFilesPendingEmit: P,
- emitSignatures: S,
- latestChangedDtsFile: o,
- errors: e.hasErrors ? !0 : void 0,
- checkPending: e.checkPending,
- version: U_
- };
- function F(J) {
- return O(es(J, i));
- }
- function O(J) {
- return q2(ld(s, J, e.program.getCanonicalFileName));
- }
- function B(J) {
- let oe = _.get(J);
- return oe === void 0 && (c.push(O(J)), _.set(J, oe = c.length)), oe;
- }
- function z(J) {
- const oe = as(J.keys(), B).sort(ho), _e = oe.join();
- let he = h?.get(_e);
- return he === void 0 && (g = wr(g, oe), (h ?? (h = /* @__PURE__ */ new Map())).set(_e, he = g.length)), he;
- }
- function X(J, oe) {
- const _e = e.program.getSourceFile(J);
- if (!e.program.getFileIncludeReasons().get(_e.path).some(
- (ve) => ve.kind === 0
- /* RootFile */
- )) return;
- if (!d.length) return d.push(oe);
- const he = d[d.length - 1], le = us(he);
- if (le && he[1] === oe - 1) return he[1] = oe;
- if (le || d.length === 1 || he !== oe - 1) return d.push(oe);
- const me = d[d.length - 2];
- return !yy(me) || me !== he - 1 ? d.push(oe) : (d[d.length - 2] = [me, oe], d.length = d.length - 1);
- }
- function q() {
- let J;
- return u.forEach((oe) => {
- const _e = e.program.getSourceFileByPath(oe);
- _e && oe !== _e.resolvedPath && (J = wr(J, [B(_e.resolvedPath), B(oe)]));
- }), J;
- }
- function V(J) {
- let oe;
- const { optionsNameMap: _e } = i6();
- for (const he of rm(J).sort(au)) {
- const le = _e.get(he.toLowerCase());
- le?.affectsBuildInfo && ((oe || (oe = {}))[he] = ae(
- le,
- J[he]
- ));
- }
- return oe;
- }
- function ae(J, oe) {
- if (J) {
- if (E.assert(J.type !== "listOrElement"), J.type === "list") {
- const _e = oe;
- if (J.element.isFilePath && _e.length)
- return _e.map(F);
- } else if (J.isFilePath)
- return F(oe);
- }
- return oe;
- }
- function ee() {
- let J;
- return e.fileInfos.forEach((oe, _e) => {
- const he = e.semanticDiagnosticsPerFile.get(_e);
- he ? he.length && (J = wr(J, [
- B(_e),
- ue(he, _e)
- ])) : e.changedFilesSet.has(_e) || (J = wr(J, B(_e)));
- }), J;
- }
- function G() {
- var J;
- let oe;
- if (!((J = e.emitDiagnosticsPerFile) != null && J.size)) return oe;
- for (const _e of as(e.emitDiagnosticsPerFile.keys()).sort(au)) {
- const he = e.emitDiagnosticsPerFile.get(_e);
- oe = wr(oe, [
- B(_e),
- ue(he, _e)
- ]);
- }
- return oe;
- }
- function ue(J, oe) {
- return E.assert(!!J.length), J.map((_e) => {
- const he = re(_e, oe);
- he.reportsUnnecessary = _e.reportsUnnecessary, he.reportDeprecated = _e.reportsDeprecated, he.source = _e.source, he.skippedOn = _e.skippedOn;
- const { relatedInformation: le } = _e;
- return he.relatedInformation = le ? le.length ? le.map((me) => re(me, oe)) : [] : void 0, he;
- });
- }
- function re(J, oe) {
- const { file: _e } = J;
- return {
- ...J,
- file: _e ? _e.resolvedPath === oe ? void 0 : O(_e.resolvedPath) : !1,
- messageText: _s(J.messageText) ? J.messageText : ne(J.messageText)
- };
- }
- function ne(J) {
- if (J.repopulateInfo)
- return {
- info: J.repopulateInfo(),
- next: ie(J.next)
- };
- const oe = ie(J.next);
- return oe === J.next ? J : { ...J, next: oe };
- }
- function ie(J) {
- return J && (ir(J, (oe, _e) => {
- const he = ne(oe);
- if (oe === he) return;
- const le = _e > 0 ? J.slice(0, _e - 1) : [];
- le.push(he);
- for (let me = _e + 1; me < J.length; me++)
- le.push(ne(J[me]));
- return le;
- }) || J);
- }
- function Se() {
- let J;
- if (e.changedFilesSet.size)
- for (const oe of as(e.changedFilesSet.keys()).sort(au))
- J = wr(J, B(oe));
- return J;
- }
- }
- var eie = /* @__PURE__ */ ((e) => (e[e.SemanticDiagnosticsBuilderProgram = 0] = "SemanticDiagnosticsBuilderProgram", e[e.EmitAndSemanticDiagnosticsBuilderProgram = 1] = "EmitAndSemanticDiagnosticsBuilderProgram", e))(eie || {});
- function yF(e, t, n, i, s, o) {
- let c, _, u;
- return e === void 0 ? (E.assert(t === void 0), c = n, u = i, E.assert(!!u), _ = u.getProgram()) : us(e) ? (u = i, _ = WA({
- rootNames: e,
- options: t,
- host: n,
- oldProgram: u && u.getProgramOrUndefined(),
- configFileParsingDiagnostics: s,
- projectReferences: o
- }), c = n) : (_ = e, c = t, u = n, s = i), { host: c, newProgram: _, oldProgram: u, configFileParsingDiagnostics: s || Ue };
- }
- function W1e(e, t) {
- return t?.sourceMapUrlPos !== void 0 ? e.substring(0, t.sourceMapUrlPos) : e;
- }
- function HW(e, t, n, i, s) {
- var o;
- n = W1e(n, s);
- let c;
- return (o = s?.diagnostics) != null && o.length && (n += s.diagnostics.map((d) => `${u(d)}${SI[d.category]}${d.code}: ${_(d.messageText)}`).join(`
-`)), (i.createHash ?? WE)(n);
- function _(d) {
- return _s(d) ? d : d === void 0 ? "" : d.next ? d.messageText + d.next.map(_).join(`
-`) : d.messageText;
- }
- function u(d) {
- return d.file.resolvedPath === t.resolvedPath ? `(${d.start},${d.length})` : (c === void 0 && (c = Xn(t.resolvedPath)), `${q2(ld(
- c,
- d.file.resolvedPath,
- e.getCanonicalFileName
- ))}(${d.start},${d.length})`);
- }
- }
- function GRe(e, t, n) {
- return (t.createHash ?? WE)(W1e(e, n));
- }
- function GW(e, { newProgram: t, host: n, oldProgram: i, configFileParsingDiagnostics: s }) {
- let o = i && i.state;
- if (o && t === o.program && s === t.getConfigFileParsingDiagnostics())
- return t = void 0, o = void 0, i;
- const c = jRe(t, o);
- t.getBuildInfo = () => HRe(MRe(c)), t = void 0, i = void 0, o = void 0;
- const _ = QW(c, s);
- return _.state = c, _.hasChangedEmitSignature = () => !!c.hasChangedEmitSignature, _.getAllDependencies = (F) => Ld.getAllDependencies(
- c,
- E.checkDefined(c.program),
- F
- ), _.getSemanticDiagnostics = I, _.getDeclarationDiagnostics = D, _.emit = T, _.releaseProgram = () => BRe(c), e === 0 ? _.getSemanticDiagnosticsOfNextAffectedFile = P : e === 1 ? (_.getSemanticDiagnosticsOfNextAffectedFile = P, _.emitNextAffectedFile = h, _.emitBuildInfo = u) : Vs(), _;
- function u(F, O) {
- if (E.assert(h6(c)), z1e(c)) {
- const B = c.program.emitBuildInfo(
- F || Ms(n, n.writeFile),
- O
- );
- return c.buildInfoEmitPending = !1, B;
- }
- return zW;
- }
- function d(F, O, B, z, X) {
- var q, V, ae, ee;
- E.assert(h6(c));
- let G = F1e(c, O, n);
- const ue = e1(c.compilerOptions);
- let re = X ? 8 : B ? ue & 56 : ue;
- if (!G) {
- if (c.compilerOptions.outFile) {
- if (c.programEmitPending && (re = hF(
- c.programEmitPending,
- c.seenProgramEmit,
- B,
- X
- ), re && (G = c.program)), !G && ((q = c.emitDiagnosticsPerFile) != null && q.size)) {
- const Se = c.seenProgramEmit || 0;
- if (!(Se & VW(X))) {
- c.seenProgramEmit = VW(X) | Se;
- const J = [];
- return c.emitDiagnosticsPerFile.forEach((oe) => Fn(J, oe)), {
- result: { emitSkipped: !0, diagnostics: J },
- affected: c.program
- };
- }
- }
- } else {
- const Se = JRe(
- c,
- B,
- X
- );
- if (Se)
- ({ affectedFile: G, emitKind: re } = Se);
- else {
- const J = zRe(
- c,
- X
- );
- if (J)
- return (c.seenEmittedFiles ?? (c.seenEmittedFiles = /* @__PURE__ */ new Map())).set(
- J.affectedFile.resolvedPath,
- J.seenKind | VW(X)
- ), {
- result: { emitSkipped: !0, diagnostics: J.diagnostics },
- affected: J.affectedFile
- };
- }
- }
- if (!G) {
- if (X || !z1e(c)) return;
- const Se = c.program, J = Se.emitBuildInfo(
- F || Ms(n, n.writeFile),
- O
- );
- return c.buildInfoEmitPending = !1, { result: J, affected: Se };
- }
- }
- let ne;
- re & 7 && (ne = 0), re & 56 && (ne = ne === void 0 ? 1 : void 0);
- const ie = X ? {
- emitSkipped: !0,
- diagnostics: c.program.getDeclarationDiagnostics(
- G === c.program ? void 0 : G,
- O
- )
- } : c.program.emit(
- G === c.program ? void 0 : G,
- S(F, z),
- O,
- ne,
- z,
- /*forceDtsEmit*/
- void 0,
- /*skipBuildInfo*/
- !0
- );
- if (G !== c.program) {
- const Se = G;
- c.seenAffectedFiles.add(Se.resolvedPath), c.affectedFilesIndex !== void 0 && c.affectedFilesIndex++, c.buildInfoEmitPending = !0;
- const J = ((V = c.seenEmittedFiles) == null ? void 0 : V.get(Se.resolvedPath)) || 0;
- (c.seenEmittedFiles ?? (c.seenEmittedFiles = /* @__PURE__ */ new Map())).set(Se.resolvedPath, re | J);
- const oe = ((ae = c.affectedFilesPendingEmit) == null ? void 0 : ae.get(Se.resolvedPath)) || ue, _e = gF(oe, re | J);
- _e ? (c.affectedFilesPendingEmit ?? (c.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(Se.resolvedPath, _e) : (ee = c.affectedFilesPendingEmit) == null || ee.delete(Se.resolvedPath), ie.diagnostics.length && (c.emitDiagnosticsPerFile ?? (c.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(Se.resolvedPath, ie.diagnostics);
- } else
- c.changedFilesSet.clear(), c.programEmitPending = c.changedFilesSet.size ? gF(ue, re) : c.programEmitPending ? gF(c.programEmitPending, re) : void 0, c.seenProgramEmit = re | (c.seenProgramEmit || 0), g(ie.diagnostics), c.buildInfoEmitPending = !0;
- return { result: ie, affected: G };
- }
- function g(F) {
- let O;
- F.forEach((B) => {
- if (!B.file) return;
- let z = O?.get(B.file.resolvedPath);
- z || (O ?? (O = /* @__PURE__ */ new Map())).set(B.file.resolvedPath, z = []), z.push(B);
- }), O && (c.emitDiagnosticsPerFile = O);
- }
- function h(F, O, B, z) {
- return d(
- F,
- O,
- B,
- z,
- /*isForDtsErrors*/
- !1
- );
- }
- function S(F, O) {
- return E.assert(h6(c)), P_(c.compilerOptions) ? (B, z, X, q, V, ae) => {
- var ee, G, ue;
- if (wl(B))
- if (c.compilerOptions.outFile) {
- if (c.compilerOptions.composite) {
- const ne = re(
- c.outSignature,
- /*newSignature*/
- void 0
- );
- if (!ne) return ae.skippedDtsWrite = !0;
- c.outSignature = ne;
- }
- } else {
- E.assert(V?.length === 1);
- let ne;
- if (!O) {
- const ie = V[0], Se = c.fileInfos.get(ie.resolvedPath);
- if (Se.signature === ie.version) {
- const J = HW(
- c.program,
- ie,
- z,
- n,
- ae
- );
- (ee = ae?.diagnostics) != null && ee.length || (ne = J), J !== ie.version && (n.storeSignatureInfo && (c.signatureInfo ?? (c.signatureInfo = /* @__PURE__ */ new Map())).set(
- ie.resolvedPath,
- 1
- /* StoredSignatureAtEmit */
- ), c.affectedFiles && ((G = c.oldSignatures) == null ? void 0 : G.get(ie.resolvedPath)) === void 0 && (c.oldSignatures ?? (c.oldSignatures = /* @__PURE__ */ new Map())).set(ie.resolvedPath, Se.signature || !1), Se.signature = J);
- }
- }
- if (c.compilerOptions.composite) {
- const ie = V[0].resolvedPath;
- if (ne = re((ue = c.emitSignatures) == null ? void 0 : ue.get(ie), ne), !ne) return ae.skippedDtsWrite = !0;
- (c.emitSignatures ?? (c.emitSignatures = /* @__PURE__ */ new Map())).set(ie, ne);
- }
- }
- F ? F(B, z, X, q, V, ae) : n.writeFile ? n.writeFile(B, z, X, q, V, ae) : c.program.writeFile(B, z, X, q, V, ae);
- function re(ne, ie) {
- const Se = !ne || _s(ne) ? ne : ne[0];
- if (ie ?? (ie = GRe(z, n, ae)), ie === Se) {
- if (ne === Se) return;
- ae ? ae.differsOnlyInMap = !0 : ae = { differsOnlyInMap: !0 };
- } else
- c.hasChangedEmitSignature = !0, c.latestChangedDtsFile = B;
- return ie;
- }
- } : F || Ms(n, n.writeFile);
- }
- function T(F, O, B, z, X) {
- E.assert(h6(c)), e === 1 && Xne(c, F);
- const q = WW(_, F, O, B);
- if (q) return q;
- if (!F)
- if (e === 1) {
- let ae = [], ee = !1, G, ue = [], re;
- for (; re = h(
- O,
- B,
- z,
- X
- ); )
- ee = ee || re.result.emitSkipped, G = Fn(G, re.result.diagnostics), ue = Fn(ue, re.result.emittedFiles), ae = Fn(ae, re.result.sourceMaps);
- return {
- emitSkipped: ee,
- diagnostics: G || Ue,
- emittedFiles: ue,
- sourceMaps: ae
- };
- } else
- L1e(
- c,
- z,
- /*isForDtsErrors*/
- !1
- );
- const V = c.program.emit(
- F,
- S(O, X),
- B,
- z,
- X
- );
- return C(
- F,
- z,
- /*isForDtsErrors*/
- !1,
- V.diagnostics
- ), V;
- }
- function C(F, O, B, z) {
- !F && e !== 1 && (L1e(c, O, B), g(z));
- }
- function D(F, O) {
- var B;
- if (E.assert(h6(c)), e === 1) {
- Xne(c, F);
- let z, X;
- for (; z = d(
- /*writeFile*/
- void 0,
- O,
- /*emitOnlyDtsFiles*/
- void 0,
- /*customTransformers*/
- void 0,
- /*isForDtsErrors*/
- !0
- ); )
- F || (X = Fn(X, z.result.diagnostics));
- return (F ? (B = c.emitDiagnosticsPerFile) == null ? void 0 : B.get(F.resolvedPath) : X) || Ue;
- } else {
- const z = c.program.getDeclarationDiagnostics(F, O);
- return C(
- F,
- /*emitOnlyDtsFiles*/
- void 0,
- /*isForDtsErrors*/
- !0,
- z
- ), z;
- }
- }
- function P(F, O) {
- for (E.assert(h6(c)); ; ) {
- const B = F1e(c, F, n);
- let z;
- if (B)
- if (B !== c.program) {
- const X = B;
- if ((!O || !O(X)) && (z = qW(c, X, F)), c.seenAffectedFiles.add(X.resolvedPath), c.affectedFilesIndex++, c.buildInfoEmitPending = !0, !z) continue;
- } else {
- let X;
- const q = /* @__PURE__ */ new Map();
- c.program.getSourceFiles().forEach(
- (V) => X = Fn(
- X,
- qW(
- c,
- V,
- F,
- q
- )
- )
- ), c.semanticDiagnosticsPerFile = q, z = X || Ue, c.changedFilesSet.clear(), c.programEmitPending = e1(c.compilerOptions), c.compilerOptions.noCheck || (c.checkPending = void 0), c.buildInfoEmitPending = !0;
- }
- else {
- c.checkPending && !c.compilerOptions.noCheck && (c.checkPending = void 0, c.buildInfoEmitPending = !0);
- return;
- }
- return { result: z, affected: B };
- }
- }
- function I(F, O) {
- if (E.assert(h6(c)), Xne(c, F), F)
- return qW(c, F, O);
- for (; ; ) {
- const z = P(O);
- if (!z) break;
- if (z.affected === c.program) return z.result;
- }
- let B;
- for (const z of c.program.getSourceFiles())
- B = Fn(B, qW(c, z, O));
- return c.checkPending && !c.compilerOptions.noCheck && (c.checkPending = void 0, c.buildInfoEmitPending = !0), B || Ue;
- }
- }
- function $W(e, t, n) {
- var i, s;
- const o = ((i = e.affectedFilesPendingEmit) == null ? void 0 : i.get(t)) || 0;
- (e.affectedFilesPendingEmit ?? (e.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(t, o | n), (s = e.emitDiagnosticsPerFile) == null || s.delete(t);
- }
- function tie(e) {
- return _s(e) ? { version: e, signature: e, affectsGlobalScope: void 0, impliedFormat: void 0 } : _s(e.signature) ? e : { version: e.version, signature: e.signature === !1 ? void 0 : e.version, affectsGlobalScope: e.affectsGlobalScope, impliedFormat: e.impliedFormat };
- }
- function rie(e, t) {
- return yy(e) ? t : e[1] || 24;
- }
- function nie(e, t) {
- return e || e1(t || {});
- }
- function iie(e, t, n) {
- var i, s, o, c;
- const _ = Xn(es(t, n.getCurrentDirectory())), u = zl(n.useCaseSensitiveFileNames());
- let d;
- const g = (i = e.fileNames) == null ? void 0 : i.map(D);
- let h;
- const S = e.latestChangedDtsFile ? P(e.latestChangedDtsFile) : void 0, T = /* @__PURE__ */ new Map(), C = new Set(lr(e.changeFileSet, I));
- if (Kne(e))
- e.fileInfos.forEach((X, q) => {
- const V = I(q + 1);
- T.set(V, _s(X) ? { version: X, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : X);
- }), d = {
- fileInfos: T,
- compilerOptions: e.options ? kO(e.options, P) : {},
- semanticDiagnosticsPerFile: B(e.semanticDiagnosticsPerFile),
- emitDiagnosticsPerFile: z(e.emitDiagnosticsPerFile),
- hasReusableDiagnostic: !0,
- changedFilesSet: C,
- latestChangedDtsFile: S,
- outSignature: e.outSignature,
- programEmitPending: e.pendingEmit === void 0 ? void 0 : nie(e.pendingEmit, e.options),
- hasErrors: e.errors,
- checkPending: e.checkPending
- };
- else {
- h = (s = e.fileIdsList) == null ? void 0 : s.map((V) => new Set(V.map(I)));
- const X = (o = e.options) != null && o.composite && !e.options.outFile ? /* @__PURE__ */ new Map() : void 0;
- e.fileInfos.forEach((V, ae) => {
- const ee = I(ae + 1), G = tie(V);
- T.set(ee, G), X && G.signature && X.set(ee, G.signature);
- }), (c = e.emitSignatures) == null || c.forEach((V) => {
- if (yy(V)) X.delete(I(V));
- else {
- const ae = I(V[0]);
- X.set(
- ae,
- !_s(V[1]) && !V[1].length ? (
- // File signature is emit signature but differs in map
- [X.get(ae)]
- ) : V[1]
- );
- }
- });
- const q = e.affectedFilesPendingEmit ? e1(e.options || {}) : void 0;
- d = {
- fileInfos: T,
- compilerOptions: e.options ? kO(e.options, P) : {},
- referencedMap: O(e.referencedMap, e.options ?? {}),
- semanticDiagnosticsPerFile: B(e.semanticDiagnosticsPerFile),
- emitDiagnosticsPerFile: z(e.emitDiagnosticsPerFile),
- hasReusableDiagnostic: !0,
- changedFilesSet: C,
- affectedFilesPendingEmit: e.affectedFilesPendingEmit && Yk(e.affectedFilesPendingEmit, (V) => I(yy(V) ? V : V[0]), (V) => rie(V, q)),
- latestChangedDtsFile: S,
- emitSignatures: X?.size ? X : void 0,
- hasErrors: e.errors,
- checkPending: e.checkPending
- };
- }
- return {
- state: d,
- getProgram: Vs,
- getProgramOrUndefined: lb,
- releaseProgram: ja,
- getCompilerOptions: () => d.compilerOptions,
- getSourceFile: Vs,
- getSourceFiles: Vs,
- getOptionsDiagnostics: Vs,
- getGlobalDiagnostics: Vs,
- getConfigFileParsingDiagnostics: Vs,
- getSyntacticDiagnostics: Vs,
- getDeclarationDiagnostics: Vs,
- getSemanticDiagnostics: Vs,
- emit: Vs,
- getAllDependencies: Vs,
- getCurrentDirectory: Vs,
- emitNextAffectedFile: Vs,
- getSemanticDiagnosticsOfNextAffectedFile: Vs,
- emitBuildInfo: Vs,
- close: ja,
- hasChangedEmitSignature: nm
- };
- function D(X) {
- return uo(X, _, u);
- }
- function P(X) {
- return es(X, _);
- }
- function I(X) {
- return g[X - 1];
- }
- function F(X) {
- return h[X - 1];
- }
- function O(X, q) {
- const V = Ld.createReferencedMap(q);
- return !V || !X || X.forEach(([ae, ee]) => V.set(I(ae), F(ee))), V;
- }
- function B(X) {
- const q = new Map(
- dy(
- T.keys(),
- (V) => C.has(V) ? void 0 : [V, Ue]
- )
- );
- return X?.forEach((V) => {
- yy(V) ? q.delete(I(V)) : q.set(I(V[0]), V[1]);
- }), q;
- }
- function z(X) {
- return X && Yk(X, (q) => I(q[0]), (q) => q[1]);
- }
- }
- function XW(e, t, n) {
- const i = Xn(es(t, n.getCurrentDirectory())), s = zl(n.useCaseSensitiveFileNames()), o = /* @__PURE__ */ new Map();
- let c = 0;
- const _ = /* @__PURE__ */ new Map(), u = new Map(e.resolvedRoot);
- return e.fileInfos.forEach((g, h) => {
- const S = uo(e.fileNames[h], i, s), T = _s(g) ? g : g.version;
- if (o.set(S, T), c < e.root.length) {
- const C = e.root[c], D = h + 1;
- us(C) ? C[0] <= D && D <= C[1] && (d(D, S), C[1] === D && c++) : C === D && (d(D, S), c++);
- }
- }), { fileInfos: o, roots: _ };
- function d(g, h) {
- const S = u.get(g);
- S ? _.set(uo(e.fileNames[S - 1], i, s), h) : _.set(h, void 0);
- }
- }
- function sie(e, t, n) {
- if (!qRe(e)) return;
- const i = Xn(es(t, n.getCurrentDirectory())), s = zl(n.useCaseSensitiveFileNames());
- return e.root.map((o) => uo(o, i, s));
- }
- function QW(e, t) {
- return {
- state: void 0,
- getProgram: n,
- getProgramOrUndefined: () => e.program,
- releaseProgram: () => e.program = void 0,
- getCompilerOptions: () => e.compilerOptions,
- getSourceFile: (i) => n().getSourceFile(i),
- getSourceFiles: () => n().getSourceFiles(),
- getOptionsDiagnostics: (i) => n().getOptionsDiagnostics(i),
- getGlobalDiagnostics: (i) => n().getGlobalDiagnostics(i),
- getConfigFileParsingDiagnostics: () => t,
- getSyntacticDiagnostics: (i, s) => n().getSyntacticDiagnostics(i, s),
- getDeclarationDiagnostics: (i, s) => n().getDeclarationDiagnostics(i, s),
- getSemanticDiagnostics: (i, s) => n().getSemanticDiagnostics(i, s),
- emit: (i, s, o, c, _) => n().emit(i, s, o, c, _),
- emitBuildInfo: (i, s) => n().emitBuildInfo(i, s),
- getAllDependencies: Vs,
- getCurrentDirectory: () => n().getCurrentDirectory(),
- close: ja
- };
- function n() {
- return E.checkDefined(e.program);
- }
- }
- function U1e(e, t, n, i, s, o) {
- return GW(
- 0,
- yF(
- e,
- t,
- n,
- i,
- s,
- o
- )
- );
- }
- function YW(e, t, n, i, s, o) {
- return GW(
- 1,
- yF(
- e,
- t,
- n,
- i,
- s,
- o
- )
- );
- }
- function V1e(e, t, n, i, s, o) {
- const { newProgram: c, configFileParsingDiagnostics: _ } = yF(
- e,
- t,
- n,
- i,
- s,
- o
- );
- return QW(
- { program: c, compilerOptions: c.getCompilerOptions() },
- _
- );
- }
- function vF(e) {
- return Zo(e, "/node_modules/.staging") ? eC(e, "/.staging") : ut(kI, (t) => e.includes(t)) ? void 0 : e;
- }
- function aie(e, t) {
- if (t <= 1) return 1;
- let n = 1, i = e[0].search(/[a-z]:/i) === 0;
- if (e[0] !== Vo && !i && // Non dos style paths
- e[1].search(/[a-z]\$$/i) === 0) {
- if (t === 2) return 2;
- n = 2, i = !0;
- }
- return i && !e[n].match(/^users$/i) ? n : e[n].match(/^workspaces$/i) ? n + 1 : n + 2;
- }
- function bF(e, t) {
- if (t === void 0 && (t = e.length), t <= 2) return !1;
- const n = aie(e, t);
- return t > n + 1;
- }
- function oie(e) {
- return H1e(Xn(e));
- }
- function q1e(e, t) {
- if (t.length < t.length) return !1;
- for (let n = 0; n < e.length; n++)
- if (t[n] !== e[n]) return !1;
- return !0;
- }
- function H1e(e) {
- return bF(Cl(e));
- }
- function cie(e) {
- return H1e(e);
- }
- function ZW(e, t, n, i, s, o, c) {
- const _ = Cl(t);
- e = H_(e) ? Os(e) : es(e, o());
- const u = Cl(e), d = aie(_, _.length);
- if (_.length <= d + 1) return;
- const g = _.indexOf("node_modules");
- if (g !== -1 && g + 1 <= d + 1) return;
- const h = _.lastIndexOf("node_modules");
- return q1e(s, _) ? _.length > s.length + 1 ? lie(
- u,
- _,
- Math.max(s.length + 1, d + 1),
- h
- ) : {
- dir: n,
- dirPath: i,
- nonRecursive: !0
- } : G1e(
- u,
- _,
- _.length - 1,
- d,
- g,
- s,
- h,
- c
- );
- }
- function G1e(e, t, n, i, s, o, c, _) {
- if (s !== -1)
- return lie(
- e,
- t,
- s + 1,
- c
- );
- let u = !0, d = n;
- if (!_) {
- for (let g = 0; g < n; g++)
- if (t[g] !== o[g]) {
- u = !1, d = Math.max(g + 1, i + 1);
- break;
- }
- }
- return lie(
- e,
- t,
- d,
- c,
- u
- );
- }
- function lie(e, t, n, i, s) {
- let o;
- return i !== -1 && i + 1 >= n && i + 2 < t.length && (Ui(t[i + 1], "@") ? i + 3 < t.length && (o = i + 3) : o = i + 2), {
- dir: p0(e, n),
- dirPath: p0(t, n),
- nonRecursive: s,
- packageDir: o !== void 0 ? p0(e, o) : void 0,
- packageDirPath: o !== void 0 ? p0(t, o) : void 0
- };
- }
- function uie(e, t, n, i, s, o, c) {
- const _ = Cl(t);
- if (q1e(i, _))
- return n;
- e = H_(e) ? Os(e) : es(e, s());
- const u = G1e(
- Cl(e),
- _,
- _.length,
- aie(_, _.length),
- _.indexOf("node_modules"),
- i,
- _.lastIndexOf("node_modules"),
- o
- );
- return u && c(u.dirPath) ? u.dirPath : void 0;
- }
- function _ie(e, t) {
- const n = es(e, t());
- return QR(n) ? n : W1(n);
- }
- function SF(e) {
- var t;
- return ((t = e.getCompilerHost) == null ? void 0 : t.call(e)) || e;
- }
- function fie(e, t, n, i, s) {
- return {
- nameAndMode: cF,
- resolve: (o, c) => $Re(
- i,
- s,
- o,
- e,
- n,
- t,
- c
- )
- };
- }
- function $Re(e, t, n, i, s, o, c) {
- const _ = SF(e), u = Vx(n, i, s, _, t, o, c);
- if (!e.getGlobalCache)
- return u;
- const d = e.getGlobalCache();
- if (d !== void 0 && !Sl(n) && !(u.resolvedModule && C5(u.resolvedModule.extension))) {
- const { resolvedModule: g, failedLookupLocations: h, affectingLocations: S, resolutionDiagnostics: T } = Cre(
- E.checkDefined(e.globalCacheResolutionModuleName)(n),
- e.projectName,
- s,
- _,
- d,
- t
- );
- if (g)
- return u.resolvedModule = g, u.failedLookupLocations = s6(u.failedLookupLocations, h), u.affectingLocations = s6(u.affectingLocations, S), u.resolutionDiagnostics = s6(u.resolutionDiagnostics, T), u;
- }
- return u;
- }
- function KW(e, t, n) {
- let i, s, o;
- const c = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
- let h = !1, S, T, C, D, P, I = !1;
- const F = Iu(() => e.getCurrentDirectory()), O = e.getCachedDirectoryStructureHost(), B = /* @__PURE__ */ new Map(), z = o6(
- F(),
- e.getCanonicalFileName,
- e.getCompilationSettings()
- ), X = /* @__PURE__ */ new Map(), q = OO(
- F(),
- e.getCanonicalFileName,
- e.getCompilationSettings(),
- z.getPackageJsonInfoCache(),
- z.optionsToRedirectsKey
- ), V = /* @__PURE__ */ new Map(), ae = o6(
- F(),
- e.getCanonicalFileName,
- Fz(e.getCompilationSettings()),
- z.getPackageJsonInfoCache()
- ), ee = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), ue = _ie(t, F), re = e.toPath(ue), ne = Cl(re), ie = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
- return {
- rootDirForResolution: t,
- resolvedModuleNames: B,
- resolvedTypeReferenceDirectives: X,
- resolvedLibraries: V,
- resolvedFileToResolution: d,
- resolutionsWithFailedLookups: _,
- resolutionsWithOnlyAffectingLocations: u,
- directoryWatchesOfFailedLookups: ee,
- fileWatchesOfAffectingLocations: G,
- packageDirWatchers: Se,
- dirPathToSymlinkPackageRefCount: J,
- watchFailedLookupLocationsOfExternalModuleResolutions: Nt,
- getModuleResolutionCache: () => z,
- startRecordingFilesWithChangedResolutions: le,
- finishRecordingFilesWithChangedResolutions: me,
- // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
- // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)
- startCachingPerDirectoryResolution: Te,
- finishCachingPerDirectoryResolution: fe,
- resolveModuleNameLiterals: Wt,
- resolveTypeReferenceDirectiveReferences: ft,
- resolveLibrary: _r,
- resolveSingleModuleNameWithoutWatching: Ir,
- removeResolutionsFromProjectReferenceRedirects: ti,
- removeResolutionsOfFile: qn,
- hasChangedAutomaticTypeDirectiveNames: () => h,
- invalidateResolutionOfFile: Ws,
- invalidateResolutionsOfFailedLookupLocations: Xe,
- setFilesWithInvalidatedNonRelativeUnresolvedImports: Hs,
- createHasInvalidatedResolutions: tt,
- isFileWithInvalidatedNonRelativeUnresolvedImports: ve,
- updateTypeRootsWatch: Ve,
- closeTypeRootsWatch: K,
- clear: _e,
- onChangesAffectModuleResolution: he
- };
- function _e() {
- D_(ee, mp), D_(G, mp), ie.clear(), Se.clear(), J.clear(), c.clear(), K(), B.clear(), X.clear(), d.clear(), _.clear(), u.clear(), C = void 0, D = void 0, P = void 0, T = void 0, S = void 0, I = !1, z.clear(), q.clear(), z.update(e.getCompilationSettings()), q.update(e.getCompilationSettings()), ae.clear(), g.clear(), V.clear(), h = !1;
- }
- function he() {
- I = !0, z.clearAllExceptPackageJsonInfoCache(), q.clearAllExceptPackageJsonInfoCache(), z.update(e.getCompilationSettings()), q.update(e.getCompilationSettings());
- }
- function le() {
- i = [];
- }
- function me() {
- const xe = i;
- return i = void 0, xe;
- }
- function ve(xe) {
- if (!o)
- return !1;
- const at = o.get(xe);
- return !!at && !!at.length;
- }
- function tt(xe, at) {
- Xe();
- const $e = s;
- return s = void 0, {
- hasInvalidatedResolutions: (bt) => xe(bt) || I || !!$e?.has(bt) || ve(bt),
- hasInvalidatedLibResolutions: (bt) => {
- var He;
- return at(bt) || !!((He = V?.get(bt)) != null && He.isInvalidated);
- }
- };
- }
- function Te() {
- z.isReadonly = void 0, q.isReadonly = void 0, ae.isReadonly = void 0, z.getPackageJsonInfoCache().isReadonly = void 0, z.clearAllExceptPackageJsonInfoCache(), q.clearAllExceptPackageJsonInfoCache(), ae.clearAllExceptPackageJsonInfoCache(), rs(), ie.clear();
- }
- function we(xe) {
- V.forEach((at, $e) => {
- var bt;
- (bt = xe?.resolvedLibReferences) != null && bt.has($e) || (Fe(
- at,
- e.toPath(_F(e.getCompilationSettings(), F(), $e)),
- HT
- ), V.delete($e));
- });
- }
- function fe(xe, at) {
- o = void 0, I = !1, rs(), xe !== at && (we(xe), xe?.getSourceFiles().forEach(($e) => {
- var bt;
- const He = ((bt = $e.packageJsonLocations) == null ? void 0 : bt.length) ?? 0, Vt = g.get($e.resolvedPath) ?? Ue;
- for (let Zt = Vt.length; Zt < He; Zt++)
- zn(
- $e.packageJsonLocations[Zt],
- /*forResolution*/
- !1
- );
- if (Vt.length > He)
- for (let Zt = He; Zt < Vt.length; Zt++)
- G.get(Vt[Zt]).files--;
- He ? g.set($e.resolvedPath, $e.packageJsonLocations) : g.delete($e.resolvedPath);
- }), g.forEach(($e, bt) => {
- const He = xe?.getSourceFileByPath(bt);
- (!He || He.resolvedPath !== bt) && ($e.forEach((Vt) => G.get(Vt).files--), g.delete(bt));
- })), ee.forEach(Qe), G.forEach(et), Se.forEach(Me), h = !1, z.isReadonly = !0, q.isReadonly = !0, ae.isReadonly = !0, z.getPackageJsonInfoCache().isReadonly = !0, ie.clear();
- }
- function Me(xe, at) {
- xe.dirPathToWatcher.size === 0 && Se.delete(at);
- }
- function Qe(xe, at) {
- xe.refCount === 0 && (ee.delete(at), xe.watcher.close());
- }
- function et(xe, at) {
- var $e;
- xe.files === 0 && xe.resolutions === 0 && !(($e = xe.symlinks) != null && $e.size) && (G.delete(at), xe.watcher.close());
- }
- function Re({
- entries: xe,
- containingFile: at,
- containingSourceFile: $e,
- redirectedReference: bt,
- options: He,
- perFileCache: Vt,
- reusedNames: Zt,
- loader: vn,
- getResolutionWithResolvedFileName: M,
- deferWatchingNonRelativeResolution: Ae,
- shouldRetryResolution: dt,
- logChanges: U
- }) {
- const be = e.toPath(at), Z = Vt.get(be) || Vt.set(be, a6()).get(be), ht = [], Le = U && ve(be), Ie = e.getCurrentProgram(), At = Ie && Ie.getResolvedProjectReferenceToRedirect(at), Dr = At ? !bt || bt.sourceFile.path !== At.sourceFile.path : !!bt, yr = a6();
- for (const nt of xe) {
- const ot = vn.nameAndMode.getName(nt), wt = vn.nameAndMode.getMode(nt, $e, bt?.commandLine.options || He);
- let jt = Z.get(ot, wt);
- if (!yr.has(ot, wt) && (I || Dr || !jt || jt.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
- Le && !Sl(ot) && dt(jt))) {
- const Xt = jt;
- jt = vn.resolve(ot, wt), e.onDiscoveredSymlink && XRe(jt) && e.onDiscoveredSymlink(), Z.set(ot, wt, jt), jt !== Xt && (Nt(ot, jt, be, M, Ae), Xt && Fe(Xt, be, M)), U && i && !$r(Xt, jt) && (i.push(be), U = !1);
- } else {
- const Xt = SF(e);
- if (Xy(He, Xt) && !yr.has(ot, wt)) {
- const Ht = M(jt);
- Zi(
- Xt,
- Vt === B ? Ht?.resolvedFileName ? Ht.packageId ? p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved : Ht?.resolvedFileName ? Ht.packageId ? p.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : p.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,
- ot,
- at,
- Ht?.resolvedFileName,
- Ht?.packageId && Q1(Ht.packageId)
- );
- }
- }
- E.assert(jt !== void 0 && !jt.isInvalidated), yr.set(ot, wt, !0), ht.push(jt);
- }
- return Zt?.forEach(
- (nt) => yr.set(
- vn.nameAndMode.getName(nt),
- vn.nameAndMode.getMode(nt, $e, bt?.commandLine.options || He),
- !0
- )
- ), Z.size() !== yr.size() && Z.forEach((nt, ot, wt) => {
- yr.has(ot, wt) || (Fe(nt, be, M), Z.delete(ot, wt));
- }), ht;
- function $r(nt, ot) {
- if (nt === ot)
- return !0;
- if (!nt || !ot)
- return !1;
- const wt = M(nt), jt = M(ot);
- return wt === jt ? !0 : !wt || !jt ? !1 : wt.resolvedFileName === jt.resolvedFileName;
- }
- }
- function ft(xe, at, $e, bt, He, Vt) {
- return Re({
- entries: xe,
- containingFile: at,
- containingSourceFile: He,
- redirectedReference: $e,
- options: bt,
- reusedNames: Vt,
- perFileCache: X,
- loader: lF(
- at,
- $e,
- bt,
- SF(e),
- q
- ),
- getResolutionWithResolvedFileName: r7,
- shouldRetryResolution: (Zt) => Zt.resolvedTypeReferenceDirective === void 0,
- deferWatchingNonRelativeResolution: !1
- });
- }
- function Wt(xe, at, $e, bt, He, Vt) {
- return Re({
- entries: xe,
- containingFile: at,
- containingSourceFile: He,
- redirectedReference: $e,
- options: bt,
- reusedNames: Vt,
- perFileCache: B,
- loader: fie(
- at,
- $e,
- bt,
- e,
- z
- ),
- getResolutionWithResolvedFileName: HT,
- shouldRetryResolution: (Zt) => !Zt.resolvedModule || !J4(Zt.resolvedModule.extension),
- logChanges: n,
- deferWatchingNonRelativeResolution: !0
- // Defer non relative resolution watch because we could be using ambient modules
- });
- }
- function _r(xe, at, $e, bt) {
- const He = SF(e);
- let Vt = V?.get(bt);
- if (!Vt || Vt.isInvalidated) {
- const Zt = Vt;
- Vt = FO(xe, at, $e, He, ae);
- const vn = e.toPath(at);
- Nt(
- xe,
- Vt,
- vn,
- HT,
- /*deferWatchingNonRelativeResolution*/
- !1
- ), V.set(bt, Vt), Zt && Fe(Zt, vn, HT);
- } else if (Xy($e, He)) {
- const Zt = HT(Vt);
- Zi(
- He,
- Zt?.resolvedFileName ? Zt.packageId ? p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : p.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,
- xe,
- at,
- Zt?.resolvedFileName,
- Zt?.packageId && Q1(Zt.packageId)
- );
- }
- return Vt;
- }
- function Ir(xe, at) {
- var $e, bt;
- const He = e.toPath(at), Vt = B.get(He), Zt = Vt?.get(
- xe,
- /*mode*/
- void 0
- );
- if (Zt && !Zt.isInvalidated) return Zt;
- const vn = ($e = e.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : $e.call(e, z), M = SF(e), Ae = Vx(
- xe,
- at,
- e.getCompilationSettings(),
- M,
- z
- );
- return (bt = e.afterResolveSingleModuleNameWithoutWatching) == null || bt.call(e, z, xe, at, Ae, vn), Ae;
- }
- function jr(xe) {
- return Zo(xe, "/node_modules/@types");
- }
- function Nt(xe, at, $e, bt, He) {
- if ((at.files ?? (at.files = /* @__PURE__ */ new Set())).add($e), at.files.size !== 1) return;
- !He || Sl(xe) ? Br(at) : c.add(at);
- const Vt = bt(at);
- if (Vt && Vt.resolvedFileName) {
- const Zt = e.toPath(Vt.resolvedFileName);
- let vn = d.get(Zt);
- vn || d.set(Zt, vn = /* @__PURE__ */ new Set()), vn.add(at);
- }
- }
- function Qt(xe, at) {
- const $e = e.toPath(xe), bt = ZW(
- xe,
- $e,
- ue,
- re,
- ne,
- F,
- e.preferNonRecursiveWatch
- );
- if (bt) {
- const { dir: He, dirPath: Vt, nonRecursive: Zt, packageDir: vn, packageDirPath: M } = bt;
- Vt === re ? (E.assert(Zt), E.assert(!vn), at = !0) : Ri(He, Vt, vn, M, Zt);
- }
- return at;
- }
- function Br(xe) {
- var at;
- E.assert(!!((at = xe.files) != null && at.size));
- const { failedLookupLocations: $e, affectingLocations: bt, alternateResult: He } = xe;
- if (!$e?.length && !bt?.length && !He) return;
- ($e?.length || He) && _.add(xe);
- let Vt = !1;
- if ($e)
- for (const Zt of $e)
- Vt = Qt(Zt, Vt);
- He && (Vt = Qt(He, Vt)), Vt && Ri(
- ue,
- re,
- /*packageDir*/
- void 0,
- /*packageDirPath*/
- void 0,
- /*nonRecursive*/
- !0
- ), xr(xe, !$e?.length && !He);
- }
- function xr(xe, at) {
- var $e;
- E.assert(!!(($e = xe.files) != null && $e.size));
- const { affectingLocations: bt } = xe;
- if (bt?.length) {
- at && u.add(xe);
- for (const He of bt)
- zn(
- He,
- /*forResolution*/
- !0
- );
- }
- }
- function zn(xe, at) {
- const $e = G.get(xe);
- if ($e) {
- at ? $e.resolutions++ : $e.files++;
- return;
- }
- let bt = xe, He = !1, Vt;
- e.realpath && (bt = e.realpath(xe), xe !== bt && (He = !0, Vt = G.get(bt)));
- const Zt = at ? 1 : 0, vn = at ? 0 : 1;
- if (!He || !Vt) {
- const M = {
- watcher: cie(e.toPath(bt)) ? e.watchAffectingFileLocation(bt, (Ae, dt) => {
- O?.addOrDeleteFile(Ae, e.toPath(bt), dt), ki(bt, z.getPackageJsonInfoCache().getInternalMap()), e.scheduleInvalidateResolutionsOfFailedLookupLocations();
- }) : JD,
- resolutions: He ? 0 : Zt,
- files: He ? 0 : vn,
- symlinks: void 0
- };
- G.set(bt, M), He && (Vt = M);
- }
- if (He) {
- E.assert(!!Vt);
- const M = {
- watcher: {
- close: () => {
- var Ae;
- const dt = G.get(bt);
- (Ae = dt?.symlinks) != null && Ae.delete(xe) && !dt.symlinks.size && !dt.resolutions && !dt.files && (G.delete(bt), dt.watcher.close());
- }
- },
- resolutions: Zt,
- files: vn,
- symlinks: void 0
- };
- G.set(xe, M), (Vt.symlinks ?? (Vt.symlinks = /* @__PURE__ */ new Set())).add(xe);
- }
- }
- function ki(xe, at) {
- var $e;
- const bt = G.get(xe);
- bt?.resolutions && (T ?? (T = /* @__PURE__ */ new Set())).add(xe), bt?.files && (S ?? (S = /* @__PURE__ */ new Set())).add(xe), ($e = bt?.symlinks) == null || $e.forEach((He) => ki(He, at)), at?.delete(e.toPath(xe));
- }
- function rs() {
- c.forEach(Br), c.clear();
- }
- function ei(xe, at, $e, bt, He) {
- E.assert(!He);
- let Vt = ie.get(bt), Zt = Se.get(bt);
- if (Vt === void 0) {
- const Ae = e.realpath($e);
- Vt = Ae !== $e && e.toPath(Ae) !== bt, ie.set(bt, Vt), Zt ? Zt.isSymlink !== Vt && (Zt.dirPathToWatcher.forEach((dt) => {
- Ot(Zt.isSymlink ? bt : at), dt.watcher = M();
- }), Zt.isSymlink = Vt) : Se.set(
- bt,
- Zt = {
- dirPathToWatcher: /* @__PURE__ */ new Map(),
- isSymlink: Vt
- }
- );
- } else
- E.assertIsDefined(Zt), E.assert(Vt === Zt.isSymlink);
- const vn = Zt.dirPathToWatcher.get(at);
- vn ? vn.refCount++ : (Zt.dirPathToWatcher.set(at, {
- watcher: M(),
- refCount: 1
- }), Vt && J.set(at, (J.get(at) ?? 0) + 1));
- function M() {
- return Vt ? Jr($e, bt, He) : Jr(xe, at, He);
- }
- }
- function Ri(xe, at, $e, bt, He) {
- !bt || !e.realpath ? Jr(xe, at, He) : ei(xe, at, $e, bt, He);
- }
- function Jr(xe, at, $e) {
- let bt = ee.get(at);
- return bt ? (E.assert(!!$e == !!bt.nonRecursive), bt.refCount++) : ee.set(at, bt = { watcher: Ar(xe, at, $e), refCount: 1, nonRecursive: $e }), bt;
- }
- function ji(xe, at) {
- const $e = e.toPath(xe), bt = ZW(
- xe,
- $e,
- ue,
- re,
- ne,
- F,
- e.preferNonRecursiveWatch
- );
- if (bt) {
- const { dirPath: He, packageDirPath: Vt } = bt;
- if (He === re)
- at = !0;
- else if (Vt && e.realpath) {
- const Zt = Se.get(Vt), vn = Zt.dirPathToWatcher.get(He);
- if (vn.refCount--, vn.refCount === 0 && (Ot(Zt.isSymlink ? Vt : He), Zt.dirPathToWatcher.delete(He), Zt.isSymlink)) {
- const M = J.get(He) - 1;
- M === 0 ? J.delete(He) : J.set(He, M);
- }
- } else
- Ot(He);
- }
- return at;
- }
- function Fe(xe, at, $e) {
- if (E.checkDefined(xe.files).delete(at), xe.files.size) return;
- xe.files = void 0;
- const bt = $e(xe);
- if (bt && bt.resolvedFileName) {
- const vn = e.toPath(bt.resolvedFileName), M = d.get(vn);
- M?.delete(xe) && !M.size && d.delete(vn);
- }
- const { failedLookupLocations: He, affectingLocations: Vt, alternateResult: Zt } = xe;
- if (_.delete(xe)) {
- let vn = !1;
- if (He)
- for (const M of He)
- vn = ji(M, vn);
- Zt && (vn = ji(Zt, vn)), vn && Ot(re);
- } else Vt?.length && u.delete(xe);
- if (Vt)
- for (const vn of Vt) {
- const M = G.get(vn);
- M.resolutions--;
- }
- }
- function Ot(xe) {
- const at = ee.get(xe);
- at.refCount--;
- }
- function Ar(xe, at, $e) {
- return e.watchDirectoryOfFailedLookupLocation(
- xe,
- (bt) => {
- const He = e.toPath(bt);
- O && O.addOrDeleteFileOrDirectory(bt, He), rr(He, at === He);
- },
- $e ? 0 : 1
- /* Recursive */
- );
- }
- function mn(xe, at, $e) {
- const bt = xe.get(at);
- bt && (bt.forEach(
- (He) => Fe(
- He,
- at,
- $e
- )
- ), xe.delete(at));
- }
- function ti(xe) {
- if (!qo(
- xe,
- ".json"
- /* Json */
- )) return;
- const at = e.getCurrentProgram();
- if (!at) return;
- const $e = at.getResolvedProjectReferenceByPath(xe);
- $e && $e.commandLine.fileNames.forEach((bt) => qn(e.toPath(bt)));
- }
- function qn(xe) {
- mn(B, xe, HT), mn(X, xe, r7);
- }
- function Oi(xe, at) {
- if (!xe) return !1;
- let $e = !1;
- return xe.forEach((bt) => {
- if (!(bt.isInvalidated || !at(bt))) {
- bt.isInvalidated = $e = !0;
- for (const He of E.checkDefined(bt.files))
- (s ?? (s = /* @__PURE__ */ new Set())).add(He), h = h || Zo(He, RD);
- }
- }), $e;
- }
- function Ws(xe) {
- qn(xe);
- const at = h;
- Oi(d.get(xe), B1) && h && !at && e.onChangedAutomaticTypeDirectiveNames();
- }
- function Hs(xe) {
- E.assert(o === xe || o === void 0), o = xe;
- }
- function rr(xe, at) {
- if (at)
- (P || (P = /* @__PURE__ */ new Set())).add(xe);
- else {
- const $e = vF(xe);
- if (!$e || (xe = $e, e.fileIsOpen(xe)))
- return !1;
- const bt = Xn(xe);
- if (jr(xe) || PI(xe) || jr(bt) || PI(bt))
- (C || (C = /* @__PURE__ */ new Set())).add(xe), (D || (D = /* @__PURE__ */ new Set())).add(xe);
- else {
- if (Fne(e.getCurrentProgram(), xe) || qo(xe, ".map"))
- return !1;
- (C || (C = /* @__PURE__ */ new Set())).add(xe);
- const He = kA(
- xe,
- /*isFolder*/
- !0
- );
- He && (D || (D = /* @__PURE__ */ new Set())).add(He);
- }
- }
- e.scheduleInvalidateResolutionsOfFailedLookupLocations();
- }
- function Ea() {
- const xe = z.getPackageJsonInfoCache().getInternalMap();
- xe && (C || D || P) && xe.forEach((at, $e) => te($e) ? xe.delete($e) : void 0);
- }
- function Xe() {
- var xe;
- if (I)
- return S = void 0, Ea(), (C || D || P || T) && Oi(V, Tt), C = void 0, D = void 0, P = void 0, T = void 0, !0;
- let at = !1;
- return S && ((xe = e.getCurrentProgram()) == null || xe.getSourceFiles().forEach(($e) => {
- ut($e.packageJsonLocations, (bt) => S.has(bt)) && ((s ?? (s = /* @__PURE__ */ new Set())).add($e.path), at = !0);
- }), S = void 0), !C && !D && !P && !T || (at = Oi(_, Tt) || at, Ea(), C = void 0, D = void 0, P = void 0, at = Oi(u, ze) || at, T = void 0), at;
- }
- function Tt(xe) {
- var at;
- return ze(xe) ? !0 : !C && !D && !P ? !1 : ((at = xe.failedLookupLocations) == null ? void 0 : at.some(($e) => te(e.toPath($e)))) || !!xe.alternateResult && te(e.toPath(xe.alternateResult));
- }
- function te(xe) {
- return C?.has(xe) || ew(D?.keys() || [], (at) => Ui(xe, at) ? !0 : void 0) || ew(P?.keys() || [], (at) => xe.length > at.length && Ui(xe, at) && (QR(at) || xe[at.length] === Vo) ? !0 : void 0);
- }
- function ze(xe) {
- var at;
- return !!T && ((at = xe.affectingLocations) == null ? void 0 : at.some(($e) => T.has($e)));
- }
- function K() {
- D_(oe, fd);
- }
- function De(xe) {
- return Ke(xe) ? e.watchTypeRootsDirectory(
- xe,
- (at) => {
- const $e = e.toPath(at);
- O && O.addOrDeleteFileOrDirectory(at, $e), h = !0, e.onChangedAutomaticTypeDirectiveNames();
- const bt = uie(
- xe,
- e.toPath(xe),
- re,
- ne,
- F,
- e.preferNonRecursiveWatch,
- (He) => ee.has(He) || J.has(He)
- );
- bt && rr($e, bt === $e);
- },
- 1
- /* Recursive */
- ) : JD;
- }
- function Ve() {
- const xe = e.getCompilationSettings();
- if (xe.types) {
- K();
- return;
- }
- const at = TD(xe, { getCurrentDirectory: F });
- at ? M4(
- oe,
- new Set(at),
- {
- createNewValue: De,
- onDeleteValue: fd
- }
- ) : K();
- }
- function Ke(xe) {
- return e.getCompilationSettings().typeRoots ? !0 : oie(e.toPath(xe));
- }
- }
- function XRe(e) {
- var t, n;
- return !!((t = e.resolvedModule) != null && t.originalPath || (n = e.resolvedTypeReferenceDirective) != null && n.originalPath);
- }
- var $1e = ll ? {
- getCurrentDirectory: () => ll.getCurrentDirectory(),
- getNewLine: () => ll.newLine,
- getCanonicalFileName: zl(ll.useCaseSensitiveFileNames)
- } : void 0;
- function $x(e, t) {
- const n = e === ll && $1e ? $1e : {
- getCurrentDirectory: () => e.getCurrentDirectory(),
- getNewLine: () => e.newLine,
- getCanonicalFileName: zl(e.useCaseSensitiveFileNames)
- };
- if (!t)
- return (s) => e.write(IW(s, n));
- const i = new Array(1);
- return (s) => {
- i[0] = s, e.write(zne(i, n) + n.getNewLine()), i[0] = void 0;
- };
- }
- function X1e(e, t, n) {
- return e.clearScreen && !n.preserveWatchOutput && !n.extendedDiagnostics && !n.diagnostics && ss(Q1e, t.code) ? (e.clearScreen(), !0) : !1;
- }
- var Q1e = [
- p.Starting_compilation_in_watch_mode.code,
- p.File_change_detected_Starting_incremental_compilation.code
- ];
- function QRe(e, t) {
- return ss(Q1e, e.code) ? t + t : t;
- }
- function qA(e) {
- return e.now ? (
- // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM.
- // This branch is solely for testing, so just switch it to a normal space for baseline stability.
- // See:
- // - https://github.com/nodejs/node/issues/45171
- // - https://github.com/nodejs/node/issues/45753
- e.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace(" ", " ")
- ) : (/* @__PURE__ */ new Date()).toLocaleTimeString();
- }
- function eU(e, t) {
- return t ? (n, i, s) => {
- X1e(e, n, s);
- let o = `[${Xb(
- qA(e),
- "\x1B[90m"
- /* Grey */
- )}] `;
- o += `${Em(n.messageText, e.newLine)}${i + i}`, e.write(o);
- } : (n, i, s) => {
- let o = "";
- X1e(e, n, s) || (o += i), o += `${qA(e)} - `, o += `${Em(n.messageText, e.newLine)}${QRe(n, i)}`, e.write(o);
- };
- }
- function pie(e, t, n, i, s, o) {
- const c = s;
- c.onUnRecoverableConfigFileDiagnostic = (u) => K1e(s, o, u);
- const _ = yA(e, t, c, n, i);
- return c.onUnRecoverableConfigFileDiagnostic = void 0, _;
- }
- function TF(e) {
- return py(
- e,
- (t) => t.category === 1
- /* Error */
- );
- }
- function xF(e) {
- return Ln(
- e,
- (n) => n.category === 1
- /* Error */
- ).map(
- (n) => {
- if (n.file !== void 0)
- return `${n.file.fileName}`;
- }
- ).map((n) => {
- if (n === void 0)
- return;
- const i = On(e, (s) => s.file !== void 0 && s.file.fileName === n);
- if (i !== void 0) {
- const { line: s } = Qs(i.file, i.start);
- return {
- fileName: n,
- line: s + 1
- };
- }
- });
- }
- function tU(e) {
- return e === 1 ? p.Found_1_error_Watching_for_file_changes : p.Found_0_errors_Watching_for_file_changes;
- }
- function Y1e(e, t) {
- const n = Xb(
- ":" + e.line,
- "\x1B[90m"
- /* Grey */
- );
- return UE(e.fileName) && UE(t) ? ld(
- t,
- e.fileName,
- /*ignoreCase*/
- !1
- ) + n : e.fileName + n;
- }
- function rU(e, t, n, i) {
- if (e === 0) return "";
- const s = t.filter((g) => g !== void 0), o = s.map((g) => `${g.fileName}:${g.line}`).filter((g, h, S) => S.indexOf(g) === h), c = s[0] && Y1e(s[0], i.getCurrentDirectory());
- let _;
- e === 1 ? _ = t[0] !== void 0 ? [p.Found_1_error_in_0, c] : [p.Found_1_error] : _ = o.length === 0 ? [p.Found_0_errors, e] : o.length === 1 ? [p.Found_0_errors_in_the_same_file_starting_at_Colon_1, e, c] : [p.Found_0_errors_in_1_files, e, o.length];
- const u = Go(..._), d = o.length > 1 ? YRe(s, i) : "";
- return `${n}${Em(u.messageText, n)}${n}${n}${d}`;
- }
- function YRe(e, t) {
- const n = e.filter((h, S, T) => S === T.findIndex((C) => C?.fileName === h?.fileName));
- if (n.length === 0) return "";
- const i = (h) => Math.log(h) * Math.LOG10E + 1, s = n.map((h) => [h, py(e, (S) => S.fileName === h.fileName)]), o = hR(s, 0, (h) => h[1]), c = p.Errors_Files.message, _ = c.split(" ")[0].length, u = Math.max(_, i(o)), d = Math.max(i(o) - _, 0);
- let g = "";
- return g += " ".repeat(d) + c + `
-`, s.forEach((h) => {
- const [S, T] = h, C = Math.log(T) * Math.LOG10E + 1 | 0, D = C < u ? " ".repeat(u - C) : "", P = Y1e(S, t.getCurrentDirectory());
- g += `${D}${T} ${P}
-`;
- }), g;
- }
- function nU(e) {
- return !!e.state;
- }
- function ZRe(e, t) {
- const n = e.getCompilerOptions();
- n.explainFiles ? iU(nU(e) ? e.getProgram() : e, t) : (n.listFiles || n.listFilesOnly) && ir(e.getSourceFiles(), (i) => {
- t(i.fileName);
- });
- }
- function iU(e, t) {
- var n, i;
- const s = e.getFileIncludeReasons(), o = (c) => VE(c, e.getCurrentDirectory(), e.getCanonicalFileName);
- for (const c of e.getSourceFiles())
- t(`${y6(c, o)}`), (n = s.get(c.path)) == null || n.forEach((_) => t(` ${cU(e, _, o).messageText}`)), (i = sU(c, e.getCompilerOptionsForFile(c), o)) == null || i.forEach((_) => t(` ${_.messageText}`));
- }
- function sU(e, t, n) {
- var i;
- let s;
- if (e.path !== e.resolvedPath && (s ?? (s = [])).push(vs(
- /*details*/
- void 0,
- p.File_is_output_of_project_reference_source_0,
- y6(e.originalFileName, n)
- )), e.redirectInfo && (s ?? (s = [])).push(vs(
- /*details*/
- void 0,
- p.File_redirects_to_file_0,
- y6(e.redirectInfo.redirectTarget, n)
- )), X_(e))
- switch (PS(e, t)) {
- case 99:
- e.packageJsonScope && (s ?? (s = [])).push(vs(
- /*details*/
- void 0,
- p.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,
- y6(_a(e.packageJsonLocations), n)
- ));
- break;
- case 1:
- e.packageJsonScope ? (s ?? (s = [])).push(vs(
- /*details*/
- void 0,
- e.packageJsonScope.contents.packageJsonContent.type ? p.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module : p.File_is_CommonJS_module_because_0_does_not_have_field_type,
- y6(_a(e.packageJsonLocations), n)
- )) : (i = e.packageJsonLocations) != null && i.length && (s ?? (s = [])).push(vs(
- /*details*/
- void 0,
- p.File_is_CommonJS_module_because_package_json_was_not_found
- ));
- break;
- }
- return s;
- }
- function aU(e, t) {
- var n;
- const i = e.getCompilerOptions().configFile;
- if (!((n = i?.configFileSpecs) != null && n.validatedFilesSpec)) return;
- const s = e.getCanonicalFileName(t), o = Xn(es(i.fileName, e.getCurrentDirectory())), c = ac(i.configFileSpecs.validatedFilesSpec, (_) => e.getCanonicalFileName(es(_, o)) === s);
- return c !== -1 ? i.configFileSpecs.validatedFilesSpecBeforeSubstitution[c] : void 0;
- }
- function oU(e, t) {
- var n, i;
- const s = e.getCompilerOptions().configFile;
- if (!((n = s?.configFileSpecs) != null && n.validatedIncludeSpecs)) return;
- if (s.configFileSpecs.isDefaultIncludeSpec) return !0;
- const o = qo(
- t,
- ".json"
- /* Json */
- ), c = Xn(es(s.fileName, e.getCurrentDirectory())), _ = e.useCaseSensitiveFileNames(), u = ac((i = s?.configFileSpecs) == null ? void 0 : i.validatedIncludeSpecs, (d) => {
- if (o && !Zo(
- d,
- ".json"
- /* Json */
- )) return !1;
- const g = GK(d, c, "files");
- return !!g && Jy(`(${g})$`, _).test(t);
- });
- return u !== -1 ? s.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[u] : void 0;
- }
- function cU(e, t, n) {
- var i, s;
- const o = e.getCompilerOptions();
- if (Sv(t)) {
- const c = jD(e, t), _ = m6(c) ? c.file.text.substring(c.pos, c.end) : `"${c.text}"`;
- let u;
- switch (E.assert(m6(c) || t.kind === 3, "Only synthetic references are imports"), t.kind) {
- case 3:
- m6(c) ? u = c.packageId ? p.Imported_via_0_from_file_1_with_packageId_2 : p.Imported_via_0_from_file_1 : c.text === X1 ? u = c.packageId ? p.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions : p.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions : u = c.packageId ? p.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions : p.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;
- break;
- case 4:
- E.assert(!c.packageId), u = p.Referenced_via_0_from_file_1;
- break;
- case 5:
- u = c.packageId ? p.Type_library_referenced_via_0_from_file_1_with_packageId_2 : p.Type_library_referenced_via_0_from_file_1;
- break;
- case 7:
- E.assert(!c.packageId), u = p.Library_referenced_via_0_from_file_1;
- break;
- default:
- E.assertNever(t);
- }
- return vs(
- /*details*/
- void 0,
- u,
- _,
- y6(c.file, n),
- c.packageId && Q1(c.packageId)
- );
- }
- switch (t.kind) {
- case 0:
- if (!((i = o.configFile) != null && i.configFileSpecs)) return vs(
- /*details*/
- void 0,
- p.Root_file_specified_for_compilation
- );
- const c = es(e.getRootFileNames()[t.index], e.getCurrentDirectory());
- if (aU(e, c)) return vs(
- /*details*/
- void 0,
- p.Part_of_files_list_in_tsconfig_json
- );
- const u = oU(e, c);
- return _s(u) ? vs(
- /*details*/
- void 0,
- p.Matched_by_include_pattern_0_in_1,
- u,
- y6(o.configFile, n)
- ) : (
- // Could be additional files specified as roots or matched by default include
- vs(
- /*details*/
- void 0,
- u ? p.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk : p.Root_file_specified_for_compilation
- )
- );
- case 1:
- case 2:
- const d = t.kind === 2, g = E.checkDefined((s = e.getResolvedProjectReferences()) == null ? void 0 : s[t.index]);
- return vs(
- /*details*/
- void 0,
- o.outFile ? d ? p.Output_from_referenced_project_0_included_because_1_specified : p.Source_from_referenced_project_0_included_because_1_specified : d ? p.Output_from_referenced_project_0_included_because_module_is_specified_as_none : p.Source_from_referenced_project_0_included_because_module_is_specified_as_none,
- y6(g.sourceFile.fileName, n),
- o.outFile ? "--outFile" : "--out"
- );
- case 8: {
- const h = o.types ? t.packageId ? [p.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1, t.typeReference, Q1(t.packageId)] : [p.Entry_point_of_type_library_0_specified_in_compilerOptions, t.typeReference] : t.packageId ? [p.Entry_point_for_implicit_type_library_0_with_packageId_1, t.typeReference, Q1(t.packageId)] : [p.Entry_point_for_implicit_type_library_0, t.typeReference];
- return vs(
- /*details*/
- void 0,
- ...h
- );
- }
- case 6: {
- if (t.index !== void 0) return vs(
- /*details*/
- void 0,
- p.Library_0_specified_in_compilerOptions,
- o.lib[t.index]
- );
- const h = _5(pa(o)), S = h ? [p.Default_library_for_target_0, h] : [p.Default_library];
- return vs(
- /*details*/
- void 0,
- ...S
- );
- }
- default:
- E.assertNever(t);
- }
- }
- function y6(e, t) {
- const n = _s(e) ? e : e.fileName;
- return t ? t(n) : n;
- }
- function kF(e, t, n, i, s, o, c, _) {
- const u = e.getCompilerOptions(), d = e.getConfigFileParsingDiagnostics().slice(), g = d.length;
- Fn(d, e.getSyntacticDiagnostics(
- /*sourceFile*/
- void 0,
- o
- )), d.length === g && (Fn(d, e.getOptionsDiagnostics(o)), u.listFilesOnly || (Fn(d, e.getGlobalDiagnostics(o)), d.length === g && Fn(d, e.getSemanticDiagnostics(
- /*sourceFile*/
- void 0,
- o
- )), u.noEmit && P_(u) && d.length === g && Fn(d, e.getDeclarationDiagnostics(
- /*sourceFile*/
- void 0,
- o
- ))));
- const h = u.listFilesOnly ? { emitSkipped: !0, diagnostics: Ue } : e.emit(
- /*targetSourceFile*/
- void 0,
- s,
- o,
- c,
- _
- );
- Fn(d, h.diagnostics);
- const S = sC(d);
- if (S.forEach(t), n) {
- const T = e.getCurrentDirectory();
- ir(h.emittedFiles, (C) => {
- const D = es(C, T);
- n(`TSFILE: ${D}`);
- }), ZRe(e, n);
- }
- return i && i(TF(S), xF(S)), {
- emitResult: h,
- diagnostics: S
- };
- }
- function lU(e, t, n, i, s, o, c, _) {
- const { emitResult: u, diagnostics: d } = kF(
- e,
- t,
- n,
- i,
- s,
- o,
- c,
- _
- );
- return u.emitSkipped && d.length > 0 ? 1 : d.length > 0 ? 2 : 0;
- }
- var JD = { close: ja }, zD = () => JD;
- function uU(e = ll, t) {
- return {
- onWatchStatusChange: t || eU(e),
- watchFile: Ms(e, e.watchFile) || zD,
- watchDirectory: Ms(e, e.watchDirectory) || zD,
- setTimeout: Ms(e, e.setTimeout) || ja,
- clearTimeout: Ms(e, e.clearTimeout) || ja,
- preferNonRecursiveWatch: e.preferNonRecursiveWatch
- };
- }
- var Tl = {
- ConfigFile: "Config file",
- ExtendedConfigFile: "Extended config file",
- SourceFile: "Source file",
- MissingFile: "Missing file",
- WildcardDirectory: "Wild card directory",
- FailedLookupLocations: "Failed Lookup Locations",
- AffectingFileLocation: "File location affecting resolution",
- TypeRoots: "Type roots",
- ConfigFileOfReferencedProject: "Config file of referened project",
- ExtendedConfigOfReferencedProject: "Extended config file of referenced project",
- WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project",
- PackageJson: "package.json file",
- ClosedScriptInfo: "Closed Script info",
- ConfigFileForInferredRoot: "Config file for the inferred project root",
- NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache",
- MissingSourceMapFile: "Missing source map file",
- NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root",
- MissingGeneratedFile: "Missing generated file",
- NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation",
- TypingInstallerLocationFile: "File location for typing installer",
- TypingInstallerLocationDirectory: "Directory location for typing installer"
- };
- function _U(e, t) {
- const n = e.trace ? t.extendedDiagnostics ? 2 : t.diagnostics ? 1 : 0 : 0, i = n !== 0 ? (o) => e.trace(o) : ja, s = DW(e, n, i);
- return s.writeLog = i, s;
- }
- function fU(e, t, n = e) {
- const i = e.useCaseSensitiveFileNames(), s = {
- getSourceFile: AW(
- (o, c) => c ? e.readFile(o, c) : s.readFile(o),
- /*setParentNodes*/
- void 0
- ),
- getDefaultLibLocation: Ms(e, e.getDefaultLibLocation),
- getDefaultLibFileName: (o) => e.getDefaultLibFileName(o),
- writeFile: NW(
- (o, c, _) => e.writeFile(o, c, _),
- (o) => e.createDirectory(o),
- (o) => e.directoryExists(o)
- ),
- getCurrentDirectory: Iu(() => e.getCurrentDirectory()),
- useCaseSensitiveFileNames: () => i,
- getCanonicalFileName: zl(i),
- getNewLine: () => k0(t()),
- fileExists: (o) => e.fileExists(o),
- readFile: (o) => e.readFile(o),
- trace: Ms(e, e.trace),
- directoryExists: Ms(n, n.directoryExists),
- getDirectories: Ms(n, n.getDirectories),
- realpath: Ms(e, e.realpath),
- getEnvironmentVariable: Ms(e, e.getEnvironmentVariable) || (() => ""),
- createHash: Ms(e, e.createHash),
- readDirectory: Ms(e, e.readDirectory),
- storeSignatureInfo: e.storeSignatureInfo,
- jsDocParsingMode: e.jsDocParsingMode
- };
- return s;
- }
- function CF(e, t) {
- if (t.match(Bre)) {
- let n = t.length, i = n;
- for (let s = n - 1; s >= 0; s--) {
- const o = t.charCodeAt(s);
- switch (o) {
- case 10:
- s && t.charCodeAt(s - 1) === 13 && s--;
- case 13:
- break;
- default:
- if (o < 127 || !gu(o)) {
- i = s;
- continue;
- }
- break;
- }
- const c = t.substring(i, n);
- if (c.match(eW)) {
- t = t.substring(0, i);
- break;
- } else if (!c.match(tW))
- break;
- n = i;
- }
- }
- return (e.createHash || WE)(t);
- }
- function EF(e) {
- const t = e.getSourceFile;
- e.getSourceFile = (...n) => {
- const i = t.call(e, ...n);
- return i && (i.version = CF(e, i.text)), i;
- };
- }
- function pU(e, t) {
- const n = Iu(() => Xn(Os(e.getExecutingFilePath())));
- return {
- useCaseSensitiveFileNames: () => e.useCaseSensitiveFileNames,
- getNewLine: () => e.newLine,
- getCurrentDirectory: Iu(() => e.getCurrentDirectory()),
- getDefaultLibLocation: n,
- getDefaultLibFileName: (i) => Bn(n(), yw(i)),
- fileExists: (i) => e.fileExists(i),
- readFile: (i, s) => e.readFile(i, s),
- directoryExists: (i) => e.directoryExists(i),
- getDirectories: (i) => e.getDirectories(i),
- readDirectory: (i, s, o, c, _) => e.readDirectory(i, s, o, c, _),
- realpath: Ms(e, e.realpath),
- getEnvironmentVariable: Ms(e, e.getEnvironmentVariable),
- trace: (i) => e.write(i + e.newLine),
- createDirectory: (i) => e.createDirectory(i),
- writeFile: (i, s, o) => e.writeFile(i, s, o),
- createHash: Ms(e, e.createHash),
- createProgram: t || YW,
- storeSignatureInfo: e.storeSignatureInfo,
- now: Ms(e, e.now)
- };
- }
- function Z1e(e = ll, t, n, i) {
- const s = (c) => e.write(c + e.newLine), o = pU(e, t);
- return mR(o, uU(e, i)), o.afterProgramCreate = (c) => {
- const _ = c.getCompilerOptions(), u = k0(_);
- kF(
- c,
- n,
- s,
- (d) => o.onWatchStatusChange(
- Go(tU(d), d),
- u,
- _,
- d
- )
- );
- }, o;
- }
- function K1e(e, t, n) {
- t(n), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- }
- function dU({
- configFileName: e,
- optionsToExtend: t,
- watchOptionsToExtend: n,
- extraFileExtensions: i,
- system: s,
- createProgram: o,
- reportDiagnostic: c,
- reportWatchStatus: _
- }) {
- const u = c || $x(s), d = Z1e(s, o, u, _);
- return d.onUnRecoverableConfigFileDiagnostic = (g) => K1e(s, u, g), d.configFileName = e, d.optionsToExtend = t, d.watchOptionsToExtend = n, d.extraFileExtensions = i, d;
- }
- function mU({
- rootFiles: e,
- options: t,
- watchOptions: n,
- projectReferences: i,
- system: s,
- createProgram: o,
- reportDiagnostic: c,
- reportWatchStatus: _
- }) {
- const u = Z1e(s, o, c || $x(s), _);
- return u.rootFiles = e, u.options = t, u.watchOptions = n, u.projectReferences = i, u;
- }
- function die(e) {
- const t = e.system || ll, n = e.host || (e.host = PF(e.options, t)), i = mie(e), s = lU(
- i,
- e.reportDiagnostic || $x(t),
- (o) => n.trace && n.trace(o),
- e.reportErrorSummary || e.options.pretty ? (o, c) => t.write(rU(o, c, t.newLine, n)) : void 0
- );
- return e.afterProgramEmitAndDiagnostics && e.afterProgramEmitAndDiagnostics(i), s;
- }
- function DF(e, t) {
- const n = bv(e);
- if (!n) return;
- let i;
- if (t.getBuildInfo)
- i = t.getBuildInfo(n, e.configFilePath);
- else {
- const s = t.readFile(n);
- if (!s) return;
- i = xW(n, s);
- }
- if (!(!i || i.version !== U_ || !VA(i)))
- return iie(i, n, t);
- }
- function PF(e, t = ll) {
- const n = aF(
- e,
- /*setParentNodes*/
- void 0,
- t
- );
- return n.createHash = Ms(t, t.createHash), n.storeSignatureInfo = t.storeSignatureInfo, EF(n), MD(n, (i) => uo(i, n.getCurrentDirectory(), n.getCanonicalFileName)), n;
- }
- function mie({
- rootNames: e,
- options: t,
- configFileParsingDiagnostics: n,
- projectReferences: i,
- host: s,
- createProgram: o
- }) {
- s = s || PF(t), o = o || YW;
- const c = DF(t, s);
- return o(e, t, s, c, n, i);
- }
- function eve(e, t, n, i, s, o, c, _) {
- return us(e) ? mU({
- rootFiles: e,
- options: t,
- watchOptions: _,
- projectReferences: c,
- system: n,
- createProgram: i,
- reportDiagnostic: s,
- reportWatchStatus: o
- }) : dU({
- configFileName: e,
- optionsToExtend: t,
- watchOptionsToExtend: c,
- extraFileExtensions: _,
- system: n,
- createProgram: i,
- reportDiagnostic: s,
- reportWatchStatus: o
- });
- }
- function gU(e) {
- let t, n, i, s, o, c, _, u, d = e.extendedConfigCache, g = !1;
- const h = /* @__PURE__ */ new Map();
- let S, T = !1;
- const C = e.useCaseSensitiveFileNames(), D = e.getCurrentDirectory(), { configFileName: P, optionsToExtend: I = {}, watchOptionsToExtend: F, extraFileExtensions: O, createProgram: B } = e;
- let { rootFiles: z, options: X, watchOptions: q, projectReferences: V } = e, ae, ee, G = !1, ue = !1;
- const re = P === void 0 ? void 0 : nF(e, D, C), ne = re || e, ie = mF(e, ne);
- let Se = Ir();
- P && e.configFileParsingResult && (Hs(e.configFileParsingResult), Se = Ir()), ei(p.Starting_compilation_in_watch_mode), P && !e.configFileParsingResult && (Se = k0(I), E.assert(!z), Ws(), Se = Ir()), E.assert(X), E.assert(z);
- const { watchFile: J, watchDirectory: oe, writeLog: _e } = _U(e, X), he = zl(C);
- _e(`Current directory: ${D} CaseSensitiveFileNames: ${C}`);
- let le;
- P && (le = J(P, Ar, 2e3, q, Tl.ConfigFile));
- const me = fU(e, () => X, ne);
- EF(me);
- const ve = me.getSourceFile;
- me.getSourceFile = ($e, ...bt) => xr($e, jr($e), ...bt), me.getSourceFileByPath = xr, me.getNewLine = () => Se, me.fileExists = Br, me.onReleaseOldSourceFile = rs, me.onReleaseParsedCommandLine = Xe, me.toPath = jr, me.getCompilationSettings = () => X, me.useSourceOfProjectReferenceRedirect = Ms(e, e.useSourceOfProjectReferenceRedirect), me.preferNonRecursiveWatch = e.preferNonRecursiveWatch, me.watchDirectoryOfFailedLookupLocation = ($e, bt, He) => oe($e, bt, He, q, Tl.FailedLookupLocations), me.watchAffectingFileLocation = ($e, bt) => J($e, bt, 2e3, q, Tl.AffectingFileLocation), me.watchTypeRootsDirectory = ($e, bt, He) => oe($e, bt, He, q, Tl.TypeRoots), me.getCachedDirectoryStructureHost = () => re, me.scheduleInvalidateResolutionsOfFailedLookupLocations = ji, me.onInvalidatedResolution = Ot, me.onChangedAutomaticTypeDirectiveNames = Ot, me.fileIsOpen = nm, me.getCurrentProgram = Re, me.writeLog = _e, me.getParsedCommandLine = rr;
- const tt = KW(
- me,
- P ? Xn(es(P, D)) : D,
- /*logChangesWhenResolvingModule*/
- !1
- );
- me.resolveModuleNameLiterals = Ms(e, e.resolveModuleNameLiterals), me.resolveModuleNames = Ms(e, e.resolveModuleNames), !me.resolveModuleNameLiterals && !me.resolveModuleNames && (me.resolveModuleNameLiterals = tt.resolveModuleNameLiterals.bind(tt)), me.resolveTypeReferenceDirectiveReferences = Ms(e, e.resolveTypeReferenceDirectiveReferences), me.resolveTypeReferenceDirectives = Ms(e, e.resolveTypeReferenceDirectives), !me.resolveTypeReferenceDirectiveReferences && !me.resolveTypeReferenceDirectives && (me.resolveTypeReferenceDirectiveReferences = tt.resolveTypeReferenceDirectiveReferences.bind(tt)), me.resolveLibrary = e.resolveLibrary ? e.resolveLibrary.bind(e) : tt.resolveLibrary.bind(tt), me.getModuleResolutionCache = e.resolveModuleNameLiterals || e.resolveModuleNames ? Ms(e, e.getModuleResolutionCache) : () => tt.getModuleResolutionCache();
- const we = !!e.resolveModuleNameLiterals || !!e.resolveTypeReferenceDirectiveReferences || !!e.resolveModuleNames || !!e.resolveTypeReferenceDirectives ? Ms(e, e.hasInvalidatedResolutions) || B1 : nm, fe = e.resolveLibrary ? Ms(e, e.hasInvalidatedLibResolutions) || B1 : nm;
- return t = DF(X, me), ft(), Ve(), P && xe(jr(P), X, q, Tl.ExtendedConfigFile), P ? { getCurrentProgram: et, getProgram: ti, close: Me, getResolutionCache: Qe } : { getCurrentProgram: et, getProgram: ti, updateRootFileNames: _r, close: Me, getResolutionCache: Qe };
- function Me() {
- Jr(), tt.clear(), D_(h, ($e) => {
- $e && $e.fileWatcher && ($e.fileWatcher.close(), $e.fileWatcher = void 0);
- }), le && (le.close(), le = void 0), d?.clear(), d = void 0, u && (D_(u, mp), u = void 0), s && (D_(s, mp), s = void 0), i && (D_(i, fd), i = void 0), _ && (D_(_, ($e) => {
- var bt;
- (bt = $e.watcher) == null || bt.close(), $e.watcher = void 0, $e.watchedDirectories && D_($e.watchedDirectories, mp), $e.watchedDirectories = void 0;
- }), _ = void 0), t = void 0;
- }
- function Qe() {
- return tt;
- }
- function et() {
- return t;
- }
- function Re() {
- return t && t.getProgramOrUndefined();
- }
- function ft() {
- _e("Synchronizing program"), E.assert(X), E.assert(z), Jr();
- const $e = et();
- T && (Se = Ir(), $e && e7($e.getCompilerOptions(), X) && tt.onChangesAffectModuleResolution());
- const { hasInvalidatedResolutions: bt, hasInvalidatedLibResolutions: He } = tt.createHasInvalidatedResolutions(we, fe), {
- originalReadFile: Vt,
- originalFileExists: Zt,
- originalDirectoryExists: vn,
- originalCreateDirectory: M,
- originalWriteFile: Ae,
- readFileWithCache: dt
- } = MD(me, jr);
- return JW(Re(), z, X, (U) => ki(U, dt), (U) => me.fileExists(U), bt, He, Ri, rr, V) ? ue && (g && ei(p.File_change_detected_Starting_incremental_compilation), t = B(
- /*rootNames*/
- void 0,
- /*options*/
- void 0,
- me,
- t,
- ee,
- V
- ), ue = !1) : (g && ei(p.File_change_detected_Starting_incremental_compilation), Wt(bt, He)), g = !1, e.afterProgramCreate && $e !== t && e.afterProgramCreate(t), me.readFile = Vt, me.fileExists = Zt, me.directoryExists = vn, me.createDirectory = M, me.writeFile = Ae, t;
- }
- function Wt($e, bt) {
- _e("CreatingProgramWith::"), _e(` roots: ${JSON.stringify(z)}`), _e(` options: ${JSON.stringify(X)}`), V && _e(` projectReferences: ${JSON.stringify(V)}`);
- const He = T || !Re();
- T = !1, ue = !1, tt.startCachingPerDirectoryResolution(), me.hasInvalidatedResolutions = $e, me.hasInvalidatedLibResolutions = bt, me.hasChangedAutomaticTypeDirectiveNames = Ri;
- const Vt = Re();
- if (t = B(z, X, me, t, ee, V), tt.finishCachingPerDirectoryResolution(t.getProgram(), Vt), EW(
- t.getProgram(),
- i || (i = /* @__PURE__ */ new Map()),
- K
- ), He && tt.updateTypeRootsWatch(), S) {
- for (const Zt of S)
- i.has(Zt) || h.delete(Zt);
- S = void 0;
- }
- }
- function _r($e) {
- E.assert(!P, "Cannot update root file names with config file watch mode"), z = $e, Ot();
- }
- function Ir() {
- return k0(X || I);
- }
- function jr($e) {
- return uo($e, D, he);
- }
- function Nt($e) {
- return typeof $e == "boolean";
- }
- function Qt($e) {
- return typeof $e.version == "boolean";
- }
- function Br($e) {
- const bt = jr($e);
- return Nt(h.get(bt)) ? !1 : ne.fileExists($e);
- }
- function xr($e, bt, He, Vt, Zt) {
- const vn = h.get(bt);
- if (Nt(vn))
- return;
- const M = typeof He == "object" ? He.impliedNodeFormat : void 0;
- if (vn === void 0 || Zt || Qt(vn) || vn.sourceFile.impliedNodeFormat !== M) {
- const Ae = ve($e, He, Vt);
- if (vn)
- Ae ? (vn.sourceFile = Ae, vn.version = Ae.version, vn.fileWatcher || (vn.fileWatcher = Tt(bt, $e, te, 250, q, Tl.SourceFile))) : (vn.fileWatcher && vn.fileWatcher.close(), h.set(bt, !1));
- else if (Ae) {
- const dt = Tt(bt, $e, te, 250, q, Tl.SourceFile);
- h.set(bt, { sourceFile: Ae, version: Ae.version, fileWatcher: dt });
- } else
- h.set(bt, !1);
- return Ae;
- }
- return vn.sourceFile;
- }
- function zn($e) {
- const bt = h.get($e);
- bt !== void 0 && (Nt(bt) ? h.set($e, { version: !1 }) : bt.version = !1);
- }
- function ki($e, bt) {
- const He = h.get($e);
- if (!He) return;
- if (He.version) return He.version;
- const Vt = bt($e);
- return Vt !== void 0 ? CF(me, Vt) : void 0;
- }
- function rs($e, bt, He) {
- const Vt = h.get($e.resolvedPath);
- Vt !== void 0 && (Nt(Vt) ? (S || (S = [])).push($e.path) : Vt.sourceFile === $e && (Vt.fileWatcher && Vt.fileWatcher.close(), h.delete($e.resolvedPath), He || tt.removeResolutionsOfFile($e.path)));
- }
- function ei($e) {
- e.onWatchStatusChange && e.onWatchStatusChange(Go($e), Se, X || I);
- }
- function Ri() {
- return tt.hasChangedAutomaticTypeDirectiveNames();
- }
- function Jr() {
- return c ? (e.clearTimeout(c), c = void 0, !0) : !1;
- }
- function ji() {
- if (!e.setTimeout || !e.clearTimeout)
- return tt.invalidateResolutionsOfFailedLookupLocations();
- const $e = Jr();
- _e(`Scheduling invalidateFailedLookup${$e ? ", Cancelled earlier one" : ""}`), c = e.setTimeout(Fe, 250, "timerToInvalidateFailedLookupResolutions");
- }
- function Fe() {
- c = void 0, tt.invalidateResolutionsOfFailedLookupLocations() && Ot();
- }
- function Ot() {
- !e.setTimeout || !e.clearTimeout || (o && e.clearTimeout(o), _e("Scheduling update"), o = e.setTimeout(mn, 250, "timerToUpdateProgram"));
- }
- function Ar() {
- E.assert(!!P), n = 2, Ot();
- }
- function mn() {
- o = void 0, g = !0, ti();
- }
- function ti() {
- switch (n) {
- case 1:
- qn();
- break;
- case 2:
- Oi();
- break;
- default:
- ft();
- break;
- }
- return et();
- }
- function qn() {
- _e("Reloading new file names and options"), E.assert(X), E.assert(P), n = 0, z = bD(X.configFile.configFileSpecs, es(Xn(P), D), X, ie, O), DO(z, es(P, D), X.configFile.configFileSpecs, ee, G) && (ue = !0), ft();
- }
- function Oi() {
- E.assert(P), _e(`Reloading config file: ${P}`), n = 0, re && re.clearCache(), Ws(), T = !0, ft(), Ve(), xe(jr(P), X, q, Tl.ExtendedConfigFile);
- }
- function Ws() {
- E.assert(P), Hs(
- yA(
- P,
- I,
- ie,
- d || (d = /* @__PURE__ */ new Map()),
- F,
- O
- )
- );
- }
- function Hs($e) {
- z = $e.fileNames, X = $e.options, q = $e.watchOptions, V = $e.projectReferences, ae = $e.wildcardDirectories, ee = Qb($e).slice(), G = vD($e.raw), ue = !0;
- }
- function rr($e) {
- const bt = jr($e);
- let He = _?.get(bt);
- if (He) {
- if (!He.updateLevel) return He.parsedCommandLine;
- if (He.parsedCommandLine && He.updateLevel === 1 && !e.getParsedCommandLine) {
- _e("Reloading new file names and options"), E.assert(X);
- const Zt = bD(
- He.parsedCommandLine.options.configFile.configFileSpecs,
- es(Xn($e), D),
- X,
- ie
- );
- return He.parsedCommandLine = { ...He.parsedCommandLine, fileNames: Zt }, He.updateLevel = void 0, He.parsedCommandLine;
- }
- }
- _e(`Loading config file: ${$e}`);
- const Vt = e.getParsedCommandLine ? e.getParsedCommandLine($e) : Ea($e);
- return He ? (He.parsedCommandLine = Vt, He.updateLevel = void 0) : (_ || (_ = /* @__PURE__ */ new Map())).set(bt, He = { parsedCommandLine: Vt }), at($e, bt, He), Vt;
- }
- function Ea($e) {
- const bt = ie.onUnRecoverableConfigFileDiagnostic;
- ie.onUnRecoverableConfigFileDiagnostic = ja;
- const He = yA(
- $e,
- /*optionsToExtend*/
- void 0,
- ie,
- d || (d = /* @__PURE__ */ new Map()),
- F
- );
- return ie.onUnRecoverableConfigFileDiagnostic = bt, He;
- }
- function Xe($e) {
- var bt;
- const He = jr($e), Vt = _?.get(He);
- Vt && (_.delete(He), Vt.watchedDirectories && D_(Vt.watchedDirectories, mp), (bt = Vt.watcher) == null || bt.close(), CW(He, u));
- }
- function Tt($e, bt, He, Vt, Zt, vn) {
- return J(bt, (M, Ae) => He(M, Ae, $e), Vt, Zt, vn);
- }
- function te($e, bt, He) {
- ze($e, He, bt), bt === 2 && h.has(He) && tt.invalidateResolutionOfFile(He), zn(He), Ot();
- }
- function ze($e, bt, He) {
- re && re.addOrDeleteFile($e, bt, He);
- }
- function K($e, bt) {
- return _?.has($e) ? JD : Tt(
- $e,
- bt,
- De,
- 500,
- q,
- Tl.MissingFile
- );
- }
- function De($e, bt, He) {
- ze($e, He, bt), bt === 0 && i.has(He) && (i.get(He).close(), i.delete(He), zn(He), Ot());
- }
- function Ve() {
- RA(
- s || (s = /* @__PURE__ */ new Map()),
- ae,
- Ke
- );
- }
- function Ke($e, bt) {
- return oe(
- $e,
- (He) => {
- E.assert(P), E.assert(X);
- const Vt = jr(He);
- re && re.addOrDeleteFileOrDirectory(He, Vt), zn(Vt), !jA({
- watchedDirPath: jr($e),
- fileOrDirectory: He,
- fileOrDirectoryPath: Vt,
- configFileName: P,
- extraFileExtensions: O,
- options: X,
- program: et() || z,
- currentDirectory: D,
- useCaseSensitiveFileNames: C,
- writeLog: _e,
- toPath: jr
- }) && n !== 2 && (n = 1, Ot());
- },
- bt,
- q,
- Tl.WildcardDirectory
- );
- }
- function xe($e, bt, He, Vt) {
- iF(
- $e,
- bt,
- u || (u = /* @__PURE__ */ new Map()),
- (Zt, vn) => J(
- Zt,
- (M, Ae) => {
- var dt;
- ze(Zt, vn, Ae), d && sF(d, vn, jr);
- const U = (dt = u.get(vn)) == null ? void 0 : dt.projects;
- U?.size && U.forEach((be) => {
- if (P && jr(P) === be)
- n = 2;
- else {
- const Z = _?.get(be);
- Z && (Z.updateLevel = 2), tt.removeResolutionsFromProjectReferenceRedirects(be);
- }
- Ot();
- });
- },
- 2e3,
- He,
- Vt
- ),
- jr
- );
- }
- function at($e, bt, He) {
- var Vt, Zt, vn, M;
- He.watcher || (He.watcher = J(
- $e,
- (Ae, dt) => {
- ze($e, bt, dt);
- const U = _?.get(bt);
- U && (U.updateLevel = 2), tt.removeResolutionsFromProjectReferenceRedirects(bt), Ot();
- },
- 2e3,
- ((Vt = He.parsedCommandLine) == null ? void 0 : Vt.watchOptions) || q,
- Tl.ConfigFileOfReferencedProject
- )), RA(
- He.watchedDirectories || (He.watchedDirectories = /* @__PURE__ */ new Map()),
- (Zt = He.parsedCommandLine) == null ? void 0 : Zt.wildcardDirectories,
- (Ae, dt) => {
- var U;
- return oe(
- Ae,
- (be) => {
- const Z = jr(be);
- re && re.addOrDeleteFileOrDirectory(be, Z), zn(Z);
- const ht = _?.get(bt);
- ht?.parsedCommandLine && (jA({
- watchedDirPath: jr(Ae),
- fileOrDirectory: be,
- fileOrDirectoryPath: Z,
- configFileName: $e,
- options: ht.parsedCommandLine.options,
- program: ht.parsedCommandLine.fileNames,
- currentDirectory: D,
- useCaseSensitiveFileNames: C,
- writeLog: _e,
- toPath: jr
- }) || ht.updateLevel !== 2 && (ht.updateLevel = 1, Ot()));
- },
- dt,
- ((U = He.parsedCommandLine) == null ? void 0 : U.watchOptions) || q,
- Tl.WildcardDirectoryOfReferencedProject
- );
- }
- ), xe(
- bt,
- (vn = He.parsedCommandLine) == null ? void 0 : vn.options,
- ((M = He.parsedCommandLine) == null ? void 0 : M.watchOptions) || q,
- Tl.ExtendedConfigOfReferencedProject
- );
- }
- }
- var gie = /* @__PURE__ */ ((e) => (e[e.Unbuildable = 0] = "Unbuildable", e[e.UpToDate = 1] = "UpToDate", e[e.UpToDateWithUpstreamTypes = 2] = "UpToDateWithUpstreamTypes", e[e.OutputMissing = 3] = "OutputMissing", e[e.ErrorReadingFile = 4] = "ErrorReadingFile", e[e.OutOfDateWithSelf = 5] = "OutOfDateWithSelf", e[e.OutOfDateWithUpstream = 6] = "OutOfDateWithUpstream", e[e.OutOfDateBuildInfoWithPendingEmit = 7] = "OutOfDateBuildInfoWithPendingEmit", e[e.OutOfDateBuildInfoWithErrors = 8] = "OutOfDateBuildInfoWithErrors", e[e.OutOfDateOptions = 9] = "OutOfDateOptions", e[e.OutOfDateRoots = 10] = "OutOfDateRoots", e[e.UpstreamOutOfDate = 11] = "UpstreamOutOfDate", e[e.UpstreamBlocked = 12] = "UpstreamBlocked", e[e.ComputingUpstream = 13] = "ComputingUpstream", e[e.TsVersionOutputOfDate = 14] = "TsVersionOutputOfDate", e[e.UpToDateWithInputFileText = 15] = "UpToDateWithInputFileText", e[e.ContainerOnly = 16] = "ContainerOnly", e[e.ForceBuild = 17] = "ForceBuild", e))(gie || {});
- function hU(e) {
- return qo(
- e,
- ".json"
- /* Json */
- ) ? e : Bn(e, "tsconfig.json");
- }
- var KRe = /* @__PURE__ */ new Date(-864e13);
- function eje(e, t, n) {
- const i = e.get(t);
- let s;
- return i || (s = n(), e.set(t, s)), i || s;
- }
- function hie(e, t) {
- return eje(e, t, () => /* @__PURE__ */ new Map());
- }
- function yU(e) {
- return e.now ? e.now() : /* @__PURE__ */ new Date();
- }
- function Xx(e) {
- return !!e && !!e.buildOrder;
- }
- function HA(e) {
- return Xx(e) ? e.buildOrder : e;
- }
- function wF(e, t) {
- return (n) => {
- let i = t ? `[${Xb(
- qA(e),
- "\x1B[90m"
- /* Grey */
- )}] ` : `${qA(e)} - `;
- i += `${Em(n.messageText, e.newLine)}${e.newLine + e.newLine}`, e.write(i);
- };
- }
- function tve(e, t, n, i) {
- const s = pU(e, t);
- return s.getModifiedTime = e.getModifiedTime ? (o) => e.getModifiedTime(o) : lb, s.setModifiedTime = e.setModifiedTime ? (o, c) => e.setModifiedTime(o, c) : ja, s.deleteFile = e.deleteFile ? (o) => e.deleteFile(o) : ja, s.reportDiagnostic = n || $x(e), s.reportSolutionBuilderStatus = i || wF(e), s.now = Ms(e, e.now), s;
- }
- function yie(e = ll, t, n, i, s) {
- const o = tve(e, t, n, i);
- return o.reportErrorSummary = s, o;
- }
- function vie(e = ll, t, n, i, s) {
- const o = tve(e, t, n, i), c = uU(e, s);
- return mR(o, c), o;
- }
- function tje(e) {
- const t = {};
- return gO.forEach((n) => {
- co(e, n.name) && (t[n.name] = e[n.name]);
- }), t.tscBuild = !0, t;
- }
- function bie(e, t, n) {
- return Tve(
- /*watch*/
- !1,
- e,
- t,
- n
- );
- }
- function Sie(e, t, n, i) {
- return Tve(
- /*watch*/
- !0,
- e,
- t,
- n,
- i
- );
- }
- function rje(e, t, n, i, s) {
- const o = t, c = t, _ = tje(i), u = fU(o, () => D.projectCompilerOptions);
- EF(u), u.getParsedCommandLine = (P) => v6(D, P, pg(D, P)), u.resolveModuleNameLiterals = Ms(o, o.resolveModuleNameLiterals), u.resolveTypeReferenceDirectiveReferences = Ms(o, o.resolveTypeReferenceDirectiveReferences), u.resolveLibrary = Ms(o, o.resolveLibrary), u.resolveModuleNames = Ms(o, o.resolveModuleNames), u.resolveTypeReferenceDirectives = Ms(o, o.resolveTypeReferenceDirectives), u.getModuleResolutionCache = Ms(o, o.getModuleResolutionCache);
- let d, g;
- !u.resolveModuleNameLiterals && !u.resolveModuleNames && (d = o6(u.getCurrentDirectory(), u.getCanonicalFileName), u.resolveModuleNameLiterals = (P, I, F, O, B) => JA(
- P,
- I,
- F,
- O,
- B,
- o,
- d,
- RW
- ), u.getModuleResolutionCache = () => d), !u.resolveTypeReferenceDirectiveReferences && !u.resolveTypeReferenceDirectives && (g = OO(
- u.getCurrentDirectory(),
- u.getCanonicalFileName,
- /*options*/
- void 0,
- d?.getPackageJsonInfoCache(),
- d?.optionsToRedirectsKey
- ), u.resolveTypeReferenceDirectiveReferences = (P, I, F, O, B) => JA(
- P,
- I,
- F,
- O,
- B,
- o,
- g,
- lF
- ));
- let h;
- u.resolveLibrary || (h = o6(
- u.getCurrentDirectory(),
- u.getCanonicalFileName,
- /*options*/
- void 0,
- d?.getPackageJsonInfoCache()
- ), u.resolveLibrary = (P, I, F) => FO(
- P,
- I,
- F,
- o,
- h
- )), u.getBuildInfo = (P, I) => pve(
- D,
- P,
- pg(D, I),
- /*modifiedTime*/
- void 0
- );
- const { watchFile: S, watchDirectory: T, writeLog: C } = _U(c, i), D = {
- host: o,
- hostWithWatch: c,
- parseConfigFileHost: mF(o),
- write: Ms(o, o.trace),
- // State of solution
- options: i,
- baseCompilerOptions: _,
- rootNames: n,
- baseWatchOptions: s,
- resolvedConfigFilePaths: /* @__PURE__ */ new Map(),
- configFileCache: /* @__PURE__ */ new Map(),
- projectStatus: /* @__PURE__ */ new Map(),
- extendedConfigCache: /* @__PURE__ */ new Map(),
- buildInfoCache: /* @__PURE__ */ new Map(),
- outputTimeStamps: /* @__PURE__ */ new Map(),
- builderPrograms: /* @__PURE__ */ new Map(),
- diagnostics: /* @__PURE__ */ new Map(),
- projectPendingBuild: /* @__PURE__ */ new Map(),
- projectErrorsReported: /* @__PURE__ */ new Map(),
- compilerHost: u,
- moduleResolutionCache: d,
- typeReferenceDirectiveResolutionCache: g,
- libraryResolutionCache: h,
- // Mutable state
- buildOrder: void 0,
- readFileWithCache: (P) => o.readFile(P),
- projectCompilerOptions: _,
- cache: void 0,
- allProjectBuildPending: !0,
- needsSummary: !0,
- watchAllProjectsPending: e,
- // Watch state
- watch: e,
- allWatchedWildcardDirectories: /* @__PURE__ */ new Map(),
- allWatchedInputFiles: /* @__PURE__ */ new Map(),
- allWatchedConfigFiles: /* @__PURE__ */ new Map(),
- allWatchedExtendedConfigFiles: /* @__PURE__ */ new Map(),
- allWatchedPackageJsonFiles: /* @__PURE__ */ new Map(),
- filesWatched: /* @__PURE__ */ new Map(),
- lastCachedPackageJsonLookups: /* @__PURE__ */ new Map(),
- timerToBuildInvalidatedProject: void 0,
- reportFileChangeDetected: !1,
- watchFile: S,
- watchDirectory: T,
- writeLog: C
- };
- return D;
- }
- function pd(e, t) {
- return uo(t, e.compilerHost.getCurrentDirectory(), e.compilerHost.getCanonicalFileName);
- }
- function pg(e, t) {
- const { resolvedConfigFilePaths: n } = e, i = n.get(t);
- if (i !== void 0) return i;
- const s = pd(e, t);
- return n.set(t, s), s;
- }
- function rve(e) {
- return !!e.options;
- }
- function nje(e, t) {
- const n = e.configFileCache.get(t);
- return n && rve(n) ? n : void 0;
- }
- function v6(e, t, n) {
- const { configFileCache: i } = e, s = i.get(n);
- if (s)
- return rve(s) ? s : void 0;
- Ko("SolutionBuilder::beforeConfigFileParsing");
- let o;
- const { parseConfigFileHost: c, baseCompilerOptions: _, baseWatchOptions: u, extendedConfigCache: d, host: g } = e;
- let h;
- return g.getParsedCommandLine ? (h = g.getParsedCommandLine(t), h || (o = Go(p.File_0_not_found, t))) : (c.onUnRecoverableConfigFileDiagnostic = (S) => o = S, h = yA(t, _, c, d, u), c.onUnRecoverableConfigFileDiagnostic = ja), i.set(n, h || o), Ko("SolutionBuilder::afterConfigFileParsing"), rp("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing"), h;
- }
- function GA(e, t) {
- return hU(z1(e.compilerHost.getCurrentDirectory(), t));
- }
- function nve(e, t) {
- const n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = [];
- let o, c;
- for (const u of t)
- _(u);
- return c ? { buildOrder: o || Ue, circularDiagnostics: c } : o || Ue;
- function _(u, d) {
- const g = pg(e, u);
- if (i.has(g)) return;
- if (n.has(g)) {
- d || (c || (c = [])).push(
- Go(
- p.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,
- s.join(`\r
-`)
- )
- );
- return;
- }
- n.set(g, !0), s.push(u);
- const h = v6(e, u, g);
- if (h && h.projectReferences)
- for (const S of h.projectReferences) {
- const T = GA(e, S.path);
- _(T, d || S.circular);
- }
- s.pop(), i.set(g, !0), (o || (o = [])).push(u);
- }
- }
- function AF(e) {
- return e.buildOrder || ije(e);
- }
- function ije(e) {
- const t = nve(e, e.rootNames.map((s) => GA(e, s)));
- e.resolvedConfigFilePaths.clear();
- const n = new Set(
- HA(t).map(
- (s) => pg(e, s)
- )
- ), i = { onDeleteValue: ja };
- return Jg(e.configFileCache, n, i), Jg(e.projectStatus, n, i), Jg(e.builderPrograms, n, i), Jg(e.diagnostics, n, i), Jg(e.projectPendingBuild, n, i), Jg(e.projectErrorsReported, n, i), Jg(e.buildInfoCache, n, i), Jg(e.outputTimeStamps, n, i), Jg(e.lastCachedPackageJsonLookups, n, i), e.watch && (Jg(
- e.allWatchedConfigFiles,
- n,
- { onDeleteValue: fd }
- ), e.allWatchedExtendedConfigFiles.forEach((s) => {
- s.projects.forEach((o) => {
- n.has(o) || s.projects.delete(o);
- }), s.close();
- }), Jg(
- e.allWatchedWildcardDirectories,
- n,
- { onDeleteValue: (s) => s.forEach(mp) }
- ), Jg(
- e.allWatchedInputFiles,
- n,
- { onDeleteValue: (s) => s.forEach(fd) }
- ), Jg(
- e.allWatchedPackageJsonFiles,
- n,
- { onDeleteValue: (s) => s.forEach(fd) }
- )), e.buildOrder = t;
- }
- function ive(e, t, n) {
- const i = t && GA(e, t), s = AF(e);
- if (Xx(s)) return s;
- if (i) {
- const c = pg(e, i);
- if (ac(
- s,
- (u) => pg(e, u) === c
- ) === -1) return;
- }
- const o = i ? nve(e, [i]) : s;
- return E.assert(!Xx(o)), E.assert(!n || i !== void 0), E.assert(!n || o[o.length - 1] === i), n ? o.slice(0, o.length - 1) : o;
- }
- function sve(e) {
- e.cache && Tie(e);
- const { compilerHost: t, host: n } = e, i = e.readFileWithCache, s = t.getSourceFile, {
- originalReadFile: o,
- originalFileExists: c,
- originalDirectoryExists: _,
- originalCreateDirectory: u,
- originalWriteFile: d,
- getSourceFileWithCache: g,
- readFileWithCache: h
- } = MD(
- n,
- (S) => pd(e, S),
- (...S) => s.call(t, ...S)
- );
- e.readFileWithCache = h, t.getSourceFile = g, e.cache = {
- originalReadFile: o,
- originalFileExists: c,
- originalDirectoryExists: _,
- originalCreateDirectory: u,
- originalWriteFile: d,
- originalReadFileWithCache: i,
- originalGetSourceFile: s
- };
- }
- function Tie(e) {
- if (!e.cache) return;
- const { cache: t, host: n, compilerHost: i, extendedConfigCache: s, moduleResolutionCache: o, typeReferenceDirectiveResolutionCache: c, libraryResolutionCache: _ } = e;
- n.readFile = t.originalReadFile, n.fileExists = t.originalFileExists, n.directoryExists = t.originalDirectoryExists, n.createDirectory = t.originalCreateDirectory, n.writeFile = t.originalWriteFile, i.getSourceFile = t.originalGetSourceFile, e.readFileWithCache = t.originalReadFileWithCache, s.clear(), o?.clear(), c?.clear(), _?.clear(), e.cache = void 0;
- }
- function ave(e, t) {
- e.projectStatus.delete(t), e.diagnostics.delete(t);
- }
- function ove({ projectPendingBuild: e }, t, n) {
- const i = e.get(t);
- (i === void 0 || i < n) && e.set(t, n);
- }
- function cve(e, t) {
- if (!e.allProjectBuildPending) return;
- e.allProjectBuildPending = !1, e.options.watch && Nie(e, p.Starting_compilation_in_watch_mode), sve(e), HA(AF(e)).forEach(
- (i) => e.projectPendingBuild.set(
- pg(e, i),
- 0
- /* Update */
- )
- ), t && t.throwIfCancellationRequested();
- }
- var xie = /* @__PURE__ */ ((e) => (e[e.Build = 0] = "Build", e[e.UpdateOutputFileStamps = 1] = "UpdateOutputFileStamps", e))(xie || {});
- function lve(e, t) {
- return e.projectPendingBuild.delete(t), e.diagnostics.has(t) ? 1 : 0;
- }
- function sje(e, t, n, i, s) {
- let o = !0;
- return {
- kind: 1,
- project: t,
- projectPath: n,
- buildOrder: s,
- getCompilerOptions: () => i.options,
- getCurrentDirectory: () => e.compilerHost.getCurrentDirectory(),
- updateOutputFileStatmps: () => {
- mve(e, i, n), o = !1;
- },
- done: () => (o && mve(e, i, n), Ko("SolutionBuilder::Timestamps only updates"), lve(e, n))
- };
- }
- function aje(e, t, n, i, s, o, c) {
- let _ = 0, u, d;
- return {
- kind: 0,
- project: t,
- projectPath: n,
- buildOrder: c,
- getCompilerOptions: () => s.options,
- getCurrentDirectory: () => e.compilerHost.getCurrentDirectory(),
- getBuilderProgram: () => h(go),
- getProgram: () => h(
- (P) => P.getProgramOrUndefined()
- ),
- getSourceFile: (P) => h(
- (I) => I.getSourceFile(P)
- ),
- getSourceFiles: () => S(
- (P) => P.getSourceFiles()
- ),
- getOptionsDiagnostics: (P) => S(
- (I) => I.getOptionsDiagnostics(P)
- ),
- getGlobalDiagnostics: (P) => S(
- (I) => I.getGlobalDiagnostics(P)
- ),
- getConfigFileParsingDiagnostics: () => S(
- (P) => P.getConfigFileParsingDiagnostics()
- ),
- getSyntacticDiagnostics: (P, I) => S(
- (F) => F.getSyntacticDiagnostics(P, I)
- ),
- getAllDependencies: (P) => S(
- (I) => I.getAllDependencies(P)
- ),
- getSemanticDiagnostics: (P, I) => S(
- (F) => F.getSemanticDiagnostics(P, I)
- ),
- getSemanticDiagnosticsOfNextAffectedFile: (P, I) => h(
- (F) => F.getSemanticDiagnosticsOfNextAffectedFile && F.getSemanticDiagnosticsOfNextAffectedFile(P, I)
- ),
- emit: (P, I, F, O, B) => P || O ? h(
- (z) => {
- var X, q;
- return z.emit(P, I, F, O, B || ((q = (X = e.host).getCustomTransformers) == null ? void 0 : q.call(X, t)));
- }
- ) : (D(0, F), C(I, F, B)),
- done: g
- };
- function g(P, I, F) {
- return D(3, P, I, F), Ko("SolutionBuilder::Projects built"), lve(e, n);
- }
- function h(P) {
- return D(
- 0
- /* CreateProgram */
- ), u && P(u);
- }
- function S(P) {
- return h(P) || Ue;
- }
- function T() {
- var P, I, F;
- if (E.assert(u === void 0), e.options.dry) {
- rf(e, p.A_non_dry_build_would_build_project_0, t), d = 1, _ = 2;
- return;
- }
- if (e.options.verbose && rf(e, p.Building_project_0, t), s.fileNames.length === 0) {
- $A(e, n, Qb(s)), d = 0, _ = 2;
- return;
- }
- const { host: O, compilerHost: B } = e;
- if (e.projectCompilerOptions = s.options, (P = e.moduleResolutionCache) == null || P.update(s.options), (I = e.typeReferenceDirectiveResolutionCache) == null || I.update(s.options), u = O.createProgram(
- s.fileNames,
- s.options,
- B,
- oje(e, n, s),
- Qb(s),
- s.projectReferences
- ), e.watch) {
- const z = (F = e.moduleResolutionCache) == null ? void 0 : F.getPackageJsonInfoCache().getInternalMap();
- e.lastCachedPackageJsonLookups.set(
- n,
- z && new Set(as(
- z.values(),
- (X) => e.host.realpath && (IO(X) || X.directoryExists) ? e.host.realpath(Bn(X.packageDirectory, "package.json")) : Bn(X.packageDirectory, "package.json")
- ))
- ), e.builderPrograms.set(n, u);
- }
- _++;
- }
- function C(P, I, F) {
- var O, B, z;
- E.assertIsDefined(u), E.assert(
- _ === 1
- /* Emit */
- );
- const { host: X, compilerHost: q } = e, V = /* @__PURE__ */ new Map(), ae = u.getCompilerOptions(), ee = Nb(ae);
- let G, ue;
- const { emitResult: re, diagnostics: ne } = kF(
- u,
- (ie) => X.reportDiagnostic(ie),
- e.write,
- /*reportSummary*/
- void 0,
- (ie, Se, J, oe, _e, he) => {
- var le;
- const me = pd(e, ie);
- if (V.set(pd(e, ie), ie), he?.buildInfo) {
- ue || (ue = yU(e.host));
- const tt = (le = u.hasChangedEmitSignature) == null ? void 0 : le.call(u), Te = SU(e, ie, n);
- Te ? (Te.buildInfo = he.buildInfo, Te.modifiedTime = ue, tt && (Te.latestChangedDtsTime = ue)) : e.buildInfoCache.set(n, {
- path: pd(e, ie),
- buildInfo: he.buildInfo,
- modifiedTime: ue,
- latestChangedDtsTime: tt ? ue : void 0
- });
- }
- const ve = he?.differsOnlyInMap ? RT(e.host, ie) : void 0;
- (P || q.writeFile)(
- ie,
- Se,
- J,
- oe,
- _e,
- he
- ), he?.differsOnlyInMap ? e.host.setModifiedTime(ie, ve) : !ee && e.watch && (G || (G = Cie(e, n))).set(me, ue || (ue = yU(e.host)));
- },
- I,
- /*emitOnlyDtsFiles*/
- void 0,
- F || ((B = (O = e.host).getCustomTransformers) == null ? void 0 : B.call(O, t))
- );
- return (!ae.noEmitOnError || !ne.length) && (V.size || o.type !== 8) && dve(e, s, n, p.Updating_unchanged_output_timestamps_of_project_0, V), e.projectErrorsReported.set(n, !0), d = (z = u.hasChangedEmitSignature) != null && z.call(u) ? 0 : 2, ne.length ? (e.diagnostics.set(n, ne), e.projectStatus.set(n, { type: 0, reason: "it had errors" }), d |= 4) : (e.diagnostics.delete(n), e.projectStatus.set(n, {
- type: 1,
- oldestOutputFileName: rw(V.values()) ?? bW(s, !X.useCaseSensitiveFileNames())
- })), cje(e, u), _ = 2, re;
- }
- function D(P, I, F, O) {
- for (; _ <= P && _ < 3; ) {
- const B = _;
- switch (_) {
- case 0:
- T();
- break;
- case 1:
- C(F, I, O);
- break;
- case 2:
- fje(e, t, n, i, s, c, E.checkDefined(d)), _++;
- break;
- }
- E.assert(_ > B);
- }
- }
- }
- function uve(e, t, n) {
- if (!e.projectPendingBuild.size || Xx(t)) return;
- const { options: i, projectPendingBuild: s } = e;
- for (let o = 0; o < t.length; o++) {
- const c = t[o], _ = pg(e, c), u = e.projectPendingBuild.get(_);
- if (u === void 0) continue;
- n && (n = !1, Cve(e, t));
- const d = v6(e, c, _);
- if (!d) {
- xve(e, _), s.delete(_);
- continue;
- }
- u === 2 ? (vve(e, c, _, d), bve(e, _, d), Sve(e, c, _, d), wie(e, c, _, d), Aie(e, c, _, d)) : u === 1 && (d.fileNames = bD(d.options.configFile.configFileSpecs, Xn(c), d.options, e.parseConfigFileHost), DO(d.fileNames, c, d.options.configFile.configFileSpecs, d.errors, vD(d.raw)), wie(e, c, _, d), Aie(e, c, _, d));
- const g = Die(e, d, _);
- if (!i.force) {
- if (g.type === 1) {
- xU(e, c, g), $A(e, _, Qb(d)), s.delete(_), i.dry && rf(e, p.Project_0_is_up_to_date, c);
- continue;
- }
- if (g.type === 2 || g.type === 15)
- return $A(e, _, Qb(d)), {
- kind: 1,
- status: g,
- project: c,
- projectPath: _,
- projectIndex: o,
- config: d
- };
- }
- if (g.type === 12) {
- xU(e, c, g), $A(e, _, Qb(d)), s.delete(_), i.verbose && rf(
- e,
- g.upstreamProjectBlocked ? p.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : p.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
- c,
- g.upstreamProjectName
- );
- continue;
- }
- if (g.type === 16) {
- xU(e, c, g), $A(e, _, Qb(d)), s.delete(_);
- continue;
- }
- return {
- kind: 0,
- status: g,
- project: c,
- projectPath: _,
- projectIndex: o,
- config: d
- };
- }
- }
- function _ve(e, t, n) {
- return xU(e, t.project, t.status), t.kind !== 1 ? aje(
- e,
- t.project,
- t.projectPath,
- t.projectIndex,
- t.config,
- t.status,
- n
- ) : sje(
- e,
- t.project,
- t.projectPath,
- t.config,
- n
- );
- }
- function kie(e, t, n) {
- const i = uve(e, t, n);
- return i && _ve(e, i, t);
- }
- function oje({ options: e, builderPrograms: t, compilerHost: n }, i, s) {
- if (e.force) return;
- const o = t.get(i);
- return o || DF(s.options, n);
- }
- function cje(e, t) {
- t && (e.host.afterProgramEmitAndDiagnostics && e.host.afterProgramEmitAndDiagnostics(t), t.releaseProgram()), e.projectCompilerOptions = e.baseCompilerOptions;
- }
- function vU(e) {
- return !!e.watcher;
- }
- function fve(e, t) {
- const n = pd(e, t), i = e.filesWatched.get(n);
- if (e.watch && i) {
- if (!vU(i)) return i;
- if (i.modifiedTime) return i.modifiedTime;
- }
- const s = RT(e.host, t);
- return e.watch && (i ? i.modifiedTime = s : e.filesWatched.set(n, s)), s;
- }
- function bU(e, t, n, i, s, o, c) {
- const _ = pd(e, t), u = e.filesWatched.get(_);
- if (u && vU(u))
- u.callbacks.push(n);
- else {
- const d = e.watchFile(
- t,
- (g, h, S) => {
- const T = E.checkDefined(e.filesWatched.get(_));
- E.assert(vU(T)), T.modifiedTime = S, T.callbacks.forEach((C) => C(g, h, S));
- },
- i,
- s,
- o,
- c
- );
- e.filesWatched.set(_, { callbacks: [n], watcher: d, modifiedTime: u });
- }
- return {
- close: () => {
- const d = E.checkDefined(e.filesWatched.get(_));
- E.assert(vU(d)), d.callbacks.length === 1 ? (e.filesWatched.delete(_), mp(d)) : LT(d.callbacks, n);
- }
- };
- }
- function Cie(e, t) {
- if (!e.watch) return;
- let n = e.outputTimeStamps.get(t);
- return n || e.outputTimeStamps.set(t, n = /* @__PURE__ */ new Map()), n;
- }
- function SU(e, t, n) {
- const i = pd(e, t), s = e.buildInfoCache.get(n);
- return s?.path === i ? s : void 0;
- }
- function pve(e, t, n, i) {
- const s = pd(e, t), o = e.buildInfoCache.get(n);
- if (o !== void 0 && o.path === s)
- return o.buildInfo || void 0;
- const c = e.readFileWithCache(t), _ = c ? xW(t, c) : void 0;
- return e.buildInfoCache.set(n, { path: s, buildInfo: _ || !1, modifiedTime: i || q_ }), _;
- }
- function Eie(e, t, n, i) {
- const s = fve(e, t);
- if (n < s)
- return {
- type: 5,
- outOfDateOutputFileName: i,
- newerInputFileName: t
- };
- }
- function lje(e, t, n) {
- var i, s, o, c, _;
- if (!t.fileNames.length && !vD(t.raw))
- return {
- type: 16
- /* ContainerOnly */
- };
- let u;
- const d = !!e.options.force;
- if (t.projectReferences) {
- e.projectStatus.set(n, {
- type: 13
- /* ComputingUpstream */
- });
- for (const ne of t.projectReferences) {
- const ie = g6(ne), Se = pg(e, ie), J = v6(e, ie, Se), oe = Die(e, J, Se);
- if (!(oe.type === 13 || oe.type === 16)) {
- if (e.options.stopBuildOnErrors && (oe.type === 0 || oe.type === 12))
- return {
- type: 12,
- upstreamProjectName: ne.path,
- upstreamProjectBlocked: oe.type === 12
- /* UpstreamBlocked */
- };
- d || (u || (u = [])).push({ ref: ne, refStatus: oe, resolvedRefPath: Se, resolvedConfig: J });
- }
- }
- }
- if (d) return {
- type: 17
- /* ForceBuild */
- };
- const { host: g } = e, h = bv(t.options), S = Nb(t.options);
- let T = SU(e, h, n);
- const C = T?.modifiedTime || RT(g, h);
- if (C === q_)
- return T || e.buildInfoCache.set(n, {
- path: pd(e, h),
- buildInfo: !1,
- modifiedTime: C
- }), {
- type: 3,
- missingOutputFileName: h
- };
- const D = pve(e, h, n, C);
- if (!D)
- return {
- type: 4,
- fileName: h
- };
- const P = S && VA(D) ? D : void 0;
- if ((P || !S) && D.version !== U_)
- return {
- type: 14,
- version: D.version
- };
- if (!t.options.noCheck && (D.errors || // TODO: syntax errors????
- D.checkPending))
- return {
- type: 8,
- buildInfoFile: h
- };
- if (P) {
- if (!t.options.noCheck && ((i = P.changeFileSet) != null && i.length || (s = P.semanticDiagnosticsPerFile) != null && s.length || P_(t.options) && ((o = P.emitDiagnosticsPerFile) != null && o.length)))
- return {
- type: 8,
- buildInfoFile: h
- };
- if (!t.options.noEmit && ((c = P.changeFileSet) != null && c.length || (_ = P.affectedFilesPendingEmit) != null && _.length || P.pendingEmit !== void 0))
- return {
- type: 7,
- buildInfoFile: h
- };
- if ((!t.options.noEmit || t.options.noEmit && P_(t.options)) && hF(
- t.options,
- P.options || {},
- /*emitOnlyDtsFiles*/
- void 0,
- !!t.options.noEmit
- ))
- return {
- type: 9,
- buildInfoFile: h
- };
- }
- let I = C, F = h, O, B = KRe, z = !1;
- const X = /* @__PURE__ */ new Set();
- let q;
- for (const ne of t.fileNames) {
- const ie = fve(e, ne);
- if (ie === q_)
- return {
- type: 0,
- reason: `${ne} does not exist`
- };
- const Se = pd(e, ne);
- if (C < ie) {
- let J, oe;
- if (P) {
- q || (q = XW(P, h, g));
- const _e = q.roots.get(Se);
- J = q.fileInfos.get(_e ?? Se);
- const he = J ? e.readFileWithCache(_e ?? ne) : void 0;
- oe = he !== void 0 ? CF(g, he) : void 0, J && J === oe && (z = !0);
- }
- if (!J || J !== oe)
- return {
- type: 5,
- outOfDateOutputFileName: h,
- newerInputFileName: ne
- };
- }
- ie > B && (O = ne, B = ie), X.add(Se);
- }
- let V;
- if (P ? (q || (q = XW(P, h, g)), V = El(
- q.roots,
- // File was root file when project was built but its not any more
- (ne, ie) => X.has(ie) ? void 0 : ie
- )) : V = ir(
- sie(D, h, g),
- (ne) => X.has(ne) ? void 0 : ne
- ), V)
- return {
- type: 10,
- buildInfoFile: h,
- inputFile: V
- };
- if (!S) {
- const ne = rF(t, !g.useCaseSensitiveFileNames()), ie = Cie(e, n);
- for (const Se of ne) {
- if (Se === h) continue;
- const J = pd(e, Se);
- let oe = ie?.get(J);
- if (oe || (oe = RT(e.host, Se), ie?.set(J, oe)), oe === q_)
- return {
- type: 3,
- missingOutputFileName: Se
- };
- if (oe < B)
- return {
- type: 5,
- outOfDateOutputFileName: Se,
- newerInputFileName: O
- };
- oe < I && (I = oe, F = Se);
- }
- }
- let ae = !1;
- if (u)
- for (const { ref: ne, refStatus: ie, resolvedConfig: Se, resolvedRefPath: J } of u) {
- if (ie.newestInputFileTime && ie.newestInputFileTime <= I)
- continue;
- if (uje(e, T ?? (T = e.buildInfoCache.get(n)), J))
- return {
- type: 6,
- outOfDateOutputFileName: h,
- newerProjectName: ne.path
- };
- const oe = _je(e, Se.options, J);
- if (oe && oe <= I) {
- ae = !0;
- continue;
- }
- return E.assert(F !== void 0, "Should have an oldest output filename here"), {
- type: 6,
- outOfDateOutputFileName: F,
- newerProjectName: ne.path
- };
- }
- const ee = Eie(e, t.options.configFilePath, I, F);
- if (ee) return ee;
- const G = ir(t.options.configFile.extendedSourceFiles || Ue, (ne) => Eie(e, ne, I, F));
- if (G) return G;
- const ue = e.lastCachedPackageJsonLookups.get(n), re = ue && Ch(
- ue,
- (ne) => Eie(e, ne, I, F)
- );
- return re || {
- type: ae ? 2 : z ? 15 : 1,
- newestInputFileTime: B,
- newestInputFileName: O,
- oldestOutputFileName: F
- };
- }
- function uje(e, t, n) {
- return e.buildInfoCache.get(n).path === t.path;
- }
- function Die(e, t, n) {
- if (t === void 0)
- return { type: 0, reason: "config file deleted mid-build" };
- const i = e.projectStatus.get(n);
- if (i !== void 0)
- return i;
- Ko("SolutionBuilder::beforeUpToDateCheck");
- const s = lje(e, t, n);
- return Ko("SolutionBuilder::afterUpToDateCheck"), rp("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck"), e.projectStatus.set(n, s), s;
- }
- function dve(e, t, n, i, s) {
- if (t.options.noEmit) return;
- let o;
- const c = bv(t.options), _ = Nb(t.options);
- if (c && _) {
- s?.has(pd(e, c)) || (e.options.verbose && rf(e, i, t.options.configFilePath), e.host.setModifiedTime(c, o = yU(e.host)), SU(e, c, n).modifiedTime = o), e.outputTimeStamps.delete(n);
- return;
- }
- const { host: u } = e, d = rF(t, !u.useCaseSensitiveFileNames()), g = Cie(e, n), h = g ? /* @__PURE__ */ new Set() : void 0;
- if (!s || d.length !== s.size) {
- let S = !!e.options.verbose;
- for (const T of d) {
- const C = pd(e, T);
- s?.has(C) || (S && (S = !1, rf(e, i, t.options.configFilePath)), u.setModifiedTime(T, o || (o = yU(e.host))), T === c ? SU(e, c, n).modifiedTime = o : g && (g.set(C, o), h.add(C)));
- }
- }
- g?.forEach((S, T) => {
- !s?.has(T) && !h.has(T) && g.delete(T);
- });
- }
- function _je(e, t, n) {
- if (!t.composite) return;
- const i = E.checkDefined(e.buildInfoCache.get(n));
- if (i.latestChangedDtsTime !== void 0) return i.latestChangedDtsTime || void 0;
- const s = i.buildInfo && VA(i.buildInfo) && i.buildInfo.latestChangedDtsFile ? e.host.getModifiedTime(es(i.buildInfo.latestChangedDtsFile, Xn(i.path))) : void 0;
- return i.latestChangedDtsTime = s || !1, s;
- }
- function mve(e, t, n) {
- if (e.options.dry)
- return rf(e, p.A_non_dry_build_would_update_timestamps_for_output_of_project_0, t.options.configFilePath);
- dve(e, t, n, p.Updating_output_timestamps_of_project_0), e.projectStatus.set(n, {
- type: 1,
- oldestOutputFileName: bW(t, !e.host.useCaseSensitiveFileNames())
- });
- }
- function fje(e, t, n, i, s, o, c) {
- if (!(e.options.stopBuildOnErrors && c & 4) && s.options.composite)
- for (let _ = i + 1; _ < o.length; _++) {
- const u = o[_], d = pg(e, u);
- if (e.projectPendingBuild.has(d)) continue;
- const g = v6(e, u, d);
- if (!(!g || !g.projectReferences))
- for (const h of g.projectReferences) {
- const S = GA(e, h.path);
- if (pg(e, S) !== n) continue;
- const T = e.projectStatus.get(d);
- if (T)
- switch (T.type) {
- case 1:
- if (c & 2) {
- T.type = 2;
- break;
- }
- case 15:
- case 2:
- c & 2 || e.projectStatus.set(d, {
- type: 6,
- outOfDateOutputFileName: T.oldestOutputFileName,
- newerProjectName: t
- });
- break;
- case 12:
- pg(e, GA(e, T.upstreamProjectName)) === n && ave(e, d);
- break;
- }
- ove(
- e,
- d,
- 0
- /* Update */
- );
- break;
- }
- }
- }
- function gve(e, t, n, i, s, o) {
- Ko("SolutionBuilder::beforeBuild");
- const c = pje(e, t, n, i, s, o);
- return Ko("SolutionBuilder::afterBuild"), rp("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"), c;
- }
- function pje(e, t, n, i, s, o) {
- const c = ive(e, t, o);
- if (!c) return 3;
- cve(e, n);
- let _ = !0, u = 0;
- for (; ; ) {
- const d = kie(e, c, _);
- if (!d) break;
- _ = !1, d.done(n, i, s?.(d.project)), e.diagnostics.has(d.projectPath) || u++;
- }
- return Tie(e), kve(e, c), hje(e, c), Xx(c) ? 4 : c.some((d) => e.diagnostics.has(pg(e, d))) ? u ? 2 : 1 : 0;
- }
- function hve(e, t, n) {
- Ko("SolutionBuilder::beforeClean");
- const i = dje(e, t, n);
- return Ko("SolutionBuilder::afterClean"), rp("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean"), i;
- }
- function dje(e, t, n) {
- const i = ive(e, t, n);
- if (!i) return 3;
- if (Xx(i))
- return TU(e, i.circularDiagnostics), 4;
- const { options: s, host: o } = e, c = s.dry ? [] : void 0;
- for (const _ of i) {
- const u = pg(e, _), d = v6(e, _, u);
- if (d === void 0) {
- xve(e, u);
- continue;
- }
- const g = rF(d, !o.useCaseSensitiveFileNames());
- if (!g.length) continue;
- const h = new Set(d.fileNames.map((S) => pd(e, S)));
- for (const S of g)
- h.has(pd(e, S)) || o.fileExists(S) && (c ? c.push(S) : (o.deleteFile(S), Pie(
- e,
- u,
- 0
- /* Update */
- )));
- }
- return c && rf(e, p.A_non_dry_build_would_delete_the_following_files_Colon_0, c.map((_) => `\r
- * ${_}`).join("")), 0;
- }
- function Pie(e, t, n) {
- e.host.getParsedCommandLine && n === 1 && (n = 2), n === 2 && (e.configFileCache.delete(t), e.buildOrder = void 0), e.needsSummary = !0, ave(e, t), ove(e, t, n), sve(e);
- }
- function NF(e, t, n) {
- e.reportFileChangeDetected = !0, Pie(e, t, n), yve(
- e,
- 250,
- /*changeDetected*/
- !0
- );
- }
- function yve(e, t, n) {
- const { hostWithWatch: i } = e;
- !i.setTimeout || !i.clearTimeout || (e.timerToBuildInvalidatedProject && i.clearTimeout(e.timerToBuildInvalidatedProject), e.timerToBuildInvalidatedProject = i.setTimeout(mje, t, "timerToBuildInvalidatedProject", e, n));
- }
- function mje(e, t, n) {
- Ko("SolutionBuilder::beforeBuild");
- const i = gje(t, n);
- Ko("SolutionBuilder::afterBuild"), rp("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"), i && kve(t, i);
- }
- function gje(e, t) {
- e.timerToBuildInvalidatedProject = void 0, e.reportFileChangeDetected && (e.reportFileChangeDetected = !1, e.projectErrorsReported.clear(), Nie(e, p.File_change_detected_Starting_incremental_compilation));
- let n = 0;
- const i = AF(e), s = kie(
- e,
- i,
- /*reportQueue*/
- !1
- );
- if (s)
- for (s.done(), n++; e.projectPendingBuild.size; ) {
- if (e.timerToBuildInvalidatedProject) return;
- const o = uve(
- e,
- i,
- /*reportQueue*/
- !1
- );
- if (!o) break;
- if (o.kind !== 1 && (t || n === 5)) {
- yve(
- e,
- 100,
- /*changeDetected*/
- !1
- );
- return;
- }
- _ve(e, o, i).done(), o.kind !== 1 && n++;
- }
- return Tie(e), i;
- }
- function vve(e, t, n, i) {
- !e.watch || e.allWatchedConfigFiles.has(n) || e.allWatchedConfigFiles.set(
- n,
- bU(
- e,
- t,
- () => NF(
- e,
- n,
- 2
- /* Full */
- ),
- 2e3,
- i?.watchOptions,
- Tl.ConfigFile,
- t
- )
- );
- }
- function bve(e, t, n) {
- iF(
- t,
- n?.options,
- e.allWatchedExtendedConfigFiles,
- (i, s) => bU(
- e,
- i,
- () => {
- var o;
- return (o = e.allWatchedExtendedConfigFiles.get(s)) == null ? void 0 : o.projects.forEach((c) => NF(
- e,
- c,
- 2
- /* Full */
- ));
- },
- 2e3,
- n?.watchOptions,
- Tl.ExtendedConfigFile
- ),
- (i) => pd(e, i)
- );
- }
- function Sve(e, t, n, i) {
- e.watch && RA(
- hie(e.allWatchedWildcardDirectories, n),
- i.wildcardDirectories,
- (s, o) => e.watchDirectory(
- s,
- (c) => {
- var _;
- jA({
- watchedDirPath: pd(e, s),
- fileOrDirectory: c,
- fileOrDirectoryPath: pd(e, c),
- configFileName: t,
- currentDirectory: e.compilerHost.getCurrentDirectory(),
- options: i.options,
- program: e.builderPrograms.get(n) || ((_ = nje(e, n)) == null ? void 0 : _.fileNames),
- useCaseSensitiveFileNames: e.parseConfigFileHost.useCaseSensitiveFileNames,
- writeLog: (u) => e.writeLog(u),
- toPath: (u) => pd(e, u)
- }) || NF(
- e,
- n,
- 1
- /* RootNamesAndUpdate */
- );
- },
- o,
- i?.watchOptions,
- Tl.WildcardDirectory,
- t
- )
- );
- }
- function wie(e, t, n, i) {
- e.watch && M4(
- hie(e.allWatchedInputFiles, n),
- new Set(i.fileNames),
- {
- createNewValue: (s) => bU(
- e,
- s,
- () => NF(
- e,
- n,
- 0
- /* Update */
- ),
- 250,
- i?.watchOptions,
- Tl.SourceFile,
- t
- ),
- onDeleteValue: fd
- }
- );
- }
- function Aie(e, t, n, i) {
- !e.watch || !e.lastCachedPackageJsonLookups || M4(
- hie(e.allWatchedPackageJsonFiles, n),
- e.lastCachedPackageJsonLookups.get(n),
- {
- createNewValue: (s) => bU(
- e,
- s,
- () => NF(
- e,
- n,
- 0
- /* Update */
- ),
- 2e3,
- i?.watchOptions,
- Tl.PackageJson,
- t
- ),
- onDeleteValue: fd
- }
- );
- }
- function hje(e, t) {
- if (e.watchAllProjectsPending) {
- Ko("SolutionBuilder::beforeWatcherCreation"), e.watchAllProjectsPending = !1;
- for (const n of HA(t)) {
- const i = pg(e, n), s = v6(e, n, i);
- vve(e, n, i, s), bve(e, i, s), s && (Sve(e, n, i, s), wie(e, n, i, s), Aie(e, n, i, s));
- }
- Ko("SolutionBuilder::afterWatcherCreation"), rp("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation");
- }
- }
- function yje(e) {
- D_(e.allWatchedConfigFiles, fd), D_(e.allWatchedExtendedConfigFiles, mp), D_(e.allWatchedWildcardDirectories, (t) => D_(t, mp)), D_(e.allWatchedInputFiles, (t) => D_(t, fd)), D_(e.allWatchedPackageJsonFiles, (t) => D_(t, fd));
- }
- function Tve(e, t, n, i, s) {
- const o = rje(e, t, n, i, s);
- return {
- build: (c, _, u, d) => gve(o, c, _, u, d),
- clean: (c) => hve(o, c),
- buildReferences: (c, _, u, d) => gve(
- o,
- c,
- _,
- u,
- d,
- /*onlyReferences*/
- !0
- ),
- cleanReferences: (c) => hve(
- o,
- c,
- /*onlyReferences*/
- !0
- ),
- getNextInvalidatedProject: (c) => (cve(o, c), kie(
- o,
- AF(o),
- /*reportQueue*/
- !1
- )),
- getBuildOrder: () => AF(o),
- getUpToDateStatusOfProject: (c) => {
- const _ = GA(o, c), u = pg(o, _);
- return Die(o, v6(o, _, u), u);
- },
- invalidateProject: (c, _) => Pie(
- o,
- c,
- _ || 0
- /* Update */
- ),
- close: () => yje(o)
- };
- }
- function Ql(e, t) {
- return VE(t, e.compilerHost.getCurrentDirectory(), e.compilerHost.getCanonicalFileName);
- }
- function rf(e, t, ...n) {
- e.host.reportSolutionBuilderStatus(Go(t, ...n));
- }
- function Nie(e, t, ...n) {
- var i, s;
- (s = (i = e.hostWithWatch).onWatchStatusChange) == null || s.call(i, Go(t, ...n), e.host.getNewLine(), e.baseCompilerOptions);
- }
- function TU({ host: e }, t) {
- t.forEach((n) => e.reportDiagnostic(n));
- }
- function $A(e, t, n) {
- TU(e, n), e.projectErrorsReported.set(t, !0), n.length && e.diagnostics.set(t, n);
- }
- function xve(e, t) {
- $A(e, t, [e.configFileCache.get(t)]);
- }
- function kve(e, t) {
- if (!e.needsSummary) return;
- e.needsSummary = !1;
- const n = e.watch || !!e.host.reportErrorSummary, { diagnostics: i } = e;
- let s = 0, o = [];
- Xx(t) ? (Cve(e, t.buildOrder), TU(e, t.circularDiagnostics), n && (s += TF(t.circularDiagnostics)), n && (o = [...o, ...xF(t.circularDiagnostics)])) : (t.forEach((c) => {
- const _ = pg(e, c);
- e.projectErrorsReported.has(_) || TU(e, i.get(_) || Ue);
- }), n && i.forEach((c) => s += TF(c)), n && i.forEach((c) => [...o, ...xF(c)])), e.watch ? Nie(e, tU(s), s) : e.host.reportErrorSummary && e.host.reportErrorSummary(s, o);
- }
- function Cve(e, t) {
- e.options.verbose && rf(e, p.Projects_in_this_build_Colon_0, t.map((n) => `\r
- * ` + Ql(e, n)).join(""));
- }
- function vje(e, t, n) {
- switch (n.type) {
- case 5:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,
- Ql(e, t),
- Ql(e, n.outOfDateOutputFileName),
- Ql(e, n.newerInputFileName)
- );
- case 6:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,
- Ql(e, t),
- Ql(e, n.outOfDateOutputFileName),
- Ql(e, n.newerProjectName)
- );
- case 3:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_output_file_1_does_not_exist,
- Ql(e, t),
- Ql(e, n.missingOutputFileName)
- );
- case 4:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_there_was_error_reading_file_1,
- Ql(e, t),
- Ql(e, n.fileName)
- );
- case 7:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,
- Ql(e, t),
- Ql(e, n.buildInfoFile)
- );
- case 8:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,
- Ql(e, t),
- Ql(e, n.buildInfoFile)
- );
- case 9:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,
- Ql(e, t),
- Ql(e, n.buildInfoFile)
- );
- case 10:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
- Ql(e, t),
- Ql(e, n.buildInfoFile),
- Ql(e, n.inputFile)
- );
- case 1:
- if (n.newestInputFileTime !== void 0)
- return rf(
- e,
- p.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,
- Ql(e, t),
- Ql(e, n.newestInputFileName || ""),
- Ql(e, n.oldestOutputFileName || "")
- );
- break;
- case 2:
- return rf(
- e,
- p.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
- Ql(e, t)
- );
- case 15:
- return rf(
- e,
- p.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
- Ql(e, t)
- );
- case 11:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,
- Ql(e, t),
- Ql(e, n.upstreamProjectName)
- );
- case 12:
- return rf(
- e,
- n.upstreamProjectBlocked ? p.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : p.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
- Ql(e, t),
- Ql(e, n.upstreamProjectName)
- );
- case 0:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_1,
- Ql(e, t),
- n.reason
- );
- case 14:
- return rf(
- e,
- p.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
- Ql(e, t),
- n.version,
- U_
- );
- case 17:
- return rf(
- e,
- p.Project_0_is_being_forcibly_rebuilt,
- Ql(e, t)
- );
- }
- }
- function xU(e, t, n) {
- e.options.verbose && vje(e, t, n);
- }
- var Iie = /* @__PURE__ */ ((e) => (e[e.time = 0] = "time", e[e.count = 1] = "count", e[e.memory = 2] = "memory", e))(Iie || {});
- function bje(e) {
- const t = Sje();
- return ir(e.getSourceFiles(), (n) => {
- const i = Tje(e, n), s = Ag(n).length;
- t.set(i, t.get(i) + s);
- }), t;
- }
- function Sje() {
- const e = /* @__PURE__ */ new Map();
- return e.set("Library", 0), e.set("Definitions", 0), e.set("TypeScript", 0), e.set("JavaScript", 0), e.set("JSON", 0), e.set("Other", 0), e;
- }
- function Tje(e, t) {
- if (e.isSourceFileDefaultLibrary(t))
- return "Library";
- if (t.isDeclarationFile)
- return "Definitions";
- const n = t.path;
- return xc(n, iJ) ? "TypeScript" : xc(n, jC) ? "JavaScript" : qo(
- n,
- ".json"
- /* Json */
- ) ? "JSON" : "Other";
- }
- function kU(e, t, n) {
- return IF(e, n) ? $x(
- e,
- /*pretty*/
- !0
- ) : t;
- }
- function Eve(e) {
- return !!e.writeOutputIsTTY && e.writeOutputIsTTY() && !e.getEnvironmentVariable("NO_COLOR");
- }
- function IF(e, t) {
- return !t || typeof t.pretty > "u" ? Eve(e) : t.pretty;
- }
- function Dve(e) {
- return e.options.all ? V_(Od, (t, n) => sw(t.name, n.name)) : Ln(Od.slice(), (t) => !!t.showInSimplifiedHelpView);
- }
- function CU(e) {
- e.write(g_(p.Version_0, U_) + e.newLine);
- }
- function EU(e) {
- if (!Eve(e))
- return {
- bold: (g) => g,
- blue: (g) => g,
- blueBackground: (g) => g,
- brightWhite: (g) => g
- };
- function n(g) {
- return `\x1B[1m${g}\x1B[22m`;
- }
- const i = e.getEnvironmentVariable("OS") && e.getEnvironmentVariable("OS").toLowerCase().includes("windows"), s = e.getEnvironmentVariable("WT_SESSION"), o = e.getEnvironmentVariable("TERM_PROGRAM") && e.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
- function c(g) {
- return i && !s && !o ? d(g) : `\x1B[94m${g}\x1B[39m`;
- }
- const _ = e.getEnvironmentVariable("COLORTERM") === "truecolor" || e.getEnvironmentVariable("TERM") === "xterm-256color";
- function u(g) {
- return _ ? `\x1B[48;5;68m${g}\x1B[39;49m` : `\x1B[44m${g}\x1B[39;49m`;
- }
- function d(g) {
- return `\x1B[97m${g}\x1B[39m`;
- }
- return {
- bold: n,
- blue: c,
- brightWhite: d,
- blueBackground: u
- };
- }
- function Pve(e) {
- return `--${e.name}${e.shortName ? `, -${e.shortName}` : ""}`;
- }
- function xje(e, t, n, i) {
- var s;
- const o = [], c = EU(e), _ = Pve(t), u = C(t), d = typeof t.defaultValueDescription == "object" ? g_(t.defaultValueDescription) : h(
- t.defaultValueDescription,
- t.type === "list" || t.type === "listOrElement" ? t.element.type : t.type
- ), g = ((s = e.getWidthOfTerminal) == null ? void 0 : s.call(e)) ?? 0;
- if (g >= 80) {
- let D = "";
- t.description && (D = g_(t.description)), o.push(...T(
- _,
- D,
- n,
- i,
- g,
- /*colorLeft*/
- !0
- ), e.newLine), S(u, t) && (u && o.push(...T(
- u.valueType,
- u.possibleValues,
- n,
- i,
- g,
- /*colorLeft*/
- !1
- ), e.newLine), d && o.push(...T(
- g_(p.default_Colon),
- d,
- n,
- i,
- g,
- /*colorLeft*/
- !1
- ), e.newLine)), o.push(e.newLine);
- } else {
- if (o.push(c.blue(_), e.newLine), t.description) {
- const D = g_(t.description);
- o.push(D);
- }
- if (o.push(e.newLine), S(u, t)) {
- if (u && o.push(`${u.valueType} ${u.possibleValues}`), d) {
- u && o.push(e.newLine);
- const D = g_(p.default_Colon);
- o.push(`${D} ${d}`);
- }
- o.push(e.newLine);
- }
- o.push(e.newLine);
- }
- return o;
- function h(D, P) {
- return D !== void 0 && typeof P == "object" ? as(P.entries()).filter(([, I]) => I === D).map(([I]) => I).join("/") : String(D);
- }
- function S(D, P) {
- const I = ["string"], F = [void 0, "false", "n/a"], O = P.defaultValueDescription;
- return !(P.category === p.Command_line_Options || ss(I, D?.possibleValues) && ss(F, O));
- }
- function T(D, P, I, F, O, B) {
- const z = [];
- let X = !0, q = P;
- const V = O - F;
- for (; q.length > 0; ) {
- let ae = "";
- X ? (ae = D.padStart(I), ae = ae.padEnd(F), ae = B ? c.blue(ae) : ae) : ae = "".padStart(F);
- const ee = q.substr(0, V);
- q = q.slice(V), z.push(`${ae}${ee}`), X = !1;
- }
- return z;
- }
- function C(D) {
- if (D.type === "object")
- return;
- return {
- valueType: P(D),
- possibleValues: I(D)
- };
- function P(F) {
- switch (E.assert(F.type !== "listOrElement"), F.type) {
- case "string":
- case "number":
- case "boolean":
- return g_(p.type_Colon);
- case "list":
- return g_(p.one_or_more_Colon);
- default:
- return g_(p.one_of_Colon);
- }
- }
- function I(F) {
- let O;
- switch (F.type) {
- case "string":
- case "number":
- case "boolean":
- O = F.type;
- break;
- case "list":
- case "listOrElement":
- O = I(F.element);
- break;
- case "object":
- O = "";
- break;
- default:
- const B = {};
- return F.type.forEach((z, X) => {
- var q;
- (q = F.deprecatedKeys) != null && q.has(X) || (B[z] || (B[z] = [])).push(X);
- }), Object.entries(B).map(([, z]) => z.join("/")).join(", ");
- }
- return O;
- }
- }
- }
- function wve(e, t) {
- let n = 0;
- for (const c of t) {
- const _ = Pve(c).length;
- n = n > _ ? n : _;
- }
- const i = n + 2, s = i + 2;
- let o = [];
- for (const c of t) {
- const _ = xje(e, c, i, s);
- o = [...o, ..._];
- }
- return o[o.length - 2] !== e.newLine && o.push(e.newLine), o;
- }
- function XA(e, t, n, i, s, o) {
- let c = [];
- if (c.push(EU(e).bold(t) + e.newLine + e.newLine), s && c.push(s + e.newLine + e.newLine), !i)
- return c = [...c, ...wve(e, n)], o && c.push(o + e.newLine + e.newLine), c;
- const _ = /* @__PURE__ */ new Map();
- for (const u of n) {
- if (!u.category)
- continue;
- const d = g_(u.category), g = _.get(d) ?? [];
- g.push(u), _.set(d, g);
- }
- return _.forEach((u, d) => {
- c.push(`### ${d}${e.newLine}${e.newLine}`), c = [...c, ...wve(e, u)];
- }), o && c.push(o + e.newLine + e.newLine), c;
- }
- function kje(e, t) {
- const n = EU(e);
- let i = [...DU(e, `${g_(p.tsc_Colon_The_TypeScript_Compiler)} - ${g_(p.Version_0, U_)}`)];
- i.push(n.bold(g_(p.COMMON_COMMANDS)) + e.newLine + e.newLine), c("tsc", p.Compiles_the_current_project_tsconfig_json_in_the_working_directory), c("tsc app.ts util.ts", p.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options), c("tsc -b", p.Build_a_composite_project_in_the_working_directory), c("tsc --init", p.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory), c("tsc -p ./path/to/tsconfig.json", p.Compiles_the_TypeScript_project_located_at_the_specified_path), c("tsc --help --all", p.An_expanded_version_of_this_information_showing_all_possible_compiler_options), c(["tsc --noEmit", "tsc --target esnext"], p.Compiles_the_current_project_with_additional_settings);
- const s = t.filter((_) => _.isCommandLineOnly || _.category === p.Command_line_Options), o = t.filter((_) => !ss(s, _));
- i = [
- ...i,
- ...XA(
- e,
- g_(p.COMMAND_LINE_FLAGS),
- s,
- /*subCategory*/
- !1,
- /*beforeOptionsDescription*/
- void 0,
- /*afterOptionsDescription*/
- void 0
- ),
- ...XA(
- e,
- g_(p.COMMON_COMPILER_OPTIONS),
- o,
- /*subCategory*/
- !1,
- /*beforeOptionsDescription*/
- void 0,
- dx(p.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc")
- )
- ];
- for (const _ of i)
- e.write(_);
- function c(_, u) {
- const d = typeof _ == "string" ? [_] : _;
- for (const g of d)
- i.push(" " + n.blue(g) + e.newLine);
- i.push(" " + g_(u) + e.newLine + e.newLine);
- }
- }
- function Cje(e, t, n, i) {
- let s = [...DU(e, `${g_(p.tsc_Colon_The_TypeScript_Compiler)} - ${g_(p.Version_0, U_)}`)];
- s = [...s, ...XA(
- e,
- g_(p.ALL_COMPILER_OPTIONS),
- t,
- /*subCategory*/
- !0,
- /*beforeOptionsDescription*/
- void 0,
- dx(p.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc")
- )], s = [...s, ...XA(
- e,
- g_(p.WATCH_OPTIONS),
- i,
- /*subCategory*/
- !1,
- g_(p.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon)
- )], s = [...s, ...XA(
- e,
- g_(p.BUILD_OPTIONS),
- n,
- /*subCategory*/
- !1,
- dx(p.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
- )];
- for (const o of s)
- e.write(o);
- }
- function Ave(e, t) {
- let n = [...DU(e, `${g_(p.tsc_Colon_The_TypeScript_Compiler)} - ${g_(p.Version_0, U_)}`)];
- n = [...n, ...XA(
- e,
- g_(p.BUILD_OPTIONS),
- t,
- /*subCategory*/
- !1,
- dx(p.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
- )];
- for (const i of n)
- e.write(i);
- }
- function DU(e, t) {
- var n;
- const i = EU(e), s = [], o = ((n = e.getWidthOfTerminal) == null ? void 0 : n.call(e)) ?? 0, c = 5, _ = i.blueBackground("".padStart(c)), u = i.blueBackground(i.brightWhite("TS ".padStart(c)));
- if (o >= t.length + c) {
- const g = (o > 120 ? 120 : o) - c;
- s.push(t.padEnd(g) + _ + e.newLine), s.push("".padStart(g) + u + e.newLine);
- } else
- s.push(t + e.newLine), s.push(e.newLine);
- return s;
- }
- function Nve(e, t) {
- t.options.all ? Cje(e, Dve(t), hz, zx) : kje(e, Dve(t));
- }
- function Ive(e, t, n) {
- let i = $x(e);
- if (n.options.build)
- return i(Go(p.Option_build_must_be_the_first_command_line_argument)), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- let s;
- if (n.options.locale && lj(n.options.locale, e, n.errors), n.errors.length > 0)
- return n.errors.forEach(i), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- if (n.options.init)
- return wje(e, i, n.options, n.fileNames), e.exit(
- 0
- /* Success */
- );
- if (n.options.version)
- return CU(e), e.exit(
- 0
- /* Success */
- );
- if (n.options.help || n.options.all)
- return Nve(e, n), e.exit(
- 0
- /* Success */
- );
- if (n.options.watch && n.options.listFilesOnly)
- return i(Go(p.Options_0_and_1_cannot_be_combined, "watch", "listFilesOnly")), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- if (n.options.project) {
- if (n.fileNames.length !== 0)
- return i(Go(p.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- const _ = Os(n.options.project);
- if (!_ || e.directoryExists(_)) {
- if (s = Bn(_, "tsconfig.json"), !e.fileExists(s))
- return i(Go(p.Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0, n.options.project)), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- } else if (s = _, !e.fileExists(s))
- return i(Go(p.The_specified_path_does_not_exist_Colon_0, n.options.project)), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- } else if (n.fileNames.length === 0) {
- const _ = Os(e.getCurrentDirectory());
- s = PW(_, (u) => e.fileExists(u));
- }
- if (n.fileNames.length === 0 && !s)
- return n.options.showConfig ? i(Go(p.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, Os(e.getCurrentDirectory()))) : (CU(e), Nve(e, n)), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- const o = e.getCurrentDirectory(), c = kO(
- n.options,
- (_) => es(_, o)
- );
- if (s) {
- const _ = /* @__PURE__ */ new Map(), u = pie(s, c, _, n.watchOptions, e, i);
- if (c.showConfig)
- return u.errors.length !== 0 ? (i = kU(
- e,
- i,
- u.options
- ), u.errors.forEach(i), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- )) : (e.write(JSON.stringify(Cz(u, s, e), null, 4) + e.newLine), e.exit(
- 0
- /* Success */
- ));
- if (i = kU(
- e,
- i,
- u.options
- ), UB(u.options))
- return Fie(e, i) ? void 0 : Eje(
- e,
- t,
- i,
- u,
- c,
- n.watchOptions,
- _
- );
- Nb(u.options) ? Mve(
- e,
- t,
- i,
- u
- ) : Lve(
- e,
- t,
- i,
- u
- );
- } else {
- if (c.showConfig)
- return e.write(JSON.stringify(Cz(n, Bn(o, "tsconfig.json"), e), null, 4) + e.newLine), e.exit(
- 0
- /* Success */
- );
- if (i = kU(
- e,
- i,
- c
- ), UB(c))
- return Fie(e, i) ? void 0 : Dje(
- e,
- t,
- i,
- n.fileNames,
- c,
- n.watchOptions
- );
- Nb(c) ? Mve(
- e,
- t,
- i,
- { ...n, options: c }
- ) : Lve(
- e,
- t,
- i,
- { ...n, options: c }
- );
- }
- }
- function Oie(e) {
- if (e.length > 0 && e[0].charCodeAt(0) === 45) {
- const t = e[0].slice(e[0].charCodeAt(1) === 45 ? 2 : 1).toLowerCase();
- return t === "build" || t === "b";
- }
- return !1;
- }
- function Ove(e, t, n) {
- if (Oie(n)) {
- const { buildOptions: s, watchOptions: o, projects: c, errors: _ } = $te(n.slice(1));
- if (s.generateCpuProfile && e.enableCPUProfiler)
- e.enableCPUProfiler(s.generateCpuProfile, () => Fve(
- e,
- t,
- s,
- o,
- c,
- _
- ));
- else
- return Fve(
- e,
- t,
- s,
- o,
- c,
- _
- );
- }
- const i = Hte(n, (s) => e.readFile(s));
- if (i.options.generateCpuProfile && e.enableCPUProfiler)
- e.enableCPUProfiler(i.options.generateCpuProfile, () => Ive(
- e,
- t,
- i
- ));
- else
- return Ive(e, t, i);
- }
- function Fie(e, t) {
- return !e.watchFile || !e.watchDirectory ? (t(Go(p.The_current_host_does_not_support_the_0_option, "--watch")), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- ), !0) : !1;
- }
- var OF = 2;
- function Fve(e, t, n, i, s, o) {
- const c = kU(
- e,
- $x(e),
- n
- );
- if (n.locale && lj(n.locale, e, o), o.length > 0)
- return o.forEach(c), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- if (n.help || s.length === 0)
- return CU(e), Ave(e, hA), e.exit(
- 0
- /* Success */
- );
- if (!e.getModifiedTime || !e.setModifiedTime || n.clean && !e.deleteFile)
- return c(Go(p.The_current_host_does_not_support_the_0_option, "--build")), e.exit(
- 1
- /* DiagnosticsPresent_OutputsSkipped */
- );
- if (n.watch) {
- if (Fie(e, c)) return;
- const h = vie(
- e,
- /*createProgram*/
- void 0,
- c,
- wF(e, IF(e, n)),
- Mie(e, n)
- );
- h.jsDocParsingMode = OF;
- const S = Jve(e, n);
- Rve(e, t, h, S);
- const T = h.onWatchStatusChange;
- let C = !1;
- h.onWatchStatusChange = (P, I, F, O) => {
- T?.(P, I, F, O), C && (P.code === p.Found_0_errors_Watching_for_file_changes.code || P.code === p.Found_1_error_Watching_for_file_changes.code) && Rie(D, S);
- };
- const D = Sie(h, s, n, i);
- return D.build(), Rie(D, S), C = !0, D;
- }
- const _ = yie(
- e,
- /*createProgram*/
- void 0,
- c,
- wF(e, IF(e, n)),
- Lie(e, n)
- );
- _.jsDocParsingMode = OF;
- const u = Jve(e, n);
- Rve(e, t, _, u);
- const d = bie(_, s, n), g = n.clean ? d.clean() : d.build();
- return Rie(d, u), zX(), e.exit(g);
- }
- function Lie(e, t) {
- return IF(e, t) ? (n, i) => e.write(rU(n, i, e.newLine, e)) : void 0;
- }
- function Lve(e, t, n, i) {
- const { fileNames: s, options: o, projectReferences: c } = i, _ = aF(
- o,
- /*setParentNodes*/
- void 0,
- e
- );
- _.jsDocParsingMode = OF;
- const u = _.getCurrentDirectory(), d = zl(_.useCaseSensitiveFileNames());
- MD(_, (T) => uo(T, u, d)), jie(
- e,
- o,
- /*isBuildMode*/
- !1
- );
- const g = {
- rootNames: s,
- options: o,
- projectReferences: c,
- host: _,
- configFileParsingDiagnostics: Qb(i)
- }, h = WA(g), S = lU(
- h,
- n,
- (T) => e.write(T + e.newLine),
- Lie(e, o)
- );
- return wU(
- e,
- h,
- /*solutionPerformance*/
- void 0
- ), t(h), e.exit(S);
- }
- function Mve(e, t, n, i) {
- const { options: s, fileNames: o, projectReferences: c } = i;
- jie(
- e,
- s,
- /*isBuildMode*/
- !1
- );
- const _ = PF(s, e);
- _.jsDocParsingMode = OF;
- const u = die({
- host: _,
- system: e,
- rootNames: o,
- options: s,
- configFileParsingDiagnostics: Qb(i),
- projectReferences: c,
- reportDiagnostic: n,
- reportErrorSummary: Lie(e, s),
- afterProgramEmitAndDiagnostics: (d) => {
- wU(
- e,
- d.getProgram(),
- /*solutionPerformance*/
- void 0
- ), t(d);
- }
- });
- return e.exit(u);
- }
- function Rve(e, t, n, i) {
- jve(
- e,
- n,
- /*isBuildMode*/
- !0
- ), n.afterProgramEmitAndDiagnostics = (s) => {
- wU(e, s.getProgram(), i), t(s);
- };
- }
- function jve(e, t, n) {
- const i = t.createProgram;
- t.createProgram = (s, o, c, _, u, d) => (E.assert(s !== void 0 || o === void 0 && !!_), o !== void 0 && jie(e, o, n), i(s, o, c, _, u, d));
- }
- function Bve(e, t, n) {
- n.jsDocParsingMode = OF, jve(
- e,
- n,
- /*isBuildMode*/
- !1
- );
- const i = n.afterProgramCreate;
- n.afterProgramCreate = (s) => {
- i(s), wU(
- e,
- s.getProgram(),
- /*solutionPerformance*/
- void 0
- ), t(s);
- };
- }
- function Mie(e, t) {
- return eU(e, IF(e, t));
- }
- function Eje(e, t, n, i, s, o, c) {
- const _ = dU({
- configFileName: i.options.configFilePath,
- optionsToExtend: s,
- watchOptionsToExtend: o,
- system: e,
- reportDiagnostic: n,
- reportWatchStatus: Mie(e, i.options)
- });
- return Bve(e, t, _), _.configFileParsingResult = i, _.extendedConfigCache = c, gU(_);
- }
- function Dje(e, t, n, i, s, o) {
- const c = mU({
- rootFiles: i,
- options: s,
- watchOptions: o,
- system: e,
- reportDiagnostic: n,
- reportWatchStatus: Mie(e, s)
- });
- return Bve(e, t, c), gU(c);
- }
- function Jve(e, t) {
- if (e === ll && t.extendedDiagnostics)
- return PR(), Pje();
- }
- function Pje() {
- let e;
- return {
- addAggregateStatistic: t,
- forEachAggregateStatistics: n,
- clear: i
- };
- function t(s) {
- const o = e?.get(s.name);
- o ? o.type === 2 ? o.value = Math.max(o.value, s.value) : o.value += s.value : (e ?? (e = /* @__PURE__ */ new Map())).set(s.name, s);
- }
- function n(s) {
- e?.forEach(s);
- }
- function i() {
- e = void 0;
- }
- }
- function Rie(e, t) {
- if (!t) return;
- if (!jX()) {
- ll.write(p.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + `
-`);
- return;
- }
- const n = [];
- n.push(
- {
- name: "Projects in scope",
- value: HA(e.getBuildOrder()).length,
- type: 1
- /* count */
- }
- ), i("SolutionBuilder::Projects built"), i("SolutionBuilder::Timestamps only updates"), i("SolutionBuilder::Bundles updated"), t.forEachAggregateStatistics((o) => {
- o.name = `Aggregate ${o.name}`, n.push(o);
- }), DR((o, c) => {
- PU(o) && n.push({
- name: `${s(o)} time`,
- value: c,
- type: 0
- /* time */
- });
- }), BX(), PR(), t.clear(), Uve(ll, n);
- function i(o) {
- const c = Eme(o);
- c && n.push({
- name: s(o),
- value: c,
- type: 1
- /* count */
- });
- }
- function s(o) {
- return o.replace("SolutionBuilder::", "");
- }
- }
- function zve(e, t) {
- return e === ll && (t.diagnostics || t.extendedDiagnostics);
- }
- function Wve(e, t) {
- return e === ll && t.generateTrace;
- }
- function jie(e, t, n) {
- zve(e, t) && PR(e), Wve(e, t) && JX(n ? "build" : "project", t.generateTrace, t.configFilePath);
- }
- function PU(e) {
- return Ui(e, "SolutionBuilder::");
- }
- function wU(e, t, n) {
- var i;
- const s = t.getCompilerOptions();
- Wve(e, s) && ((i = rn) == null || i.stopTracing());
- let o;
- if (zve(e, s)) {
- o = [];
- const d = e.getMemoryUsage ? e.getMemoryUsage() : -1;
- _("Files", t.getSourceFiles().length);
- const g = bje(t);
- if (s.extendedDiagnostics)
- for (const [P, I] of g.entries())
- _("Lines of " + P, I);
- else
- _("Lines", uX(g.values(), (P, I) => P + I, 0));
- _("Identifiers", t.getIdentifierCount()), _("Symbols", t.getSymbolCount()), _("Types", t.getTypeCount()), _("Instantiations", t.getInstantiationCount()), d >= 0 && c(
- {
- name: "Memory used",
- value: d,
- type: 2
- /* memory */
- },
- /*aggregate*/
- !0
- );
- const h = jX(), S = h ? BE("Program") : 0, T = h ? BE("Bind") : 0, C = h ? BE("Check") : 0, D = h ? BE("Emit") : 0;
- if (s.extendedDiagnostics) {
- const P = t.getRelationCacheSizes();
- _("Assignability cache size", P.assignable), _("Identity cache size", P.identity), _("Subtype cache size", P.subtype), _("Strict subtype cache size", P.strictSubtype), h && DR((I, F) => {
- PU(I) || u(
- `${I} time`,
- F,
- /*aggregate*/
- !0
- );
- });
- } else h && (u(
- "I/O read",
- BE("I/O Read"),
- /*aggregate*/
- !0
- ), u(
- "I/O write",
- BE("I/O Write"),
- /*aggregate*/
- !0
- ), u(
- "Parse time",
- S,
- /*aggregate*/
- !0
- ), u(
- "Bind time",
- T,
- /*aggregate*/
- !0
- ), u(
- "Check time",
- C,
- /*aggregate*/
- !0
- ), u(
- "Emit time",
- D,
- /*aggregate*/
- !0
- ));
- h && u(
- "Total time",
- S + T + C + D,
- /*aggregate*/
- !1
- ), Uve(e, o), h ? n ? (DR((P) => {
- PU(P) || Pme(P);
- }), Dme((P) => {
- PU(P) || wme(P);
- })) : BX() : e.write(p.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + `
-`);
- }
- function c(d, g) {
- o.push(d), g && n?.addAggregateStatistic(d);
- }
- function _(d, g) {
- c(
- {
- name: d,
- value: g,
- type: 1
- /* count */
- },
- /*aggregate*/
- !0
- );
- }
- function u(d, g, h) {
- c({
- name: d,
- value: g,
- type: 0
- /* time */
- }, h);
- }
- }
- function Uve(e, t) {
- let n = 0, i = 0;
- for (const s of t) {
- s.name.length > n && (n = s.name.length);
- const o = Vve(s);
- o.length > i && (i = o.length);
- }
- for (const s of t)
- e.write(`${s.name}:`.padEnd(n + 2) + Vve(s).toString().padStart(i) + e.newLine);
- }
- function Vve(e) {
- switch (e.type) {
- case 1:
- return "" + e.value;
- case 0:
- return (e.value / 1e3).toFixed(2) + "s";
- case 2:
- return Math.round(e.value / 1e3) + "K";
- default:
- E.assertNever(e.type);
- }
- }
- function wje(e, t, n, i) {
- const s = e.getCurrentDirectory(), o = Os(Bn(s, "tsconfig.json"));
- if (e.fileExists(o))
- t(Go(p.A_tsconfig_json_file_is_already_defined_at_Colon_0, o));
- else {
- e.writeFile(o, Kte(n, i, e.newLine));
- const c = [e.newLine, ...DU(e, "Created a new tsconfig.json with:")];
- c.push(Zte(n, e.newLine) + e.newLine + e.newLine), c.push("You can learn more at https://aka.ms/tsconfig" + e.newLine);
- for (const _ of c)
- e.write(_);
- }
- }
- function Bie(e, t) {
- const n = cu(e, "strictNullChecks");
- return {
- typeFromExpression: F,
- serializeTypeOfDeclaration: o,
- serializeReturnTypeForSignature: c,
- serializeTypeOfExpression: s
- };
- function i(J, oe) {
- return J !== void 0 && (!oe || J && ne(J)) ? !0 : void 0;
- }
- function s(J, oe, _e, he) {
- return F(
- J,
- oe,
- /*isConstContext*/
- !1,
- _e,
- he
- ) ?? C(J, oe);
- }
- function o(J, oe) {
- switch (J.kind) {
- case 171:
- return i(Gc(J));
- case 169:
- return h(J, oe);
- case 260:
- return g(J, oe);
- case 172:
- return S(J, oe);
- case 208:
- return T(J, oe);
- case 277:
- return s(
- J.expression,
- oe,
- /*addUndefined*/
- void 0,
- /*preserveLiterals*/
- !0
- );
- case 211:
- case 212:
- case 226:
- return i(Gc(J)) || T(J, oe);
- case 303:
- return F(J.initializer, oe) || T(J, oe);
- default:
- E.assertNever(J, `Node needs to be an inferrable node, found ${E.formatSyntaxKind(J.kind)}`);
- }
- }
- function c(J, oe) {
- switch (J.kind) {
- case 177:
- return d(J, oe);
- case 174:
- case 262:
- case 180:
- case 173:
- case 179:
- case 176:
- case 178:
- case 181:
- case 184:
- case 185:
- case 218:
- case 219:
- case 317:
- case 323:
- return ie(J, oe);
- default:
- E.assertNever(J, `Node needs to be an inferrable node, found ${E.formatSyntaxKind(J.kind)}`);
- }
- }
- function _(J) {
- if (J)
- return J.kind === 177 ? Y_(J) : J.parameters.length > 0 ? Gc(J.parameters[0]) : void 0;
- }
- function u(J, oe) {
- let _e = _(J);
- return !_e && J !== oe.firstAccessor && (_e = _(oe.firstAccessor)), !_e && oe.secondAccessor && J !== oe.secondAccessor && (_e = _(oe.secondAccessor)), _e;
- }
- function d(J, oe) {
- const _e = t.getAllAccessorDeclarations(J), he = u(J, _e);
- return he ? i(he) : _e.getAccessor ? ie(_e.getAccessor, oe) : !1;
- }
- function g(J, oe) {
- const _e = Gc(J);
- if (_e)
- return i(_e);
- let he;
- return J.initializer && (t.isExpandoFunctionDeclaration(J) || (he = F(
- J.initializer,
- oe,
- /*isConstContext*/
- void 0,
- /*requiresAddingUndefined*/
- void 0,
- SZ(J)
- ))), he ?? T(J, oe);
- }
- function h(J, oe) {
- const _e = J.parent;
- if (_e.kind === 178)
- return d(_e, oe);
- const he = Gc(J), le = t.requiresAddingImplicitUndefined(J, oe.enclosingDeclaration);
- let me;
- return he ? me = i(he, le) : J.initializer && Oe(J.name) && (me = F(
- J.initializer,
- oe,
- /*isConstContext*/
- void 0,
- le
- )), me ?? T(J, oe);
- }
- function S(J, oe) {
- const _e = Gc(J);
- if (_e)
- return i(_e);
- let he;
- if (J.initializer) {
- const le = Vw(J);
- he = F(
- J.initializer,
- oe,
- /*isConstContext*/
- void 0,
- /*requiresAddingUndefined*/
- void 0,
- le
- );
- }
- return he ?? T(J, oe);
- }
- function T(J, oe) {
- return oe.tracker.reportInferenceFallback(J), !1;
- }
- function C(J, oe) {
- return oe.tracker.reportInferenceFallback(J), !1;
- }
- function D(J, oe) {
- return oe.tracker.reportInferenceFallback(J), !1;
- }
- function P(J, oe, _e) {
- return J.kind === 177 ? ie(J, _e) : (_e.tracker.reportInferenceFallback(J), !1);
- }
- function I(J, oe, _e, he) {
- return xd(oe) ? F(
- J,
- _e,
- /*isConstContext*/
- !0,
- he
- ) : (he && !ne(oe) && _e.tracker.reportInferenceFallback(oe), i(oe));
- }
- function F(J, oe, _e = !1, he = !1, le = !1) {
- switch (J.kind) {
- case 217:
- return xS(J) ? I(J.expression, mD(J), oe, he) : F(J.expression, oe, _e, he);
- case 80:
- if (t.isUndefinedIdentifierExpression(J))
- return !0;
- break;
- case 106:
- return !0;
- case 219:
- case 218:
- return O(J, oe);
- case 216:
- case 234:
- const me = J;
- return I(me.expression, me.type, oe, he);
- case 224:
- const ve = J;
- if (F5(ve) && (ve.operand.kind === 10 || ve.operand.kind === 9))
- return re();
- break;
- case 9:
- return re();
- case 228:
- if (!_e && !le)
- return !0;
- break;
- case 15:
- case 11:
- return re();
- case 10:
- return re();
- case 112:
- case 97:
- return re();
- case 209:
- return z(J, oe, _e);
- case 210:
- return q(J, oe, _e);
- case 231:
- return C(J, oe);
- }
- }
- function O(J, oe) {
- const _e = i(J.type) ?? ie(J, oe), he = ee(J.typeParameters), le = J.parameters.every((me) => ae(me, oe));
- return _e && he && le;
- }
- function B(J, oe, _e) {
- if (!_e)
- return oe.tracker.reportInferenceFallback(J), !1;
- for (const he of J.elements)
- if (he.kind === 230)
- return oe.tracker.reportInferenceFallback(he), !1;
- return !0;
- }
- function z(J, oe, _e) {
- if (!B(J, oe, _e))
- return !1;
- let he = !0;
- for (const le of J.elements)
- E.assert(
- le.kind !== 230
- /* SpreadElement */
- ), le.kind !== 232 && (he = (F(le, oe, _e) ?? C(le, oe)) && he);
- return !0;
- }
- function X(J, oe) {
- let _e = !0;
- for (const he of J.properties) {
- if (he.flags & 262144) {
- _e = !1;
- break;
- }
- if (he.kind === 304 || he.kind === 305)
- oe.tracker.reportInferenceFallback(he), _e = !1;
- else if (he.name.flags & 262144) {
- _e = !1;
- break;
- } else if (he.name.kind === 81)
- _e = !1;
- else if (he.name.kind === 167) {
- const le = he.name.expression;
- !F5(
- le,
- /*includeBigInt*/
- !1
- ) && !t.isDefinitelyReferenceToGlobalSymbolObject(le) && (oe.tracker.reportInferenceFallback(he.name), _e = !1);
- }
- }
- return _e;
- }
- function q(J, oe, _e) {
- if (!X(J, oe)) return !1;
- let he = !0;
- for (const le of J.properties) {
- E.assert(!uu(le) && !$g(le));
- const me = le.name;
- switch (le.kind) {
- case 174:
- he = !!G(le, me, oe) && he;
- break;
- case 303:
- he = !!V(le, me, oe, _e) && he;
- break;
- case 178:
- case 177:
- he = !!ue(le, me, oe) && he;
- break;
- }
- }
- return he;
- }
- function V(J, oe, _e, he) {
- return F(J.initializer, _e, he) ?? T(J, _e);
- }
- function ae(J, oe) {
- return h(J, oe);
- }
- function ee(J) {
- return J?.every(
- (oe) => i(oe.constraint) && i(oe.default)
- ) ?? !0;
- }
- function G(J, oe, _e) {
- const he = ie(J, _e), le = ee(J.typeParameters), me = J.parameters.every((ve) => ae(ve, _e));
- return he && le && me;
- }
- function ue(J, oe, _e) {
- const he = t.getAllAccessorDeclarations(J), le = he.getAccessor && _(he.getAccessor), me = he.setAccessor && _(he.setAccessor);
- if (le !== void 0 && me !== void 0) {
- const ve = J.parameters.every((tt) => ae(tt, _e));
- return d0(J) ? ve && i(le) : ve;
- } else if (he.firstAccessor === J) {
- const ve = le ?? me;
- return ve ? i(ve) : P(J, he, _e);
- }
- return !1;
- }
- function re() {
- return !0;
- }
- function ne(J) {
- return !n || p_(J.kind) || J.kind === 201 || J.kind === 184 || J.kind === 185 || J.kind === 188 || J.kind === 189 || J.kind === 187 || J.kind === 203 || J.kind === 197 ? !0 : J.kind === 196 ? ne(J.type) : J.kind === 192 || J.kind === 193 ? J.types.every(ne) : !1;
- }
- function ie(J, oe) {
- let _e;
- const he = Y_(J);
- return he && (_e = i(he)), !_e && nx(J) && (_e = Se(J, oe)), _e ?? D(J, oe);
- }
- function Se(J, oe) {
- let _e;
- if (J && !rc(J.body)) {
- if (Jc(J) & 3) return;
- const he = J.body;
- he && Cs(he) ? y0(he, (le) => {
- if (!_e)
- _e = le.expression;
- else
- return _e = void 0, !0;
- }) : _e = he;
- }
- if (_e)
- return F(_e, oe);
- }
- }
- var Dm = {};
- La(Dm, {
- NameValidationResult: () => ebe,
- discoverTypings: () => Oje,
- isTypingUpToDate: () => Xve,
- loadSafeList: () => Nje,
- loadTypesMap: () => Ije,
- nodeCoreModuleList: () => Yve,
- nodeCoreModules: () => Zve,
- nonRelativeModuleNameForTypingCache: () => Kve,
- renderPackageNameValidationFailure: () => Lje,
- validatePackageName: () => Fje
- });
- var FF = "action::set", LF = "action::invalidate", MF = "action::packageInstalled", AU = "event::typesRegistry", NU = "event::beginInstallTypes", IU = "event::endInstallTypes", Jie = "event::initializationFailed", QA = "action::watchTypingLocations", OU;
- ((e) => {
- e.GlobalCacheLocation = "--globalTypingsCacheLocation", e.LogFile = "--logFile", e.EnableTelemetry = "--enableTelemetry", e.TypingSafeListLocation = "--typingSafeListLocation", e.TypesMapLocation = "--typesMapLocation", e.NpmLocation = "--npmLocation", e.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
- })(OU || (OU = {}));
- function qve(e) {
- return ll.args.includes(e);
- }
- function Hve(e) {
- const t = ll.args.indexOf(e);
- return t >= 0 && t < ll.args.length - 1 ? ll.args[t + 1] : void 0;
- }
- function Gve() {
- const e = /* @__PURE__ */ new Date();
- return `${e.getHours().toString().padStart(2, "0")}:${e.getMinutes().toString().padStart(2, "0")}:${e.getSeconds().toString().padStart(2, "0")}.${e.getMilliseconds().toString().padStart(3, "0")}`;
- }
- var $ve = `
- `;
- function WD(e) {
- return $ve + e.replace(/\n/g, $ve);
- }
- function Tv(e) {
- return WD(JSON.stringify(e, void 0, 2));
- }
- function Xve(e, t) {
- return new Sd(fI(t, `ts${wf}`) || fI(t, "latest")).compareTo(e.version) <= 0;
- }
- var Qve = [
- "assert",
- "assert/strict",
- "async_hooks",
- "buffer",
- "child_process",
- "cluster",
- "console",
- "constants",
- "crypto",
- "dgram",
- "diagnostics_channel",
- "dns",
- "dns/promises",
- "domain",
- "events",
- "fs",
- "fs/promises",
- "http",
- "https",
- "http2",
- "inspector",
- "module",
- "net",
- "os",
- "path",
- "perf_hooks",
- "process",
- "punycode",
- "querystring",
- "readline",
- "repl",
- "stream",
- "stream/promises",
- "string_decoder",
- "timers",
- "timers/promises",
- "tls",
- "trace_events",
- "tty",
- "url",
- "util",
- "util/types",
- "v8",
- "vm",
- "wasi",
- "worker_threads",
- "zlib"
- ], Aje = Qve.map((e) => `node:${e}`), Yve = [...Qve, ...Aje], Zve = new Set(Yve);
- function Kve(e) {
- return Zve.has(e) ? "node" : e;
- }
- function Nje(e, t) {
- const n = vA(t, (i) => e.readFile(i));
- return new Map(Object.entries(n.config));
- }
- function Ije(e, t) {
- var n;
- const i = vA(t, (s) => e.readFile(s));
- if ((n = i.config) != null && n.simpleMap)
- return new Map(Object.entries(i.config.simpleMap));
- }
- function Oje(e, t, n, i, s, o, c, _, u, d) {
- if (!c || !c.enable)
- return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };
- const g = /* @__PURE__ */ new Map();
- n = Ai(n, (B) => {
- const z = Os(B);
- if (Ug(z))
- return z;
- });
- const h = [];
- c.include && I(c.include, "Explicitly included types");
- const S = c.exclude || [];
- if (!d.types) {
- const B = new Set(n.map(Xn));
- B.add(i), B.forEach((z) => {
- F(z, "bower.json", "bower_components", h), F(z, "package.json", "node_modules", h);
- });
- }
- if (c.disableFilenameBasedTypeAcquisition || O(n), _) {
- const B = cb(
- _.map(Kve),
- ub,
- au
- );
- I(B, "Inferred typings from unresolved imports");
- }
- for (const B of S)
- g.delete(B) && t && t(`Typing for ${B} is in exclude list, will be ignored.`);
- o.forEach((B, z) => {
- const X = u.get(z);
- g.get(z) === !1 && X !== void 0 && Xve(B, X) && g.set(z, B.typingLocation);
- });
- const T = [], C = [];
- g.forEach((B, z) => {
- B ? C.push(B) : T.push(z);
- });
- const D = { cachedTypingPaths: C, newTypingNames: T, filesToWatch: h };
- return t && t(`Finished typings discovery:${Tv(D)}`), D;
- function P(B) {
- g.has(B) || g.set(B, !1);
- }
- function I(B, z) {
- t && t(`${z}: ${JSON.stringify(B)}`), ir(B, P);
- }
- function F(B, z, X, q) {
- const V = Bn(B, z);
- let ae, ee;
- e.fileExists(V) && (q.push(V), ae = vA(V, (ne) => e.readFile(ne)).config, ee = ta([ae.dependencies, ae.devDependencies, ae.optionalDependencies, ae.peerDependencies], rm), I(ee, `Typing names in '${V}' dependencies`));
- const G = Bn(B, X);
- if (q.push(G), !e.directoryExists(G))
- return;
- const ue = [], re = ee ? ee.map((ne) => Bn(G, ne, z)) : e.readDirectory(
- G,
- [
- ".json"
- /* Json */
- ],
- /*excludes*/
- void 0,
- /*includes*/
- void 0,
- /*depth*/
- 3
- ).filter((ne) => {
- if (Hc(ne) !== z)
- return !1;
- const ie = Cl(Os(ne)), Se = ie[ie.length - 3][0] === "@";
- return Se && vy(ie[ie.length - 4]) === X || // `node_modules/@foo/bar`
- !Se && vy(ie[ie.length - 3]) === X;
- });
- t && t(`Searching for typing names in ${G}; all files: ${JSON.stringify(re)}`);
- for (const ne of re) {
- const ie = Os(ne), J = vA(ie, (_e) => e.readFile(_e)).config;
- if (!J.name)
- continue;
- const oe = J.types || J.typings;
- if (oe) {
- const _e = es(oe, Xn(ie));
- e.fileExists(_e) ? (t && t(` Package '${J.name}' provides its own types.`), g.set(J.name, _e)) : t && t(` Package '${J.name}' provides its own types but they are missing.`);
- } else
- ue.push(J.name);
- }
- I(ue, " Found package names");
- }
- function O(B) {
- const z = Ai(B, (q) => {
- if (!Ug(q)) return;
- const V = $u(vy(Hc(q))), ae = SR(V);
- return s.get(ae);
- });
- z.length && I(z, "Inferred typings from file names"), ut(B, (q) => qo(
- q,
- ".jsx"
- /* Jsx */
- )) && (t && t("Inferred 'react' typings due to presence of '.jsx' extension"), P("react"));
- }
- }
- var ebe = /* @__PURE__ */ ((e) => (e[e.Ok = 0] = "Ok", e[e.EmptyName = 1] = "EmptyName", e[e.NameTooLong = 2] = "NameTooLong", e[e.NameStartsWithDot = 3] = "NameStartsWithDot", e[e.NameStartsWithUnderscore = 4] = "NameStartsWithUnderscore", e[e.NameContainsNonURISafeCharacters = 5] = "NameContainsNonURISafeCharacters", e))(ebe || {}), tbe = 214;
- function Fje(e) {
- return zie(
- e,
- /*supportScopedPackage*/
- !0
- );
- }
- function zie(e, t) {
- if (!e)
- return 1;
- if (e.length > tbe)
- return 2;
- if (e.charCodeAt(0) === 46)
- return 3;
- if (e.charCodeAt(0) === 95)
- return 4;
- if (t) {
- const n = /^@([^/]+)\/([^/]+)$/.exec(e);
- if (n) {
- const i = zie(
- n[1],
- /*supportScopedPackage*/
- !1
- );
- if (i !== 0)
- return { name: n[1], isScopeName: !0, result: i };
- const s = zie(
- n[2],
- /*supportScopedPackage*/
- !1
- );
- return s !== 0 ? { name: n[2], isScopeName: !1, result: s } : 0;
- }
- }
- return encodeURIComponent(e) !== e ? 5 : 0;
- }
- function Lje(e, t) {
- return typeof e == "object" ? rbe(t, e.result, e.name, e.isScopeName) : rbe(
- t,
- e,
- t,
- /*isScopeName*/
- !1
- );
- }
- function rbe(e, t, n, i) {
- const s = i ? "Scope" : "Package";
- switch (t) {
- case 1:
- return `'${e}':: ${s} name '${n}' cannot be empty`;
- case 2:
- return `'${e}':: ${s} name '${n}' should be less than ${tbe} characters`;
- case 3:
- return `'${e}':: ${s} name '${n}' cannot start with '.'`;
- case 4:
- return `'${e}':: ${s} name '${n}' cannot start with '_'`;
- case 5:
- return `'${e}':: ${s} name '${n}' contains non URI safe characters`;
- case 0:
- return E.fail();
- default:
- E.assertNever(t);
- }
- }
- var RF;
- ((e) => {
- class t {
- constructor(s) {
- this.text = s;
- }
- getText(s, o) {
- return s === 0 && o === this.text.length ? this.text : this.text.substring(s, o);
- }
- getLength() {
- return this.text.length;
- }
- getChangeRange() {
- }
- }
- function n(i) {
- return new t(i);
- }
- e.fromString = n;
- })(RF || (RF = {}));
- var Wie = /* @__PURE__ */ ((e) => (e[e.Dependencies = 1] = "Dependencies", e[e.DevDependencies = 2] = "DevDependencies", e[e.PeerDependencies = 4] = "PeerDependencies", e[e.OptionalDependencies = 8] = "OptionalDependencies", e[e.All = 15] = "All", e))(Wie || {}), Uie = /* @__PURE__ */ ((e) => (e[e.Off = 0] = "Off", e[e.On = 1] = "On", e[e.Auto = 2] = "Auto", e))(Uie || {}), Vie = /* @__PURE__ */ ((e) => (e[e.Semantic = 0] = "Semantic", e[e.PartialSemantic = 1] = "PartialSemantic", e[e.Syntactic = 2] = "Syntactic", e))(Vie || {}), Gp = {}, qie = /* @__PURE__ */ ((e) => (e.Original = "original", e.TwentyTwenty = "2020", e))(qie || {}), FU = /* @__PURE__ */ ((e) => (e.All = "All", e.SortAndCombine = "SortAndCombine", e.RemoveUnused = "RemoveUnused", e))(FU || {}), LU = /* @__PURE__ */ ((e) => (e[e.Invoked = 1] = "Invoked", e[e.TriggerCharacter = 2] = "TriggerCharacter", e[e.TriggerForIncompleteCompletions = 3] = "TriggerForIncompleteCompletions", e))(LU || {}), Hie = /* @__PURE__ */ ((e) => (e.Type = "Type", e.Parameter = "Parameter", e.Enum = "Enum", e))(Hie || {}), Gie = /* @__PURE__ */ ((e) => (e.none = "none", e.definition = "definition", e.reference = "reference", e.writtenReference = "writtenReference", e))(Gie || {}), $ie = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Block = 1] = "Block", e[e.Smart = 2] = "Smart", e))($ie || {}), MU = /* @__PURE__ */ ((e) => (e.Ignore = "ignore", e.Insert = "insert", e.Remove = "remove", e))(MU || {});
- function jF(e) {
- return {
- indentSize: 4,
- tabSize: 4,
- newLineCharacter: e || `
-`,
- convertTabsToSpaces: !0,
- indentStyle: 2,
- insertSpaceAfterConstructor: !1,
- insertSpaceAfterCommaDelimiter: !0,
- insertSpaceAfterSemicolonInForStatements: !0,
- insertSpaceBeforeAndAfterBinaryOperators: !0,
- insertSpaceAfterKeywordsInControlFlowStatements: !0,
- insertSpaceAfterFunctionKeywordForAnonymousFunctions: !1,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: !1,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: !1,
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: !0,
- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: !1,
- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: !1,
- insertSpaceBeforeFunctionParenthesis: !1,
- placeOpenBraceOnNewLineForFunctions: !1,
- placeOpenBraceOnNewLineForControlBlocks: !1,
- semicolons: "ignore",
- trimTrailingWhitespace: !0,
- indentSwitchCase: !0
- };
- }
- var nbe = jF(`
-`), BF = /* @__PURE__ */ ((e) => (e[e.aliasName = 0] = "aliasName", e[e.className = 1] = "className", e[e.enumName = 2] = "enumName", e[e.fieldName = 3] = "fieldName", e[e.interfaceName = 4] = "interfaceName", e[e.keyword = 5] = "keyword", e[e.lineBreak = 6] = "lineBreak", e[e.numericLiteral = 7] = "numericLiteral", e[e.stringLiteral = 8] = "stringLiteral", e[e.localName = 9] = "localName", e[e.methodName = 10] = "methodName", e[e.moduleName = 11] = "moduleName", e[e.operator = 12] = "operator", e[e.parameterName = 13] = "parameterName", e[e.propertyName = 14] = "propertyName", e[e.punctuation = 15] = "punctuation", e[e.space = 16] = "space", e[e.text = 17] = "text", e[e.typeParameterName = 18] = "typeParameterName", e[e.enumMemberName = 19] = "enumMemberName", e[e.functionName = 20] = "functionName", e[e.regularExpressionLiteral = 21] = "regularExpressionLiteral", e[e.link = 22] = "link", e[e.linkName = 23] = "linkName", e[e.linkText = 24] = "linkText", e))(BF || {}), Xie = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.MayIncludeAutoImports = 1] = "MayIncludeAutoImports", e[e.IsImportStatementCompletion = 2] = "IsImportStatementCompletion", e[e.IsContinuation = 4] = "IsContinuation", e[e.ResolvedModuleSpecifiers = 8] = "ResolvedModuleSpecifiers", e[e.ResolvedModuleSpecifiersBeyondLimit = 16] = "ResolvedModuleSpecifiersBeyondLimit", e[e.MayIncludeMethodSnippets = 32] = "MayIncludeMethodSnippets", e))(Xie || {}), Qie = /* @__PURE__ */ ((e) => (e.Comment = "comment", e.Region = "region", e.Code = "code", e.Imports = "imports", e))(Qie || {}), Yie = /* @__PURE__ */ ((e) => (e[e.JavaScript = 0] = "JavaScript", e[e.SourceMap = 1] = "SourceMap", e[e.Declaration = 2] = "Declaration", e))(Yie || {}), Zie = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InMultiLineCommentTrivia = 1] = "InMultiLineCommentTrivia", e[e.InSingleQuoteStringLiteral = 2] = "InSingleQuoteStringLiteral", e[e.InDoubleQuoteStringLiteral = 3] = "InDoubleQuoteStringLiteral", e[e.InTemplateHeadOrNoSubstitutionTemplate = 4] = "InTemplateHeadOrNoSubstitutionTemplate", e[e.InTemplateMiddleOrTail = 5] = "InTemplateMiddleOrTail", e[e.InTemplateSubstitutionPosition = 6] = "InTemplateSubstitutionPosition", e))(Zie || {}), Kie = /* @__PURE__ */ ((e) => (e[e.Punctuation = 0] = "Punctuation", e[e.Keyword = 1] = "Keyword", e[e.Operator = 2] = "Operator", e[e.Comment = 3] = "Comment", e[e.Whitespace = 4] = "Whitespace", e[e.Identifier = 5] = "Identifier", e[e.NumberLiteral = 6] = "NumberLiteral", e[e.BigIntLiteral = 7] = "BigIntLiteral", e[e.StringLiteral = 8] = "StringLiteral", e[e.RegExpLiteral = 9] = "RegExpLiteral", e))(Kie || {}), ese = /* @__PURE__ */ ((e) => (e.unknown = "", e.warning = "warning", e.keyword = "keyword", e.scriptElement = "script", e.moduleElement = "module", e.classElement = "class", e.localClassElement = "local class", e.interfaceElement = "interface", e.typeElement = "type", e.enumElement = "enum", e.enumMemberElement = "enum member", e.variableElement = "var", e.localVariableElement = "local var", e.variableUsingElement = "using", e.variableAwaitUsingElement = "await using", e.functionElement = "function", e.localFunctionElement = "local function", e.memberFunctionElement = "method", e.memberGetAccessorElement = "getter", e.memberSetAccessorElement = "setter", e.memberVariableElement = "property", e.memberAccessorVariableElement = "accessor", e.constructorImplementationElement = "constructor", e.callSignatureElement = "call", e.indexSignatureElement = "index", e.constructSignatureElement = "construct", e.parameterElement = "parameter", e.typeParameterElement = "type parameter", e.primitiveType = "primitive type", e.label = "label", e.alias = "alias", e.constElement = "const", e.letElement = "let", e.directory = "directory", e.externalModuleName = "external module name", e.jsxAttribute = "JSX attribute", e.string = "string", e.link = "link", e.linkName = "link name", e.linkText = "link text", e))(ese || {}), tse = /* @__PURE__ */ ((e) => (e.none = "", e.publicMemberModifier = "public", e.privateMemberModifier = "private", e.protectedMemberModifier = "protected", e.exportedModifier = "export", e.ambientModifier = "declare", e.staticModifier = "static", e.abstractModifier = "abstract", e.optionalModifier = "optional", e.deprecatedModifier = "deprecated", e.dtsModifier = ".d.ts", e.tsModifier = ".ts", e.tsxModifier = ".tsx", e.jsModifier = ".js", e.jsxModifier = ".jsx", e.jsonModifier = ".json", e.dmtsModifier = ".d.mts", e.mtsModifier = ".mts", e.mjsModifier = ".mjs", e.dctsModifier = ".d.cts", e.ctsModifier = ".cts", e.cjsModifier = ".cjs", e))(tse || {}), rse = /* @__PURE__ */ ((e) => (e.comment = "comment", e.identifier = "identifier", e.keyword = "keyword", e.numericLiteral = "number", e.bigintLiteral = "bigint", e.operator = "operator", e.stringLiteral = "string", e.whiteSpace = "whitespace", e.text = "text", e.punctuation = "punctuation", e.className = "class name", e.enumName = "enum name", e.interfaceName = "interface name", e.moduleName = "module name", e.typeParameterName = "type parameter name", e.typeAliasName = "type alias name", e.parameterName = "parameter name", e.docCommentTagName = "doc comment tag name", e.jsxOpenTagName = "jsx open tag name", e.jsxCloseTagName = "jsx close tag name", e.jsxSelfClosingTagName = "jsx self closing tag name", e.jsxAttribute = "jsx attribute", e.jsxText = "jsx text", e.jsxAttributeStringLiteralValue = "jsx attribute string literal value", e))(rse || {}), RU = /* @__PURE__ */ ((e) => (e[e.comment = 1] = "comment", e[e.identifier = 2] = "identifier", e[e.keyword = 3] = "keyword", e[e.numericLiteral = 4] = "numericLiteral", e[e.operator = 5] = "operator", e[e.stringLiteral = 6] = "stringLiteral", e[e.regularExpressionLiteral = 7] = "regularExpressionLiteral", e[e.whiteSpace = 8] = "whiteSpace", e[e.text = 9] = "text", e[e.punctuation = 10] = "punctuation", e[e.className = 11] = "className", e[e.enumName = 12] = "enumName", e[e.interfaceName = 13] = "interfaceName", e[e.moduleName = 14] = "moduleName", e[e.typeParameterName = 15] = "typeParameterName", e[e.typeAliasName = 16] = "typeAliasName", e[e.parameterName = 17] = "parameterName", e[e.docCommentTagName = 18] = "docCommentTagName", e[e.jsxOpenTagName = 19] = "jsxOpenTagName", e[e.jsxCloseTagName = 20] = "jsxCloseTagName", e[e.jsxSelfClosingTagName = 21] = "jsxSelfClosingTagName", e[e.jsxAttribute = 22] = "jsxAttribute", e[e.jsxText = 23] = "jsxText", e[e.jsxAttributeStringLiteralValue = 24] = "jsxAttributeStringLiteralValue", e[e.bigintLiteral = 25] = "bigintLiteral", e))(RU || {}), ju = Og(
- 99,
- /*skipTrivia*/
- !0
- ), nse = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Value = 1] = "Value", e[e.Type = 2] = "Type", e[e.Namespace = 4] = "Namespace", e[e.All = 7] = "All", e))(nse || {});
- function JF(e) {
- switch (e.kind) {
- case 260:
- return cn(e) && pj(e) ? 7 : 1;
- case 169:
- case 208:
- case 172:
- case 171:
- case 303:
- case 304:
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- case 262:
- case 218:
- case 219:
- case 299:
- case 291:
- return 1;
- case 168:
- case 264:
- case 265:
- case 187:
- return 2;
- case 346:
- return e.name === void 0 ? 3 : 2;
- case 306:
- case 263:
- return 3;
- case 267:
- return Fu(e) || Rh(e) === 1 ? 5 : 4;
- case 266:
- case 275:
- case 276:
- case 271:
- case 272:
- case 277:
- case 278:
- return 7;
- case 307:
- return 5;
- }
- return 7;
- }
- function wS(e) {
- e = YU(e);
- const t = e.parent;
- return e.kind === 307 ? 1 : wo(t) || vu(t) || Fh(t) || Zu(t) || Ad(t) || gl(t) && e === t.name ? 7 : zF(e) ? Mje(e) : og(e) ? JF(t) : l_(e) && or(e, Nf(_D, qT, dv)) ? 7 : Jje(e) ? 2 : Rje(e) ? 4 : zo(t) ? (E.assert(qp(t.parent)), 2) : P0(t) ? 3 : 1;
- }
- function Mje(e) {
- const t = e.kind === 166 ? e : Xu(e.parent) && e.parent.right === e ? e.parent : void 0;
- return t && t.parent.kind === 271 ? 7 : 4;
- }
- function zF(e) {
- for (; e.parent.kind === 166; )
- e = e.parent;
- return nS(e.parent) && e.parent.moduleReference === e;
- }
- function Rje(e) {
- return jje(e) || Bje(e);
- }
- function jje(e) {
- let t = e, n = !0;
- if (t.parent.kind === 166) {
- for (; t.parent && t.parent.kind === 166; )
- t = t.parent;
- n = t.right === e;
- }
- return t.parent.kind === 183 && !n;
- }
- function Bje(e) {
- let t = e, n = !0;
- if (t.parent.kind === 211) {
- for (; t.parent && t.parent.kind === 211; )
- t = t.parent;
- n = t.name === e;
- }
- if (!n && t.parent.kind === 233 && t.parent.parent.kind === 298) {
- const i = t.parent.parent.parent;
- return i.kind === 263 && t.parent.parent.token === 119 || i.kind === 264 && t.parent.parent.token === 96;
- }
- return !1;
- }
- function Jje(e) {
- switch (A4(e) && (e = e.parent), e.kind) {
- case 110:
- return !Ed(e);
- case 197:
- return !0;
- }
- switch (e.parent.kind) {
- case 183:
- return !0;
- case 205:
- return !e.parent.isTypeOf;
- case 233:
- return um(e.parent);
- }
- return !1;
- }
- function jU(e, t = !1, n = !1) {
- return YA(e, Fs, JU, t, n);
- }
- function UD(e, t = !1, n = !1) {
- return YA(e, jb, JU, t, n);
- }
- function BU(e, t = !1, n = !1) {
- return YA(e, am, JU, t, n);
- }
- function ise(e, t = !1, n = !1) {
- return YA(e, lv, zje, t, n);
- }
- function sse(e, t = !1, n = !1) {
- return YA(e, dl, JU, t, n);
- }
- function ase(e, t = !1, n = !1) {
- return YA(e, ou, Wje, t, n);
- }
- function JU(e) {
- return e.expression;
- }
- function zje(e) {
- return e.tag;
- }
- function Wje(e) {
- return e.tagName;
- }
- function YA(e, t, n, i, s) {
- let o = i ? Uje(e) : WF(e);
- return s && (o = Dc(o)), !!o && !!o.parent && t(o.parent) && n(o.parent) === o;
- }
- function WF(e) {
- return b6(e) ? e.parent : e;
- }
- function Uje(e) {
- return b6(e) || VU(e) ? e.parent : e;
- }
- function UF(e, t) {
- for (; e; ) {
- if (e.kind === 256 && e.label.escapedText === t)
- return e.label;
- e = e.parent;
- }
- }
- function ZA(e, t) {
- return Cn(e.expression) ? e.expression.name.text === t : !1;
- }
- function KA(e) {
- var t;
- return Oe(e) && ((t = Wn(e.parent, t4)) == null ? void 0 : t.label) === e;
- }
- function zU(e) {
- var t;
- return Oe(e) && ((t = Wn(e.parent, Gy)) == null ? void 0 : t.label) === e;
- }
- function WU(e) {
- return zU(e) || KA(e);
- }
- function UU(e) {
- var t;
- return ((t = Wn(e.parent, _C)) == null ? void 0 : t.tagName) === e;
- }
- function ose(e) {
- var t;
- return ((t = Wn(e.parent, Xu)) == null ? void 0 : t.right) === e;
- }
- function b6(e) {
- var t;
- return ((t = Wn(e.parent, Cn)) == null ? void 0 : t.name) === e;
- }
- function VU(e) {
- var t;
- return ((t = Wn(e.parent, ko)) == null ? void 0 : t.argumentExpression) === e;
- }
- function qU(e) {
- var t;
- return ((t = Wn(e.parent, zc)) == null ? void 0 : t.name) === e;
- }
- function HU(e) {
- var t;
- return Oe(e) && ((t = Wn(e.parent, ys)) == null ? void 0 : t.name) === e;
- }
- function VF(e) {
- switch (e.parent.kind) {
- case 172:
- case 171:
- case 303:
- case 306:
- case 174:
- case 173:
- case 177:
- case 178:
- case 267:
- return os(e.parent) === e;
- case 212:
- return e.parent.argumentExpression === e;
- case 167:
- return !0;
- case 201:
- return e.parent.parent.kind === 199;
- default:
- return !1;
- }
- }
- function cse(e) {
- return Z1(e.parent.parent) && g4(e.parent.parent) === e;
- }
- function AS(e) {
- for (Bp(e) && (e = e.parent.parent); ; ) {
- if (e = e.parent, !e)
- return;
- switch (e.kind) {
- case 307:
- case 174:
- case 173:
- case 262:
- case 218:
- case 177:
- case 178:
- case 263:
- case 264:
- case 266:
- case 267:
- return e;
- }
- }
- }
- function Yb(e) {
- switch (e.kind) {
- case 307:
- return il(e) ? "module" : "script";
- case 267:
- return "module";
- case 263:
- case 231:
- return "class";
- case 264:
- return "interface";
- case 265:
- case 338:
- case 346:
- return "type";
- case 266:
- return "enum";
- case 260:
- return t(e);
- case 208:
- return t(pm(e));
- case 219:
- case 262:
- case 218:
- return "function";
- case 177:
- return "getter";
- case 178:
- return "setter";
- case 174:
- case 173:
- return "method";
- case 303:
- const { initializer: n } = e;
- return ys(n) ? "method" : "property";
- case 172:
- case 171:
- case 304:
- case 305:
- return "property";
- case 181:
- return "index";
- case 180:
- return "construct";
- case 179:
- return "call";
- case 176:
- case 175:
- return "constructor";
- case 168:
- return "type parameter";
- case 306:
- return "enum member";
- case 169:
- return Gn(
- e,
- 31
- /* ParameterPropertyModifier */
- ) ? "property" : "parameter";
- case 271:
- case 276:
- case 281:
- case 274:
- case 280:
- return "alias";
- case 226:
- const i = Cc(e), { right: s } = e;
- switch (i) {
- case 7:
- case 8:
- case 9:
- case 0:
- return "";
- case 1:
- case 2:
- const c = Yb(s);
- return c === "" ? "const" : c;
- case 3:
- return vo(s) ? "method" : "property";
- case 4:
- return "property";
- case 5:
- return vo(s) ? "method" : "property";
- case 6:
- return "local class";
- default:
- return "";
- }
- case 80:
- return Ad(e.parent) ? "alias" : "";
- case 277:
- const o = Yb(e.expression);
- return o === "" ? "const" : o;
- default:
- return "";
- }
- function t(n) {
- return hC(n) ? "const" : p7(n) ? "let" : "var";
- }
- }
- function S6(e) {
- switch (e.kind) {
- case 110:
- return !0;
- case 80:
- return AB(e) && e.parent.kind === 169;
- default:
- return !1;
- }
- }
- var Vje = /^\/\/\/\s*;
- function $p(e, t) {
- const n = Ag(t), i = t.getLineAndCharacterOfPosition(e).line;
- return n[i];
- }
- function nf(e, t) {
- return GU(e.pos, e.end, t);
- }
- function lse(e, t) {
- return e8(e, t.pos) && e8(e, t.end);
- }
- function VD(e, t) {
- return e.pos <= t && t <= e.end;
- }
- function e8(e, t) {
- return e.pos < t && t < e.end;
- }
- function GU(e, t, n) {
- return e <= n.pos && t >= n.end;
- }
- function t8(e, t, n) {
- return e.pos <= t && e.end >= n;
- }
- function qD(e, t, n) {
- return HF(e.pos, e.end, t, n);
- }
- function qF(e, t, n, i) {
- return HF(e.getStart(t), e.end, n, i);
- }
- function HF(e, t, n, i) {
- const s = Math.max(e, n), o = Math.min(t, i);
- return s < o;
- }
- function $U(e, t, n) {
- return E.assert(e.pos <= t), t < e.end || !Md(e, n);
- }
- function Md(e, t) {
- if (e === void 0 || rc(e))
- return !1;
- switch (e.kind) {
- case 263:
- case 264:
- case 266:
- case 210:
- case 206:
- case 187:
- case 241:
- case 268:
- case 269:
- case 275:
- case 279:
- return XU(e, 20, t);
- case 299:
- return Md(e.block, t);
- case 214:
- if (!e.arguments)
- return !0;
- case 213:
- case 217:
- case 196:
- return XU(e, 22, t);
- case 184:
- case 185:
- return Md(e.type, t);
- case 176:
- case 177:
- case 178:
- case 262:
- case 218:
- case 174:
- case 173:
- case 180:
- case 179:
- case 219:
- return e.body ? Md(e.body, t) : e.type ? Md(e.type, t) : QU(e, 22, t);
- case 267:
- return !!e.body && Md(e.body, t);
- case 245:
- return e.elseStatement ? Md(e.elseStatement, t) : Md(e.thenStatement, t);
- case 244:
- return Md(e.expression, t) || QU(e, 27, t);
- case 209:
- case 207:
- case 212:
- case 167:
- case 189:
- return XU(e, 24, t);
- case 181:
- return e.type ? Md(e.type, t) : QU(e, 24, t);
- case 296:
- case 297:
- return !1;
- case 248:
- case 249:
- case 250:
- case 247:
- return Md(e.statement, t);
- case 246:
- return QU(e, 117, t) ? XU(e, 22, t) : Md(e.statement, t);
- case 186:
- return Md(e.exprName, t);
- case 221:
- case 220:
- case 222:
- case 229:
- case 230:
- return Md(e.expression, t);
- case 215:
- return Md(e.template, t);
- case 228:
- const i = Ro(e.templateSpans);
- return Md(i, t);
- case 239:
- return Mp(e.literal);
- case 278:
- case 272:
- return Mp(e.moduleSpecifier);
- case 224:
- return Md(e.operand, t);
- case 226:
- return Md(e.right, t);
- case 227:
- return Md(e.whenFalse, t);
- default:
- return !0;
- }
- }
- function XU(e, t, n) {
- const i = e.getChildren(n);
- if (i.length) {
- const s = _a(i);
- if (s.kind === t)
- return !0;
- if (s.kind === 27 && i.length !== 1)
- return i[i.length - 2].kind === t;
- }
- return !1;
- }
- function use(e) {
- const t = GF(e);
- if (!t)
- return;
- const n = t.getChildren();
- return {
- listItemIndex: mC(n, e),
- list: t
- };
- }
- function QU(e, t, n) {
- return !!Ya(e, t, n);
- }
- function Ya(e, t, n) {
- return On(e.getChildren(n), (i) => i.kind === t);
- }
- function GF(e) {
- const t = On(e.parent.getChildren(), (n) => KC(n) && nf(n, e));
- return E.assert(!t || ss(t.getChildren(), e)), t;
- }
- function ibe(e) {
- return e.kind === 90;
- }
- function qje(e) {
- return e.kind === 86;
- }
- function Hje(e) {
- return e.kind === 100;
- }
- function Gje(e) {
- if (Vl(e))
- return e.name;
- if (Xc(e)) {
- const t = e.modifiers && On(e.modifiers, ibe);
- if (t) return t;
- }
- if ($c(e)) {
- const t = On(e.getChildren(), qje);
- if (t) return t;
- }
- }
- function $je(e) {
- if (Vl(e))
- return e.name;
- if (Ec(e)) {
- const t = On(e.modifiers, ibe);
- if (t) return t;
- }
- if (vo(e)) {
- const t = On(e.getChildren(), Hje);
- if (t) return t;
- }
- }
- function Xje(e) {
- let t;
- return or(e, (n) => (fi(n) && (t = n), !Xu(n.parent) && !fi(n.parent) && !db(n.parent))), t;
- }
- function $F(e, t) {
- if (e.flags & 16777216) return;
- const n = u9(e, t);
- if (n) return n;
- const i = Xje(e);
- return i && t.getTypeAtLocation(i);
- }
- function Qje(e, t) {
- if (!t)
- switch (e.kind) {
- case 263:
- case 231:
- return Gje(e);
- case 262:
- case 218:
- return $je(e);
- case 176:
- return e;
- }
- if (Vl(e))
- return e.name;
- }
- function sbe(e, t) {
- if (e.importClause) {
- if (e.importClause.name && e.importClause.namedBindings)
- return;
- if (e.importClause.name)
- return e.importClause.name;
- if (e.importClause.namedBindings) {
- if (Tm(e.importClause.namedBindings)) {
- const n = Qm(e.importClause.namedBindings.elements);
- return n ? n.name : void 0;
- } else if (Hg(e.importClause.namedBindings))
- return e.importClause.namedBindings.name;
- }
- }
- if (!t)
- return e.moduleSpecifier;
- }
- function abe(e, t) {
- if (e.exportClause) {
- if (pp(e.exportClause))
- return Qm(e.exportClause.elements) ? e.exportClause.elements[0].name : void 0;
- if (ug(e.exportClause))
- return e.exportClause.name;
- }
- if (!t)
- return e.moduleSpecifier;
- }
- function Yje(e) {
- if (e.types.length === 1)
- return e.types[0].expression;
- }
- function obe(e, t) {
- const { parent: n } = e;
- if (ra(e) && (t || e.kind !== 90) ? Hp(n) && ss(n.modifiers, e) : e.kind === 86 ? Xc(n) || $c(e) : e.kind === 100 ? Ec(n) || vo(e) : e.kind === 120 ? Xl(n) : e.kind === 94 ? Bb(n) : e.kind === 156 ? Vp(n) : e.kind === 145 || e.kind === 144 ? zc(n) : e.kind === 102 ? gl(n) : e.kind === 139 ? Lf(n) : e.kind === 153 && K_(n)) {
- const i = Qje(n, t);
- if (i)
- return i;
- }
- if ((e.kind === 115 || e.kind === 87 || e.kind === 121) && Fl(n) && n.declarations.length === 1) {
- const i = n.declarations[0];
- if (Oe(i.name))
- return i.name;
- }
- if (e.kind === 156) {
- if (Ad(n) && n.isTypeOnly) {
- const i = sbe(n.parent, t);
- if (i)
- return i;
- }
- if (Nc(n) && n.isTypeOnly) {
- const i = abe(n, t);
- if (i)
- return i;
- }
- }
- if (e.kind === 130) {
- if (Zu(n) && n.propertyName || vu(n) && n.propertyName || Hg(n) || ug(n))
- return n.name;
- if (Nc(n) && n.exportClause && ug(n.exportClause))
- return n.exportClause.name;
- }
- if (e.kind === 102 && ic(n)) {
- const i = sbe(n, t);
- if (i)
- return i;
- }
- if (e.kind === 95) {
- if (Nc(n)) {
- const i = abe(n, t);
- if (i)
- return i;
- }
- if (wo(n))
- return Dc(n.expression);
- }
- if (e.kind === 149 && Fh(n))
- return n.expression;
- if (e.kind === 161 && (ic(n) || Nc(n)) && n.moduleSpecifier)
- return n.moduleSpecifier;
- if ((e.kind === 96 || e.kind === 119) && ef(n) && n.token === e.kind) {
- const i = Yje(n);
- if (i)
- return i;
- }
- if (e.kind === 96) {
- if (zo(n) && n.constraint && vf(n.constraint))
- return n.constraint.typeName;
- if (Mb(n) && vf(n.extendsType))
- return n.extendsType.typeName;
- }
- if (e.kind === 140 && pS(n))
- return n.typeParameter.name;
- if (e.kind === 103 && zo(n) && mS(n.parent))
- return n.name;
- if (e.kind === 143 && cv(n) && n.operator === 143 && vf(n.type))
- return n.type.typeName;
- if (e.kind === 148 && cv(n) && n.operator === 148 && rA(n.type) && vf(n.type.elementType))
- return n.type.elementType.typeName;
- if (!t) {
- if ((e.kind === 105 && jb(n) || e.kind === 116 && Nx(n) || e.kind === 114 && GC(n) || e.kind === 135 && Hy(n) || e.kind === 127 && Q5(n) || e.kind === 91 && Gee(n)) && n.expression)
- return Dc(n.expression);
- if ((e.kind === 103 || e.kind === 104) && dn(n) && n.operatorToken === e)
- return Dc(n.right);
- if (e.kind === 130 && iD(n) && vf(n.type))
- return n.type.typeName;
- if (e.kind === 103 && Z5(n) || e.kind === 165 && nA(n))
- return Dc(n.expression);
- }
- return e;
- }
- function YU(e) {
- return obe(
- e,
- /*forRename*/
- !1
- );
- }
- function XF(e) {
- return obe(
- e,
- /*forRename*/
- !0
- );
- }
- function h_(e, t) {
- return T6(e, t, (n) => fm(n) || p_(n.kind) || Di(n));
- }
- function T6(e, t, n) {
- return cbe(
- e,
- t,
- /*allowPositionInLeadingTrivia*/
- !1,
- n,
- /*includeEndPosition*/
- !1
- );
- }
- function xi(e, t) {
- return cbe(
- e,
- t,
- /*allowPositionInLeadingTrivia*/
- !0,
- /*includePrecedingTokenAtEndPosition*/
- void 0,
- /*includeEndPosition*/
- !1
- );
- }
- function cbe(e, t, n, i, s) {
- let o = e, c;
- e:
- for (; ; ) {
- const u = o.getChildren(e), d = IT(u, t, (g, h) => h, (g, h) => {
- const S = u[g].getEnd();
- if (S < t)
- return -1;
- const T = n ? u[g].getFullStart() : u[g].getStart(
- e,
- /*includeJsDocComment*/
- !0
- );
- return T > t ? 1 : _(u[g], T, S) ? u[g - 1] && _(u[g - 1]) ? 1 : 0 : i && T === t && u[g - 1] && u[g - 1].getEnd() === t && _(u[g - 1]) ? 1 : -1;
- });
- if (c)
- return c;
- if (d >= 0 && u[d]) {
- o = u[d];
- continue e;
- }
- return o;
- }
- function _(u, d, g) {
- if (g ?? (g = u.getEnd()), g < t || (d ?? (d = n ? u.getFullStart() : u.getStart(
- e,
- /*includeJsDocComment*/
- !0
- )), d > t))
- return !1;
- if (t < g || t === g && (u.kind === 1 || s))
- return !0;
- if (i && g === t) {
- const h = sl(t, e, u);
- if (h && i(h))
- return c = h, !0;
- }
- return !1;
- }
- }
- function _se(e, t) {
- let n = xi(e, t);
- for (; QF(n); ) {
- const i = Zb(n, n.parent, e);
- if (!i) return;
- n = i;
- }
- return n;
- }
- function r8(e, t) {
- const n = xi(e, t);
- return zT(n) && t > n.getStart(e) && t < n.getEnd() ? n : sl(t, e);
- }
- function Zb(e, t, n) {
- return i(t);
- function i(s) {
- return zT(s) && s.pos === e.end ? s : Tc(s.getChildren(n), (o) => /* previous token is enclosed somewhere in the child */ (o.pos <= e.pos && o.end > e.end || // previous token ends exactly at the beginning of child
- o.pos === e.end) && hse(o, n) ? i(o) : void 0);
- }
- }
- function sl(e, t, n, i) {
- const s = o(n || t);
- return E.assert(!(s && QF(s))), s;
- function o(c) {
- if (lbe(c) && c.kind !== 1)
- return c;
- const _ = c.getChildren(t), u = IT(_, e, (g, h) => h, (g, h) => e < _[g].end ? !_[g - 1] || e >= _[g - 1].end ? 0 : 1 : -1);
- if (u >= 0 && _[u]) {
- const g = _[u];
- if (e < g.end)
- if (g.getStart(
- t,
- /*includeJsDoc*/
- !i
- ) >= e || // cursor in the leading trivia
- !hse(g, t) || QF(g)) {
- const T = pse(
- _,
- /*exclusiveStartPosition*/
- u,
- t,
- c.kind
- );
- return T ? !i && QI(T) && T.getChildren(t).length ? o(T) : fse(T, t) : void 0;
- } else
- return o(g);
- }
- E.assert(n !== void 0 || c.kind === 307 || c.kind === 1 || QI(c));
- const d = pse(
- _,
- /*exclusiveStartPosition*/
- _.length,
- t,
- c.kind
- );
- return d && fse(d, t);
- }
- }
- function lbe(e) {
- return zT(e) && !QF(e);
- }
- function fse(e, t) {
- if (lbe(e))
- return e;
- const n = e.getChildren(t);
- if (n.length === 0)
- return e;
- const i = pse(
- n,
- /*exclusiveStartPosition*/
- n.length,
- t,
- e.kind
- );
- return i && fse(i, t);
- }
- function pse(e, t, n, i) {
- for (let s = t - 1; s >= 0; s--) {
- const o = e[s];
- if (QF(o))
- s === 0 && (i === 12 || i === 285) && E.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");
- else if (hse(e[s], n))
- return e[s];
- }
- }
- function Qx(e, t, n = sl(t, e)) {
- if (n && bj(n)) {
- const i = n.getStart(e), s = n.getEnd();
- if (i < t && t < s)
- return !0;
- if (t === s)
- return !!n.isUnterminated;
- }
- return !1;
- }
- function dse(e, t) {
- const n = xi(e, t);
- return n ? !!(n.kind === 12 || n.kind === 30 && n.parent.kind === 12 || n.kind === 30 && n.parent.kind === 294 || n && n.kind === 20 && n.parent.kind === 294 || n.kind === 30 && n.parent.kind === 287) : !1;
- }
- function QF(e) {
- return xx(e) && e.containsOnlyTriviaWhiteSpaces;
- }
- function ZU(e, t) {
- const n = xi(e, t);
- return Dy(n.kind) && t > n.getStart(e);
- }
- function mse(e, t) {
- const n = xi(e, t);
- return !!(xx(n) || n.kind === 19 && lD(n.parent) && Gg(n.parent.parent) || n.kind === 30 && ou(n.parent) && Gg(n.parent.parent));
- }
- function YF(e, t) {
- function n(i) {
- for (; i; )
- if (i.kind >= 285 && i.kind <= 294 || i.kind === 12 || i.kind === 30 || i.kind === 32 || i.kind === 80 || i.kind === 20 || i.kind === 19 || i.kind === 44)
- i = i.parent;
- else if (i.kind === 284) {
- if (t > i.getStart(e)) return !0;
- i = i.parent;
- } else
- return !1;
- return !1;
- }
- return n(xi(e, t));
- }
- function ZF(e, t, n) {
- const i = qs(e.kind), s = qs(t), o = e.getFullStart(), c = n.text.lastIndexOf(s, o);
- if (c === -1)
- return;
- if (n.text.lastIndexOf(i, o - 1) < c) {
- const d = sl(c + 1, n);
- if (d && d.kind === t)
- return d;
- }
- const _ = e.kind;
- let u = 0;
- for (; ; ) {
- const d = sl(e.getFullStart(), n);
- if (!d)
- return;
- if (e = d, e.kind === t) {
- if (u === 0)
- return e;
- u--;
- } else e.kind === _ && u++;
- }
- }
- function Zje(e, t, n) {
- return t ? e.getNonNullableType() : n ? e.getNonOptionalType() : e;
- }
- function n8(e, t, n) {
- const i = eV(e, t);
- return i !== void 0 && (um(i.called) || KU(i.called, i.nTypeArguments, n).length !== 0 || n8(i.called, t, n));
- }
- function KU(e, t, n) {
- let i = n.getTypeAtLocation(e);
- return hu(e.parent) && (i = Zje(
- i,
- KE(e.parent),
- /*isOptionalChain*/
- !0
- )), (jb(e.parent) ? i.getConstructSignatures() : i.getCallSignatures()).filter((o) => !!o.typeParameters && o.typeParameters.length >= t);
- }
- function eV(e, t) {
- if (t.text.lastIndexOf("<", e ? e.pos : t.text.length) === -1)
- return;
- let n = e, i = 0, s = 0;
- for (; n; ) {
- switch (n.kind) {
- case 30:
- if (n = sl(n.getFullStart(), t), n && n.kind === 29 && (n = sl(n.getFullStart(), t)), !n || !Oe(n)) return;
- if (!i)
- return og(n) ? void 0 : { called: n, nTypeArguments: s };
- i--;
- break;
- case 50:
- i = 3;
- break;
- case 49:
- i = 2;
- break;
- case 32:
- i++;
- break;
- case 20:
- if (n = ZF(n, 19, t), !n) return;
- break;
- case 22:
- if (n = ZF(n, 21, t), !n) return;
- break;
- case 24:
- if (n = ZF(n, 23, t), !n) return;
- break;
- case 28:
- s++;
- break;
- case 39:
- case 80:
- case 11:
- case 9:
- case 10:
- case 112:
- case 97:
- case 114:
- case 96:
- case 143:
- case 25:
- case 52:
- case 58:
- case 59:
- break;
- default:
- if (fi(n))
- break;
- return;
- }
- n = sl(n.getFullStart(), t);
- }
- }
- function O0(e, t, n) {
- return Yc.getRangeOfEnclosingComment(
- e,
- t,
- /*precedingToken*/
- void 0,
- n
- );
- }
- function gse(e, t) {
- const n = xi(e, t);
- return !!or(n, Id);
- }
- function hse(e, t) {
- return e.kind === 1 ? !!e.jsDoc : e.getWidth(t) !== 0;
- }
- function HD(e, t = 0) {
- const n = [], i = ql(e) ? cj(e) & ~t : 0;
- return i & 2 && n.push(
- "private"
- /* privateMemberModifier */
- ), i & 4 && n.push(
- "protected"
- /* protectedMemberModifier */
- ), i & 1 && n.push(
- "public"
- /* publicMemberModifier */
- ), (i & 256 || oc(e)) && n.push(
- "static"
- /* staticModifier */
- ), i & 64 && n.push(
- "abstract"
- /* abstractModifier */
- ), i & 32 && n.push(
- "export"
- /* exportedModifier */
- ), i & 65536 && n.push(
- "deprecated"
- /* deprecatedModifier */
- ), e.flags & 33554432 && n.push(
- "declare"
- /* ambientModifier */
- ), e.kind === 277 && n.push(
- "export"
- /* exportedModifier */
- ), n.length > 0 ? n.join(",") : "";
- }
- function yse(e) {
- if (e.kind === 183 || e.kind === 213)
- return e.typeArguments;
- if (ys(e) || e.kind === 263 || e.kind === 264)
- return e.typeParameters;
- }
- function KF(e) {
- return e === 2 || e === 3;
- }
- function tV(e) {
- return !!(e === 11 || e === 14 || Dy(e));
- }
- function ube(e, t, n) {
- return !!(t.flags & 4) && e.isEmptyAnonymousObjectType(n);
- }
- function vse(e) {
- if (!e.isIntersection())
- return !1;
- const { types: t, checker: n } = e;
- return t.length === 2 && (ube(n, t[0], t[1]) || ube(n, t[1], t[0]));
- }
- function i8(e, t, n) {
- return Dy(e.kind) && e.getStart(n) < t && t < e.end || !!e.isUnterminated && t === e.end;
- }
- function rV(e) {
- switch (e) {
- case 125:
- case 123:
- case 124:
- return !0;
- }
- return !1;
- }
- function nV(e) {
- const t = bX(e);
- return Dz(t, e && e.configFile), t;
- }
- function F0(e) {
- return !!((e.kind === 209 || e.kind === 210) && (e.parent.kind === 226 && e.parent.left === e && e.parent.operatorToken.kind === 64 || e.parent.kind === 250 && e.parent.initializer === e || F0(e.parent.kind === 303 ? e.parent.parent : e.parent)));
- }
- function bse(e, t) {
- return _be(
- e,
- t,
- /*shouldBeReference*/
- !0
- );
- }
- function Sse(e, t) {
- return _be(
- e,
- t,
- /*shouldBeReference*/
- !1
- );
- }
- function _be(e, t, n) {
- const i = O0(
- e,
- t,
- /*tokenAtPosition*/
- void 0
- );
- return !!i && n === Vje.test(e.text.substring(i.pos, i.end));
- }
- function iV(e, t) {
- if (e)
- switch (e.kind) {
- case 11:
- case 15:
- return sV(e, t);
- default:
- return t_(e);
- }
- }
- function t_(e, t, n) {
- return kc(e.getStart(t), (n || e).getEnd());
- }
- function sV(e, t) {
- let n = e.getEnd() - 1;
- if (e.isUnterminated) {
- if (e.getStart() === n) return;
- n = Math.min(t, e.getEnd());
- }
- return kc(e.getStart() + 1, n);
- }
- function aV(e, t) {
- return op(e.getStart(t), e.end);
- }
- function L0(e) {
- return kc(e.pos, e.end);
- }
- function e9(e) {
- return op(e.start, e.start + e.length);
- }
- function t9(e, t, n) {
- return s8(Ul(e, t), n);
- }
- function s8(e, t) {
- return { span: e, newText: t };
- }
- var oV = [
- 133,
- 131,
- 163,
- 136,
- 97,
- 140,
- 143,
- 146,
- 106,
- 150,
- 151,
- 148,
- 154,
- 155,
- 114,
- 112,
- 116,
- 157,
- 158,
- 159
- /* UnknownKeyword */
- ];
- function GD(e) {
- return ss(oV, e);
- }
- function fbe(e) {
- return e.kind === 156;
- }
- function r9(e) {
- return fbe(e) || Oe(e) && e.text === "type";
- }
- function x6() {
- const e = [];
- return (t) => {
- const n = Ma(t);
- return !e[n] && (e[n] = !0);
- };
- }
- function Yx(e) {
- return e.getText(0, e.getLength());
- }
- function a8(e, t) {
- let n = "";
- for (let i = 0; i < t; i++)
- n += e;
- return n;
- }
- function cV(e) {
- return e.isTypeParameter() && e.getConstraint() || e;
- }
- function o8(e) {
- return e.kind === 167 ? Of(e.expression) ? e.expression.text : void 0 : Di(e) ? Nn(e) : Jp(e);
- }
- function Tse(e) {
- return e.getSourceFiles().some((t) => !t.isDeclarationFile && !e.isSourceFileFromExternalLibrary(t) && !!(t.externalModuleIndicator || t.commonJsModuleIndicator));
- }
- function xse(e) {
- return e.getSourceFiles().some((t) => !t.isDeclarationFile && !e.isSourceFileFromExternalLibrary(t) && !!t.externalModuleIndicator);
- }
- function lV(e) {
- return !!e.module || pa(e) >= 2 || !!e.noEmit;
- }
- function Zx(e, t) {
- return {
- fileExists: (n) => e.fileExists(n),
- getCurrentDirectory: () => t.getCurrentDirectory(),
- readFile: Ms(t, t.readFile),
- useCaseSensitiveFileNames: Ms(t, t.useCaseSensitiveFileNames),
- getSymlinkCache: Ms(t, t.getSymlinkCache) || e.getSymlinkCache,
- getModuleSpecifierCache: Ms(t, t.getModuleSpecifierCache),
- getPackageJsonInfoCache: () => {
- var n;
- return (n = e.getModuleResolutionCache()) == null ? void 0 : n.getPackageJsonInfoCache();
- },
- getGlobalTypingsCacheLocation: Ms(t, t.getGlobalTypingsCacheLocation),
- redirectTargetsMap: e.redirectTargetsMap,
- getProjectReferenceRedirect: (n) => e.getProjectReferenceRedirect(n),
- isSourceOfProjectReferenceRedirect: (n) => e.isSourceOfProjectReferenceRedirect(n),
- getNearestAncestorDirectoryWithPackageJson: Ms(t, t.getNearestAncestorDirectoryWithPackageJson),
- getFileIncludeReasons: () => e.getFileIncludeReasons(),
- getCommonSourceDirectory: () => e.getCommonSourceDirectory(),
- getDefaultResolutionModeForFile: (n) => e.getDefaultResolutionModeForFile(n),
- getModeForResolutionAtIndex: (n, i) => e.getModeForResolutionAtIndex(n, i)
- };
- }
- function uV(e, t) {
- return {
- ...Zx(e, t),
- getCommonSourceDirectory: () => e.getCommonSourceDirectory()
- };
- }
- function n9(e) {
- return e === 2 || e >= 3 && e <= 99 || e === 100;
- }
- function t1(e, t, n, i, s) {
- return A.createImportDeclaration(
- /*modifiers*/
- void 0,
- e || t ? A.createImportClause(!!s, e, t && t.length ? A.createNamedImports(t) : void 0) : void 0,
- typeof n == "string" ? $D(n, i) : n,
- /*attributes*/
- void 0
- );
- }
- function $D(e, t) {
- return A.createStringLiteral(
- e,
- t === 0
- /* Single */
- );
- }
- var kse = /* @__PURE__ */ ((e) => (e[e.Single = 0] = "Single", e[e.Double = 1] = "Double", e))(kse || {});
- function _V(e, t) {
- return w7(e, t) ? 1 : 0;
- }
- function bf(e, t) {
- if (t.quotePreference && t.quotePreference !== "auto")
- return t.quotePreference === "single" ? 0 : 1;
- {
- const n = sg(e) && e.imports && On(e.imports, (i) => oa(i) && !fo(i.parent));
- return n ? _V(n, e) : 1;
- }
- }
- function fV(e) {
- switch (e) {
- case 0:
- return "'";
- case 1:
- return '"';
- default:
- return E.assertNever(e);
- }
- }
- function pV(e) {
- const t = i9(e);
- return t === void 0 ? void 0 : Ei(t);
- }
- function i9(e) {
- return e.escapedName !== "default" ? e.escapedName : Tc(e.declarations, (t) => {
- const n = os(t);
- return n && n.kind === 80 ? n.escapedText : void 0;
- });
- }
- function s9(e) {
- return Xa(e) && (Fh(e.parent) || ic(e.parent) || Cm(e.parent) || f_(
- e.parent,
- /*requireStringLiteralLikeArgument*/
- !1
- ) && e.parent.arguments[0] === e || hf(e.parent) && e.parent.arguments[0] === e);
- }
- function c8(e) {
- return va(e) && Mf(e.parent) && Oe(e.name) && !e.propertyName;
- }
- function a9(e, t) {
- const n = e.getTypeAtLocation(t.parent);
- return n && e.getPropertyOfType(n, t.name.text);
- }
- function l8(e, t, n) {
- if (e)
- for (; e.parent; ) {
- if (Si(e.parent) || !Kje(n, e.parent, t))
- return e;
- e = e.parent;
- }
- }
- function Kje(e, t, n) {
- return sj(e, t.getStart(n)) && t.getEnd() <= ec(e);
- }
- function k6(e, t) {
- return Hp(e) ? On(e.modifiers, (n) => n.kind === t) : void 0;
- }
- function dV(e, t, n, i, s) {
- var o;
- const _ = (us(n) ? n[0] : n).kind === 243 ? r3 : XT, u = Ln(t.statements, _), { comparer: d, isSorted: g } = Av.getOrganizeImportsStringComparerWithDetection(u, s), h = us(n) ? V_(n, (S, T) => Av.compareImportsOrRequireStatements(S, T, d)) : [n];
- if (!u?.length) {
- if (sg(t))
- e.insertNodesAtTopOfFile(t, h, i);
- else
- for (const S of h)
- e.insertStatementsInNewFile(t.fileName, [S], (o = Ho(S)) == null ? void 0 : o.getSourceFile());
- return;
- }
- if (E.assert(sg(t)), u && g)
- for (const S of h) {
- const T = Av.getImportDeclarationInsertionIndex(u, S, d);
- if (T === 0) {
- const C = u[0] === t.statements[0] ? { leadingTriviaOption: sn.LeadingTriviaOption.Exclude } : {};
- e.insertNodeBefore(
- t,
- u[0],
- S,
- /*blankLineBetween*/
- !1,
- C
- );
- } else {
- const C = u[T - 1];
- e.insertNodeAfter(t, C, S);
- }
- }
- else {
- const S = Ro(u);
- S ? e.insertNodesAfter(t, S, h) : e.insertNodesAtTopOfFile(t, h, i);
- }
- }
- function mV(e, t) {
- return E.assert(e.isTypeOnly), Bs(e.getChildAt(0, t), fbe);
- }
- function C6(e, t) {
- return !!e && !!t && e.start === t.start && e.length === t.length;
- }
- function gV(e, t, n) {
- return (n ? ub : Sy)(e.fileName, t.fileName) && C6(e.textSpan, t.textSpan);
- }
- function hV(e) {
- return (t, n) => gV(t, n, e);
- }
- function yV(e, t) {
- if (e) {
- for (let n = 0; n < e.length; n++)
- if (e.indexOf(e[n]) === n) {
- const i = t(e[n], n);
- if (i)
- return i;
- }
- }
- }
- function Cse(e, t, n) {
- for (let i = t; i < n; i++)
- if (!Ng(e.charCodeAt(i)))
- return !1;
- return !0;
- }
- function XD(e, t, n) {
- const i = t.tryGetSourcePosition(e);
- return i && (!n || n(Os(i.fileName)) ? i : void 0);
- }
- function o9(e, t, n) {
- const { fileName: i, textSpan: s } = e, o = XD({ fileName: i, pos: s.start }, t, n);
- if (!o) return;
- const c = XD({ fileName: i, pos: s.start + s.length }, t, n), _ = c ? c.pos - o.pos : s.length;
- return {
- fileName: o.fileName,
- textSpan: {
- start: o.pos,
- length: _
- },
- originalFileName: e.fileName,
- originalTextSpan: e.textSpan,
- contextSpan: vV(e, t, n),
- originalContextSpan: e.contextSpan
- };
- }
- function vV(e, t, n) {
- const i = e.contextSpan && XD(
- { fileName: e.fileName, pos: e.contextSpan.start },
- t,
- n
- ), s = e.contextSpan && XD(
- { fileName: e.fileName, pos: e.contextSpan.start + e.contextSpan.length },
- t,
- n
- );
- return i && s ? { start: i.pos, length: s.pos - i.pos } : void 0;
- }
- function bV(e) {
- const t = e.declarations ? el(e.declarations) : void 0;
- return !!or(t, (n) => Ii(n) ? !0 : va(n) || Mf(n) || w0(n) ? !1 : "quit");
- }
- var Ese = eBe();
- function eBe() {
- const e = l4 * 10;
- let t, n, i, s;
- g();
- const o = (h) => _(
- h,
- 17
- /* text */
- );
- return {
- displayParts: () => {
- const h = t.length && t[t.length - 1].text;
- return s > e && h && h !== "..." && (Ng(h.charCodeAt(h.length - 1)) || t.push(w_(
- " ",
- 16
- /* space */
- )), t.push(w_(
- "...",
- 15
- /* punctuation */
- ))), t;
- },
- writeKeyword: (h) => _(
- h,
- 5
- /* keyword */
- ),
- writeOperator: (h) => _(
- h,
- 12
- /* operator */
- ),
- writePunctuation: (h) => _(
- h,
- 15
- /* punctuation */
- ),
- writeTrailingSemicolon: (h) => _(
- h,
- 15
- /* punctuation */
- ),
- writeSpace: (h) => _(
- h,
- 16
- /* space */
- ),
- writeStringLiteral: (h) => _(
- h,
- 8
- /* stringLiteral */
- ),
- writeParameter: (h) => _(
- h,
- 13
- /* parameterName */
- ),
- writeProperty: (h) => _(
- h,
- 14
- /* propertyName */
- ),
- writeLiteral: (h) => _(
- h,
- 8
- /* stringLiteral */
- ),
- writeSymbol: u,
- writeLine: d,
- write: o,
- writeComment: o,
- getText: () => "",
- getTextPos: () => 0,
- getColumn: () => 0,
- getLine: () => 0,
- isAtStartOfLine: () => !1,
- hasTrailingWhitespace: () => !1,
- hasTrailingComment: () => !1,
- rawWrite: Vs,
- getIndent: () => i,
- increaseIndent: () => {
- i++;
- },
- decreaseIndent: () => {
- i--;
- },
- clear: g
- };
- function c() {
- if (!(s > e) && n) {
- const h = J7(i);
- h && (s += h.length, t.push(w_(
- h,
- 16
- /* space */
- ))), n = !1;
- }
- }
- function _(h, S) {
- s > e || (c(), s += h.length, t.push(w_(h, S)));
- }
- function u(h, S) {
- s > e || (c(), s += h.length, t.push(tBe(h, S)));
- }
- function d() {
- s > e || (s += 1, t.push(E6()), n = !0);
- }
- function g() {
- t = [], n = !0, i = 0, s = 0;
- }
- }
- function tBe(e, t) {
- return w_(e, n(t));
- function n(i) {
- const s = i.flags;
- return s & 3 ? bV(i) ? 13 : 9 : s & 4 || s & 32768 || s & 65536 ? 14 : s & 8 ? 19 : s & 16 ? 20 : s & 32 ? 1 : s & 64 ? 4 : s & 384 ? 2 : s & 1536 ? 11 : s & 8192 ? 10 : s & 262144 ? 18 : s & 524288 || s & 2097152 ? 0 : 17;
- }
- }
- function w_(e, t) {
- return { text: e, kind: BF[t] };
- }
- function uc() {
- return w_(
- " ",
- 16
- /* space */
- );
- }
- function sf(e) {
- return w_(
- qs(e),
- 5
- /* keyword */
- );
- }
- function Tu(e) {
- return w_(
- qs(e),
- 15
- /* punctuation */
- );
- }
- function QD(e) {
- return w_(
- qs(e),
- 12
- /* operator */
- );
- }
- function Dse(e) {
- return w_(
- e,
- 13
- /* parameterName */
- );
- }
- function Pse(e) {
- return w_(
- e,
- 14
- /* propertyName */
- );
- }
- function SV(e) {
- const t = H2(e);
- return t === void 0 ? Jf(e) : sf(t);
- }
- function Jf(e) {
- return w_(
- e,
- 17
- /* text */
- );
- }
- function wse(e) {
- return w_(
- e,
- 0
- /* aliasName */
- );
- }
- function Ase(e) {
- return w_(
- e,
- 18
- /* typeParameterName */
- );
- }
- function Nse(e) {
- return w_(
- e,
- 24
- /* linkText */
- );
- }
- function rBe(e, t) {
- return {
- text: e,
- kind: BF[
- 23
- /* linkName */
- ],
- target: {
- fileName: Tr(t).fileName,
- textSpan: t_(t)
- }
- };
- }
- function pbe(e) {
- return w_(
- e,
- 22
- /* link */
- );
- }
- function Ise(e, t) {
- var n;
- const i = tte(e) ? "link" : rte(e) ? "linkcode" : "linkplain", s = [pbe(`{@${i} `)];
- if (!e.name)
- e.text && s.push(Nse(e.text));
- else {
- const o = t?.getSymbolAtLocation(e.name), c = o && t ? kV(o, t) : void 0, _ = iBe(e.text), u = nc(e.name) + e.text.slice(0, _), d = nBe(e.text.slice(_)), g = c?.valueDeclaration || ((n = c?.declarations) == null ? void 0 : n[0]);
- if (g)
- s.push(rBe(u, g)), d && s.push(Nse(d));
- else {
- const h = _ === 0 || e.text.charCodeAt(_) === 124 && u.charCodeAt(u.length - 1) !== 32 ? " " : "";
- s.push(Nse(u + h + d));
- }
- }
- return s.push(pbe("}")), s;
- }
- function nBe(e) {
- let t = 0;
- if (e.charCodeAt(t++) === 124) {
- for (; t < e.length && e.charCodeAt(t) === 32; ) t++;
- return e.slice(t);
- }
- return e;
- }
- function iBe(e) {
- let t = e.indexOf("://");
- if (t === 0) {
- for (; t < e.length && e.charCodeAt(t) !== 124; ) t++;
- return t;
- }
- if (e.indexOf("()") === 0) return 2;
- if (e.charAt(0) === "<") {
- let n = 0, i = 0;
- for (; i < e.length; )
- if (e[i] === "<" && n++, e[i] === ">" && n--, i++, !n) return i;
- }
- return 0;
- }
- var sBe = `
-`;
- function jh(e, t) {
- var n;
- return t?.newLineCharacter || ((n = e.getNewLine) == null ? void 0 : n.call(e)) || sBe;
- }
- function E6() {
- return w_(
- `
-`,
- 6
- /* lineBreak */
- );
- }
- function xv(e) {
- try {
- return e(Ese), Ese.displayParts();
- } finally {
- Ese.clear();
- }
- }
- function u8(e, t, n, i = 0) {
- return xv((s) => {
- e.writeType(t, n, i | 1024 | 16384, s);
- });
- }
- function YD(e, t, n, i, s = 0) {
- return xv((o) => {
- e.writeSymbol(t, n, i, s | 8, o);
- });
- }
- function TV(e, t, n, i = 0) {
- return i |= 25632, xv((s) => {
- e.writeSignature(
- t,
- n,
- i,
- /*kind*/
- void 0,
- s
- );
- });
- }
- function Ose(e) {
- return !!e.parent && G1(e.parent) && e.parent.propertyName === e;
- }
- function xV(e, t) {
- return v5(e, t.getScriptKind && t.getScriptKind(e));
- }
- function kV(e, t) {
- let n = e;
- for (; aBe(n) || Lg(n) && n.links.target; )
- Lg(n) && n.links.target ? n = n.links.target : n = Hl(n, t);
- return n;
- }
- function aBe(e) {
- return (e.flags & 2097152) !== 0;
- }
- function Fse(e, t) {
- return na(Hl(e, t));
- }
- function Lse(e, t) {
- for (; Ng(e.charCodeAt(t)); )
- t += 1;
- return t;
- }
- function c9(e, t) {
- for (; t > -1 && sm(e.charCodeAt(t)); )
- t -= 1;
- return t + 1;
- }
- function Ja(e, t = !0) {
- const n = e && dbe(e);
- return n && !t && af(n), Nh(
- n,
- /*incremental*/
- !1
- );
- }
- function _8(e, t, n) {
- let i = n(e);
- return i ? kn(i, e) : i = dbe(e, n), i && !t && af(i), i;
- }
- function dbe(e, t) {
- const n = t ? (o) => _8(
- o,
- /*includeTrivia*/
- !0,
- t
- ) : Ja, s = br(
- e,
- n,
- /*context*/
- void 0,
- t ? (o) => o && CV(
- o,
- /*includeTrivia*/
- !0,
- t
- ) : (o) => o && Kb(o),
- n
- );
- if (s === e) {
- const o = oa(e) ? kn(A.createStringLiteralFromNode(e), e) : d_(e) ? kn(A.createNumericLiteral(e.text, e.numericLiteralFlags), e) : A.cloneNode(e);
- return lt(o, e);
- }
- return s.parent = void 0, s;
- }
- function Kb(e, t = !0) {
- if (e) {
- const n = A.createNodeArray(e.map((i) => Ja(i, t)), e.hasTrailingComma);
- return lt(n, e), n;
- }
- return e;
- }
- function CV(e, t, n) {
- return A.createNodeArray(e.map((i) => _8(i, t, n)), e.hasTrailingComma);
- }
- function af(e) {
- EV(e), Mse(e);
- }
- function EV(e) {
- Rse(e, 1024, cBe);
- }
- function Mse(e) {
- Rse(e, 2048, qB);
- }
- function NS(e, t) {
- const n = e.getSourceFile(), i = n.text;
- oBe(e, i) ? D6(e, t, n) : p8(e, t, n), ZD(e, t, n);
- }
- function oBe(e, t) {
- const n = e.getFullStart(), i = e.getStart();
- for (let s = n; s < i; s++)
- if (t.charCodeAt(s) === 10) return !0;
- return !1;
- }
- function Rse(e, t, n) {
- hm(e, t);
- const i = n(e);
- i && Rse(i, t, n);
- }
- function cBe(e) {
- return e.forEachChild((t) => t);
- }
- function IS(e, t) {
- let n = e;
- for (let i = 1; !a7(t, n); i++)
- n = `${e}_${i}`;
- return n;
- }
- function f8(e, t, n, i) {
- let s = 0, o = -1;
- for (const { fileName: c, textChanges: _ } of e) {
- E.assert(c === t);
- for (const u of _) {
- const { span: d, newText: g } = u, h = lBe(g, cg(n));
- if (h !== -1 && (o = d.start + s + h, !i))
- return o;
- s += g.length - d.length;
- }
- }
- return E.assert(i), E.assert(o >= 0), o;
- }
- function D6(e, t, n, i, s) {
- mw(n.text, e.pos, jse(t, n, i, s, Z4));
- }
- function ZD(e, t, n, i, s) {
- gw(n.text, e.end, jse(t, n, i, s, j5));
- }
- function p8(e, t, n, i, s) {
- gw(n.text, e.pos, jse(t, n, i, s, Z4));
- }
- function jse(e, t, n, i, s) {
- return (o, c, _, u) => {
- _ === 3 ? (o += 2, c -= 2) : o += 2, s(e, n || _, t.text.slice(o, c), i !== void 0 ? i : u);
- };
- }
- function lBe(e, t) {
- if (Ui(e, t)) return 0;
- let n = e.indexOf(" " + t);
- return n === -1 && (n = e.indexOf("." + t)), n === -1 && (n = e.indexOf('"' + t)), n === -1 ? -1 : n + 1;
- }
- function l9(e) {
- return dn(e) && e.operatorToken.kind === 28 || Ks(e) || (iD(e) || Y5(e)) && Ks(e.expression);
- }
- function u9(e, t, n) {
- const i = ag(e.parent);
- switch (i.kind) {
- case 214:
- return t.getContextualType(i, n);
- case 226: {
- const { left: s, operatorToken: o, right: c } = i;
- return _9(o.kind) ? t.getTypeAtLocation(e === c ? s : c) : t.getContextualType(e, n);
- }
- case 296:
- return PV(i, t);
- default:
- return t.getContextualType(e, n);
- }
- }
- function KD(e, t, n) {
- const i = bf(e, t), s = JSON.stringify(n);
- return i === 0 ? `'${ap(s).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : s;
- }
- function _9(e) {
- switch (e) {
- case 37:
- case 35:
- case 38:
- case 36:
- return !0;
- default:
- return !1;
- }
- }
- function Bse(e) {
- switch (e.kind) {
- case 11:
- case 15:
- case 228:
- case 215:
- return !0;
- default:
- return !1;
- }
- }
- function DV(e) {
- return !!e.getStringIndexType() || !!e.getNumberIndexType();
- }
- function PV(e, t) {
- return t.getTypeAtLocation(e.parent.parent.expression);
- }
- var wV = "anonymous function";
- function eP(e, t, n, i) {
- const s = n.getTypeChecker();
- let o = !0;
- const c = () => o = !1, _ = s.typeToTypeNode(e, t, 1, 8, {
- trackSymbol: (u, d, g) => (o = o && s.isSymbolAccessible(
- u,
- d,
- g,
- /*shouldComputeAliasToMarkVisible*/
- !1
- ).accessibility === 0, !o),
- reportInaccessibleThisError: c,
- reportPrivateInBaseOfClassExpression: c,
- reportInaccessibleUniqueSymbolError: c,
- moduleResolverHost: uV(n, i)
- });
- return o ? _ : void 0;
- }
- function Jse(e) {
- return e === 179 || e === 180 || e === 181 || e === 171 || e === 173;
- }
- function mbe(e) {
- return e === 262 || e === 176 || e === 174 || e === 177 || e === 178;
- }
- function gbe(e) {
- return e === 267;
- }
- function zse(e) {
- return e === 243 || e === 244 || e === 246 || e === 251 || e === 252 || e === 253 || e === 257 || e === 259 || e === 172 || e === 265 || e === 272 || e === 271 || e === 278 || e === 270 || e === 277;
- }
- var uBe = Nf(
- Jse,
- mbe,
- gbe,
- zse
- );
- function _Be(e, t) {
- const n = e.getLastToken(t);
- if (n && n.kind === 27)
- return !1;
- if (Jse(e.kind)) {
- if (n && n.kind === 28)
- return !1;
- } else if (gbe(e.kind)) {
- const _ = _a(e.getChildren(t));
- if (_ && Sm(_))
- return !1;
- } else if (mbe(e.kind)) {
- const _ = _a(e.getChildren(t));
- if (_ && vb(_))
- return !1;
- } else if (!zse(e.kind))
- return !1;
- if (e.kind === 246)
- return !0;
- const i = or(e, (_) => !_.parent), s = Zb(e, i, t);
- if (!s || s.kind === 20)
- return !0;
- const o = t.getLineAndCharacterOfPosition(e.getEnd()).line, c = t.getLineAndCharacterOfPosition(s.getStart(t)).line;
- return o !== c;
- }
- function f9(e, t, n) {
- const i = or(t, (s) => s.end !== e ? "quit" : uBe(s.kind));
- return !!i && _Be(i, n);
- }
- function d8(e) {
- let t = 0, n = 0;
- const i = 5;
- return bs(e, function s(o) {
- if (zse(o.kind)) {
- const c = o.getLastToken(e);
- c?.kind === 27 ? t++ : n++;
- } else if (Jse(o.kind)) {
- const c = o.getLastToken(e);
- if (c?.kind === 27)
- t++;
- else if (c && c.kind !== 28) {
- const _ = Qs(e, c.getStart(e)).line, u = Qs(e, cm(e, c.end).start).line;
- _ !== u && n++;
- }
- }
- return t + n >= i ? !0 : bs(o, s);
- }), t === 0 && n <= 1 ? !0 : t / n > 1 / i;
- }
- function p9(e, t) {
- return Wse(e, e.getDirectories, t) || [];
- }
- function AV(e, t, n, i, s) {
- return Wse(e, e.readDirectory, t, n, i, s) || Ue;
- }
- function m8(e, t) {
- return Wse(e, e.fileExists, t);
- }
- function d9(e, t) {
- return m9(() => Dd(t, e)) || !1;
- }
- function m9(e) {
- try {
- return e();
- } catch {
- return;
- }
- }
- function Wse(e, t, ...n) {
- return m9(() => t && t.apply(e, n));
- }
- function NV(e, t, n) {
- const i = [];
- return Fp(e, (s) => {
- if (s === n)
- return !0;
- const o = Bn(s, "package.json");
- m8(t, o) && i.push(o);
- }), i;
- }
- function Use(e, t) {
- let n;
- return Fp(e, (i) => {
- if (i === "node_modules" || (n = PW(i, (s) => m8(t, s), "package.json"), n))
- return !0;
- }), n;
- }
- function fBe(e, t) {
- if (!t.fileExists)
- return [];
- const n = [];
- return Fp(Xn(e), (i) => {
- const s = Bn(i, "package.json");
- if (t.fileExists(s)) {
- const o = IV(s, t);
- o && n.push(o);
- }
- }), n;
- }
- function IV(e, t) {
- if (!t.readFile)
- return;
- const n = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"], i = t.readFile(e) || "", s = K7(i), o = {};
- if (s)
- for (const u of n) {
- const d = s[u];
- if (!d)
- continue;
- const g = /* @__PURE__ */ new Map();
- for (const h in d)
- g.set(h, d[h]);
- o[u] = g;
- }
- const c = [
- [1, o.dependencies],
- [2, o.devDependencies],
- [8, o.optionalDependencies],
- [4, o.peerDependencies]
- ];
- return {
- ...o,
- parseable: !!s,
- fileName: e,
- get: _,
- has(u, d) {
- return !!_(u, d);
- }
- };
- function _(u, d = 15) {
- for (const [g, h] of c)
- if (h && d & g) {
- const S = h.get(u);
- if (S !== void 0)
- return S;
- }
- }
- }
- function P6(e, t, n) {
- const i = (n.getPackageJsonsVisibleToFile && n.getPackageJsonsVisibleToFile(e.fileName) || fBe(e.fileName, n)).filter((C) => C.parseable);
- let s, o, c;
- return {
- allowsImportingAmbientModule: u,
- getSourceFileInfo: d,
- allowsImportingSpecifier: g
- };
- function _(C) {
- const D = T(C);
- for (const P of i)
- if (P.has(D) || P.has(jO(D)))
- return !0;
- return !1;
- }
- function u(C, D) {
- if (!i.length || !C.valueDeclaration)
- return !0;
- if (!o)
- o = /* @__PURE__ */ new Map();
- else {
- const B = o.get(C);
- if (B !== void 0)
- return B;
- }
- const P = ap(C.getName());
- if (h(P))
- return o.set(C, !0), !0;
- const I = C.valueDeclaration.getSourceFile(), F = S(I.fileName, D);
- if (typeof F > "u")
- return o.set(C, !0), !0;
- const O = _(F) || _(P);
- return o.set(C, O), O;
- }
- function d(C, D) {
- if (!i.length)
- return { importable: !0, packageName: void 0 };
- if (!c)
- c = /* @__PURE__ */ new Map();
- else {
- const O = c.get(C);
- if (O !== void 0)
- return O;
- }
- const P = S(C.fileName, D);
- if (!P) {
- const O = { importable: !0, packageName: P };
- return c.set(C, O), O;
- }
- const F = { importable: _(P), packageName: P };
- return c.set(C, F), F;
- }
- function g(C) {
- return !i.length || h(C) || If(C) || H_(C) ? !0 : _(C);
- }
- function h(C) {
- return !!(sg(e) && Gu(e) && Dm.nodeCoreModules.has(C) && (s === void 0 && (s = g9(e)), s));
- }
- function S(C, D) {
- if (!C.includes("node_modules"))
- return;
- const P = N0.getNodeModulesPackageName(
- n.getCompilationSettings(),
- e,
- C,
- D,
- t
- );
- if (P && !If(P) && !H_(P))
- return T(P);
- }
- function T(C) {
- const D = Cl(ED(C)).slice(1);
- return Ui(D[0], "@") ? `${D[0]}/${D[1]}` : D[0];
- }
- }
- function g9(e) {
- return ut(e.imports, ({ text: t }) => Dm.nodeCoreModules.has(t));
- }
- function g8(e) {
- return ss(Cl(e), "node_modules");
- }
- function hbe(e) {
- return e.file !== void 0 && e.start !== void 0 && e.length !== void 0;
- }
- function Vse(e, t) {
- const n = t_(e), i = IT(t, n, go, dI);
- if (i >= 0) {
- const s = t[i];
- return E.assertEqual(s.file, e.getSourceFile(), "Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"), Bs(s, hbe);
- }
- }
- function qse(e, t) {
- var n;
- let i = IT(t, e.start, (c) => c.start, ho);
- for (i < 0 && (i = ~i); ((n = t[i - 1]) == null ? void 0 : n.start) === e.start; )
- i--;
- const s = [], o = ec(e);
- for (; ; ) {
- const c = Wn(t[i], hbe);
- if (!c || c.start > o)
- break;
- sY(e, c) && s.push(c), i++;
- }
- return s;
- }
- function Kx({ startPosition: e, endPosition: t }) {
- return kc(e, t === void 0 ? e : t);
- }
- function OV(e, t) {
- const n = xi(e, t.start);
- return or(n, (s) => s.getStart(e) < t.start || s.getEnd() > ec(t) ? "quit" : _t(s) && C6(t, t_(s, e)));
- }
- function FV(e, t, n = go) {
- return e ? us(e) ? n(lr(e, t)) : t(e, 0) : void 0;
- }
- function LV(e) {
- return us(e) ? xa(e) : e;
- }
- function h9(e, t, n) {
- return e.escapedName === "export=" || e.escapedName === "default" ? MV(e) || h8(pBe(e), t, !!n) : e.name;
- }
- function MV(e) {
- return Tc(e.declarations, (t) => {
- var n, i, s;
- return wo(t) ? (n = Wn(Dc(t.expression), Oe)) == null ? void 0 : n.text : vu(t) && t.symbol.flags === 2097152 ? (i = Wn(t.propertyName, Oe)) == null ? void 0 : i.text : (s = Wn(os(t), Oe)) == null ? void 0 : s.text;
- });
- }
- function pBe(e) {
- var t;
- return E.checkDefined(
- e.parent,
- `Symbol parent was undefined. Flags: ${E.formatSymbolFlags(e.flags)}. Declarations: ${(t = e.declarations) == null ? void 0 : t.map((n) => {
- const i = E.formatSyntaxKind(n.kind), s = cn(n), { expression: o } = n;
- return (s ? "[JS]" : "") + i + (o ? ` (expression: ${E.formatSyntaxKind(o.kind)})` : "");
- }).join(", ")}.`
- );
- }
- function h8(e, t, n) {
- return y8($u(ap(e.name)), t, n);
- }
- function y8(e, t, n) {
- const i = Hc(eC(e, "/index"));
- let s = "", o = !0;
- const c = i.charCodeAt(0);
- eg(c, t) ? (s += String.fromCharCode(c), n && (s = s.toUpperCase())) : o = !1;
- for (let _ = 1; _ < i.length; _++) {
- const u = i.charCodeAt(_), d = Th(u, t);
- if (d) {
- let g = String.fromCharCode(u);
- o || (g = g.toUpperCase()), s += g;
- }
- o = d;
- }
- return ix(s) ? `_${s}` : s || "_";
- }
- function Hse(e, t, n) {
- const i = t.length;
- if (i + n > e.length)
- return !1;
- for (let s = 0; s < i; s++)
- if (t.charCodeAt(s) !== e.charCodeAt(s + n)) return !1;
- return !0;
- }
- function RV(e) {
- return e.charCodeAt(0) === 95;
- }
- function y9(e) {
- return !!(cj(e) & 65536);
- }
- function v9(e, t) {
- return Tc(e.imports, (i) => {
- if (Dm.nodeCoreModules.has(i.text))
- return Ui(i.text, "node:");
- }) ?? t.usesUriStyleNodeCoreModules;
- }
- function v8(e) {
- return e === `
-` ? 1 : 0;
- }
- function e2(e) {
- return us(e) ? zg(ms(e[0]), e.slice(1)) : ms(e);
- }
- function b9({ options: e }, t) {
- const n = !e.semicolons || e.semicolons === "ignore", i = e.semicolons === "remove" || n && !d8(t);
- return {
- ...e,
- semicolons: i ? "remove" : "ignore"
- /* Ignore */
- };
- }
- function jV(e) {
- return e === 2 || e === 3;
- }
- function w6(e, t) {
- return e.isSourceFileFromExternalLibrary(t) || e.isSourceFileDefaultLibrary(t);
- }
- function S9(e, t) {
- const n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
- for (const _ of t)
- if (!uD(_)) {
- const u = Ba(_.expression);
- if (X2(u))
- switch (u.kind) {
- case 15:
- case 11:
- n.add(u.text);
- break;
- case 9:
- i.add(parseInt(u.text));
- break;
- case 10:
- const d = nee(Zo(u.text, "n") ? u.text.slice(0, -1) : u.text);
- d && s.add(Ib(d));
- break;
- }
- else {
- const d = e.getSymbolAtLocation(_.expression);
- if (d && d.valueDeclaration && A0(d.valueDeclaration)) {
- const g = e.getConstantValue(d.valueDeclaration);
- g !== void 0 && o(g);
- }
- }
- }
- return {
- addValue: o,
- hasValue: c
- };
- function o(_) {
- switch (typeof _) {
- case "string":
- n.add(_);
- break;
- case "number":
- i.add(_);
- }
- }
- function c(_) {
- switch (typeof _) {
- case "string":
- return n.has(_);
- case "number":
- return i.has(_);
- case "object":
- return s.has(Ib(_));
- }
- }
- }
- function BV(e, t, n, i) {
- var s;
- const o = typeof e == "string" ? e : e.fileName;
- if (!Ug(o))
- return !1;
- const c = typeof e == "string" ? t.getCompilerOptions() : t.getCompilerOptionsForFile(e), _ = Ru(c), u = typeof e == "string" ? {
- fileName: e,
- impliedNodeFormat: zA(uo(e, n.getCurrentDirectory(), S0(n)), (s = t.getPackageJsonInfoCache) == null ? void 0 : s.call(t), n, c)
- } : e, d = PS(u, c);
- if (d === 99)
- return !1;
- if (d === 1 || c.verbatimModuleSyntax && _ === 1)
- return !0;
- if (c.verbatimModuleSyntax && j3(_))
- return !1;
- if (typeof e == "object") {
- if (e.commonJsModuleIndicator)
- return !0;
- if (e.externalModuleIndicator)
- return !1;
- }
- return i;
- }
- function ek(e) {
- switch (e.kind) {
- case 241:
- case 307:
- case 268:
- case 296:
- return !0;
- default:
- return !1;
- }
- }
- function T9(e, t, n, i) {
- var s;
- const o = fF(e, (s = n.getPackageJsonInfoCache) == null ? void 0 : s.call(n), i, n.getCompilerOptions());
- let c, _;
- return typeof o == "object" && (c = o.impliedNodeFormat, _ = o.packageJsonScope), {
- path: uo(e, n.getCurrentDirectory(), n.getCanonicalFileName),
- fileName: e,
- externalModuleIndicator: t === 99 ? !0 : void 0,
- commonJsModuleIndicator: t === 1 ? !0 : void 0,
- impliedNodeFormat: c,
- packageJsonScope: _,
- statements: Ue,
- imports: Ue
- };
- }
- var Gse = /* @__PURE__ */ ((e) => (e[e.Named = 0] = "Named", e[e.Default = 1] = "Default", e[e.Namespace = 2] = "Namespace", e[e.CommonJS = 3] = "CommonJS", e))(Gse || {}), $se = /* @__PURE__ */ ((e) => (e[e.Named = 0] = "Named", e[e.Default = 1] = "Default", e[e.ExportEquals = 2] = "ExportEquals", e[e.UMD = 3] = "UMD", e))($se || {});
- function JV(e) {
- let t = 1;
- const n = Ip(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
- let o;
- const c = {
- isUsableByFile: (T) => T === o,
- isEmpty: () => !n.size,
- clear: () => {
- n.clear(), i.clear(), o = void 0;
- },
- add: (T, C, D, P, I, F, O, B) => {
- T !== o && (c.clear(), o = T);
- let z;
- if (I) {
- const Se = A5(I.fileName);
- if (Se) {
- const { topLevelNodeModulesIndex: J, topLevelPackageNameIndex: oe, packageRootIndex: _e } = Se;
- if (z = EA(ED(I.fileName.substring(oe + 1, _e))), Ui(T, I.path.substring(0, J))) {
- const he = s.get(z), le = I.fileName.substring(0, oe + 1);
- if (he) {
- const me = he.indexOf(Xg);
- J > me && s.set(z, le);
- } else
- s.set(z, le);
- }
- }
- }
- const q = F === 1 && N4(C) || C, V = F === 0 || fC(q) ? Ei(D) : mBe(
- q,
- B,
- /*scriptTarget*/
- void 0
- ), ae = typeof V == "string" ? V : V[0], ee = typeof V == "string" ? void 0 : V[1], G = ap(P.name), ue = t++, re = Hl(C, B), ne = C.flags & 33554432 ? void 0 : C, ie = P.flags & 33554432 ? void 0 : P;
- (!ne || !ie) && i.set(ue, [C, P]), n.add(u(ae, C, Sl(G) ? void 0 : G, B), {
- id: ue,
- symbolTableKey: D,
- symbolName: ae,
- capitalizedSymbolName: ee,
- moduleName: G,
- moduleFile: I,
- moduleFileName: I?.fileName,
- packageName: z,
- exportKind: F,
- targetFlags: re.flags,
- isFromPackageJson: O,
- symbol: ne,
- moduleSymbol: ie
- });
- },
- get: (T, C) => {
- if (T !== o) return;
- const D = n.get(C);
- return D?.map(_);
- },
- search: (T, C, D, P) => {
- if (T === o)
- return El(n, (I, F) => {
- const { symbolName: O, ambientModuleName: B } = d(F), z = C && I[0].capitalizedSymbolName || O;
- if (D(z, I[0].targetFlags)) {
- const q = I.map(_).filter((V, ae) => S(V, I[ae].packageName));
- if (q.length) {
- const V = P(q, z, !!B, F);
- if (V !== void 0) return V;
- }
- }
- });
- },
- releaseSymbols: () => {
- i.clear();
- },
- onFileChanged: (T, C, D) => g(T) && g(C) ? !1 : o && o !== C.path || // If ATA is enabled, auto-imports uses existing imports to guess whether you want auto-imports from node.
- // Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list.
- D && g9(T) !== g9(C) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported.
- // Changes elsewhere in the file can change the *type* of an export in a module augmentation,
- // but type info is gathered in getCompletionEntryDetails, which doesn't use the cache.
- !Af(T.moduleAugmentations, C.moduleAugmentations) || !h(T, C) ? (c.clear(), !0) : (o = C.path, !1)
- };
- return E.isDebugging && Object.defineProperty(c, "__cache", { value: n }), c;
- function _(T) {
- if (T.symbol && T.moduleSymbol) return T;
- const { id: C, exportKind: D, targetFlags: P, isFromPackageJson: I, moduleFileName: F } = T, [O, B] = i.get(C) || Ue;
- if (O && B)
- return {
- symbol: O,
- moduleSymbol: B,
- moduleFileName: F,
- exportKind: D,
- targetFlags: P,
- isFromPackageJson: I
- };
- const z = (I ? e.getPackageJsonAutoImportProvider() : e.getCurrentProgram()).getTypeChecker(), X = T.moduleSymbol || B || E.checkDefined(
- T.moduleFile ? z.getMergedSymbol(T.moduleFile.symbol) : z.tryFindAmbientModule(T.moduleName)
- ), q = T.symbol || O || E.checkDefined(
- D === 2 ? z.resolveExternalModuleSymbol(X) : z.tryGetMemberInModuleExportsAndProperties(Ei(T.symbolTableKey), X),
- `Could not find symbol '${T.symbolName}' by key '${T.symbolTableKey}' in module ${X.name}`
- );
- return i.set(C, [q, X]), {
- symbol: q,
- moduleSymbol: X,
- moduleFileName: F,
- exportKind: D,
- targetFlags: P,
- isFromPackageJson: I
- };
- }
- function u(T, C, D, P) {
- const I = D || "";
- return `${T.length} ${na(Hl(C, P))} ${T} ${I}`;
- }
- function d(T) {
- const C = T.indexOf(" "), D = T.indexOf(" ", C + 1), P = parseInt(T.substring(0, C), 10), I = T.substring(D + 1), F = I.substring(0, P), O = I.substring(P + 1);
- return { symbolName: F, ambientModuleName: O === "" ? void 0 : O };
- }
- function g(T) {
- return !T.commonJsModuleIndicator && !T.externalModuleIndicator && !T.moduleAugmentations && !T.ambientModuleNames;
- }
- function h(T, C) {
- if (!Af(T.ambientModuleNames, C.ambientModuleNames))
- return !1;
- let D = -1, P = -1;
- for (const I of C.ambientModuleNames) {
- const F = (O) => Wj(O) && O.name.text === I;
- if (D = ac(T.statements, F, D + 1), P = ac(C.statements, F, P + 1), T.statements[D] !== C.statements[P])
- return !1;
- }
- return !0;
- }
- function S(T, C) {
- if (!C || !T.moduleFileName) return !0;
- const D = e.getGlobalTypingsCacheLocation();
- if (D && Ui(T.moduleFileName, D)) return !0;
- const P = s.get(C);
- return !P || Ui(T.moduleFileName, P);
- }
- }
- function zV(e, t, n, i, s, o, c) {
- var _;
- if (t === n) return !1;
- const u = c?.get(t.path, n.path, i, {});
- if (u?.isBlockedByPackageJsonDependencies !== void 0)
- return !u.isBlockedByPackageJsonDependencies || !!u.packageName && b8(t, u.packageName);
- const d = S0(o), g = (_ = o.getGlobalTypingsCacheLocation) == null ? void 0 : _.call(o), h = !!N0.forEachFileNameOfModule(
- t.fileName,
- n.fileName,
- o,
- /*preferSymlinks*/
- !1,
- (S) => {
- const T = e.getSourceFile(S);
- return (T === n || !T) && dBe(t.fileName, S, d, g);
- }
- );
- if (s) {
- const S = h ? s.getSourceFileInfo(n, o) : void 0;
- return c?.setBlockedByPackageJsonDependencies(t.path, n.path, i, {}, S?.packageName, !S?.importable), !!S?.importable || !!S?.packageName && b8(t, S.packageName);
- }
- return h;
- }
- function b8(e, t) {
- return e.imports && e.imports.some((n) => n.text === t || n.text.startsWith(t + "/"));
- }
- function dBe(e, t, n, i) {
- const s = Fp(t, (c) => Hc(c) === "node_modules" ? c : void 0), o = s && Xn(n(s));
- return o === void 0 || Ui(n(e), o) || !!i && Ui(n(i), o);
- }
- function WV(e, t, n, i, s) {
- var o, c;
- const _ = sx(t), u = n.autoImportFileExcludePatterns && ybe(n, _);
- vbe(e.getTypeChecker(), e.getSourceFiles(), u, t, (g, h) => s(
- g,
- h,
- e,
- /*isFromPackageJson*/
- !1
- ));
- const d = i && ((o = t.getPackageJsonAutoImportProvider) == null ? void 0 : o.call(t));
- if (d) {
- const g = lo(), h = e.getTypeChecker();
- vbe(d.getTypeChecker(), d.getSourceFiles(), u, t, (S, T) => {
- (T && !e.getSourceFile(T.fileName) || !T && !h.resolveName(
- S.name,
- /*location*/
- void 0,
- 1536,
- /*excludeGlobals*/
- !1
- )) && s(
- S,
- T,
- d,
- /*isFromPackageJson*/
- !0
- );
- }), (c = t.log) == null || c.call(t, `forEachExternalModuleToImportFrom autoImportProvider: ${lo() - g}`);
- }
- }
- function ybe(e, t) {
- return Ai(e.autoImportFileExcludePatterns, (n) => {
- const i = h5(n, "", "exclude");
- return i ? Jy(i, t) : void 0;
- });
- }
- function vbe(e, t, n, i, s) {
- var o;
- const c = n && bbe(n, i);
- for (const _ of e.getAmbientModules())
- !_.name.includes("*") && !(n && ((o = _.declarations) != null && o.every((u) => c(u.getSourceFile())))) && s(
- _,
- /*sourceFile*/
- void 0
- );
- for (const _ of t)
- X_(_) && !c?.(_) && s(e.getMergedSymbol(_.symbol), _);
- }
- function bbe(e, t) {
- var n;
- const i = (n = t.getSymlinkCache) == null ? void 0 : n.call(t).getSymlinkedDirectoriesByRealpath();
- return ({ fileName: s, path: o }) => {
- if (e.some((c) => c.test(s))) return !0;
- if (i?.size && Yy(s)) {
- let c = Xn(s);
- return Fp(Xn(o), (_) => {
- const u = i.get(ul(_));
- if (u)
- return u.some((d) => e.some((g) => g.test(s.replace(c, d))));
- c = Xn(c);
- }) ?? !1;
- }
- return !1;
- };
- }
- function Xse(e, t) {
- return t.autoImportFileExcludePatterns ? bbe(ybe(t, sx(e)), e) : () => !1;
- }
- function S8(e, t, n, i, s) {
- var o, c, _, u, d;
- const g = lo();
- (o = t.getPackageJsonAutoImportProvider) == null || o.call(t);
- const h = ((c = t.getCachedExportInfoMap) == null ? void 0 : c.call(t)) || JV({
- getCurrentProgram: () => n,
- getPackageJsonAutoImportProvider: () => {
- var T;
- return (T = t.getPackageJsonAutoImportProvider) == null ? void 0 : T.call(t);
- },
- getGlobalTypingsCacheLocation: () => {
- var T;
- return (T = t.getGlobalTypingsCacheLocation) == null ? void 0 : T.call(t);
- }
- });
- if (h.isUsableByFile(e.path))
- return (_ = t.log) == null || _.call(t, "getExportInfoMap: cache hit"), h;
- (u = t.log) == null || u.call(t, "getExportInfoMap: cache miss or empty; calculating new results");
- let S = 0;
- try {
- WV(
- n,
- t,
- i,
- /*useAutoImportProvider*/
- !0,
- (T, C, D, P) => {
- ++S % 100 === 0 && s?.throwIfCancellationRequested();
- const I = /* @__PURE__ */ new Map(), F = D.getTypeChecker(), O = x9(T, F);
- O && Sbe(O.symbol, F) && h.add(
- e.path,
- O.symbol,
- O.exportKind === 1 ? "default" : "export=",
- T,
- C,
- O.exportKind,
- P,
- F
- ), F.forEachExportAndPropertyOfModule(T, (B, z) => {
- B !== O?.symbol && Sbe(B, F) && zp(I, z) && h.add(
- e.path,
- B,
- z,
- T,
- C,
- 0,
- P,
- F
- );
- });
- }
- );
- } catch (T) {
- throw h.clear(), T;
- }
- return (d = t.log) == null || d.call(t, `getExportInfoMap: done in ${lo() - g} ms`), h;
- }
- function x9(e, t) {
- const n = t.resolveExternalModuleSymbol(e);
- if (n !== e) return {
- symbol: n,
- exportKind: 2
- /* ExportEquals */
- };
- const i = t.tryGetMemberInModuleExports("default", e);
- if (i) return {
- symbol: i,
- exportKind: 1
- /* Default */
- };
- }
- function Sbe(e, t) {
- return !t.isUndefinedSymbol(e) && !t.isUnknownSymbol(e) && !b3(e) && !ZZ(e);
- }
- function mBe(e, t, n) {
- let i;
- return k9(e, t, n, (s, o) => (i = o ? [s, o] : s, !0)), E.checkDefined(i);
- }
- function k9(e, t, n, i) {
- let s, o = e;
- const c = /* @__PURE__ */ new Map();
- for (; o; ) {
- const _ = MV(o);
- if (_) {
- const u = i(_);
- if (u) return u;
- }
- if (o.escapedName !== "default" && o.escapedName !== "export=") {
- const u = i(o.name);
- if (u) return u;
- }
- if (s = wr(s, o), !zp(c, o)) break;
- o = o.flags & 2097152 ? t.getImmediateAliasedSymbol(o) : void 0;
- }
- for (const _ of s ?? Ue)
- if (_.parent && fC(_.parent)) {
- const u = i(
- h8(
- _.parent,
- n,
- /*forceCapitalize*/
- !1
- ),
- h8(
- _.parent,
- n,
- /*forceCapitalize*/
- !0
- )
- );
- if (u) return u;
- }
- }
- function Tbe() {
- const e = Og(
- 99,
- /*skipTrivia*/
- !1
- );
- function t(i, s, o) {
- return vBe(n(i, s, o), i);
- }
- function n(i, s, o) {
- let c = 0, _ = 0;
- const u = [], { prefix: d, pushTemplate: g } = TBe(s);
- i = d + i;
- const h = d.length;
- g && u.push(
- 16
- /* TemplateHead */
- ), e.setText(i);
- let S = 0;
- const T = [];
- let C = 0;
- do {
- c = e.scan(), PC(c) || (D(), _ = c);
- const P = e.getTokenEnd();
- if (yBe(e.getTokenStart(), P, h, CBe(c), T), P >= i.length) {
- const I = hBe(e, c, Ro(u));
- I !== void 0 && (S = I);
- }
- } while (c !== 1);
- function D() {
- switch (c) {
- case 44:
- case 69:
- !gBe[_] && e.reScanSlashToken() === 14 && (c = 14);
- break;
- case 30:
- _ === 80 && C++;
- break;
- case 32:
- C > 0 && C--;
- break;
- case 133:
- case 154:
- case 150:
- case 136:
- case 155:
- C > 0 && !o && (c = 80);
- break;
- case 16:
- u.push(c);
- break;
- case 19:
- u.length > 0 && u.push(c);
- break;
- case 20:
- if (u.length > 0) {
- const P = Ro(u);
- P === 16 ? (c = e.reScanTemplateToken(
- /*isTaggedTemplate*/
- !1
- ), c === 18 ? u.pop() : E.assertEqual(c, 17, "Should have been a template middle.")) : (E.assertEqual(P, 19, "Should have been an open brace"), u.pop());
- }
- break;
- default:
- if (!p_(c))
- break;
- (_ === 25 || p_(_) && p_(c) && !SBe(_, c)) && (c = 80);
- }
- }
- return { endOfLineState: S, spans: T };
- }
- return { getClassificationsForLine: t, getEncodedLexicalClassifications: n };
- }
- var gBe = vX(
- [
- 80,
- 11,
- 9,
- 10,
- 14,
- 110,
- 46,
- 47,
- 22,
- 24,
- 20,
- 112,
- 97
- /* FalseKeyword */
- ],
- (e) => e,
- () => !0
- );
- function hBe(e, t, n) {
- switch (t) {
- case 11: {
- if (!e.isUnterminated()) return;
- const i = e.getTokenText(), s = i.length - 1;
- let o = 0;
- for (; i.charCodeAt(s - o) === 92; )
- o++;
- return o & 1 ? i.charCodeAt(0) === 34 ? 3 : 2 : void 0;
- }
- case 3:
- return e.isUnterminated() ? 1 : void 0;
- default:
- if (Dy(t)) {
- if (!e.isUnterminated())
- return;
- switch (t) {
- case 18:
- return 5;
- case 15:
- return 4;
- default:
- return E.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + t);
- }
- }
- return n === 16 ? 6 : void 0;
- }
- }
- function yBe(e, t, n, i, s) {
- if (i === 8)
- return;
- e === 0 && n > 0 && (e += n);
- const o = t - e;
- o > 0 && s.push(e - n, o, i);
- }
- function vBe(e, t) {
- const n = [], i = e.spans;
- let s = 0;
- for (let c = 0; c < i.length; c += 3) {
- const _ = i[c], u = i[c + 1], d = i[c + 2];
- if (s >= 0) {
- const g = _ - s;
- g > 0 && n.push({
- length: g,
- classification: 4
- /* Whitespace */
- });
- }
- n.push({ length: u, classification: bBe(d) }), s = _ + u;
- }
- const o = t.length - s;
- return o > 0 && n.push({
- length: o,
- classification: 4
- /* Whitespace */
- }), { entries: n, finalLexState: e.endOfLineState };
- }
- function bBe(e) {
- switch (e) {
- case 1:
- return 3;
- case 3:
- return 1;
- case 4:
- return 6;
- case 25:
- return 7;
- case 5:
- return 2;
- case 6:
- return 8;
- case 8:
- return 4;
- case 10:
- return 0;
- case 2:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 9:
- case 17:
- return 5;
- default:
- return;
- }
- }
- function SBe(e, t) {
- if (!rV(e))
- return !0;
- switch (t) {
- case 139:
- case 153:
- case 137:
- case 126:
- case 129:
- return !0;
- default:
- return !1;
- }
- }
- function TBe(e) {
- switch (e) {
- case 3:
- return { prefix: `"\\
-` };
- case 2:
- return { prefix: `'\\
-` };
- case 1:
- return { prefix: `/*
-` };
- case 4:
- return { prefix: "`\n" };
- case 5:
- return { prefix: `}
-`, pushTemplate: !0 };
- case 6:
- return { prefix: "", pushTemplate: !0 };
- case 0:
- return { prefix: "" };
- default:
- return E.assertNever(e);
- }
- }
- function xBe(e) {
- switch (e) {
- case 42:
- case 44:
- case 45:
- case 40:
- case 41:
- case 48:
- case 49:
- case 50:
- case 30:
- case 32:
- case 33:
- case 34:
- case 104:
- case 103:
- case 130:
- case 152:
- case 35:
- case 36:
- case 37:
- case 38:
- case 51:
- case 53:
- case 52:
- case 56:
- case 57:
- case 75:
- case 74:
- case 79:
- case 71:
- case 72:
- case 73:
- case 65:
- case 66:
- case 67:
- case 69:
- case 70:
- case 64:
- case 28:
- case 61:
- case 76:
- case 77:
- case 78:
- return !0;
- default:
- return !1;
- }
- }
- function kBe(e) {
- switch (e) {
- case 40:
- case 41:
- case 55:
- case 54:
- case 46:
- case 47:
- return !0;
- default:
- return !1;
- }
- }
- function CBe(e) {
- if (p_(e))
- return 3;
- if (xBe(e) || kBe(e))
- return 5;
- if (e >= 19 && e <= 79)
- return 10;
- switch (e) {
- case 9:
- return 4;
- case 10:
- return 25;
- case 11:
- return 6;
- case 14:
- return 7;
- case 7:
- case 3:
- case 2:
- return 1;
- case 5:
- case 4:
- return 8;
- case 80:
- default:
- return Dy(e) ? 6 : 2;
- }
- }
- function Qse(e, t, n, i, s) {
- return Cbe(UV(e, t, n, i, s));
- }
- function xbe(e, t) {
- switch (t) {
- case 267:
- case 263:
- case 264:
- case 262:
- case 231:
- case 218:
- case 219:
- e.throwIfCancellationRequested();
- }
- }
- function UV(e, t, n, i, s) {
- const o = [];
- return n.forEachChild(function _(u) {
- if (!(!u || !bw(s, u.pos, u.getFullWidth()))) {
- if (xbe(t, u.kind), Oe(u) && !rc(u) && i.has(u.escapedText)) {
- const d = e.getSymbolAtLocation(u), g = d && kbe(d, wS(u), e);
- g && c(u.getStart(n), u.getEnd(), g);
- }
- u.forEachChild(_);
- }
- }), {
- spans: o,
- endOfLineState: 0
- /* None */
- };
- function c(_, u, d) {
- const g = u - _;
- E.assert(g > 0, `Classification had non-positive length of ${g}`), o.push(_), o.push(g), o.push(d);
- }
- }
- function kbe(e, t, n) {
- const i = e.getFlags();
- if (i & 2885600)
- return i & 32 ? 11 : i & 384 ? 12 : i & 524288 ? 16 : i & 1536 ? t & 4 || t & 1 && EBe(e) ? 14 : void 0 : i & 2097152 ? kbe(n.getAliasedSymbol(e), t, n) : t & 2 ? i & 64 ? 13 : i & 262144 ? 15 : void 0 : void 0;
- }
- function EBe(e) {
- return ut(
- e.declarations,
- (t) => zc(t) && Rh(t) === 1
- /* Instantiated */
- );
- }
- function DBe(e) {
- switch (e) {
- case 1:
- return "comment";
- case 2:
- return "identifier";
- case 3:
- return "keyword";
- case 4:
- return "number";
- case 25:
- return "bigint";
- case 5:
- return "operator";
- case 6:
- return "string";
- case 8:
- return "whitespace";
- case 9:
- return "text";
- case 10:
- return "punctuation";
- case 11:
- return "class name";
- case 12:
- return "enum name";
- case 13:
- return "interface name";
- case 14:
- return "module name";
- case 15:
- return "type parameter name";
- case 16:
- return "type alias name";
- case 17:
- return "parameter name";
- case 18:
- return "doc comment tag name";
- case 19:
- return "jsx open tag name";
- case 20:
- return "jsx close tag name";
- case 21:
- return "jsx self closing tag name";
- case 22:
- return "jsx attribute";
- case 23:
- return "jsx text";
- case 24:
- return "jsx attribute string literal value";
- default:
- return;
- }
- }
- function Cbe(e) {
- E.assert(e.spans.length % 3 === 0);
- const t = e.spans, n = [];
- for (let i = 0; i < t.length; i += 3)
- n.push({
- textSpan: Ul(t[i], t[i + 1]),
- classificationType: DBe(t[i + 2])
- });
- return n;
- }
- function Yse(e, t, n) {
- return Cbe(VV(e, t, n));
- }
- function VV(e, t, n) {
- const i = n.start, s = n.length, o = Og(
- 99,
- /*skipTrivia*/
- !1,
- t.languageVariant,
- t.text
- ), c = Og(
- 99,
- /*skipTrivia*/
- !1,
- t.languageVariant,
- t.text
- ), _ = [];
- return B(t), {
- spans: _,
- endOfLineState: 0
- /* None */
- };
- function u(z, X, q) {
- _.push(z), _.push(X), _.push(q);
- }
- function d(z) {
- for (o.resetTokenState(z.pos); ; ) {
- const X = o.getTokenEnd();
- if (!eY(t.text, X))
- return X;
- const q = o.scan(), V = o.getTokenEnd(), ae = V - X;
- if (!PC(q))
- return X;
- switch (q) {
- case 4:
- case 5:
- continue;
- case 2:
- case 3:
- g(z, q, X, ae), o.resetTokenState(V);
- continue;
- case 7:
- const ee = t.text, G = ee.charCodeAt(X);
- if (G === 60 || G === 62) {
- u(
- X,
- ae,
- 1
- /* comment */
- );
- continue;
- }
- E.assert(
- G === 124 || G === 61
- /* equals */
- ), D(ee, X, V);
- break;
- case 6:
- break;
- default:
- E.assertNever(q);
- }
- }
- }
- function g(z, X, q, V) {
- if (X === 3) {
- const ae = Nte(t.text, q, V);
- if (ae && ae.jsDoc) {
- Aa(ae.jsDoc, z), S(ae.jsDoc);
- return;
- }
- } else if (X === 2 && T(q, V))
- return;
- h(q, V);
- }
- function h(z, X) {
- u(
- z,
- X,
- 1
- /* comment */
- );
- }
- function S(z) {
- var X, q, V, ae, ee, G, ue, re;
- let ne = z.pos;
- if (z.tags)
- for (const Se of z.tags) {
- Se.pos !== ne && h(ne, Se.pos - ne), u(
- Se.pos,
- 1,
- 10
- /* punctuation */
- ), u(
- Se.tagName.pos,
- Se.tagName.end - Se.tagName.pos,
- 18
- /* docCommentTagName */
- ), ne = Se.tagName.end;
- let J = Se.tagName.end;
- switch (Se.kind) {
- case 341:
- const oe = Se;
- ie(oe), J = oe.isNameFirst && ((X = oe.typeExpression) == null ? void 0 : X.end) || oe.name.end;
- break;
- case 348:
- const _e = Se;
- J = _e.isNameFirst && ((q = _e.typeExpression) == null ? void 0 : q.end) || _e.name.end;
- break;
- case 345:
- C(Se), ne = Se.end, J = Se.typeParameters.end;
- break;
- case 346:
- const he = Se;
- J = ((V = he.typeExpression) == null ? void 0 : V.kind) === 309 && ((ae = he.fullName) == null ? void 0 : ae.end) || ((ee = he.typeExpression) == null ? void 0 : ee.end) || J;
- break;
- case 338:
- J = Se.typeExpression.end;
- break;
- case 344:
- B(Se.typeExpression), ne = Se.end, J = Se.typeExpression.end;
- break;
- case 343:
- case 340:
- J = Se.typeExpression.end;
- break;
- case 342:
- B(Se.typeExpression), ne = Se.end, J = ((G = Se.typeExpression) == null ? void 0 : G.end) || J;
- break;
- case 347:
- J = ((ue = Se.name) == null ? void 0 : ue.end) || J;
- break;
- case 328:
- case 329:
- J = Se.class.end;
- break;
- case 349:
- B(Se.typeExpression), ne = Se.end, J = ((re = Se.typeExpression) == null ? void 0 : re.end) || J;
- break;
- }
- typeof Se.comment == "object" ? h(Se.comment.pos, Se.comment.end - Se.comment.pos) : typeof Se.comment == "string" && h(J, Se.end - J);
- }
- ne !== z.end && h(ne, z.end - ne);
- return;
- function ie(Se) {
- Se.isNameFirst && (h(ne, Se.name.pos - ne), u(
- Se.name.pos,
- Se.name.end - Se.name.pos,
- 17
- /* parameterName */
- ), ne = Se.name.end), Se.typeExpression && (h(ne, Se.typeExpression.pos - ne), B(Se.typeExpression), ne = Se.typeExpression.end), Se.isNameFirst || (h(ne, Se.name.pos - ne), u(
- Se.name.pos,
- Se.name.end - Se.name.pos,
- 17
- /* parameterName */
- ), ne = Se.name.end);
- }
- }
- function T(z, X) {
- const q = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/m, V = /(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/g, ae = t.text.substr(z, X), ee = q.exec(ae);
- if (!ee || !ee[3] || !(ee[3] in TI))
- return !1;
- let G = z;
- h(G, ee[1].length), G += ee[1].length, u(
- G,
- ee[2].length,
- 10
- /* punctuation */
- ), G += ee[2].length, u(
- G,
- ee[3].length,
- 21
- /* jsxSelfClosingTagName */
- ), G += ee[3].length;
- const ue = ee[4];
- let re = G;
- for (; ; ) {
- const ie = V.exec(ue);
- if (!ie)
- break;
- const Se = G + ie.index + ie[1].length;
- Se > re && (h(re, Se - re), re = Se), u(
- re,
- ie[2].length,
- 22
- /* jsxAttribute */
- ), re += ie[2].length, ie[3].length && (h(re, ie[3].length), re += ie[3].length), u(
- re,
- ie[4].length,
- 5
- /* operator */
- ), re += ie[4].length, ie[5].length && (h(re, ie[5].length), re += ie[5].length), u(
- re,
- ie[6].length,
- 24
- /* jsxAttributeStringLiteralValue */
- ), re += ie[6].length;
- }
- G += ee[4].length, G > re && h(re, G - re), ee[5] && (u(
- G,
- ee[5].length,
- 10
- /* punctuation */
- ), G += ee[5].length);
- const ne = z + X;
- return G < ne && h(G, ne - G), !0;
- }
- function C(z) {
- for (const X of z.getChildren())
- B(X);
- }
- function D(z, X, q) {
- let V;
- for (V = X; V < q && !gu(z.charCodeAt(V)); V++)
- ;
- for (u(
- X,
- V - X,
- 1
- /* comment */
- ), c.resetTokenState(V); c.getTokenEnd() < q; )
- P();
- }
- function P() {
- const z = c.getTokenEnd(), X = c.scan(), q = c.getTokenEnd(), V = O(X);
- V && u(z, q - z, V);
- }
- function I(z) {
- if (Id(z) || rc(z))
- return !0;
- const X = F(z);
- if (!zT(z) && z.kind !== 12 && X === void 0)
- return !1;
- const q = z.kind === 12 ? z.pos : d(z), V = z.end - q;
- if (E.assert(V >= 0), V > 0) {
- const ae = X || O(z.kind, z);
- ae && u(q, V, ae);
- }
- return !0;
- }
- function F(z) {
- switch (z.parent && z.parent.kind) {
- case 286:
- if (z.parent.tagName === z)
- return 19;
- break;
- case 287:
- if (z.parent.tagName === z)
- return 20;
- break;
- case 285:
- if (z.parent.tagName === z)
- return 21;
- break;
- case 291:
- if (z.parent.name === z)
- return 22;
- break;
- }
- }
- function O(z, X) {
- if (p_(z))
- return 3;
- if ((z === 30 || z === 32) && X && yse(X.parent))
- return 10;
- if (mB(z)) {
- if (X) {
- const q = X.parent;
- if (z === 64 && (q.kind === 260 || q.kind === 172 || q.kind === 169 || q.kind === 291) || q.kind === 226 || q.kind === 224 || q.kind === 225 || q.kind === 227)
- return 5;
- }
- return 10;
- } else {
- if (z === 9)
- return 4;
- if (z === 10)
- return 25;
- if (z === 11)
- return X && X.parent.kind === 291 ? 24 : 6;
- if (z === 14)
- return 6;
- if (Dy(z))
- return 6;
- if (z === 12)
- return 23;
- if (z === 80) {
- if (X) {
- switch (X.parent.kind) {
- case 263:
- return X.parent.name === X ? 11 : void 0;
- case 168:
- return X.parent.name === X ? 15 : void 0;
- case 264:
- return X.parent.name === X ? 13 : void 0;
- case 266:
- return X.parent.name === X ? 12 : void 0;
- case 267:
- return X.parent.name === X ? 14 : void 0;
- case 169:
- return X.parent.name === X ? Ly(X) ? 3 : 17 : void 0;
- }
- if (xd(X.parent))
- return 3;
- }
- return 2;
- }
- }
- }
- function B(z) {
- if (z && Sw(i, s, z.pos, z.getFullWidth())) {
- xbe(e, z.kind);
- for (const X of z.getChildren(t))
- I(X) || B(X);
- }
- }
- }
- var C9;
- ((e) => {
- function t(G, ue, re, ne, ie) {
- const Se = h_(re, ne);
- if (Se.parent && (xm(Se.parent) && Se.parent.tagName === Se || Jb(Se.parent))) {
- const { openingElement: J, closingElement: oe } = Se.parent.parent, _e = [J, oe].map(({ tagName: he }) => n(he, re));
- return [{ fileName: re.fileName, highlightSpans: _e }];
- }
- return i(ne, Se, G, ue, ie) || s(Se, re);
- }
- e.getDocumentHighlights = t;
- function n(G, ue) {
- return {
- fileName: ue.fileName,
- textSpan: t_(G, ue),
- kind: "none"
- /* none */
- };
- }
- function i(G, ue, re, ne, ie) {
- const Se = new Set(ie.map((he) => he.fileName)), J = Eo.getReferenceEntriesForNode(
- G,
- ue,
- re,
- ie,
- ne,
- /*options*/
- void 0,
- Se
- );
- if (!J) return;
- const oe = nw(J.map(Eo.toHighlightSpan), (he) => he.fileName, (he) => he.span), _e = zl(re.useCaseSensitiveFileNames());
- return as(dy(oe.entries(), ([he, le]) => {
- if (!Se.has(he)) {
- if (!re.redirectTargetsMap.has(uo(he, re.getCurrentDirectory(), _e)))
- return;
- const me = re.getSourceFile(he);
- he = On(ie, (tt) => !!tt.redirectInfo && tt.redirectInfo.redirectTarget === me).fileName, E.assert(Se.has(he));
- }
- return { fileName: he, highlightSpans: le };
- }));
- }
- function s(G, ue) {
- const re = o(G, ue);
- return re && [{ fileName: ue.fileName, highlightSpans: re }];
- }
- function o(G, ue) {
- switch (G.kind) {
- case 101:
- case 93:
- return _v(G.parent) ? V(G.parent, ue) : void 0;
- case 107:
- return ne(G.parent, Up, B);
- case 111:
- return ne(G.parent, jJ, O);
- case 113:
- case 85:
- case 98:
- const Se = G.kind === 85 ? G.parent.parent : G.parent;
- return ne(Se, gS, F);
- case 109:
- return ne(G.parent, oD, I);
- case 84:
- case 90:
- return uD(G.parent) || XC(G.parent) ? ne(G.parent.parent.parent, oD, I) : void 0;
- case 83:
- case 88:
- return ne(G.parent, t4, P);
- case 99:
- case 117:
- case 92:
- return ne(G.parent, (J) => Ny(
- J,
- /*lookInLabeledStatements*/
- !0
- ), D);
- case 137:
- return re(Qo, [
- 137
- /* ConstructorKeyword */
- ]);
- case 139:
- case 153:
- return re(Ay, [
- 139,
- 153
- /* SetKeyword */
- ]);
- case 135:
- return ne(G.parent, Hy, z);
- case 134:
- return ie(z(G));
- case 127:
- return ie(X(G));
- case 103:
- case 147:
- return;
- default:
- return wy(G.kind) && (ql(G.parent) || yc(G.parent)) ? ie(S(G.kind, G.parent)) : void 0;
- }
- function re(Se, J) {
- return ne(G.parent, Se, (oe) => {
- var _e;
- return Ai((_e = Wn(oe, kd)) == null ? void 0 : _e.symbol.declarations, (he) => Se(he) ? On(he.getChildren(ue), (le) => ss(J, le.kind)) : void 0);
- });
- }
- function ne(Se, J, oe) {
- return J(Se) ? ie(oe(Se, ue)) : void 0;
- }
- function ie(Se) {
- return Se && Se.map((J) => n(J, ue));
- }
- }
- function c(G) {
- return jJ(G) ? [G] : gS(G) ? Qi(
- G.catchClause ? c(G.catchClause) : G.tryBlock && c(G.tryBlock),
- G.finallyBlock && c(G.finallyBlock)
- ) : ys(G) ? void 0 : d(G, c);
- }
- function _(G) {
- let ue = G;
- for (; ue.parent; ) {
- const re = ue.parent;
- if (vb(re) || re.kind === 307)
- return re;
- if (gS(re) && re.tryBlock === ue && re.catchClause)
- return ue;
- ue = re;
- }
- }
- function u(G) {
- return t4(G) ? [G] : ys(G) ? void 0 : d(G, u);
- }
- function d(G, ue) {
- const re = [];
- return G.forEachChild((ne) => {
- const ie = ue(ne);
- ie !== void 0 && re.push(...FT(ie));
- }), re;
- }
- function g(G, ue) {
- const re = h(ue);
- return !!re && re === G;
- }
- function h(G) {
- return or(G, (ue) => {
- switch (ue.kind) {
- case 255:
- if (G.kind === 251)
- return !1;
- case 248:
- case 249:
- case 250:
- case 247:
- case 246:
- return !G.label || ee(ue, G.label.escapedText);
- default:
- return ys(ue) && "quit";
- }
- });
- }
- function S(G, ue) {
- return Ai(T(ue, cx(G)), (re) => k6(re, G));
- }
- function T(G, ue) {
- const re = G.parent;
- switch (re.kind) {
- case 268:
- case 307:
- case 241:
- case 296:
- case 297:
- return ue & 64 && Xc(G) ? [...G.members, G] : re.statements;
- case 176:
- case 174:
- case 262:
- return [...re.parameters, ...Zn(re.parent) ? re.parent.members : []];
- case 263:
- case 231:
- case 264:
- case 187:
- const ne = re.members;
- if (ue & 15) {
- const ie = On(re.members, Qo);
- if (ie)
- return [...ne, ...ie.parameters];
- } else if (ue & 64)
- return [...ne, re];
- return ne;
- default:
- return;
- }
- }
- function C(G, ue, ...re) {
- return ue && ss(re, ue.kind) ? (G.push(ue), !0) : !1;
- }
- function D(G) {
- const ue = [];
- if (C(
- ue,
- G.getFirstToken(),
- 99,
- 117,
- 92
- /* DoKeyword */
- ) && G.kind === 246) {
- const re = G.getChildren();
- for (let ne = re.length - 1; ne >= 0 && !C(
- ue,
- re[ne],
- 117
- /* WhileKeyword */
- ); ne--)
- ;
- }
- return ir(u(G.statement), (re) => {
- g(G, re) && C(
- ue,
- re.getFirstToken(),
- 83,
- 88
- /* ContinueKeyword */
- );
- }), ue;
- }
- function P(G) {
- const ue = h(G);
- if (ue)
- switch (ue.kind) {
- case 248:
- case 249:
- case 250:
- case 246:
- case 247:
- return D(ue);
- case 255:
- return I(ue);
- }
- }
- function I(G) {
- const ue = [];
- return C(
- ue,
- G.getFirstToken(),
- 109
- /* SwitchKeyword */
- ), ir(G.caseBlock.clauses, (re) => {
- C(
- ue,
- re.getFirstToken(),
- 84,
- 90
- /* DefaultKeyword */
- ), ir(u(re), (ne) => {
- g(G, ne) && C(
- ue,
- ne.getFirstToken(),
- 83
- /* BreakKeyword */
- );
- });
- }), ue;
- }
- function F(G, ue) {
- const re = [];
- if (C(
- re,
- G.getFirstToken(),
- 113
- /* TryKeyword */
- ), G.catchClause && C(
- re,
- G.catchClause.getFirstToken(),
- 85
- /* CatchKeyword */
- ), G.finallyBlock) {
- const ne = Ya(G, 98, ue);
- C(
- re,
- ne,
- 98
- /* FinallyKeyword */
- );
- }
- return re;
- }
- function O(G, ue) {
- const re = _(G);
- if (!re)
- return;
- const ne = [];
- return ir(c(re), (ie) => {
- ne.push(Ya(ie, 111, ue));
- }), vb(re) && y0(re, (ie) => {
- ne.push(Ya(ie, 107, ue));
- }), ne;
- }
- function B(G, ue) {
- const re = yf(G);
- if (!re)
- return;
- const ne = [];
- return y0(Bs(re.body, Cs), (ie) => {
- ne.push(Ya(ie, 107, ue));
- }), ir(c(re.body), (ie) => {
- ne.push(Ya(ie, 111, ue));
- }), ne;
- }
- function z(G) {
- const ue = yf(G);
- if (!ue)
- return;
- const re = [];
- return ue.modifiers && ue.modifiers.forEach((ne) => {
- C(
- re,
- ne,
- 134
- /* AsyncKeyword */
- );
- }), bs(ue, (ne) => {
- q(ne, (ie) => {
- Hy(ie) && C(
- re,
- ie.getFirstToken(),
- 135
- /* AwaitKeyword */
- );
- });
- }), re;
- }
- function X(G) {
- const ue = yf(G);
- if (!ue)
- return;
- const re = [];
- return bs(ue, (ne) => {
- q(ne, (ie) => {
- Q5(ie) && C(
- re,
- ie.getFirstToken(),
- 127
- /* YieldKeyword */
- );
- });
- }), re;
- }
- function q(G, ue) {
- ue(G), !ys(G) && !Zn(G) && !Xl(G) && !zc(G) && !Vp(G) && !fi(G) && bs(G, (re) => q(re, ue));
- }
- function V(G, ue) {
- const re = ae(G, ue), ne = [];
- for (let ie = 0; ie < re.length; ie++) {
- if (re[ie].kind === 93 && ie < re.length - 1) {
- const Se = re[ie], J = re[ie + 1];
- let oe = !0;
- for (let _e = J.getStart(ue) - 1; _e >= Se.end; _e--)
- if (!sm(ue.text.charCodeAt(_e))) {
- oe = !1;
- break;
- }
- if (oe) {
- ne.push({
- fileName: ue.fileName,
- textSpan: kc(Se.getStart(), J.end),
- kind: "reference"
- /* reference */
- }), ie++;
- continue;
- }
- }
- ne.push(n(re[ie], ue));
- }
- return ne;
- }
- function ae(G, ue) {
- const re = [];
- for (; _v(G.parent) && G.parent.elseStatement === G; )
- G = G.parent;
- for (; ; ) {
- const ne = G.getChildren(ue);
- C(
- re,
- ne[0],
- 101
- /* IfKeyword */
- );
- for (let ie = ne.length - 1; ie >= 0 && !C(
- re,
- ne[ie],
- 93
- /* ElseKeyword */
- ); ie--)
- ;
- if (!G.elseStatement || !_v(G.elseStatement))
- break;
- G = G.elseStatement;
- }
- return re;
- }
- function ee(G, ue) {
- return !!or(G.parent, (re) => Gy(re) ? re.label.escapedText === ue : "quit");
- }
- })(C9 || (C9 = {}));
- function T8(e) {
- return !!e.sourceFile;
- }
- function Zse(e, t, n) {
- return qV(e, t, n);
- }
- function qV(e, t = "", n, i) {
- const s = /* @__PURE__ */ new Map(), o = zl(!!e);
- function c() {
- const P = as(s.keys()).filter((I) => I && I.charAt(0) === "_").map((I) => {
- const F = s.get(I), O = [];
- return F.forEach((B, z) => {
- T8(B) ? O.push({
- name: z,
- scriptKind: B.sourceFile.scriptKind,
- refCount: B.languageServiceRefCount
- }) : B.forEach((X, q) => O.push({ name: z, scriptKind: q, refCount: X.languageServiceRefCount }));
- }), O.sort((B, z) => z.refCount - B.refCount), {
- bucket: I,
- sourceFiles: O
- };
- });
- return JSON.stringify(P, void 0, 2);
- }
- function _(P) {
- return typeof P.getCompilationSettings == "function" ? P.getCompilationSettings() : P;
- }
- function u(P, I, F, O, B, z) {
- const X = uo(P, t, o), q = HV(_(I));
- return d(P, X, I, q, F, O, B, z);
- }
- function d(P, I, F, O, B, z, X, q) {
- return T(
- P,
- I,
- F,
- O,
- B,
- z,
- /*acquiring*/
- !0,
- X,
- q
- );
- }
- function g(P, I, F, O, B, z) {
- const X = uo(P, t, o), q = HV(_(I));
- return h(P, X, I, q, F, O, B, z);
- }
- function h(P, I, F, O, B, z, X, q) {
- return T(
- P,
- I,
- _(F),
- O,
- B,
- z,
- /*acquiring*/
- !1,
- X,
- q
- );
- }
- function S(P, I) {
- const F = T8(P) ? P : P.get(E.checkDefined(I, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
- return E.assert(I === void 0 || !F || F.sourceFile.scriptKind === I, `Script kind should match provided ScriptKind:${I} and sourceFile.scriptKind: ${F?.sourceFile.scriptKind}, !entry: ${!F}`), F;
- }
- function T(P, I, F, O, B, z, X, q, V) {
- var ae, ee, G, ue;
- q = v5(P, q);
- const re = _(F), ne = F === re ? void 0 : F, ie = q === 6 ? 100 : pa(re), Se = typeof V == "object" ? V : {
- languageVersion: ie,
- impliedNodeFormat: ne && zA(I, (ue = (G = (ee = (ae = ne.getCompilerHost) == null ? void 0 : ae.call(ne)) == null ? void 0 : ee.getModuleResolutionCache) == null ? void 0 : G.call(ee)) == null ? void 0 : ue.getPackageJsonInfoCache(), ne, re),
- setExternalModuleIndicator: L3(re),
- jsDocParsingMode: n
- };
- Se.languageVersion = ie, E.assertEqual(n, Se.jsDocParsingMode);
- const J = s.size, oe = Kse(O, Se.impliedNodeFormat), _e = NE(s, oe, () => /* @__PURE__ */ new Map());
- if (rn) {
- s.size > J && rn.instant(rn.Phase.Session, "createdDocumentRegistryBucket", { configFilePath: re.configFilePath, key: oe });
- const ve = !wl(I) && El(s, (tt, Te) => Te !== oe && tt.has(I) && Te);
- ve && rn.instant(rn.Phase.Session, "documentRegistryBucketOverlap", { path: I, key1: ve, key2: oe });
- }
- const he = _e.get(I);
- let le = he && S(he, q);
- if (!le && i) {
- const ve = i.getDocument(oe, I);
- ve && ve.scriptKind === q && ve.text === Yx(B) && (E.assert(X), le = {
- sourceFile: ve,
- languageServiceRefCount: 0
- }, me());
- }
- if (le)
- le.sourceFile.version !== z && (le.sourceFile = kq(le.sourceFile, B, z, B.getChangeRange(le.sourceFile.scriptSnapshot)), i && i.setDocument(oe, I, le.sourceFile)), X && le.languageServiceRefCount++;
- else {
- const ve = z9(
- P,
- B,
- Se,
- z,
- /*setNodeParents*/
- !1,
- q
- );
- i && i.setDocument(oe, I, ve), le = {
- sourceFile: ve,
- languageServiceRefCount: 1
- }, me();
- }
- return E.assert(le.languageServiceRefCount !== 0), le.sourceFile;
- function me() {
- if (!he)
- _e.set(I, le);
- else if (T8(he)) {
- const ve = /* @__PURE__ */ new Map();
- ve.set(he.sourceFile.scriptKind, he), ve.set(q, le), _e.set(I, ve);
- } else
- he.set(q, le);
- }
- }
- function C(P, I, F, O) {
- const B = uo(P, t, o), z = HV(I);
- return D(B, z, F, O);
- }
- function D(P, I, F, O) {
- const B = E.checkDefined(s.get(Kse(I, O))), z = B.get(P), X = S(z, F);
- X.languageServiceRefCount--, E.assert(X.languageServiceRefCount >= 0), X.languageServiceRefCount === 0 && (T8(z) ? B.delete(P) : (z.delete(F), z.size === 1 && B.set(P, ew(z.values(), go))));
- }
- return {
- acquireDocument: u,
- acquireDocumentWithKey: d,
- updateDocument: g,
- updateDocumentWithKey: h,
- releaseDocument: C,
- releaseDocumentWithKey: D,
- getKeyForCompilationSettings: HV,
- getDocumentRegistryBucketKeyWithMode: Kse,
- reportStats: c,
- getBuckets: () => s
- };
- }
- function HV(e) {
- return Oz(e, gz);
- }
- function Kse(e, t) {
- return t ? `${e}|${t}` : e;
- }
- function eae(e, t, n, i, s, o, c) {
- const _ = sx(i), u = zl(_), d = GV(t, n, u, c), g = GV(n, t, u, c);
- return sn.ChangeTracker.with({ host: i, formatContext: s, preferences: o }, (h) => {
- wBe(e, h, d, t, n, i.getCurrentDirectory(), _), ABe(e, h, d, g, i, u);
- });
- }
- function GV(e, t, n, i) {
- const s = n(e);
- return (c) => {
- const _ = i && i.tryGetSourcePosition({ fileName: c, pos: 0 }), u = o(_ ? _.fileName : c);
- return _ ? u === void 0 ? void 0 : PBe(_.fileName, u, c, n) : u;
- };
- function o(c) {
- if (n(c) === s) return t;
- const _ = tJ(c, s, n);
- return _ === void 0 ? void 0 : t + "/" + _;
- }
- }
- function PBe(e, t, n, i) {
- const s = qE(e, t, i);
- return tae(Xn(n), s);
- }
- function wBe(e, t, n, i, s, o, c) {
- const { configFile: _ } = e.getCompilerOptions();
- if (!_) return;
- const u = Xn(_.fileName), d = d4(_);
- if (!d) return;
- rae(d, (T, C) => {
- switch (C) {
- case "files":
- case "include":
- case "exclude": {
- if (g(T) || C !== "include" || !$l(T.initializer)) return;
- const P = Ai(T.initializer.elements, (F) => oa(F) ? F.text : void 0);
- if (P.length === 0) return;
- const I = y5(
- u,
- /*excludes*/
- [],
- P,
- c,
- o
- );
- Jy(E.checkDefined(I.includeFilePattern), c).test(i) && !Jy(E.checkDefined(I.includeFilePattern), c).test(s) && t.insertNodeAfter(_, _a(T.initializer.elements), A.createStringLiteral(S(s)));
- return;
- }
- case "compilerOptions":
- rae(T.initializer, (D, P) => {
- const I = bz(P);
- E.assert(I?.type !== "listOrElement"), I && (I.isFilePath || I.type === "list" && I.element.isFilePath) ? g(D) : P === "paths" && rae(D.initializer, (F) => {
- if ($l(F.initializer))
- for (const O of F.initializer.elements)
- h(O);
- });
- });
- return;
- }
- });
- function g(T) {
- const C = $l(T.initializer) ? T.initializer.elements : [T.initializer];
- let D = !1;
- for (const P of C)
- D = h(P) || D;
- return D;
- }
- function h(T) {
- if (!oa(T)) return !1;
- const C = tae(u, T.text), D = n(C);
- return D !== void 0 ? (t.replaceRangeWithText(_, Dbe(T, _), S(D)), !0) : !1;
- }
- function S(T) {
- return ld(
- u,
- T,
- /*ignoreCase*/
- !c
- );
- }
- }
- function ABe(e, t, n, i, s, o) {
- const c = e.getSourceFiles();
- for (const _ of c) {
- const u = n(_.fileName), d = u ?? _.fileName, g = Xn(d), h = i(_.fileName), S = h || _.fileName, T = Xn(S), C = u !== void 0 || h !== void 0;
- OBe(_, t, (D) => {
- if (!If(D)) return;
- const P = tae(T, D), I = n(P);
- return I === void 0 ? void 0 : q2(ld(g, I, o));
- }, (D) => {
- const P = e.getTypeChecker().getSymbolAtLocation(D);
- if (P?.declarations && P.declarations.some((F) => Fu(F))) return;
- const I = h !== void 0 ? Ebe(D, Vx(D.text, S, e.getCompilerOptions(), s), n, c) : IBe(P, D, _, e, s, n);
- return I !== void 0 && (I.updated || C && If(D.text)) ? N0.updateModuleSpecifier(e.getCompilerOptions(), _, d, I.newFileName, Zx(e, s), D.text) : void 0;
- });
- }
- }
- function NBe(e, t) {
- return Os(Bn(e, t));
- }
- function tae(e, t) {
- return q2(NBe(e, t));
- }
- function IBe(e, t, n, i, s, o) {
- if (e) {
- const c = On(e.declarations, Si).fileName, _ = o(c);
- return _ === void 0 ? { newFileName: c, updated: !1 } : { newFileName: _, updated: !0 };
- } else {
- const c = i.getModeForUsageLocation(n, t), _ = s.resolveModuleNameLiterals || !s.resolveModuleNames ? i.getResolvedModuleFromModuleSpecifier(t, n) : s.getResolvedModuleWithFailedLookupLocationsFromCache && s.getResolvedModuleWithFailedLookupLocationsFromCache(t.text, n.fileName, c);
- return Ebe(t, _, o, i.getSourceFiles());
- }
- }
- function Ebe(e, t, n, i) {
- if (!t) return;
- if (t.resolvedModule) {
- const u = _(t.resolvedModule.resolvedFileName);
- if (u) return u;
- }
- const s = ir(t.failedLookupLocations, o) || If(e.text) && ir(t.failedLookupLocations, c);
- if (s) return s;
- return t.resolvedModule && { newFileName: t.resolvedModule.resolvedFileName, updated: !1 };
- function o(u) {
- const d = n(u);
- return d && On(i, (g) => g.fileName === d) ? c(u) : void 0;
- }
- function c(u) {
- return Zo(u, "/package.json") ? void 0 : _(u);
- }
- function _(u) {
- const d = n(u);
- return d && { newFileName: d, updated: !0 };
- }
- }
- function OBe(e, t, n, i) {
- for (const s of e.referencedFiles || Ue) {
- const o = n(s.fileName);
- o !== void 0 && o !== e.text.slice(s.pos, s.end) && t.replaceRangeWithText(e, s, o);
- }
- for (const s of e.imports) {
- const o = i(s);
- o !== void 0 && o !== s.text && t.replaceRangeWithText(e, Dbe(s, e), o);
- }
- }
- function Dbe(e, t) {
- return op(e.getStart(t) + 1, e.end - 1);
- }
- function rae(e, t) {
- if (Ks(e))
- for (const n of e.properties)
- Qc(n) && oa(n.name) && t(n, n.name.text);
- }
- var $V = /* @__PURE__ */ ((e) => (e[e.exact = 0] = "exact", e[e.prefix = 1] = "prefix", e[e.substring = 2] = "substring", e[e.camelCase = 3] = "camelCase", e))($V || {});
- function tP(e, t) {
- return {
- kind: e,
- isCaseSensitive: t
- };
- }
- function nae(e) {
- const t = /* @__PURE__ */ new Map(), n = e.trim().split(".").map((i) => RBe(i.trim()));
- if (n.length === 1 && n[0].totalTextChunk.text === "")
- return {
- getMatchForLastSegmentOfPattern: () => tP(
- 2,
- /*isCaseSensitive*/
- !0
- ),
- getFullMatch: () => tP(
- 2,
- /*isCaseSensitive*/
- !0
- ),
- patternContainsDots: !1
- };
- if (!n.some((i) => !i.subWordTextChunks.length))
- return {
- getFullMatch: (i, s) => FBe(i, s, n, t),
- getMatchForLastSegmentOfPattern: (i) => iae(i, _a(n), t),
- patternContainsDots: n.length > 1
- };
- }
- function FBe(e, t, n, i) {
- if (!iae(t, _a(n), i) || n.length - 1 > e.length)
- return;
- let o;
- for (let c = n.length - 2, _ = e.length - 1; c >= 0; c -= 1, _ -= 1)
- o = Abe(o, iae(e[_], n[c], i));
- return o;
- }
- function Pbe(e, t) {
- let n = t.get(e);
- return n || t.set(e, n = uae(e)), n;
- }
- function wbe(e, t, n) {
- const i = jBe(e, t.textLowerCase);
- if (i === 0)
- return tP(
- t.text.length === e.length ? 0 : 1,
- /*isCaseSensitive:*/
- Ui(e, t.text)
- );
- if (t.isLowerCase) {
- if (i === -1) return;
- const s = Pbe(e, n);
- for (const o of s)
- if (sae(
- e,
- o,
- t.text,
- /*ignoreCase*/
- !0
- ))
- return tP(
- 2,
- /*isCaseSensitive:*/
- sae(
- e,
- o,
- t.text,
- /*ignoreCase*/
- !1
- )
- );
- if (t.text.length < e.length && A6(e.charCodeAt(i)))
- return tP(
- 2,
- /*isCaseSensitive*/
- !1
- );
- } else {
- if (e.indexOf(t.text) > 0)
- return tP(
- 2,
- /*isCaseSensitive*/
- !0
- );
- if (t.characterSpans.length > 0) {
- const s = Pbe(e, n), o = Nbe(
- e,
- s,
- t,
- /*ignoreCase*/
- !1
- ) ? !0 : Nbe(
- e,
- s,
- t,
- /*ignoreCase*/
- !0
- ) ? !1 : void 0;
- if (o !== void 0)
- return tP(3, o);
- }
- }
- }
- function iae(e, t, n) {
- if (XV(
- t.totalTextChunk.text,
- (o) => o !== 32 && o !== 42
- /* asterisk */
- )) {
- const o = wbe(e, t.totalTextChunk, n);
- if (o) return o;
- }
- const i = t.subWordTextChunks;
- let s;
- for (const o of i)
- s = Abe(s, wbe(e, o, n));
- return s;
- }
- function Abe(e, t) {
- return yR([e, t], LBe);
- }
- function LBe(e, t) {
- return e === void 0 ? 1 : t === void 0 ? -1 : ho(e.kind, t.kind) || J1(!e.isCaseSensitive, !t.isCaseSensitive);
- }
- function sae(e, t, n, i, s = { start: 0, length: n.length }) {
- return s.length <= t.length && Lbe(0, s.length, (o) => MBe(n.charCodeAt(s.start + o), e.charCodeAt(t.start + o), i));
- }
- function MBe(e, t, n) {
- return n ? aae(e) === aae(t) : e === t;
- }
- function Nbe(e, t, n, i) {
- const s = n.characterSpans;
- let o = 0, c = 0;
- for (; ; ) {
- if (c === s.length)
- return !0;
- if (o === t.length)
- return !1;
- let _ = t[o], u = !1;
- for (; c < s.length; c++) {
- const d = s[c];
- if (u && (!A6(n.text.charCodeAt(s[c - 1].start)) || !A6(n.text.charCodeAt(s[c].start))) || !sae(e, _, n.text, i, d))
- break;
- u = !0, _ = Ul(_.start + d.length, _.length - d.length);
- }
- o++;
- }
- }
- function RBe(e) {
- return {
- totalTextChunk: cae(e),
- subWordTextChunks: JBe(e)
- };
- }
- function A6(e) {
- if (e >= 65 && e <= 90)
- return !0;
- if (e < 127 || !AI(
- e,
- 99
- /* Latest */
- ))
- return !1;
- const t = String.fromCharCode(e);
- return t === t.toUpperCase();
- }
- function Ibe(e) {
- if (e >= 97 && e <= 122)
- return !0;
- if (e < 127 || !AI(
- e,
- 99
- /* Latest */
- ))
- return !1;
- const t = String.fromCharCode(e);
- return t === t.toLowerCase();
- }
- function jBe(e, t) {
- const n = e.length - t.length;
- for (let i = 0; i <= n; i++)
- if (XV(t, (s, o) => aae(e.charCodeAt(o + i)) === s))
- return i;
- return -1;
- }
- function aae(e) {
- return e >= 65 && e <= 90 ? 97 + (e - 65) : e < 127 ? e : String.fromCharCode(e).toLowerCase().charCodeAt(0);
- }
- function oae(e) {
- return e >= 48 && e <= 57;
- }
- function BBe(e) {
- return A6(e) || Ibe(e) || oae(e) || e === 95 || e === 36;
- }
- function JBe(e) {
- const t = [];
- let n = 0, i = 0;
- for (let s = 0; s < e.length; s++) {
- const o = e.charCodeAt(s);
- BBe(o) ? (i === 0 && (n = s), i++) : i > 0 && (t.push(cae(e.substr(n, i))), i = 0);
- }
- return i > 0 && t.push(cae(e.substr(n, i))), t;
- }
- function cae(e) {
- const t = e.toLowerCase();
- return {
- text: e,
- textLowerCase: t,
- isLowerCase: e === t,
- characterSpans: lae(e)
- };
- }
- function lae(e) {
- return Obe(
- e,
- /*word*/
- !1
- );
- }
- function uae(e) {
- return Obe(
- e,
- /*word*/
- !0
- );
- }
- function Obe(e, t) {
- const n = [];
- let i = 0;
- for (let s = 1; s < e.length; s++) {
- const o = oae(e.charCodeAt(s - 1)), c = oae(e.charCodeAt(s)), _ = WBe(e, t, s), u = t && zBe(e, s, i);
- (_ae(e.charCodeAt(s - 1)) || _ae(e.charCodeAt(s)) || o !== c || _ || u) && (Fbe(e, i, s) || n.push(Ul(i, s - i)), i = s);
- }
- return Fbe(e, i, e.length) || n.push(Ul(i, e.length - i)), n;
- }
- function _ae(e) {
- switch (e) {
- case 33:
- case 34:
- case 35:
- case 37:
- case 38:
- case 39:
- case 40:
- case 41:
- case 42:
- case 44:
- case 45:
- case 46:
- case 47:
- case 58:
- case 59:
- case 63:
- case 64:
- case 91:
- case 92:
- case 93:
- case 95:
- case 123:
- case 125:
- return !0;
- }
- return !1;
- }
- function Fbe(e, t, n) {
- return XV(e, (i) => _ae(i) && i !== 95, t, n);
- }
- function zBe(e, t, n) {
- return t !== n && t + 1 < e.length && A6(e.charCodeAt(t)) && Ibe(e.charCodeAt(t + 1)) && XV(e, A6, n, t);
- }
- function WBe(e, t, n) {
- const i = A6(e.charCodeAt(n - 1));
- return A6(e.charCodeAt(n)) && (!t || !i);
- }
- function Lbe(e, t, n) {
- for (let i = e; i < t; i++)
- if (!n(i))
- return !1;
- return !0;
- }
- function XV(e, t, n = 0, i = e.length) {
- return Lbe(n, i, (s) => t(e.charCodeAt(s), s));
- }
- function Mbe(e, t = !0, n = !1) {
- const i = {
- languageVersion: 1,
- // controls whether the token scanner considers unicode identifiers or not - shouldn't matter, since we're only using it for trivia
- pragmas: void 0,
- checkJsDirective: void 0,
- referencedFiles: [],
- typeReferenceDirectives: [],
- libReferenceDirectives: [],
- amdDependencies: [],
- hasNoDefaultLib: void 0,
- moduleName: void 0
- }, s = [];
- let o, c, _, u = 0, d = !1;
- function g() {
- return c = _, _ = ju.scan(), _ === 19 ? u++ : _ === 20 && u--, _;
- }
- function h() {
- const z = ju.getTokenValue(), X = ju.getTokenStart();
- return { fileName: z, pos: X, end: X + z.length };
- }
- function S() {
- o || (o = []), o.push({ ref: h(), depth: u });
- }
- function T() {
- s.push(h()), C();
- }
- function C() {
- u === 0 && (d = !0);
- }
- function D() {
- let z = ju.getToken();
- return z === 138 ? (z = g(), z === 144 && (z = g(), z === 11 && S()), !0) : !1;
- }
- function P() {
- if (c === 25)
- return !1;
- let z = ju.getToken();
- if (z === 102) {
- if (z = g(), z === 21) {
- if (z = g(), z === 11 || z === 15)
- return T(), !0;
- } else {
- if (z === 11)
- return T(), !0;
- if (z === 156 && ju.lookAhead(() => {
- const q = ju.scan();
- return q !== 161 && (q === 42 || q === 19 || q === 80 || p_(q));
- }) && (z = g()), z === 80 || p_(z))
- if (z = g(), z === 161) {
- if (z = g(), z === 11)
- return T(), !0;
- } else if (z === 64) {
- if (F(
- /*skipCurrentToken*/
- !0
- ))
- return !0;
- } else if (z === 28)
- z = g();
- else
- return !0;
- if (z === 19) {
- for (z = g(); z !== 20 && z !== 1; )
- z = g();
- z === 20 && (z = g(), z === 161 && (z = g(), z === 11 && T()));
- } else z === 42 && (z = g(), z === 130 && (z = g(), (z === 80 || p_(z)) && (z = g(), z === 161 && (z = g(), z === 11 && T()))));
- }
- return !0;
- }
- return !1;
- }
- function I() {
- let z = ju.getToken();
- if (z === 95) {
- if (C(), z = g(), z === 156 && ju.lookAhead(() => {
- const q = ju.scan();
- return q === 42 || q === 19;
- }) && (z = g()), z === 19) {
- for (z = g(); z !== 20 && z !== 1; )
- z = g();
- z === 20 && (z = g(), z === 161 && (z = g(), z === 11 && T()));
- } else if (z === 42)
- z = g(), z === 161 && (z = g(), z === 11 && T());
- else if (z === 102 && (z = g(), z === 156 && ju.lookAhead(() => {
- const q = ju.scan();
- return q === 80 || p_(q);
- }) && (z = g()), (z === 80 || p_(z)) && (z = g(), z === 64 && F(
- /*skipCurrentToken*/
- !0
- ))))
- return !0;
- return !0;
- }
- return !1;
- }
- function F(z, X = !1) {
- let q = z ? g() : ju.getToken();
- return q === 149 ? (q = g(), q === 21 && (q = g(), (q === 11 || X && q === 15) && T()), !0) : !1;
- }
- function O() {
- let z = ju.getToken();
- if (z === 80 && ju.getTokenValue() === "define") {
- if (z = g(), z !== 21)
- return !0;
- if (z = g(), z === 11 || z === 15)
- if (z = g(), z === 28)
- z = g();
- else
- return !0;
- if (z !== 23)
- return !0;
- for (z = g(); z !== 24 && z !== 1; )
- (z === 11 || z === 15) && T(), z = g();
- return !0;
- }
- return !1;
- }
- function B() {
- for (ju.setText(e), g(); ju.getToken() !== 1; ) {
- if (ju.getToken() === 16) {
- const z = [ju.getToken()];
- e:
- for (; Nr(z); ) {
- const X = ju.scan();
- switch (X) {
- case 1:
- break e;
- case 102:
- P();
- break;
- case 16:
- z.push(X);
- break;
- case 19:
- Nr(z) && z.push(X);
- break;
- case 20:
- Nr(z) && (Ro(z) === 16 ? ju.reScanTemplateToken(
- /*isTaggedTemplate*/
- !1
- ) === 18 && z.pop() : z.pop());
- break;
- }
- }
- g();
- }
- D() || P() || I() || n && (F(
- /*skipCurrentToken*/
- !1,
- /*allowTemplateLiterals*/
- !0
- ) || O()) || g();
- }
- ju.setText(void 0);
- }
- if (t && B(), _z(i, e), fz(i, ja), d) {
- if (o)
- for (const z of o)
- s.push(z.ref);
- return { referencedFiles: i.referencedFiles, typeReferenceDirectives: i.typeReferenceDirectives, libReferenceDirectives: i.libReferenceDirectives, importedFiles: s, isLibFile: !!i.hasNoDefaultLib, ambientExternalModules: void 0 };
- } else {
- let z;
- if (o)
- for (const X of o)
- X.depth === 0 ? (z || (z = []), z.push(X.ref.fileName)) : s.push(X.ref);
- return { referencedFiles: i.referencedFiles, typeReferenceDirectives: i.typeReferenceDirectives, libReferenceDirectives: i.libReferenceDirectives, importedFiles: s, isLibFile: !!i.hasNoDefaultLib, ambientExternalModules: z };
- }
- }
- var UBe = /^data:(?:application\/json;charset=[uU][tT][fF]-8;base64,([A-Za-z0-9+/=]+)$)?/;
- function fae(e) {
- const t = zl(e.useCaseSensitiveFileNames()), n = e.getCurrentDirectory(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
- return {
- tryGetSourcePosition: _,
- tryGetGeneratedPosition: u,
- toLineColumnOffset: S,
- clearCache: T,
- documentPositionMappers: s
- };
- function o(C) {
- return uo(C, n, t);
- }
- function c(C, D) {
- const P = o(C), I = s.get(P);
- if (I) return I;
- let F;
- if (e.getDocumentPositionMapper)
- F = e.getDocumentPositionMapper(C, D);
- else if (e.readFile) {
- const O = h(C);
- F = O && QV(
- { getSourceFileLike: h, getCanonicalFileName: t, log: (B) => e.log(B) },
- C,
- rW(O.text, Ag(O)),
- (B) => !e.fileExists || e.fileExists(B) ? e.readFile(B) : void 0
- );
- }
- return s.set(P, F || iW), F || iW;
- }
- function _(C) {
- if (!wl(C.fileName) || !d(C.fileName)) return;
- const P = c(C.fileName).getSourcePosition(C);
- return !P || P === C ? void 0 : _(P) || P;
- }
- function u(C) {
- if (wl(C.fileName)) return;
- const D = d(C.fileName);
- if (!D) return;
- const P = e.getProgram();
- if (P.isSourceOfProjectReferenceRedirect(D.fileName))
- return;
- const F = P.getCompilerOptions().outFile, O = F ? $u(F) + ".d.ts" : z7(C.fileName, P.getCompilerOptions(), P);
- if (O === void 0) return;
- const B = c(O, C.fileName).getGeneratedPosition(C);
- return B === C ? void 0 : B;
- }
- function d(C) {
- const D = e.getProgram();
- if (!D) return;
- const P = o(C), I = D.getSourceFileByPath(P);
- return I && I.resolvedPath === P ? I : void 0;
- }
- function g(C) {
- const D = o(C), P = i.get(D);
- if (P !== void 0) return P || void 0;
- if (!e.readFile || e.fileExists && !e.fileExists(C)) {
- i.set(D, !1);
- return;
- }
- const I = e.readFile(C), F = I ? VBe(I) : !1;
- return i.set(D, F), F || void 0;
- }
- function h(C) {
- return e.getSourceFileLike ? e.getSourceFileLike(C) : d(C) || g(C);
- }
- function S(C, D) {
- return h(C).getLineAndCharacterOfPosition(D);
- }
- function T() {
- i.clear(), s.clear();
- }
- }
- function QV(e, t, n, i) {
- let s = Jre(n);
- if (s) {
- const _ = UBe.exec(s);
- if (_) {
- if (_[1]) {
- const u = _[1];
- return Rbe(e, xK(ll, u), t);
- }
- s = void 0;
- }
- }
- const o = [];
- s && o.push(s), o.push(t + ".map");
- const c = s && es(s, Xn(t));
- for (const _ of o) {
- const u = es(_, Xn(t)), d = i(u, c);
- if (_s(d))
- return Rbe(e, d, u);
- if (d !== void 0)
- return d || void 0;
- }
- }
- function Rbe(e, t, n) {
- const i = zre(t);
- if (!(!i || !i.sources || !i.file || !i.mappings) && !(i.sourcesContent && i.sourcesContent.some(_s)))
- return Ure(e, i, n);
- }
- function VBe(e, t) {
- return {
- text: e,
- lineMap: t,
- getLineAndCharacterOfPosition(n) {
- return nC(Ag(this), n);
- }
- };
- }
- var pae = /* @__PURE__ */ new Map();
- function YV(e, t, n) {
- var i;
- t.getSemanticDiagnostics(e, n);
- const s = [], o = t.getTypeChecker();
- !(t.getImpliedNodeFormatForEmit(e) === 1 || xc(e.fileName, [
- ".cts",
- ".cjs"
- /* Cjs */
- ])) && e.commonJsModuleIndicator && (xse(t) || lV(t.getCompilerOptions())) && qBe(e) && s.push(Kr(XBe(e.commonJsModuleIndicator), p.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));
- const _ = Gu(e);
- if (pae.clear(), u(e), mx(t.getCompilerOptions()))
- for (const d of e.imports) {
- const g = v4(d), h = HBe(g);
- if (!h) continue;
- const S = (i = t.getResolvedModuleFromModuleSpecifier(d, e)) == null ? void 0 : i.resolvedModule, T = S && t.getSourceFile(S.resolvedFileName);
- T && T.externalModuleIndicator && T.externalModuleIndicator !== !0 && wo(T.externalModuleIndicator) && T.externalModuleIndicator.isExportEquals && s.push(Kr(h, p.Import_may_be_converted_to_a_default_import));
- }
- return Fn(s, e.bindSuggestionDiagnostics), Fn(s, t.getSuggestionDiagnostics(e, n)), s.sort((d, g) => d.start - g.start), s;
- function u(d) {
- if (_)
- YBe(d, o) && s.push(Kr(ii(d.parent) ? d.parent.name : d, p.This_constructor_function_may_be_converted_to_a_class_declaration));
- else {
- if (yc(d) && d.parent === e && d.declarationList.flags & 2 && d.declarationList.declarations.length === 1) {
- const h = d.declarationList.declarations[0].initializer;
- h && f_(
- h,
- /*requireStringLiteralLikeArgument*/
- !0
- ) && s.push(Kr(h, p.require_call_may_be_converted_to_an_import));
- }
- const g = xu.getJSDocTypedefNodes(d);
- for (const h of g)
- s.push(Kr(h, p.JSDoc_typedef_may_be_converted_to_TypeScript_type));
- xu.parameterShouldGetTypeFromJSDoc(d) && s.push(Kr(d.name || d, p.JSDoc_types_may_be_moved_to_TypeScript_types));
- }
- eq(d) && GBe(d, o, s), d.forEachChild(u);
- }
- }
- function qBe(e) {
- return e.statements.some((t) => {
- switch (t.kind) {
- case 243:
- return t.declarationList.declarations.some((n) => !!n.initializer && f_(
- jbe(n.initializer),
- /*requireStringLiteralLikeArgument*/
- !0
- ));
- case 244: {
- const { expression: n } = t;
- if (!dn(n)) return f_(
- n,
- /*requireStringLiteralLikeArgument*/
- !0
- );
- const i = Cc(n);
- return i === 1 || i === 2;
- }
- default:
- return !1;
- }
- });
- }
- function jbe(e) {
- return Cn(e) ? jbe(e.expression) : e;
- }
- function HBe(e) {
- switch (e.kind) {
- case 272:
- const { importClause: t, moduleSpecifier: n } = e;
- return t && !t.name && t.namedBindings && t.namedBindings.kind === 274 && oa(n) ? t.namedBindings.name : void 0;
- case 271:
- return e.name;
- default:
- return;
- }
- }
- function GBe(e, t, n) {
- $Be(e, t) && !pae.has(Wbe(e)) && n.push(Kr(
- !e.name && ii(e.parent) && Oe(e.parent.name) ? e.parent.name : e,
- p.This_may_be_converted_to_an_async_function
- ));
- }
- function $Be(e, t) {
- return !k4(e) && e.body && Cs(e.body) && QBe(e.body, t) && ZV(e, t);
- }
- function ZV(e, t) {
- const n = t.getSignatureFromDeclaration(e), i = n ? t.getReturnTypeOfSignature(n) : void 0;
- return !!i && !!t.getPromisedTypeOfPromise(i);
- }
- function XBe(e) {
- return dn(e) ? e.left : e;
- }
- function QBe(e, t) {
- return !!y0(e, (n) => E9(n, t));
- }
- function E9(e, t) {
- return Up(e) && !!e.expression && KV(e.expression, t);
- }
- function KV(e, t) {
- if (!Bbe(e) || !Jbe(e) || !e.arguments.every((i) => zbe(i, t)))
- return !1;
- let n = e.expression.expression;
- for (; Bbe(n) || Cn(n); )
- if (Fs(n)) {
- if (!Jbe(n) || !n.arguments.every((i) => zbe(i, t)))
- return !1;
- n = n.expression.expression;
- } else
- n = n.expression;
- return !0;
- }
- function Bbe(e) {
- return Fs(e) && (ZA(e, "then") || ZA(e, "catch") || ZA(e, "finally"));
- }
- function Jbe(e) {
- const t = e.expression.name.text, n = t === "then" ? 2 : t === "catch" || t === "finally" ? 1 : 0;
- return e.arguments.length > n ? !1 : e.arguments.length < n ? !0 : n === 1 || ut(e.arguments, (i) => i.kind === 106 || Oe(i) && i.text === "undefined");
- }
- function zbe(e, t) {
- switch (e.kind) {
- case 262:
- case 218:
- if (Jc(e) & 1)
- return !1;
- case 219:
- pae.set(Wbe(e), !0);
- case 106:
- return !0;
- case 80:
- case 211: {
- const i = t.getSymbolAtLocation(e);
- return i ? t.isUndefinedSymbol(i) || ut(Hl(i, t).declarations, (s) => ys(s) || m0(s) && !!s.initializer && ys(s.initializer)) : !1;
- }
- default:
- return !1;
- }
- }
- function Wbe(e) {
- return `${e.pos.toString()}:${e.end.toString()}`;
- }
- function YBe(e, t) {
- var n, i, s, o;
- if (vo(e)) {
- if (ii(e.parent) && ((n = e.symbol.members) != null && n.size))
- return !0;
- const c = t.getSymbolOfExpando(
- e,
- /*allowDeclaration*/
- !1
- );
- return !!(c && ((i = c.exports) != null && i.size || (s = c.members) != null && s.size));
- }
- return Ec(e) ? !!((o = e.symbol.members) != null && o.size) : !1;
- }
- function eq(e) {
- switch (e.kind) {
- case 262:
- case 174:
- case 218:
- case 219:
- return !0;
- default:
- return !1;
- }
- }
- var ZBe = /* @__PURE__ */ new Set([
- "isolatedModules"
- ]);
- function dae(e, t) {
- return Vbe(
- e,
- t,
- /*declaration*/
- !1
- );
- }
- function Ube(e, t) {
- return Vbe(
- e,
- t,
- /*declaration*/
- !0
- );
- }
- var KBe = `///
-interface Boolean {}
-interface Function {}
-interface CallableFunction {}
-interface NewableFunction {}
-interface IArguments {}
-interface Number {}
-interface Object {}
-interface RegExp {}
-interface String {}
-interface Array { length: number; [n: number]: T; }
-interface SymbolConstructor {
- (desc?: string | number): symbol;
- for(name: string): symbol;
- readonly toStringTag: symbol;
-}
-declare var Symbol: SymbolConstructor;
-interface Symbol {
- readonly [Symbol.toStringTag]: string;
-}`, D9 = "lib.d.ts", mae;
- function Vbe(e, t, n) {
- mae ?? (mae = Bx(D9, KBe, {
- languageVersion: 99
- /* Latest */
- }));
- const i = [], s = t.compilerOptions ? tq(t.compilerOptions, i) : {}, o = J9();
- for (const D in o)
- co(o, D) && s[D] === void 0 && (s[D] = o[D]);
- for (const D of zte)
- s.verbatimModuleSyntax && ZBe.has(D.name) || (s[D.name] = D.transpileOptionValue);
- s.suppressOutputPathCheck = !0, s.allowNonTsExtensions = !0, n ? (s.declaration = !0, s.emitDeclarationOnly = !0, s.isolatedDeclarations = !0) : (s.declaration = !1, s.declarationMap = !1);
- const c = k0(s), _ = {
- getSourceFile: (D) => D === Os(u) ? d : D === Os(D9) ? mae : void 0,
- writeFile: (D, P) => {
- qo(D, ".map") ? (E.assertEqual(h, void 0, "Unexpected multiple source map outputs, file:", D), h = P) : (E.assertEqual(g, void 0, "Unexpected multiple outputs, file:", D), g = P);
- },
- getDefaultLibFileName: () => D9,
- useCaseSensitiveFileNames: () => !1,
- getCanonicalFileName: (D) => D,
- getCurrentDirectory: () => "",
- getNewLine: () => c,
- fileExists: (D) => D === u || !!n && D === D9,
- readFile: () => "",
- directoryExists: () => !0,
- getDirectories: () => []
- }, u = t.fileName || (t.compilerOptions && t.compilerOptions.jsx ? "module.tsx" : "module.ts"), d = Bx(
- u,
- e,
- {
- languageVersion: pa(s),
- impliedNodeFormat: zA(
- uo(u, "", _.getCanonicalFileName),
- /*packageJsonInfoCache*/
- void 0,
- _,
- s
- ),
- setExternalModuleIndicator: L3(s),
- jsDocParsingMode: t.jsDocParsingMode ?? 0
- /* ParseAll */
- }
- );
- t.moduleName && (d.moduleName = t.moduleName), t.renamedDependencies && (d.renamedDependencies = new Map(Object.entries(t.renamedDependencies)));
- let g, h;
- const T = WA(n ? [u, D9] : [u], s, _);
- t.reportDiagnostics && (Fn(
- /*to*/
- i,
- /*from*/
- T.getSyntacticDiagnostics(d)
- ), Fn(
- /*to*/
- i,
- /*from*/
- T.getOptionsDiagnostics()
- ));
- const C = T.emit(
- /*targetSourceFile*/
- void 0,
- /*writeFile*/
- void 0,
- /*cancellationToken*/
- void 0,
- /*emitOnlyDtsFiles*/
- n,
- t.transformers,
- /*forceDtsEmit*/
- n
- );
- return Fn(
- /*to*/
- i,
- /*from*/
- C.diagnostics
- ), g === void 0 ? E.fail("Output generation failed") : { outputText: g, diagnostics: i, sourceMapText: h };
- }
- function qbe(e, t, n, i, s) {
- const o = dae(e, { compilerOptions: t, fileName: n, reportDiagnostics: !!i, moduleName: s });
- return Fn(i, o.diagnostics), o.outputText;
- }
- var gae;
- function tq(e, t) {
- gae = gae || Ln(Od, (n) => typeof n.type == "object" && !El(n.type, (i) => typeof i != "number")), e = nV(e);
- for (const n of gae) {
- if (!co(e, n.name))
- continue;
- const i = e[n.name];
- _s(i) ? e[n.name] = vO(n, i, t) : El(n.type, (s) => s === i) || t.push(Ute(n));
- }
- return e;
- }
- var hae = {};
- La(hae, {
- getNavigateToItems: () => Hbe
- });
- function Hbe(e, t, n, i, s, o, c) {
- const _ = nae(i);
- if (!_) return Ue;
- const u = [], d = e.length === 1 ? e[0] : void 0;
- for (const g of e)
- n.throwIfCancellationRequested(), !(o && g.isDeclarationFile) && (Gbe(g, !!c, d) || g.getNamedDeclarations().forEach((h, S) => {
- eJe(_, S, h, t, g.fileName, !!c, d, u);
- }));
- return u.sort(iJe), (s === void 0 ? u : u.slice(0, s)).map(sJe);
- }
- function Gbe(e, t, n) {
- return e !== n && t && (g8(e.path) || e.hasNoDefaultLib);
- }
- function eJe(e, t, n, i, s, o, c, _) {
- const u = e.getMatchForLastSegmentOfPattern(t);
- if (u) {
- for (const d of n)
- if (tJe(d, i, o, c))
- if (e.patternContainsDots) {
- const g = e.getFullMatch(nJe(d), t);
- g && _.push({ name: t, fileName: s, matchKind: g.kind, isCaseSensitive: g.isCaseSensitive, declaration: d });
- } else
- _.push({ name: t, fileName: s, matchKind: u.kind, isCaseSensitive: u.isCaseSensitive, declaration: d });
- }
- }
- function tJe(e, t, n, i) {
- var s;
- switch (e.kind) {
- case 273:
- case 276:
- case 271:
- const o = t.getSymbolAtLocation(e.name), c = t.getAliasedSymbol(o);
- return o.escapedName !== c.escapedName && !((s = c.declarations) != null && s.every((_) => Gbe(_.getSourceFile(), n, i)));
- default:
- return !0;
- }
- }
- function rJe(e, t) {
- const n = os(e);
- return !!n && ($be(n, t) || n.kind === 167 && yae(n.expression, t));
- }
- function yae(e, t) {
- return $be(e, t) || Cn(e) && (t.push(e.name.text), !0) && yae(e.expression, t);
- }
- function $be(e, t) {
- return fm(e) && (t.push(Jp(e)), !0);
- }
- function nJe(e) {
- const t = [], n = os(e);
- if (n && n.kind === 167 && !yae(n.expression, t))
- return Ue;
- t.shift();
- let i = AS(e);
- for (; i; ) {
- if (!rJe(i, t))
- return Ue;
- i = AS(i);
- }
- return t.reverse(), t;
- }
- function iJe(e, t) {
- return ho(e.matchKind, t.matchKind) || aw(e.name, t.name);
- }
- function sJe(e) {
- const t = e.declaration, n = AS(t), i = n && os(n);
- return {
- name: e.name,
- kind: Yb(t),
- kindModifiers: HD(t),
- matchKind: $V[e.matchKind],
- isCaseSensitive: e.isCaseSensitive,
- fileName: e.fileName,
- textSpan: t_(t),
- // TODO(jfreeman): What should be the containerName when the container has a computed name?
- containerName: i ? i.text : "",
- containerKind: i ? Yb(n) : ""
- /* unknown */
- };
- }
- var vae = {};
- La(vae, {
- getNavigationBarItems: () => Qbe,
- getNavigationTree: () => Ybe
- });
- var aJe = /\s+/g, bae = 150, rq, x8, P9 = [], M0, Xbe = [], N6, Sae = [];
- function Qbe(e, t) {
- rq = t, x8 = e;
- try {
- return lr(_Je(e2e(e)), fJe);
- } finally {
- Zbe();
- }
- }
- function Ybe(e, t) {
- rq = t, x8 = e;
- try {
- return l2e(e2e(e));
- } finally {
- Zbe();
- }
- }
- function Zbe() {
- x8 = void 0, rq = void 0, P9 = [], M0 = void 0, Sae = [];
- }
- function w9(e) {
- return rP(e.getText(x8));
- }
- function nq(e) {
- return e.node.kind;
- }
- function Kbe(e, t) {
- e.children ? e.children.push(t) : e.children = [t];
- }
- function e2e(e) {
- E.assert(!P9.length);
- const t = { node: e, name: void 0, additionalNodes: void 0, parent: void 0, children: void 0, indent: 0 };
- M0 = t;
- for (const n of e.statements)
- tk(n);
- return kv(), E.assert(!M0 && !P9.length), t;
- }
- function t2(e, t) {
- Kbe(M0, Tae(e, t));
- }
- function Tae(e, t) {
- return {
- node: e,
- name: t || (ql(e) || _t(e) ? os(e) : void 0),
- additionalNodes: void 0,
- parent: M0,
- children: void 0,
- indent: M0.indent + 1
- };
- }
- function t2e(e) {
- N6 || (N6 = /* @__PURE__ */ new Map()), N6.set(e, !0);
- }
- function r2e(e) {
- for (let t = 0; t < e; t++) kv();
- }
- function n2e(e, t) {
- const n = [];
- for (; !fm(t); ) {
- const i = a3(t), s = Eh(t);
- t = t.expression, !(s === "prototype" || Di(i)) && n.push(i);
- }
- n.push(t);
- for (let i = n.length - 1; i > 0; i--) {
- const s = n[i];
- r2(e, s);
- }
- return [n.length - 1, n[0]];
- }
- function r2(e, t) {
- const n = Tae(e, t);
- Kbe(M0, n), P9.push(M0), Xbe.push(N6), N6 = void 0, M0 = n;
- }
- function kv() {
- M0.children && (iq(M0.children, M0), Cae(M0.children)), M0 = P9.pop(), N6 = Xbe.pop();
- }
- function Cv(e, t, n) {
- r2(e, n), tk(t), kv();
- }
- function i2e(e) {
- e.initializer && dJe(e.initializer) ? (r2(e), bs(e.initializer, tk), kv()) : Cv(e, e.initializer);
- }
- function xae(e) {
- const t = os(e);
- if (t === void 0) return !1;
- if (ma(t)) {
- const n = t.expression;
- return yo(n) || d_(n) || Of(n);
- }
- return !!t;
- }
- function tk(e) {
- if (rq.throwIfCancellationRequested(), !(!e || zT(e)))
- switch (e.kind) {
- case 176:
- const t = e;
- Cv(t, t.body);
- for (const c of t.parameters)
- G_(c, t) && t2(c);
- break;
- case 174:
- case 177:
- case 178:
- case 173:
- xae(e) && Cv(e, e.body);
- break;
- case 172:
- xae(e) && i2e(e);
- break;
- case 171:
- xae(e) && t2(e);
- break;
- case 273:
- const n = e;
- n.name && t2(n.name);
- const { namedBindings: i } = n;
- if (i)
- if (i.kind === 274)
- t2(i);
- else
- for (const c of i.elements)
- t2(c);
- break;
- case 304:
- Cv(e, e.name);
- break;
- case 305:
- const { expression: s } = e;
- Oe(s) ? t2(e, s) : t2(e);
- break;
- case 208:
- case 303:
- case 260: {
- const c = e;
- As(c.name) ? tk(c.name) : i2e(c);
- break;
- }
- case 262:
- const o = e.name;
- o && Oe(o) && t2e(o.text), Cv(e, e.body);
- break;
- case 219:
- case 218:
- Cv(e, e.body);
- break;
- case 266:
- r2(e);
- for (const c of e.members)
- pJe(c) || t2(c);
- kv();
- break;
- case 263:
- case 231:
- case 264:
- r2(e);
- for (const c of e.members)
- tk(c);
- kv();
- break;
- case 267:
- Cv(e, _2e(e).body);
- break;
- case 277: {
- const c = e.expression, _ = Ks(c) || Fs(c) ? c : Co(c) || vo(c) ? c.body : void 0;
- _ ? (r2(e), tk(_), kv()) : t2(e);
- break;
- }
- case 281:
- case 271:
- case 181:
- case 179:
- case 180:
- case 265:
- t2(e);
- break;
- case 213:
- case 226: {
- const c = Cc(e);
- switch (c) {
- case 1:
- case 2:
- Cv(e, e.right);
- return;
- case 6:
- case 3: {
- const _ = e, u = _.left, d = c === 3 ? u.expression : u;
- let g = 0, h;
- Oe(d.expression) ? (t2e(d.expression.text), h = d.expression) : [g, h] = n2e(_, d.expression), c === 6 ? Ks(_.right) && _.right.properties.length > 0 && (r2(_, h), bs(_.right, tk), kv()) : vo(_.right) || Co(_.right) ? Cv(e, _.right, h) : (r2(_, h), Cv(e, _.right, u.name), kv()), r2e(g);
- return;
- }
- case 7:
- case 9: {
- const _ = e, u = c === 7 ? _.arguments[0] : _.arguments[0].expression, d = _.arguments[1], [g, h] = n2e(e, u);
- r2(e, h), r2(e, lt(A.createIdentifier(d.text), d)), tk(e.arguments[2]), kv(), kv(), r2e(g);
- return;
- }
- case 5: {
- const _ = e, u = _.left, d = u.expression;
- if (Oe(d) && Eh(u) !== "prototype" && N6 && N6.has(d.text)) {
- vo(_.right) || Co(_.right) ? Cv(e, _.right, d) : Tb(u) && (r2(_, d), Cv(_.left, _.right, a3(u)), kv());
- return;
- }
- break;
- }
- case 4:
- case 0:
- case 8:
- break;
- default:
- E.assertNever(c);
- }
- }
- default:
- gf(e) && ir(e.jsDoc, (c) => {
- ir(c.tags, (_) => {
- Bp(_) && t2(_);
- });
- }), bs(e, tk);
- }
- }
- function iq(e, t) {
- const n = /* @__PURE__ */ new Map();
- nR(e, (i, s) => {
- const o = i.name || os(i.node), c = o && w9(o);
- if (!c)
- return !0;
- const _ = n.get(c);
- if (!_)
- return n.set(c, i), !0;
- if (_ instanceof Array) {
- for (const u of _)
- if (s2e(u, i, s, t))
- return !1;
- return _.push(i), !0;
- } else {
- const u = _;
- return s2e(u, i, s, t) ? !1 : (n.set(c, [u, i]), !0);
- }
- });
- }
- var k8 = {
- 5: !0,
- 3: !0,
- 7: !0,
- 9: !0,
- 0: !1,
- 1: !1,
- 2: !1,
- 8: !1,
- 6: !0,
- 4: !1
- };
- function oJe(e, t, n, i) {
- function s(_) {
- return vo(_) || Ec(_) || ii(_);
- }
- const o = dn(t.node) || Fs(t.node) ? Cc(t.node) : 0, c = dn(e.node) || Fs(e.node) ? Cc(e.node) : 0;
- if (k8[o] && k8[c] || s(e.node) && k8[o] || s(t.node) && k8[c] || Xc(e.node) && kae(e.node) && k8[o] || Xc(t.node) && k8[c] || Xc(e.node) && kae(e.node) && s(t.node) || Xc(t.node) && s(e.node) && kae(e.node)) {
- let _ = e.additionalNodes && Ro(e.additionalNodes) || e.node;
- if (!Xc(e.node) && !Xc(t.node) || s(e.node) || s(t.node)) {
- const d = s(e.node) ? e.node : s(t.node) ? t.node : void 0;
- if (d !== void 0) {
- const g = lt(
- A.createConstructorDeclaration(
- /*modifiers*/
- void 0,
- [],
- /*body*/
- void 0
- ),
- d
- ), h = Tae(g);
- h.indent = e.indent + 1, h.children = e.node === d ? e.children : t.children, e.children = e.node === d ? Qi([h], t.children || [t]) : Qi(e.children || [{ ...e }], [h]);
- } else
- (e.children || t.children) && (e.children = Qi(e.children || [{ ...e }], t.children || [t]), e.children && (iq(e.children, e), Cae(e.children)));
- _ = e.node = lt(
- A.createClassDeclaration(
- /*modifiers*/
- void 0,
- e.name || A.createIdentifier("__class__"),
- /*typeParameters*/
- void 0,
- /*heritageClauses*/
- void 0,
- []
- ),
- e.node
- );
- } else
- e.children = Qi(e.children, t.children), e.children && iq(e.children, e);
- const u = t.node;
- return i.children[n - 1].node.end === _.end ? lt(_, { pos: _.pos, end: u.end }) : (e.additionalNodes || (e.additionalNodes = []), e.additionalNodes.push(lt(
- A.createClassDeclaration(
- /*modifiers*/
- void 0,
- e.name || A.createIdentifier("__class__"),
- /*typeParameters*/
- void 0,
- /*heritageClauses*/
- void 0,
- []
- ),
- t.node
- ))), !0;
- }
- return o !== 0;
- }
- function s2e(e, t, n, i) {
- return oJe(e, t, n, i) ? !0 : cJe(e.node, t.node, i) ? (lJe(e, t), !0) : !1;
- }
- function cJe(e, t, n) {
- if (e.kind !== t.kind || e.parent !== t.parent && !(a2e(e, n) && a2e(t, n)))
- return !1;
- switch (e.kind) {
- case 172:
- case 174:
- case 177:
- case 178:
- return zs(e) === zs(t);
- case 267:
- return o2e(e, t) && Pae(e) === Pae(t);
- default:
- return !0;
- }
- }
- function kae(e) {
- return !!(e.flags & 16);
- }
- function a2e(e, t) {
- const n = Sm(e.parent) ? e.parent.parent : e.parent;
- return n === t.node || ss(t.additionalNodes, n);
- }
- function o2e(e, t) {
- return !e.body || !t.body ? e.body === t.body : e.body.kind === t.body.kind && (e.body.kind !== 267 || o2e(e.body, t.body));
- }
- function lJe(e, t) {
- e.additionalNodes = e.additionalNodes || [], e.additionalNodes.push(t.node), t.additionalNodes && e.additionalNodes.push(...t.additionalNodes), e.children = Qi(e.children, t.children), e.children && (iq(e.children, e), Cae(e.children));
- }
- function Cae(e) {
- e.sort(uJe);
- }
- function uJe(e, t) {
- return aw(c2e(e.node), c2e(t.node)) || ho(nq(e), nq(t));
- }
- function c2e(e) {
- if (e.kind === 267)
- return u2e(e);
- const t = os(e);
- if (t && Bc(t)) {
- const n = oS(t);
- return n && Ei(n);
- }
- switch (e.kind) {
- case 218:
- case 219:
- case 231:
- return p2e(e);
- default:
- return;
- }
- }
- function Eae(e, t) {
- if (e.kind === 267)
- return rP(u2e(e));
- if (t) {
- const n = Oe(t) ? t.text : ko(t) ? `[${w9(t.argumentExpression)}]` : w9(t);
- if (n.length > 0)
- return rP(n);
- }
- switch (e.kind) {
- case 307:
- const n = e;
- return il(n) ? `"${cg(Hc($u(Os(n.fileName))))}"` : "";
- case 277:
- return wo(e) && e.isExportEquals ? "export=" : "default";
- case 219:
- case 262:
- case 218:
- case 263:
- case 231:
- return T0(e) & 2048 ? "default" : p2e(e);
- case 176:
- return "constructor";
- case 180:
- return "new()";
- case 179:
- return "()";
- case 181:
- return "[]";
- default:
- return "";
- }
- }
- function _Je(e) {
- const t = [];
- function n(s) {
- if (i(s) && (t.push(s), s.children))
- for (const o of s.children)
- n(o);
- }
- return n(e), t;
- function i(s) {
- if (s.children)
- return !0;
- switch (nq(s)) {
- case 263:
- case 231:
- case 266:
- case 264:
- case 267:
- case 307:
- case 265:
- case 346:
- case 338:
- return !0;
- case 219:
- case 262:
- case 218:
- return o(s);
- default:
- return !1;
- }
- function o(c) {
- if (!c.node.body)
- return !1;
- switch (nq(c.parent)) {
- case 268:
- case 307:
- case 174:
- case 176:
- return !0;
- default:
- return !1;
- }
- }
- }
- }
- function l2e(e) {
- return {
- text: Eae(e.node, e.name),
- kind: Yb(e.node),
- kindModifiers: f2e(e.node),
- spans: Dae(e),
- nameSpan: e.name && wae(e.name),
- childItems: lr(e.children, l2e)
- };
- }
- function fJe(e) {
- return {
- text: Eae(e.node, e.name),
- kind: Yb(e.node),
- kindModifiers: f2e(e.node),
- spans: Dae(e),
- childItems: lr(e.children, t) || Sae,
- indent: e.indent,
- bolded: !1,
- grayed: !1
- };
- function t(n) {
- return {
- text: Eae(n.node, n.name),
- kind: Yb(n.node),
- kindModifiers: HD(n.node),
- spans: Dae(n),
- childItems: Sae,
- indent: 0,
- bolded: !1,
- grayed: !1
- };
- }
- }
- function Dae(e) {
- const t = [wae(e.node)];
- if (e.additionalNodes)
- for (const n of e.additionalNodes)
- t.push(wae(n));
- return t;
- }
- function u2e(e) {
- return Fu(e) ? nc(e.name) : Pae(e);
- }
- function Pae(e) {
- const t = [Jp(e.name)];
- for (; e.body && e.body.kind === 267; )
- e = e.body, t.push(Jp(e.name));
- return t.join(".");
- }
- function _2e(e) {
- return e.body && zc(e.body) ? _2e(e.body) : e;
- }
- function pJe(e) {
- return !e.name || e.name.kind === 167;
- }
- function wae(e) {
- return e.kind === 307 ? L0(e) : t_(e, x8);
- }
- function f2e(e) {
- return e.parent && e.parent.kind === 260 && (e = e.parent), HD(e);
- }
- function p2e(e) {
- const { parent: t } = e;
- if (e.name && Rw(e.name) > 0)
- return rP(_o(e.name));
- if (ii(t))
- return rP(_o(t.name));
- if (dn(t) && t.operatorToken.kind === 64)
- return w9(t.left).replace(aJe, "");
- if (Qc(t))
- return w9(t.name);
- if (T0(e) & 2048)
- return "default";
- if (Zn(e))
- return "";
- if (Fs(t)) {
- let n = d2e(t.expression);
- if (n !== void 0) {
- if (n = rP(n), n.length > bae)
- return `${n} callback`;
- const i = rP(Ai(t.arguments, (s) => Xa(s) || VT(s) ? s.getText(x8) : void 0).join(", "));
- return `${n}(${i}) callback`;
- }
- }
- return "";
- }
- function d2e(e) {
- if (Oe(e))
- return e.text;
- if (Cn(e)) {
- const t = d2e(e.expression), n = e.name.text;
- return t === void 0 ? n : `${t}.${n}`;
- } else
- return;
- }
- function dJe(e) {
- switch (e.kind) {
- case 219:
- case 218:
- case 231:
- return !0;
- default:
- return !1;
- }
- }
- function rP(e) {
- return e = e.length > bae ? e.substring(0, bae) + "..." : e, e.replace(/\\?(?:\r?\n|[\r\u2028\u2029])/g, "");
- }
- var rk = {};
- La(rk, {
- addExportsInOldFile: () => Jae,
- addImportsForMovedSymbols: () => zae,
- addNewFileToTsconfig: () => Bae,
- addOrRemoveBracesToArrowFunction: () => uze,
- addTargetFileImports: () => Qae,
- containsJsx: () => Vae,
- convertArrowFunctionOrFunctionExpression: () => mze,
- convertParamsToDestructuredObject: () => Eze,
- convertStringOrTemplateLiteral: () => Vze,
- convertToOptionalChainExpression: () => eWe,
- createNewFileName: () => Uae,
- doChangeNamedToNamespaceOrDefault: () => b2e,
- extractSymbol: () => pSe,
- generateGetAccessorAndSetAccessor: () => RWe,
- getApplicableRefactors: () => mJe,
- getEditsForRefactor: () => gJe,
- getExistingLocals: () => $ae,
- getIdentifierForNode: () => Xae,
- getNewStatementsAndRemoveFromOldFile: () => jae,
- getStatementsToMove: () => C8,
- getUsageInfo: () => A9,
- inferFunctionReturnType: () => jWe,
- isRefactorErrorInfo: () => Bh,
- refactorKindBeginsWith: () => Ev,
- registerRefactor: () => Qg
- });
- var Aae = /* @__PURE__ */ new Map();
- function Qg(e, t) {
- Aae.set(e, t);
- }
- function mJe(e, t) {
- return as(iR(Aae.values(), (n) => {
- var i;
- return e.cancellationToken && e.cancellationToken.isCancellationRequested() || !((i = n.kinds) != null && i.some((s) => Ev(s, e.kind))) ? void 0 : n.getAvailableActions(e, t);
- }));
- }
- function gJe(e, t, n, i) {
- const s = Aae.get(t);
- return s && s.getEditsForAction(e, n, i);
- }
- var Nae = "Convert export", sq = {
- name: "Convert default export to named export",
- description: ms(p.Convert_default_export_to_named_export),
- kind: "refactor.rewrite.export.named"
- }, aq = {
- name: "Convert named export to default export",
- description: ms(p.Convert_named_export_to_default_export),
- kind: "refactor.rewrite.export.default"
- };
- Qg(Nae, {
- kinds: [
- sq.kind,
- aq.kind
- ],
- getAvailableActions: function(t) {
- const n = m2e(t, t.triggerReason === "invoked");
- if (!n) return Ue;
- if (!Bh(n)) {
- const i = n.wasDefault ? sq : aq;
- return [{ name: Nae, description: i.description, actions: [i] }];
- }
- return t.preferences.provideRefactorNotApplicableReason ? [
- {
- name: Nae,
- description: ms(p.Convert_default_export_to_named_export),
- actions: [
- { ...sq, notApplicableReason: n.error },
- { ...aq, notApplicableReason: n.error }
- ]
- }
- ] : Ue;
- },
- getEditsForAction: function(t, n) {
- E.assert(n === sq.name || n === aq.name, "Unexpected action name");
- const i = m2e(t);
- return E.assert(i && !Bh(i), "Expected applicable refactor info"), { edits: sn.ChangeTracker.with(t, (o) => hJe(t.file, t.program, i, o, t.cancellationToken)), renameFilename: void 0, renameLocation: void 0 };
- }
- });
- function m2e(e, t = !0) {
- const { file: n, program: i } = e, s = Kx(e), o = xi(n, s.start), c = o.parent && T0(o.parent) & 32 && t ? o.parent : l8(o, n, s);
- if (!c || !Si(c.parent) && !(Sm(c.parent) && Fu(c.parent.parent)))
- return { error: ms(p.Could_not_find_export_statement) };
- const _ = i.getTypeChecker(), u = TJe(c.parent, _), d = T0(c) || (wo(c) && !c.isExportEquals ? 2080 : 0), g = !!(d & 2048);
- if (!(d & 32) || !g && u.exports.has(
- "default"
- /* Default */
- ))
- return { error: ms(p.This_file_already_has_a_default_export) };
- const h = (S) => Oe(S) && _.getSymbolAtLocation(S) ? void 0 : { error: ms(p.Can_only_convert_named_export) };
- switch (c.kind) {
- case 262:
- case 263:
- case 264:
- case 266:
- case 265:
- case 267: {
- const S = c;
- return S.name ? h(S.name) || { exportNode: S, exportName: S.name, wasDefault: g, exportingModuleSymbol: u } : void 0;
- }
- case 243: {
- const S = c;
- if (!(S.declarationList.flags & 2) || S.declarationList.declarations.length !== 1)
- return;
- const T = xa(S.declarationList.declarations);
- return T.initializer ? (E.assert(!g, "Can't have a default flag here"), h(T.name) || { exportNode: S, exportName: T.name, wasDefault: g, exportingModuleSymbol: u }) : void 0;
- }
- case 277: {
- const S = c;
- return S.isExportEquals ? void 0 : h(S.expression) || { exportNode: S, exportName: S.expression, wasDefault: g, exportingModuleSymbol: u };
- }
- default:
- return;
- }
- }
- function hJe(e, t, n, i, s) {
- yJe(e, n, i, t.getTypeChecker()), vJe(t, n, i, s);
- }
- function yJe(e, { wasDefault: t, exportNode: n, exportName: i }, s, o) {
- if (t)
- if (wo(n) && !n.isExportEquals) {
- const c = n.expression, _ = g2e(c.text, c.text);
- s.replaceNode(e, n, A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([_])
- ));
- } else
- s.delete(e, E.checkDefined(k6(
- n,
- 90
- /* DefaultKeyword */
- ), "Should find a default keyword in modifier list"));
- else {
- const c = E.checkDefined(k6(
- n,
- 95
- /* ExportKeyword */
- ), "Should find an export keyword in modifier list");
- switch (n.kind) {
- case 262:
- case 263:
- case 264:
- s.insertNodeAfter(e, c, A.createToken(
- 90
- /* DefaultKeyword */
- ));
- break;
- case 243:
- const _ = xa(n.declarationList.declarations);
- if (!Eo.Core.isSymbolReferencedInFile(i, o, e) && !_.type) {
- s.replaceNode(e, n, A.createExportDefault(E.checkDefined(_.initializer, "Initializer was previously known to be present")));
- break;
- }
- case 266:
- case 265:
- case 267:
- s.deleteModifier(e, c), s.insertNodeAfter(e, n, A.createExportDefault(A.createIdentifier(i.text)));
- break;
- default:
- E.fail(`Unexpected exportNode kind ${n.kind}`);
- }
- }
- }
- function vJe(e, { wasDefault: t, exportName: n, exportingModuleSymbol: i }, s, o) {
- const c = e.getTypeChecker(), _ = E.checkDefined(c.getSymbolAtLocation(n), "Export name should resolve to a symbol");
- Eo.Core.eachExportReference(e.getSourceFiles(), c, o, _, i, n.text, t, (u) => {
- if (n === u) return;
- const d = u.getSourceFile();
- t ? bJe(d, u, s, n.text) : SJe(d, u, s);
- });
- }
- function bJe(e, t, n, i) {
- const { parent: s } = t;
- switch (s.kind) {
- case 211:
- n.replaceNode(e, t, A.createIdentifier(i));
- break;
- case 276:
- case 281: {
- const c = s;
- n.replaceNode(e, c, Iae(i, c.name.text));
- break;
- }
- case 273: {
- const c = s;
- E.assert(c.name === t, "Import clause name should match provided ref");
- const _ = Iae(i, t.text), { namedBindings: u } = c;
- if (!u)
- n.replaceNode(e, t, A.createNamedImports([_]));
- else if (u.kind === 274) {
- n.deleteRange(e, { pos: t.getStart(e), end: u.getStart(e) });
- const d = oa(c.parent.moduleSpecifier) ? _V(c.parent.moduleSpecifier, e) : 1, g = t1(
- /*defaultImport*/
- void 0,
- [Iae(i, t.text)],
- c.parent.moduleSpecifier,
- d
- );
- n.insertNodeAfter(e, c.parent, g);
- } else
- n.delete(e, t), n.insertNodeAtEndOfList(e, u.elements, _);
- break;
- }
- case 205:
- const o = s;
- n.replaceNode(e, s, A.createImportTypeNode(o.argument, o.attributes, A.createIdentifier(i), o.typeArguments, o.isTypeOf));
- break;
- default:
- E.failBadSyntaxKind(s);
- }
- }
- function SJe(e, t, n) {
- const i = t.parent;
- switch (i.kind) {
- case 211:
- n.replaceNode(e, t, A.createIdentifier("default"));
- break;
- case 276: {
- const s = A.createIdentifier(i.name.text);
- i.parent.elements.length === 1 ? n.replaceNode(e, i.parent, s) : (n.delete(e, i), n.insertNodeBefore(e, i.parent, s));
- break;
- }
- case 281: {
- n.replaceNode(e, i, g2e("default", i.name.text));
- break;
- }
- default:
- E.assertNever(i, `Unexpected parent kind ${i.kind}`);
- }
- }
- function Iae(e, t) {
- return A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- e === t ? void 0 : A.createIdentifier(e),
- A.createIdentifier(t)
- );
- }
- function g2e(e, t) {
- return A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- e === t ? void 0 : A.createIdentifier(e),
- A.createIdentifier(t)
- );
- }
- function TJe(e, t) {
- if (Si(e))
- return e.symbol;
- const n = e.parent.symbol;
- return n.valueDeclaration && yb(n.valueDeclaration) ? t.getMergedSymbol(n) : n;
- }
- var Oae = "Convert import", oq = {
- 0: {
- name: "Convert namespace import to named imports",
- description: ms(p.Convert_namespace_import_to_named_imports),
- kind: "refactor.rewrite.import.named"
- },
- 2: {
- name: "Convert named imports to namespace import",
- description: ms(p.Convert_named_imports_to_namespace_import),
- kind: "refactor.rewrite.import.namespace"
- },
- 1: {
- name: "Convert named imports to default import",
- description: ms(p.Convert_named_imports_to_default_import),
- kind: "refactor.rewrite.import.default"
- }
- };
- Qg(Oae, {
- kinds: OT(oq).map((e) => e.kind),
- getAvailableActions: function(t) {
- const n = h2e(t, t.triggerReason === "invoked");
- if (!n) return Ue;
- if (!Bh(n)) {
- const i = oq[n.convertTo];
- return [{ name: Oae, description: i.description, actions: [i] }];
- }
- return t.preferences.provideRefactorNotApplicableReason ? OT(oq).map((i) => ({
- name: Oae,
- description: i.description,
- actions: [{ ...i, notApplicableReason: n.error }]
- })) : Ue;
- },
- getEditsForAction: function(t, n) {
- E.assert(ut(OT(oq), (o) => o.name === n), "Unexpected action name");
- const i = h2e(t);
- return E.assert(i && !Bh(i), "Expected applicable refactor info"), { edits: sn.ChangeTracker.with(t, (o) => xJe(t.file, t.program, o, i)), renameFilename: void 0, renameLocation: void 0 };
- }
- });
- function h2e(e, t = !0) {
- const { file: n } = e, i = Kx(e), s = xi(n, i.start), o = t ? or(s, Nf(ic, Cm)) : l8(s, n, i);
- if (o === void 0 || !(ic(o) || Cm(o))) return { error: "Selection is not an import declaration." };
- const c = i.start + i.length, _ = Zb(o, o.parent, n);
- if (_ && c > _.getStart()) return;
- const { importClause: u } = o;
- return u ? u.namedBindings ? u.namedBindings.kind === 274 ? { convertTo: 0, import: u.namedBindings } : y2e(e.program, u) ? { convertTo: 1, import: u.namedBindings } : { convertTo: 2, import: u.namedBindings } : { error: ms(p.Could_not_find_namespace_import_or_named_imports) } : { error: ms(p.Could_not_find_import_clause) };
- }
- function y2e(e, t) {
- return mx(e.getCompilerOptions()) && EJe(t.parent.moduleSpecifier, e.getTypeChecker());
- }
- function xJe(e, t, n, i) {
- const s = t.getTypeChecker();
- i.convertTo === 0 ? kJe(e, s, n, i.import, mx(t.getCompilerOptions())) : b2e(
- e,
- t,
- n,
- i.import,
- i.convertTo === 1
- /* Default */
- );
- }
- function kJe(e, t, n, i, s) {
- let o = !1;
- const c = [], _ = /* @__PURE__ */ new Map();
- Eo.Core.eachSymbolReferenceInFile(i.name, t, e, (h) => {
- if (!Iw(h.parent))
- o = !0;
- else {
- const S = v2e(h.parent).text;
- t.resolveName(
- S,
- h,
- -1,
- /*excludeGlobals*/
- !0
- ) && _.set(S, !0), E.assert(CJe(h.parent) === h, "Parent expression should match id"), c.push(h.parent);
- }
- });
- const u = /* @__PURE__ */ new Map();
- for (const h of c) {
- const S = v2e(h).text;
- let T = u.get(S);
- T === void 0 && u.set(S, T = _.has(S) ? IS(S, e) : S), n.replaceNode(e, h, A.createIdentifier(T));
- }
- const d = [];
- u.forEach((h, S) => {
- d.push(A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- h === S ? void 0 : A.createIdentifier(S),
- A.createIdentifier(h)
- ));
- });
- const g = i.parent.parent;
- if (o && !s && ic(g))
- n.insertNodeAfter(e, g, S2e(
- g,
- /*defaultImportName*/
- void 0,
- d
- ));
- else {
- const h = o ? A.createIdentifier(i.name.text) : void 0;
- n.replaceNode(e, i.parent, T2e(h, d));
- }
- }
- function v2e(e) {
- return Cn(e) ? e.name : e.right;
- }
- function CJe(e) {
- return Cn(e) ? e.expression : e.left;
- }
- function b2e(e, t, n, i, s = y2e(t, i.parent)) {
- const o = t.getTypeChecker(), c = i.parent.parent, { moduleSpecifier: _ } = c, u = /* @__PURE__ */ new Set();
- i.elements.forEach((C) => {
- const D = o.getSymbolAtLocation(C.name);
- D && u.add(D);
- });
- const d = _ && oa(_) ? y8(
- _.text,
- 99
- /* ESNext */
- ) : "module";
- function g(C) {
- return !!Eo.Core.eachSymbolReferenceInFile(C.name, o, e, (D) => {
- const P = o.resolveName(
- d,
- D,
- -1,
- /*excludeGlobals*/
- !0
- );
- return P ? u.has(P) ? vu(D.parent) : !0 : !1;
- });
- }
- const S = i.elements.some(g) ? IS(d, e) : d, T = /* @__PURE__ */ new Set();
- for (const C of i.elements) {
- const D = C.propertyName || C.name;
- Eo.Core.eachSymbolReferenceInFile(C.name, o, e, (P) => {
- const I = D.kind === 11 ? A.createElementAccessExpression(A.createIdentifier(S), A.cloneNode(D)) : A.createPropertyAccessExpression(A.createIdentifier(S), A.cloneNode(D));
- uu(P.parent) ? n.replaceNode(e, P.parent, A.createPropertyAssignment(P.text, I)) : vu(P.parent) ? T.add(C) : n.replaceNode(e, P, I);
- });
- }
- if (n.replaceNode(
- e,
- i,
- s ? A.createIdentifier(S) : A.createNamespaceImport(A.createIdentifier(S))
- ), T.size && ic(c)) {
- const C = as(T.values(), (D) => A.createImportSpecifier(D.isTypeOnly, D.propertyName && A.cloneNode(D.propertyName), A.cloneNode(D.name)));
- n.insertNodeAfter(e, i.parent.parent, S2e(
- c,
- /*defaultImportName*/
- void 0,
- C
- ));
- }
- }
- function EJe(e, t) {
- const n = t.resolveExternalModuleName(e);
- if (!n) return !1;
- const i = t.resolveExternalModuleSymbol(n);
- return n !== i;
- }
- function S2e(e, t, n) {
- return A.createImportDeclaration(
- /*modifiers*/
- void 0,
- T2e(t, n),
- e.moduleSpecifier,
- /*attributes*/
- void 0
- );
- }
- function T2e(e, t) {
- return A.createImportClause(
- /*isTypeOnly*/
- !1,
- e,
- t && t.length ? A.createNamedImports(t) : void 0
- );
- }
- var Fae = "Extract type", cq = {
- name: "Extract to type alias",
- description: ms(p.Extract_to_type_alias),
- kind: "refactor.extract.type"
- }, lq = {
- name: "Extract to interface",
- description: ms(p.Extract_to_interface),
- kind: "refactor.extract.interface"
- }, uq = {
- name: "Extract to typedef",
- description: ms(p.Extract_to_typedef),
- kind: "refactor.extract.typedef"
- };
- Qg(Fae, {
- kinds: [
- cq.kind,
- lq.kind,
- uq.kind
- ],
- getAvailableActions: function(t) {
- const { info: n, affectedTextRange: i } = x2e(t, t.triggerReason === "invoked");
- return n ? Bh(n) ? t.preferences.provideRefactorNotApplicableReason ? [{
- name: Fae,
- description: ms(p.Extract_type),
- actions: [
- { ...uq, notApplicableReason: n.error },
- { ...cq, notApplicableReason: n.error },
- { ...lq, notApplicableReason: n.error }
- ]
- }] : Ue : [{
- name: Fae,
- description: ms(p.Extract_type),
- actions: n.isJS ? [uq] : wr([cq], n.typeElements && lq)
- }].map((o) => ({
- ...o,
- actions: o.actions.map((c) => ({
- ...c,
- range: i ? {
- start: { line: Qs(t.file, i.pos).line, offset: Qs(t.file, i.pos).character },
- end: { line: Qs(t.file, i.end).line, offset: Qs(t.file, i.end).character }
- } : void 0
- }))
- })) : Ue;
- },
- getEditsForAction: function(t, n) {
- const { file: i } = t, { info: s } = x2e(t);
- E.assert(s && !Bh(s), "Expected to find a range to extract");
- const o = IS("NewType", i), c = sn.ChangeTracker.with(t, (d) => {
- switch (n) {
- case cq.name:
- return E.assert(!s.isJS, "Invalid actionName/JS combo"), wJe(d, i, o, s);
- case uq.name:
- return E.assert(s.isJS, "Invalid actionName/JS combo"), NJe(d, t, i, o, s);
- case lq.name:
- return E.assert(!s.isJS && !!s.typeElements, "Invalid actionName/JS combo"), AJe(d, i, o, s);
- default:
- E.fail("Unexpected action name");
- }
- }), _ = i.fileName, u = f8(
- c,
- _,
- o,
- /*preferLastLocation*/
- !1
- );
- return { edits: c, renameFilename: _, renameLocation: u };
- }
- });
- function x2e(e, t = !0) {
- const { file: n, startPosition: i } = e, s = Gu(n), o = e9(Kx(e)), c = o.pos === o.end && t, _ = DJe(n, i, o, c);
- if (!_ || !fi(_)) return { info: { error: ms(p.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 };
- const u = e.program.getTypeChecker(), d = IJe(_, s);
- if (d === void 0) return { info: { error: ms(p.No_type_could_be_extracted_from_this_type_node) }, affectedTextRange: void 0 };
- const g = OJe(_, d);
- if (!fi(g)) return { info: { error: ms(p.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 };
- const h = [];
- (qy(g.parent) || Ax(g.parent)) && o.end > _.end && Fn(
- h,
- g.parent.types.filter((P) => qF(P, n, o.pos, o.end))
- );
- const S = h.length > 1 ? h : g, { typeParameters: T, affectedTextRange: C } = PJe(u, S, d, n);
- if (!T) return { info: { error: ms(p.No_type_could_be_extracted_from_this_type_node) }, affectedTextRange: void 0 };
- const D = _q(u, S);
- return { info: { isJS: s, selection: S, enclosingNode: d, typeParameters: T, typeElements: D }, affectedTextRange: C };
- }
- function DJe(e, t, n, i) {
- const s = [
- () => xi(e, t),
- () => T6(e, t, () => !0)
- ];
- for (const o of s) {
- const c = o(), _ = qF(c, e, n.pos, n.end), u = or(c, (d) => d.parent && fi(d) && !n2(n, d.parent, e) && (i || _));
- if (u)
- return u;
- }
- }
- function _q(e, t) {
- if (t) {
- if (us(t)) {
- const n = [];
- for (const i of t) {
- const s = _q(e, i);
- if (!s) return;
- Fn(n, s);
- }
- return n;
- }
- if (Ax(t)) {
- const n = [], i = /* @__PURE__ */ new Map();
- for (const s of t.types) {
- const o = _q(e, s);
- if (!o || !o.every((c) => c.name && zp(i, o8(c.name))))
- return;
- Fn(n, o);
- }
- return n;
- } else {
- if (dS(t))
- return _q(e, t.type);
- if (Qu(t))
- return t.members;
- }
- }
- }
- function n2(e, t, n) {
- return t8(e, aa(n.text, t.pos), t.end);
- }
- function PJe(e, t, n, i) {
- const s = [], o = FT(t), c = { pos: o[0].getStart(i), end: o[o.length - 1].end };
- for (const u of o)
- if (_(u)) return { typeParameters: void 0, affectedTextRange: void 0 };
- return { typeParameters: s, affectedTextRange: c };
- function _(u) {
- if (vf(u)) {
- if (Oe(u.typeName)) {
- const d = u.typeName, g = e.resolveName(
- d.text,
- d,
- 262144,
- /*excludeGlobals*/
- !0
- );
- for (const h of g?.declarations || Ue)
- if (zo(h) && h.getSourceFile() === i) {
- if (h.name.escapedText === d.escapedText && n2(h, c, i))
- return !0;
- if (n2(n, h, i) && !n2(c, h, i)) {
- tp(s, h);
- break;
- }
- }
- }
- } else if (pS(u)) {
- const d = or(u, (g) => Mb(g) && n2(g.extendsType, u, i));
- if (!d || !n2(c, d, i))
- return !0;
- } else if (Px(u) || HC(u)) {
- const d = or(u.parent, ys);
- if (d && d.type && n2(d.type, u, i) && !n2(c, d, i))
- return !0;
- } else if (Lb(u)) {
- if (Oe(u.exprName)) {
- const d = e.resolveName(
- u.exprName.text,
- u.exprName,
- 111551,
- /*excludeGlobals*/
- !1
- );
- if (d?.valueDeclaration && n2(n, d.valueDeclaration, i) && !n2(c, d.valueDeclaration, i))
- return !0;
- } else if (Ly(u.exprName.left) && !n2(c, u.parent, i))
- return !0;
- }
- return i && wx(u) && Qs(i, u.pos).line === Qs(i, u.end).line && an(
- u,
- 1
- /* SingleLine */
- ), bs(u, _);
- }
- }
- function wJe(e, t, n, i) {
- const { enclosingNode: s, typeParameters: o } = i, { firstTypeNode: c, lastTypeNode: _, newTypeNode: u } = Lae(i), d = A.createTypeAliasDeclaration(
- /*modifiers*/
- void 0,
- n,
- o.map((g) => A.updateTypeParameterDeclaration(
- g,
- g.modifiers,
- g.name,
- g.constraint,
- /*defaultType*/
- void 0
- )),
- u
- );
- e.insertNodeBefore(
- t,
- s,
- EJ(d),
- /*blankLineBetween*/
- !0
- ), e.replaceNodeRange(t, c, _, A.createTypeReferenceNode(n, o.map((g) => A.createTypeReferenceNode(
- g.name,
- /*typeArguments*/
- void 0
- ))), { leadingTriviaOption: sn.LeadingTriviaOption.Exclude, trailingTriviaOption: sn.TrailingTriviaOption.ExcludeWhitespace });
- }
- function AJe(e, t, n, i) {
- var s;
- const { enclosingNode: o, typeParameters: c, typeElements: _ } = i, u = A.createInterfaceDeclaration(
- /*modifiers*/
- void 0,
- n,
- c,
- /*heritageClauses*/
- void 0,
- _
- );
- lt(u, (s = _[0]) == null ? void 0 : s.parent), e.insertNodeBefore(
- t,
- o,
- EJ(u),
- /*blankLineBetween*/
- !0
- );
- const { firstTypeNode: d, lastTypeNode: g } = Lae(i);
- e.replaceNodeRange(t, d, g, A.createTypeReferenceNode(n, c.map((h) => A.createTypeReferenceNode(
- h.name,
- /*typeArguments*/
- void 0
- ))), { leadingTriviaOption: sn.LeadingTriviaOption.Exclude, trailingTriviaOption: sn.TrailingTriviaOption.ExcludeWhitespace });
- }
- function NJe(e, t, n, i, s) {
- var o;
- FT(s.selection).forEach((C) => {
- an(
- C,
- 7168
- /* NoNestedComments */
- );
- });
- const { enclosingNode: c, typeParameters: _ } = s, { firstTypeNode: u, lastTypeNode: d, newTypeNode: g } = Lae(s), h = A.createJSDocTypedefTag(
- A.createIdentifier("typedef"),
- A.createJSDocTypeExpression(g),
- A.createIdentifier(i)
- ), S = [];
- ir(_, (C) => {
- const D = oC(C), P = A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- C.name
- ), I = A.createJSDocTemplateTag(
- A.createIdentifier("template"),
- D && Bs(D, pv),
- [P]
- );
- S.push(I);
- });
- const T = A.createJSDocComment(
- /*comment*/
- void 0,
- A.createNodeArray(Qi(S, [h]))
- );
- if (Id(c)) {
- const C = c.getStart(n), D = jh(t.host, (o = t.formatContext) == null ? void 0 : o.options);
- e.insertNodeAt(n, c.getStart(n), T, {
- suffix: D + D + n.text.slice(c9(n.text, C - 1), C)
- });
- } else
- e.insertNodeBefore(
- n,
- c,
- T,
- /*blankLineBetween*/
- !0
- );
- e.replaceNodeRange(n, u, d, A.createTypeReferenceNode(i, _.map((C) => A.createTypeReferenceNode(
- C.name,
- /*typeArguments*/
- void 0
- ))));
- }
- function Lae(e) {
- return us(e.selection) ? {
- firstTypeNode: e.selection[0],
- lastTypeNode: e.selection[e.selection.length - 1],
- newTypeNode: qy(e.selection[0].parent) ? A.createUnionTypeNode(e.selection) : A.createIntersectionTypeNode(e.selection)
- } : {
- firstTypeNode: e.selection,
- lastTypeNode: e.selection,
- newTypeNode: e.selection
- };
- }
- function IJe(e, t) {
- return or(e, bi) || (t ? or(e, Id) : void 0);
- }
- function OJe(e, t) {
- return or(e, (n) => n === t ? "quit" : !!(qy(n.parent) || Ax(n.parent))) ?? e;
- }
- var fq = "Move to file", Mae = ms(p.Move_to_file), Rae = {
- name: "Move to file",
- description: Mae,
- kind: "refactor.move.file"
- };
- Qg(fq, {
- kinds: [Rae.kind],
- getAvailableActions: function(t, n) {
- const i = t.file, s = C8(t);
- if (!n)
- return Ue;
- if (t.triggerReason === "implicit" && t.endPosition !== void 0) {
- const o = or(xi(i, t.startPosition), ek), c = or(xi(i, t.endPosition), ek);
- if (o && !Si(o) && c && !Si(c))
- return Ue;
- }
- if (t.preferences.allowTextChangesInNewFiles && s) {
- const o = {
- start: { line: Qs(i, s.all[0].getStart(i)).line, offset: Qs(i, s.all[0].getStart(i)).character },
- end: { line: Qs(i, _a(s.all).end).line, offset: Qs(i, _a(s.all).end).character }
- };
- return [{ name: fq, description: Mae, actions: [{ ...Rae, range: o }] }];
- }
- return t.preferences.provideRefactorNotApplicableReason ? [{ name: fq, description: Mae, actions: [{ ...Rae, notApplicableReason: ms(p.Selection_is_not_a_valid_statement_or_statements) }] }] : Ue;
- },
- getEditsForAction: function(t, n, i) {
- E.assert(n === fq, "Wrong refactor invoked");
- const s = E.checkDefined(C8(t)), { host: o, program: c } = t;
- E.assert(i, "No interactive refactor arguments available");
- const _ = i.targetFile;
- return Ug(_) || gx(_) ? o.fileExists(_) && c.getSourceFile(_) === void 0 ? k2e(ms(p.Cannot_move_statements_to_the_selected_file)) : { edits: sn.ChangeTracker.with(t, (d) => FJe(t, t.file, i.targetFile, t.program, s, d, t.host, t.preferences)), renameFilename: void 0, renameLocation: void 0 } : k2e(ms(p.Cannot_move_to_file_selected_file_is_invalid));
- }
- });
- function k2e(e) {
- return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: e };
- }
- function FJe(e, t, n, i, s, o, c, _) {
- const u = i.getTypeChecker(), d = !c.fileExists(n), g = d ? T9(n, t.externalModuleIndicator ? 99 : t.commonJsModuleIndicator ? 1 : void 0, i, c) : E.checkDefined(i.getSourceFile(n)), h = xu.createImportAdder(t, e.program, e.preferences, e.host), S = xu.createImportAdder(g, e.program, e.preferences, e.host);
- jae(t, g, A9(t, s.all, u, d ? void 0 : $ae(g, s.all, u)), o, s, i, c, _, S, h), d && Bae(i, o, t.fileName, n, S0(c));
- }
- function jae(e, t, n, i, s, o, c, _, u, d) {
- const g = o.getTypeChecker(), h = kR(e.statements, lm), S = !BV(t.fileName, o, c, !!e.commonJsModuleIndicator), T = bf(e, _);
- zae(n.oldFileImportsFromTargetFile, t.fileName, d, o), MJe(e, s.all, n.unusedImportsFromOldFile, d), d.writeFixes(i, T), LJe(e, s.ranges, i), RJe(i, o, c, e, n.movedSymbols, t.fileName, T), Jae(e, n.targetFileImportsFromOldFile, i, S), Qae(e, n.oldImportsNeededByTargetFile, n.targetFileImportsFromOldFile, g, o, u), !sg(t) && h.length && i.insertStatementsInNewFile(t.fileName, h, e), u.writeFixes(i, T);
- const C = UJe(e, s.all, as(n.oldFileImportsFromTargetFile.keys()), S);
- sg(t) && t.statements.length > 0 ? aze(i, o, C, t, s) : sg(t) ? i.insertNodesAtEndOfFile(
- t,
- C,
- /*blankLineBetween*/
- !1
- ) : i.insertStatementsInNewFile(t.fileName, u.hasFixes() ? [4, ...C] : C, e);
- }
- function Bae(e, t, n, i, s) {
- const o = e.getCompilerOptions().configFile;
- if (!o) return;
- const c = Os(Bn(n, "..", i)), _ = qE(o.fileName, c, s), u = o.statements[0] && Wn(o.statements[0].expression, Ks), d = u && On(u.properties, (g) => Qc(g) && oa(g.name) && g.name.text === "files");
- d && $l(d.initializer) && t.insertNodeInListAfter(o, _a(d.initializer.elements), A.createStringLiteral(_), d.initializer.elements);
- }
- function LJe(e, t, n) {
- for (const { first: i, afterLast: s } of t)
- n.deleteNodeRangeExcludingEnd(e, i, s);
- }
- function MJe(e, t, n, i) {
- for (const s of e.statements)
- ss(t, s) || E2e(s, (o) => {
- D2e(o, (c) => {
- n.has(c.symbol) && i.removeExistingImport(c);
- });
- });
- }
- function Jae(e, t, n, i) {
- const s = x6();
- t.forEach((o, c) => {
- if (c.declarations)
- for (const _ of c.declarations) {
- if (!Gae(_)) continue;
- const u = YJe(_);
- if (!u) continue;
- const d = N2e(_);
- s(d) && ZJe(e, d, u, n, i);
- }
- });
- }
- function RJe(e, t, n, i, s, o, c) {
- const _ = t.getTypeChecker();
- for (const u of t.getSourceFiles())
- if (u !== i)
- for (const d of u.statements)
- E2e(d, (g) => {
- if (_.getSymbolAtLocation(zJe(g)) !== i.symbol) return;
- const h = (P) => {
- const I = va(P.parent) ? a9(_, P.parent) : Hl(_.getSymbolAtLocation(P), _);
- return !!I && s.has(I);
- };
- VJe(u, g, e, h);
- const S = z1(Xn(es(i.fileName, t.getCurrentDirectory())), o);
- if (Kk(!t.useCaseSensitiveFileNames())(S, u.fileName) === 0) return;
- const T = N0.getModuleSpecifier(t.getCompilerOptions(), u, u.fileName, S, Zx(t, n)), C = $Je(g, $D(T, c), h);
- C && e.insertNodeAfter(u, d, C);
- const D = jJe(g);
- D && BJe(e, u, _, s, T, D, g, c);
- });
- }
- function jJe(e) {
- switch (e.kind) {
- case 272:
- return e.importClause && e.importClause.namedBindings && e.importClause.namedBindings.kind === 274 ? e.importClause.namedBindings.name : void 0;
- case 271:
- return e.name;
- case 260:
- return Wn(e.name, Oe);
- default:
- return E.assertNever(e, `Unexpected node kind ${e.kind}`);
- }
- }
- function BJe(e, t, n, i, s, o, c, _) {
- const u = y8(
- s,
- 99
- /* ESNext */
- );
- let d = !1;
- const g = [];
- if (Eo.Core.eachSymbolReferenceInFile(o, n, t, (h) => {
- Cn(h.parent) && (d = d || !!n.resolveName(
- u,
- h,
- -1,
- /*excludeGlobals*/
- !0
- ), i.has(n.getSymbolAtLocation(h.parent.name)) && g.push(h));
- }), g.length) {
- const h = d ? IS(u, t) : u;
- for (const S of g)
- e.replaceNode(t, S, A.createIdentifier(h));
- e.insertNodeAfter(t, c, JJe(c, u, s, _));
- }
- }
- function JJe(e, t, n, i) {
- const s = A.createIdentifier(t), o = $D(n, i);
- switch (e.kind) {
- case 272:
- return A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- /*isTypeOnly*/
- !1,
- /*name*/
- void 0,
- A.createNamespaceImport(s)
- ),
- o,
- /*attributes*/
- void 0
- );
- case 271:
- return A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- s,
- A.createExternalModuleReference(o)
- );
- case 260:
- return A.createVariableDeclaration(
- s,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- C2e(o)
- );
- default:
- return E.assertNever(e, `Unexpected node kind ${e.kind}`);
- }
- }
- function C2e(e) {
- return A.createCallExpression(
- A.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- [e]
- );
- }
- function zJe(e) {
- return e.kind === 272 ? e.moduleSpecifier : e.kind === 271 ? e.moduleReference.expression : e.initializer.arguments[0];
- }
- function E2e(e, t) {
- if (ic(e))
- oa(e.moduleSpecifier) && t(e);
- else if (gl(e))
- Fh(e.moduleReference) && Xa(e.moduleReference.expression) && t(e);
- else if (yc(e))
- for (const n of e.declarationList.declarations)
- n.initializer && f_(
- n.initializer,
- /*requireStringLiteralLikeArgument*/
- !0
- ) && t(n);
- }
- function D2e(e, t) {
- var n, i, s, o, c;
- if (e.kind === 272) {
- if ((n = e.importClause) != null && n.name && t(e.importClause), ((s = (i = e.importClause) == null ? void 0 : i.namedBindings) == null ? void 0 : s.kind) === 274 && t(e.importClause.namedBindings), ((c = (o = e.importClause) == null ? void 0 : o.namedBindings) == null ? void 0 : c.kind) === 275)
- for (const _ of e.importClause.namedBindings.elements)
- t(_);
- } else if (e.kind === 271)
- t(e);
- else if (e.kind === 260) {
- if (e.name.kind === 80)
- t(e);
- else if (e.name.kind === 206)
- for (const _ of e.name.elements)
- Oe(_.name) && t(_);
- }
- }
- function zae(e, t, n, i) {
- for (const [s, o] of e) {
- const c = h9(s, pa(i.getCompilerOptions())), _ = s.name === "default" && s.parent ? 1 : 0;
- n.addImportForNonExistentExport(c, t, _, s.flags, o);
- }
- }
- function WJe(e, t, n, i = 2) {
- return A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList([A.createVariableDeclaration(
- e,
- /*exclamationToken*/
- void 0,
- t,
- n
- )], i)
- );
- }
- function UJe(e, t, n, i) {
- return ta(t, (s) => {
- if (w2e(s) && !P2e(e, s, i) && Hae(s, (o) => {
- var c;
- return n.includes(E.checkDefined((c = Wn(o, kd)) == null ? void 0 : c.symbol));
- })) {
- const o = qJe(Ja(s), i);
- if (o) return o;
- }
- return Ja(s);
- });
- }
- function P2e(e, t, n, i) {
- var s;
- return n ? !Pl(t) && Gn(
- t,
- 32
- /* Export */
- ) || !!(i && e.symbol && ((s = e.symbol.exports) != null && s.has(i.escapedText))) : !!e.symbol && !!e.symbol.exports && Wae(t).some((o) => e.symbol.exports.has(tc(o)));
- }
- function VJe(e, t, n, i) {
- if (t.kind === 272 && t.importClause) {
- const { name: s, namedBindings: o } = t.importClause;
- if ((!s || i(s)) && (!o || o.kind === 275 && o.elements.length !== 0 && o.elements.every((c) => i(c.name))))
- return n.delete(e, t);
- }
- D2e(t, (s) => {
- s.name && Oe(s.name) && i(s.name) && n.delete(e, s);
- });
- }
- function w2e(e) {
- return E.assert(Si(e.parent), "Node parent should be a SourceFile"), L2e(e) || yc(e);
- }
- function qJe(e, t) {
- return t ? [HJe(e)] : GJe(e);
- }
- function HJe(e) {
- const t = Hp(e) ? Qi([A.createModifier(
- 95
- /* ExportKeyword */
- )], fb(e)) : void 0;
- switch (e.kind) {
- case 262:
- return A.updateFunctionDeclaration(e, t, e.asteriskToken, e.name, e.typeParameters, e.parameters, e.type, e.body);
- case 263:
- const n = Vb(e) ? Cy(e) : void 0;
- return A.updateClassDeclaration(e, Qi(n, t), e.name, e.typeParameters, e.heritageClauses, e.members);
- case 243:
- return A.updateVariableStatement(e, t, e.declarationList);
- case 267:
- return A.updateModuleDeclaration(e, t, e.name, e.body);
- case 266:
- return A.updateEnumDeclaration(e, t, e.name, e.members);
- case 265:
- return A.updateTypeAliasDeclaration(e, t, e.name, e.typeParameters, e.type);
- case 264:
- return A.updateInterfaceDeclaration(e, t, e.name, e.typeParameters, e.heritageClauses, e.members);
- case 271:
- return A.updateImportEqualsDeclaration(e, t, e.isTypeOnly, e.name, e.moduleReference);
- case 244:
- return E.fail();
- default:
- return E.assertNever(e, `Unexpected declaration kind ${e.kind}`);
- }
- }
- function GJe(e) {
- return [e, ...Wae(e).map(A2e)];
- }
- function A2e(e) {
- return A.createExpressionStatement(
- A.createBinaryExpression(
- A.createPropertyAccessExpression(A.createIdentifier("exports"), A.createIdentifier(e)),
- 64,
- A.createIdentifier(e)
- )
- );
- }
- function Wae(e) {
- switch (e.kind) {
- case 262:
- case 263:
- return [e.name.text];
- case 243:
- return Ai(e.declarationList.declarations, (t) => Oe(t.name) ? t.name.text : void 0);
- case 267:
- case 266:
- case 265:
- case 264:
- case 271:
- return Ue;
- case 244:
- return E.fail("Can't export an ExpressionStatement");
- default:
- return E.assertNever(e, `Unexpected decl kind ${e.kind}`);
- }
- }
- function $Je(e, t, n) {
- switch (e.kind) {
- case 272: {
- const i = e.importClause;
- if (!i) return;
- const s = i.name && n(i.name) ? i.name : void 0, o = i.namedBindings && XJe(i.namedBindings, n);
- return s || o ? A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(i.isTypeOnly, s, o),
- Ja(t),
- /*attributes*/
- void 0
- ) : void 0;
- }
- case 271:
- return n(e.name) ? e : void 0;
- case 260: {
- const i = QJe(e.name, n);
- return i ? WJe(i, e.type, C2e(t), e.parent.flags) : void 0;
- }
- default:
- return E.assertNever(e, `Unexpected import kind ${e.kind}`);
- }
- }
- function XJe(e, t) {
- if (e.kind === 274)
- return t(e.name) ? e : void 0;
- {
- const n = e.elements.filter((i) => t(i.name));
- return n.length ? A.createNamedImports(n) : void 0;
- }
- }
- function QJe(e, t) {
- switch (e.kind) {
- case 80:
- return t(e) ? e : void 0;
- case 207:
- return e;
- case 206: {
- const n = e.elements.filter((i) => i.propertyName || !Oe(i.name) || t(i.name));
- return n.length ? A.createObjectBindingPattern(n) : void 0;
- }
- }
- }
- function YJe(e) {
- return Pl(e) ? Wn(e.expression.left.name, Oe) : Wn(e.name, Oe);
- }
- function N2e(e) {
- switch (e.kind) {
- case 260:
- return e.parent.parent;
- case 208:
- return N2e(
- Bs(e.parent.parent, (t) => ii(t) || va(t))
- );
- default:
- return e;
- }
- }
- function ZJe(e, t, n, i, s) {
- if (!P2e(e, t, s, n))
- if (s)
- Pl(t) || i.insertExportModifier(e, t);
- else {
- const o = Wae(t);
- o.length !== 0 && i.insertNodesAfter(e, t, o.map(A2e));
- }
- }
- function Uae(e, t, n, i) {
- const s = t.getTypeChecker();
- if (i) {
- const o = A9(e, i.all, s), c = Xn(e.fileName), _ = z4(e.fileName);
- return Bn(
- // new file is always placed in the same directory as the old file
- c,
- // ensures the filename computed below isn't already taken
- nze(
- // infers a name for the new file from the symbols being moved
- ize(o.oldFileImportsFromTargetFile, o.movedSymbols),
- _,
- c,
- n
- )
- ) + _;
- }
- return "";
- }
- function KJe(e) {
- const { file: t } = e, n = e9(Kx(e)), { statements: i } = t;
- let s = ac(i, (d) => d.end > n.pos);
- if (s === -1) return;
- const o = i[s], c = M2e(t, o);
- c && (s = c.start);
- let _ = ac(i, (d) => d.end >= n.end, s);
- _ !== -1 && n.end <= i[_].getStart() && _--;
- const u = M2e(t, i[_]);
- return u && (_ = u.end), {
- toMove: i.slice(s, _ === -1 ? i.length : _ + 1),
- afterLast: _ === -1 ? void 0 : i[_ + 1]
- };
- }
- function C8(e) {
- const t = KJe(e);
- if (t === void 0) return;
- const n = [], i = [], { toMove: s, afterLast: o } = t;
- return oR(s, eze, (c, _) => {
- for (let u = c; u < _; u++) n.push(s[u]);
- i.push({ first: s[c], afterLast: o });
- }), n.length === 0 ? void 0 : { all: n, ranges: i };
- }
- function Vae(e) {
- return On(e, (t) => !!(t.transformFlags & 2));
- }
- function eze(e) {
- return !tze(e) && !lm(e);
- }
- function tze(e) {
- switch (e.kind) {
- case 272:
- return !0;
- case 271:
- return !Gn(
- e,
- 32
- /* Export */
- );
- case 243:
- return e.declarationList.declarations.every((t) => !!t.initializer && f_(
- t.initializer,
- /*requireStringLiteralLikeArgument*/
- !0
- ));
- default:
- return !1;
- }
- }
- function A9(e, t, n, i = /* @__PURE__ */ new Set(), s) {
- var o;
- const c = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = S(Vae(t));
- d && _.set(d, [!1, Wn((o = d.declarations) == null ? void 0 : o[0], (T) => Zu(T) || Ad(T) || Hg(T) || gl(T) || va(T) || ii(T))]);
- for (const T of t)
- Hae(T, (C) => {
- c.add(E.checkDefined(Pl(C) ? n.getSymbolAtLocation(C.expression.left) : C.symbol, "Need a symbol here"));
- });
- const g = /* @__PURE__ */ new Set();
- for (const T of t)
- qae(T, n, s, (C, D) => {
- if (!(!C.declarations || rze(n, C))) {
- if (i.has(Hl(C, n))) {
- g.add(C);
- return;
- }
- for (const P of C.declarations)
- if (I2e(P)) {
- const I = _.get(C);
- _.set(C, [
- (I === void 0 || I) && D,
- Wn(P, (F) => Zu(F) || Ad(F) || Hg(F) || gl(F) || va(F) || ii(F))
- ]);
- } else Gae(P) && sze(P) === e && !c.has(C) && u.set(C, D);
- }
- });
- for (const T of _.keys())
- g.add(T);
- const h = /* @__PURE__ */ new Map();
- for (const T of e.statements)
- ss(t, T) || (d && T.transformFlags & 2 && g.delete(d), qae(T, n, s, (C, D) => {
- c.has(C) && h.set(C, D), g.delete(C);
- }));
- return { movedSymbols: c, targetFileImportsFromOldFile: u, oldFileImportsFromTargetFile: h, oldImportsNeededByTargetFile: _, unusedImportsFromOldFile: g };
- function S(T) {
- if (T === void 0)
- return;
- const C = n.getJsxNamespace(T), D = n.resolveName(
- C,
- T,
- 1920,
- /*excludeGlobals*/
- !0
- );
- return D && ut(D.declarations, I2e) ? D : void 0;
- }
- }
- function rze(e, t) {
- return !!e.resolveName(
- t.name,
- /*location*/
- void 0,
- 788968,
- /*excludeGlobals*/
- !1
- );
- }
- function nze(e, t, n, i) {
- let s = e;
- for (let o = 1; ; o++) {
- const c = Bn(n, s + t);
- if (!i.fileExists(c)) return s;
- s = `${e}.${o}`;
- }
- }
- function ize(e, t) {
- return Ch(e, pV) || Ch(t, pV) || "newFile";
- }
- function qae(e, t, n, i) {
- e.forEachChild(function s(o) {
- if (Oe(o) && !og(o)) {
- if (n && !nf(n, o))
- return;
- const c = t.getSymbolAtLocation(o);
- c && i(c, av(o));
- } else
- o.forEachChild(s);
- });
- }
- function Hae(e, t) {
- switch (e.kind) {
- case 262:
- case 263:
- case 267:
- case 266:
- case 265:
- case 264:
- case 271:
- return t(e);
- case 243:
- return Tc(e.declarationList.declarations, (n) => F2e(n.name, t));
- case 244: {
- const { expression: n } = e;
- return dn(n) && Cc(n) === 1 ? t(e) : void 0;
- }
- }
- }
- function I2e(e) {
- switch (e.kind) {
- case 271:
- case 276:
- case 273:
- case 274:
- return !0;
- case 260:
- return O2e(e);
- case 208:
- return ii(e.parent.parent) && O2e(e.parent.parent);
- default:
- return !1;
- }
- }
- function O2e(e) {
- return Si(e.parent.parent.parent) && !!e.initializer && f_(
- e.initializer,
- /*requireStringLiteralLikeArgument*/
- !0
- );
- }
- function Gae(e) {
- return L2e(e) && Si(e.parent) || ii(e) && Si(e.parent.parent.parent);
- }
- function sze(e) {
- return ii(e) ? e.parent.parent.parent : e.parent;
- }
- function F2e(e, t) {
- switch (e.kind) {
- case 80:
- return t(Bs(e.parent, (n) => ii(n) || va(n)));
- case 207:
- case 206:
- return Tc(e.elements, (n) => ml(n) ? void 0 : F2e(n.name, t));
- default:
- return E.assertNever(e, `Unexpected name kind ${e.kind}`);
- }
- }
- function L2e(e) {
- switch (e.kind) {
- case 262:
- case 263:
- case 267:
- case 266:
- case 265:
- case 264:
- case 271:
- return !0;
- default:
- return !1;
- }
- }
- function aze(e, t, n, i, s) {
- var o;
- const c = /* @__PURE__ */ new Set(), _ = (o = i.symbol) == null ? void 0 : o.exports;
- if (_) {
- const d = t.getTypeChecker(), g = /* @__PURE__ */ new Map();
- for (const h of s.all)
- w2e(h) && Gn(
- h,
- 32
- /* Export */
- ) && Hae(h, (S) => {
- var T;
- const C = kd(S) ? (T = _.get(S.symbol.escapedName)) == null ? void 0 : T.declarations : void 0, D = Tc(C, (P) => Nc(P) ? P : vu(P) ? Wn(P.parent.parent, Nc) : void 0);
- D && D.moduleSpecifier && g.set(D, (g.get(D) || /* @__PURE__ */ new Set()).add(S));
- });
- for (const [h, S] of as(g))
- if (h.exportClause && pp(h.exportClause) && Nr(h.exportClause.elements)) {
- const T = h.exportClause.elements, C = Ln(T, (D) => On(Hl(D.symbol, d).declarations, (P) => Gae(P) && S.has(P)) === void 0);
- if (Nr(C) === 0) {
- e.deleteNode(i, h), c.add(h);
- continue;
- }
- Nr(C) < Nr(T) && e.replaceNode(i, h, A.updateExportDeclaration(h, h.modifiers, h.isTypeOnly, A.updateNamedExports(h.exportClause, A.createNodeArray(C, T.hasTrailingComma)), h.moduleSpecifier, h.attributes));
- }
- }
- const u = ob(i.statements, (d) => Nc(d) && !!d.moduleSpecifier && !c.has(d));
- u ? e.insertNodesBefore(
- i,
- u,
- n,
- /*blankLineBetween*/
- !0
- ) : e.insertNodesAfter(i, i.statements[i.statements.length - 1], n);
- }
- function M2e(e, t) {
- if (no(t)) {
- const n = t.symbol.declarations;
- if (n === void 0 || Nr(n) <= 1 || !ss(n, t))
- return;
- const i = n[0], s = n[Nr(n) - 1], o = Ai(n, (u) => Tr(u) === e && bi(u) ? u : void 0), c = ac(e.statements, (u) => u.end >= s.end), _ = ac(e.statements, (u) => u.end >= i.end);
- return { toMove: o, start: _, end: c };
- }
- }
- function $ae(e, t, n) {
- const i = /* @__PURE__ */ new Set();
- for (const s of e.imports) {
- const o = v4(s);
- if (ic(o) && o.importClause && o.importClause.namedBindings && Tm(o.importClause.namedBindings))
- for (const c of o.importClause.namedBindings.elements) {
- const _ = n.getSymbolAtLocation(c.propertyName || c.name);
- _ && i.add(Hl(_, n));
- }
- if (t3(o.parent) && Mf(o.parent.name))
- for (const c of o.parent.name.elements) {
- const _ = n.getSymbolAtLocation(c.propertyName || c.name);
- _ && i.add(Hl(_, n));
- }
- }
- for (const s of t)
- qae(
- s,
- n,
- /*enclosingRange*/
- void 0,
- (o) => {
- const c = Hl(o, n);
- c.valueDeclaration && Tr(c.valueDeclaration).path === e.path && i.add(c);
- }
- );
- return i;
- }
- function Bh(e) {
- return e.error !== void 0;
- }
- function Ev(e, t) {
- return t ? e.substr(0, t.length) === t : !0;
- }
- function Xae(e, t, n, i) {
- return Cn(e) && !Zn(t) && !n.resolveName(
- e.name.text,
- e,
- 111551,
- /*excludeGlobals*/
- !1
- ) && !Di(e.name) && !G2(e.name) ? e.name.text : IS(Zn(t) ? "newProperty" : "newLocal", i);
- }
- function Qae(e, t, n, i, s, o) {
- t.forEach(([c, _], u) => {
- var d;
- const g = Hl(u, i);
- i.isUnknownSymbol(g) ? o.addVerbatimImport(E.checkDefined(_ ?? or((d = u.declarations) == null ? void 0 : d[0], fZ))) : o.addImportFromExportedSymbol(g, c, _);
- }), zae(n, e.fileName, o, s);
- }
- var N9 = "Inline variable", Yae = ms(p.Inline_variable), Zae = {
- name: N9,
- description: Yae,
- kind: "refactor.inline.variable"
- };
- Qg(N9, {
- kinds: [Zae.kind],
- getAvailableActions(e) {
- const {
- file: t,
- program: n,
- preferences: i,
- startPosition: s,
- triggerReason: o
- } = e, c = R2e(t, s, o === "invoked", n);
- return c ? rk.isRefactorErrorInfo(c) ? i.provideRefactorNotApplicableReason ? [{
- name: N9,
- description: Yae,
- actions: [{
- ...Zae,
- notApplicableReason: c.error
- }]
- }] : Ue : [{
- name: N9,
- description: Yae,
- actions: [Zae]
- }] : Ue;
- },
- getEditsForAction(e, t) {
- E.assert(t === N9, "Unexpected refactor invoked");
- const { file: n, program: i, startPosition: s } = e, o = R2e(
- n,
- s,
- /*tryWithReferenceToken*/
- !0,
- i
- );
- if (!o || rk.isRefactorErrorInfo(o))
- return;
- const { references: c, declaration: _, replacement: u } = o;
- return { edits: sn.ChangeTracker.with(e, (g) => {
- for (const h of c) {
- const S = oa(u) && Oe(h) && ag(h.parent);
- S && $C(S) && !lv(S.parent.parent) ? cze(g, n, S, u) : g.replaceNode(n, h, oze(h, u));
- }
- g.delete(n, _);
- }) };
- }
- });
- function R2e(e, t, n, i) {
- var s, o;
- const c = i.getTypeChecker(), _ = h_(e, t), u = _.parent;
- if (Oe(_)) {
- if (O3(u) && p4(u) && Oe(u.name)) {
- if (((s = c.getMergedSymbol(u.symbol).declarations) == null ? void 0 : s.length) !== 1)
- return { error: ms(p.Variables_with_multiple_declarations_cannot_be_inlined) };
- if (j2e(u))
- return;
- const d = B2e(u, c, e);
- return d && { references: d, declaration: u, replacement: u.initializer };
- }
- if (n) {
- let d = c.resolveName(
- _.text,
- _,
- 111551,
- /*excludeGlobals*/
- !1
- );
- if (d = d && c.getMergedSymbol(d), ((o = d?.declarations) == null ? void 0 : o.length) !== 1)
- return { error: ms(p.Variables_with_multiple_declarations_cannot_be_inlined) };
- const g = d.declarations[0];
- if (!O3(g) || !p4(g) || !Oe(g.name) || j2e(g))
- return;
- const h = B2e(g, c, e);
- return h && { references: h, declaration: g, replacement: g.initializer };
- }
- return { error: ms(p.Could_not_find_variable_to_inline) };
- }
- }
- function j2e(e) {
- const t = Bs(e.parent.parent, yc);
- return ut(t.modifiers, Cx);
- }
- function B2e(e, t, n) {
- const i = [], s = Eo.Core.eachSymbolReferenceInFile(e.name, t, n, (o) => {
- if (Eo.isWriteAccessForReference(o) && !uu(o.parent) || vu(o.parent) || wo(o.parent) || Lb(o.parent) || vw(e, o.pos))
- return !0;
- i.push(o);
- });
- return i.length === 0 || s ? void 0 : i;
- }
- function oze(e, t) {
- t = Ja(t);
- const { parent: n } = e;
- return _t(n) && (E4(t) < E4(n) || l9(n)) || ys(t) && (mb(n) || Cn(n)) || Cn(n) && (d_(t) || Ks(t)) ? A.createParenthesizedExpression(t) : Oe(e) && uu(n) ? A.createPropertyAssignment(e, t) : t;
- }
- function cze(e, t, n, i) {
- const s = n.parent, o = s.templateSpans.indexOf(n), c = o === 0 ? s.head : s.templateSpans[o - 1];
- e.replaceRangeWithText(
- t,
- {
- pos: c.getEnd() - 2,
- end: n.literal.getStart() + 1
- },
- i.text.replace(/\\/g, "\\\\").replace(/`/g, "\\`")
- );
- }
- var I9 = "Move to a new file", Kae = ms(p.Move_to_a_new_file), eoe = {
- name: I9,
- description: Kae,
- kind: "refactor.move.newFile"
- };
- Qg(I9, {
- kinds: [eoe.kind],
- getAvailableActions: function(t) {
- const n = C8(t), i = t.file;
- if (t.triggerReason === "implicit" && t.endPosition !== void 0) {
- const s = or(xi(i, t.startPosition), ek), o = or(xi(i, t.endPosition), ek);
- if (s && !Si(s) && o && !Si(o))
- return Ue;
- }
- if (t.preferences.allowTextChangesInNewFiles && n) {
- const s = t.file, o = {
- start: { line: Qs(s, n.all[0].getStart(s)).line, offset: Qs(s, n.all[0].getStart(s)).character },
- end: { line: Qs(s, _a(n.all).end).line, offset: Qs(s, _a(n.all).end).character }
- };
- return [{ name: I9, description: Kae, actions: [{ ...eoe, range: o }] }];
- }
- return t.preferences.provideRefactorNotApplicableReason ? [{ name: I9, description: Kae, actions: [{ ...eoe, notApplicableReason: ms(p.Selection_is_not_a_valid_statement_or_statements) }] }] : Ue;
- },
- getEditsForAction: function(t, n) {
- E.assert(n === I9, "Wrong refactor invoked");
- const i = E.checkDefined(C8(t));
- return { edits: sn.ChangeTracker.with(t, (o) => lze(t.file, t.program, i, o, t.host, t, t.preferences)), renameFilename: void 0, renameLocation: void 0 };
- }
- });
- function lze(e, t, n, i, s, o, c) {
- const _ = t.getTypeChecker(), u = A9(e, n.all, _), d = Uae(e, t, s, n), g = T9(d, e.externalModuleIndicator ? 99 : e.commonJsModuleIndicator ? 1 : void 0, t, s), h = xu.createImportAdder(e, o.program, o.preferences, o.host), S = xu.createImportAdder(g, o.program, o.preferences, o.host);
- jae(e, g, u, i, n, t, s, c, S, h), Bae(t, i, e.fileName, d, S0(s));
- }
- var uze = {}, toe = "Convert overload list to single signature", J2e = ms(p.Convert_overload_list_to_single_signature), z2e = {
- name: toe,
- description: J2e,
- kind: "refactor.rewrite.function.overloadList"
- };
- Qg(toe, {
- kinds: [z2e.kind],
- getEditsForAction: fze,
- getAvailableActions: _ze
- });
- function _ze(e) {
- const { file: t, startPosition: n, program: i } = e;
- return U2e(t, n, i) ? [{
- name: toe,
- description: J2e,
- actions: [z2e]
- }] : Ue;
- }
- function fze(e) {
- const { file: t, startPosition: n, program: i } = e, s = U2e(t, n, i);
- if (!s) return;
- const o = i.getTypeChecker(), c = s[s.length - 1];
- let _ = c;
- switch (c.kind) {
- case 173: {
- _ = A.updateMethodSignature(
- c,
- c.modifiers,
- c.name,
- c.questionToken,
- c.typeParameters,
- d(s),
- c.type
- );
- break;
- }
- case 174: {
- _ = A.updateMethodDeclaration(
- c,
- c.modifiers,
- c.asteriskToken,
- c.name,
- c.questionToken,
- c.typeParameters,
- d(s),
- c.type,
- c.body
- );
- break;
- }
- case 179: {
- _ = A.updateCallSignature(
- c,
- c.typeParameters,
- d(s),
- c.type
- );
- break;
- }
- case 176: {
- _ = A.updateConstructorDeclaration(
- c,
- c.modifiers,
- d(s),
- c.body
- );
- break;
- }
- case 180: {
- _ = A.updateConstructSignature(
- c,
- c.typeParameters,
- d(s),
- c.type
- );
- break;
- }
- case 262: {
- _ = A.updateFunctionDeclaration(
- c,
- c.modifiers,
- c.asteriskToken,
- c.name,
- c.typeParameters,
- d(s),
- c.type,
- c.body
- );
- break;
- }
- default:
- return E.failBadSyntaxKind(c, "Unhandled signature kind in overload list conversion refactoring");
- }
- if (_ === c)
- return;
- return { renameFilename: void 0, renameLocation: void 0, edits: sn.ChangeTracker.with(e, (S) => {
- S.replaceNodeRange(t, s[0], s[s.length - 1], _);
- }) };
- function d(S) {
- const T = S[S.length - 1];
- return no(T) && T.body && (S = S.slice(0, S.length - 1)), A.createNodeArray([
- A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- A.createToken(
- 26
- /* DotDotDotToken */
- ),
- "args",
- /*questionToken*/
- void 0,
- A.createUnionTypeNode(lr(S, g))
- )
- ]);
- }
- function g(S) {
- const T = lr(S.parameters, h);
- return an(
- A.createTupleTypeNode(T),
- ut(T, (C) => !!Nr(UC(C))) ? 0 : 1
- /* SingleLine */
- );
- }
- function h(S) {
- E.assert(Oe(S.name));
- const T = lt(
- A.createNamedTupleMember(
- S.dotDotDotToken,
- S.name,
- S.questionToken,
- S.type || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- ),
- S
- ), C = S.symbol && S.symbol.getDocumentationComment(o);
- if (C) {
- const D = P8(C);
- D.length && ov(T, [{
- text: `*
-${D.split(`
-`).map((P) => ` * ${P}`).join(`
-`)}
- `,
- kind: 3,
- pos: -1,
- end: -1,
- hasTrailingNewLine: !0,
- hasLeadingNewline: !0
- }]);
- }
- return T;
- }
- }
- function W2e(e) {
- switch (e.kind) {
- case 173:
- case 174:
- case 179:
- case 176:
- case 180:
- case 262:
- return !0;
- }
- return !1;
- }
- function U2e(e, t, n) {
- const i = xi(e, t), s = or(i, W2e);
- if (!s || no(s) && s.body && VD(s.body, t))
- return;
- const o = n.getTypeChecker(), c = s.symbol;
- if (!c)
- return;
- const _ = c.declarations;
- if (Nr(_) <= 1 || !Mi(_, (S) => Tr(S) === e) || !W2e(_[0]))
- return;
- const u = _[0].kind;
- if (!Mi(_, (S) => S.kind === u))
- return;
- const d = _;
- if (ut(d, (S) => !!S.typeParameters || ut(S.parameters, (T) => !!T.modifiers || !Oe(T.name))))
- return;
- const g = Ai(d, (S) => o.getSignatureFromDeclaration(S));
- if (Nr(g) !== Nr(_))
- return;
- const h = o.getReturnTypeOfSignature(g[0]);
- if (Mi(g, (S) => o.getReturnTypeOfSignature(S) === h))
- return d;
- }
- var roe = "Add or remove braces in an arrow function", V2e = ms(p.Add_or_remove_braces_in_an_arrow_function), pq = {
- name: "Add braces to arrow function",
- description: ms(p.Add_braces_to_arrow_function),
- kind: "refactor.rewrite.arrow.braces.add"
- }, O9 = {
- name: "Remove braces from arrow function",
- description: ms(p.Remove_braces_from_arrow_function),
- kind: "refactor.rewrite.arrow.braces.remove"
- };
- Qg(roe, {
- kinds: [O9.kind],
- getEditsForAction: dze,
- getAvailableActions: pze
- });
- function pze(e) {
- const { file: t, startPosition: n, triggerReason: i } = e, s = q2e(t, n, i === "invoked");
- return s ? Bh(s) ? e.preferences.provideRefactorNotApplicableReason ? [{
- name: roe,
- description: V2e,
- actions: [
- { ...pq, notApplicableReason: s.error },
- { ...O9, notApplicableReason: s.error }
- ]
- }] : Ue : [{
- name: roe,
- description: V2e,
- actions: [
- s.addBraces ? pq : O9
- ]
- }] : Ue;
- }
- function dze(e, t) {
- const { file: n, startPosition: i } = e, s = q2e(n, i);
- E.assert(s && !Bh(s), "Expected applicable refactor info");
- const { expression: o, returnStatement: c, func: _ } = s;
- let u;
- if (t === pq.name) {
- const g = A.createReturnStatement(o);
- u = A.createBlock(
- [g],
- /*multiLine*/
- !0
- ), D6(
- o,
- g,
- n,
- 3,
- /*hasTrailingNewLine*/
- !0
- );
- } else if (t === O9.name && c) {
- const g = o || A.createVoidZero();
- u = l9(g) ? A.createParenthesizedExpression(g) : g, p8(
- c,
- u,
- n,
- 3,
- /*hasTrailingNewLine*/
- !1
- ), D6(
- c,
- u,
- n,
- 3,
- /*hasTrailingNewLine*/
- !1
- ), ZD(
- c,
- u,
- n,
- 3,
- /*hasTrailingNewLine*/
- !1
- );
- } else
- E.fail("invalid action");
- return { renameFilename: void 0, renameLocation: void 0, edits: sn.ChangeTracker.with(e, (g) => {
- g.replaceNode(n, _.body, u);
- }) };
- }
- function q2e(e, t, n = !0, i) {
- const s = xi(e, t), o = yf(s);
- if (!o)
- return {
- error: ms(p.Could_not_find_a_containing_arrow_function)
- };
- if (!Co(o))
- return {
- error: ms(p.Containing_function_is_not_an_arrow_function)
- };
- if (!(!nf(o, s) || nf(o.body, s) && !n)) {
- if (Ev(pq.kind, i) && _t(o.body))
- return { func: o, addBraces: !0, expression: o.body };
- if (Ev(O9.kind, i) && Cs(o.body) && o.body.statements.length === 1) {
- const c = xa(o.body.statements);
- if (Up(c)) {
- const _ = c.expression && Ks(MC(
- c.expression,
- /*stopAtCallExpressions*/
- !1
- )) ? A.createParenthesizedExpression(c.expression) : c.expression;
- return { func: o, addBraces: !1, expression: _, returnStatement: c };
- }
- }
- }
- }
- var mze = {}, H2e = "Convert arrow function or function expression", gze = ms(p.Convert_arrow_function_or_function_expression), F9 = {
- name: "Convert to anonymous function",
- description: ms(p.Convert_to_anonymous_function),
- kind: "refactor.rewrite.function.anonymous"
- }, L9 = {
- name: "Convert to named function",
- description: ms(p.Convert_to_named_function),
- kind: "refactor.rewrite.function.named"
- }, M9 = {
- name: "Convert to arrow function",
- description: ms(p.Convert_to_arrow_function),
- kind: "refactor.rewrite.function.arrow"
- };
- Qg(H2e, {
- kinds: [
- F9.kind,
- L9.kind,
- M9.kind
- ],
- getEditsForAction: yze,
- getAvailableActions: hze
- });
- function hze(e) {
- const { file: t, startPosition: n, program: i, kind: s } = e, o = $2e(t, n, i);
- if (!o) return Ue;
- const { selectedVariableDeclaration: c, func: _ } = o, u = [], d = [];
- if (Ev(L9.kind, s)) {
- const g = c || Co(_) && ii(_.parent) ? void 0 : ms(p.Could_not_convert_to_named_function);
- g ? d.push({ ...L9, notApplicableReason: g }) : u.push(L9);
- }
- if (Ev(F9.kind, s)) {
- const g = !c && Co(_) ? void 0 : ms(p.Could_not_convert_to_anonymous_function);
- g ? d.push({ ...F9, notApplicableReason: g }) : u.push(F9);
- }
- if (Ev(M9.kind, s)) {
- const g = vo(_) ? void 0 : ms(p.Could_not_convert_to_arrow_function);
- g ? d.push({ ...M9, notApplicableReason: g }) : u.push(M9);
- }
- return [{
- name: H2e,
- description: gze,
- actions: u.length === 0 && e.preferences.provideRefactorNotApplicableReason ? d : u
- }];
- }
- function yze(e, t) {
- const { file: n, startPosition: i, program: s } = e, o = $2e(n, i, s);
- if (!o) return;
- const { func: c } = o, _ = [];
- switch (t) {
- case F9.name:
- _.push(...Tze(e, c));
- break;
- case L9.name:
- const u = Sze(c);
- if (!u) return;
- _.push(...xze(e, c, u));
- break;
- case M9.name:
- if (!vo(c)) return;
- _.push(...kze(e, c));
- break;
- default:
- return E.fail("invalid action");
- }
- return { renameFilename: void 0, renameLocation: void 0, edits: _ };
- }
- function G2e(e) {
- let t = !1;
- return e.forEachChild(function n(i) {
- if (S6(i)) {
- t = !0;
- return;
- }
- !Zn(i) && !Ec(i) && !vo(i) && bs(i, n);
- }), t;
- }
- function $2e(e, t, n) {
- const i = xi(e, t), s = n.getTypeChecker(), o = bze(e, s, i.parent);
- if (o && !G2e(o.body) && !s.containsArgumentsReference(o))
- return { selectedVariableDeclaration: !0, func: o };
- const c = yf(i);
- if (c && (vo(c) || Co(c)) && !nf(c.body, i) && !G2e(c.body) && !s.containsArgumentsReference(c))
- return vo(c) && Q2e(e, s, c) ? void 0 : { selectedVariableDeclaration: !1, func: c };
- }
- function vze(e) {
- return ii(e) || Fl(e) && e.declarations.length === 1;
- }
- function bze(e, t, n) {
- if (!vze(n))
- return;
- const s = (ii(n) ? n : xa(n.declarations)).initializer;
- if (s && (Co(s) || vo(s) && !Q2e(e, t, s)))
- return s;
- }
- function X2e(e) {
- if (_t(e)) {
- const t = A.createReturnStatement(e), n = e.getSourceFile();
- return lt(t, e), af(t), p8(
- e,
- t,
- n,
- /*commentKind*/
- void 0,
- /*hasTrailingNewLine*/
- !0
- ), A.createBlock(
- [t],
- /*multiLine*/
- !0
- );
- } else
- return e;
- }
- function Sze(e) {
- const t = e.parent;
- if (!ii(t) || !p4(t)) return;
- const n = t.parent, i = n.parent;
- if (!(!Fl(n) || !yc(i) || !Oe(t.name)))
- return { variableDeclaration: t, variableDeclarationList: n, statement: i, name: t.name };
- }
- function Tze(e, t) {
- const { file: n } = e, i = X2e(t.body), s = A.createFunctionExpression(
- t.modifiers,
- t.asteriskToken,
- /*name*/
- void 0,
- t.typeParameters,
- t.parameters,
- t.type,
- i
- );
- return sn.ChangeTracker.with(e, (o) => o.replaceNode(n, t, s));
- }
- function xze(e, t, n) {
- const { file: i } = e, s = X2e(t.body), { variableDeclaration: o, variableDeclarationList: c, statement: _, name: u } = n;
- EV(_);
- const d = U1(o) & 32 | Mu(t), g = A.createModifiersFromModifierFlags(d), h = A.createFunctionDeclaration(Nr(g) ? g : void 0, t.asteriskToken, u, t.typeParameters, t.parameters, t.type, s);
- return c.declarations.length === 1 ? sn.ChangeTracker.with(e, (S) => S.replaceNode(i, _, h)) : sn.ChangeTracker.with(e, (S) => {
- S.delete(i, o), S.insertNodeAfter(i, _, h);
- });
- }
- function kze(e, t) {
- const { file: n } = e, s = t.body.statements[0];
- let o;
- Cze(t.body, s) ? (o = s.expression, af(o), NS(s, o)) : o = t.body;
- const c = A.createArrowFunction(t.modifiers, t.typeParameters, t.parameters, t.type, A.createToken(
- 39
- /* EqualsGreaterThanToken */
- ), o);
- return sn.ChangeTracker.with(e, (_) => _.replaceNode(n, t, c));
- }
- function Cze(e, t) {
- return e.statements.length === 1 && Up(t) && !!t.expression;
- }
- function Q2e(e, t, n) {
- return !!n.name && Eo.Core.isSymbolReferencedInFile(n.name, t, e);
- }
- var Eze = {}, dq = "Convert parameters to destructured object", Dze = 1, Y2e = ms(p.Convert_parameters_to_destructured_object), Z2e = {
- name: dq,
- description: Y2e,
- kind: "refactor.rewrite.parameters.toDestructured"
- };
- Qg(dq, {
- kinds: [Z2e.kind],
- getEditsForAction: wze,
- getAvailableActions: Pze
- });
- function Pze(e) {
- const { file: t, startPosition: n } = e;
- return Gu(t) || !tSe(t, n, e.program.getTypeChecker()) ? Ue : [{
- name: dq,
- description: Y2e,
- actions: [Z2e]
- }];
- }
- function wze(e, t) {
- E.assert(t === dq, "Unexpected action name");
- const { file: n, startPosition: i, program: s, cancellationToken: o, host: c } = e, _ = tSe(n, i, s.getTypeChecker());
- if (!_ || !o) return;
- const u = Nze(_, s, o);
- return u.valid ? { renameFilename: void 0, renameLocation: void 0, edits: sn.ChangeTracker.with(e, (g) => Aze(n, s, c, g, _, u)) } : { edits: [] };
- }
- function Aze(e, t, n, i, s, o) {
- const c = o.signature, _ = lr(sSe(s, t, n), (g) => Ja(g));
- if (c) {
- const g = lr(sSe(c, t, n), (h) => Ja(h));
- d(c, g);
- }
- d(s, _);
- const u = IE(
- o.functionCalls,
- /*comparer*/
- (g, h) => ho(g.pos, h.pos)
- );
- for (const g of u)
- if (g.arguments && g.arguments.length) {
- const h = Ja(
- zze(s, g.arguments),
- /*includeTrivia*/
- !0
- );
- i.replaceNodeRange(
- Tr(g),
- xa(g.arguments),
- _a(g.arguments),
- h,
- { leadingTriviaOption: sn.LeadingTriviaOption.IncludeAll, trailingTriviaOption: sn.TrailingTriviaOption.Include }
- );
- }
- function d(g, h) {
- i.replaceNodeRangeWithNodes(
- e,
- xa(g.parameters),
- _a(g.parameters),
- h,
- {
- joiner: ", ",
- // indentation is set to 0 because otherwise the object parameter will be indented if there is a `this` parameter
- indentation: 0,
- leadingTriviaOption: sn.LeadingTriviaOption.IncludeAll,
- trailingTriviaOption: sn.TrailingTriviaOption.Include
- }
- );
- }
- }
- function Nze(e, t, n) {
- const i = Uze(e), s = Qo(e) ? Wze(e) : [], o = cb([...i, ...s], by), c = t.getTypeChecker(), _ = ta(
- o,
- /*mapfn*/
- (h) => Eo.getReferenceEntriesForNode(-1, h, t, t.getSourceFiles(), n)
- ), u = d(_);
- return Mi(
- u.declarations,
- /*callback*/
- (h) => ss(o, h)
- ) || (u.valid = !1), u;
- function d(h) {
- const S = { accessExpressions: [], typeUsages: [] }, T = { functionCalls: [], declarations: [], classReferences: S, valid: !0 }, C = lr(i, g), D = lr(s, g), P = Qo(e), I = lr(i, (F) => noe(F, c));
- for (const F of h) {
- if (F.kind === Eo.EntryKind.Span) {
- T.valid = !1;
- continue;
- }
- if (ss(I, g(F.node))) {
- if (Lze(F.node.parent)) {
- T.signature = F.node.parent;
- continue;
- }
- const B = eSe(F);
- if (B) {
- T.functionCalls.push(B);
- continue;
- }
- }
- const O = noe(F.node, c);
- if (O && ss(I, O)) {
- const B = ioe(F);
- if (B) {
- T.declarations.push(B);
- continue;
- }
- }
- if (ss(C, g(F.node)) || UD(F.node)) {
- if (K2e(F))
- continue;
- const z = ioe(F);
- if (z) {
- T.declarations.push(z);
- continue;
- }
- const X = eSe(F);
- if (X) {
- T.functionCalls.push(X);
- continue;
- }
- }
- if (P && ss(D, g(F.node))) {
- if (K2e(F))
- continue;
- const z = ioe(F);
- if (z) {
- T.declarations.push(z);
- continue;
- }
- const X = Ize(F);
- if (X) {
- S.accessExpressions.push(X);
- continue;
- }
- if (Xc(e.parent)) {
- const q = Oze(F);
- if (q) {
- S.typeUsages.push(q);
- continue;
- }
- }
- }
- T.valid = !1;
- }
- return T;
- }
- function g(h) {
- const S = c.getSymbolAtLocation(h);
- return S && kV(S, c);
- }
- }
- function noe(e, t) {
- const n = w8(e);
- if (n) {
- const i = t.getContextualTypeForObjectLiteralElement(n), s = i?.getSymbol();
- if (s && !(gc(s) & 6))
- return s;
- }
- }
- function K2e(e) {
- const t = e.node;
- if (Zu(t.parent) || Ad(t.parent) || gl(t.parent) || Hg(t.parent) || vu(t.parent) || wo(t.parent))
- return t;
- }
- function ioe(e) {
- if (ql(e.node.parent))
- return e.node;
- }
- function eSe(e) {
- if (e.node.parent) {
- const t = e.node, n = t.parent;
- switch (n.kind) {
- case 213:
- case 214:
- const i = Wn(n, am);
- if (i && i.expression === t)
- return i;
- break;
- case 211:
- const s = Wn(n, Cn);
- if (s && s.parent && s.name === t) {
- const c = Wn(s.parent, am);
- if (c && c.expression === s)
- return c;
- }
- break;
- case 212:
- const o = Wn(n, ko);
- if (o && o.parent && o.argumentExpression === t) {
- const c = Wn(o.parent, am);
- if (c && c.expression === o)
- return c;
- }
- break;
- }
- }
- }
- function Ize(e) {
- if (e.node.parent) {
- const t = e.node, n = t.parent;
- switch (n.kind) {
- case 211:
- const i = Wn(n, Cn);
- if (i && i.expression === t)
- return i;
- break;
- case 212:
- const s = Wn(n, ko);
- if (s && s.expression === t)
- return s;
- break;
- }
- }
- }
- function Oze(e) {
- const t = e.node;
- if (wS(t) === 2 || Q7(t.parent))
- return t;
- }
- function tSe(e, t, n) {
- const i = T6(e, t), s = NZ(i);
- if (!Fze(i) && s && Mze(s, n) && nf(s, i) && !(s.body && nf(s.body, i)))
- return s;
- }
- function Fze(e) {
- const t = or(e, uC);
- if (t) {
- const n = or(t, (i) => !uC(i));
- return !!n && no(n);
- }
- return !1;
- }
- function Lze(e) {
- return vm(e) && (Xl(e.parent) || Qu(e.parent));
- }
- function Mze(e, t) {
- var n;
- if (!Rze(e.parameters, t)) return !1;
- switch (e.kind) {
- case 262:
- return rSe(e) && R9(e, t);
- case 174:
- if (Ks(e.parent)) {
- const i = noe(e.name, t);
- return ((n = i?.declarations) == null ? void 0 : n.length) === 1 && R9(e, t);
- }
- return R9(e, t);
- case 176:
- return Xc(e.parent) ? rSe(e.parent) && R9(e, t) : nSe(e.parent.parent) && R9(e, t);
- case 218:
- case 219:
- return nSe(e.parent);
- }
- return !1;
- }
- function R9(e, t) {
- return !!e.body && !t.isImplementationOfOverload(e);
- }
- function rSe(e) {
- return e.name ? !0 : !!k6(
- e,
- 90
- /* DefaultKeyword */
- );
- }
- function Rze(e, t) {
- return Bze(e) >= Dze && Mi(
- e,
- /*callback*/
- (n) => jze(n, t)
- );
- }
- function jze(e, t) {
- if (rg(e)) {
- const n = t.getTypeAtLocation(e);
- if (!t.isArrayType(n) && !t.isTupleType(n)) return !1;
- }
- return !e.modifiers && Oe(e.name);
- }
- function nSe(e) {
- return ii(e) && hC(e) && Oe(e.name) && !e.type;
- }
- function soe(e) {
- return e.length > 0 && S6(e[0].name);
- }
- function Bze(e) {
- return soe(e) ? e.length - 1 : e.length;
- }
- function iSe(e) {
- return soe(e) && (e = A.createNodeArray(e.slice(1), e.hasTrailingComma)), e;
- }
- function Jze(e, t) {
- return Oe(t) && Jp(t) === e ? A.createShorthandPropertyAssignment(e) : A.createPropertyAssignment(e, t);
- }
- function zze(e, t) {
- const n = iSe(e.parameters), i = rg(_a(n)), s = i ? t.slice(0, n.length - 1) : t, o = lr(s, (_, u) => {
- const d = mq(n[u]), g = Jze(d, _);
- return af(g.name), Qc(g) && af(g.initializer), NS(_, g), g;
- });
- if (i && t.length >= n.length) {
- const _ = t.slice(n.length - 1), u = A.createPropertyAssignment(mq(_a(n)), A.createArrayLiteralExpression(_));
- o.push(u);
- }
- return A.createObjectLiteralExpression(
- o,
- /*multiLine*/
- !1
- );
- }
- function sSe(e, t, n) {
- const i = t.getTypeChecker(), s = iSe(e.parameters), o = lr(s, g), c = A.createObjectBindingPattern(o), _ = h(s);
- let u;
- Mi(s, C) && (u = A.createObjectLiteralExpression());
- const d = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- c,
- /*questionToken*/
- void 0,
- _,
- u
- );
- if (soe(e.parameters)) {
- const D = e.parameters[0], P = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- D.name,
- /*questionToken*/
- void 0,
- D.type
- );
- return af(P.name), NS(D.name, P.name), D.type && (af(P.type), NS(D.type, P.type)), A.createNodeArray([P, d]);
- }
- return A.createNodeArray([d]);
- function g(D) {
- const P = A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- void 0,
- mq(D),
- rg(D) && C(D) ? A.createArrayLiteralExpression() : D.initializer
- );
- return af(P), D.initializer && P.initializer && NS(D.initializer, P.initializer), P;
- }
- function h(D) {
- const P = lr(D, S);
- return hm(
- A.createTypeLiteralNode(P),
- 1
- /* SingleLine */
- );
- }
- function S(D) {
- let P = D.type;
- !P && (D.initializer || rg(D)) && (P = T(D));
- const I = A.createPropertySignature(
- /*modifiers*/
- void 0,
- mq(D),
- C(D) ? A.createToken(
- 58
- /* QuestionToken */
- ) : D.questionToken,
- P
- );
- return af(I), NS(D.name, I.name), D.type && I.type && NS(D.type, I.type), I;
- }
- function T(D) {
- const P = i.getTypeAtLocation(D);
- return eP(P, D, t, n);
- }
- function C(D) {
- if (rg(D)) {
- const P = i.getTypeAtLocation(D);
- return !i.isTupleType(P);
- }
- return i.isOptionalParameter(D);
- }
- }
- function mq(e) {
- return Jp(e.name);
- }
- function Wze(e) {
- switch (e.parent.kind) {
- case 263:
- const t = e.parent;
- return t.name ? [t.name] : [E.checkDefined(
- k6(
- t,
- 90
- /* DefaultKeyword */
- ),
- "Nameless class declaration should be a default export"
- )];
- case 231:
- const i = e.parent, s = e.parent.parent, o = i.name;
- return o ? [o, s.name] : [s.name];
- }
- }
- function Uze(e) {
- switch (e.kind) {
- case 262:
- return e.name ? [e.name] : [E.checkDefined(
- k6(
- e,
- 90
- /* DefaultKeyword */
- ),
- "Nameless function declaration should be a default export"
- )];
- case 174:
- return [e.name];
- case 176:
- const n = E.checkDefined(
- Ya(e, 137, e.getSourceFile()),
- "Constructor declaration should have constructor keyword"
- );
- return e.parent.kind === 231 ? [e.parent.parent.name, n] : [n];
- case 219:
- return [e.parent.name];
- case 218:
- return e.name ? [e.name, e.parent.name] : [e.parent.name];
- default:
- return E.assertNever(e, `Unexpected function declaration kind ${e.kind}`);
- }
- }
- var Vze = {}, aoe = "Convert to template string", ooe = ms(p.Convert_to_template_string), coe = {
- name: aoe,
- description: ooe,
- kind: "refactor.rewrite.string"
- };
- Qg(aoe, {
- kinds: [coe.kind],
- getEditsForAction: Hze,
- getAvailableActions: qze
- });
- function qze(e) {
- const { file: t, startPosition: n } = e, i = aSe(t, n), s = loe(i), o = oa(s), c = { name: aoe, description: ooe, actions: [] };
- return o && e.triggerReason !== "invoked" ? Ue : Ed(s) && (o || dn(s) && uoe(s).isValidConcatenation) ? (c.actions.push(coe), [c]) : e.preferences.provideRefactorNotApplicableReason ? (c.actions.push({ ...coe, notApplicableReason: ms(p.Can_only_convert_string_concatenations_and_string_literals) }), [c]) : Ue;
- }
- function aSe(e, t) {
- const n = xi(e, t), i = loe(n);
- return !uoe(i).isValidConcatenation && Yu(i.parent) && dn(i.parent.parent) ? i.parent.parent : n;
- }
- function Hze(e, t) {
- const { file: n, startPosition: i } = e, s = aSe(n, i);
- switch (t) {
- case ooe:
- return { edits: Gze(e, s) };
- default:
- return E.fail("invalid action");
- }
- }
- function Gze(e, t) {
- const n = loe(t), i = e.file, s = Zze(uoe(n), i), o = ky(i.text, n.end);
- if (o) {
- const c = o[o.length - 1], _ = { pos: o[0].pos, end: c.end };
- return sn.ChangeTracker.with(e, (u) => {
- u.deleteRange(i, _), u.replaceNode(i, n, s);
- });
- } else
- return sn.ChangeTracker.with(e, (c) => c.replaceNode(i, n, s));
- }
- function $ze(e) {
- return !(e.operatorToken.kind === 64 || e.operatorToken.kind === 65);
- }
- function loe(e) {
- return or(e.parent, (n) => {
- switch (n.kind) {
- case 211:
- case 212:
- return !1;
- case 228:
- case 226:
- return !(dn(n.parent) && $ze(n.parent));
- default:
- return "quit";
- }
- }) || e;
- }
- function uoe(e) {
- const t = (c) => {
- if (!dn(c))
- return { nodes: [c], operators: [], validOperators: !0, hasString: oa(c) || fS(c) };
- const { nodes: _, operators: u, hasString: d, validOperators: g } = t(c.left);
- if (!(d || oa(c.right) || X5(c.right)))
- return { nodes: [c], operators: [], hasString: !1, validOperators: !0 };
- const h = c.operatorToken.kind === 40, S = g && h;
- return _.push(c.right), u.push(c.operatorToken), { nodes: _, operators: u, hasString: !0, validOperators: S };
- }, { nodes: n, operators: i, validOperators: s, hasString: o } = t(e);
- return { nodes: n, operators: i, isValidConcatenation: s && o };
- }
- var Xze = (e, t) => (n, i) => {
- n < e.length && ZD(
- e[n],
- i,
- t,
- 3,
- /*hasTrailingNewLine*/
- !1
- );
- }, Qze = (e, t, n) => (i, s) => {
- for (; i.length > 0; ) {
- const o = i.shift();
- ZD(
- e[o],
- s,
- t,
- 3,
- /*hasTrailingNewLine*/
- !1
- ), n(o, s);
- }
- };
- function Yze(e) {
- return e.replace(/\\.|[$`]/g, (t) => t[0] === "\\" ? t : "\\" + t);
- }
- function oSe(e) {
- const t = kx(e) || PJ(e) ? -2 : -1;
- return nc(e).slice(1, t);
- }
- function cSe(e, t) {
- const n = [];
- let i = "", s = "";
- for (; e < t.length; ) {
- const o = t[e];
- if (Xa(o))
- i += o.text, s += Yze(nc(o).slice(1, -1)), n.push(e), e++;
- else if (X5(o)) {
- i += o.head.text, s += oSe(o.head);
- break;
- } else
- break;
- }
- return [e, i, s, n];
- }
- function Zze({ nodes: e, operators: t }, n) {
- const i = Xze(t, n), s = Qze(e, n, i), [o, c, _, u] = cSe(0, e);
- if (o === e.length) {
- const h = A.createNoSubstitutionTemplateLiteral(c, _);
- return s(u, h), h;
- }
- const d = [], g = A.createTemplateHead(c, _);
- s(u, g);
- for (let h = o; h < e.length; h++) {
- const S = Kze(e[h]);
- i(h, S);
- const [T, C, D, P] = cSe(h + 1, e);
- h = T - 1;
- const I = h === e.length - 1;
- if (X5(S)) {
- const F = lr(S.templateSpans, (O, B) => {
- lSe(O);
- const z = B === S.templateSpans.length - 1, X = O.literal.text + (z ? C : ""), q = oSe(O.literal) + (z ? D : "");
- return A.createTemplateSpan(
- O.expression,
- I && z ? A.createTemplateTail(X, q) : A.createTemplateMiddle(X, q)
- );
- });
- d.push(...F);
- } else {
- const F = I ? A.createTemplateTail(C, D) : A.createTemplateMiddle(C, D);
- s(P, F), d.push(A.createTemplateSpan(S, F));
- }
- }
- return A.createTemplateExpression(g, d);
- }
- function lSe(e) {
- const t = e.getSourceFile();
- ZD(
- e,
- e.expression,
- t,
- 3,
- /*hasTrailingNewLine*/
- !1
- ), p8(
- e.expression,
- e.expression,
- t,
- 3,
- /*hasTrailingNewLine*/
- !1
- );
- }
- function Kze(e) {
- return Yu(e) && (lSe(e), e = e.expression), e;
- }
- var eWe = {}, gq = "Convert to optional chain expression", _oe = ms(p.Convert_to_optional_chain_expression), foe = {
- name: gq,
- description: _oe,
- kind: "refactor.rewrite.expression.optionalChain"
- };
- Qg(gq, {
- kinds: [foe.kind],
- getEditsForAction: rWe,
- getAvailableActions: tWe
- });
- function tWe(e) {
- const t = uSe(e, e.triggerReason === "invoked");
- return t ? Bh(t) ? e.preferences.provideRefactorNotApplicableReason ? [{
- name: gq,
- description: _oe,
- actions: [{ ...foe, notApplicableReason: t.error }]
- }] : Ue : [{
- name: gq,
- description: _oe,
- actions: [foe]
- }] : Ue;
- }
- function rWe(e, t) {
- const n = uSe(e);
- return E.assert(n && !Bh(n), "Expected applicable refactor info"), { edits: sn.ChangeTracker.with(e, (s) => uWe(e.file, e.program.getTypeChecker(), s, n)), renameFilename: void 0, renameLocation: void 0 };
- }
- function hq(e) {
- return dn(e) || Ix(e);
- }
- function nWe(e) {
- return Pl(e) || Up(e) || yc(e);
- }
- function yq(e) {
- return hq(e) || nWe(e);
- }
- function uSe(e, t = !0) {
- const { file: n, program: i } = e, s = Kx(e), o = s.length === 0;
- if (o && !t) return;
- const c = xi(n, s.start), _ = r8(n, s.start + s.length), u = kc(c.pos, _ && _.end >= c.pos ? _.getEnd() : c.getEnd()), d = o ? cWe(c) : oWe(c, u), g = d && yq(d) ? lWe(d) : void 0;
- if (!g) return { error: ms(p.Could_not_find_convertible_access_expression) };
- const h = i.getTypeChecker();
- return Ix(g) ? iWe(g, h) : sWe(g);
- }
- function iWe(e, t) {
- const n = e.condition, i = doe(e.whenTrue);
- if (!i || t.isNullableType(t.getTypeAtLocation(i)))
- return { error: ms(p.Could_not_find_convertible_access_expression) };
- if ((Cn(n) || Oe(n)) && poe(n, i.expression))
- return { finalExpression: i, occurrences: [n], expression: e };
- if (dn(n)) {
- const s = _Se(i.expression, n);
- return s ? { finalExpression: i, occurrences: s, expression: e } : { error: ms(p.Could_not_find_matching_access_expressions) };
- }
- }
- function sWe(e) {
- if (e.operatorToken.kind !== 56)
- return { error: ms(p.Can_only_convert_logical_AND_access_chains) };
- const t = doe(e.right);
- if (!t) return { error: ms(p.Could_not_find_convertible_access_expression) };
- const n = _Se(t.expression, e.left);
- return n ? { finalExpression: t, occurrences: n, expression: e } : { error: ms(p.Could_not_find_matching_access_expressions) };
- }
- function _Se(e, t) {
- const n = [];
- for (; dn(t) && t.operatorToken.kind === 56; ) {
- const s = poe(Ba(e), Ba(t.right));
- if (!s)
- break;
- n.push(s), e = s, t = t.left;
- }
- const i = poe(e, t);
- return i && n.push(i), n.length > 0 ? n : void 0;
- }
- function poe(e, t) {
- if (!(!Oe(t) && !Cn(t) && !ko(t)))
- return aWe(e, t) ? t : void 0;
- }
- function aWe(e, t) {
- for (; (Fs(e) || Cn(e) || ko(e)) && E8(e) !== E8(t); )
- e = e.expression;
- for (; Cn(e) && Cn(t) || ko(e) && ko(t); ) {
- if (E8(e) !== E8(t)) return !1;
- e = e.expression, t = t.expression;
- }
- return Oe(e) && Oe(t) && e.getText() === t.getText();
- }
- function E8(e) {
- if (Oe(e) || Of(e))
- return e.getText();
- if (Cn(e))
- return E8(e.name);
- if (ko(e))
- return E8(e.argumentExpression);
- }
- function oWe(e, t) {
- for (; e.parent; ) {
- if (yq(e) && t.length !== 0 && e.end >= t.start + t.length)
- return e;
- e = e.parent;
- }
- }
- function cWe(e) {
- for (; e.parent; ) {
- if (yq(e) && !yq(e.parent))
- return e;
- e = e.parent;
- }
- }
- function lWe(e) {
- if (hq(e))
- return e;
- if (yc(e)) {
- const t = rx(e), n = t?.initializer;
- return n && hq(n) ? n : void 0;
- }
- return e.expression && hq(e.expression) ? e.expression : void 0;
- }
- function doe(e) {
- if (e = Ba(e), dn(e))
- return doe(e.left);
- if ((Cn(e) || ko(e) || Fs(e)) && !hu(e))
- return e;
- }
- function fSe(e, t, n) {
- if (Cn(t) || ko(t) || Fs(t)) {
- const i = fSe(e, t.expression, n), s = n.length > 0 ? n[n.length - 1] : void 0, o = s?.getText() === t.expression.getText();
- if (o && n.pop(), Fs(t))
- return o ? A.createCallChain(i, A.createToken(
- 29
- /* QuestionDotToken */
- ), t.typeArguments, t.arguments) : A.createCallChain(i, t.questionDotToken, t.typeArguments, t.arguments);
- if (Cn(t))
- return o ? A.createPropertyAccessChain(i, A.createToken(
- 29
- /* QuestionDotToken */
- ), t.name) : A.createPropertyAccessChain(i, t.questionDotToken, t.name);
- if (ko(t))
- return o ? A.createElementAccessChain(i, A.createToken(
- 29
- /* QuestionDotToken */
- ), t.argumentExpression) : A.createElementAccessChain(i, t.questionDotToken, t.argumentExpression);
- }
- return t;
- }
- function uWe(e, t, n, i, s) {
- const { finalExpression: o, occurrences: c, expression: _ } = i, u = c[c.length - 1], d = fSe(t, o, c);
- d && (Cn(d) || ko(d) || Fs(d)) && (dn(_) ? n.replaceNodeRange(e, u, o, d) : Ix(_) && n.replaceNode(e, _, A.createBinaryExpression(d, A.createToken(
- 61
- /* QuestionQuestionToken */
- ), _.whenFalse)));
- }
- var pSe = {};
- La(pSe, {
- Messages: () => Yl,
- RangeFacts: () => gSe,
- getRangeToExtract: () => moe,
- getRefactorActionsToExtractSymbol: () => dSe,
- getRefactorEditsToExtractSymbol: () => mSe
- });
- var nP = "Extract Symbol", iP = {
- name: "Extract Constant",
- description: ms(p.Extract_constant),
- kind: "refactor.extract.constant"
- }, sP = {
- name: "Extract Function",
- description: ms(p.Extract_function),
- kind: "refactor.extract.function"
- };
- Qg(nP, {
- kinds: [
- iP.kind,
- sP.kind
- ],
- getEditsForAction: mSe,
- getAvailableActions: dSe
- });
- function dSe(e) {
- const t = e.kind, n = moe(e.file, Kx(e), e.triggerReason === "invoked"), i = n.targetRange;
- if (i === void 0) {
- if (!n.errors || n.errors.length === 0 || !e.preferences.provideRefactorNotApplicableReason)
- return Ue;
- const D = [];
- return Ev(sP.kind, t) && D.push({
- name: nP,
- description: sP.description,
- actions: [{ ...sP, notApplicableReason: C(n.errors) }]
- }), Ev(iP.kind, t) && D.push({
- name: nP,
- description: iP.description,
- actions: [{ ...iP, notApplicableReason: C(n.errors) }]
- }), D;
- }
- const { affectedTextRange: s, extractions: o } = gWe(i, e);
- if (o === void 0)
- return Ue;
- const c = [], _ = /* @__PURE__ */ new Map();
- let u;
- const d = [], g = /* @__PURE__ */ new Map();
- let h, S = 0;
- for (const { functionExtraction: D, constantExtraction: P } of o) {
- if (Ev(sP.kind, t)) {
- const I = D.description;
- D.errors.length === 0 ? _.has(I) || (_.set(I, !0), c.push({
- description: I,
- name: `function_scope_${S}`,
- kind: sP.kind,
- range: {
- start: { line: Qs(e.file, s.pos).line, offset: Qs(e.file, s.pos).character },
- end: { line: Qs(e.file, s.end).line, offset: Qs(e.file, s.end).character }
- }
- })) : u || (u = {
- description: I,
- name: `function_scope_${S}`,
- notApplicableReason: C(D.errors),
- kind: sP.kind
- });
- }
- if (Ev(iP.kind, t)) {
- const I = P.description;
- P.errors.length === 0 ? g.has(I) || (g.set(I, !0), d.push({
- description: I,
- name: `constant_scope_${S}`,
- kind: iP.kind,
- range: {
- start: { line: Qs(e.file, s.pos).line, offset: Qs(e.file, s.pos).character },
- end: { line: Qs(e.file, s.end).line, offset: Qs(e.file, s.end).character }
- }
- })) : h || (h = {
- description: I,
- name: `constant_scope_${S}`,
- notApplicableReason: C(P.errors),
- kind: iP.kind
- });
- }
- S++;
- }
- const T = [];
- return c.length ? T.push({
- name: nP,
- description: ms(p.Extract_function),
- actions: c
- }) : e.preferences.provideRefactorNotApplicableReason && u && T.push({
- name: nP,
- description: ms(p.Extract_function),
- actions: [u]
- }), d.length ? T.push({
- name: nP,
- description: ms(p.Extract_constant),
- actions: d
- }) : e.preferences.provideRefactorNotApplicableReason && h && T.push({
- name: nP,
- description: ms(p.Extract_constant),
- actions: [h]
- }), T.length ? T : Ue;
- function C(D) {
- let P = D[0].messageText;
- return typeof P != "string" && (P = P.messageText), P;
- }
- }
- function mSe(e, t) {
- const i = moe(e.file, Kx(e)).targetRange, s = /^function_scope_(\d+)$/.exec(t);
- if (s) {
- const c = +s[1];
- return E.assert(isFinite(c), "Expected to parse a finite number from the function scope index"), dWe(i, e, c);
- }
- const o = /^constant_scope_(\d+)$/.exec(t);
- if (o) {
- const c = +o[1];
- return E.assert(isFinite(c), "Expected to parse a finite number from the constant scope index"), mWe(i, e, c);
- }
- E.fail("Unrecognized action name");
- }
- var Yl;
- ((e) => {
- function t(n) {
- return { message: n, code: 0, category: 3, key: n };
- }
- e.cannotExtractRange = t("Cannot extract range."), e.cannotExtractImport = t("Cannot extract import statement."), e.cannotExtractSuper = t("Cannot extract super call."), e.cannotExtractJSDoc = t("Cannot extract JSDoc."), e.cannotExtractEmpty = t("Cannot extract empty range."), e.expressionExpected = t("expression expected."), e.uselessConstantType = t("No reason to extract constant of type."), e.statementOrExpressionExpected = t("Statement or expression expected."), e.cannotExtractRangeContainingConditionalBreakOrContinueStatements = t("Cannot extract range containing conditional break or continue statements."), e.cannotExtractRangeContainingConditionalReturnStatement = t("Cannot extract range containing conditional return statement."), e.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = t("Cannot extract range containing labeled break or continue with target outside of the range."), e.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = t("Cannot extract range containing writes to references located outside of the target range in generators."), e.typeWillNotBeVisibleInTheNewScope = t("Type will not visible in the new scope."), e.functionWillNotBeVisibleInTheNewScope = t("Function will not visible in the new scope."), e.cannotExtractIdentifier = t("Select more than a single identifier."), e.cannotExtractExportedEntity = t("Cannot extract exported declaration"), e.cannotWriteInExpression = t("Cannot write back side-effects when extracting an expression"), e.cannotExtractReadonlyPropertyInitializerOutsideConstructor = t("Cannot move initialization of read-only class property outside of the constructor"), e.cannotExtractAmbientBlock = t("Cannot extract code from ambient contexts"), e.cannotAccessVariablesFromNestedScopes = t("Cannot access variables from nested scopes"), e.cannotExtractToJSClass = t("Cannot extract constant to a class scope in JS"), e.cannotExtractToExpressionArrowFunction = t("Cannot extract constant to an arrow function without a block"), e.cannotExtractFunctionsContainingThisToMethod = t("Cannot extract functions containing this to method");
- })(Yl || (Yl = {}));
- var gSe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.HasReturn = 1] = "HasReturn", e[e.IsGenerator = 2] = "IsGenerator", e[e.IsAsyncFunction = 4] = "IsAsyncFunction", e[e.UsesThis = 8] = "UsesThis", e[e.UsesThisInFunction = 16] = "UsesThisInFunction", e[e.InStaticRegion = 32] = "InStaticRegion", e))(gSe || {});
- function moe(e, t, n = !0) {
- const { length: i } = t;
- if (i === 0 && !n)
- return { errors: [fl(e, t.start, i, Yl.cannotExtractEmpty)] };
- const s = i === 0 && n, o = _se(e, t.start), c = r8(e, ec(t)), _ = o && c && n ? _We(o, c, e) : t, u = s ? MWe(o) : l8(o, e, _), d = s ? u : l8(c, e, _);
- let g = 0, h;
- if (!u || !d)
- return { errors: [fl(e, t.start, i, Yl.cannotExtractRange)] };
- if (u.flags & 16777216)
- return { errors: [fl(e, t.start, i, Yl.cannotExtractJSDoc)] };
- if (u.parent !== d.parent)
- return { errors: [fl(e, t.start, i, Yl.cannotExtractRange)] };
- if (u !== d) {
- if (!ek(u.parent))
- return { errors: [fl(e, t.start, i, Yl.cannotExtractRange)] };
- const F = [];
- for (const O of u.parent.statements) {
- if (O === u || F.length) {
- const B = I(O);
- if (B)
- return { errors: B };
- F.push(O);
- }
- if (O === d)
- break;
- }
- return F.length ? { targetRange: { range: F, facts: g, thisNode: h } } : { errors: [fl(e, t.start, i, Yl.cannotExtractRange)] };
- }
- if (Up(u) && !u.expression)
- return { errors: [fl(e, t.start, i, Yl.cannotExtractRange)] };
- const S = C(u), T = D(S) || I(S);
- if (T)
- return { errors: T };
- return { targetRange: { range: fWe(S), facts: g, thisNode: h } };
- function C(F) {
- if (Up(F)) {
- if (F.expression)
- return F.expression;
- } else if (yc(F) || Fl(F)) {
- const O = yc(F) ? F.declarationList.declarations : F.declarations;
- let B = 0, z;
- for (const X of O)
- X.initializer && (B++, z = X.initializer);
- if (B === 1)
- return z;
- } else if (ii(F) && F.initializer)
- return F.initializer;
- return F;
- }
- function D(F) {
- if (Oe(Pl(F) ? F.expression : F))
- return [Kr(F, Yl.cannotExtractIdentifier)];
- }
- function P(F, O) {
- let B = F;
- for (; B !== O; ) {
- if (B.kind === 172) {
- zs(B) && (g |= 32);
- break;
- } else if (B.kind === 169) {
- yf(B).kind === 176 && (g |= 32);
- break;
- } else B.kind === 174 && zs(B) && (g |= 32);
- B = B.parent;
- }
- }
- function I(F) {
- let O;
- if (((ae) => {
- ae[ae.None = 0] = "None", ae[ae.Break = 1] = "Break", ae[ae.Continue = 2] = "Continue", ae[ae.Return = 4] = "Return";
- })(O || (O = {})), E.assert(F.pos <= F.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"), E.assert(!Pd(F.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"), !bi(F) && !(Ed(F) && hSe(F)) && !boe(F))
- return [Kr(F, Yl.statementOrExpressionExpected)];
- if (F.flags & 33554432)
- return [Kr(F, Yl.cannotExtractAmbientBlock)];
- const B = Ol(F);
- B && P(F, B);
- let z, X = 4, q;
- if (V(F), g & 8) {
- const ae = Lu(
- F,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- (ae.kind === 262 || ae.kind === 174 && ae.parent.kind === 210 || ae.kind === 218) && (g |= 16);
- }
- return z;
- function V(ae) {
- if (z)
- return !0;
- if (ql(ae)) {
- const G = ae.kind === 260 ? ae.parent.parent : ae;
- if (Gn(
- G,
- 32
- /* Export */
- ))
- return (z || (z = [])).push(Kr(ae, Yl.cannotExtractExportedEntity)), !0;
- }
- switch (ae.kind) {
- case 272:
- return (z || (z = [])).push(Kr(ae, Yl.cannotExtractImport)), !0;
- case 277:
- return (z || (z = [])).push(Kr(ae, Yl.cannotExtractExportedEntity)), !0;
- case 108:
- if (ae.parent.kind === 213) {
- const G = Ol(ae);
- if (G === void 0 || G.pos < t.start || G.end >= t.start + t.length)
- return (z || (z = [])).push(Kr(ae, Yl.cannotExtractSuper)), !0;
- } else
- g |= 8, h = ae;
- break;
- case 219:
- bs(ae, function G(ue) {
- if (S6(ue))
- g |= 8, h = ae;
- else {
- if (Zn(ue) || ys(ue) && !Co(ue))
- return !1;
- bs(ue, G);
- }
- });
- case 263:
- case 262:
- Si(ae.parent) && ae.parent.externalModuleIndicator === void 0 && (z || (z = [])).push(Kr(ae, Yl.functionWillNotBeVisibleInTheNewScope));
- case 231:
- case 218:
- case 174:
- case 176:
- case 177:
- case 178:
- return !1;
- }
- const ee = X;
- switch (ae.kind) {
- case 245:
- X &= -5;
- break;
- case 258:
- X = 0;
- break;
- case 241:
- ae.parent && ae.parent.kind === 258 && ae.parent.finallyBlock === ae && (X = 4);
- break;
- case 297:
- case 296:
- X |= 1;
- break;
- default:
- Ny(
- ae,
- /*lookInLabeledStatements*/
- !1
- ) && (X |= 3);
- break;
- }
- switch (ae.kind) {
- case 197:
- case 110:
- g |= 8, h = ae;
- break;
- case 256: {
- const G = ae.label;
- (q || (q = [])).push(G.escapedText), bs(ae, V), q.pop();
- break;
- }
- case 252:
- case 251: {
- const G = ae.label;
- G ? ss(q, G.escapedText) || (z || (z = [])).push(Kr(ae, Yl.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)) : X & (ae.kind === 252 ? 1 : 2) || (z || (z = [])).push(Kr(ae, Yl.cannotExtractRangeContainingConditionalBreakOrContinueStatements));
- break;
- }
- case 223:
- g |= 4;
- break;
- case 229:
- g |= 2;
- break;
- case 253:
- X & 4 ? g |= 1 : (z || (z = [])).push(Kr(ae, Yl.cannotExtractRangeContainingConditionalReturnStatement));
- break;
- default:
- bs(ae, V);
- break;
- }
- X = ee;
- }
- }
- }
- function _We(e, t, n) {
- const i = e.getStart(n);
- let s = t.getEnd();
- return n.text.charCodeAt(s) === 59 && s++, { start: i, length: s - i };
- }
- function fWe(e) {
- if (bi(e))
- return [e];
- if (Ed(e))
- return Pl(e.parent) ? [e.parent] : e;
- if (boe(e))
- return e;
- }
- function goe(e) {
- return Co(e) ? Dj(e.body) : no(e) || Si(e) || Sm(e) || Zn(e);
- }
- function pWe(e) {
- let t = R0(e.range) ? xa(e.range) : e.range;
- if (e.facts & 8 && !(e.facts & 16)) {
- const i = Ol(t);
- if (i) {
- const s = or(t, no);
- return s ? [s, i] : [i];
- }
- }
- const n = [];
- for (; ; )
- if (t = t.parent, t.kind === 169 && (t = or(t, (i) => no(i)).parent), goe(t) && (n.push(t), t.kind === 307))
- return n;
- }
- function dWe(e, t, n) {
- const { scopes: i, readsAndWrites: { target: s, usagesPerScope: o, functionErrorsPerScope: c, exposedVariableDeclarations: _ } } = hoe(e, t);
- return E.assert(!c[n].length, "The extraction went missing? How?"), t.cancellationToken.throwIfCancellationRequested(), TWe(s, i[n], o[n], _, e, t);
- }
- function mWe(e, t, n) {
- const { scopes: i, readsAndWrites: { target: s, usagesPerScope: o, constantErrorsPerScope: c, exposedVariableDeclarations: _ } } = hoe(e, t);
- E.assert(!c[n].length, "The extraction went missing? How?"), E.assert(_.length === 0, "Extract constant accepted a range containing a variable declaration?"), t.cancellationToken.throwIfCancellationRequested();
- const u = _t(s) ? s : s.statements[0].expression;
- return xWe(u, i[n], o[n], e.facts, t);
- }
- function gWe(e, t) {
- const { scopes: n, affectedTextRange: i, readsAndWrites: { functionErrorsPerScope: s, constantErrorsPerScope: o } } = hoe(e, t), c = n.map((_, u) => {
- const d = hWe(_), g = yWe(_), h = no(_) ? vWe(_) : Zn(_) ? bWe(_) : SWe(_);
- let S, T;
- return h === 1 ? (S = zg(ms(p.Extract_to_0_in_1_scope), [d, "global"]), T = zg(ms(p.Extract_to_0_in_1_scope), [g, "global"])) : h === 0 ? (S = zg(ms(p.Extract_to_0_in_1_scope), [d, "module"]), T = zg(ms(p.Extract_to_0_in_1_scope), [g, "module"])) : (S = zg(ms(p.Extract_to_0_in_1), [d, h]), T = zg(ms(p.Extract_to_0_in_1), [g, h])), u === 0 && !Zn(_) && (T = zg(ms(p.Extract_to_0_in_enclosing_scope), [g])), {
- functionExtraction: {
- description: S,
- errors: s[u]
- },
- constantExtraction: {
- description: T,
- errors: o[u]
- }
- };
- });
- return { affectedTextRange: i, extractions: c };
- }
- function hoe(e, t) {
- const { file: n } = t, i = pWe(e), s = FWe(e, n), o = LWe(
- e,
- i,
- s,
- n,
- t.program.getTypeChecker(),
- t.cancellationToken
- );
- return { scopes: i, affectedTextRange: s, readsAndWrites: o };
- }
- function hWe(e) {
- return no(e) ? "inner function" : Zn(e) ? "method" : "function";
- }
- function yWe(e) {
- return Zn(e) ? "readonly field" : "constant";
- }
- function vWe(e) {
- switch (e.kind) {
- case 176:
- return "constructor";
- case 218:
- case 262:
- return e.name ? `function '${e.name.text}'` : wV;
- case 219:
- return "arrow function";
- case 174:
- return `method '${e.name.getText()}'`;
- case 177:
- return `'get ${e.name.getText()}'`;
- case 178:
- return `'set ${e.name.getText()}'`;
- default:
- E.assertNever(e, `Unexpected scope kind ${e.kind}`);
- }
- }
- function bWe(e) {
- return e.kind === 263 ? e.name ? `class '${e.name.text}'` : "anonymous class declaration" : e.name ? `class expression '${e.name.text}'` : "anonymous class expression";
- }
- function SWe(e) {
- return e.kind === 268 ? `namespace '${e.parent.name.getText()}'` : e.externalModuleIndicator ? 0 : 1;
- }
- function TWe(e, t, { usages: n, typeParameterUsages: i, substitutions: s }, o, c, _) {
- const u = _.program.getTypeChecker(), d = pa(_.program.getCompilerOptions()), g = xu.createImportAdder(_.file, _.program, _.preferences, _.host), h = t.getSourceFile(), S = IS(Zn(t) ? "newMethod" : "newFunction", h), T = cn(t), C = A.createIdentifier(S);
- let D;
- const P = [], I = [];
- let F;
- n.forEach((le, me) => {
- let ve;
- if (!T) {
- let Te = u.getTypeOfSymbolAtLocation(le.symbol, le.node);
- Te = u.getBaseTypeOfLiteralType(Te), ve = xu.typeToAutoImportableTypeNode(
- u,
- g,
- Te,
- t,
- d,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- }
- const tt = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- me,
- /*questionToken*/
- void 0,
- ve
- );
- P.push(tt), le.usage === 2 && (F || (F = [])).push(le), I.push(A.createIdentifier(me));
- });
- const O = as(i.values(), (le) => ({ type: le, declaration: CWe(le, _.startPosition) }));
- O.sort(EWe);
- const B = O.length === 0 ? void 0 : Ai(O, ({ declaration: le }) => le), z = B !== void 0 ? B.map((le) => A.createTypeReferenceNode(
- le.name,
- /*typeArguments*/
- void 0
- )) : void 0;
- if (_t(e) && !T) {
- const le = u.getContextualType(e);
- D = u.typeToTypeNode(
- le,
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- }
- const { body: X, returnValueProperty: q } = PWe(e, o, F, s, !!(c.facts & 1));
- af(X);
- let V;
- const ae = !!(c.facts & 16);
- if (Zn(t)) {
- const le = T ? [] : [A.createModifier(
- 123
- /* PrivateKeyword */
- )];
- c.facts & 32 && le.push(A.createModifier(
- 126
- /* StaticKeyword */
- )), c.facts & 4 && le.push(A.createModifier(
- 134
- /* AsyncKeyword */
- )), V = A.createMethodDeclaration(
- le.length ? le : void 0,
- c.facts & 2 ? A.createToken(
- 42
- /* AsteriskToken */
- ) : void 0,
- C,
- /*questionToken*/
- void 0,
- B,
- P,
- D,
- X
- );
- } else
- ae && P.unshift(
- A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- "this",
- /*questionToken*/
- void 0,
- u.typeToTypeNode(
- u.getTypeAtLocation(c.thisNode),
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- ),
- /*initializer*/
- void 0
- )
- ), V = A.createFunctionDeclaration(
- c.facts & 4 ? [A.createToken(
- 134
- /* AsyncKeyword */
- )] : void 0,
- c.facts & 2 ? A.createToken(
- 42
- /* AsteriskToken */
- ) : void 0,
- C,
- B,
- P,
- D,
- X
- );
- const ee = sn.ChangeTracker.fromContext(_), G = (R0(c.range) ? _a(c.range) : c.range).end, ue = NWe(G, t);
- ue ? ee.insertNodeBefore(
- _.file,
- ue,
- V,
- /*blankLineBetween*/
- !0
- ) : ee.insertNodeAtEndOfScope(_.file, t, V), g.writeFixes(ee);
- const re = [], ne = DWe(t, c, S);
- ae && I.unshift(A.createIdentifier("this"));
- let ie = A.createCallExpression(
- ae ? A.createPropertyAccessExpression(
- ne,
- "call"
- ) : ne,
- z,
- // Note that no attempt is made to take advantage of type argument inference
- I
- );
- if (c.facts & 2 && (ie = A.createYieldExpression(A.createToken(
- 42
- /* AsteriskToken */
- ), ie)), c.facts & 4 && (ie = A.createAwaitExpression(ie)), voe(e) && (ie = A.createJsxExpression(
- /*dotDotDotToken*/
- void 0,
- ie
- )), o.length && !F)
- if (E.assert(!q, "Expected no returnValueProperty"), E.assert(!(c.facts & 1), "Expected RangeFacts.HasReturn flag to be unset"), o.length === 1) {
- const le = o[0];
- re.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- Ja(le.name),
- /*exclamationToken*/
- void 0,
- /*type*/
- Ja(le.type),
- /*initializer*/
- ie
- )],
- le.parent.flags
- )
- ));
- } else {
- const le = [], me = [];
- let ve = o[0].parent.flags, tt = !1;
- for (const we of o) {
- le.push(A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- void 0,
- /*name*/
- Ja(we.name)
- ));
- const fe = u.typeToTypeNode(
- u.getBaseTypeOfLiteralType(u.getTypeAtLocation(we)),
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- me.push(A.createPropertySignature(
- /*modifiers*/
- void 0,
- /*name*/
- we.symbol.name,
- /*questionToken*/
- void 0,
- /*type*/
- fe
- )), tt = tt || we.type !== void 0, ve = ve & we.parent.flags;
- }
- const Te = tt ? A.createTypeLiteralNode(me) : void 0;
- Te && an(
- Te,
- 1
- /* SingleLine */
- ), re.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- A.createObjectBindingPattern(le),
- /*exclamationToken*/
- void 0,
- /*type*/
- Te,
- /*initializer*/
- ie
- )],
- ve
- )
- ));
- }
- else if (o.length || F) {
- if (o.length)
- for (const me of o) {
- let ve = me.parent.flags;
- ve & 2 && (ve = ve & -3 | 1), re.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- me.symbol.name,
- /*exclamationToken*/
- void 0,
- he(me.type)
- )],
- ve
- )
- ));
- }
- q && re.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- q,
- /*exclamationToken*/
- void 0,
- he(D)
- )],
- 1
- /* Let */
- )
- ));
- const le = yoe(o, F);
- q && le.unshift(A.createShorthandPropertyAssignment(q)), le.length === 1 ? (E.assert(!q, "Shouldn't have returnValueProperty here"), re.push(A.createExpressionStatement(A.createAssignment(le[0].name, ie))), c.facts & 1 && re.push(A.createReturnStatement())) : (re.push(A.createExpressionStatement(A.createAssignment(A.createObjectLiteralExpression(le), ie))), q && re.push(A.createReturnStatement(A.createIdentifier(q))));
- } else
- c.facts & 1 ? re.push(A.createReturnStatement(ie)) : R0(c.range) ? re.push(A.createExpressionStatement(ie)) : re.push(ie);
- R0(c.range) ? ee.replaceNodeRangeWithNodes(_.file, xa(c.range), _a(c.range), re) : ee.replaceNodeWithNodes(_.file, c.range, re);
- const Se = ee.getChanges(), oe = (R0(c.range) ? xa(c.range) : c.range).getSourceFile().fileName, _e = f8(
- Se,
- oe,
- S,
- /*preferLastLocation*/
- !1
- );
- return { renameFilename: oe, renameLocation: _e, edits: Se };
- function he(le) {
- if (le === void 0)
- return;
- const me = Ja(le);
- let ve = me;
- for (; dS(ve); )
- ve = ve.type;
- return qy(ve) && On(
- ve.types,
- (tt) => tt.kind === 157
- /* UndefinedKeyword */
- ) ? me : A.createUnionTypeNode([me, A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- )]);
- }
- }
- function xWe(e, t, { substitutions: n }, i, s) {
- const o = s.program.getTypeChecker(), c = t.getSourceFile(), _ = Xae(e, t, o, c), u = cn(t);
- let d = u || !o.isContextSensitive(e) ? void 0 : o.typeToTypeNode(
- o.getContextualType(e),
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- ), g = wWe(Ba(e), n);
- ({ variableType: d, initializer: g } = D(d, g)), af(g);
- const h = sn.ChangeTracker.fromContext(s);
- if (Zn(t)) {
- E.assert(!u, "Cannot extract to a JS class");
- const P = [];
- P.push(A.createModifier(
- 123
- /* PrivateKeyword */
- )), i & 32 && P.push(A.createModifier(
- 126
- /* StaticKeyword */
- )), P.push(A.createModifier(
- 148
- /* ReadonlyKeyword */
- ));
- const I = A.createPropertyDeclaration(
- P,
- _,
- /*questionOrExclamationToken*/
- void 0,
- d,
- g
- );
- let F = A.createPropertyAccessExpression(
- i & 32 ? A.createIdentifier(t.name.getText()) : A.createThis(),
- A.createIdentifier(_)
- );
- voe(e) && (F = A.createJsxExpression(
- /*dotDotDotToken*/
- void 0,
- F
- ));
- const O = e.pos, B = IWe(O, t);
- h.insertNodeBefore(
- s.file,
- B,
- I,
- /*blankLineBetween*/
- !0
- ), h.replaceNode(s.file, e, F);
- } else {
- const P = A.createVariableDeclaration(
- _,
- /*exclamationToken*/
- void 0,
- d,
- g
- ), I = kWe(e, t);
- if (I) {
- h.insertNodeBefore(s.file, I, P);
- const F = A.createIdentifier(_);
- h.replaceNode(s.file, e, F);
- } else if (e.parent.kind === 244 && t === or(e, goe)) {
- const F = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [P],
- 2
- /* Const */
- )
- );
- h.replaceNode(s.file, e.parent, F);
- } else {
- const F = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [P],
- 2
- /* Const */
- )
- ), O = OWe(e, t);
- if (O.pos === 0 ? h.insertNodeAtTopOfFile(
- s.file,
- F,
- /*blankLineBetween*/
- !1
- ) : h.insertNodeBefore(
- s.file,
- O,
- F,
- /*blankLineBetween*/
- !1
- ), e.parent.kind === 244)
- h.delete(s.file, e.parent);
- else {
- let B = A.createIdentifier(_);
- voe(e) && (B = A.createJsxExpression(
- /*dotDotDotToken*/
- void 0,
- B
- )), h.replaceNode(s.file, e, B);
- }
- }
- }
- const S = h.getChanges(), T = e.getSourceFile().fileName, C = f8(
- S,
- T,
- _,
- /*preferLastLocation*/
- !0
- );
- return { renameFilename: T, renameLocation: C, edits: S };
- function D(P, I) {
- if (P === void 0) return { variableType: P, initializer: I };
- if (!vo(I) && !Co(I) || I.typeParameters) return { variableType: P, initializer: I };
- const F = o.getTypeAtLocation(e), O = Qm(o.getSignaturesOfType(
- F,
- 0
- /* Call */
- ));
- if (!O) return { variableType: P, initializer: I };
- if (O.getTypeParameters()) return { variableType: P, initializer: I };
- const B = [];
- let z = !1;
- for (const X of I.parameters)
- if (X.type)
- B.push(X);
- else {
- const q = o.getTypeAtLocation(X);
- q === o.getAnyType() && (z = !0), B.push(A.updateParameterDeclaration(X, X.modifiers, X.dotDotDotToken, X.name, X.questionToken, X.type || o.typeToTypeNode(
- q,
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- ), X.initializer));
- }
- if (z) return { variableType: P, initializer: I };
- if (P = void 0, Co(I))
- I = A.updateArrowFunction(I, Hp(e) ? fb(e) : void 0, I.typeParameters, B, I.type || o.typeToTypeNode(
- O.getReturnType(),
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- ), I.equalsGreaterThanToken, I.body);
- else {
- if (O && O.thisParameter) {
- const X = el(B);
- if (!X || Oe(X.name) && X.name.escapedText !== "this") {
- const q = o.getTypeOfSymbolAtLocation(O.thisParameter, e);
- B.splice(
- 0,
- 0,
- A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "this",
- /*questionToken*/
- void 0,
- o.typeToTypeNode(
- q,
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- )
- )
- );
- }
- }
- I = A.updateFunctionExpression(I, Hp(e) ? fb(e) : void 0, I.asteriskToken, I.name, I.typeParameters, B, I.type || o.typeToTypeNode(
- O.getReturnType(),
- t,
- 1
- /* NoTruncation */
- ), I.body);
- }
- return { variableType: P, initializer: I };
- }
- }
- function kWe(e, t) {
- let n;
- for (; e !== void 0 && e !== t; ) {
- if (ii(e) && e.initializer === n && Fl(e.parent) && e.parent.declarations.length > 1)
- return e;
- n = e, e = e.parent;
- }
- }
- function CWe(e, t) {
- let n;
- const i = e.symbol;
- if (i && i.declarations)
- for (const s of i.declarations)
- (n === void 0 || s.pos < n.pos) && s.pos < t && (n = s);
- return n;
- }
- function EWe({ type: e, declaration: t }, { type: n, declaration: i }) {
- return CX(t, i, "pos", ho) || au(
- e.symbol ? e.symbol.getName() : "",
- n.symbol ? n.symbol.getName() : ""
- ) || ho(e.id, n.id);
- }
- function DWe(e, t, n) {
- const i = A.createIdentifier(n);
- if (Zn(e)) {
- const s = t.facts & 32 ? A.createIdentifier(e.name.text) : A.createThis();
- return A.createPropertyAccessExpression(s, i);
- } else
- return i;
- }
- function PWe(e, t, n, i, s) {
- const o = n !== void 0 || t.length > 0;
- if (Cs(e) && !o && i.size === 0)
- return { body: A.createBlock(
- e.statements,
- /*multiLine*/
- !0
- ), returnValueProperty: void 0 };
- let c, _ = !1;
- const u = A.createNodeArray(Cs(e) ? e.statements.slice(0) : [bi(e) ? e : A.createReturnStatement(Ba(e))]);
- if (o || i.size) {
- const g = Fr(u, d, bi).slice();
- if (o && !s && bi(e)) {
- const h = yoe(t, n);
- h.length === 1 ? g.push(A.createReturnStatement(h[0].name)) : g.push(A.createReturnStatement(A.createObjectLiteralExpression(h)));
- }
- return { body: A.createBlock(
- g,
- /*multiLine*/
- !0
- ), returnValueProperty: c };
- } else
- return { body: A.createBlock(
- u,
- /*multiLine*/
- !0
- ), returnValueProperty: void 0 };
- function d(g) {
- if (!_ && Up(g) && o) {
- const h = yoe(t, n);
- return g.expression && (c || (c = "__return"), h.unshift(A.createPropertyAssignment(c, Ge(g.expression, d, _t)))), h.length === 1 ? A.createReturnStatement(h[0].name) : A.createReturnStatement(A.createObjectLiteralExpression(h));
- } else {
- const h = _;
- _ = _ || no(g) || Zn(g);
- const S = i.get(Ma(g).toString()), T = S ? Ja(S) : br(
- g,
- d,
- /*context*/
- void 0
- );
- return _ = h, T;
- }
- }
- }
- function wWe(e, t) {
- return t.size ? n(e) : e;
- function n(i) {
- const s = t.get(Ma(i).toString());
- return s ? Ja(s) : br(
- i,
- n,
- /*context*/
- void 0
- );
- }
- }
- function AWe(e) {
- if (no(e)) {
- const t = e.body;
- if (Cs(t))
- return t.statements;
- } else {
- if (Sm(e) || Si(e))
- return e.statements;
- if (Zn(e))
- return e.members;
- }
- return Ue;
- }
- function NWe(e, t) {
- return On(AWe(t), (n) => n.pos >= e && no(n) && !Qo(n));
- }
- function IWe(e, t) {
- const n = t.members;
- E.assert(n.length > 0, "Found no members");
- let i, s = !0;
- for (const o of n) {
- if (o.pos > e)
- return i || n[0];
- if (s && !cs(o)) {
- if (i !== void 0)
- return o;
- s = !1;
- }
- i = o;
- }
- return i === void 0 ? E.fail() : i;
- }
- function OWe(e, t) {
- E.assert(!Zn(t));
- let n;
- for (let i = e; i !== t; i = i.parent)
- goe(i) && (n = i);
- for (let i = (n || e).parent; ; i = i.parent) {
- if (ek(i)) {
- let s;
- for (const o of i.statements) {
- if (o.pos > e.pos)
- break;
- s = o;
- }
- return !s && XC(i) ? (E.assert(oD(i.parent.parent), "Grandparent isn't a switch statement"), i.parent.parent) : E.checkDefined(s, "prevStatement failed to get set");
- }
- E.assert(i !== t, "Didn't encounter a block-like before encountering scope");
- }
- }
- function yoe(e, t) {
- const n = lr(e, (s) => A.createShorthandPropertyAssignment(s.symbol.name)), i = lr(t, (s) => A.createShorthandPropertyAssignment(s.symbol.name));
- return n === void 0 ? i : i === void 0 ? n : n.concat(i);
- }
- function R0(e) {
- return us(e);
- }
- function FWe(e, t) {
- return R0(e.range) ? { pos: xa(e.range).getStart(t), end: _a(e.range).getEnd() } : e.range;
- }
- function LWe(e, t, n, i, s, o) {
- const c = /* @__PURE__ */ new Map(), _ = [], u = [], d = [], g = [], h = [], S = /* @__PURE__ */ new Map(), T = [];
- let C;
- const D = R0(e.range) ? e.range.length === 1 && Pl(e.range[0]) ? e.range[0].expression : void 0 : e.range;
- let P;
- if (D === void 0) {
- const re = e.range, ne = xa(re).getStart(), ie = _a(re).end;
- P = fl(i, ne, ie - ne, Yl.expressionExpected);
- } else s.getTypeAtLocation(D).flags & 147456 && (P = Kr(D, Yl.uselessConstantType));
- for (const re of t) {
- _.push({ usages: /* @__PURE__ */ new Map(), typeParameterUsages: /* @__PURE__ */ new Map(), substitutions: /* @__PURE__ */ new Map() }), u.push(/* @__PURE__ */ new Map()), d.push([]);
- const ne = [];
- P && ne.push(P), Zn(re) && cn(re) && ne.push(Kr(re, Yl.cannotExtractToJSClass)), Co(re) && !Cs(re.body) && ne.push(Kr(re, Yl.cannotExtractToExpressionArrowFunction)), g.push(ne);
- }
- const I = /* @__PURE__ */ new Map(), F = R0(e.range) ? A.createBlock(e.range) : e.range, O = R0(e.range) ? xa(e.range) : e.range, B = z(O);
- if (q(F), B && !R0(e.range) && !km(e.range)) {
- const re = s.getContextualType(e.range);
- X(re);
- }
- if (c.size > 0) {
- const re = /* @__PURE__ */ new Map();
- let ne = 0;
- for (let ie = O; ie !== void 0 && ne < t.length; ie = ie.parent)
- if (ie === t[ne] && (re.forEach((Se, J) => {
- _[ne].typeParameterUsages.set(J, Se);
- }), ne++), $j(ie))
- for (const Se of Ey(ie)) {
- const J = s.getTypeAtLocation(Se);
- c.has(J.id.toString()) && re.set(J.id.toString(), J);
- }
- E.assert(ne === t.length, "Should have iterated all scopes");
- }
- if (h.length) {
- const re = Gj(t[0], t[0].parent) ? t[0] : Cd(t[0]);
- bs(re, ee);
- }
- for (let re = 0; re < t.length; re++) {
- const ne = _[re];
- if (re > 0 && (ne.usages.size > 0 || ne.typeParameterUsages.size > 0)) {
- const J = R0(e.range) ? e.range[0] : e.range;
- g[re].push(Kr(J, Yl.cannotAccessVariablesFromNestedScopes));
- }
- e.facts & 16 && Zn(t[re]) && d[re].push(Kr(e.thisNode, Yl.cannotExtractFunctionsContainingThisToMethod));
- let ie = !1, Se;
- if (_[re].usages.forEach((J) => {
- J.usage === 2 && (ie = !0, J.symbol.flags & 106500 && J.symbol.valueDeclaration && Z_(
- J.symbol.valueDeclaration,
- 8
- /* Readonly */
- ) && (Se = J.symbol.valueDeclaration));
- }), E.assert(R0(e.range) || T.length === 0, "No variable declarations expected if something was extracted"), ie && !R0(e.range)) {
- const J = Kr(e.range, Yl.cannotWriteInExpression);
- d[re].push(J), g[re].push(J);
- } else if (Se && re > 0) {
- const J = Kr(Se, Yl.cannotExtractReadonlyPropertyInitializerOutsideConstructor);
- d[re].push(J), g[re].push(J);
- } else if (C) {
- const J = Kr(C, Yl.cannotExtractExportedEntity);
- d[re].push(J), g[re].push(J);
- }
- }
- return { target: F, usagesPerScope: _, functionErrorsPerScope: d, constantErrorsPerScope: g, exposedVariableDeclarations: T };
- function z(re) {
- return !!or(re, (ne) => $j(ne) && Ey(ne).length !== 0);
- }
- function X(re) {
- const ne = s.getSymbolWalker(() => (o.throwIfCancellationRequested(), !0)), { visitedTypes: ie } = ne.walkType(re);
- for (const Se of ie)
- Se.isTypeParameter() && c.set(Se.id.toString(), Se);
- }
- function q(re, ne = 1) {
- if (B) {
- const ie = s.getTypeAtLocation(re);
- X(ie);
- }
- if (ql(re) && re.symbol && h.push(re), Dl(re))
- q(
- re.left,
- 2
- /* Write */
- ), q(re.right);
- else if (BY(re))
- q(
- re.operand,
- 2
- /* Write */
- );
- else if (Cn(re) || ko(re))
- bs(re, q);
- else if (Oe(re)) {
- if (!re.parent || Xu(re.parent) && re !== re.parent.left || Cn(re.parent) && re !== re.parent.expression)
- return;
- V(
- re,
- ne,
- /*isTypeNode*/
- um(re)
- );
- } else
- bs(re, q);
- }
- function V(re, ne, ie) {
- const Se = ae(re, ne, ie);
- if (Se)
- for (let J = 0; J < t.length; J++) {
- const oe = u[J].get(Se);
- oe && _[J].substitutions.set(Ma(re).toString(), oe);
- }
- }
- function ae(re, ne, ie) {
- const Se = G(re);
- if (!Se)
- return;
- const J = na(Se).toString(), oe = I.get(J);
- if (oe && oe >= ne)
- return J;
- if (I.set(J, ne), oe) {
- for (const le of _)
- le.usages.get(re.text) && le.usages.set(re.text, { usage: ne, symbol: Se, node: re });
- return J;
- }
- const _e = Se.getDeclarations(), he = _e && On(_e, (le) => le.getSourceFile() === i);
- if (he && !t8(n, he.getStart(), he.end)) {
- if (e.facts & 2 && ne === 2) {
- const le = Kr(re, Yl.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);
- for (const me of d)
- me.push(le);
- for (const me of g)
- me.push(le);
- }
- for (let le = 0; le < t.length; le++) {
- const me = t[le];
- if (s.resolveName(
- Se.name,
- me,
- Se.flags,
- /*excludeGlobals*/
- !1
- ) !== Se && !u[le].has(J)) {
- const tt = ue(Se.exportSymbol || Se, me, ie);
- if (tt)
- u[le].set(J, tt);
- else if (ie) {
- if (!(Se.flags & 262144)) {
- const Te = Kr(re, Yl.typeWillNotBeVisibleInTheNewScope);
- d[le].push(Te), g[le].push(Te);
- }
- } else
- _[le].usages.set(re.text, { usage: ne, symbol: Se, node: re });
- }
- }
- return J;
- }
- }
- function ee(re) {
- if (re === e.range || R0(e.range) && e.range.includes(re))
- return;
- const ne = Oe(re) ? G(re) : s.getSymbolAtLocation(re);
- if (ne) {
- const ie = On(h, (Se) => Se.symbol === ne);
- if (ie)
- if (ii(ie)) {
- const Se = ie.symbol.id.toString();
- S.has(Se) || (T.push(ie), S.set(Se, !0));
- } else
- C = C || ie;
- }
- bs(re, ee);
- }
- function G(re) {
- return re.parent && uu(re.parent) && re.parent.name === re ? s.getShorthandAssignmentValueSymbol(re.parent) : s.getSymbolAtLocation(re);
- }
- function ue(re, ne, ie) {
- if (!re)
- return;
- const Se = re.getDeclarations();
- if (Se && Se.some((oe) => oe.parent === ne))
- return A.createIdentifier(re.name);
- const J = ue(re.parent, ne, ie);
- if (J !== void 0)
- return ie ? A.createQualifiedName(J, A.createIdentifier(re.name)) : A.createPropertyAccessExpression(J, re.name);
- }
- }
- function MWe(e) {
- return or(e, (t) => t.parent && hSe(t) && !dn(t.parent));
- }
- function hSe(e) {
- const { parent: t } = e;
- switch (t.kind) {
- case 306:
- return !1;
- }
- switch (e.kind) {
- case 11:
- return t.kind !== 272 && t.kind !== 276;
- case 230:
- case 206:
- case 208:
- return !1;
- case 80:
- return t.kind !== 208 && t.kind !== 276 && t.kind !== 281;
- }
- return !0;
- }
- function voe(e) {
- return boe(e) || (Gg(e) || yS(e) || zb(e)) && (Gg(e.parent) || zb(e.parent));
- }
- function boe(e) {
- return oa(e) && e.parent && km(e.parent);
- }
- var RWe = {}, vq = "Generate 'get' and 'set' accessors", Soe = ms(p.Generate_get_and_set_accessors), Toe = {
- name: vq,
- description: Soe,
- kind: "refactor.rewrite.property.generateAccessors"
- };
- Qg(vq, {
- kinds: [Toe.kind],
- getEditsForAction: function(t, n) {
- if (!t.endPosition) return;
- const i = xu.getAccessorConvertiblePropertyAtPosition(t.file, t.program, t.startPosition, t.endPosition);
- E.assert(i && !Bh(i), "Expected applicable refactor info");
- const s = xu.generateAccessorFromProperty(t.file, t.program, t.startPosition, t.endPosition, t, n);
- if (!s) return;
- const o = t.file.fileName, c = i.renameAccessor ? i.accessorName : i.fieldName, u = (Oe(c) ? 0 : -1) + f8(
- s,
- o,
- c.text,
- /*preferLastLocation*/
- Ii(i.declaration)
- );
- return { renameFilename: o, renameLocation: u, edits: s };
- },
- getAvailableActions(e) {
- if (!e.endPosition) return Ue;
- const t = xu.getAccessorConvertiblePropertyAtPosition(e.file, e.program, e.startPosition, e.endPosition, e.triggerReason === "invoked");
- return t ? Bh(t) ? e.preferences.provideRefactorNotApplicableReason ? [{
- name: vq,
- description: Soe,
- actions: [{ ...Toe, notApplicableReason: t.error }]
- }] : Ue : [{
- name: vq,
- description: Soe,
- actions: [Toe]
- }] : Ue;
- }
- });
- var jWe = {}, bq = "Infer function return type", xoe = ms(p.Infer_function_return_type), Sq = {
- name: bq,
- description: xoe,
- kind: "refactor.rewrite.function.returnType"
- };
- Qg(bq, {
- kinds: [Sq.kind],
- getEditsForAction: BWe,
- getAvailableActions: JWe
- });
- function BWe(e) {
- const t = ySe(e);
- if (t && !Bh(t))
- return { renameFilename: void 0, renameLocation: void 0, edits: sn.ChangeTracker.with(e, (i) => zWe(e.file, i, t.declaration, t.returnTypeNode)) };
- }
- function JWe(e) {
- const t = ySe(e);
- return t ? Bh(t) ? e.preferences.provideRefactorNotApplicableReason ? [{
- name: bq,
- description: xoe,
- actions: [{ ...Sq, notApplicableReason: t.error }]
- }] : Ue : [{
- name: bq,
- description: xoe,
- actions: [Sq]
- }] : Ue;
- }
- function zWe(e, t, n, i) {
- const s = Ya(n, 22, e), o = Co(n) && s === void 0, c = o ? xa(n.parameters) : s;
- c && (o && (t.insertNodeBefore(e, c, A.createToken(
- 21
- /* OpenParenToken */
- )), t.insertNodeAfter(e, c, A.createToken(
- 22
- /* CloseParenToken */
- ))), t.insertNodeAt(e, c.end, i, { prefix: ": " }));
- }
- function ySe(e) {
- if (cn(e.file) || !Ev(Sq.kind, e.kind)) return;
- const t = h_(e.file, e.startPosition), n = or(t, (c) => Cs(c) || c.parent && Co(c.parent) && (c.kind === 39 || c.parent.body === c) ? "quit" : WWe(c));
- if (!n || !n.body || n.type)
- return { error: ms(p.Return_type_must_be_inferred_from_a_function) };
- const i = e.program.getTypeChecker();
- let s;
- if (i.isImplementationOfOverload(n)) {
- const c = i.getTypeAtLocation(n).getCallSignatures();
- c.length > 1 && (s = i.getUnionType(Ai(c, (_) => _.getReturnType())));
- }
- if (!s) {
- const c = i.getSignatureFromDeclaration(n);
- if (c) {
- const _ = i.getTypePredicateOfSignature(c);
- if (_ && _.type) {
- const u = i.typePredicateToTypePredicateNode(
- _,
- n,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- if (u)
- return { declaration: n, returnTypeNode: u };
- } else
- s = i.getReturnTypeOfSignature(c);
- }
- }
- if (!s)
- return { error: ms(p.Could_not_determine_function_return_type) };
- const o = i.typeToTypeNode(
- s,
- n,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- if (o)
- return { declaration: n, returnTypeNode: o };
- }
- function WWe(e) {
- switch (e.kind) {
- case 262:
- case 218:
- case 219:
- case 174:
- return !0;
- default:
- return !1;
- }
- }
- var vSe = /* @__PURE__ */ ((e) => (e[e.typeOffset = 8] = "typeOffset", e[e.modifierMask = 255] = "modifierMask", e))(vSe || {}), bSe = /* @__PURE__ */ ((e) => (e[e.class = 0] = "class", e[e.enum = 1] = "enum", e[e.interface = 2] = "interface", e[e.namespace = 3] = "namespace", e[e.typeParameter = 4] = "typeParameter", e[e.type = 5] = "type", e[e.parameter = 6] = "parameter", e[e.variable = 7] = "variable", e[e.enumMember = 8] = "enumMember", e[e.property = 9] = "property", e[e.function = 10] = "function", e[e.member = 11] = "member", e))(bSe || {}), SSe = /* @__PURE__ */ ((e) => (e[e.declaration = 0] = "declaration", e[e.static = 1] = "static", e[e.async = 2] = "async", e[e.readonly = 3] = "readonly", e[e.defaultLibrary = 4] = "defaultLibrary", e[e.local = 5] = "local", e))(SSe || {});
- function TSe(e, t, n, i) {
- const s = koe(e, t, n, i);
- E.assert(s.spans.length % 3 === 0);
- const o = s.spans, c = [];
- for (let _ = 0; _ < o.length; _ += 3)
- c.push({
- textSpan: Ul(o[_], o[_ + 1]),
- classificationType: o[_ + 2]
- });
- return c;
- }
- function koe(e, t, n, i) {
- return {
- spans: UWe(e, n, i, t),
- endOfLineState: 0
- /* None */
- };
- }
- function UWe(e, t, n, i) {
- const s = [];
- return e && t && VWe(e, t, n, (c, _, u) => {
- s.push(c.getStart(t), c.getWidth(t), (_ + 1 << 8) + u);
- }, i), s;
- }
- function VWe(e, t, n, i, s) {
- const o = e.getTypeChecker();
- let c = !1;
- function _(u) {
- switch (u.kind) {
- case 267:
- case 263:
- case 264:
- case 262:
- case 231:
- case 218:
- case 219:
- s.throwIfCancellationRequested();
- }
- if (!u || !bw(n, u.pos, u.getFullWidth()) || u.getFullWidth() === 0)
- return;
- const d = c;
- if ((Gg(u) || yS(u)) && (c = !0), lD(u) && (c = !1), Oe(u) && !c && !$We(u) && !G4(u.escapedText)) {
- let g = o.getSymbolAtLocation(u);
- if (g) {
- g.flags & 2097152 && (g = o.getAliasedSymbol(g));
- let h = qWe(g, wS(u));
- if (h !== void 0) {
- let S = 0;
- u.parent && (va(u.parent) || CSe.get(u.parent.kind) === h) && u.parent.name === u && (S = 1), h === 6 && kSe(u) && (h = 9), h = HWe(o, u, h);
- const T = g.valueDeclaration;
- if (T) {
- const C = U1(T), D = xh(T);
- C & 256 && (S |= 2), C & 1024 && (S |= 4), h !== 0 && h !== 2 && (C & 8 || D & 2 || g.getFlags() & 8) && (S |= 8), (h === 7 || h === 10) && GWe(T, t) && (S |= 32), e.isSourceFileDefaultLibrary(T.getSourceFile()) && (S |= 16);
- } else g.declarations && g.declarations.some((C) => e.isSourceFileDefaultLibrary(C.getSourceFile())) && (S |= 16);
- i(u, h, S);
- }
- }
- }
- bs(u, _), c = d;
- }
- _(t);
- }
- function qWe(e, t) {
- const n = e.getFlags();
- if (n & 32)
- return 0;
- if (n & 384)
- return 1;
- if (n & 524288)
- return 5;
- if (n & 64) {
- if (t & 2)
- return 2;
- } else if (n & 262144)
- return 4;
- let i = e.valueDeclaration || e.declarations && e.declarations[0];
- return i && va(i) && (i = xSe(i)), i && CSe.get(i.kind);
- }
- function HWe(e, t, n) {
- if (n === 7 || n === 9 || n === 6) {
- const i = e.getTypeAtLocation(t);
- if (i) {
- const s = (o) => o(i) || i.isUnion() && i.types.some(o);
- if (n !== 6 && s((o) => o.getConstructSignatures().length > 0))
- return 0;
- if (s((o) => o.getCallSignatures().length > 0) && !s((o) => o.getProperties().length > 0) || XWe(t))
- return n === 9 ? 11 : 10;
- }
- }
- return n;
- }
- function GWe(e, t) {
- return va(e) && (e = xSe(e)), ii(e) ? (!Si(e.parent.parent.parent) || Ub(e.parent)) && e.getSourceFile() === t : Ec(e) ? !Si(e.parent) && e.getSourceFile() === t : !1;
- }
- function xSe(e) {
- for (; ; )
- if (va(e.parent.parent))
- e = e.parent.parent;
- else
- return e.parent.parent;
- }
- function $We(e) {
- const t = e.parent;
- return t && (Ad(t) || Zu(t) || Hg(t));
- }
- function XWe(e) {
- for (; kSe(e); )
- e = e.parent;
- return Fs(e.parent) && e.parent.expression === e;
- }
- function kSe(e) {
- return Xu(e.parent) && e.parent.right === e || Cn(e.parent) && e.parent.name === e;
- }
- var CSe = /* @__PURE__ */ new Map([
- [
- 260,
- 7
- /* variable */
- ],
- [
- 169,
- 6
- /* parameter */
- ],
- [
- 172,
- 9
- /* property */
- ],
- [
- 267,
- 3
- /* namespace */
- ],
- [
- 266,
- 1
- /* enum */
- ],
- [
- 306,
- 8
- /* enumMember */
- ],
- [
- 263,
- 0
- /* class */
- ],
- [
- 174,
- 11
- /* member */
- ],
- [
- 262,
- 10
- /* function */
- ],
- [
- 218,
- 10
- /* function */
- ],
- [
- 173,
- 11
- /* member */
- ],
- [
- 177,
- 9
- /* property */
- ],
- [
- 178,
- 9
- /* property */
- ],
- [
- 171,
- 9
- /* property */
- ],
- [
- 264,
- 2
- /* interface */
- ],
- [
- 265,
- 5
- /* type */
- ],
- [
- 168,
- 4
- /* typeParameter */
- ],
- [
- 303,
- 9
- /* property */
- ],
- [
- 304,
- 9
- /* property */
- ]
- ]), ESe = "0.8";
- function DSe(e, t, n, i) {
- const s = WI(e) ? new Coe(e, t, n) : e === 80 ? new wSe(80, t, n) : e === 81 ? new ASe(81, t, n) : new PSe(e, t, n);
- return s.parent = i, s.flags = i.flags & 101441536, s;
- }
- var Coe = class {
- constructor(e, t, n) {
- this.pos = t, this.end = n, this.kind = e, this.id = 0, this.flags = 0, this.modifierFlagsCache = 0, this.transformFlags = 0, this.parent = void 0, this.original = void 0, this.emitNode = void 0;
- }
- assertHasRealPosition(e) {
- E.assert(!Pd(this.pos) && !Pd(this.end), e || "Node must have a real position for this operation");
- }
- getSourceFile() {
- return Tr(this);
- }
- getStart(e, t) {
- return this.assertHasRealPosition(), Oy(this, e, t);
- }
- getFullStart() {
- return this.assertHasRealPosition(), this.pos;
- }
- getEnd() {
- return this.assertHasRealPosition(), this.end;
- }
- getWidth(e) {
- return this.assertHasRealPosition(), this.getEnd() - this.getStart(e);
- }
- getFullWidth() {
- return this.assertHasRealPosition(), this.end - this.pos;
- }
- getLeadingTriviaWidth(e) {
- return this.assertHasRealPosition(), this.getStart(e) - this.pos;
- }
- getFullText(e) {
- return this.assertHasRealPosition(), (e || this.getSourceFile()).text.substring(this.pos, this.end);
- }
- getText(e) {
- return this.assertHasRealPosition(), e || (e = this.getSourceFile()), e.text.substring(this.getStart(e), this.getEnd());
- }
- getChildCount(e) {
- return this.getChildren(e).length;
- }
- getChildAt(e, t) {
- return this.getChildren(t)[e];
- }
- getChildren(e = Tr(this)) {
- return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"), GJ(this, e) ?? ote(this, e, QWe(this, e));
- }
- getFirstToken(e) {
- this.assertHasRealPosition();
- const t = this.getChildren(e);
- if (!t.length)
- return;
- const n = On(
- t,
- (i) => i.kind < 309 || i.kind > 351
- /* LastJSDocNode */
- );
- return n.kind < 166 ? n : n.getFirstToken(e);
- }
- getLastToken(e) {
- this.assertHasRealPosition();
- const t = this.getChildren(e), n = Ro(t);
- if (n)
- return n.kind < 166 ? n : n.getLastToken(e);
- }
- forEachChild(e, t) {
- return bs(this, e, t);
- }
- };
- function QWe(e, t) {
- const n = [];
- if (QI(e))
- return e.forEachChild((c) => {
- n.push(c);
- }), n;
- ju.setText((t || e.getSourceFile()).text);
- let i = e.pos;
- const s = (c) => {
- j9(n, i, c.pos, e), n.push(c), i = c.end;
- }, o = (c) => {
- j9(n, i, c.pos, e), n.push(YWe(c, e)), i = c.end;
- };
- return ir(e.jsDoc, s), i = e.pos, e.forEachChild(s, o), j9(n, i, e.end, e), ju.setText(void 0), n;
- }
- function j9(e, t, n, i) {
- for (ju.resetTokenState(t); t < n; ) {
- const s = ju.scan(), o = ju.getTokenEnd();
- if (o <= n) {
- if (s === 80) {
- if (uee(i))
- continue;
- E.fail(`Did not expect ${E.formatSyntaxKind(i.kind)} to have an Identifier in its trivia`);
- }
- e.push(DSe(s, t, o, i));
- }
- if (t = o, s === 1)
- break;
- }
- }
- function YWe(e, t) {
- const n = DSe(352, e.pos, e.end, t), i = [];
- let s = e.pos;
- for (const o of e)
- j9(i, s, o.pos, t), i.push(o), s = o.end;
- return j9(i, s, e.end, t), n._children = i, n;
- }
- var Eoe = class {
- constructor(e, t, n) {
- this.pos = t, this.end = n, this.kind = e, this.id = 0, this.flags = 0, this.transformFlags = 0, this.parent = void 0, this.emitNode = void 0;
- }
- getSourceFile() {
- return Tr(this);
- }
- getStart(e, t) {
- return Oy(this, e, t);
- }
- getFullStart() {
- return this.pos;
- }
- getEnd() {
- return this.end;
- }
- getWidth(e) {
- return this.getEnd() - this.getStart(e);
- }
- getFullWidth() {
- return this.end - this.pos;
- }
- getLeadingTriviaWidth(e) {
- return this.getStart(e) - this.pos;
- }
- getFullText(e) {
- return (e || this.getSourceFile()).text.substring(this.pos, this.end);
- }
- getText(e) {
- return e || (e = this.getSourceFile()), e.text.substring(this.getStart(e), this.getEnd());
- }
- getChildCount() {
- return this.getChildren().length;
- }
- getChildAt(e) {
- return this.getChildren()[e];
- }
- getChildren() {
- return this.kind === 1 && this.jsDoc || Ue;
- }
- getFirstToken() {
- }
- getLastToken() {
- }
- forEachChild() {
- }
- }, ZWe = class {
- constructor(e, t) {
- this.flags = e, this.escapedName = t, this.declarations = void 0, this.valueDeclaration = void 0, this.id = 0, this.mergeId = 0, this.parent = void 0, this.members = void 0, this.exports = void 0, this.exportSymbol = void 0, this.constEnumOnlyModule = void 0, this.isReferenced = void 0, this.lastAssignmentPos = void 0, this.links = void 0;
- }
- getFlags() {
- return this.flags;
- }
- get name() {
- return mc(this);
- }
- getEscapedName() {
- return this.escapedName;
- }
- getName() {
- return this.name;
- }
- getDeclarations() {
- return this.declarations;
- }
- getDocumentationComment(e) {
- if (!this.documentationComment)
- if (this.documentationComment = Ue, !this.declarations && Lg(this) && this.links.target && Lg(this.links.target) && this.links.target.links.tupleLabelDeclaration) {
- const t = this.links.target.links.tupleLabelDeclaration;
- this.documentationComment = B9([t], e);
- } else
- this.documentationComment = B9(this.declarations, e);
- return this.documentationComment;
- }
- getContextualDocumentationComment(e, t) {
- if (e) {
- if (d0(e) && (this.contextualGetAccessorDocumentationComment || (this.contextualGetAccessorDocumentationComment = B9(Ln(this.declarations, d0), t)), Nr(this.contextualGetAccessorDocumentationComment)))
- return this.contextualGetAccessorDocumentationComment;
- if (om(e) && (this.contextualSetAccessorDocumentationComment || (this.contextualSetAccessorDocumentationComment = B9(Ln(this.declarations, om), t)), Nr(this.contextualSetAccessorDocumentationComment)))
- return this.contextualSetAccessorDocumentationComment;
- }
- return this.getDocumentationComment(t);
- }
- getJsDocTags(e) {
- return this.tags === void 0 && (this.tags = Ue, this.tags = Tq(this.declarations, e)), this.tags;
- }
- getContextualJsDocTags(e, t) {
- if (e) {
- if (d0(e) && (this.contextualGetAccessorTags || (this.contextualGetAccessorTags = Tq(Ln(this.declarations, d0), t)), Nr(this.contextualGetAccessorTags)))
- return this.contextualGetAccessorTags;
- if (om(e) && (this.contextualSetAccessorTags || (this.contextualSetAccessorTags = Tq(Ln(this.declarations, om), t)), Nr(this.contextualSetAccessorTags)))
- return this.contextualSetAccessorTags;
- }
- return this.getJsDocTags(t);
- }
- }, PSe = class extends Eoe {
- constructor(e, t, n) {
- super(e, t, n);
- }
- }, wSe = class extends Eoe {
- constructor(e, t, n) {
- super(e, t, n);
- }
- get text() {
- return Nn(this);
- }
- }, ASe = class extends Eoe {
- constructor(e, t, n) {
- super(e, t, n);
- }
- get text() {
- return Nn(this);
- }
- }, KWe = class {
- constructor(e, t) {
- this.flags = t, this.checker = e;
- }
- getFlags() {
- return this.flags;
- }
- getSymbol() {
- return this.symbol;
- }
- getProperties() {
- return this.checker.getPropertiesOfType(this);
- }
- getProperty(e) {
- return this.checker.getPropertyOfType(this, e);
- }
- getApparentProperties() {
- return this.checker.getAugmentedPropertiesOfType(this);
- }
- getCallSignatures() {
- return this.checker.getSignaturesOfType(
- this,
- 0
- /* Call */
- );
- }
- getConstructSignatures() {
- return this.checker.getSignaturesOfType(
- this,
- 1
- /* Construct */
- );
- }
- getStringIndexType() {
- return this.checker.getIndexTypeOfType(
- this,
- 0
- /* String */
- );
- }
- getNumberIndexType() {
- return this.checker.getIndexTypeOfType(
- this,
- 1
- /* Number */
- );
- }
- getBaseTypes() {
- return this.isClassOrInterface() ? this.checker.getBaseTypes(this) : void 0;
- }
- isNullableType() {
- return this.checker.isNullableType(this);
- }
- getNonNullableType() {
- return this.checker.getNonNullableType(this);
- }
- getNonOptionalType() {
- return this.checker.getNonOptionalType(this);
- }
- getConstraint() {
- return this.checker.getBaseConstraintOfType(this);
- }
- getDefault() {
- return this.checker.getDefaultFromTypeParameter(this);
- }
- isUnion() {
- return !!(this.flags & 1048576);
- }
- isIntersection() {
- return !!(this.flags & 2097152);
- }
- isUnionOrIntersection() {
- return !!(this.flags & 3145728);
- }
- isLiteral() {
- return !!(this.flags & 2432);
- }
- isStringLiteral() {
- return !!(this.flags & 128);
- }
- isNumberLiteral() {
- return !!(this.flags & 256);
- }
- isTypeParameter() {
- return !!(this.flags & 262144);
- }
- isClassOrInterface() {
- return !!(wn(this) & 3);
- }
- isClass() {
- return !!(wn(this) & 1);
- }
- isIndexType() {
- return !!(this.flags & 4194304);
- }
- /**
- * This polyfills `referenceType.typeArguments` for API consumers
- */
- get typeArguments() {
- if (wn(this) & 4)
- return this.checker.getTypeArguments(this);
- }
- }, eUe = class {
- // same
- constructor(e, t) {
- this.flags = t, this.checker = e;
- }
- getDeclaration() {
- return this.declaration;
- }
- getTypeParameters() {
- return this.typeParameters;
- }
- getParameters() {
- return this.parameters;
- }
- getReturnType() {
- return this.checker.getReturnTypeOfSignature(this);
- }
- getTypeParameterAtPosition(e) {
- const t = this.checker.getParameterType(this, e);
- if (t.isIndexType() && $4(t.type)) {
- const n = t.type.getConstraint();
- if (n)
- return this.checker.getIndexType(n);
- }
- return t;
- }
- getDocumentationComment() {
- return this.documentationComment || (this.documentationComment = B9(MT(this.declaration), this.checker));
- }
- getJsDocTags() {
- return this.jsDocTags || (this.jsDocTags = Tq(MT(this.declaration), this.checker));
- }
- };
- function NSe(e) {
- return H1(e).some((t) => t.tagName.text === "inheritDoc" || t.tagName.text === "inheritdoc");
- }
- function Tq(e, t) {
- if (!e) return Ue;
- let n = wv.getJsDocTagsFromDeclarations(e, t);
- if (t && (n.length === 0 || e.some(NSe))) {
- const i = /* @__PURE__ */ new Set();
- for (const s of e) {
- const o = ISe(t, s, (c) => {
- var _;
- if (!i.has(c))
- return i.add(c), s.kind === 177 || s.kind === 178 ? c.getContextualJsDocTags(s, t) : ((_ = c.declarations) == null ? void 0 : _.length) === 1 ? c.getJsDocTags(t) : void 0;
- });
- o && (n = [...o, ...n]);
- }
- }
- return n;
- }
- function B9(e, t) {
- if (!e) return Ue;
- let n = wv.getJsDocCommentsFromDeclarations(e, t);
- if (t && (n.length === 0 || e.some(NSe))) {
- const i = /* @__PURE__ */ new Set();
- for (const s of e) {
- const o = ISe(t, s, (c) => {
- if (!i.has(c))
- return i.add(c), s.kind === 177 || s.kind === 178 ? c.getContextualDocumentationComment(s, t) : c.getDocumentationComment(t);
- });
- o && (n = n.length === 0 ? o.slice() : o.concat(E6(), n));
- }
- }
- return n;
- }
- function ISe(e, t, n) {
- var i;
- const s = ((i = t.parent) == null ? void 0 : i.kind) === 176 ? t.parent.parent : t.parent;
- if (!s) return;
- const o = tl(t);
- return Tc(T4(s), (c) => {
- const _ = e.getTypeAtLocation(c), u = o && _.symbol ? e.getTypeOfSymbol(_.symbol) : _, d = e.getPropertyOfType(u, t.symbol.name);
- return d ? n(d) : void 0;
- });
- }
- var tUe = class extends Coe {
- constructor(e, t, n) {
- super(e, t, n);
- }
- update(e, t) {
- return cz(this, e, t);
- }
- getLineAndCharacterOfPosition(e) {
- return Qs(this, e);
- }
- getLineStarts() {
- return Ag(this);
- }
- getPositionOfLineAndCharacter(e, t, n) {
- return NI(Ag(this), e, t, this.text, n);
- }
- getLineEndOfPosition(e) {
- const { line: t } = this.getLineAndCharacterOfPosition(e), n = this.getLineStarts();
- let i;
- t + 1 >= n.length && (i = this.getEnd()), i || (i = n[t + 1] - 1);
- const s = this.getFullText();
- return s[i] === `
-` && s[i - 1] === "\r" ? i - 1 : i;
- }
- getNamedDeclarations() {
- return this.namedDeclarations || (this.namedDeclarations = this.computeNamedDeclarations()), this.namedDeclarations;
- }
- computeNamedDeclarations() {
- const e = Ip();
- return this.forEachChild(s), e;
- function t(o) {
- const c = i(o);
- c && e.add(c, o);
- }
- function n(o) {
- let c = e.get(o);
- return c || e.set(o, c = []), c;
- }
- function i(o) {
- const c = FI(o);
- return c && (ma(c) && Cn(c.expression) ? c.expression.name.text : Bc(c) ? o8(c) : void 0);
- }
- function s(o) {
- switch (o.kind) {
- case 262:
- case 218:
- case 174:
- case 173:
- const c = o, _ = i(c);
- if (_) {
- const g = n(_), h = Ro(g);
- h && c.parent === h.parent && c.symbol === h.symbol ? c.body && !h.body && (g[g.length - 1] = c) : g.push(c);
- }
- bs(o, s);
- break;
- case 263:
- case 231:
- case 264:
- case 265:
- case 266:
- case 267:
- case 271:
- case 281:
- case 276:
- case 273:
- case 274:
- case 177:
- case 178:
- case 187:
- t(o), bs(o, s);
- break;
- case 169:
- if (!Gn(
- o,
- 31
- /* ParameterPropertyModifier */
- ))
- break;
- case 260:
- case 208: {
- const g = o;
- if (As(g.name)) {
- bs(g.name, s);
- break;
- }
- g.initializer && s(g.initializer);
- }
- case 306:
- case 172:
- case 171:
- t(o);
- break;
- case 278:
- const u = o;
- u.exportClause && (pp(u.exportClause) ? ir(u.exportClause.elements, s) : s(u.exportClause.name));
- break;
- case 272:
- const d = o.importClause;
- d && (d.name && t(d.name), d.namedBindings && (d.namedBindings.kind === 274 ? t(d.namedBindings) : ir(d.namedBindings.elements, s)));
- break;
- case 226:
- Cc(o) !== 0 && t(o);
- default:
- bs(o, s);
- }
- }
- }
- }, rUe = class {
- constructor(e, t, n) {
- this.fileName = e, this.text = t, this.skipTrivia = n || ((i) => i);
- }
- getLineAndCharacterOfPosition(e) {
- return Qs(this, e);
- }
- };
- function nUe() {
- return {
- getNodeConstructor: () => Coe,
- getTokenConstructor: () => PSe,
- getIdentifierConstructor: () => wSe,
- getPrivateIdentifierConstructor: () => ASe,
- getSourceFileConstructor: () => tUe,
- getSymbolConstructor: () => ZWe,
- getTypeConstructor: () => KWe,
- getSignatureConstructor: () => eUe,
- getSourceMapSourceConstructor: () => rUe
- };
- }
- function D8(e) {
- let t = !0;
- for (const i in e)
- if (co(e, i) && !OSe(i)) {
- t = !1;
- break;
- }
- if (t)
- return e;
- const n = {};
- for (const i in e)
- if (co(e, i)) {
- const s = OSe(i) ? i : i.charAt(0).toLowerCase() + i.substr(1);
- n[s] = e[i];
- }
- return n;
- }
- function OSe(e) {
- return !e.length || e.charAt(0) === e.charAt(0).toLowerCase();
- }
- function P8(e) {
- return e ? lr(e, (t) => t.text).join("") : "";
- }
- function J9() {
- return {
- target: 1,
- jsx: 1
- /* Preserve */
- };
- }
- function xq() {
- return xu.getSupportedErrorCodes();
- }
- var iUe = class {
- constructor(e) {
- this.host = e;
- }
- getCurrentSourceFile(e) {
- var t, n, i, s, o, c, _, u;
- const d = this.host.getScriptSnapshot(e);
- if (!d)
- throw new Error("Could not find file: '" + e + "'.");
- const g = xV(e, this.host), h = this.host.getScriptVersion(e);
- let S;
- if (this.currentFileName !== e) {
- const T = {
- languageVersion: 99,
- impliedNodeFormat: zA(
- uo(e, this.host.getCurrentDirectory(), ((i = (n = (t = this.host).getCompilerHost) == null ? void 0 : n.call(t)) == null ? void 0 : i.getCanonicalFileName) || S0(this.host)),
- (u = (_ = (c = (o = (s = this.host).getCompilerHost) == null ? void 0 : o.call(s)) == null ? void 0 : c.getModuleResolutionCache) == null ? void 0 : _.call(c)) == null ? void 0 : u.getPackageJsonInfoCache(),
- this.host,
- this.host.getCompilationSettings()
- ),
- setExternalModuleIndicator: L3(this.host.getCompilationSettings()),
- // These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll.
- jsDocParsingMode: 0
- /* ParseAll */
- };
- S = z9(
- e,
- d,
- T,
- h,
- /*setNodeParents*/
- !0,
- g
- );
- } else if (this.currentFileVersion !== h) {
- const T = d.getChangeRange(this.currentFileScriptSnapshot);
- S = kq(this.currentSourceFile, d, h, T);
- }
- return S && (this.currentFileVersion = h, this.currentFileName = e, this.currentFileScriptSnapshot = d, this.currentSourceFile = S), this.currentSourceFile;
- }
- };
- function FSe(e, t, n) {
- e.version = n, e.scriptSnapshot = t;
- }
- function z9(e, t, n, i, s, o) {
- const c = Bx(e, Yx(t), n, s, o);
- return FSe(c, t, i), c;
- }
- function kq(e, t, n, i, s) {
- if (i && n !== e.version) {
- let c;
- const _ = i.span.start !== 0 ? e.text.substr(0, i.span.start) : "", u = ec(i.span) !== e.text.length ? e.text.substr(ec(i.span)) : "";
- if (i.newLength === 0)
- c = _ && u ? _ + u : _ || u;
- else {
- const g = t.getText(i.span.start, i.span.start + i.newLength);
- c = _ && u ? _ + g + u : _ ? _ + g : g + u;
- }
- const d = cz(e, c, i, s);
- return FSe(d, t, n), d.nameTable = void 0, e !== d && e.scriptSnapshot && (e.scriptSnapshot.dispose && e.scriptSnapshot.dispose(), e.scriptSnapshot = void 0), d;
- }
- const o = {
- languageVersion: e.languageVersion,
- impliedNodeFormat: e.impliedNodeFormat,
- setExternalModuleIndicator: e.setExternalModuleIndicator,
- jsDocParsingMode: e.jsDocParsingMode
- };
- return z9(
- e.fileName,
- t,
- o,
- n,
- /*setNodeParents*/
- !0,
- e.scriptKind
- );
- }
- var sUe = {
- isCancellationRequested: nm,
- throwIfCancellationRequested: ja
- }, aUe = class {
- constructor(e) {
- this.cancellationToken = e;
- }
- isCancellationRequested() {
- return this.cancellationToken.isCancellationRequested();
- }
- throwIfCancellationRequested() {
- var e;
- if (this.isCancellationRequested())
- throw (e = rn) == null || e.instant(rn.Phase.Session, "cancellationThrown", { kind: "CancellationTokenObject" }), new JE();
- }
- }, Doe = class {
- constructor(e, t = 20) {
- this.hostCancellationToken = e, this.throttleWaitMilliseconds = t, this.lastCancellationCheckTime = 0;
- }
- isCancellationRequested() {
- const e = lo();
- return Math.abs(e - this.lastCancellationCheckTime) >= this.throttleWaitMilliseconds ? (this.lastCancellationCheckTime = e, this.hostCancellationToken.isCancellationRequested()) : !1;
- }
- throwIfCancellationRequested() {
- var e;
- if (this.isCancellationRequested())
- throw (e = rn) == null || e.instant(rn.Phase.Session, "cancellationThrown", { kind: "ThrottledCancellationToken" }), new JE();
- }
- }, LSe = [
- "getSemanticDiagnostics",
- "getSuggestionDiagnostics",
- "getCompilerOptionsDiagnostics",
- "getSemanticClassifications",
- "getEncodedSemanticClassifications",
- "getCodeFixesAtPosition",
- "getCombinedCodeFix",
- "applyCodeActionCommand",
- "organizeImports",
- "getEditsForFileRename",
- "getEmitOutput",
- "getApplicableRefactors",
- "getEditsForRefactor",
- "prepareCallHierarchy",
- "provideCallHierarchyIncomingCalls",
- "provideCallHierarchyOutgoingCalls",
- "provideInlayHints",
- "getSupportedCodeFixes",
- "getPasteEdits"
- ], oUe = [
- ...LSe,
- "getCompletionsAtPosition",
- "getCompletionEntryDetails",
- "getCompletionEntrySymbol",
- "getSignatureHelpItems",
- "getQuickInfoAtPosition",
- "getDefinitionAtPosition",
- "getDefinitionAndBoundSpan",
- "getImplementationAtPosition",
- "getTypeDefinitionAtPosition",
- "getReferencesAtPosition",
- "findReferences",
- "getDocumentHighlights",
- "getNavigateToItems",
- "getRenameInfo",
- "findRenameLocations",
- "getApplicableRefactors"
- ];
- function Poe(e, t = Zse(e.useCaseSensitiveFileNames && e.useCaseSensitiveFileNames(), e.getCurrentDirectory(), e.jsDocParsingMode), n) {
- var i;
- let s;
- n === void 0 ? s = 0 : typeof n == "boolean" ? s = n ? 2 : 0 : s = n;
- const o = new iUe(e);
- let c, _, u = 0;
- const d = e.getCancellationToken ? new aUe(e.getCancellationToken()) : sUe, g = e.getCurrentDirectory();
- LK((i = e.getLocalizedDiagnosticMessages) == null ? void 0 : i.bind(e));
- function h(nt) {
- e.log && e.log(nt);
- }
- const S = sx(e), T = zl(S), C = fae({
- useCaseSensitiveFileNames: () => S,
- getCurrentDirectory: () => g,
- getProgram: F,
- fileExists: Ms(e, e.fileExists),
- readFile: Ms(e, e.readFile),
- getDocumentPositionMapper: Ms(e, e.getDocumentPositionMapper),
- getSourceFileLike: Ms(e, e.getSourceFileLike),
- log: h
- });
- function D(nt) {
- const ot = c.getSourceFile(nt);
- if (!ot) {
- const wt = new Error(`Could not find source file: '${nt}'.`);
- throw wt.ProgramFiles = c.getSourceFiles().map((jt) => jt.fileName), wt;
- }
- return ot;
- }
- function P() {
- e.updateFromProject && !e.updateFromProjectInProgress ? e.updateFromProject() : I();
- }
- function I() {
- var nt, ot, wt;
- if (E.assert(
- s !== 2
- /* Syntactic */
- ), e.getProjectVersion) {
- const Yi = e.getProjectVersion();
- if (Yi) {
- if (_ === Yi && !((nt = e.hasChangedAutomaticTypeDirectiveNames) != null && nt.call(e)))
- return;
- _ = Yi;
- }
- }
- const jt = e.getTypeRootsVersion ? e.getTypeRootsVersion() : 0;
- u !== jt && (h("TypeRoots version has changed; provide new program"), c = void 0, u = jt);
- const Xt = e.getScriptFileNames().slice(), Ht = e.getCompilationSettings() || J9(), en = e.hasInvalidatedResolutions || nm, zt = Ms(e, e.hasInvalidatedLibResolutions) || nm, mr = Ms(e, e.hasChangedAutomaticTypeDirectiveNames), Kt = (ot = e.getProjectReferences) == null ? void 0 : ot.call(e);
- let hr, Ft = {
- getSourceFile: Cu,
- getSourceFileByPath: Zc,
- getCancellationToken: () => d,
- getCanonicalFileName: T,
- useCaseSensitiveFileNames: () => S,
- getNewLine: () => k0(Ht),
- getDefaultLibFileName: (Yi) => e.getDefaultLibFileName(Yi),
- writeFile: ja,
- getCurrentDirectory: () => g,
- fileExists: (Yi) => e.fileExists(Yi),
- readFile: (Yi) => e.readFile && e.readFile(Yi),
- getSymlinkCache: Ms(e, e.getSymlinkCache),
- realpath: Ms(e, e.realpath),
- directoryExists: (Yi) => Dd(Yi, e),
- getDirectories: (Yi) => e.getDirectories ? e.getDirectories(Yi) : [],
- readDirectory: (Yi, Na, Ia, Vi, ba) => (E.checkDefined(e.readDirectory, "'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"), e.readDirectory(Yi, Na, Ia, Vi, ba)),
- onReleaseOldSourceFile: xs,
- onReleaseParsedCommandLine: ca,
- hasInvalidatedResolutions: en,
- hasInvalidatedLibResolutions: zt,
- hasChangedAutomaticTypeDirectiveNames: mr,
- trace: Ms(e, e.trace),
- resolveModuleNames: Ms(e, e.resolveModuleNames),
- getModuleResolutionCache: Ms(e, e.getModuleResolutionCache),
- createHash: Ms(e, e.createHash),
- resolveTypeReferenceDirectives: Ms(e, e.resolveTypeReferenceDirectives),
- resolveModuleNameLiterals: Ms(e, e.resolveModuleNameLiterals),
- resolveTypeReferenceDirectiveReferences: Ms(e, e.resolveTypeReferenceDirectiveReferences),
- resolveLibrary: Ms(e, e.resolveLibrary),
- useSourceOfProjectReferenceRedirect: Ms(e, e.useSourceOfProjectReferenceRedirect),
- getParsedCommandLine: io,
- jsDocParsingMode: e.jsDocParsingMode
- };
- const Ss = Ft.getSourceFile, { getSourceFileWithCache: gs } = MD(
- Ft,
- (Yi) => uo(Yi, g, T),
- (...Yi) => Ss.call(Ft, ...Yi)
- );
- Ft.getSourceFile = gs, (wt = e.setCompilerHost) == null || wt.call(e, Ft);
- const Ts = {
- useCaseSensitiveFileNames: S,
- fileExists: (Yi) => Ft.fileExists(Yi),
- readFile: (Yi) => Ft.readFile(Yi),
- directoryExists: (Yi) => Ft.directoryExists(Yi),
- getDirectories: (Yi) => Ft.getDirectories(Yi),
- realpath: Ft.realpath,
- readDirectory: (...Yi) => Ft.readDirectory(...Yi),
- trace: Ft.trace,
- getCurrentDirectory: Ft.getCurrentDirectory,
- onUnRecoverableConfigFileDiagnostic: ja
- }, Ua = t.getKeyForCompilationSettings(Ht);
- let lc = /* @__PURE__ */ new Set();
- if (JW(c, Xt, Ht, (Yi, Na) => e.getScriptVersion(Na), (Yi) => Ft.fileExists(Yi), en, zt, mr, io, Kt)) {
- Ft = void 0, hr = void 0, lc = void 0;
- return;
- }
- c = WA({
- rootNames: Xt,
- options: Ht,
- host: Ft,
- oldProgram: c,
- projectReferences: Kt
- }), Ft = void 0, hr = void 0, lc = void 0, C.clearCache(), c.getTypeChecker();
- return;
- function io(Yi) {
- const Na = uo(Yi, g, T), Ia = hr?.get(Na);
- if (Ia !== void 0) return Ia || void 0;
- const Vi = e.getParsedCommandLine ? e.getParsedCommandLine(Yi) : vi(Yi);
- return (hr || (hr = /* @__PURE__ */ new Map())).set(Na, Vi || !1), Vi;
- }
- function vi(Yi) {
- const Na = Cu(
- Yi,
- 100
- /* JSON */
- );
- if (Na)
- return Na.path = uo(Yi, g, T), Na.resolvedPath = Na.path, Na.originalFileName = Na.fileName, SA(
- Na,
- Ts,
- es(Xn(Yi), g),
- /*existingOptions*/
- void 0,
- es(Yi, g)
- );
- }
- function ca(Yi, Na, Ia) {
- var Vi;
- e.getParsedCommandLine ? (Vi = e.onReleaseParsedCommandLine) == null || Vi.call(e, Yi, Na, Ia) : Na && Ll(Na.sourceFile, Ia);
- }
- function Ll(Yi, Na) {
- const Ia = t.getKeyForCompilationSettings(Na);
- t.releaseDocumentWithKey(Yi.resolvedPath, Ia, Yi.scriptKind, Yi.impliedNodeFormat);
- }
- function xs(Yi, Na, Ia, Vi) {
- var ba;
- Ll(Yi, Na), (ba = e.onReleaseOldSourceFile) == null || ba.call(e, Yi, Na, Ia, Vi);
- }
- function Cu(Yi, Na, Ia, Vi) {
- return Zc(Yi, uo(Yi, g, T), Na, Ia, Vi);
- }
- function Zc(Yi, Na, Ia, Vi, ba) {
- E.assert(Ft, "getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");
- const Bt = e.getScriptSnapshot(Yi);
- if (!Bt)
- return;
- const to = xV(Yi, e), _u = e.getScriptVersion(Yi);
- if (!ba) {
- const Wc = c && c.getSourceFileByPath(Na);
- if (Wc) {
- if (to === Wc.scriptKind || lc.has(Wc.resolvedPath))
- return t.updateDocumentWithKey(Yi, Na, e, Ua, Bt, _u, to, Ia);
- t.releaseDocumentWithKey(Wc.resolvedPath, t.getKeyForCompilationSettings(c.getCompilerOptions()), Wc.scriptKind, Wc.impliedNodeFormat), lc.add(Wc.resolvedPath);
- }
- }
- return t.acquireDocumentWithKey(Yi, Na, e, Ua, Bt, _u, to, Ia);
- }
- }
- function F() {
- if (s === 2) {
- E.assert(c === void 0);
- return;
- }
- return P(), c;
- }
- function O() {
- var nt;
- return (nt = e.getPackageJsonAutoImportProvider) == null ? void 0 : nt.call(e);
- }
- function B(nt, ot) {
- const wt = c.getTypeChecker(), jt = Xt();
- if (!jt) return !1;
- for (const en of nt)
- for (const zt of en.references) {
- const mr = Ht(zt);
- if (E.assertIsDefined(mr), ot.has(zt) || Eo.isDeclarationOfSymbol(mr, jt)) {
- ot.add(zt), zt.isDefinition = !0;
- const Kt = o9(zt, C, Ms(e, e.fileExists));
- Kt && ot.add(Kt);
- } else
- zt.isDefinition = !1;
- }
- return !0;
- function Xt() {
- for (const en of nt)
- for (const zt of en.references) {
- if (ot.has(zt)) {
- const Kt = Ht(zt);
- return E.assertIsDefined(Kt), wt.getSymbolAtLocation(Kt);
- }
- const mr = o9(zt, C, Ms(e, e.fileExists));
- if (mr && ot.has(mr)) {
- const Kt = Ht(mr);
- if (Kt)
- return wt.getSymbolAtLocation(Kt);
- }
- }
- }
- function Ht(en) {
- const zt = c.getSourceFile(en.fileName);
- if (!zt) return;
- const mr = h_(zt, en.textSpan.start);
- return Eo.Core.getAdjustedNode(mr, { use: Eo.FindReferencesUse.References });
- }
- }
- function z() {
- if (c) {
- const nt = t.getKeyForCompilationSettings(c.getCompilerOptions());
- ir(c.getSourceFiles(), (ot) => t.releaseDocumentWithKey(ot.resolvedPath, nt, ot.scriptKind, ot.impliedNodeFormat)), c = void 0;
- }
- }
- function X() {
- z(), e = void 0;
- }
- function q(nt) {
- return P(), c.getSyntacticDiagnostics(D(nt), d).slice();
- }
- function V(nt) {
- P();
- const ot = D(nt), wt = c.getSemanticDiagnostics(ot, d);
- if (!P_(c.getCompilerOptions()))
- return wt.slice();
- const jt = c.getDeclarationDiagnostics(ot, d);
- return [...wt, ...jt];
- }
- function ae(nt, ot) {
- P();
- const wt = D(nt), jt = c.getCompilerOptions();
- if (JC(wt, jt, c) || !U4(wt, jt) || c.getCachedSemanticDiagnostics(wt))
- return;
- const Xt = ee(wt, ot);
- if (!Xt)
- return;
- const Ht = oj(Xt.map((zt) => kc(zt.getFullStart(), zt.getEnd())));
- return {
- diagnostics: c.getSemanticDiagnostics(wt, d, Xt).slice(),
- spans: Ht
- };
- }
- function ee(nt, ot) {
- const wt = [], jt = oj(ot.map((Xt) => L0(Xt)));
- for (const Xt of jt) {
- const Ht = G(nt, Xt);
- if (!Ht)
- return;
- wt.push(...Ht);
- }
- if (wt.length)
- return wt;
- }
- function G(nt, ot) {
- if (aj(ot, nt))
- return;
- const wt = r8(nt, ec(ot)) || nt, jt = or(wt, (Ht) => aY(Ht, ot)), Xt = [];
- if (ue(ot, jt, Xt), nt.end === ot.start + ot.length && Xt.push(nt.endOfFileToken), !ut(Xt, Si))
- return Xt;
- }
- function ue(nt, ot, wt) {
- return re(ot, nt) ? aj(nt, ot) ? (ne(ot, wt), !0) : ek(ot) ? ie(nt, ot, wt) : Zn(ot) ? Se(nt, ot, wt) : (ne(ot, wt), !0) : !1;
- }
- function re(nt, ot) {
- const wt = ot.start + ot.length;
- return nt.pos < wt && nt.end > ot.start;
- }
- function ne(nt, ot) {
- for (; nt.parent && !dee(nt); )
- nt = nt.parent;
- ot.push(nt);
- }
- function ie(nt, ot, wt) {
- const jt = [];
- return ot.statements.filter((Ht) => ue(nt, Ht, jt)).length === ot.statements.length ? (ne(ot, wt), !0) : (wt.push(...jt), !1);
- }
- function Se(nt, ot, wt) {
- var jt, Xt, Ht;
- const en = (Kt) => uY(Kt, nt);
- if ((jt = ot.modifiers) != null && jt.some(en) || ot.name && en(ot.name) || (Xt = ot.typeParameters) != null && Xt.some(en) || (Ht = ot.heritageClauses) != null && Ht.some(en))
- return ne(ot, wt), !0;
- const zt = [];
- return ot.members.filter((Kt) => ue(nt, Kt, zt)).length === ot.members.length ? (ne(ot, wt), !0) : (wt.push(...zt), !1);
- }
- function J(nt) {
- return P(), YV(D(nt), c, d);
- }
- function oe() {
- return P(), [...c.getOptionsDiagnostics(d), ...c.getGlobalDiagnostics(d)];
- }
- function _e(nt, ot, wt = Gp, jt) {
- const Xt = {
- ...wt,
- // avoid excess property check
- includeCompletionsForModuleExports: wt.includeCompletionsForModuleExports || wt.includeExternalModuleExports,
- includeCompletionsWithInsertText: wt.includeCompletionsWithInsertText || wt.includeInsertTextCompletions
- };
- return P(), ck.getCompletionsAtPosition(
- e,
- c,
- h,
- D(nt),
- ot,
- Xt,
- wt.triggerCharacter,
- wt.triggerKind,
- d,
- jt && Yc.getFormatContext(jt, e),
- wt.includeSymbol
- );
- }
- function he(nt, ot, wt, jt, Xt, Ht = Gp, en) {
- return P(), ck.getCompletionEntryDetails(
- c,
- h,
- D(nt),
- ot,
- { name: wt, source: Xt, data: en },
- e,
- jt && Yc.getFormatContext(jt, e),
- // TODO: GH#18217
- Ht,
- d
- );
- }
- function le(nt, ot, wt, jt, Xt = Gp) {
- return P(), ck.getCompletionEntrySymbol(c, h, D(nt), ot, { name: wt, source: jt }, e, Xt);
- }
- function me(nt, ot) {
- P();
- const wt = D(nt), jt = h_(wt, ot);
- if (jt === wt)
- return;
- const Xt = c.getTypeChecker(), Ht = tt(jt), en = _Ue(Ht, Xt);
- if (!en || Xt.isUnknownSymbol(en)) {
- const Ft = Te(wt, Ht, ot) ? Xt.getTypeAtLocation(Ht) : void 0;
- return Ft && {
- kind: "",
- kindModifiers: "",
- textSpan: t_(Ht, wt),
- displayParts: Xt.runWithCancellationToken(d, (Ss) => u8(Ss, Ft, AS(Ht))),
- documentation: Ft.symbol ? Ft.symbol.getDocumentationComment(Xt) : void 0,
- tags: Ft.symbol ? Ft.symbol.getJsDocTags(Xt) : void 0
- };
- }
- const { symbolKind: zt, displayParts: mr, documentation: Kt, tags: hr } = Xt.runWithCancellationToken(d, (Ft) => j0.getSymbolDisplayPartsDocumentationAndSymbolKind(Ft, en, wt, AS(Ht), Ht));
- return {
- kind: zt,
- kindModifiers: j0.getSymbolModifiers(Xt, en),
- textSpan: t_(Ht, wt),
- displayParts: mr,
- documentation: Kt,
- tags: hr
- };
- }
- function ve(nt, ot) {
- return P(), FH.pasteEditsProvider(
- D(nt.targetFile),
- nt.pastedText,
- nt.pasteLocations,
- nt.copiedFrom ? { file: D(nt.copiedFrom.file), range: nt.copiedFrom.range } : void 0,
- e,
- nt.preferences,
- Yc.getFormatContext(ot, e),
- d
- );
- }
- function tt(nt) {
- return jb(nt.parent) && nt.pos === nt.parent.pos ? nt.parent.expression : qC(nt.parent) && nt.pos === nt.parent.pos || yC(nt.parent) && nt.parent.name === nt || Nd(nt.parent) ? nt.parent : nt;
- }
- function Te(nt, ot, wt) {
- switch (ot.kind) {
- case 80:
- return ot.flags & 16777216 && !cn(ot) && (ot.parent.kind === 171 && ot.parent.name === ot || or(
- ot,
- (jt) => jt.kind === 169
- /* Parameter */
- )) ? !1 : !WU(ot) && !UU(ot) && !xd(ot.parent);
- case 211:
- case 166:
- return !O0(nt, wt);
- case 110:
- case 197:
- case 108:
- case 202:
- return !0;
- case 236:
- return yC(ot);
- default:
- return !1;
- }
- }
- function we(nt, ot, wt, jt) {
- return P(), L6.getDefinitionAtPosition(c, D(nt), ot, wt, jt);
- }
- function fe(nt, ot) {
- return P(), L6.getDefinitionAndBoundSpan(c, D(nt), ot);
- }
- function Me(nt, ot) {
- return P(), L6.getTypeDefinitionAtPosition(c.getTypeChecker(), D(nt), ot);
- }
- function Qe(nt, ot) {
- return P(), Eo.getImplementationsAtPosition(c, d, c.getSourceFiles(), D(nt), ot);
- }
- function et(nt, ot, wt) {
- const jt = Os(nt);
- E.assert(wt.some((en) => Os(en) === jt)), P();
- const Xt = Ai(wt, (en) => c.getSourceFile(en)), Ht = D(nt);
- return C9.getDocumentHighlights(c, d, Ht, ot, Xt);
- }
- function Re(nt, ot, wt, jt, Xt) {
- P();
- const Ht = D(nt), en = XF(h_(Ht, ot));
- if (uL.nodeIsEligibleForRename(en))
- if (Oe(en) && (xm(en.parent) || Jb(en.parent)) && AC(en.escapedText)) {
- const { openingElement: zt, closingElement: mr } = en.parent.parent;
- return [zt, mr].map((Kt) => {
- const hr = t_(Kt.tagName, Ht);
- return {
- fileName: Ht.fileName,
- textSpan: hr,
- ...Eo.toContextSpan(hr, Ht, Kt.parent)
- };
- });
- } else {
- const zt = bf(Ht, Xt ?? Gp), mr = typeof Xt == "boolean" ? Xt : Xt?.providePrefixAndSuffixTextForRename;
- return Wt(en, ot, { findInStrings: wt, findInComments: jt, providePrefixAndSuffixTextForRename: mr, use: Eo.FindReferencesUse.Rename }, (Kt, hr, Ft) => Eo.toRenameLocation(Kt, hr, Ft, mr || !1, zt));
- }
- }
- function ft(nt, ot) {
- return P(), Wt(h_(D(nt), ot), ot, { use: Eo.FindReferencesUse.References }, Eo.toReferenceEntry);
- }
- function Wt(nt, ot, wt, jt) {
- P();
- const Xt = wt && wt.use === Eo.FindReferencesUse.Rename ? c.getSourceFiles().filter((Ht) => !c.isSourceFileDefaultLibrary(Ht)) : c.getSourceFiles();
- return Eo.findReferenceOrRenameEntries(c, d, Xt, nt, ot, wt, jt);
- }
- function _r(nt, ot) {
- return P(), Eo.findReferencedSymbols(c, d, c.getSourceFiles(), D(nt), ot);
- }
- function Ir(nt) {
- return P(), Eo.Core.getReferencesForFileName(nt, c, c.getSourceFiles()).map(Eo.toReferenceEntry);
- }
- function jr(nt, ot, wt, jt = !1, Xt = !1) {
- P();
- const Ht = wt ? [D(wt)] : c.getSourceFiles();
- return Hbe(Ht, c.getTypeChecker(), d, nt, ot, jt, Xt);
- }
- function Nt(nt, ot, wt) {
- P();
- const jt = D(nt), Xt = e.getCustomTransformers && e.getCustomTransformers();
- return Vne(c, jt, !!ot, d, Xt, wt);
- }
- function Qt(nt, ot, { triggerReason: wt } = Gp) {
- P();
- const jt = D(nt);
- return U8.getSignatureHelpItems(c, jt, ot, wt, d);
- }
- function Br(nt) {
- return o.getCurrentSourceFile(nt);
- }
- function xr(nt, ot, wt) {
- const jt = o.getCurrentSourceFile(nt), Xt = h_(jt, ot);
- if (Xt === jt)
- return;
- switch (Xt.kind) {
- case 211:
- case 166:
- case 11:
- case 97:
- case 112:
- case 106:
- case 108:
- case 110:
- case 197:
- case 80:
- break;
- default:
- return;
- }
- let Ht = Xt;
- for (; ; )
- if (b6(Ht) || ose(Ht))
- Ht = Ht.parent;
- else if (qU(Ht))
- if (Ht.parent.parent.kind === 267 && Ht.parent.parent.body === Ht.parent)
- Ht = Ht.parent.parent.name;
- else
- break;
- else
- break;
- return kc(Ht.getStart(), Xt.getEnd());
- }
- function zn(nt, ot) {
- const wt = o.getCurrentSourceFile(nt);
- return Eq.spanInSourceFileAtLocation(wt, ot);
- }
- function ki(nt) {
- return Qbe(o.getCurrentSourceFile(nt), d);
- }
- function rs(nt) {
- return Ybe(o.getCurrentSourceFile(nt), d);
- }
- function ei(nt, ot, wt) {
- return P(), (wt || "original") === "2020" ? TSe(c, d, D(nt), ot) : Qse(c.getTypeChecker(), d, D(nt), c.getClassifiableNames(), ot);
- }
- function Ri(nt, ot, wt) {
- return P(), (wt || "original") === "original" ? UV(c.getTypeChecker(), d, D(nt), c.getClassifiableNames(), ot) : koe(c, d, D(nt), ot);
- }
- function Jr(nt, ot) {
- return Yse(d, o.getCurrentSourceFile(nt), ot);
- }
- function ji(nt, ot) {
- return VV(d, o.getCurrentSourceFile(nt), ot);
- }
- function Fe(nt) {
- const ot = o.getCurrentSourceFile(nt);
- return vH.collectElements(ot, d);
- }
- const Ot = new Map(Object.entries({
- 19: 20,
- 21: 22,
- 23: 24,
- 32: 30
- /* LessThanToken */
- }));
- Ot.forEach((nt, ot) => Ot.set(nt.toString(), Number(ot)));
- function Ar(nt, ot) {
- const wt = o.getCurrentSourceFile(nt), jt = T6(wt, ot), Xt = jt.getStart(wt) === ot ? Ot.get(jt.kind.toString()) : void 0, Ht = Xt && Ya(jt.parent, Xt, wt);
- return Ht ? [t_(jt, wt), t_(Ht, wt)].sort((en, zt) => en.start - zt.start) : Ue;
- }
- function mn(nt, ot, wt) {
- let jt = lo();
- const Xt = D8(wt), Ht = o.getCurrentSourceFile(nt);
- h("getIndentationAtPosition: getCurrentSourceFile: " + (lo() - jt)), jt = lo();
- const en = Yc.SmartIndenter.getIndentation(ot, Ht, Xt);
- return h("getIndentationAtPosition: computeIndentation : " + (lo() - jt)), en;
- }
- function ti(nt, ot, wt, jt) {
- const Xt = o.getCurrentSourceFile(nt);
- return Yc.formatSelection(ot, wt, Xt, Yc.getFormatContext(D8(jt), e));
- }
- function qn(nt, ot) {
- return Yc.formatDocument(o.getCurrentSourceFile(nt), Yc.getFormatContext(D8(ot), e));
- }
- function Oi(nt, ot, wt, jt) {
- const Xt = o.getCurrentSourceFile(nt), Ht = Yc.getFormatContext(D8(jt), e);
- if (!O0(Xt, ot))
- switch (wt) {
- case "{":
- return Yc.formatOnOpeningCurly(ot, Xt, Ht);
- case "}":
- return Yc.formatOnClosingCurly(ot, Xt, Ht);
- case ";":
- return Yc.formatOnSemicolon(ot, Xt, Ht);
- case `
-`:
- return Yc.formatOnEnter(ot, Xt, Ht);
- }
- return [];
- }
- function Ws(nt, ot, wt, jt, Xt, Ht = Gp) {
- P();
- const en = D(nt), zt = kc(ot, wt), mr = Yc.getFormatContext(Xt, e);
- return ta(cb(jt, by, ho), (Kt) => (d.throwIfCancellationRequested(), xu.getFixes({ errorCode: Kt, sourceFile: en, span: zt, program: c, host: e, cancellationToken: d, formatContext: mr, preferences: Ht })));
- }
- function Hs(nt, ot, wt, jt = Gp) {
- P(), E.assert(nt.type === "file");
- const Xt = D(nt.fileName), Ht = Yc.getFormatContext(wt, e);
- return xu.getAllFixes({ fixId: ot, sourceFile: Xt, program: c, host: e, cancellationToken: d, formatContext: Ht, preferences: jt });
- }
- function rr(nt, ot, wt = Gp) {
- P(), E.assert(nt.type === "file");
- const jt = D(nt.fileName);
- if (GT(jt)) return Ue;
- const Xt = Yc.getFormatContext(ot, e), Ht = nt.mode ?? (nt.skipDestructiveCodeActions ? "SortAndCombine" : "All");
- return Av.organizeImports(jt, Xt, e, c, wt, Ht);
- }
- function Ea(nt, ot, wt, jt = Gp) {
- return eae(F(), nt, ot, e, Yc.getFormatContext(wt, e), jt, C);
- }
- function Xe(nt, ot) {
- const wt = typeof nt == "string" ? ot : nt;
- return us(wt) ? Promise.all(wt.map((jt) => Tt(jt))) : Tt(wt);
- }
- function Tt(nt) {
- const ot = (wt) => uo(wt, g, T);
- return E.assertEqual(nt.type, "install package"), e.installPackage ? e.installPackage({ fileName: ot(nt.file), packageName: nt.packageName }) : Promise.reject("Host does not implement `installPackage`");
- }
- function te(nt, ot, wt, jt) {
- const Xt = jt ? Yc.getFormatContext(jt, e).options : void 0;
- return wv.getDocCommentTemplateAtPosition(jh(e, Xt), o.getCurrentSourceFile(nt), ot, wt);
- }
- function ze(nt, ot, wt) {
- if (wt === 60)
- return !1;
- const jt = o.getCurrentSourceFile(nt);
- if (Qx(jt, ot))
- return !1;
- if (dse(jt, ot))
- return wt === 123;
- if (ZU(jt, ot))
- return !1;
- switch (wt) {
- case 39:
- case 34:
- case 96:
- return !O0(jt, ot);
- }
- return !0;
- }
- function K(nt, ot) {
- const wt = o.getCurrentSourceFile(nt), jt = sl(ot, wt);
- if (!jt) return;
- const Xt = jt.kind === 32 && xm(jt.parent) ? jt.parent.parent : xx(jt) && Gg(jt.parent) ? jt.parent : void 0;
- if (Xt && bt(Xt))
- return { newText: `${Xt.openingElement.tagName.getText(wt)}>` };
- const Ht = jt.kind === 32 && vS(jt.parent) ? jt.parent.parent : xx(jt) && zb(jt.parent) ? jt.parent : void 0;
- if (Ht && He(Ht))
- return { newText: ">" };
- }
- function De(nt, ot) {
- const wt = o.getCurrentSourceFile(nt), jt = sl(ot, wt);
- if (!jt || jt.parent.kind === 307) return;
- const Xt = "[a-zA-Z0-9:\\-\\._$]*";
- if (zb(jt.parent.parent)) {
- const Ht = jt.parent.parent.openingFragment, en = jt.parent.parent.closingFragment;
- if (GT(Ht) || GT(en)) return;
- const zt = Ht.getStart(wt) + 1, mr = en.getStart(wt) + 2;
- return ot !== zt && ot !== mr ? void 0 : {
- ranges: [{ start: zt, length: 0 }, { start: mr, length: 0 }],
- wordPattern: Xt
- };
- } else {
- const Ht = or(jt.parent, (gs) => !!(xm(gs) || Jb(gs)));
- if (!Ht) return;
- E.assert(xm(Ht) || Jb(Ht), "tag should be opening or closing element");
- const en = Ht.parent.openingElement, zt = Ht.parent.closingElement, mr = en.tagName.getStart(wt), Kt = en.tagName.end, hr = zt.tagName.getStart(wt), Ft = zt.tagName.end;
- return mr === en.getStart(wt) || hr === zt.getStart(wt) || Kt === en.getEnd() || Ft === zt.getEnd() || !(mr <= ot && ot <= Kt || hr <= ot && ot <= Ft) || en.tagName.getText(wt) !== zt.tagName.getText(wt) ? void 0 : {
- ranges: [{ start: mr, length: Kt - mr }, { start: hr, length: Ft - hr }],
- wordPattern: Xt
- };
- }
- }
- function Ve(nt, ot) {
- return {
- lineStarts: nt.getLineStarts(),
- firstLine: nt.getLineAndCharacterOfPosition(ot.pos).line,
- lastLine: nt.getLineAndCharacterOfPosition(ot.end).line
- };
- }
- function Ke(nt, ot, wt) {
- const jt = o.getCurrentSourceFile(nt), Xt = [], { lineStarts: Ht, firstLine: en, lastLine: zt } = Ve(jt, ot);
- let mr = wt || !1, Kt = Number.MAX_VALUE;
- const hr = /* @__PURE__ */ new Map(), Ft = new RegExp(/\S/), Ss = YF(jt, Ht[en]), gs = Ss ? "{/*" : "//";
- for (let Ts = en; Ts <= zt; Ts++) {
- const Ua = jt.text.substring(Ht[Ts], jt.getLineEndOfPosition(Ht[Ts])), lc = Ft.exec(Ua);
- lc && (Kt = Math.min(Kt, lc.index), hr.set(Ts.toString(), lc.index), Ua.substr(lc.index, gs.length) !== gs && (mr = wt === void 0 || wt));
- }
- for (let Ts = en; Ts <= zt; Ts++) {
- if (en !== zt && Ht[Ts] === ot.end)
- continue;
- const Ua = hr.get(Ts.toString());
- Ua !== void 0 && (Ss ? Xt.push(...xe(nt, { pos: Ht[Ts] + Kt, end: jt.getLineEndOfPosition(Ht[Ts]) }, mr, Ss)) : mr ? Xt.push({
- newText: gs,
- span: {
- length: 0,
- start: Ht[Ts] + Kt
- }
- }) : jt.text.substr(Ht[Ts] + Ua, gs.length) === gs && Xt.push({
- newText: "",
- span: {
- length: gs.length,
- start: Ht[Ts] + Ua
- }
- }));
- }
- return Xt;
- }
- function xe(nt, ot, wt, jt) {
- var Xt;
- const Ht = o.getCurrentSourceFile(nt), en = [], { text: zt } = Ht;
- let mr = !1, Kt = wt || !1;
- const hr = [];
- let { pos: Ft } = ot;
- const Ss = jt !== void 0 ? jt : YF(Ht, Ft), gs = Ss ? "{/*" : "/*", Ts = Ss ? "*/}" : "*/", Ua = Ss ? "\\{\\/\\*" : "\\/\\*", lc = Ss ? "\\*\\/\\}" : "\\*\\/";
- for (; Ft <= ot.end; ) {
- const Ic = zt.substr(Ft, gs.length) === gs ? gs.length : 0, io = O0(Ht, Ft + Ic);
- if (io)
- Ss && (io.pos--, io.end++), hr.push(io.pos), io.kind === 3 && hr.push(io.end), mr = !0, Ft = io.end + 1;
- else {
- const vi = zt.substring(Ft, ot.end).search(`(${Ua})|(${lc})`);
- Kt = wt !== void 0 ? wt : Kt || !Cse(zt, Ft, vi === -1 ? ot.end : Ft + vi), Ft = vi === -1 ? ot.end + 1 : Ft + vi + Ts.length;
- }
- }
- if (Kt || !mr) {
- ((Xt = O0(Ht, ot.pos)) == null ? void 0 : Xt.kind) !== 2 && my(hr, ot.pos, ho), my(hr, ot.end, ho);
- const Ic = hr[0];
- zt.substr(Ic, gs.length) !== gs && en.push({
- newText: gs,
- span: {
- length: 0,
- start: Ic
- }
- });
- for (let io = 1; io < hr.length - 1; io++)
- zt.substr(hr[io] - Ts.length, Ts.length) !== Ts && en.push({
- newText: Ts,
- span: {
- length: 0,
- start: hr[io]
- }
- }), zt.substr(hr[io], gs.length) !== gs && en.push({
- newText: gs,
- span: {
- length: 0,
- start: hr[io]
- }
- });
- en.length % 2 !== 0 && en.push({
- newText: Ts,
- span: {
- length: 0,
- start: hr[hr.length - 1]
- }
- });
- } else
- for (const Ic of hr) {
- const io = Ic - Ts.length > 0 ? Ic - Ts.length : 0, vi = zt.substr(io, Ts.length) === Ts ? Ts.length : 0;
- en.push({
- newText: "",
- span: {
- length: gs.length,
- start: Ic - vi
- }
- });
- }
- return en;
- }
- function at(nt, ot) {
- const wt = o.getCurrentSourceFile(nt), { firstLine: jt, lastLine: Xt } = Ve(wt, ot);
- return jt === Xt && ot.pos !== ot.end ? xe(
- nt,
- ot,
- /*insertComment*/
- !0
- ) : Ke(
- nt,
- ot,
- /*insertComment*/
- !0
- );
- }
- function $e(nt, ot) {
- const wt = o.getCurrentSourceFile(nt), jt = [], { pos: Xt } = ot;
- let { end: Ht } = ot;
- Xt === Ht && (Ht += YF(wt, Xt) ? 2 : 1);
- for (let en = Xt; en <= Ht; en++) {
- const zt = O0(wt, en);
- if (zt) {
- switch (zt.kind) {
- case 2:
- jt.push(...Ke(
- nt,
- { end: zt.end, pos: zt.pos + 1 },
- /*insertComment*/
- !1
- ));
- break;
- case 3:
- jt.push(...xe(
- nt,
- { end: zt.end, pos: zt.pos + 1 },
- /*insertComment*/
- !1
- ));
- }
- en = zt.end + 1;
- }
- }
- return jt;
- }
- function bt({ openingElement: nt, closingElement: ot, parent: wt }) {
- return !yv(nt.tagName, ot.tagName) || Gg(wt) && yv(nt.tagName, wt.openingElement.tagName) && bt(wt);
- }
- function He({ closingFragment: nt, parent: ot }) {
- return !!(nt.flags & 262144) || zb(ot) && He(ot);
- }
- function Vt(nt, ot, wt) {
- const jt = o.getCurrentSourceFile(nt), Xt = Yc.getRangeOfEnclosingComment(jt, ot);
- return Xt && (!wt || Xt.kind === 3) ? L0(Xt) : void 0;
- }
- function Zt(nt, ot) {
- P();
- const wt = D(nt);
- d.throwIfCancellationRequested();
- const jt = wt.text, Xt = [];
- if (ot.length > 0 && !mr(wt.fileName)) {
- const Kt = en();
- let hr;
- for (; hr = Kt.exec(jt); ) {
- d.throwIfCancellationRequested();
- const Ft = 3;
- E.assert(hr.length === ot.length + Ft);
- const Ss = hr[1], gs = hr.index + Ss.length;
- if (!O0(wt, gs))
- continue;
- let Ts;
- for (let lc = 0; lc < ot.length; lc++)
- hr[lc + Ft] && (Ts = ot[lc]);
- if (Ts === void 0) return E.fail();
- if (zt(jt.charCodeAt(gs + Ts.text.length)))
- continue;
- const Ua = hr[2];
- Xt.push({ descriptor: Ts, message: Ua, position: gs });
- }
- }
- return Xt;
- function Ht(Kt) {
- return Kt.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
- }
- function en() {
- const Kt = /(?:\/{2,}\s*)/.source, hr = /(?:\/\*+\s*)/.source, Ss = "(" + /(?:^(?:\s|\*)*)/.source + "|" + Kt + "|" + hr + ")", gs = "(?:" + lr(ot, (io) => "(" + Ht(io.text) + ")").join("|") + ")", Ts = /(?:$|\*\/)/.source, Ua = /(?:.*?)/.source, lc = "(" + gs + Ua + ")", Ic = Ss + lc + Ts;
- return new RegExp(Ic, "gim");
- }
- function zt(Kt) {
- return Kt >= 97 && Kt <= 122 || Kt >= 65 && Kt <= 90 || Kt >= 48 && Kt <= 57;
- }
- function mr(Kt) {
- return Kt.includes("/node_modules/");
- }
- }
- function vn(nt, ot, wt) {
- return P(), uL.getRenameInfo(c, D(nt), ot, wt || {});
- }
- function M(nt, ot, wt, jt, Xt, Ht) {
- const [en, zt] = typeof ot == "number" ? [ot, void 0] : [ot.pos, ot.end];
- return {
- file: nt,
- startPosition: en,
- endPosition: zt,
- program: F(),
- host: e,
- formatContext: Yc.getFormatContext(jt, e),
- // TODO: GH#18217
- cancellationToken: d,
- preferences: wt,
- triggerReason: Xt,
- kind: Ht
- };
- }
- function Ae(nt, ot, wt) {
- return {
- file: nt,
- program: F(),
- host: e,
- span: ot,
- preferences: wt,
- cancellationToken: d
- };
- }
- function dt(nt, ot) {
- return TH.getSmartSelectionRange(ot, o.getCurrentSourceFile(nt));
- }
- function U(nt, ot, wt = Gp, jt, Xt, Ht) {
- P();
- const en = D(nt);
- return rk.getApplicableRefactors(M(en, ot, wt, Gp, jt, Xt), Ht);
- }
- function be(nt, ot, wt = Gp) {
- P();
- const jt = D(nt), Xt = E.checkDefined(c.getSourceFiles()), Ht = z4(nt), en = C8(M(jt, ot, wt, Gp)), zt = Vae(en?.all), mr = Ai(Xt, (Kt) => {
- const hr = z4(Kt.fileName);
- return !c?.isSourceFileFromExternalLibrary(jt) && !(jt === D(Kt.fileName) || Ht === ".ts" && hr === ".d.ts" || Ht === ".d.ts" && Ui(Hc(Kt.fileName), "lib.") && hr === ".d.ts") && (Ht === hr || (Ht === ".tsx" && hr === ".ts" || Ht === ".jsx" && hr === ".js") && !zt) ? Kt.fileName : void 0;
- });
- return { newFileName: Uae(jt, c, e, en), files: mr };
- }
- function Z(nt, ot, wt, jt, Xt, Ht = Gp, en) {
- P();
- const zt = D(nt);
- return rk.getEditsForRefactor(M(zt, wt, Ht, ot), jt, Xt, en);
- }
- function ht(nt, ot) {
- return ot === 0 ? { line: 0, character: 0 } : C.toLineColumnOffset(nt, ot);
- }
- function Le(nt, ot) {
- P();
- const wt = nk.resolveCallHierarchyDeclaration(c, h_(D(nt), ot));
- return wt && FV(wt, (jt) => nk.createCallHierarchyItem(c, jt));
- }
- function Ie(nt, ot) {
- P();
- const wt = D(nt), jt = LV(nk.resolveCallHierarchyDeclaration(c, ot === 0 ? wt : h_(wt, ot)));
- return jt ? nk.getIncomingCalls(c, jt, d) : [];
- }
- function At(nt, ot) {
- P();
- const wt = D(nt), jt = LV(nk.resolveCallHierarchyDeclaration(c, ot === 0 ? wt : h_(wt, ot)));
- return jt ? nk.getOutgoingCalls(c, jt) : [];
- }
- function Dr(nt, ot, wt = Gp) {
- P();
- const jt = D(nt);
- return gH.provideInlayHints(Ae(jt, ot, wt));
- }
- function yr(nt, ot, wt, jt, Xt) {
- return hH.mapCode(
- o.getCurrentSourceFile(nt),
- ot,
- wt,
- e,
- Yc.getFormatContext(jt, e),
- Xt
- );
- }
- const $r = {
- dispose: X,
- cleanupSemanticCache: z,
- getSyntacticDiagnostics: q,
- getSemanticDiagnostics: V,
- getRegionSemanticDiagnostics: ae,
- getSuggestionDiagnostics: J,
- getCompilerOptionsDiagnostics: oe,
- getSyntacticClassifications: Jr,
- getSemanticClassifications: ei,
- getEncodedSyntacticClassifications: ji,
- getEncodedSemanticClassifications: Ri,
- getCompletionsAtPosition: _e,
- getCompletionEntryDetails: he,
- getCompletionEntrySymbol: le,
- getSignatureHelpItems: Qt,
- getQuickInfoAtPosition: me,
- getDefinitionAtPosition: we,
- getDefinitionAndBoundSpan: fe,
- getImplementationAtPosition: Qe,
- getTypeDefinitionAtPosition: Me,
- getReferencesAtPosition: ft,
- findReferences: _r,
- getFileReferences: Ir,
- getDocumentHighlights: et,
- getNameOrDottedNameSpan: xr,
- getBreakpointStatementAtPosition: zn,
- getNavigateToItems: jr,
- getRenameInfo: vn,
- getSmartSelectionRange: dt,
- findRenameLocations: Re,
- getNavigationBarItems: ki,
- getNavigationTree: rs,
- getOutliningSpans: Fe,
- getTodoComments: Zt,
- getBraceMatchingAtPosition: Ar,
- getIndentationAtPosition: mn,
- getFormattingEditsForRange: ti,
- getFormattingEditsForDocument: qn,
- getFormattingEditsAfterKeystroke: Oi,
- getDocCommentTemplateAtPosition: te,
- isValidBraceCompletionAtPosition: ze,
- getJsxClosingTagAtPosition: K,
- getLinkedEditingRangeAtPosition: De,
- getSpanOfEnclosingComment: Vt,
- getCodeFixesAtPosition: Ws,
- getCombinedCodeFix: Hs,
- applyCodeActionCommand: Xe,
- organizeImports: rr,
- getEditsForFileRename: Ea,
- getEmitOutput: Nt,
- getNonBoundSourceFile: Br,
- getProgram: F,
- getCurrentProgram: () => c,
- getAutoImportProvider: O,
- updateIsDefinitionOfReferencedSymbols: B,
- getApplicableRefactors: U,
- getEditsForRefactor: Z,
- getMoveToRefactoringFileSuggestions: be,
- toLineColumnOffset: ht,
- getSourceMapper: () => C,
- clearSourceMapperCache: () => C.clearCache(),
- prepareCallHierarchy: Le,
- provideCallHierarchyIncomingCalls: Ie,
- provideCallHierarchyOutgoingCalls: At,
- toggleLineComment: Ke,
- toggleMultilineComment: xe,
- commentSelection: at,
- uncommentSelection: $e,
- provideInlayHints: Dr,
- getSupportedCodeFixes: xq,
- getPasteEdits: ve,
- mapCode: yr
- };
- switch (s) {
- case 0:
- break;
- case 1:
- LSe.forEach(
- (nt) => $r[nt] = () => {
- throw new Error(`LanguageService Operation: ${nt} not allowed in LanguageServiceMode.PartialSemantic`);
- }
- );
- break;
- case 2:
- oUe.forEach(
- (nt) => $r[nt] = () => {
- throw new Error(`LanguageService Operation: ${nt} not allowed in LanguageServiceMode.Syntactic`);
- }
- );
- break;
- default:
- E.assertNever(s);
- }
- return $r;
- }
- function Cq(e) {
- return e.nameTable || cUe(e), e.nameTable;
- }
- function cUe(e) {
- const t = e.nameTable = /* @__PURE__ */ new Map();
- e.forEachChild(function n(i) {
- if (Oe(i) && !UU(i) && i.escapedText || Of(i) && lUe(i)) {
- const s = C4(i);
- t.set(s, t.get(s) === void 0 ? i.pos : -1);
- } else if (Di(i)) {
- const s = i.escapedText;
- t.set(s, t.get(s) === void 0 ? i.pos : -1);
- }
- if (bs(i, n), gf(i))
- for (const s of i.jsDoc)
- bs(s, n);
- });
- }
- function lUe(e) {
- return og(e) || e.parent.kind === 283 || fUe(e) || g3(e);
- }
- function w8(e) {
- const t = uUe(e);
- return t && (Ks(t.parent) || Wb(t.parent)) ? t : void 0;
- }
- function uUe(e) {
- switch (e.kind) {
- case 11:
- case 15:
- case 9:
- if (e.parent.kind === 167)
- return wj(e.parent.parent) ? e.parent.parent : void 0;
- case 80:
- return wj(e.parent) && (e.parent.parent.kind === 210 || e.parent.parent.kind === 292) && e.parent.name === e ? e.parent : void 0;
- }
- }
- function _Ue(e, t) {
- const n = w8(e);
- if (n) {
- const i = t.getContextualType(n.parent), s = i && W9(
- n,
- t,
- i,
- /*unionSymbolOk*/
- !1
- );
- if (s && s.length === 1)
- return xa(s);
- }
- return t.getSymbolAtLocation(e);
- }
- function W9(e, t, n, i) {
- const s = o8(e.name);
- if (!s) return Ue;
- if (!n.isUnion()) {
- const _ = n.getProperty(s);
- return _ ? [_] : Ue;
- }
- const o = Ks(e.parent) || Wb(e.parent) ? Ln(n.types, (_) => !t.isTypeInvalidDueToUnionDiscriminant(_, e.parent)) : n.types, c = Ai(o, (_) => _.getProperty(s));
- if (i && (c.length === 0 || c.length === n.types.length)) {
- const _ = n.getProperty(s);
- if (_) return [_];
- }
- return !o.length && !c.length ? Ai(n.types, (_) => _.getProperty(s)) : cb(c, by);
- }
- function fUe(e) {
- return e && e.parent && e.parent.kind === 212 && e.parent.argumentExpression === e;
- }
- function woe(e) {
- if (ll)
- return Bn(Xn(Os(ll.getExecutingFilePath())), yw(e));
- throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ");
- }
- OK(nUe());
- function MSe(e, t, n) {
- const i = [];
- n = tq(n, i);
- const s = us(e) ? e : [e], o = LA(
- /*resolver*/
- void 0,
- /*host*/
- void 0,
- A,
- n,
- s,
- t,
- /*allowDtsFiles*/
- !0
- );
- return o.diagnostics = Qi(o.diagnostics, i), o;
- }
- var Eq = {};
- La(Eq, {
- spanInSourceFileAtLocation: () => pUe
- });
- function pUe(e, t) {
- if (e.isDeclarationFile)
- return;
- let n = xi(e, t);
- const i = e.getLineAndCharacterOfPosition(t).line;
- if (e.getLineAndCharacterOfPosition(n.getStart(e)).line > i) {
- const h = sl(n.pos, e);
- if (!h || e.getLineAndCharacterOfPosition(h.getEnd()).line !== i)
- return;
- n = h;
- }
- if (n.flags & 33554432)
- return;
- return g(n);
- function s(h, S) {
- const T = Vb(h) ? ob(h.modifiers, dl) : void 0, C = T ? aa(e.text, T.end) : h.getStart(e);
- return kc(C, (S || h).getEnd());
- }
- function o(h, S) {
- return s(h, Zb(S, S.parent, e));
- }
- function c(h, S) {
- return h && i === e.getLineAndCharacterOfPosition(h.getStart(e)).line ? g(h) : g(S);
- }
- function _(h, S, T) {
- if (h) {
- const C = h.indexOf(S);
- if (C >= 0) {
- let D = C, P = C + 1;
- for (; D > 0 && T(h[D - 1]); ) D--;
- for (; P < h.length && T(h[P]); ) P++;
- return kc(aa(e.text, h[D].pos), h[P - 1].end);
- }
- }
- return s(S);
- }
- function u(h) {
- return g(sl(h.pos, e));
- }
- function d(h) {
- return g(Zb(h, h.parent, e));
- }
- function g(h) {
- if (h) {
- const { parent: J } = h;
- switch (h.kind) {
- case 243:
- return T(h.declarationList.declarations[0]);
- case 260:
- case 172:
- case 171:
- return T(h);
- case 169:
- return D(h);
- case 262:
- case 174:
- case 173:
- case 177:
- case 178:
- case 176:
- case 218:
- case 219:
- return I(h);
- case 241:
- if (vb(h))
- return F(h);
- case 268:
- return O(h);
- case 299:
- return O(h.block);
- case 244:
- return s(h.expression);
- case 253:
- return s(h.getChildAt(0), h.expression);
- case 247:
- return o(h, h.expression);
- case 246:
- return g(h.statement);
- case 259:
- return s(h.getChildAt(0));
- case 245:
- return o(h, h.expression);
- case 256:
- return g(h.statement);
- case 252:
- case 251:
- return s(h.getChildAt(0), h.label);
- case 248:
- return z(h);
- case 249:
- return o(h, h.expression);
- case 250:
- return B(h);
- case 255:
- return o(h, h.expression);
- case 296:
- case 297:
- return g(h.statements[0]);
- case 258:
- return O(h.tryBlock);
- case 257:
- return s(h, h.expression);
- case 277:
- return s(h, h.expression);
- case 271:
- return s(h, h.moduleReference);
- case 272:
- return s(h, h.moduleSpecifier);
- case 278:
- return s(h, h.moduleSpecifier);
- case 267:
- if (Rh(h) !== 1)
- return;
- case 263:
- case 266:
- case 306:
- case 208:
- return s(h);
- case 254:
- return g(h.statement);
- case 170:
- return _(J.modifiers, h, dl);
- case 206:
- case 207:
- return X(h);
- case 264:
- case 265:
- return;
- case 27:
- case 1:
- return c(sl(h.pos, e));
- case 28:
- return u(h);
- case 19:
- return V(h);
- case 20:
- return ae(h);
- case 24:
- return ee(h);
- case 21:
- return G(h);
- case 22:
- return ue(h);
- case 59:
- return re(h);
- case 32:
- case 30:
- return ne(h);
- case 117:
- return ie(h);
- case 93:
- case 85:
- case 98:
- return d(h);
- case 165:
- return Se(h);
- default:
- if (F0(h))
- return q(h);
- if ((h.kind === 80 || h.kind === 230 || h.kind === 303 || h.kind === 304) && F0(J))
- return s(h);
- if (h.kind === 226) {
- const { left: oe, operatorToken: _e } = h;
- if (F0(oe))
- return q(
- oe
- );
- if (_e.kind === 64 && F0(h.parent))
- return s(h);
- if (_e.kind === 28)
- return g(oe);
- }
- if (Ed(h))
- switch (J.kind) {
- case 246:
- return u(h);
- case 170:
- return g(h.parent);
- case 248:
- case 250:
- return s(h);
- case 226:
- if (h.parent.operatorToken.kind === 28)
- return s(h);
- break;
- case 219:
- if (h.parent.body === h)
- return s(h);
- break;
- }
- switch (h.parent.kind) {
- case 303:
- if (h.parent.name === h && !F0(h.parent.parent))
- return g(h.parent.initializer);
- break;
- case 216:
- if (h.parent.type === h)
- return d(h.parent.type);
- break;
- case 260:
- case 169: {
- const { initializer: oe, type: _e } = h.parent;
- if (oe === h || _e === h || Ph(h.kind))
- return u(h);
- break;
- }
- case 226: {
- const { left: oe } = h.parent;
- if (F0(oe) && h !== oe)
- return u(h);
- break;
- }
- default:
- if (ys(h.parent) && h.parent.type === h)
- return u(h);
- }
- return g(h.parent);
- }
- }
- function S(J) {
- return Fl(J.parent) && J.parent.declarations[0] === J ? s(sl(J.pos, e, J.parent), J) : s(J);
- }
- function T(J) {
- if (J.parent.parent.kind === 249)
- return g(J.parent.parent);
- const oe = J.parent;
- if (As(J.name))
- return X(J.name);
- if (K2(J) && J.initializer || Gn(
- J,
- 32
- /* Export */
- ) || oe.parent.kind === 250)
- return S(J);
- if (Fl(J.parent) && J.parent.declarations[0] !== J)
- return g(sl(J.pos, e, J.parent));
- }
- function C(J) {
- return !!J.initializer || J.dotDotDotToken !== void 0 || Gn(
- J,
- 3
- /* Private */
- );
- }
- function D(J) {
- if (As(J.name))
- return X(J.name);
- if (C(J))
- return s(J);
- {
- const oe = J.parent, _e = oe.parameters.indexOf(J);
- return E.assert(_e !== -1), _e !== 0 ? D(oe.parameters[_e - 1]) : g(oe.body);
- }
- }
- function P(J) {
- return Gn(
- J,
- 32
- /* Export */
- ) || J.parent.kind === 263 && J.kind !== 176;
- }
- function I(J) {
- if (J.body)
- return P(J) ? s(J) : g(J.body);
- }
- function F(J) {
- const oe = J.statements.length ? J.statements[0] : J.getLastToken();
- return P(J.parent) ? c(J.parent, oe) : g(oe);
- }
- function O(J) {
- switch (J.parent.kind) {
- case 267:
- if (Rh(J.parent) !== 1)
- return;
- case 247:
- case 245:
- case 249:
- return c(J.parent, J.statements[0]);
- case 248:
- case 250:
- return c(sl(J.pos, e, J.parent), J.statements[0]);
- }
- return g(J.statements[0]);
- }
- function B(J) {
- if (J.initializer.kind === 261) {
- const oe = J.initializer;
- if (oe.declarations.length > 0)
- return g(oe.declarations[0]);
- } else
- return g(J.initializer);
- }
- function z(J) {
- if (J.initializer)
- return B(J);
- if (J.condition)
- return s(J.condition);
- if (J.incrementor)
- return s(J.incrementor);
- }
- function X(J) {
- const oe = ir(J.elements, (_e) => _e.kind !== 232 ? _e : void 0);
- return oe ? g(oe) : J.parent.kind === 208 ? s(J.parent) : S(J.parent);
- }
- function q(J) {
- E.assert(
- J.kind !== 207 && J.kind !== 206
- /* ObjectBindingPattern */
- );
- const oe = J.kind === 209 ? J.elements : J.properties, _e = ir(oe, (he) => he.kind !== 232 ? he : void 0);
- return _e ? g(_e) : s(J.parent.kind === 226 ? J.parent : J);
- }
- function V(J) {
- switch (J.parent.kind) {
- case 266:
- const oe = J.parent;
- return c(sl(J.pos, e, J.parent), oe.members.length ? oe.members[0] : oe.getLastToken(e));
- case 263:
- const _e = J.parent;
- return c(sl(J.pos, e, J.parent), _e.members.length ? _e.members[0] : _e.getLastToken(e));
- case 269:
- return c(J.parent.parent, J.parent.clauses[0]);
- }
- return g(J.parent);
- }
- function ae(J) {
- switch (J.parent.kind) {
- case 268:
- if (Rh(J.parent.parent) !== 1)
- return;
- case 266:
- case 263:
- return s(J);
- case 241:
- if (vb(J.parent))
- return s(J);
- case 299:
- return g(Ro(J.parent.statements));
- case 269:
- const oe = J.parent, _e = Ro(oe.clauses);
- return _e ? g(Ro(_e.statements)) : void 0;
- case 206:
- const he = J.parent;
- return g(Ro(he.elements) || he);
- default:
- if (F0(J.parent)) {
- const le = J.parent;
- return s(Ro(le.properties) || le);
- }
- return g(J.parent);
- }
- }
- function ee(J) {
- switch (J.parent.kind) {
- case 207:
- const oe = J.parent;
- return s(Ro(oe.elements) || oe);
- default:
- if (F0(J.parent)) {
- const _e = J.parent;
- return s(Ro(_e.elements) || _e);
- }
- return g(J.parent);
- }
- }
- function G(J) {
- return J.parent.kind === 246 || // Go to while keyword and do action instead
- J.parent.kind === 213 || J.parent.kind === 214 ? u(J) : J.parent.kind === 217 ? d(J) : g(J.parent);
- }
- function ue(J) {
- switch (J.parent.kind) {
- case 218:
- case 262:
- case 219:
- case 174:
- case 173:
- case 177:
- case 178:
- case 176:
- case 247:
- case 246:
- case 248:
- case 250:
- case 213:
- case 214:
- case 217:
- return u(J);
- default:
- return g(J.parent);
- }
- }
- function re(J) {
- return ys(J.parent) || J.parent.kind === 303 || J.parent.kind === 169 ? u(J) : g(J.parent);
- }
- function ne(J) {
- return J.parent.kind === 216 ? d(J) : g(J.parent);
- }
- function ie(J) {
- return J.parent.kind === 246 ? o(J, J.parent.expression) : g(J.parent);
- }
- function Se(J) {
- return J.parent.kind === 250 ? d(J) : g(J.parent);
- }
- }
- }
- var nk = {};
- La(nk, {
- createCallHierarchyItem: () => Aoe,
- getIncomingCalls: () => SUe,
- getOutgoingCalls: () => NUe,
- resolveCallHierarchyDeclaration: () => VSe
- });
- function dUe(e) {
- return (vo(e) || $c(e)) && Vl(e);
- }
- function RSe(e) {
- return cs(e) || ii(e);
- }
- function A8(e) {
- return (vo(e) || Co(e) || $c(e)) && RSe(e.parent) && e === e.parent.initializer && Oe(e.parent.name) && (!!(xh(e.parent) & 2) || cs(e.parent));
- }
- function jSe(e) {
- return Si(e) || zc(e) || Ec(e) || vo(e) || Xc(e) || $c(e) || oc(e) || hc(e) || vm(e) || Lf(e) || K_(e);
- }
- function I6(e) {
- return Si(e) || zc(e) && Oe(e.name) || Ec(e) || Xc(e) || oc(e) || hc(e) || vm(e) || Lf(e) || K_(e) || dUe(e) || A8(e);
- }
- function BSe(e) {
- return Si(e) ? e : Vl(e) ? e.name : A8(e) ? e.parent.name : E.checkDefined(e.modifiers && On(e.modifiers, JSe));
- }
- function JSe(e) {
- return e.kind === 90;
- }
- function zSe(e, t) {
- const n = BSe(t);
- return n && e.getSymbolAtLocation(n);
- }
- function mUe(e, t) {
- if (Si(t))
- return { text: t.fileName, pos: 0, end: 0 };
- if ((Ec(t) || Xc(t)) && !Vl(t)) {
- const s = t.modifiers && On(t.modifiers, JSe);
- if (s)
- return { text: "default", pos: s.getStart(), end: s.getEnd() };
- }
- if (oc(t)) {
- const s = t.getSourceFile(), o = aa(s.text, gm(t).pos), c = o + 6, _ = e.getTypeChecker(), u = _.getSymbolAtLocation(t.parent);
- return { text: `${u ? `${_.symbolToString(u, t.parent)} ` : ""}static {}`, pos: o, end: c };
- }
- const n = A8(t) ? t.parent.name : E.checkDefined(os(t), "Expected call hierarchy item to have a name");
- let i = Oe(n) ? Nn(n) : Of(n) ? n.text : ma(n) && Of(n.expression) ? n.expression.text : void 0;
- if (i === void 0) {
- const s = e.getTypeChecker(), o = s.getSymbolAtLocation(n);
- o && (i = s.symbolToString(o, t));
- }
- if (i === void 0) {
- const s = kW();
- i = dC((o) => s.writeNode(4, t, t.getSourceFile(), o));
- }
- return { text: i, pos: n.getStart(), end: n.getEnd() };
- }
- function gUe(e) {
- var t, n, i, s;
- if (A8(e))
- return cs(e.parent) && Zn(e.parent.parent) ? $c(e.parent.parent) ? (t = LI(e.parent.parent)) == null ? void 0 : t.getText() : (n = e.parent.parent.name) == null ? void 0 : n.getText() : Sm(e.parent.parent.parent.parent) && Oe(e.parent.parent.parent.parent.parent.name) ? e.parent.parent.parent.parent.parent.name.getText() : void 0;
- switch (e.kind) {
- case 177:
- case 178:
- case 174:
- return e.parent.kind === 210 ? (i = LI(e.parent)) == null ? void 0 : i.getText() : (s = os(e.parent)) == null ? void 0 : s.getText();
- case 262:
- case 263:
- case 267:
- if (Sm(e.parent) && Oe(e.parent.parent.name))
- return e.parent.parent.name.getText();
- }
- }
- function WSe(e, t) {
- if (t.body)
- return t;
- if (Qo(t))
- return Bg(t.parent);
- if (Ec(t) || hc(t)) {
- const n = zSe(e, t);
- return n && n.valueDeclaration && no(n.valueDeclaration) && n.valueDeclaration.body ? n.valueDeclaration : void 0;
- }
- return t;
- }
- function USe(e, t) {
- const n = zSe(e, t);
- let i;
- if (n && n.declarations) {
- const s = _I(n.declarations), o = lr(n.declarations, (u) => ({ file: u.getSourceFile().fileName, pos: u.pos }));
- s.sort((u, d) => au(o[u].file, o[d].file) || o[u].pos - o[d].pos);
- const c = lr(s, (u) => n.declarations[u]);
- let _;
- for (const u of c)
- I6(u) && ((!_ || _.parent !== u.parent || _.end !== u.pos) && (i = wr(i, u)), _ = u);
- }
- return i;
- }
- function Dq(e, t) {
- return oc(t) ? t : no(t) ? WSe(e, t) ?? USe(e, t) ?? t : USe(e, t) ?? t;
- }
- function VSe(e, t) {
- const n = e.getTypeChecker();
- let i = !1;
- for (; ; ) {
- if (I6(t))
- return Dq(n, t);
- if (jSe(t)) {
- const s = or(t, I6);
- return s && Dq(n, s);
- }
- if (og(t)) {
- if (I6(t.parent))
- return Dq(n, t.parent);
- if (jSe(t.parent)) {
- const s = or(t.parent, I6);
- return s && Dq(n, s);
- }
- return RSe(t.parent) && t.parent.initializer && A8(t.parent.initializer) ? t.parent.initializer : void 0;
- }
- if (Qo(t))
- return I6(t.parent) ? t.parent : void 0;
- if (t.kind === 126 && oc(t.parent)) {
- t = t.parent;
- continue;
- }
- if (ii(t) && t.initializer && A8(t.initializer))
- return t.initializer;
- if (!i) {
- let s = n.getSymbolAtLocation(t);
- if (s && (s.flags & 2097152 && (s = n.getAliasedSymbol(s)), s.valueDeclaration)) {
- i = !0, t = s.valueDeclaration;
- continue;
- }
- }
- return;
- }
- }
- function Aoe(e, t) {
- const n = t.getSourceFile(), i = mUe(e, t), s = gUe(t), o = Yb(t), c = HD(t), _ = kc(aa(
- n.text,
- t.getFullStart(),
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- ), t.getEnd()), u = kc(i.pos, i.end);
- return { file: n.fileName, kind: o, kindModifiers: c, name: i.text, containerName: s, span: _, selectionSpan: u };
- }
- function hUe(e) {
- return e !== void 0;
- }
- function yUe(e) {
- if (e.kind === Eo.EntryKind.Node) {
- const { node: t } = e;
- if (BU(
- t,
- /*includeElementAccess*/
- !0,
- /*skipPastOuterExpressions*/
- !0
- ) || ise(
- t,
- /*includeElementAccess*/
- !0,
- /*skipPastOuterExpressions*/
- !0
- ) || sse(
- t,
- /*includeElementAccess*/
- !0,
- /*skipPastOuterExpressions*/
- !0
- ) || ase(
- t,
- /*includeElementAccess*/
- !0,
- /*skipPastOuterExpressions*/
- !0
- ) || b6(t) || VU(t)) {
- const n = t.getSourceFile();
- return { declaration: or(t, I6) || n, range: aV(t, n) };
- }
- }
- }
- function qSe(e) {
- return Ma(e.declaration);
- }
- function vUe(e, t) {
- return { from: e, fromSpans: t };
- }
- function bUe(e, t) {
- return vUe(Aoe(e, t[0].declaration), lr(t, (n) => L0(n.range)));
- }
- function SUe(e, t, n) {
- if (Si(t) || zc(t) || oc(t))
- return [];
- const i = BSe(t), s = Ln(Eo.findReferenceOrRenameEntries(
- e,
- n,
- e.getSourceFiles(),
- i,
- /*position*/
- 0,
- { use: Eo.FindReferencesUse.References },
- yUe
- ), hUe);
- return s ? Zk(s, qSe, (o) => bUe(e, o)) : [];
- }
- function TUe(e, t) {
- function n(s) {
- const o = lv(s) ? s.tag : ou(s) ? s.tagName : xo(s) || oc(s) ? s : s.expression, c = VSe(e, o);
- if (c) {
- const _ = aV(o, s.getSourceFile());
- if (us(c))
- for (const u of c)
- t.push({ declaration: u, range: _ });
- else
- t.push({ declaration: c, range: _ });
- }
- }
- function i(s) {
- if (s && !(s.flags & 33554432)) {
- if (I6(s)) {
- if (Zn(s))
- for (const o of s.members)
- o.name && ma(o.name) && i(o.name.expression);
- return;
- }
- switch (s.kind) {
- case 80:
- case 271:
- case 272:
- case 278:
- case 264:
- case 265:
- return;
- case 175:
- n(s);
- return;
- case 216:
- case 234:
- i(s.expression);
- return;
- case 260:
- case 169:
- i(s.name), i(s.initializer);
- return;
- case 213:
- n(s), i(s.expression), ir(s.arguments, i);
- return;
- case 214:
- n(s), i(s.expression), ir(s.arguments, i);
- return;
- case 215:
- n(s), i(s.tag), i(s.template);
- return;
- case 286:
- case 285:
- n(s), i(s.tagName), i(s.attributes);
- return;
- case 170:
- n(s), i(s.expression);
- return;
- case 211:
- case 212:
- n(s), bs(s, i);
- break;
- case 238:
- i(s.expression);
- return;
- }
- um(s) || bs(s, i);
- }
- }
- return i;
- }
- function xUe(e, t) {
- ir(e.statements, t);
- }
- function kUe(e, t) {
- !Gn(
- e,
- 128
- /* Ambient */
- ) && e.body && Sm(e.body) && ir(e.body.statements, t);
- }
- function CUe(e, t, n) {
- const i = WSe(e, t);
- i && (ir(i.parameters, n), n(i.body));
- }
- function EUe(e, t) {
- t(e.body);
- }
- function DUe(e, t) {
- ir(e.modifiers, t);
- const n = Cb(e);
- n && t(n.expression);
- for (const i of e.members)
- Hp(i) && ir(i.modifiers, t), cs(i) ? t(i.initializer) : Qo(i) && i.body ? (ir(i.parameters, t), t(i.body)) : oc(i) && t(i);
- }
- function PUe(e, t) {
- const n = [], i = TUe(e, n);
- switch (t.kind) {
- case 307:
- xUe(t, i);
- break;
- case 267:
- kUe(t, i);
- break;
- case 262:
- case 218:
- case 219:
- case 174:
- case 177:
- case 178:
- CUe(e.getTypeChecker(), t, i);
- break;
- case 263:
- case 231:
- DUe(t, i);
- break;
- case 175:
- EUe(t, i);
- break;
- default:
- E.assertNever(t);
- }
- return n;
- }
- function wUe(e, t) {
- return { to: e, fromSpans: t };
- }
- function AUe(e, t) {
- return wUe(Aoe(e, t[0].declaration), lr(t, (n) => L0(n.range)));
- }
- function NUe(e, t) {
- return t.flags & 33554432 || vm(t) ? [] : Zk(PUe(e, t), qSe, (n) => AUe(e, n));
- }
- var Noe = {};
- La(Noe, {
- v2020: () => HSe
- });
- var HSe = {};
- La(HSe, {
- TokenEncodingConsts: () => vSe,
- TokenModifier: () => SSe,
- TokenType: () => bSe,
- getEncodedSemanticClassifications: () => koe,
- getSemanticClassifications: () => TSe
- });
- var xu = {};
- La(xu, {
- PreserveOptionalFlags: () => n6e,
- addNewNodeForMemberSymbol: () => i6e,
- codeFixAll: () => Za,
- createCodeFixAction: () => Ls,
- createCodeFixActionMaybeFixAll: () => Foe,
- createCodeFixActionWithoutFixAll: () => Rd,
- createCombinedCodeActions: () => ik,
- createFileTextChanges: () => GSe,
- createImportAdder: () => s2,
- createImportSpecifierResolver: () => JVe,
- createMissingMemberNodes: () => Kce,
- createSignatureDeclarationFromCallExpression: () => ele,
- createSignatureDeclarationFromSignature: () => eH,
- createStubbedBody: () => Q9,
- eachDiagnostic: () => sk,
- findAncestorMatchingSpan: () => ale,
- generateAccessorFromProperty: () => _6e,
- getAccessorConvertiblePropertyAtPosition: () => d6e,
- getAllFixes: () => LUe,
- getAllSupers: () => ole,
- getFixes: () => FUe,
- getImportCompletionAction: () => zVe,
- getImportKind: () => Bq,
- getJSDocTypedefNodes: () => jVe,
- getNoopSymbolTrackerWithResolver: () => F6,
- getPromoteTypeOnlyCompletionAction: () => WVe,
- getSupportedErrorCodes: () => IUe,
- importFixName: () => pxe,
- importSymbols: () => OS,
- parameterShouldGetTypeFromJSDoc: () => TTe,
- registerCodeFix: () => Ys,
- setJsonCompilerOptionValue: () => ile,
- setJsonCompilerOptionValues: () => nle,
- tryGetAutoImportableReferenceFromTypeNode: () => a2,
- typePredicateToAutoImportableTypeNode: () => a6e,
- typeToAutoImportableTypeNode: () => X9
- });
- var Ioe = Ip(), Ooe = /* @__PURE__ */ new Map();
- function Rd(e, t, n) {
- return Loe(
- e,
- e2(n),
- t,
- /*fixId*/
- void 0,
- /*fixAllDescription*/
- void 0
- );
- }
- function Ls(e, t, n, i, s, o) {
- return Loe(e, e2(n), t, i, e2(s), o);
- }
- function Foe(e, t, n, i, s, o) {
- return Loe(e, e2(n), t, i, s && e2(s), o);
- }
- function Loe(e, t, n, i, s, o) {
- return { fixName: e, description: t, changes: n, fixId: i, fixAllDescription: s, commands: o ? [o] : void 0 };
- }
- function Ys(e) {
- for (const t of e.errorCodes)
- Moe = void 0, Ioe.add(String(t), e);
- if (e.fixIds)
- for (const t of e.fixIds)
- E.assert(!Ooe.has(t)), Ooe.set(t, e);
- }
- var Moe;
- function IUe() {
- return Moe ?? (Moe = as(Ioe.keys()));
- }
- function OUe(e, t) {
- const { errorCodes: n } = e;
- let i = 0;
- for (const o of t)
- if (ss(n, o.code) && i++, i > 1) break;
- const s = i < 2;
- return ({ fixId: o, fixAllDescription: c, ..._ }) => s ? _ : { ..._, fixId: o, fixAllDescription: c };
- }
- function FUe(e) {
- const t = $Se(e), n = Ioe.get(String(e.errorCode));
- return ta(n, (i) => lr(i.getCodeActions(e), OUe(i, t)));
- }
- function LUe(e) {
- return Ooe.get(Bs(e.fixId, _s)).getAllCodeActions(e);
- }
- function ik(e, t) {
- return { changes: e, commands: t };
- }
- function GSe(e, t) {
- return { fileName: e, textChanges: t };
- }
- function Za(e, t, n) {
- const i = [], s = sn.ChangeTracker.with(e, (o) => sk(e, t, (c) => n(o, c, i)));
- return ik(s, i.length === 0 ? void 0 : i);
- }
- function sk(e, t, n) {
- for (const i of $Se(e))
- ss(t, i.code) && n(i);
- }
- function $Se({ program: e, sourceFile: t, cancellationToken: n }) {
- const i = [
- ...e.getSemanticDiagnostics(t, n),
- ...e.getSyntacticDiagnostics(t, n),
- ...YV(t, e, n)
- ];
- return P_(e.getCompilerOptions()) && i.push(
- ...e.getDeclarationDiagnostics(t, n)
- ), i;
- }
- var Roe = "addConvertToUnknownForNonOverlappingTypes", XSe = [p.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];
- Ys({
- errorCodes: XSe,
- getCodeActions: function(t) {
- const n = YSe(t.sourceFile, t.span.start);
- if (n === void 0) return;
- const i = sn.ChangeTracker.with(t, (s) => QSe(s, t.sourceFile, n));
- return [Ls(Roe, i, p.Add_unknown_conversion_for_non_overlapping_types, Roe, p.Add_unknown_to_all_conversions_of_non_overlapping_types)];
- },
- fixIds: [Roe],
- getAllCodeActions: (e) => Za(e, XSe, (t, n) => {
- const i = YSe(n.file, n.start);
- i && QSe(t, n.file, i);
- })
- });
- function QSe(e, t, n) {
- const i = iD(n) ? A.createAsExpression(n.expression, A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- )) : A.createTypeAssertion(A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- ), n.expression);
- e.replaceNode(t, n.expression, i);
- }
- function YSe(e, t) {
- if (!cn(e))
- return or(xi(e, t), (n) => iD(n) || OJ(n));
- }
- Ys({
- errorCodes: [
- p.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,
- p.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,
- p.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code
- ],
- getCodeActions: function(t) {
- const { sourceFile: n } = t, i = sn.ChangeTracker.with(t, (s) => {
- const o = A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports([]),
- /*moduleSpecifier*/
- void 0
- );
- s.insertNodeAtEndOfScope(n, n, o);
- });
- return [Rd("addEmptyExportDeclaration", i, p.Add_export_to_make_this_file_into_a_module)];
- }
- });
- var joe = "addMissingAsync", ZSe = [
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
- p.Type_0_is_not_assignable_to_type_1.code,
- p.Type_0_is_not_comparable_to_type_1.code
- ];
- Ys({
- fixIds: [joe],
- errorCodes: ZSe,
- getCodeActions: function(t) {
- const { sourceFile: n, errorCode: i, cancellationToken: s, program: o, span: c } = t, _ = On(o.getTypeChecker().getDiagnostics(n, s), RUe(c, i)), u = _ && _.relatedInformation && On(_.relatedInformation, (h) => h.code === p.Did_you_mean_to_mark_this_function_as_async.code), d = eTe(n, u);
- return d ? [KSe(t, d, (h) => sn.ChangeTracker.with(t, h))] : void 0;
- },
- getAllCodeActions: (e) => {
- const { sourceFile: t } = e, n = /* @__PURE__ */ new Set();
- return Za(e, ZSe, (i, s) => {
- const o = s.relatedInformation && On(s.relatedInformation, (u) => u.code === p.Did_you_mean_to_mark_this_function_as_async.code), c = eTe(t, o);
- return c ? KSe(e, c, (u) => (u(i), []), n) : void 0;
- });
- }
- });
- function KSe(e, t, n, i) {
- const s = n((o) => MUe(o, e.sourceFile, t, i));
- return Ls(joe, s, p.Add_async_modifier_to_containing_function, joe, p.Add_all_missing_async_modifiers);
- }
- function MUe(e, t, n, i) {
- if (i && i.has(Ma(n)))
- return;
- i?.add(Ma(n));
- const s = A.replaceModifiers(
- Ja(
- n,
- /*includeTrivia*/
- !0
- ),
- A.createNodeArray(A.createModifiersFromModifierFlags(
- T0(n) | 1024
- /* Async */
- ))
- );
- e.replaceNode(
- t,
- n,
- s
- );
- }
- function eTe(e, t) {
- if (!t) return;
- const n = xi(e, t.start);
- return or(n, (s) => s.getStart(e) < t.start || s.getEnd() > ec(t) ? "quit" : (Co(s) || hc(s) || vo(s) || Ec(s)) && C6(t, t_(s, e)));
- }
- function RUe(e, t) {
- return ({ start: n, length: i, relatedInformation: s, code: o }) => yy(n) && yy(i) && C6({ start: n, length: i }, e) && o === t && !!s && ut(s, (c) => c.code === p.Did_you_mean_to_mark_this_function_as_async.code);
- }
- var Boe = "addMissingAwait", tTe = p.Property_0_does_not_exist_on_type_1.code, rTe = [
- p.This_expression_is_not_callable.code,
- p.This_expression_is_not_constructable.code
- ], Joe = [
- p.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
- p.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
- p.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
- p.Operator_0_cannot_be_applied_to_type_1.code,
- p.Operator_0_cannot_be_applied_to_types_1_and_2.code,
- p.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,
- p.This_condition_will_always_return_true_since_this_0_is_always_defined.code,
- p.Type_0_is_not_an_array_type.code,
- p.Type_0_is_not_an_array_type_or_a_string_type.code,
- p.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,
- p.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
- p.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
- p.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
- p.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
- tTe,
- ...rTe
- ];
- Ys({
- fixIds: [Boe],
- errorCodes: Joe,
- getCodeActions: function(t) {
- const { sourceFile: n, errorCode: i, span: s, cancellationToken: o, program: c } = t, _ = nTe(n, i, s, o, c);
- if (!_)
- return;
- const u = t.program.getTypeChecker(), d = (g) => sn.ChangeTracker.with(t, g);
- return tw([
- iTe(t, _, i, u, d),
- sTe(t, _, i, u, d)
- ]);
- },
- getAllCodeActions: (e) => {
- const { sourceFile: t, program: n, cancellationToken: i } = e, s = e.program.getTypeChecker(), o = /* @__PURE__ */ new Set();
- return Za(e, Joe, (c, _) => {
- const u = nTe(t, _.code, _, i, n);
- if (!u)
- return;
- const d = (g) => (g(c), []);
- return iTe(e, u, _.code, s, d, o) || sTe(e, u, _.code, s, d, o);
- });
- }
- });
- function nTe(e, t, n, i, s) {
- const o = OV(e, n);
- return o && jUe(e, t, n, i, s) && aTe(o) ? o : void 0;
- }
- function iTe(e, t, n, i, s, o) {
- const { sourceFile: c, program: _, cancellationToken: u } = e, d = BUe(t, c, u, _, i);
- if (d) {
- const g = s((h) => {
- ir(d.initializers, ({ expression: S }) => zoe(h, n, c, i, S, o)), o && d.needsSecondPassForFixAll && zoe(h, n, c, i, t, o);
- });
- return Rd(
- "addMissingAwaitToInitializer",
- g,
- d.initializers.length === 1 ? [p.Add_await_to_initializer_for_0, d.initializers[0].declarationSymbol.name] : p.Add_await_to_initializers
- );
- }
- }
- function sTe(e, t, n, i, s, o) {
- const c = s((_) => zoe(_, n, e.sourceFile, i, t, o));
- return Ls(Boe, c, p.Add_await, Boe, p.Fix_all_expressions_possibly_missing_await);
- }
- function jUe(e, t, n, i, s) {
- const c = s.getTypeChecker().getDiagnostics(e, i);
- return ut(c, ({ start: _, length: u, relatedInformation: d, code: g }) => yy(_) && yy(u) && C6({ start: _, length: u }, n) && g === t && !!d && ut(d, (h) => h.code === p.Did_you_forget_to_use_await.code));
- }
- function BUe(e, t, n, i, s) {
- const o = JUe(e, s);
- if (!o)
- return;
- let c = o.isCompleteFix, _;
- for (const u of o.identifiers) {
- const d = s.getSymbolAtLocation(u);
- if (!d)
- continue;
- const g = Wn(d.valueDeclaration, ii), h = g && Wn(g.name, Oe), S = nv(
- g,
- 243
- /* VariableStatement */
- );
- if (!g || !S || g.type || !g.initializer || S.getSourceFile() !== t || Gn(
- S,
- 32
- /* Export */
- ) || !h || !aTe(g.initializer)) {
- c = !1;
- continue;
- }
- const T = i.getSemanticDiagnostics(t, n);
- if (Eo.Core.eachSymbolReferenceInFile(h, s, t, (D) => u !== D && !zUe(D, T, t, s))) {
- c = !1;
- continue;
- }
- (_ || (_ = [])).push({
- expression: g.initializer,
- declarationSymbol: d
- });
- }
- return _ && {
- initializers: _,
- needsSecondPassForFixAll: !c
- };
- }
- function JUe(e, t) {
- if (Cn(e.parent) && Oe(e.parent.expression))
- return { identifiers: [e.parent.expression], isCompleteFix: !0 };
- if (Oe(e))
- return { identifiers: [e], isCompleteFix: !0 };
- if (dn(e)) {
- let n, i = !0;
- for (const s of [e.left, e.right]) {
- const o = t.getTypeAtLocation(s);
- if (t.getPromisedTypeOfPromise(o)) {
- if (!Oe(s)) {
- i = !1;
- continue;
- }
- (n || (n = [])).push(s);
- }
- }
- return n && { identifiers: n, isCompleteFix: i };
- }
- }
- function zUe(e, t, n, i) {
- const s = Cn(e.parent) ? e.parent.name : dn(e.parent) ? e.parent : e, o = On(t, (c) => c.start === s.getStart(n) && c.start + c.length === s.getEnd());
- return o && ss(Joe, o.code) || // A Promise is usually not correct in a binary expression (it's not valid
- // in an arithmetic expression and an equality comparison seems unusual),
- // but if the other side of the binary expression has an error, the side
- // is typed `any` which will squash the error that would identify this
- // Promise as an invalid operand. So if the whole binary expression is
- // typed `any` as a result, there is a strong likelihood that this Promise
- // is accidentally missing `await`.
- i.getTypeAtLocation(s).flags & 1;
- }
- function aTe(e) {
- return e.flags & 65536 || !!or(e, (t) => t.parent && Co(t.parent) && t.parent.body === t || Cs(t) && (t.parent.kind === 262 || t.parent.kind === 218 || t.parent.kind === 219 || t.parent.kind === 174));
- }
- function zoe(e, t, n, i, s, o) {
- if (nA(s.parent) && !s.parent.awaitModifier) {
- const c = i.getTypeAtLocation(s), _ = i.getAnyAsyncIterableType();
- if (_ && i.isTypeAssignableTo(c, _)) {
- const u = s.parent;
- e.replaceNode(n, u, A.updateForOfStatement(u, A.createToken(
- 135
- /* AwaitKeyword */
- ), u.initializer, u.expression, u.statement));
- return;
- }
- }
- if (dn(s))
- for (const c of [s.left, s.right]) {
- if (o && Oe(c)) {
- const d = i.getSymbolAtLocation(c);
- if (d && o.has(na(d)))
- continue;
- }
- const _ = i.getTypeAtLocation(c), u = i.getPromisedTypeOfPromise(_) ? A.createAwaitExpression(c) : c;
- e.replaceNode(n, c, u);
- }
- else if (t === tTe && Cn(s.parent)) {
- if (o && Oe(s.parent.expression)) {
- const c = i.getSymbolAtLocation(s.parent.expression);
- if (c && o.has(na(c)))
- return;
- }
- e.replaceNode(
- n,
- s.parent.expression,
- A.createParenthesizedExpression(A.createAwaitExpression(s.parent.expression))
- ), oTe(e, s.parent.expression, n);
- } else if (ss(rTe, t) && am(s.parent)) {
- if (o && Oe(s)) {
- const c = i.getSymbolAtLocation(s);
- if (c && o.has(na(c)))
- return;
- }
- e.replaceNode(n, s, A.createParenthesizedExpression(A.createAwaitExpression(s))), oTe(e, s, n);
- } else {
- if (o && ii(s.parent) && Oe(s.parent.name)) {
- const c = i.getSymbolAtLocation(s.parent.name);
- if (c && !Xm(o, na(c)))
- return;
- }
- e.replaceNode(n, s, A.createAwaitExpression(s));
- }
- }
- function oTe(e, t, n) {
- const i = sl(t.pos, n);
- i && f9(i.end, i.parent, n) && e.insertText(n, t.getStart(n), ";");
- }
- var Woe = "addMissingConst", cTe = [
- p.Cannot_find_name_0.code,
- p.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code
- ];
- Ys({
- errorCodes: cTe,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => lTe(i, t.sourceFile, t.span.start, t.program));
- if (n.length > 0)
- return [Ls(Woe, n, p.Add_const_to_unresolved_variable, Woe, p.Add_const_to_all_unresolved_variables)];
- },
- fixIds: [Woe],
- getAllCodeActions: (e) => {
- const t = /* @__PURE__ */ new Set();
- return Za(e, cTe, (n, i) => lTe(n, i.file, i.start, e.program, t));
- }
- });
- function lTe(e, t, n, i, s) {
- const o = xi(t, n), c = or(o, (d) => Z2(d.parent) ? d.parent.initializer === d : WUe(d) ? !1 : "quit");
- if (c) return Pq(e, c, t, s);
- const _ = o.parent;
- if (dn(_) && _.operatorToken.kind === 64 && Pl(_.parent))
- return Pq(e, o, t, s);
- if ($l(_)) {
- const d = i.getTypeChecker();
- return Mi(_.elements, (g) => UUe(g, d)) ? Pq(e, _, t, s) : void 0;
- }
- const u = or(o, (d) => Pl(d.parent) ? !0 : VUe(d) ? !1 : "quit");
- if (u) {
- const d = i.getTypeChecker();
- return uTe(u, d) ? Pq(e, u, t, s) : void 0;
- }
- }
- function Pq(e, t, n, i) {
- (!i || Xm(i, t)) && e.insertModifierBefore(n, 87, t);
- }
- function WUe(e) {
- switch (e.kind) {
- case 80:
- case 209:
- case 210:
- case 303:
- case 304:
- return !0;
- default:
- return !1;
- }
- }
- function UUe(e, t) {
- const n = Oe(e) ? e : Dl(
- e,
- /*excludeCompoundAssignment*/
- !0
- ) && Oe(e.left) ? e.left : void 0;
- return !!n && !t.getSymbolAtLocation(n);
- }
- function VUe(e) {
- switch (e.kind) {
- case 80:
- case 226:
- case 28:
- return !0;
- default:
- return !1;
- }
- }
- function uTe(e, t) {
- return dn(e) ? e.operatorToken.kind === 28 ? Mi([e.left, e.right], (n) => uTe(n, t)) : e.operatorToken.kind === 64 && Oe(e.left) && !t.getSymbolAtLocation(e.left) : !1;
- }
- var Uoe = "addMissingDeclareProperty", _Te = [
- p.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code
- ];
- Ys({
- errorCodes: _Te,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => fTe(i, t.sourceFile, t.span.start));
- if (n.length > 0)
- return [Ls(Uoe, n, p.Prefix_with_declare, Uoe, p.Prefix_all_incorrect_property_declarations_with_declare)];
- },
- fixIds: [Uoe],
- getAllCodeActions: (e) => {
- const t = /* @__PURE__ */ new Set();
- return Za(e, _Te, (n, i) => fTe(n, i.file, i.start, t));
- }
- });
- function fTe(e, t, n, i) {
- const s = xi(t, n);
- if (!Oe(s))
- return;
- const o = s.parent;
- o.kind === 172 && (!i || Xm(i, o)) && e.insertModifierBefore(t, 138, o);
- }
- var Voe = "addMissingInvocationForDecorator", pTe = [p._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];
- Ys({
- errorCodes: pTe,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => dTe(i, t.sourceFile, t.span.start));
- return [Ls(Voe, n, p.Call_decorator_expression, Voe, p.Add_to_all_uncalled_decorators)];
- },
- fixIds: [Voe],
- getAllCodeActions: (e) => Za(e, pTe, (t, n) => dTe(t, n.file, n.start))
- });
- function dTe(e, t, n) {
- const i = xi(t, n), s = or(i, dl);
- E.assert(!!s, "Expected position to be owned by a decorator.");
- const o = A.createCallExpression(
- s.expression,
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- void 0
- );
- e.replaceNode(t, s.expression, o);
- }
- var qoe = "addNameToNamelessParameter", mTe = [p.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];
- Ys({
- errorCodes: mTe,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => gTe(i, t.sourceFile, t.span.start));
- return [Ls(qoe, n, p.Add_parameter_name, qoe, p.Add_names_to_all_parameters_without_names)];
- },
- fixIds: [qoe],
- getAllCodeActions: (e) => Za(e, mTe, (t, n) => gTe(t, n.file, n.start))
- });
- function gTe(e, t, n) {
- const i = xi(t, n), s = i.parent;
- if (!Ii(s))
- return E.fail("Tried to add a parameter name to a non-parameter: " + E.formatSyntaxKind(i.kind));
- const o = s.parent.parameters.indexOf(s);
- E.assert(!s.type, "Tried to add a parameter name to a parameter that already had one."), E.assert(o > -1, "Parameter not found in parent parameter list.");
- let c = s.name.getEnd(), _ = A.createTypeReferenceNode(
- s.name,
- /*typeArguments*/
- void 0
- ), u = hTe(t, s);
- for (; u; )
- _ = A.createArrayTypeNode(_), c = u.getEnd(), u = hTe(t, u);
- const d = A.createParameterDeclaration(
- s.modifiers,
- s.dotDotDotToken,
- "arg" + o,
- s.questionToken,
- s.dotDotDotToken && !rA(_) ? A.createArrayTypeNode(_) : _,
- s.initializer
- );
- e.replaceRange(t, op(s.getStart(t), c), d);
- }
- function hTe(e, t) {
- const n = Zb(t.name, t.parent, e);
- if (n && n.kind === 23 && w0(n.parent) && Ii(n.parent.parent))
- return n.parent.parent;
- }
- var yTe = "addOptionalPropertyUndefined", qUe = [
- p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,
- p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code
- ];
- Ys({
- errorCodes: qUe,
- getCodeActions(e) {
- const t = e.program.getTypeChecker(), n = HUe(e.sourceFile, e.span, t);
- if (!n.length)
- return;
- const i = sn.ChangeTracker.with(e, (s) => $Ue(s, n));
- return [Rd(yTe, i, p.Add_undefined_to_optional_property_type)];
- },
- fixIds: [yTe]
- });
- function HUe(e, t, n) {
- var i, s;
- const o = vTe(OV(e, t), n);
- if (!o)
- return Ue;
- const { source: c, target: _ } = o, u = GUe(c, _, n) ? n.getTypeAtLocation(_.expression) : n.getTypeAtLocation(_);
- return (s = (i = u.symbol) == null ? void 0 : i.declarations) != null && s.some((d) => Tr(d).fileName.match(/\.d\.ts$/)) ? Ue : n.getExactOptionalProperties(u);
- }
- function GUe(e, t, n) {
- return Cn(t) && !!n.getExactOptionalProperties(n.getTypeAtLocation(t.expression)).length && n.getTypeAtLocation(e) === n.getUndefinedType();
- }
- function vTe(e, t) {
- var n;
- if (e) {
- if (dn(e.parent) && e.parent.operatorToken.kind === 64)
- return { source: e.parent.right, target: e.parent.left };
- if (ii(e.parent) && e.parent.initializer)
- return { source: e.parent.initializer, target: e.parent.name };
- if (Fs(e.parent)) {
- const i = t.getSymbolAtLocation(e.parent.expression);
- if (!i?.valueDeclaration || !WT(i.valueDeclaration.kind) || !_t(e)) return;
- const s = e.parent.arguments.indexOf(e);
- if (s === -1) return;
- const o = i.valueDeclaration.parameters[s].name;
- if (Oe(o)) return { source: e, target: o };
- } else if (Qc(e.parent) && Oe(e.parent.name) || uu(e.parent)) {
- const i = vTe(e.parent.parent, t);
- if (!i) return;
- const s = t.getPropertyOfType(t.getTypeAtLocation(i.target), e.parent.name.text), o = (n = s?.declarations) == null ? void 0 : n[0];
- return o ? {
- source: Qc(e.parent) ? e.parent.initializer : e.parent.name,
- target: o
- } : void 0;
- }
- } else return;
- }
- function $Ue(e, t) {
- for (const n of t) {
- const i = n.valueDeclaration;
- if (i && (m_(i) || cs(i)) && i.type) {
- const s = A.createUnionTypeNode([
- ...i.type.kind === 192 ? i.type.types : [i.type],
- A.createTypeReferenceNode("undefined")
- ]);
- e.replaceNode(i.getSourceFile(), i.type, s);
- }
- }
- }
- var Hoe = "annotateWithTypeFromJSDoc", bTe = [p.JSDoc_types_may_be_moved_to_TypeScript_types.code];
- Ys({
- errorCodes: bTe,
- getCodeActions(e) {
- const t = STe(e.sourceFile, e.span.start);
- if (!t) return;
- const n = sn.ChangeTracker.with(e, (i) => kTe(i, e.sourceFile, t));
- return [Ls(Hoe, n, p.Annotate_with_type_from_JSDoc, Hoe, p.Annotate_everything_with_types_from_JSDoc)];
- },
- fixIds: [Hoe],
- getAllCodeActions: (e) => Za(e, bTe, (t, n) => {
- const i = STe(n.file, n.start);
- i && kTe(t, n.file, i);
- })
- });
- function STe(e, t) {
- const n = xi(e, t);
- return Wn(Ii(n.parent) ? n.parent.parent : n.parent, TTe);
- }
- function TTe(e) {
- return XUe(e) && xTe(e);
- }
- function xTe(e) {
- return no(e) ? e.parameters.some(xTe) || !e.type && !!kw(e) : !e.type && !!q1(e);
- }
- function kTe(e, t, n) {
- if (no(n) && (kw(n) || n.parameters.some((i) => !!q1(i)))) {
- if (!n.typeParameters) {
- const s = G7(n);
- s.length && e.insertTypeParameters(t, n, s);
- }
- const i = Co(n) && !Ya(n, 21, t);
- i && e.insertNodeBefore(t, xa(n.parameters), A.createToken(
- 21
- /* OpenParenToken */
- ));
- for (const s of n.parameters)
- if (!s.type) {
- const o = q1(s);
- o && e.tryInsertTypeAnnotation(t, s, Ge(o, i2, fi));
- }
- if (i && e.insertNodeAfter(t, _a(n.parameters), A.createToken(
- 22
- /* CloseParenToken */
- )), !n.type) {
- const s = kw(n);
- s && e.tryInsertTypeAnnotation(t, n, Ge(s, i2, fi));
- }
- } else {
- const i = E.checkDefined(q1(n), "A JSDocType for this declaration should exist");
- E.assert(!n.type, "The JSDocType decl should have a type"), e.tryInsertTypeAnnotation(t, n, Ge(i, i2, fi));
- }
- }
- function XUe(e) {
- return no(e) || e.kind === 260 || e.kind === 171 || e.kind === 172;
- }
- function i2(e) {
- switch (e.kind) {
- case 312:
- case 313:
- return A.createTypeReferenceNode("any", Ue);
- case 316:
- return YUe(e);
- case 315:
- return i2(e.type);
- case 314:
- return ZUe(e);
- case 318:
- return KUe(e);
- case 317:
- return eVe(e);
- case 183:
- return rVe(e);
- case 322:
- return QUe(e);
- default:
- const t = br(
- e,
- i2,
- /*context*/
- void 0
- );
- return an(
- t,
- 1
- /* SingleLine */
- ), t;
- }
- }
- function QUe(e) {
- const t = A.createTypeLiteralNode(lr(e.jsDocPropertyTags, (n) => A.createPropertySignature(
- /*modifiers*/
- void 0,
- Oe(n.name) ? n.name : n.name.right,
- V3(n) ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- n.typeExpression && Ge(n.typeExpression.type, i2, fi) || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- )
- )));
- return an(
- t,
- 1
- /* SingleLine */
- ), t;
- }
- function YUe(e) {
- return A.createUnionTypeNode([Ge(e.type, i2, fi), A.createTypeReferenceNode("undefined", Ue)]);
- }
- function ZUe(e) {
- return A.createUnionTypeNode([Ge(e.type, i2, fi), A.createTypeReferenceNode("null", Ue)]);
- }
- function KUe(e) {
- return A.createArrayTypeNode(Ge(e.type, i2, fi));
- }
- function eVe(e) {
- return A.createFunctionTypeNode(Ue, e.parameters.map(tVe), e.type ?? A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ));
- }
- function tVe(e) {
- const t = e.parent.parameters.indexOf(e), n = e.type.kind === 318 && t === e.parent.parameters.length - 1, i = e.name || (n ? "rest" : "arg" + t), s = n ? A.createToken(
- 26
- /* DotDotDotToken */
- ) : e.dotDotDotToken;
- return A.createParameterDeclaration(e.modifiers, s, i, e.questionToken, Ge(e.type, i2, fi), e.initializer);
- }
- function rVe(e) {
- let t = e.typeName, n = e.typeArguments;
- if (Oe(e.typeName)) {
- if (P7(e))
- return nVe(e);
- let i = e.typeName.text;
- switch (e.typeName.text) {
- case "String":
- case "Boolean":
- case "Object":
- case "Number":
- i = i.toLowerCase();
- break;
- case "array":
- case "date":
- case "promise":
- i = i[0].toUpperCase() + i.slice(1);
- break;
- }
- t = A.createIdentifier(i), (i === "Array" || i === "Promise") && !e.typeArguments ? n = A.createNodeArray([A.createTypeReferenceNode("any", Ue)]) : n = Fr(e.typeArguments, i2, fi);
- }
- return A.createTypeReferenceNode(t, n);
- }
- function nVe(e) {
- const t = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- e.typeArguments[0].kind === 150 ? "n" : "s",
- /*questionToken*/
- void 0,
- A.createTypeReferenceNode(e.typeArguments[0].kind === 150 ? "number" : "string", []),
- /*initializer*/
- void 0
- ), n = A.createTypeLiteralNode([A.createIndexSignature(
- /*modifiers*/
- void 0,
- [t],
- e.typeArguments[1]
- )]);
- return an(
- n,
- 1
- /* SingleLine */
- ), n;
- }
- var Goe = "convertFunctionToEs6Class", CTe = [p.This_constructor_function_may_be_converted_to_a_class_declaration.code];
- Ys({
- errorCodes: CTe,
- getCodeActions(e) {
- const t = sn.ChangeTracker.with(e, (n) => ETe(n, e.sourceFile, e.span.start, e.program.getTypeChecker(), e.preferences, e.program.getCompilerOptions()));
- return [Ls(Goe, t, p.Convert_function_to_an_ES2015_class, Goe, p.Convert_all_constructor_functions_to_classes)];
- },
- fixIds: [Goe],
- getAllCodeActions: (e) => Za(e, CTe, (t, n) => ETe(t, n.file, n.start, e.program.getTypeChecker(), e.preferences, e.program.getCompilerOptions()))
- });
- function ETe(e, t, n, i, s, o) {
- const c = i.getSymbolAtLocation(xi(t, n));
- if (!c || !c.valueDeclaration || !(c.flags & 19))
- return;
- const _ = c.valueDeclaration;
- if (Ec(_) || vo(_))
- e.replaceNode(t, _, g(_));
- else if (ii(_)) {
- const h = d(_);
- if (!h)
- return;
- const S = _.parent.parent;
- Fl(_.parent) && _.parent.declarations.length > 1 ? (e.delete(t, _), e.insertNodeAfter(t, S, h)) : e.replaceNode(t, S, h);
- }
- function u(h) {
- const S = [];
- return h.exports && h.exports.forEach((D) => {
- if (D.name === "prototype" && D.declarations) {
- const P = D.declarations[0];
- if (D.declarations.length === 1 && Cn(P) && dn(P.parent) && P.parent.operatorToken.kind === 64 && Ks(P.parent.right)) {
- const I = P.parent.right;
- C(
- I.symbol,
- /*modifiers*/
- void 0,
- S
- );
- }
- } else
- C(D, [A.createToken(
- 126
- /* StaticKeyword */
- )], S);
- }), h.members && h.members.forEach((D, P) => {
- var I, F, O, B;
- if (P === "constructor" && D.valueDeclaration) {
- const z = (B = (O = (F = (I = h.exports) == null ? void 0 : I.get("prototype")) == null ? void 0 : F.declarations) == null ? void 0 : O[0]) == null ? void 0 : B.parent;
- z && dn(z) && Ks(z.right) && ut(z.right.properties, Aq) || e.delete(t, D.valueDeclaration.parent);
- return;
- }
- C(
- D,
- /*modifiers*/
- void 0,
- S
- );
- }), S;
- function T(D, P) {
- return xo(D) ? Cn(D) && Aq(D) ? !0 : ys(P) : Mi(D.properties, (I) => !!(hc(I) || Ew(I) || Qc(I) && vo(I.initializer) && I.name || Aq(I)));
- }
- function C(D, P, I) {
- if (!(D.flags & 8192) && !(D.flags & 4096))
- return;
- const F = D.valueDeclaration, O = F.parent, B = O.right;
- if (!T(F, B) || ut(I, (ae) => {
- const ee = os(ae);
- return !!(ee && Oe(ee) && Nn(ee) === mc(D));
- }))
- return;
- const z = O.parent && O.parent.kind === 244 ? O.parent : O;
- if (e.delete(t, z), !B) {
- I.push(A.createPropertyDeclaration(
- P,
- D.name,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ));
- return;
- }
- if (xo(F) && (vo(B) || Co(B))) {
- const ae = bf(t, s), ee = iVe(F, o, ae);
- ee && X(I, B, ee);
- return;
- } else if (Ks(B)) {
- ir(
- B.properties,
- (ae) => {
- (hc(ae) || Ew(ae)) && I.push(ae), Qc(ae) && vo(ae.initializer) && X(I, ae.initializer, ae.name), Aq(ae);
- }
- );
- return;
- } else {
- if (Gu(t) || !Cn(F)) return;
- const ae = A.createPropertyDeclaration(
- P,
- F.name,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- B
- );
- D6(O.parent, ae, t), I.push(ae);
- return;
- }
- function X(ae, ee, G) {
- return vo(ee) ? q(ae, ee, G) : V(ae, ee, G);
- }
- function q(ae, ee, G) {
- const ue = Qi(P, wq(
- ee,
- 134
- /* AsyncKeyword */
- )), re = A.createMethodDeclaration(
- ue,
- /*asteriskToken*/
- void 0,
- G,
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- ee.parameters,
- /*type*/
- void 0,
- ee.body
- );
- D6(O, re, t), ae.push(re);
- }
- function V(ae, ee, G) {
- const ue = ee.body;
- let re;
- ue.kind === 241 ? re = ue : re = A.createBlock([A.createReturnStatement(ue)]);
- const ne = Qi(P, wq(
- ee,
- 134
- /* AsyncKeyword */
- )), ie = A.createMethodDeclaration(
- ne,
- /*asteriskToken*/
- void 0,
- G,
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- ee.parameters,
- /*type*/
- void 0,
- re
- );
- D6(O, ie, t), ae.push(ie);
- }
- }
- }
- function d(h) {
- const S = h.initializer;
- if (!S || !vo(S) || !Oe(h.name))
- return;
- const T = u(h.symbol);
- S.body && T.unshift(A.createConstructorDeclaration(
- /*modifiers*/
- void 0,
- S.parameters,
- S.body
- ));
- const C = wq(
- h.parent.parent,
- 95
- /* ExportKeyword */
- );
- return A.createClassDeclaration(
- C,
- h.name,
- /*typeParameters*/
- void 0,
- /*heritageClauses*/
- void 0,
- T
- );
- }
- function g(h) {
- const S = u(c);
- h.body && S.unshift(A.createConstructorDeclaration(
- /*modifiers*/
- void 0,
- h.parameters,
- h.body
- ));
- const T = wq(
- h,
- 95
- /* ExportKeyword */
- );
- return A.createClassDeclaration(
- T,
- h.name,
- /*typeParameters*/
- void 0,
- /*heritageClauses*/
- void 0,
- S
- );
- }
- }
- function wq(e, t) {
- return Hp(e) ? Ln(e.modifiers, (n) => n.kind === t) : void 0;
- }
- function Aq(e) {
- return e.name ? !!(Oe(e.name) && e.name.text === "constructor") : !1;
- }
- function iVe(e, t, n) {
- if (Cn(e))
- return e.name;
- const i = e.argumentExpression;
- if (d_(i))
- return i;
- if (Xa(i))
- return k_(i.text, pa(t)) ? A.createIdentifier(i.text) : fS(i) ? A.createStringLiteral(
- i.text,
- n === 0
- /* Single */
- ) : i;
- }
- var $oe = "convertToAsyncFunction", DTe = [p.This_may_be_converted_to_an_async_function.code], Nq = !0;
- Ys({
- errorCodes: DTe,
- getCodeActions(e) {
- Nq = !0;
- const t = sn.ChangeTracker.with(e, (n) => PTe(n, e.sourceFile, e.span.start, e.program.getTypeChecker()));
- return Nq ? [Ls($oe, t, p.Convert_to_async_function, $oe, p.Convert_all_to_async_functions)] : [];
- },
- fixIds: [$oe],
- getAllCodeActions: (e) => Za(e, DTe, (t, n) => PTe(t, n.file, n.start, e.program.getTypeChecker()))
- });
- function PTe(e, t, n, i) {
- const s = xi(t, n);
- let o;
- if (Oe(s) && ii(s.parent) && s.parent.initializer && no(s.parent.initializer) ? o = s.parent.initializer : o = Wn(yf(xi(t, n)), eq), !o)
- return;
- const c = /* @__PURE__ */ new Map(), _ = cn(o), u = aVe(o, i), d = oVe(o, i, c);
- if (!ZV(d, i))
- return;
- const g = d.body && Cs(d.body) ? sVe(d.body, i) : Ue, h = { checker: i, synthNamesMap: c, setOfExpressionsToReturn: u, isInJSFile: _ };
- if (!g.length)
- return;
- const S = aa(t.text, gm(o).pos);
- e.insertModifierAt(t, S, 134, { suffix: " " });
- for (const T of g)
- if (bs(T, function C(D) {
- if (Fs(D)) {
- const P = O6(
- D,
- D,
- h,
- /*hasContinuation*/
- !1
- );
- if (ak())
- return !0;
- e.replaceNodeWithNodes(t, T, P);
- } else if (!ys(D) && (bs(D, C), ak()))
- return !0;
- }), ak())
- return;
- }
- function sVe(e, t) {
- const n = [];
- return y0(e, (i) => {
- E9(i, t) && n.push(i);
- }), n;
- }
- function aVe(e, t) {
- if (!e.body)
- return /* @__PURE__ */ new Set();
- const n = /* @__PURE__ */ new Set();
- return bs(e.body, function i(s) {
- N8(s, t, "then") ? (n.add(Ma(s)), ir(s.arguments, i)) : N8(s, t, "catch") || N8(s, t, "finally") ? (n.add(Ma(s)), bs(s, i)) : ATe(s, t) ? n.add(Ma(s)) : bs(s, i);
- }), n;
- }
- function N8(e, t, n) {
- if (!Fs(e)) return !1;
- const s = ZA(e, n) && t.getTypeAtLocation(e);
- return !!(s && t.getPromisedTypeOfPromise(s));
- }
- function wTe(e, t) {
- return (wn(e) & 4) !== 0 && e.target === t;
- }
- function Iq(e, t, n) {
- if (e.expression.name.escapedText === "finally")
- return;
- const i = n.getTypeAtLocation(e.expression.expression);
- if (wTe(i, n.getPromiseType()) || wTe(i, n.getPromiseLikeType()))
- if (e.expression.name.escapedText === "then") {
- if (t === gy(e.arguments, 0))
- return gy(e.typeArguments, 0);
- if (t === gy(e.arguments, 1))
- return gy(e.typeArguments, 1);
- } else
- return gy(e.typeArguments, 0);
- }
- function ATe(e, t) {
- return _t(e) ? !!t.getPromisedTypeOfPromise(t.getTypeAtLocation(e)) : !1;
- }
- function oVe(e, t, n) {
- const i = /* @__PURE__ */ new Map(), s = Ip();
- return bs(e, function o(c) {
- if (!Oe(c)) {
- bs(c, o);
- return;
- }
- const _ = t.getSymbolAtLocation(c);
- if (_) {
- const u = t.getTypeAtLocation(c), d = MTe(u, t), g = na(_).toString();
- if (d && !Ii(c.parent) && !no(c.parent) && !n.has(g)) {
- const h = el(d.parameters), S = h?.valueDeclaration && Ii(h.valueDeclaration) && Wn(h.valueDeclaration.name, Oe) || A.createUniqueName(
- "result",
- 16
- /* Optimistic */
- ), T = NTe(S, s);
- n.set(g, T), s.add(S.text, _);
- } else if (c.parent && (Ii(c.parent) || ii(c.parent) || va(c.parent))) {
- const h = c.text, S = s.get(h);
- if (S && S.some((T) => T !== _)) {
- const T = NTe(c, s);
- i.set(g, T.identifier), n.set(g, T), s.add(h, _);
- } else {
- const T = Ja(c);
- n.set(g, aP(T)), s.add(h, _);
- }
- }
- }
- }), _8(
- e,
- /*includeTrivia*/
- !0,
- (o) => {
- if (va(o) && Oe(o.name) && Mf(o.parent)) {
- const c = t.getSymbolAtLocation(o.name), _ = c && i.get(String(na(c)));
- if (_ && _.text !== (o.name || o.propertyName).getText())
- return A.createBindingElement(
- o.dotDotDotToken,
- o.propertyName || o.name,
- _,
- o.initializer
- );
- } else if (Oe(o)) {
- const c = t.getSymbolAtLocation(o), _ = c && i.get(String(na(c)));
- if (_)
- return A.createIdentifier(_.text);
- }
- }
- );
- }
- function NTe(e, t) {
- const n = (t.get(e.text) || Ue).length, i = n === 0 ? e : A.createIdentifier(e.text + "_" + n);
- return aP(i);
- }
- function ak() {
- return !Nq;
- }
- function Dv() {
- return Nq = !1, Ue;
- }
- function O6(e, t, n, i, s) {
- if (N8(t, n.checker, "then"))
- return uVe(t, gy(t.arguments, 0), gy(t.arguments, 1), n, i, s);
- if (N8(t, n.checker, "catch"))
- return FTe(t, gy(t.arguments, 0), n, i, s);
- if (N8(t, n.checker, "finally"))
- return lVe(t, gy(t.arguments, 0), n, i, s);
- if (Cn(t))
- return O6(e, t.expression, n, i, s);
- const o = n.checker.getTypeAtLocation(t);
- return o && n.checker.getPromisedTypeOfPromise(o) ? (E.assertNode(Ho(t).parent, Cn), _Ve(e, t, n, i, s)) : Dv();
- }
- function Oq({ checker: e }, t) {
- if (t.kind === 106) return !0;
- if (Oe(t) && !jo(t) && Nn(t) === "undefined") {
- const n = e.getSymbolAtLocation(t);
- return !n || e.isUndefinedSymbol(n);
- }
- return !1;
- }
- function cVe(e) {
- const t = A.createUniqueName(
- e.identifier.text,
- 16
- /* Optimistic */
- );
- return aP(t);
- }
- function ITe(e, t, n) {
- let i;
- return n && !O8(e, t) && (I8(n) ? (i = n, t.synthNamesMap.forEach((s, o) => {
- if (s.identifier.text === n.identifier.text) {
- const c = cVe(n);
- t.synthNamesMap.set(o, c);
- }
- })) : i = aP(A.createUniqueName(
- "result",
- 16
- /* Optimistic */
- ), n.types), Zoe(i)), i;
- }
- function OTe(e, t, n, i, s) {
- const o = [];
- let c;
- if (i && !O8(e, t)) {
- c = Ja(Zoe(i));
- const _ = i.types, u = t.checker.getUnionType(
- _,
- 2
- /* Subtype */
- ), d = t.isInJSFile ? void 0 : t.checker.typeToTypeNode(
- u,
- /*enclosingDeclaration*/
- void 0,
- /*flags*/
- void 0
- ), g = [A.createVariableDeclaration(
- c,
- /*exclamationToken*/
- void 0,
- d
- )], h = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- g,
- 1
- /* Let */
- )
- );
- o.push(h);
- }
- return o.push(n), s && c && dVe(s) && o.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- Ja(JTe(s)),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- c
- )
- ],
- 2
- /* Const */
- )
- )), o;
- }
- function lVe(e, t, n, i, s) {
- if (!t || Oq(n, t))
- return O6(
- /* returnContextNode */
- e,
- e.expression.expression,
- n,
- i,
- s
- );
- const o = ITe(e, n, s), c = O6(
- /*returnContextNode*/
- e,
- e.expression.expression,
- n,
- /*hasContinuation*/
- !0,
- o
- );
- if (ak()) return Dv();
- const _ = Qoe(
- t,
- i,
- /*continuationArgName*/
- void 0,
- /*inputArgName*/
- void 0,
- e,
- n
- );
- if (ak()) return Dv();
- const u = A.createBlock(c), d = A.createBlock(_), g = A.createTryStatement(
- u,
- /*catchClause*/
- void 0,
- d
- );
- return OTe(e, n, g, o, s);
- }
- function FTe(e, t, n, i, s) {
- if (!t || Oq(n, t))
- return O6(
- /* returnContextNode */
- e,
- e.expression.expression,
- n,
- i,
- s
- );
- const o = jTe(t, n), c = ITe(e, n, s), _ = O6(
- /*returnContextNode*/
- e,
- e.expression.expression,
- n,
- /*hasContinuation*/
- !0,
- c
- );
- if (ak()) return Dv();
- const u = Qoe(t, i, c, o, e, n);
- if (ak()) return Dv();
- const d = A.createBlock(_), g = A.createCatchClause(o && Ja(U9(o)), A.createBlock(u)), h = A.createTryStatement(
- d,
- g,
- /*finallyBlock*/
- void 0
- );
- return OTe(e, n, h, c, s);
- }
- function uVe(e, t, n, i, s, o) {
- if (!t || Oq(i, t))
- return FTe(e, n, i, s, o);
- if (n && !Oq(i, n))
- return Dv();
- const c = jTe(t, i), _ = O6(
- e.expression.expression,
- e.expression.expression,
- i,
- /*hasContinuation*/
- !0,
- c
- );
- if (ak()) return Dv();
- const u = Qoe(t, s, o, c, e, i);
- return ak() ? Dv() : Qi(_, u);
- }
- function _Ve(e, t, n, i, s) {
- if (O8(e, n)) {
- let o = Ja(t);
- return i && (o = A.createAwaitExpression(o)), [A.createReturnStatement(o)];
- }
- return Fq(
- s,
- A.createAwaitExpression(t),
- /*typeAnnotation*/
- void 0
- );
- }
- function Fq(e, t, n) {
- return !e || BTe(e) ? [A.createExpressionStatement(t)] : I8(e) && e.hasBeenDeclared ? [A.createExpressionStatement(A.createAssignment(Ja(Yoe(e)), t))] : [
- A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- Ja(U9(e)),
- /*exclamationToken*/
- void 0,
- n,
- t
- )
- ],
- 2
- /* Const */
- )
- )
- ];
- }
- function Xoe(e, t) {
- if (t && e) {
- const n = A.createUniqueName(
- "result",
- 16
- /* Optimistic */
- );
- return [
- ...Fq(aP(n), e, t),
- A.createReturnStatement(n)
- ];
- }
- return [A.createReturnStatement(e)];
- }
- function Qoe(e, t, n, i, s, o) {
- var c;
- switch (e.kind) {
- case 106:
- break;
- case 211:
- case 80:
- if (!i)
- break;
- const _ = A.createCallExpression(
- Ja(e),
- /*typeArguments*/
- void 0,
- I8(i) ? [Yoe(i)] : []
- );
- if (O8(s, o))
- return Xoe(_, Iq(s, e, o.checker));
- const u = o.checker.getTypeAtLocation(e), d = o.checker.getSignaturesOfType(
- u,
- 0
- /* Call */
- );
- if (!d.length)
- return Dv();
- const g = d[0].getReturnType(), h = Fq(n, A.createAwaitExpression(_), Iq(s, e, o.checker));
- return n && n.types.push(o.checker.getAwaitedType(g) || g), h;
- case 218:
- case 219: {
- const S = e.body, T = (c = MTe(o.checker.getTypeAtLocation(e), o.checker)) == null ? void 0 : c.getReturnType();
- if (Cs(S)) {
- let C = [], D = !1;
- for (const P of S.statements)
- if (Up(P))
- if (D = !0, E9(P, o.checker))
- C = C.concat(RTe(o, P, t, n));
- else {
- const I = T && P.expression ? LTe(o.checker, T, P.expression) : P.expression;
- C.push(...Xoe(I, Iq(s, e, o.checker)));
- }
- else {
- if (t && y0(P, B1))
- return Dv();
- C.push(P);
- }
- return O8(s, o) ? C.map((P) => Ja(P)) : fVe(
- C,
- n,
- o,
- D
- );
- } else {
- const C = KV(S, o.checker) ? RTe(o, A.createReturnStatement(S), t, n) : Ue;
- if (C.length > 0)
- return C;
- if (T) {
- const D = LTe(o.checker, T, S);
- if (O8(s, o))
- return Xoe(D, Iq(s, e, o.checker));
- {
- const P = Fq(
- n,
- D,
- /*typeAnnotation*/
- void 0
- );
- return n && n.types.push(o.checker.getAwaitedType(T) || T), P;
- }
- } else
- return Dv();
- }
- }
- default:
- return Dv();
- }
- return Ue;
- }
- function LTe(e, t, n) {
- const i = Ja(n);
- return e.getPromisedTypeOfPromise(t) ? A.createAwaitExpression(i) : i;
- }
- function MTe(e, t) {
- const n = t.getSignaturesOfType(
- e,
- 0
- /* Call */
- );
- return Ro(n);
- }
- function fVe(e, t, n, i) {
- const s = [];
- for (const o of e)
- if (Up(o)) {
- if (o.expression) {
- const c = ATe(o.expression, n.checker) ? A.createAwaitExpression(o.expression) : o.expression;
- t === void 0 ? s.push(A.createExpressionStatement(c)) : I8(t) && t.hasBeenDeclared ? s.push(A.createExpressionStatement(A.createAssignment(Yoe(t), c))) : s.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- U9(t),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- c
- )],
- 2
- /* Const */
- )
- ));
- }
- } else
- s.push(Ja(o));
- return !i && t !== void 0 && s.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- U9(t),
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- A.createIdentifier("undefined")
- )],
- 2
- /* Const */
- )
- )), s;
- }
- function RTe(e, t, n, i) {
- let s = [];
- return bs(t, function o(c) {
- if (Fs(c)) {
- const _ = O6(c, c, e, n, i);
- if (s = s.concat(_), s.length > 0)
- return;
- } else ys(c) || bs(c, o);
- }), s;
- }
- function jTe(e, t) {
- const n = [];
- let i;
- if (no(e)) {
- if (e.parameters.length > 0) {
- const u = e.parameters[0].name;
- i = s(u);
- }
- } else Oe(e) ? i = o(e) : Cn(e) && Oe(e.name) && (i = o(e.name));
- if (!i || "identifier" in i && i.identifier.text === "undefined")
- return;
- return i;
- function s(u) {
- if (Oe(u)) return o(u);
- const d = ta(u.elements, (g) => ml(g) ? [] : [s(g.name)]);
- return pVe(u, d);
- }
- function o(u) {
- const d = _(u), g = c(d);
- return g && t.synthNamesMap.get(na(g).toString()) || aP(u, n);
- }
- function c(u) {
- var d;
- return ((d = Wn(u, kd)) == null ? void 0 : d.symbol) ?? t.checker.getSymbolAtLocation(u);
- }
- function _(u) {
- return u.original ? u.original : u;
- }
- }
- function BTe(e) {
- return e ? I8(e) ? !e.identifier.text : Mi(e.elements, BTe) : !0;
- }
- function aP(e, t = []) {
- return { kind: 0, identifier: e, types: t, hasBeenDeclared: !1, hasBeenReferenced: !1 };
- }
- function pVe(e, t = Ue, n = []) {
- return { kind: 1, bindingPattern: e, elements: t, types: n };
- }
- function Yoe(e) {
- return e.hasBeenReferenced = !0, e.identifier;
- }
- function U9(e) {
- return I8(e) ? Zoe(e) : JTe(e);
- }
- function JTe(e) {
- for (const t of e.elements)
- U9(t);
- return e.bindingPattern;
- }
- function Zoe(e) {
- return e.hasBeenDeclared = !0, e.identifier;
- }
- function I8(e) {
- return e.kind === 0;
- }
- function dVe(e) {
- return e.kind === 1;
- }
- function O8(e, t) {
- return !!e.original && t.setOfExpressionsToReturn.has(Ma(e.original));
- }
- Ys({
- errorCodes: [p.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],
- getCodeActions(e) {
- const { sourceFile: t, program: n, preferences: i } = e, s = sn.ChangeTracker.with(e, (o) => {
- if (gVe(t, n.getTypeChecker(), o, pa(n.getCompilerOptions()), bf(t, i)))
- for (const _ of n.getSourceFiles())
- mVe(_, t, n, o, bf(_, i));
- });
- return [Rd("convertToEsModule", s, p.Convert_to_ES_module)];
- }
- });
- function mVe(e, t, n, i, s) {
- var o;
- for (const c of e.imports) {
- const _ = (o = n.getResolvedModuleFromModuleSpecifier(c, e)) == null ? void 0 : o.resolvedModule;
- if (!_ || _.resolvedFileName !== t.fileName)
- continue;
- const u = v4(c);
- switch (u.kind) {
- case 271:
- i.replaceNode(e, u, t1(
- u.name,
- /*namedImports*/
- void 0,
- c,
- s
- ));
- break;
- case 213:
- f_(
- u,
- /*requireStringLiteralLikeArgument*/
- !1
- ) && i.replaceNode(e, u, A.createPropertyAccessExpression(Ja(u), "default"));
- break;
- }
- }
- }
- function gVe(e, t, n, i, s) {
- const o = { original: wVe(e), additional: /* @__PURE__ */ new Set() }, c = hVe(e, t, o);
- yVe(e, c, n);
- let _ = !1, u;
- for (const d of Ln(e.statements, yc)) {
- const g = WTe(e, d, n, t, o, i, s);
- g && t7(g, u ?? (u = /* @__PURE__ */ new Map()));
- }
- for (const d of Ln(e.statements, (g) => !yc(g))) {
- const g = vVe(e, d, t, n, o, i, c, u, s);
- _ = _ || g;
- }
- return u?.forEach((d, g) => {
- n.replaceNode(e, g, d);
- }), _;
- }
- function hVe(e, t, n) {
- const i = /* @__PURE__ */ new Map();
- return zTe(e, (s) => {
- const { text: o } = s.name;
- !i.has(o) && (hB(s.name) || t.resolveName(
- o,
- s,
- 111551,
- /*excludeGlobals*/
- !0
- )) && i.set(o, Lq(`_${o}`, n));
- }), i;
- }
- function yVe(e, t, n) {
- zTe(e, (i, s) => {
- if (s)
- return;
- const { text: o } = i.name;
- n.replaceNode(e, i, A.createIdentifier(t.get(o) || o));
- });
- }
- function zTe(e, t) {
- e.forEachChild(function n(i) {
- if (Cn(i) && qb(e, i.expression) && Oe(i.name)) {
- const { parent: s } = i;
- t(
- i,
- dn(s) && s.left === i && s.operatorToken.kind === 64
- /* EqualsToken */
- );
- }
- i.forEachChild(n);
- });
- }
- function vVe(e, t, n, i, s, o, c, _, u) {
- switch (t.kind) {
- case 243:
- return WTe(e, t, i, n, s, o, u), !1;
- case 244: {
- const { expression: d } = t;
- switch (d.kind) {
- case 213:
- return f_(
- d,
- /*requireStringLiteralLikeArgument*/
- !0
- ) && i.replaceNode(e, t, t1(
- /*defaultImport*/
- void 0,
- /*namedImports*/
- void 0,
- d.arguments[0],
- u
- )), !1;
- case 226: {
- const { operatorToken: g } = d;
- return g.kind === 64 && SVe(e, n, d, i, c, _);
- }
- }
- }
- default:
- return !1;
- }
- }
- function WTe(e, t, n, i, s, o, c) {
- const { declarationList: _ } = t;
- let u = !1;
- const d = lr(_.declarations, (g) => {
- const { name: h, initializer: S } = g;
- if (S) {
- if (qb(e, S))
- return u = !0, oP([]);
- if (f_(
- S,
- /*requireStringLiteralLikeArgument*/
- !0
- ))
- return u = !0, DVe(h, S.arguments[0], i, s, o, c);
- if (Cn(S) && f_(
- S.expression,
- /*requireStringLiteralLikeArgument*/
- !0
- ))
- return u = !0, bVe(h, S.name.text, S.expression.arguments[0], s, c);
- }
- return oP([A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList([g], _.flags)
- )]);
- });
- if (u) {
- n.replaceNodeWithNodes(e, t, ta(d, (h) => h.newImports));
- let g;
- return ir(d, (h) => {
- h.useSitesToUnqualify && t7(h.useSitesToUnqualify, g ?? (g = /* @__PURE__ */ new Map()));
- }), g;
- }
- }
- function bVe(e, t, n, i, s) {
- switch (e.kind) {
- case 206:
- case 207: {
- const o = Lq(t, i);
- return oP([
- HTe(o, t, n, s),
- Mq(
- /*modifiers*/
- void 0,
- e,
- A.createIdentifier(o)
- )
- ]);
- }
- case 80:
- return oP([HTe(e.text, t, n, s)]);
- default:
- return E.assertNever(e, `Convert to ES module got invalid syntax form ${e.kind}`);
- }
- }
- function SVe(e, t, n, i, s, o) {
- const { left: c, right: _ } = n;
- if (!Cn(c))
- return !1;
- if (qb(e, c))
- if (qb(e, _))
- i.delete(e, n.parent);
- else {
- const u = Ks(_) ? TVe(_, o) : f_(
- _,
- /*requireStringLiteralLikeArgument*/
- !0
- ) ? kVe(_.arguments[0], t) : void 0;
- return u ? (i.replaceNodeWithNodes(e, n.parent, u[0]), u[1]) : (i.replaceRangeWithText(e, op(c.getStart(e), _.pos), "export default"), !0);
- }
- else qb(e, c.expression) && xVe(e, n, i, s);
- return !1;
- }
- function TVe(e, t) {
- const n = sR(e.properties, (i) => {
- switch (i.kind) {
- case 177:
- case 178:
- case 304:
- case 305:
- return;
- case 303:
- return Oe(i.name) ? EVe(i.name.text, i.initializer, t) : void 0;
- case 174:
- return Oe(i.name) ? qTe(i.name.text, [A.createToken(
- 95
- /* ExportKeyword */
- )], i, t) : void 0;
- default:
- E.assertNever(i, `Convert to ES6 got invalid prop kind ${i.kind}`);
- }
- });
- return n && [n, !1];
- }
- function xVe(e, t, n, i) {
- const { text: s } = t.left.name, o = i.get(s);
- if (o !== void 0) {
- const c = [
- Mq(
- /*modifiers*/
- void 0,
- o,
- t.right
- ),
- tce([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- o,
- s
- )])
- ];
- n.replaceNodeWithNodes(e, t.parent, c);
- } else
- CVe(t, e, n);
- }
- function kVe(e, t) {
- const n = e.text, i = t.getSymbolAtLocation(e), s = i ? i.exports : eR;
- return s.has(
- "export="
- /* ExportEquals */
- ) ? [[Koe(n)], !0] : s.has(
- "default"
- /* Default */
- ) ? (
- // If there's some non-default export, must include both `export *` and `export default`.
- s.size > 1 ? [[UTe(n), Koe(n)], !0] : [[Koe(n)], !0]
- ) : [[UTe(n)], !1];
- }
- function UTe(e) {
- return tce(
- /*exportSpecifiers*/
- void 0,
- e
- );
- }
- function Koe(e) {
- return tce([A.createExportSpecifier(
- /*isTypeOnly*/
- !1,
- /*propertyName*/
- void 0,
- "default"
- )], e);
- }
- function CVe({ left: e, right: t, parent: n }, i, s) {
- const o = e.name.text;
- if ((vo(t) || Co(t) || $c(t)) && (!t.name || t.name.text === o)) {
- s.replaceRange(i, { pos: e.getStart(i), end: t.getStart(i) }, A.createToken(
- 95
- /* ExportKeyword */
- ), { suffix: " " }), t.name || s.insertName(i, t, o);
- const c = Ya(n, 27, i);
- c && s.delete(i, c);
- } else
- s.replaceNodeRangeWithNodes(i, e.expression, Ya(e, 25, i), [A.createToken(
- 95
- /* ExportKeyword */
- ), A.createToken(
- 87
- /* ConstKeyword */
- )], { joiner: " ", suffix: " " });
- }
- function EVe(e, t, n) {
- const i = [A.createToken(
- 95
- /* ExportKeyword */
- )];
- switch (t.kind) {
- case 218: {
- const { name: o } = t;
- if (o && o.text !== e)
- return s();
- }
- case 219:
- return qTe(e, i, t, n);
- case 231:
- return NVe(e, i, t, n);
- default:
- return s();
- }
- function s() {
- return Mq(i, A.createIdentifier(e), ece(t, n));
- }
- }
- function ece(e, t) {
- if (!t || !ut(as(t.keys()), (i) => nf(e, i)))
- return e;
- return us(e) ? CV(
- e,
- /*includeTrivia*/
- !0,
- n
- ) : _8(
- e,
- /*includeTrivia*/
- !0,
- n
- );
- function n(i) {
- if (i.kind === 211) {
- const s = t.get(i);
- return t.delete(i), s;
- }
- }
- }
- function DVe(e, t, n, i, s, o) {
- switch (e.kind) {
- case 206: {
- const c = sR(e.elements, (_) => _.dotDotDotToken || _.initializer || _.propertyName && !Oe(_.propertyName) || !Oe(_.name) ? void 0 : GTe(_.propertyName && _.propertyName.text, _.name.text));
- if (c)
- return oP([t1(
- /*defaultImport*/
- void 0,
- c,
- t,
- o
- )]);
- }
- case 207: {
- const c = Lq(y8(t.text, s), i);
- return oP([
- t1(
- A.createIdentifier(c),
- /*namedImports*/
- void 0,
- t,
- o
- ),
- Mq(
- /*modifiers*/
- void 0,
- Ja(e),
- A.createIdentifier(c)
- )
- ]);
- }
- case 80:
- return PVe(e, t, n, i, o);
- default:
- return E.assertNever(e, `Convert to ES module got invalid name kind ${e.kind}`);
- }
- }
- function PVe(e, t, n, i, s) {
- const o = n.getSymbolAtLocation(e), c = /* @__PURE__ */ new Map();
- let _ = !1, u;
- for (const g of i.original.get(e.text)) {
- if (n.getSymbolAtLocation(g) !== o || g === e)
- continue;
- const { parent: h } = g;
- if (Cn(h)) {
- const { name: { text: S } } = h;
- if (S === "default") {
- _ = !0;
- const T = g.getText();
- (u ?? (u = /* @__PURE__ */ new Map())).set(h, A.createIdentifier(T));
- } else {
- E.assert(h.expression === g, "Didn't expect expression === use");
- let T = c.get(S);
- T === void 0 && (T = Lq(S, i), c.set(S, T)), (u ?? (u = /* @__PURE__ */ new Map())).set(h, A.createIdentifier(T));
- }
- } else
- _ = !0;
- }
- const d = c.size === 0 ? void 0 : as(wE(c.entries(), ([g, h]) => A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- g === h ? void 0 : A.createIdentifier(g),
- A.createIdentifier(h)
- )));
- return d || (_ = !0), oP(
- [t1(_ ? Ja(e) : void 0, d, t, s)],
- u
- );
- }
- function Lq(e, t) {
- for (; t.original.has(e) || t.additional.has(e); )
- e = `_${e}`;
- return t.additional.add(e), e;
- }
- function wVe(e) {
- const t = Ip();
- return VTe(e, (n) => t.add(n.text, n)), t;
- }
- function VTe(e, t) {
- Oe(e) && AVe(e) && t(e), e.forEachChild((n) => VTe(n, t));
- }
- function AVe(e) {
- const { parent: t } = e;
- switch (t.kind) {
- case 211:
- return t.name !== e;
- case 208:
- return t.propertyName !== e;
- case 276:
- return t.propertyName !== e;
- default:
- return !0;
- }
- }
- function qTe(e, t, n, i) {
- return A.createFunctionDeclaration(
- Qi(t, Kb(n.modifiers)),
- Ja(n.asteriskToken),
- e,
- Kb(n.typeParameters),
- Kb(n.parameters),
- Ja(n.type),
- A.converters.convertToFunctionBlock(ece(n.body, i))
- );
- }
- function NVe(e, t, n, i) {
- return A.createClassDeclaration(
- Qi(t, Kb(n.modifiers)),
- e,
- Kb(n.typeParameters),
- Kb(n.heritageClauses),
- ece(n.members, i)
- );
- }
- function HTe(e, t, n, i) {
- return t === "default" ? t1(
- A.createIdentifier(e),
- /*namedImports*/
- void 0,
- n,
- i
- ) : t1(
- /*defaultImport*/
- void 0,
- [GTe(t, e)],
- n,
- i
- );
- }
- function GTe(e, t) {
- return A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- e !== void 0 && e !== t ? A.createIdentifier(e) : void 0,
- A.createIdentifier(t)
- );
- }
- function Mq(e, t, n) {
- return A.createVariableStatement(
- e,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- t,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- n
- )],
- 2
- /* Const */
- )
- );
- }
- function tce(e, t) {
- return A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- e && A.createNamedExports(e),
- t === void 0 ? void 0 : A.createStringLiteral(t)
- );
- }
- function oP(e, t) {
- return {
- newImports: e,
- useSitesToUnqualify: t
- };
- }
- var rce = "correctQualifiedNameToIndexedAccessType", $Te = [p.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];
- Ys({
- errorCodes: $Te,
- getCodeActions(e) {
- const t = XTe(e.sourceFile, e.span.start);
- if (!t) return;
- const n = sn.ChangeTracker.with(e, (s) => QTe(s, e.sourceFile, t)), i = `${t.left.text}["${t.right.text}"]`;
- return [Ls(rce, n, [p.Rewrite_as_the_indexed_access_type_0, i], rce, p.Rewrite_all_as_indexed_access_types)];
- },
- fixIds: [rce],
- getAllCodeActions: (e) => Za(e, $Te, (t, n) => {
- const i = XTe(n.file, n.start);
- i && QTe(t, n.file, i);
- })
- });
- function XTe(e, t) {
- const n = or(xi(e, t), Xu);
- return E.assert(!!n, "Expected position to be owned by a qualified name."), Oe(n.left) ? n : void 0;
- }
- function QTe(e, t, n) {
- const i = n.right.text, s = A.createIndexedAccessTypeNode(
- A.createTypeReferenceNode(
- n.left,
- /*typeArguments*/
- void 0
- ),
- A.createLiteralTypeNode(A.createStringLiteral(i))
- );
- e.replaceNode(t, n, s);
- }
- var nce = [p.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code], ice = "convertToTypeOnlyExport";
- Ys({
- errorCodes: nce,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => ZTe(i, YTe(t.span, t.sourceFile), t));
- if (n.length)
- return [Ls(ice, n, p.Convert_to_type_only_export, ice, p.Convert_all_re_exported_types_to_type_only_exports)];
- },
- fixIds: [ice],
- getAllCodeActions: function(t) {
- const n = /* @__PURE__ */ new Map();
- return Za(t, nce, (i, s) => {
- const o = YTe(s, t.sourceFile);
- o && zp(n, Ma(o.parent.parent)) && ZTe(i, o, t);
- });
- }
- });
- function YTe(e, t) {
- return Wn(xi(t, e.start).parent, vu);
- }
- function ZTe(e, t, n) {
- if (!t)
- return;
- const i = t.parent, s = i.parent, o = IVe(t, n);
- if (o.length === i.elements.length)
- e.insertModifierBefore(n.sourceFile, 156, i);
- else {
- const c = A.updateExportDeclaration(
- s,
- s.modifiers,
- /*isTypeOnly*/
- !1,
- A.updateNamedExports(i, Ln(i.elements, (u) => !ss(o, u))),
- s.moduleSpecifier,
- /*attributes*/
- void 0
- ), _ = A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !0,
- A.createNamedExports(o),
- s.moduleSpecifier,
- /*attributes*/
- void 0
- );
- e.replaceNode(n.sourceFile, s, c, {
- leadingTriviaOption: sn.LeadingTriviaOption.IncludeAll,
- trailingTriviaOption: sn.TrailingTriviaOption.Exclude
- }), e.insertNodeAfter(n.sourceFile, s, _);
- }
- }
- function IVe(e, t) {
- const n = e.parent;
- if (n.elements.length === 1)
- return n.elements;
- const i = qse(
- t_(n),
- t.program.getSemanticDiagnostics(t.sourceFile, t.cancellationToken)
- );
- return Ln(n.elements, (s) => {
- var o;
- return s === e || ((o = Vse(s, i)) == null ? void 0 : o.code) === nce[0];
- });
- }
- var KTe = [
- p._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
- p._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code
- ], Rq = "convertToTypeOnlyImport";
- Ys({
- errorCodes: KTe,
- getCodeActions: function(t) {
- var n;
- const i = exe(t.sourceFile, t.span.start);
- if (i) {
- const s = sn.ChangeTracker.with(t, (_) => V9(_, t.sourceFile, i)), o = i.kind === 276 && ic(i.parent.parent.parent) && txe(i, t.sourceFile, t.program) ? sn.ChangeTracker.with(t, (_) => V9(_, t.sourceFile, i.parent.parent.parent)) : void 0, c = Ls(
- Rq,
- s,
- i.kind === 276 ? [p.Use_type_0, ((n = i.propertyName) == null ? void 0 : n.text) ?? i.name.text] : p.Use_import_type,
- Rq,
- p.Fix_all_with_type_only_imports
- );
- return ut(o) ? [
- Rd(Rq, o, p.Use_import_type),
- c
- ] : [c];
- }
- },
- fixIds: [Rq],
- getAllCodeActions: function(t) {
- const n = /* @__PURE__ */ new Set();
- return Za(t, KTe, (i, s) => {
- const o = exe(s.file, s.start);
- o?.kind === 272 && !n.has(o) ? (V9(i, s.file, o), n.add(o)) : o?.kind === 276 && ic(o.parent.parent.parent) && !n.has(o.parent.parent.parent) && txe(o, s.file, t.program) ? (V9(i, s.file, o.parent.parent.parent), n.add(o.parent.parent.parent)) : o?.kind === 276 && V9(i, s.file, o);
- });
- }
- });
- function exe(e, t) {
- const { parent: n } = xi(e, t);
- return Zu(n) || ic(n) && n.importClause ? n : void 0;
- }
- function txe(e, t, n) {
- if (e.parent.parent.name)
- return !1;
- const i = e.parent.elements.filter((o) => !o.isTypeOnly);
- if (i.length === 1)
- return !0;
- const s = n.getTypeChecker();
- for (const o of i)
- if (Eo.Core.eachSymbolReferenceInFile(o.name, s, t, (_) => {
- const u = s.getSymbolAtLocation(_);
- return !!u && s.symbolIsValue(u) || !av(_);
- }))
- return !1;
- return !0;
- }
- function V9(e, t, n) {
- var i;
- if (Zu(n))
- e.replaceNode(t, n, A.updateImportSpecifier(
- n,
- /*isTypeOnly*/
- !0,
- n.propertyName,
- n.name
- ));
- else {
- const s = n.importClause;
- if (s.name && s.namedBindings)
- e.replaceNodeWithNodes(t, n, [
- A.createImportDeclaration(
- Kb(
- n.modifiers,
- /*includeTrivia*/
- !0
- ),
- A.createImportClause(
- /*isTypeOnly*/
- !0,
- Ja(
- s.name,
- /*includeTrivia*/
- !0
- ),
- /*namedBindings*/
- void 0
- ),
- Ja(
- n.moduleSpecifier,
- /*includeTrivia*/
- !0
- ),
- Ja(
- n.attributes,
- /*includeTrivia*/
- !0
- )
- ),
- A.createImportDeclaration(
- Kb(
- n.modifiers,
- /*includeTrivia*/
- !0
- ),
- A.createImportClause(
- /*isTypeOnly*/
- !0,
- /*name*/
- void 0,
- Ja(
- s.namedBindings,
- /*includeTrivia*/
- !0
- )
- ),
- Ja(
- n.moduleSpecifier,
- /*includeTrivia*/
- !0
- ),
- Ja(
- n.attributes,
- /*includeTrivia*/
- !0
- )
- )
- ]);
- else {
- const o = ((i = s.namedBindings) == null ? void 0 : i.kind) === 275 ? A.updateNamedImports(
- s.namedBindings,
- qc(s.namedBindings.elements, (_) => A.updateImportSpecifier(
- _,
- /*isTypeOnly*/
- !1,
- _.propertyName,
- _.name
- ))
- ) : s.namedBindings, c = A.updateImportDeclaration(n, n.modifiers, A.updateImportClause(
- s,
- /*isTypeOnly*/
- !0,
- s.name,
- o
- ), n.moduleSpecifier, n.attributes);
- e.replaceNode(t, n, c);
- }
- }
- }
- var sce = "convertTypedefToType", rxe = [p.JSDoc_typedef_may_be_converted_to_TypeScript_type.code];
- Ys({
- fixIds: [sce],
- errorCodes: rxe,
- getCodeActions(e) {
- const t = jh(e.host, e.formatContext.options), n = xi(
- e.sourceFile,
- e.span.start
- );
- if (!n) return;
- const i = sn.ChangeTracker.with(e, (s) => nxe(s, n, e.sourceFile, t));
- if (i.length > 0)
- return [
- Ls(
- sce,
- i,
- p.Convert_typedef_to_TypeScript_type,
- sce,
- p.Convert_all_typedef_to_TypeScript_types
- )
- ];
- },
- getAllCodeActions: (e) => Za(
- e,
- rxe,
- (t, n) => {
- const i = jh(e.host, e.formatContext.options), s = xi(n.file, n.start);
- s && nxe(t, s, n.file, i, !0);
- }
- )
- });
- function nxe(e, t, n, i, s = !1) {
- if (!SS(t)) return;
- const o = FVe(t);
- if (!o) return;
- const c = t.parent, { leftSibling: _, rightSibling: u } = OVe(t);
- let d = c.getStart(), g = "";
- !_ && c.comment && (d = ixe(c, c.getStart(), t.getStart()), g = `${i} */${i}`), _ && (s && SS(_) ? (d = t.getStart(), g = "") : (d = ixe(c, _.getStart(), t.getStart()), g = `${i} */${i}`));
- let h = c.getEnd(), S = "";
- u && (s && SS(u) ? (h = u.getStart(), S = `${i}${i}`) : (h = u.getStart(), S = `${i}/**${i} * `)), e.replaceRange(n, { pos: d, end: h }, o, { prefix: g, suffix: S });
- }
- function OVe(e) {
- const t = e.parent, n = t.getChildCount() - 1, i = t.getChildren().findIndex(
- (c) => c.getStart() === e.getStart() && c.getEnd() === e.getEnd()
- ), s = i > 0 ? t.getChildAt(i - 1) : void 0, o = i < n ? t.getChildAt(i + 1) : void 0;
- return { leftSibling: s, rightSibling: o };
- }
- function ixe(e, t, n) {
- const i = e.getText().substring(t - e.getStart(), n - e.getStart());
- for (let s = i.length; s > 0; s--)
- if (!/[*/\s]/.test(i.substring(s - 1, s)))
- return t + s;
- return n;
- }
- function FVe(e) {
- var t;
- const { typeExpression: n } = e;
- if (!n) return;
- const i = (t = e.name) == null ? void 0 : t.getText();
- if (i) {
- if (n.kind === 322)
- return LVe(i, n);
- if (n.kind === 309)
- return MVe(i, n);
- }
- }
- function LVe(e, t) {
- const n = sxe(t);
- if (ut(n))
- return A.createInterfaceDeclaration(
- /*modifiers*/
- void 0,
- e,
- /*typeParameters*/
- void 0,
- /*heritageClauses*/
- void 0,
- n
- );
- }
- function MVe(e, t) {
- const n = Ja(t.type);
- if (n)
- return A.createTypeAliasDeclaration(
- /*modifiers*/
- void 0,
- A.createIdentifier(e),
- /*typeParameters*/
- void 0,
- n
- );
- }
- function sxe(e) {
- const t = e.jsDocPropertyTags;
- return ut(t) ? Ai(t, (i) => {
- var s;
- const o = RVe(i), c = (s = i.typeExpression) == null ? void 0 : s.type, _ = i.isBracketed;
- let u;
- if (c && bS(c)) {
- const d = sxe(c);
- u = A.createTypeLiteralNode(d);
- } else c && (u = Ja(c));
- if (u && o) {
- const d = _ ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0;
- return A.createPropertySignature(
- /*modifiers*/
- void 0,
- o,
- d,
- u
- );
- }
- }) : void 0;
- }
- function RVe(e) {
- return e.name.kind === 80 ? e.name.text : e.name.right.text;
- }
- function jVe(e) {
- return gf(e) ? ta(e.jsDoc, (t) => {
- var n;
- return (n = t.tags) == null ? void 0 : n.filter((i) => SS(i));
- }) : [];
- }
- var ace = "convertLiteralTypeToMappedType", axe = [p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];
- Ys({
- errorCodes: axe,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = oxe(n, i.start);
- if (!s)
- return;
- const { name: o, constraint: c } = s, _ = sn.ChangeTracker.with(t, (u) => cxe(u, n, s));
- return [Ls(ace, _, [p.Convert_0_to_1_in_0, c, o], ace, p.Convert_all_type_literals_to_mapped_type)];
- },
- fixIds: [ace],
- getAllCodeActions: (e) => Za(e, axe, (t, n) => {
- const i = oxe(n.file, n.start);
- i && cxe(t, n.file, i);
- })
- });
- function oxe(e, t) {
- const n = xi(e, t);
- if (Oe(n)) {
- const i = Bs(n.parent.parent, m_), s = n.getText(e);
- return {
- container: Bs(i.parent, Qu),
- typeNode: i.type,
- constraint: s,
- name: s === "K" ? "P" : "K"
- };
- }
- }
- function cxe(e, t, { container: n, typeNode: i, constraint: s, name: o }) {
- e.replaceNode(
- t,
- n,
- A.createMappedTypeNode(
- /*readonlyToken*/
- void 0,
- A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- o,
- A.createTypeReferenceNode(s)
- ),
- /*nameType*/
- void 0,
- /*questionToken*/
- void 0,
- i,
- /*members*/
- void 0
- )
- );
- }
- var lxe = [
- p.Class_0_incorrectly_implements_interface_1.code,
- p.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code
- ], oce = "fixClassIncorrectlyImplementsInterface";
- Ys({
- errorCodes: lxe,
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = uxe(t, n.start);
- return Ai(DC(i), (s) => {
- const o = sn.ChangeTracker.with(e, (c) => fxe(e, s, t, i, c, e.preferences));
- return o.length === 0 ? void 0 : Ls(oce, o, [p.Implement_interface_0, s.getText(t)], oce, p.Implement_all_unimplemented_interfaces);
- });
- },
- fixIds: [oce],
- getAllCodeActions(e) {
- const t = /* @__PURE__ */ new Map();
- return Za(e, lxe, (n, i) => {
- const s = uxe(i.file, i.start);
- if (zp(t, Ma(s)))
- for (const o of DC(s))
- fxe(e, o, i.file, s, n, e.preferences);
- });
- }
- });
- function uxe(e, t) {
- return E.checkDefined(Ol(xi(e, t)), "There should be a containing class");
- }
- function _xe(e) {
- return !e.valueDeclaration || !(Mu(e.valueDeclaration) & 2);
- }
- function fxe(e, t, n, i, s, o) {
- const c = e.program.getTypeChecker(), _ = BVe(i, c), u = c.getTypeAtLocation(t), g = c.getPropertiesOfType(u).filter(gI(_xe, (P) => !_.has(P.escapedName))), h = c.getTypeAtLocation(i), S = On(i.members, (P) => Qo(P));
- h.getNumberIndexType() || C(
- u,
- 1
- /* Number */
- ), h.getStringIndexType() || C(
- u,
- 0
- /* String */
- );
- const T = s2(n, e.program, o, e.host);
- Kce(i, g, n, e, o, T, (P) => D(n, i, P)), T.writeFixes(s);
- function C(P, I) {
- const F = c.getIndexInfoOfType(P, I);
- F && D(n, i, c.indexInfoToIndexSignatureDeclaration(
- F,
- i,
- /*flags*/
- void 0,
- /*internalFlags*/
- void 0,
- F6(e)
- ));
- }
- function D(P, I, F) {
- S ? s.insertNodeAfter(P, S, F) : s.insertMemberAtStart(P, I, F);
- }
- }
- function BVe(e, t) {
- const n = _m(e);
- if (!n) return Js();
- const i = t.getTypeAtLocation(n), s = t.getPropertiesOfType(i);
- return Js(s.filter(_xe));
- }
- var pxe = "import", dxe = "fixMissingImport", mxe = [
- p.Cannot_find_name_0.code,
- p.Cannot_find_name_0_Did_you_mean_1.code,
- p.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
- p.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
- p.Cannot_find_namespace_0.code,
- p._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
- p._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,
- p.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
- p._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,
- p.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,
- p.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,
- p.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
- p.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
- p.Cannot_find_namespace_0_Did_you_mean_1.code
- ];
- Ys({
- errorCodes: mxe,
- getCodeActions(e) {
- const { errorCode: t, preferences: n, sourceFile: i, span: s, program: o } = e, c = Txe(
- e,
- t,
- s.start,
- /*useAutoImportProvider*/
- !0
- );
- if (c)
- return c.map(
- ({ fix: _, symbolName: u, errorIdentifierText: d }) => lce(
- e,
- i,
- u,
- _,
- /*includeSymbolNameInDescription*/
- u !== d,
- o,
- n
- )
- );
- },
- fixIds: [dxe],
- getAllCodeActions: (e) => {
- const { sourceFile: t, program: n, preferences: i, host: s, cancellationToken: o } = e, c = gxe(
- t,
- n,
- /*useAutoImportProvider*/
- !0,
- i,
- s,
- o
- );
- return sk(e, mxe, (_) => c.addImportFromDiagnostic(_, e)), ik(sn.ChangeTracker.with(e, c.writeFixes));
- }
- });
- function s2(e, t, n, i, s) {
- return gxe(
- e,
- t,
- /*useAutoImportProvider*/
- !1,
- n,
- i,
- s
- );
- }
- function gxe(e, t, n, i, s, o) {
- const c = t.getCompilerOptions(), _ = [], u = [], d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map();
- return { addImportFromDiagnostic: D, addImportFromExportedSymbol: P, writeFixes: B, hasFixes: X, addImportForUnresolvedIdentifier: C, addImportForNonExistentExport: I, removeExistingImport: F, addVerbatimImport: T };
- function T(q) {
- h.add(q);
- }
- function C(q, V, ae) {
- const ee = QVe(q, V, ae);
- !ee || !ee.length || O(xa(ee));
- }
- function D(q, V) {
- const ae = Txe(V, q.code, q.start, n);
- !ae || !ae.length || O(xa(ae));
- }
- function P(q, V, ae) {
- var ee, G;
- const ue = E.checkDefined(q.parent), re = h9(q, pa(c)), ne = t.getTypeChecker(), ie = ne.getMergedSymbol(Hl(q, ne)), Se = vxe(
- e,
- ie,
- re,
- ue,
- /*preferCapitalized*/
- !1,
- t,
- s,
- i,
- o
- );
- if (!Se) {
- E.assert((ee = i.autoImportFileExcludePatterns) == null ? void 0 : ee.length);
- return;
- }
- const J = H9(e, t);
- let oe = hxe(
- e,
- Se,
- t,
- /*position*/
- void 0,
- !!V,
- J,
- s,
- i
- );
- if (oe) {
- const _e = ((G = Wn(ae?.name, Oe)) == null ? void 0 : G.text) ?? re;
- ae && i4(ae) && (oe.kind === 3 || oe.kind === 2) && oe.addAsTypeOnly === 1 && (oe = {
- ...oe,
- addAsTypeOnly: 2
- /* Required */
- }), O({ fix: oe, symbolName: _e ?? re, errorIdentifierText: void 0 });
- }
- }
- function I(q, V, ae, ee, G) {
- const ue = t.getSourceFile(V), re = H9(e, t);
- if (ue && ue.symbol) {
- const { fixes: ne } = q9(
- [{
- exportKind: ae,
- isFromPackageJson: !1,
- moduleFileName: V,
- moduleSymbol: ue.symbol,
- targetFlags: ee
- }],
- /*usagePosition*/
- void 0,
- G,
- re,
- t,
- e,
- s,
- i
- );
- ne.length && O({ fix: ne[0], symbolName: q, errorIdentifierText: q });
- } else {
- const ne = T9(V, 99, t, s), ie = N0.getLocalModuleSpecifierBetweenFileNames(
- e,
- V,
- c,
- Zx(t, s),
- i
- ), Se = Bq(ne, ae, t), J = jq(
- G,
- /*isForNewImportDeclaration*/
- !0,
- /*symbol*/
- void 0,
- ee,
- t.getTypeChecker(),
- c
- );
- O({ fix: {
- kind: 3,
- moduleSpecifierKind: "relative",
- moduleSpecifier: ie,
- importKind: Se,
- addAsTypeOnly: J,
- useRequire: re
- }, symbolName: q, errorIdentifierText: q });
- }
- }
- function F(q) {
- q.kind === 273 && E.assertIsDefined(q.name, "ImportClause should have a name if it's being removed"), g.add(q);
- }
- function O(q) {
- var V, ae;
- const { fix: ee, symbolName: G } = q;
- switch (ee.kind) {
- case 0:
- _.push(ee);
- break;
- case 1:
- u.push(ee);
- break;
- case 2: {
- const { importClauseOrBindingPattern: ie, importKind: Se, addAsTypeOnly: J } = ee;
- let oe = d.get(ie);
- if (oe || d.set(ie, oe = { importClauseOrBindingPattern: ie, defaultImport: void 0, namedImports: /* @__PURE__ */ new Map() }), Se === 0) {
- const _e = oe?.namedImports.get(G);
- oe.namedImports.set(G, ue(_e, J));
- } else
- E.assert(oe.defaultImport === void 0 || oe.defaultImport.name === G, "(Add to Existing) Default import should be missing or match symbolName"), oe.defaultImport = {
- name: G,
- addAsTypeOnly: ue((V = oe.defaultImport) == null ? void 0 : V.addAsTypeOnly, J)
- };
- break;
- }
- case 3: {
- const { moduleSpecifier: ie, importKind: Se, useRequire: J, addAsTypeOnly: oe } = ee, _e = re(ie, Se, J, oe);
- switch (E.assert(_e.useRequire === J, "(Add new) Tried to add an `import` and a `require` for the same module"), Se) {
- case 1:
- E.assert(_e.defaultImport === void 0 || _e.defaultImport.name === G, "(Add new) Default import should be missing or match symbolName"), _e.defaultImport = { name: G, addAsTypeOnly: ue((ae = _e.defaultImport) == null ? void 0 : ae.addAsTypeOnly, oe) };
- break;
- case 0:
- const he = (_e.namedImports || (_e.namedImports = /* @__PURE__ */ new Map())).get(G);
- _e.namedImports.set(G, ue(he, oe));
- break;
- case 3:
- if (c.verbatimModuleSyntax) {
- const le = (_e.namedImports || (_e.namedImports = /* @__PURE__ */ new Map())).get(G);
- _e.namedImports.set(G, ue(le, oe));
- } else
- E.assert(_e.namespaceLikeImport === void 0 || _e.namespaceLikeImport.name === G, "Namespacelike import shoudl be missing or match symbolName"), _e.namespaceLikeImport = { importKind: Se, name: G, addAsTypeOnly: oe };
- break;
- case 2:
- E.assert(_e.namespaceLikeImport === void 0 || _e.namespaceLikeImport.name === G, "Namespacelike import shoudl be missing or match symbolName"), _e.namespaceLikeImport = { importKind: Se, name: G, addAsTypeOnly: oe };
- break;
- }
- break;
- }
- case 4:
- break;
- default:
- E.assertNever(ee, `fix wasn't never - got kind ${ee.kind}`);
- }
- function ue(ie, Se) {
- return Math.max(ie ?? 0, Se);
- }
- function re(ie, Se, J, oe) {
- const _e = ne(
- ie,
- /*topLevelTypeOnly*/
- !0
- ), he = ne(
- ie,
- /*topLevelTypeOnly*/
- !1
- ), le = S.get(_e), me = S.get(he), ve = {
- defaultImport: void 0,
- namedImports: void 0,
- namespaceLikeImport: void 0,
- useRequire: J
- };
- return Se === 1 && oe === 2 ? le || (S.set(_e, ve), ve) : oe === 1 && (le || me) ? le || me : me || (S.set(he, ve), ve);
- }
- function ne(ie, Se) {
- return `${Se ? 1 : 0}|${ie}`;
- }
- }
- function B(q, V) {
- var ae, ee;
- let G;
- sg(e) && e.imports.length === 0 && V !== void 0 ? G = V : G = bf(e, i);
- for (const ne of _)
- uce(q, e, ne);
- for (const ne of u)
- Nxe(q, e, ne, G);
- let ue;
- if (g.size) {
- E.assert(sg(e), "Cannot remove imports from a future source file");
- const ne = new Set(Ai([...g], (_e) => or(_e, ic))), ie = new Set(Ai([...g], (_e) => or(_e, t3))), Se = [...ne].filter(
- (_e) => {
- var he, le, me;
- return (
- // nothing added to the import declaration
- !d.has(_e.importClause) && // no default, or default is being removed
- (!((he = _e.importClause) != null && he.name) || g.has(_e.importClause)) && // no namespace import, or namespace import is being removed
- (!Wn((le = _e.importClause) == null ? void 0 : le.namedBindings, Hg) || g.has(_e.importClause.namedBindings)) && // no named imports, or all named imports are being removed
- (!Wn((me = _e.importClause) == null ? void 0 : me.namedBindings, Tm) || Mi(_e.importClause.namedBindings.elements, (ve) => g.has(ve)))
- );
- }
- ), J = [...ie].filter(
- (_e) => (
- // no binding elements being added to the variable declaration
- (_e.name.kind !== 206 || !d.has(_e.name)) && // no binding elements, or all binding elements are being removed
- (_e.name.kind !== 206 || Mi(_e.name.elements, (he) => g.has(he)))
- )
- ), oe = [...ne].filter(
- (_e) => {
- var he, le;
- return (
- // has named bindings
- ((he = _e.importClause) == null ? void 0 : he.namedBindings) && // is not being fully removed
- Se.indexOf(_e) === -1 && // is not gaining named imports
- !((le = d.get(_e.importClause)) != null && le.namedImports) && // all named imports are being removed
- (_e.importClause.namedBindings.kind === 274 || Mi(_e.importClause.namedBindings.elements, (me) => g.has(me)))
- );
- }
- );
- for (const _e of [...Se, ...J])
- q.delete(e, _e);
- for (const _e of oe)
- q.replaceNode(
- e,
- _e.importClause,
- A.updateImportClause(
- _e.importClause,
- _e.importClause.isTypeOnly,
- _e.importClause.name,
- /*namedBindings*/
- void 0
- )
- );
- for (const _e of g) {
- const he = or(_e, ic);
- he && Se.indexOf(he) === -1 && oe.indexOf(he) === -1 ? _e.kind === 273 ? q.delete(e, _e.name) : (E.assert(_e.kind === 276, "NamespaceImport should have been handled earlier"), (ae = d.get(he.importClause)) != null && ae.namedImports ? (ue ?? (ue = /* @__PURE__ */ new Set())).add(_e) : q.delete(e, _e)) : _e.kind === 208 ? (ee = d.get(_e.parent)) != null && ee.namedImports ? (ue ?? (ue = /* @__PURE__ */ new Set())).add(_e) : q.delete(e, _e) : _e.kind === 271 && q.delete(e, _e);
- }
- }
- d.forEach(({ importClauseOrBindingPattern: ne, defaultImport: ie, namedImports: Se }) => {
- Axe(
- q,
- e,
- ne,
- ie,
- as(Se.entries(), ([J, oe]) => ({ addAsTypeOnly: oe, name: J })),
- ue,
- i
- );
- });
- let re;
- S.forEach(({ useRequire: ne, defaultImport: ie, namedImports: Se, namespaceLikeImport: J }, oe) => {
- const _e = oe.slice(2), le = (ne ? Fxe : Oxe)(
- _e,
- G,
- ie,
- Se && as(Se.entries(), ([me, ve]) => ({ addAsTypeOnly: ve, name: me })),
- J,
- c,
- i
- );
- re = NT(re, le);
- }), re = NT(re, z()), re && dV(
- q,
- e,
- re,
- /*blankLineBetween*/
- !0,
- i
- );
- }
- function z() {
- if (!h.size) return;
- const q = new Set(Ai([...h], (ae) => or(ae, ic))), V = new Set(Ai([...h], (ae) => or(ae, r3)));
- return [
- ...Ai([...h], (ae) => ae.kind === 271 ? Ja(
- ae,
- /*includeTrivia*/
- !0
- ) : void 0),
- ...[...q].map((ae) => {
- var ee;
- return h.has(ae) ? Ja(
- ae,
- /*includeTrivia*/
- !0
- ) : Ja(
- A.updateImportDeclaration(
- ae,
- ae.modifiers,
- ae.importClause && A.updateImportClause(
- ae.importClause,
- ae.importClause.isTypeOnly,
- h.has(ae.importClause) ? ae.importClause.name : void 0,
- h.has(ae.importClause.namedBindings) ? ae.importClause.namedBindings : (ee = Wn(ae.importClause.namedBindings, Tm)) != null && ee.elements.some((G) => h.has(G)) ? A.updateNamedImports(
- ae.importClause.namedBindings,
- ae.importClause.namedBindings.elements.filter((G) => h.has(G))
- ) : void 0
- ),
- ae.moduleSpecifier,
- ae.attributes
- ),
- /*includeTrivia*/
- !0
- );
- }),
- ...[...V].map((ae) => h.has(ae) ? Ja(
- ae,
- /*includeTrivia*/
- !0
- ) : Ja(
- A.updateVariableStatement(
- ae,
- ae.modifiers,
- A.updateVariableDeclarationList(
- ae.declarationList,
- Ai(ae.declarationList.declarations, (ee) => h.has(ee) ? ee : A.updateVariableDeclaration(
- ee,
- ee.name.kind === 206 ? A.updateObjectBindingPattern(
- ee.name,
- ee.name.elements.filter((G) => h.has(G))
- ) : ee.name,
- ee.exclamationToken,
- ee.type,
- ee.initializer
- ))
- )
- ),
- /*includeTrivia*/
- !0
- ))
- ];
- }
- function X() {
- return _.length > 0 || u.length > 0 || d.size > 0 || S.size > 0 || h.size > 0 || g.size > 0;
- }
- }
- function JVe(e, t, n, i) {
- const s = P6(e, i, n), o = bxe(e, t);
- return { getModuleSpecifierForBestExportInfo: c };
- function c(_, u, d, g) {
- const { fixes: h, computedWithoutCacheCount: S } = q9(
- _,
- u,
- d,
- /*useRequire*/
- !1,
- t,
- e,
- n,
- i,
- o,
- g
- ), T = kxe(h, e, t, s, n, i);
- return T && { ...T, computedWithoutCacheCount: S };
- }
- }
- function zVe(e, t, n, i, s, o, c, _, u, d, g, h) {
- let S;
- n ? (S = S8(i, c, _, g, h).get(i.path, n), E.assertIsDefined(S, "Some exportInfo should match the specified exportMapKey")) : (S = YR(ap(t.name)) ? [UVe(e, s, t, _, c)] : vxe(i, e, s, t, o, _, c, g, h), E.assertIsDefined(S, "Some exportInfo should match the specified symbol / moduleSymbol"));
- const T = H9(i, _), C = av(xi(i, d)), D = E.checkDefined(hxe(i, S, _, d, C, T, c, g));
- return {
- moduleSpecifier: D.moduleSpecifier,
- codeAction: yxe(lce(
- { host: c, formatContext: u, preferences: g },
- i,
- s,
- D,
- /*includeSymbolNameInDescription*/
- !1,
- _,
- g
- ))
- };
- }
- function WVe(e, t, n, i, s, o) {
- const c = n.getCompilerOptions(), _ = fR(cce(e, n.getTypeChecker(), t, c)), u = Pxe(e, t, _, n), d = _ !== t.text;
- return u && yxe(lce(
- { host: i, formatContext: s, preferences: o },
- e,
- _,
- u,
- d,
- n,
- o
- ));
- }
- function hxe(e, t, n, i, s, o, c, _) {
- const u = P6(e, _, c);
- return kxe(q9(t, i, s, o, n, e, c, _).fixes, e, n, u, c, _);
- }
- function yxe({ description: e, changes: t, commands: n }) {
- return { description: e, changes: t, commands: n };
- }
- function vxe(e, t, n, i, s, o, c, _, u) {
- const d = Sxe(o, c), g = _.autoImportFileExcludePatterns && Xse(c, _), h = o.getTypeChecker().getMergedSymbol(i), S = g && h.declarations && Jo(
- h,
- 307
- /* SourceFile */
- ), T = S && g(S);
- return S8(e, c, o, _, u).search(e.path, s, (C) => C === n, (C) => {
- if (d(C[0].isFromPackageJson).getMergedSymbol(Hl(C[0].symbol, d(C[0].isFromPackageJson))) === t && (T || C.some((D) => D.moduleSymbol === i || D.symbol.parent === i)))
- return C;
- });
- }
- function UVe(e, t, n, i, s) {
- var o, c;
- const _ = d(
- i.getTypeChecker(),
- /*isFromPackageJson*/
- !1
- );
- if (_)
- return _;
- const u = (c = (o = s.getPackageJsonAutoImportProvider) == null ? void 0 : o.call(s)) == null ? void 0 : c.getTypeChecker();
- return E.checkDefined(u && d(
- u,
- /*isFromPackageJson*/
- !0
- ), "Could not find symbol in specified module for code actions");
- function d(g, h) {
- const S = x9(n, g);
- if (S && Hl(S.symbol, g) === e)
- return { symbol: S.symbol, moduleSymbol: n, moduleFileName: void 0, exportKind: S.exportKind, targetFlags: Hl(e, g).flags, isFromPackageJson: h };
- const T = g.tryGetMemberInModuleExportsAndProperties(t, n);
- if (T && Hl(T, g) === e)
- return { symbol: T, moduleSymbol: n, moduleFileName: void 0, exportKind: 0, targetFlags: Hl(e, g).flags, isFromPackageJson: h };
- }
- }
- function q9(e, t, n, i, s, o, c, _, u = sg(o) ? bxe(o, s) : void 0, d) {
- const g = s.getTypeChecker(), h = u ? ta(e, u.getImportsForExportInfo) : Ue, S = t !== void 0 && VVe(h, t), T = HVe(h, n, g, s.getCompilerOptions());
- if (T)
- return {
- computedWithoutCacheCount: 0,
- fixes: [...S ? [S] : Ue, T]
- };
- const { fixes: C, computedWithoutCacheCount: D = 0 } = $Ve(
- e,
- h,
- s,
- o,
- t,
- n,
- i,
- c,
- _,
- d
- );
- return {
- computedWithoutCacheCount: D,
- fixes: [...S ? [S] : Ue, ...C]
- };
- }
- function VVe(e, t) {
- return Tc(e, ({ declaration: n, importKind: i }) => {
- var s;
- if (i !== 0) return;
- const o = qVe(n), c = o && ((s = xC(n)) == null ? void 0 : s.text);
- if (c)
- return { kind: 0, namespacePrefix: o, usagePosition: t, moduleSpecifierKind: void 0, moduleSpecifier: c };
- });
- }
- function qVe(e) {
- var t, n, i;
- switch (e.kind) {
- case 260:
- return (t = Wn(e.name, Oe)) == null ? void 0 : t.text;
- case 271:
- return e.name.text;
- case 351:
- case 272:
- return (i = Wn((n = e.importClause) == null ? void 0 : n.namedBindings, Hg)) == null ? void 0 : i.name.text;
- default:
- return E.assertNever(e);
- }
- }
- function jq(e, t, n, i, s, o) {
- return e ? n && o.verbatimModuleSyntax && (!(i & 111551) || s.getTypeOnlyAliasDeclaration(n)) ? 2 : 1 : 4;
- }
- function HVe(e, t, n, i) {
- let s;
- for (const c of e) {
- const _ = o(c);
- if (!_) continue;
- const u = i4(_.importClauseOrBindingPattern);
- if (_.addAsTypeOnly !== 4 && u || _.addAsTypeOnly === 4 && !u)
- return _;
- s ?? (s = _);
- }
- return s;
- function o({ declaration: c, importKind: _, symbol: u, targetFlags: d }) {
- if (_ === 3 || _ === 2 || c.kind === 271)
- return;
- if (c.kind === 260)
- return (_ === 0 || _ === 1) && c.name.kind === 206 ? {
- kind: 2,
- importClauseOrBindingPattern: c.name,
- importKind: _,
- moduleSpecifierKind: void 0,
- moduleSpecifier: c.initializer.arguments[0].text,
- addAsTypeOnly: 4
- /* NotAllowed */
- } : void 0;
- const { importClause: g } = c;
- if (!g || !Xa(c.moduleSpecifier))
- return;
- const { name: h, namedBindings: S } = g;
- if (g.isTypeOnly && !(_ === 0 && S))
- return;
- const T = jq(
- t,
- /*isForNewImportDeclaration*/
- !1,
- u,
- d,
- n,
- i
- );
- if (!(_ === 1 && (h || // Cannot add a default import to a declaration that already has one
- T === 2 && S)) && !(_ === 0 && S?.kind === 274))
- return {
- kind: 2,
- importClauseOrBindingPattern: g,
- importKind: _,
- moduleSpecifierKind: void 0,
- moduleSpecifier: c.moduleSpecifier.text,
- addAsTypeOnly: T
- };
- }
- }
- function bxe(e, t) {
- const n = t.getTypeChecker();
- let i;
- for (const s of e.imports) {
- const o = v4(s);
- if (t3(o.parent)) {
- const c = n.resolveExternalModuleName(s);
- c && (i || (i = Ip())).add(na(c), o.parent);
- } else if (o.kind === 272 || o.kind === 271 || o.kind === 351) {
- const c = n.getSymbolAtLocation(s);
- c && (i || (i = Ip())).add(na(c), o);
- }
- }
- return {
- getImportsForExportInfo: ({ moduleSymbol: s, exportKind: o, targetFlags: c, symbol: _ }) => {
- const u = i?.get(na(s));
- if (!u || Gu(e) && !(c & 111551) && !Mi(u, Cm)) return Ue;
- const d = Bq(e, o, t);
- return u.map((g) => ({ declaration: g, importKind: d, symbol: _, targetFlags: c }));
- }
- };
- }
- function H9(e, t) {
- if (!Ug(e.fileName))
- return !1;
- if (e.commonJsModuleIndicator && !e.externalModuleIndicator) return !0;
- if (e.externalModuleIndicator && !e.commonJsModuleIndicator) return !1;
- const n = t.getCompilerOptions();
- if (n.configFile)
- return Ru(n) < 5;
- if (fce(e, t) === 1) return !0;
- if (fce(e, t) === 99) return !1;
- for (const i of t.getSourceFiles())
- if (!(i === e || !Gu(i) || t.isSourceFileFromExternalLibrary(i))) {
- if (i.commonJsModuleIndicator && !i.externalModuleIndicator) return !0;
- if (i.externalModuleIndicator && !i.commonJsModuleIndicator) return !1;
- }
- return !0;
- }
- function Sxe(e, t) {
- return im((n) => n ? t.getPackageJsonAutoImportProvider().getTypeChecker() : e.getTypeChecker());
- }
- function GVe(e, t, n, i, s, o, c, _, u) {
- const d = Ug(t.fileName), g = e.getCompilerOptions(), h = Zx(e, c), S = Sxe(e, c), T = yu(g), C = n9(T), D = u ? (F) => N0.tryGetModuleSpecifiersFromCache(F.moduleSymbol, t, h, _) : (F, O) => N0.getModuleSpecifiersWithCacheInfo(
- F.moduleSymbol,
- O,
- g,
- t,
- h,
- _,
- /*options*/
- void 0,
- /*forAutoImport*/
- !0
- );
- let P = 0;
- const I = ta(o, (F, O) => {
- const B = S(F.isFromPackageJson), { computedWithoutCache: z, moduleSpecifiers: X, kind: q } = D(F, B) ?? {}, V = !!(F.targetFlags & 111551), ae = jq(
- i,
- /*isForNewImportDeclaration*/
- !0,
- F.symbol,
- F.targetFlags,
- B,
- g
- );
- return P += z ? 1 : 0, Ai(X, (ee) => {
- if (C && Yy(ee))
- return;
- if (!V && d && n !== void 0)
- return { kind: 1, moduleSpecifierKind: q, moduleSpecifier: ee, usagePosition: n, exportInfo: F, isReExport: O > 0 };
- const G = Bq(t, F.exportKind, e);
- let ue;
- if (n !== void 0 && G === 3 && F.exportKind === 0) {
- const re = B.resolveExternalModuleSymbol(F.moduleSymbol);
- let ne;
- re !== F.moduleSymbol && (ne = k9(re, B, pa(g), go)), ne || (ne = h8(
- F.moduleSymbol,
- pa(g),
- /*forceCapitalize*/
- !1
- )), ue = { namespacePrefix: ne, usagePosition: n };
- }
- return {
- kind: 3,
- moduleSpecifierKind: q,
- moduleSpecifier: ee,
- importKind: G,
- useRequire: s,
- addAsTypeOnly: ae,
- exportInfo: F,
- isReExport: O > 0,
- qualification: ue
- };
- });
- });
- return { computedWithoutCacheCount: P, fixes: I };
- }
- function $Ve(e, t, n, i, s, o, c, _, u, d) {
- const g = Tc(t, (h) => XVe(h, o, c, n.getTypeChecker(), n.getCompilerOptions()));
- return g ? { fixes: [g] } : GVe(n, i, s, o, c, e, _, u, d);
- }
- function XVe({ declaration: e, importKind: t, symbol: n, targetFlags: i }, s, o, c, _) {
- var u;
- const d = (u = xC(e)) == null ? void 0 : u.text;
- if (d) {
- const g = o ? 4 : jq(
- s,
- /*isForNewImportDeclaration*/
- !0,
- n,
- i,
- c,
- _
- );
- return { kind: 3, moduleSpecifierKind: void 0, moduleSpecifier: d, importKind: t, addAsTypeOnly: g, useRequire: o };
- }
- }
- function Txe(e, t, n, i) {
- const s = xi(e.sourceFile, n);
- let o;
- if (t === p._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code)
- o = eqe(e, s);
- else if (Oe(s))
- if (t === p._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code) {
- const _ = fR(cce(e.sourceFile, e.program.getTypeChecker(), s, e.program.getCompilerOptions())), u = Pxe(e.sourceFile, s, _, e.program);
- return u && [{ fix: u, symbolName: _, errorIdentifierText: s.text }];
- } else
- o = Dxe(e, s, i);
- else return;
- const c = P6(e.sourceFile, e.preferences, e.host);
- return o && xxe(o, e.sourceFile, e.program, c, e.host, e.preferences);
- }
- function xxe(e, t, n, i, s, o) {
- const c = (_) => uo(_, s.getCurrentDirectory(), S0(s));
- return V_(e, (_, u) => J1(!!_.isJsxNamespaceFix, !!u.isJsxNamespaceFix) || ho(_.fix.kind, u.fix.kind) || Cxe(_.fix, u.fix, t, n, o, i.allowsImportingSpecifier, c));
- }
- function QVe(e, t, n) {
- const i = Dxe(e, t, n), s = P6(e.sourceFile, e.preferences, e.host);
- return i && xxe(i, e.sourceFile, e.program, s, e.host, e.preferences);
- }
- function kxe(e, t, n, i, s, o) {
- if (ut(e))
- return e[0].kind === 0 || e[0].kind === 2 ? e[0] : e.reduce(
- (c, _) => (
- // Takes true branch of conditional if `fix` is better than `best`
- Cxe(
- _,
- c,
- t,
- n,
- o,
- i.allowsImportingSpecifier,
- (u) => uo(u, s.getCurrentDirectory(), S0(s))
- ) === -1 ? _ : c
- )
- );
- }
- function Cxe(e, t, n, i, s, o, c) {
- return e.kind !== 0 && t.kind !== 0 ? J1(
- t.moduleSpecifierKind !== "node_modules" || o(t.moduleSpecifier),
- e.moduleSpecifierKind !== "node_modules" || o(e.moduleSpecifier)
- ) || YVe(e, t, s) || KVe(e.moduleSpecifier, t.moduleSpecifier, n, i) || J1(
- Exe(e, n.path, c),
- Exe(t, n.path, c)
- ) || z3(e.moduleSpecifier, t.moduleSpecifier) : 0;
- }
- function YVe(e, t, n) {
- return n.importModuleSpecifierPreference === "non-relative" || n.importModuleSpecifierPreference === "project-relative" ? J1(e.moduleSpecifierKind === "relative", t.moduleSpecifierKind === "relative") : 0;
- }
- function Exe(e, t, n) {
- var i;
- if (e.isReExport && ((i = e.exportInfo) != null && i.moduleFileName) && ZVe(e.exportInfo.moduleFileName)) {
- const s = n(Xn(e.exportInfo.moduleFileName));
- return Ui(t, s);
- }
- return !1;
- }
- function ZVe(e) {
- return Hc(
- e,
- [".js", ".jsx", ".d.ts", ".ts", ".tsx"],
- /*ignoreCase*/
- !0
- ) === "index";
- }
- function KVe(e, t, n, i) {
- return Ui(e, "node:") && !Ui(t, "node:") ? v9(n, i) ? -1 : 1 : Ui(t, "node:") && !Ui(e, "node:") ? v9(n, i) ? 1 : -1 : 0;
- }
- function eqe({ sourceFile: e, program: t, host: n, preferences: i }, s) {
- const o = t.getTypeChecker(), c = tqe(s, o);
- if (!c) return;
- const _ = o.getAliasedSymbol(c), u = c.name, d = [{ symbol: c, moduleSymbol: _, moduleFileName: void 0, exportKind: 3, targetFlags: _.flags, isFromPackageJson: !1 }], g = H9(e, t);
- return q9(
- d,
- /*usagePosition*/
- void 0,
- /*isValidTypeOnlyUseSite*/
- !1,
- g,
- t,
- e,
- n,
- i
- ).fixes.map((S) => {
- var T;
- return { fix: S, symbolName: u, errorIdentifierText: (T = Wn(s, Oe)) == null ? void 0 : T.text };
- });
- }
- function tqe(e, t) {
- const n = Oe(e) ? t.getSymbolAtLocation(e) : void 0;
- if (n5(n)) return n;
- const { parent: i } = e;
- if (ou(i) && i.tagName === e || vS(i)) {
- const s = t.resolveName(
- t.getJsxNamespace(i),
- ou(i) ? e : i,
- 111551,
- /*excludeGlobals*/
- !1
- );
- if (n5(s))
- return s;
- }
- }
- function Bq(e, t, n, i) {
- if (n.getCompilerOptions().verbatimModuleSyntax && cqe(e, n) === 1)
- return 3;
- switch (t) {
- case 0:
- return 0;
- case 1:
- return 1;
- case 2:
- return sqe(e, n.getCompilerOptions(), !!i);
- case 3:
- return rqe(e, n, !!i);
- default:
- return E.assertNever(t);
- }
- }
- function rqe(e, t, n) {
- if (mx(t.getCompilerOptions()))
- return 1;
- const i = Ru(t.getCompilerOptions());
- switch (i) {
- case 2:
- case 1:
- case 3:
- return Ug(e.fileName) && (e.externalModuleIndicator || n) ? 2 : 3;
- case 4:
- case 5:
- case 6:
- case 7:
- case 99:
- case 0:
- case 200:
- return 2;
- case 100:
- case 199:
- return fce(e, t) === 99 ? 2 : 3;
- default:
- return E.assertNever(i, `Unexpected moduleKind ${i}`);
- }
- }
- function Dxe({ sourceFile: e, program: t, cancellationToken: n, host: i, preferences: s }, o, c) {
- const _ = t.getTypeChecker(), u = t.getCompilerOptions();
- return ta(cce(e, _, o, u), (d) => {
- if (d === "default")
- return;
- const g = av(o), h = H9(e, t), S = iqe(d, SC(o), wS(o), n, e, t, c, i, s);
- return as(
- iR(S.values(), (T) => q9(T, o.getStart(e), g, h, t, e, i, s).fixes),
- (T) => ({ fix: T, symbolName: d, errorIdentifierText: o.text, isJsxNamespaceFix: d !== o.text })
- );
- });
- }
- function Pxe(e, t, n, i) {
- const s = i.getTypeChecker(), o = s.resolveName(
- n,
- t,
- 111551,
- /*excludeGlobals*/
- !0
- );
- if (!o) return;
- const c = s.getTypeOnlyAliasDeclaration(o);
- if (!(!c || Tr(c) !== e))
- return { kind: 4, typeOnlyAliasDeclaration: c };
- }
- function cce(e, t, n, i) {
- const s = n.parent;
- if ((ou(s) || Jb(s)) && s.tagName === n && jV(i.jsx)) {
- const o = t.getJsxNamespace(e);
- if (nqe(o, n, t))
- return !AC(n.text) && !t.resolveName(
- n.text,
- n,
- 111551,
- /*excludeGlobals*/
- !1
- ) ? [n.text, o] : [o];
- }
- return [n.text];
- }
- function nqe(e, t, n) {
- if (AC(t.text)) return !0;
- const i = n.resolveName(
- e,
- t,
- 111551,
- /*excludeGlobals*/
- !0
- );
- return !i || ut(i.declarations, Py) && !(i.flags & 111551);
- }
- function iqe(e, t, n, i, s, o, c, _, u) {
- var d;
- const g = Ip(), h = P6(s, u, _), S = (d = _.getModuleSpecifierCache) == null ? void 0 : d.call(_), T = im((D) => Zx(D ? _.getPackageJsonAutoImportProvider() : o, _));
- function C(D, P, I, F, O, B) {
- const z = T(B);
- if (P && zV(O, s, P, u, h, z, S) || !P && h.allowsImportingAmbientModule(D, z) || b8(s, ap(D.name))) {
- const X = O.getTypeChecker();
- g.add(Fse(I, X).toString(), { symbol: I, moduleSymbol: D, moduleFileName: P?.fileName, exportKind: F, targetFlags: Hl(I, X).flags, isFromPackageJson: B });
- }
- }
- return WV(o, _, u, c, (D, P, I, F) => {
- const O = I.getTypeChecker();
- i.throwIfCancellationRequested();
- const B = I.getCompilerOptions(), z = x9(D, O);
- z && Mxe(O.getSymbolFlags(z.symbol), n) && k9(z.symbol, O, pa(B), (q, V) => (t ? V ?? q : q) === e) && C(D, P, z.symbol, z.exportKind, I, F);
- const X = O.tryGetMemberInModuleExportsAndProperties(e, D);
- X && Mxe(O.getSymbolFlags(X), n) && C(D, P, X, 0, I, F);
- }), g;
- }
- function sqe(e, t, n) {
- const i = mx(t), s = Ug(e.fileName);
- if (!s && Ru(t) >= 5)
- return i ? 1 : 2;
- if (s)
- return e.externalModuleIndicator || n ? i ? 1 : 2 : 3;
- for (const o of e.statements ?? Ue)
- if (gl(o) && !rc(o.moduleReference))
- return 3;
- return i ? 1 : 3;
- }
- function lce(e, t, n, i, s, o, c) {
- let _;
- const u = sn.ChangeTracker.with(e, (d) => {
- _ = aqe(d, t, n, i, s, o, c);
- });
- return Ls(pxe, u, _, dxe, p.Add_all_missing_imports);
- }
- function aqe(e, t, n, i, s, o, c) {
- const _ = bf(t, c);
- switch (i.kind) {
- case 0:
- return uce(e, t, i), [p.Change_0_to_1, n, `${i.namespacePrefix}.${n}`];
- case 1:
- return Nxe(e, t, i, _), [p.Change_0_to_1, n, Ixe(i.moduleSpecifier, _) + n];
- case 2: {
- const { importClauseOrBindingPattern: u, importKind: d, addAsTypeOnly: g, moduleSpecifier: h } = i;
- Axe(
- e,
- t,
- u,
- d === 1 ? { name: n, addAsTypeOnly: g } : void 0,
- d === 0 ? [{ name: n, addAsTypeOnly: g }] : Ue,
- /*removeExistingImportSpecifiers*/
- void 0,
- c
- );
- const S = ap(h);
- return s ? [p.Import_0_from_1, n, S] : [p.Update_import_from_0, S];
- }
- case 3: {
- const { importKind: u, moduleSpecifier: d, addAsTypeOnly: g, useRequire: h, qualification: S } = i, T = h ? Fxe : Oxe, C = u === 1 ? { name: n, addAsTypeOnly: g } : void 0, D = u === 0 ? [{ name: n, addAsTypeOnly: g }] : void 0, P = u === 2 || u === 3 ? { importKind: u, name: S?.namespacePrefix || n, addAsTypeOnly: g } : void 0;
- return dV(
- e,
- t,
- T(
- d,
- _,
- C,
- D,
- P,
- o.getCompilerOptions(),
- c
- ),
- /*blankLineBetween*/
- !0,
- c
- ), S && uce(e, t, S), s ? [p.Import_0_from_1, n, d] : [p.Add_import_from_0, d];
- }
- case 4: {
- const { typeOnlyAliasDeclaration: u } = i, d = oqe(e, u, o, t, c);
- return d.kind === 276 ? [p.Remove_type_from_import_of_0_from_1, n, wxe(d.parent.parent)] : [p.Remove_type_from_import_declaration_from_0, wxe(d)];
- }
- default:
- return E.assertNever(i, `Unexpected fix kind ${i.kind}`);
- }
- }
- function wxe(e) {
- var t, n;
- return e.kind === 271 ? ((n = Wn((t = Wn(e.moduleReference, Fh)) == null ? void 0 : t.expression, Xa)) == null ? void 0 : n.text) || e.moduleReference.getText() : Bs(e.parent.moduleSpecifier, oa).text;
- }
- function oqe(e, t, n, i, s) {
- const o = n.getCompilerOptions(), c = o.verbatimModuleSyntax;
- switch (t.kind) {
- case 276:
- if (t.isTypeOnly) {
- if (t.parent.elements.length > 1) {
- const u = A.updateImportSpecifier(
- t,
- /*isTypeOnly*/
- !1,
- t.propertyName,
- t.name
- ), { specifierComparer: d } = Av.getNamedImportSpecifierComparerWithDetection(t.parent.parent.parent, s, i), g = Av.getImportSpecifierInsertionIndex(t.parent.elements, u, d);
- if (g !== t.parent.elements.indexOf(t))
- return e.delete(i, t), e.insertImportSpecifierAtIndex(i, u, t.parent, g), t;
- }
- return e.deleteRange(i, { pos: Oy(t.getFirstToken()), end: Oy(t.propertyName ?? t.name) }), t;
- } else
- return E.assert(t.parent.parent.isTypeOnly), _(t.parent.parent), t.parent.parent;
- case 273:
- return _(t), t;
- case 274:
- return _(t.parent), t.parent;
- case 271:
- return e.deleteRange(i, t.getChildAt(1)), t;
- default:
- E.failBadSyntaxKind(t);
- }
- function _(u) {
- var d;
- if (e.delete(i, mV(u, i)), !o.allowImportingTsExtensions) {
- const g = xC(u.parent), h = g && ((d = n.getResolvedModuleFromModuleSpecifier(g, i)) == null ? void 0 : d.resolvedModule);
- if (h?.resolvedUsingTsExtension) {
- const S = fw(g.text, tF(g.text, o));
- e.replaceNode(i, g, A.createStringLiteral(S));
- }
- }
- if (c) {
- const g = Wn(u.namedBindings, Tm);
- if (g && g.elements.length > 1) {
- Av.getNamedImportSpecifierComparerWithDetection(u.parent, s, i).isSorted !== !1 && t.kind === 276 && g.elements.indexOf(t) !== 0 && (e.delete(i, t), e.insertImportSpecifierAtIndex(i, t, g, 0));
- for (const S of g.elements)
- S !== t && !S.isTypeOnly && e.insertModifierBefore(i, 156, S);
- }
- }
- }
- }
- function Axe(e, t, n, i, s, o, c) {
- var _;
- if (n.kind === 206) {
- if (o && n.elements.some((h) => o.has(h))) {
- e.replaceNode(
- t,
- n,
- A.createObjectBindingPattern([
- ...n.elements.filter((h) => !o.has(h)),
- ...i ? [A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- "default",
- i.name
- )] : Ue,
- ...s.map((h) => A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- void 0,
- h.name
- ))
- ])
- );
- return;
- }
- i && g(n, i.name, "default");
- for (const h of s)
- g(
- n,
- h.name,
- /*propertyName*/
- void 0
- );
- return;
- }
- const u = n.isTypeOnly && ut(
- [i, ...s],
- (h) => h?.addAsTypeOnly === 4
- /* NotAllowed */
- ), d = n.namedBindings && ((_ = Wn(n.namedBindings, Tm)) == null ? void 0 : _.elements);
- if (i && (E.assert(!n.name, "Cannot add a default import to an import clause that already has one"), e.insertNodeAt(t, n.getStart(t), A.createIdentifier(i.name), { suffix: ", " })), s.length) {
- const { specifierComparer: h, isSorted: S } = Av.getNamedImportSpecifierComparerWithDetection(n.parent, c, t), T = V_(
- s.map(
- (C) => A.createImportSpecifier(
- (!n.isTypeOnly || u) && Jq(C, c),
- /*propertyName*/
- void 0,
- A.createIdentifier(C.name)
- )
- ),
- h
- );
- if (o)
- e.replaceNode(
- t,
- n.namedBindings,
- A.updateNamedImports(
- n.namedBindings,
- V_([...d.filter((C) => !o.has(C)), ...T], h)
- )
- );
- else if (d?.length && S !== !1) {
- const C = u && d ? A.updateNamedImports(
- n.namedBindings,
- qc(d, (D) => A.updateImportSpecifier(
- D,
- /*isTypeOnly*/
- !0,
- D.propertyName,
- D.name
- ))
- ).elements : d;
- for (const D of T) {
- const P = Av.getImportSpecifierInsertionIndex(C, D, h);
- e.insertImportSpecifierAtIndex(t, D, n.namedBindings, P);
- }
- } else if (d?.length)
- for (const C of T)
- e.insertNodeInListAfter(t, _a(d), C, d);
- else if (T.length) {
- const C = A.createNamedImports(T);
- n.namedBindings ? e.replaceNode(t, n.namedBindings, C) : e.insertNodeAfter(t, E.checkDefined(n.name, "Import clause must have either named imports or a default import"), C);
- }
- }
- if (u && (e.delete(t, mV(n, t)), d))
- for (const h of d)
- e.insertModifierBefore(t, 156, h);
- function g(h, S, T) {
- const C = A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- T,
- S
- );
- h.elements.length ? e.insertNodeInListAfter(t, _a(h.elements), C) : e.replaceNode(t, h, A.createObjectBindingPattern([C]));
- }
- }
- function uce(e, t, { namespacePrefix: n, usagePosition: i }) {
- e.insertText(t, i, n + ".");
- }
- function Nxe(e, t, { moduleSpecifier: n, usagePosition: i }, s) {
- e.insertText(t, i, Ixe(n, s));
- }
- function Ixe(e, t) {
- const n = fV(t);
- return `import(${n}${e}${n}).`;
- }
- function _ce({ addAsTypeOnly: e }) {
- return e === 2;
- }
- function Jq(e, t) {
- return _ce(e) || !!t.preferTypeOnlyAutoImports && e.addAsTypeOnly !== 4;
- }
- function Oxe(e, t, n, i, s, o, c) {
- const _ = $D(e, t);
- let u;
- if (n !== void 0 || i?.length) {
- const d = (!n || _ce(n)) && Mi(i, _ce) || (o.verbatimModuleSyntax || c.preferTypeOnlyAutoImports) && n?.addAsTypeOnly !== 4 && !ut(
- i,
- (g) => g.addAsTypeOnly === 4
- /* NotAllowed */
- );
- u = NT(
- u,
- t1(
- n && A.createIdentifier(n.name),
- i?.map(
- (g) => A.createImportSpecifier(
- !d && Jq(g, c),
- /*propertyName*/
- void 0,
- A.createIdentifier(g.name)
- )
- ),
- e,
- t,
- d
- )
- );
- }
- if (s) {
- const d = s.importKind === 3 ? A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- Jq(s, c),
- A.createIdentifier(s.name),
- A.createExternalModuleReference(_)
- ) : A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- Jq(s, c),
- /*name*/
- void 0,
- A.createNamespaceImport(A.createIdentifier(s.name))
- ),
- _,
- /*attributes*/
- void 0
- );
- u = NT(u, d);
- }
- return E.checkDefined(u);
- }
- function Fxe(e, t, n, i, s) {
- const o = $D(e, t);
- let c;
- if (n || i?.length) {
- const _ = i?.map(({ name: d }) => A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- /*propertyName*/
- void 0,
- d
- )) || [];
- n && _.unshift(A.createBindingElement(
- /*dotDotDotToken*/
- void 0,
- "default",
- n.name
- ));
- const u = Lxe(A.createObjectBindingPattern(_), o);
- c = NT(c, u);
- }
- if (s) {
- const _ = Lxe(s.name, o);
- c = NT(c, _);
- }
- return E.checkDefined(c);
- }
- function Lxe(e, t) {
- return A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- typeof e == "string" ? A.createIdentifier(e) : e,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- A.createCallExpression(
- A.createIdentifier("require"),
- /*typeArguments*/
- void 0,
- [t]
- )
- )
- ],
- 2
- /* Const */
- )
- );
- }
- function Mxe(e, t) {
- return t === 7 ? !0 : t & 1 ? !!(e & 111551) : t & 2 ? !!(e & 788968) : t & 4 ? !!(e & 1920) : !1;
- }
- function fce(e, t) {
- return sg(e) ? t.getImpliedNodeFormatForEmit(e) : PS(e, t.getCompilerOptions());
- }
- function cqe(e, t) {
- return sg(e) ? t.getEmitModuleFormatOfFile(e) : BD(e, t.getCompilerOptions());
- }
- var pce = "addMissingConstraint", Rxe = [
- // We want errors this could be attached to:
- // Diagnostics.This_type_parameter_probably_needs_an_extends_0_constraint
- p.Type_0_is_not_comparable_to_type_1.code,
- p.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,
- p.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,
- p.Type_0_is_not_assignable_to_type_1.code,
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,
- p.Property_0_is_incompatible_with_index_signature.code,
- p.Property_0_in_type_1_is_not_assignable_to_type_2.code,
- p.Type_0_does_not_satisfy_the_constraint_1.code
- ];
- Ys({
- errorCodes: Rxe,
- getCodeActions(e) {
- const { sourceFile: t, span: n, program: i, preferences: s, host: o } = e, c = jxe(i, t, n);
- if (c === void 0) return;
- const _ = sn.ChangeTracker.with(e, (u) => Bxe(u, i, s, o, t, c));
- return [Ls(pce, _, p.Add_extends_constraint, pce, p.Add_extends_constraint_to_all_type_parameters)];
- },
- fixIds: [pce],
- getAllCodeActions: (e) => {
- const { program: t, preferences: n, host: i } = e, s = /* @__PURE__ */ new Map();
- return ik(sn.ChangeTracker.with(e, (o) => {
- sk(e, Rxe, (c) => {
- const _ = jxe(t, c.file, Ul(c.start, c.length));
- if (_ && zp(s, Ma(_.declaration)))
- return Bxe(o, t, n, i, c.file, _);
- });
- }));
- }
- });
- function jxe(e, t, n) {
- const i = On(e.getSemanticDiagnostics(t), (c) => c.start === n.start && c.length === n.length);
- if (i === void 0 || i.relatedInformation === void 0) return;
- const s = On(i.relatedInformation, (c) => c.code === p.This_type_parameter_might_need_an_extends_0_constraint.code);
- if (s === void 0 || s.file === void 0 || s.start === void 0 || s.length === void 0) return;
- let o = ale(s.file, Ul(s.start, s.length));
- if (o !== void 0 && (Oe(o) && zo(o.parent) && (o = o.parent), zo(o))) {
- if (mS(o.parent)) return;
- const c = xi(t, n.start), _ = e.getTypeChecker();
- return { constraint: uqe(_, c) || lqe(s.messageText), declaration: o, token: c };
- }
- }
- function Bxe(e, t, n, i, s, o) {
- const { declaration: c, constraint: _ } = o, u = t.getTypeChecker();
- if (_s(_))
- e.insertText(s, c.name.end, ` extends ${_}`);
- else {
- const d = pa(t.getCompilerOptions()), g = F6({ program: t, host: i }), h = s2(s, t, n, i), S = X9(
- u,
- h,
- _,
- /*contextNode*/
- void 0,
- d,
- /*flags*/
- void 0,
- /*internalFlags*/
- void 0,
- g
- );
- S && (e.replaceNode(s, c, A.updateTypeParameterDeclaration(
- c,
- /*modifiers*/
- void 0,
- c.name,
- S,
- c.default
- )), h.writeFixes(e));
- }
- }
- function lqe(e) {
- const [, t] = Em(e, `
-`, 0).match(/`extends (.*)`/) || [];
- return t;
- }
- function uqe(e, t) {
- return fi(t.parent) ? e.getTypeArgumentConstraint(t.parent) : (_t(t) ? e.getContextualType(t) : void 0) || e.getTypeAtLocation(t);
- }
- var Jxe = "fixOverrideModifier", F8 = "fixAddOverrideModifier", G9 = "fixRemoveOverrideModifier", zxe = [
- p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,
- p.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,
- p.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,
- p.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,
- p.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,
- p.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,
- p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,
- p.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,
- p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code
- ], Wxe = {
- // case #1:
- [p.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]: {
- descriptions: p.Add_override_modifier,
- fixId: F8,
- fixAllDescriptions: p.Add_all_missing_override_modifiers
- },
- [p.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: {
- descriptions: p.Add_override_modifier,
- fixId: F8,
- fixAllDescriptions: p.Add_all_missing_override_modifiers
- },
- // case #2:
- [p.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]: {
- descriptions: p.Remove_override_modifier,
- fixId: G9,
- fixAllDescriptions: p.Remove_all_unnecessary_override_modifiers
- },
- [p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]: {
- descriptions: p.Remove_override_modifier,
- fixId: G9,
- fixAllDescriptions: p.Remove_override_modifier
- },
- // case #3:
- [p.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]: {
- descriptions: p.Add_override_modifier,
- fixId: F8,
- fixAllDescriptions: p.Add_all_missing_override_modifiers
- },
- [p.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: {
- descriptions: p.Add_override_modifier,
- fixId: F8,
- fixAllDescriptions: p.Add_all_missing_override_modifiers
- },
- // case #4:
- [p.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]: {
- descriptions: p.Add_override_modifier,
- fixId: F8,
- fixAllDescriptions: p.Remove_all_unnecessary_override_modifiers
- },
- // case #5:
- [p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]: {
- descriptions: p.Remove_override_modifier,
- fixId: G9,
- fixAllDescriptions: p.Remove_all_unnecessary_override_modifiers
- },
- [p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]: {
- descriptions: p.Remove_override_modifier,
- fixId: G9,
- fixAllDescriptions: p.Remove_all_unnecessary_override_modifiers
- }
- };
- Ys({
- errorCodes: zxe,
- getCodeActions: function(t) {
- const { errorCode: n, span: i } = t, s = Wxe[n];
- if (!s) return Ue;
- const { descriptions: o, fixId: c, fixAllDescriptions: _ } = s, u = sn.ChangeTracker.with(t, (d) => Uxe(d, t, n, i.start));
- return [
- Foe(Jxe, u, o, c, _)
- ];
- },
- fixIds: [Jxe, F8, G9],
- getAllCodeActions: (e) => Za(e, zxe, (t, n) => {
- const { code: i, start: s } = n, o = Wxe[i];
- !o || o.fixId !== e.fixId || Uxe(t, e, i, s);
- })
- });
- function Uxe(e, t, n, i) {
- switch (n) {
- case p.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:
- case p.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:
- case p.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:
- case p.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:
- case p.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:
- return _qe(e, t.sourceFile, i);
- case p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:
- case p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:
- case p.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:
- case p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:
- return fqe(e, t.sourceFile, i);
- default:
- E.fail("Unexpected error code: " + n);
- }
- }
- function _qe(e, t, n) {
- const i = qxe(t, n);
- if (Gu(t)) {
- e.addJSDocTags(t, i, [A.createJSDocOverrideTag(A.createIdentifier("override"))]);
- return;
- }
- const s = i.modifiers || Ue, o = On(s, Ex), c = On(s, Wee), _ = On(s, (h) => rV(h.kind)), u = ob(s, dl), d = c ? c.end : o ? o.end : _ ? _.end : u ? aa(t.text, u.end) : i.getStart(t), g = _ || o || c ? { prefix: " " } : { suffix: " " };
- e.insertModifierAt(t, d, 164, g);
- }
- function fqe(e, t, n) {
- const i = qxe(t, n);
- if (Gu(t)) {
- e.filterJSDocTags(t, i, hI(rO));
- return;
- }
- const s = On(i.modifiers, Uee);
- E.assertIsDefined(s), e.deleteModifier(t, s);
- }
- function Vxe(e) {
- switch (e.kind) {
- case 176:
- case 172:
- case 174:
- case 177:
- case 178:
- return !0;
- case 169:
- return G_(e, e.parent);
- default:
- return !1;
- }
- }
- function qxe(e, t) {
- const n = xi(e, t), i = or(n, (s) => Zn(s) ? "quit" : Vxe(s));
- return E.assert(i && Vxe(i)), i;
- }
- var dce = "fixNoPropertyAccessFromIndexSignature", Hxe = [
- p.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code
- ];
- Ys({
- errorCodes: Hxe,
- fixIds: [dce],
- getCodeActions(e) {
- const { sourceFile: t, span: n, preferences: i } = e, s = $xe(t, n.start), o = sn.ChangeTracker.with(e, (c) => Gxe(c, e.sourceFile, s, i));
- return [Ls(dce, o, [p.Use_element_access_for_0, s.name.text], dce, p.Use_element_access_for_all_undeclared_properties)];
- },
- getAllCodeActions: (e) => Za(e, Hxe, (t, n) => Gxe(t, n.file, $xe(n.file, n.start), e.preferences))
- });
- function Gxe(e, t, n, i) {
- const s = bf(t, i), o = A.createStringLiteral(
- n.name.text,
- s === 0
- /* Single */
- );
- e.replaceNode(
- t,
- n,
- BI(n) ? A.createElementAccessChain(n.expression, n.questionDotToken, o) : A.createElementAccessExpression(n.expression, o)
- );
- }
- function $xe(e, t) {
- return Bs(xi(e, t).parent, Cn);
- }
- var mce = "fixImplicitThis", Xxe = [p.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];
- Ys({
- errorCodes: Xxe,
- getCodeActions: function(t) {
- const { sourceFile: n, program: i, span: s } = t;
- let o;
- const c = sn.ChangeTracker.with(t, (_) => {
- o = Qxe(_, n, s.start, i.getTypeChecker());
- });
- return o ? [Ls(mce, c, o, mce, p.Fix_all_implicit_this_errors)] : Ue;
- },
- fixIds: [mce],
- getAllCodeActions: (e) => Za(e, Xxe, (t, n) => {
- Qxe(t, n.file, n.start, e.program.getTypeChecker());
- })
- });
- function Qxe(e, t, n, i) {
- const s = xi(t, n);
- if (!S6(s)) return;
- const o = Lu(
- s,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (!(!Ec(o) && !vo(o)) && !Si(Lu(
- o,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- ))) {
- const c = E.checkDefined(Ya(o, 100, t)), { name: _ } = o, u = E.checkDefined(o.body);
- return vo(o) ? _ && Eo.Core.isSymbolReferencedInFile(_, i, t, u) ? void 0 : (e.delete(t, c), _ && e.delete(t, _), e.insertText(t, u.pos, " =>"), [p.Convert_function_expression_0_to_arrow_function, _ ? _.text : wV]) : (e.replaceNode(t, c, A.createToken(
- 87
- /* ConstKeyword */
- )), e.insertText(t, _.end, " = "), e.insertText(t, u.pos, " =>"), [p.Convert_function_declaration_0_to_arrow_function, _.text]);
- }
- }
- var gce = "fixImportNonExportedMember", Yxe = [
- p.Module_0_declares_1_locally_but_it_is_not_exported.code
- ];
- Ys({
- errorCodes: Yxe,
- fixIds: [gce],
- getCodeActions(e) {
- const { sourceFile: t, span: n, program: i } = e, s = Zxe(t, n.start, i);
- if (s === void 0) return;
- const o = sn.ChangeTracker.with(e, (c) => pqe(c, i, s));
- return [Ls(gce, o, [p.Export_0_from_module_1, s.exportName.node.text, s.moduleSpecifier], gce, p.Export_all_referenced_locals)];
- },
- getAllCodeActions(e) {
- const { program: t } = e;
- return ik(sn.ChangeTracker.with(e, (n) => {
- const i = /* @__PURE__ */ new Map();
- sk(e, Yxe, (s) => {
- const o = Zxe(s.file, s.start, t);
- if (o === void 0) return;
- const { exportName: c, node: _, moduleSourceFile: u } = o;
- if (zq(u, c.isTypeOnly) === void 0 && U3(_))
- n.insertExportModifier(u, _);
- else {
- const d = i.get(u) || { typeOnlyExports: [], exports: [] };
- c.isTypeOnly ? d.typeOnlyExports.push(c) : d.exports.push(c), i.set(u, d);
- }
- }), i.forEach((s, o) => {
- const c = zq(
- o,
- /*isTypeOnly*/
- !0
- );
- c && c.isTypeOnly ? (hce(n, t, o, s.typeOnlyExports, c), hce(n, t, o, s.exports, zq(
- o,
- /*isTypeOnly*/
- !1
- ))) : hce(n, t, o, [...s.exports, ...s.typeOnlyExports], c);
- });
- }));
- }
- });
- function Zxe(e, t, n) {
- var i, s;
- const o = xi(e, t);
- if (Oe(o)) {
- const c = or(o, ic);
- if (c === void 0) return;
- const _ = oa(c.moduleSpecifier) ? c.moduleSpecifier : void 0;
- if (_ === void 0) return;
- const u = (i = n.getResolvedModuleFromModuleSpecifier(_, e)) == null ? void 0 : i.resolvedModule;
- if (u === void 0) return;
- const d = n.getSourceFile(u.resolvedFileName);
- if (d === void 0 || w6(n, d)) return;
- const g = d.symbol, h = (s = Wn(g.valueDeclaration, tg)) == null ? void 0 : s.locals;
- if (h === void 0) return;
- const S = h.get(o.escapedText);
- if (S === void 0) return;
- const T = dqe(S);
- return T === void 0 ? void 0 : { exportName: { node: o, isTypeOnly: hx(T) }, node: T, moduleSourceFile: d, moduleSpecifier: _.text };
- }
- }
- function pqe(e, t, { exportName: n, node: i, moduleSourceFile: s }) {
- const o = zq(s, n.isTypeOnly);
- o ? Kxe(e, t, s, o, [n]) : U3(i) ? e.insertExportModifier(s, i) : eke(e, t, s, [n]);
- }
- function hce(e, t, n, i, s) {
- Nr(i) && (s ? Kxe(e, t, n, s, i) : eke(e, t, n, i));
- }
- function zq(e, t) {
- const n = (i) => Nc(i) && (t && i.isTypeOnly || !i.isTypeOnly);
- return ob(e.statements, n);
- }
- function Kxe(e, t, n, i, s) {
- const o = i.exportClause && pp(i.exportClause) ? i.exportClause.elements : A.createNodeArray([]), c = !i.isTypeOnly && !!(Wp(t.getCompilerOptions()) || On(o, (_) => _.isTypeOnly));
- e.replaceNode(
- n,
- i,
- A.updateExportDeclaration(
- i,
- i.modifiers,
- i.isTypeOnly,
- A.createNamedExports(
- A.createNodeArray(
- [...o, ...tke(s, c)],
- /*hasTrailingComma*/
- o.hasTrailingComma
- )
- ),
- i.moduleSpecifier,
- i.attributes
- )
- );
- }
- function eke(e, t, n, i) {
- e.insertNodeAtEndOfScope(n, n, A.createExportDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- A.createNamedExports(tke(
- i,
- /*allowTypeModifier*/
- Wp(t.getCompilerOptions())
- )),
- /*moduleSpecifier*/
- void 0,
- /*attributes*/
- void 0
- ));
- }
- function tke(e, t) {
- return A.createNodeArray(lr(e, (n) => A.createExportSpecifier(
- t && n.isTypeOnly,
- /*propertyName*/
- void 0,
- n.node
- )));
- }
- function dqe(e) {
- if (e.valueDeclaration === void 0)
- return el(e.declarations);
- const t = e.valueDeclaration, n = ii(t) ? Wn(t.parent.parent, yc) : void 0;
- return n && Nr(n.declarationList.declarations) === 1 ? n : t;
- }
- var yce = "fixIncorrectNamedTupleSyntax", mqe = [
- p.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,
- p.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code
- ];
- Ys({
- errorCodes: mqe,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = gqe(n, i.start), o = sn.ChangeTracker.with(t, (c) => hqe(c, n, s));
- return [Ls(yce, o, p.Move_labeled_tuple_element_modifiers_to_labels, yce, p.Move_labeled_tuple_element_modifiers_to_labels)];
- },
- fixIds: [yce]
- });
- function gqe(e, t) {
- const n = xi(e, t);
- return or(
- n,
- (i) => i.kind === 202
- /* NamedTupleMember */
- );
- }
- function hqe(e, t, n) {
- if (!n)
- return;
- let i = n.type, s = !1, o = !1;
- for (; i.kind === 190 || i.kind === 191 || i.kind === 196; )
- i.kind === 190 ? s = !0 : i.kind === 191 && (o = !0), i = i.type;
- const c = A.updateNamedTupleMember(
- n,
- n.dotDotDotToken || (o ? A.createToken(
- 26
- /* DotDotDotToken */
- ) : void 0),
- n.name,
- n.questionToken || (s ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0),
- i
- );
- c !== n && e.replaceNode(t, n, c);
- }
- var rke = "fixSpelling", nke = [
- p.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
- p.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,
- p.Cannot_find_name_0_Did_you_mean_1.code,
- p.Could_not_find_name_0_Did_you_mean_1.code,
- p.Cannot_find_namespace_0_Did_you_mean_1.code,
- p.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
- p.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
- p._0_has_no_exported_member_named_1_Did_you_mean_2.code,
- p.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
- p.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
- // for JSX class components
- p.No_overload_matches_this_call.code,
- // for JSX FC
- p.Type_0_is_not_assignable_to_type_1.code
- ];
- Ys({
- errorCodes: nke,
- getCodeActions(e) {
- const { sourceFile: t, errorCode: n } = e, i = ike(t, e.span.start, e, n);
- if (!i) return;
- const { node: s, suggestedSymbol: o } = i, c = pa(e.host.getCompilationSettings()), _ = sn.ChangeTracker.with(e, (u) => ske(u, t, s, o, c));
- return [Ls("spelling", _, [p.Change_spelling_to_0, mc(o)], rke, p.Fix_all_detected_spelling_errors)];
- },
- fixIds: [rke],
- getAllCodeActions: (e) => Za(e, nke, (t, n) => {
- const i = ike(n.file, n.start, e, n.code), s = pa(e.host.getCompilationSettings());
- i && ske(t, e.sourceFile, i.node, i.suggestedSymbol, s);
- })
- });
- function ike(e, t, n, i) {
- const s = xi(e, t), o = s.parent;
- if ((i === p.No_overload_matches_this_call.code || i === p.Type_0_is_not_assignable_to_type_1.code) && !km(o)) return;
- const c = n.program.getTypeChecker();
- let _;
- if (Cn(o) && o.name === s) {
- E.assert(Fg(s), "Expected an identifier for spelling (property access)");
- let u = c.getTypeAtLocation(o.expression);
- o.flags & 64 && (u = c.getNonNullableType(u)), _ = c.getSuggestedSymbolForNonexistentProperty(s, u);
- } else if (dn(o) && o.operatorToken.kind === 103 && o.left === s && Di(s)) {
- const u = c.getTypeAtLocation(o.right);
- _ = c.getSuggestedSymbolForNonexistentProperty(s, u);
- } else if (Xu(o) && o.right === s) {
- const u = c.getSymbolAtLocation(o.left);
- u && u.flags & 1536 && (_ = c.getSuggestedSymbolForNonexistentModule(o.right, u));
- } else if (Zu(o) && o.name === s) {
- E.assertNode(s, Oe, "Expected an identifier for spelling (import)");
- const u = or(s, ic), d = vqe(n, u, e);
- d && d.symbol && (_ = c.getSuggestedSymbolForNonexistentModule(s, d.symbol));
- } else if (km(o) && o.name === s) {
- E.assertNode(s, Oe, "Expected an identifier for JSX attribute");
- const u = or(s, ou), d = c.getContextualTypeForArgumentAtIndex(u, 0);
- _ = c.getSuggestedSymbolForNonexistentJSXAttribute(s, d);
- } else if ($7(o) && _l(o) && o.name === s) {
- const u = or(s, Zn), d = u ? _m(u) : void 0, g = d ? c.getTypeAtLocation(d) : void 0;
- g && (_ = c.getSuggestedSymbolForNonexistentClassMember(nc(s), g));
- } else {
- const u = wS(s), d = nc(s);
- E.assert(d !== void 0, "name should be defined"), _ = c.getSuggestedSymbolForNonexistentSymbol(s, d, yqe(u));
- }
- return _ === void 0 ? void 0 : { node: s, suggestedSymbol: _ };
- }
- function ske(e, t, n, i, s) {
- const o = mc(i);
- if (!k_(o, s) && Cn(n.parent)) {
- const c = i.valueDeclaration;
- c && Vl(c) && Di(c.name) ? e.replaceNode(t, n, A.createIdentifier(o)) : e.replaceNode(t, n.parent, A.createElementAccessExpression(n.parent.expression, A.createStringLiteral(o)));
- } else
- e.replaceNode(t, n, A.createIdentifier(o));
- }
- function yqe(e) {
- let t = 0;
- return e & 4 && (t |= 1920), e & 2 && (t |= 788968), e & 1 && (t |= 111551), t;
- }
- function vqe(e, t, n) {
- var i;
- if (!t || !Xa(t.moduleSpecifier)) return;
- const s = (i = e.program.getResolvedModuleFromModuleSpecifier(t.moduleSpecifier, n)) == null ? void 0 : i.resolvedModule;
- if (s)
- return e.program.getSourceFile(s.resolvedFileName);
- }
- var vce = "returnValueCorrect", bce = "fixAddReturnStatement", Sce = "fixRemoveBracesFromArrowFunctionBody", Tce = "fixWrapTheBlockWithParen", ake = [
- p.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code,
- p.Type_0_is_not_assignable_to_type_1.code,
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code
- ];
- Ys({
- errorCodes: ake,
- fixIds: [bce, Sce, Tce],
- getCodeActions: function(t) {
- const { program: n, sourceFile: i, span: { start: s }, errorCode: o } = t, c = cke(n.getTypeChecker(), i, s, o);
- if (c)
- return c.kind === 0 ? wr(
- [Sqe(t, c.expression, c.statement)],
- Co(c.declaration) ? Tqe(t, c.declaration, c.expression, c.commentSource) : void 0
- ) : [xqe(t, c.declaration, c.expression)];
- },
- getAllCodeActions: (e) => Za(e, ake, (t, n) => {
- const i = cke(e.program.getTypeChecker(), n.file, n.start, n.code);
- if (i)
- switch (e.fixId) {
- case bce:
- lke(t, n.file, i.expression, i.statement);
- break;
- case Sce:
- if (!Co(i.declaration)) return;
- uke(
- t,
- n.file,
- i.declaration,
- i.expression,
- i.commentSource
- );
- break;
- case Tce:
- if (!Co(i.declaration)) return;
- _ke(t, n.file, i.declaration, i.expression);
- break;
- default:
- E.fail(JSON.stringify(e.fixId));
- }
- })
- });
- function oke(e, t, n) {
- const i = e.createSymbol(4, t.escapedText);
- i.links.type = e.getTypeAtLocation(n);
- const s = Js([i]);
- return e.createAnonymousType(
- /*symbol*/
- void 0,
- s,
- [],
- [],
- []
- );
- }
- function xce(e, t, n, i) {
- if (!t.body || !Cs(t.body) || Nr(t.body.statements) !== 1) return;
- const s = xa(t.body.statements);
- if (Pl(s) && kce(e, t, e.getTypeAtLocation(s.expression), n, i))
- return {
- declaration: t,
- kind: 0,
- expression: s.expression,
- statement: s,
- commentSource: s.expression
- };
- if (Gy(s) && Pl(s.statement)) {
- const o = A.createObjectLiteralExpression([A.createPropertyAssignment(s.label, s.statement.expression)]), c = oke(e, s.label, s.statement.expression);
- if (kce(e, t, c, n, i))
- return Co(t) ? {
- declaration: t,
- kind: 1,
- expression: o,
- statement: s,
- commentSource: s.statement.expression
- } : {
- declaration: t,
- kind: 0,
- expression: o,
- statement: s,
- commentSource: s.statement.expression
- };
- } else if (Cs(s) && Nr(s.statements) === 1) {
- const o = xa(s.statements);
- if (Gy(o) && Pl(o.statement)) {
- const c = A.createObjectLiteralExpression([A.createPropertyAssignment(o.label, o.statement.expression)]), _ = oke(e, o.label, o.statement.expression);
- if (kce(e, t, _, n, i))
- return {
- declaration: t,
- kind: 0,
- expression: c,
- statement: s,
- commentSource: o
- };
- }
- }
- }
- function kce(e, t, n, i, s) {
- if (s) {
- const o = e.getSignatureFromDeclaration(t);
- if (o) {
- Gn(
- t,
- 1024
- /* Async */
- ) && (n = e.createPromiseType(n));
- const c = e.createSignature(
- t,
- o.typeParameters,
- o.thisParameter,
- o.parameters,
- n,
- /*typePredicate*/
- void 0,
- o.minArgumentCount,
- o.flags
- );
- n = e.createAnonymousType(
- /*symbol*/
- void 0,
- Js(),
- [c],
- [],
- []
- );
- } else
- n = e.getAnyType();
- }
- return e.isTypeAssignableTo(n, i);
- }
- function cke(e, t, n, i) {
- const s = xi(t, n);
- if (!s.parent) return;
- const o = or(s.parent, no);
- switch (i) {
- case p.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code:
- return !o || !o.body || !o.type || !nf(o.type, s) ? void 0 : xce(
- e,
- o,
- e.getTypeFromTypeNode(o.type),
- /*isFunctionType*/
- !1
- );
- case p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:
- if (!o || !Fs(o.parent) || !o.body) return;
- const c = o.parent.arguments.indexOf(o);
- if (c === -1) return;
- const _ = e.getContextualTypeForArgumentAtIndex(o.parent, c);
- return _ ? xce(
- e,
- o,
- _,
- /*isFunctionType*/
- !0
- ) : void 0;
- case p.Type_0_is_not_assignable_to_type_1.code:
- if (!og(s) || !YT(s.parent) && !km(s.parent)) return;
- const u = bqe(s.parent);
- return !u || !no(u) || !u.body ? void 0 : xce(
- e,
- u,
- e.getTypeAtLocation(s.parent),
- /*isFunctionType*/
- !0
- );
- }
- }
- function bqe(e) {
- switch (e.kind) {
- case 260:
- case 169:
- case 208:
- case 172:
- case 303:
- return e.initializer;
- case 291:
- return e.initializer && (lD(e.initializer) ? e.initializer.expression : void 0);
- case 304:
- case 171:
- case 306:
- case 348:
- case 341:
- return;
- }
- }
- function lke(e, t, n, i) {
- af(n);
- const s = d8(t);
- e.replaceNode(t, i, A.createReturnStatement(n), {
- leadingTriviaOption: sn.LeadingTriviaOption.Exclude,
- trailingTriviaOption: sn.TrailingTriviaOption.Exclude,
- suffix: s ? ";" : void 0
- });
- }
- function uke(e, t, n, i, s, o) {
- const c = l9(i) ? A.createParenthesizedExpression(i) : i;
- af(s), NS(s, c), e.replaceNode(t, n.body, c);
- }
- function _ke(e, t, n, i) {
- e.replaceNode(t, n.body, A.createParenthesizedExpression(i));
- }
- function Sqe(e, t, n) {
- const i = sn.ChangeTracker.with(e, (s) => lke(s, e.sourceFile, t, n));
- return Ls(vce, i, p.Add_a_return_statement, bce, p.Add_all_missing_return_statement);
- }
- function Tqe(e, t, n, i) {
- const s = sn.ChangeTracker.with(e, (o) => uke(
- o,
- e.sourceFile,
- t,
- n,
- i
- ));
- return Ls(vce, s, p.Remove_braces_from_arrow_function_body, Sce, p.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues);
- }
- function xqe(e, t, n) {
- const i = sn.ChangeTracker.with(e, (s) => _ke(s, e.sourceFile, t, n));
- return Ls(vce, i, p.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal, Tce, p.Wrap_all_object_literal_with_parentheses);
- }
- var Pv = "fixMissingMember", Wq = "fixMissingProperties", Uq = "fixMissingAttributes", Vq = "fixMissingFunctionDeclaration", fke = [
- p.Property_0_does_not_exist_on_type_1.code,
- p.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
- p.Property_0_is_missing_in_type_1_but_required_in_type_2.code,
- p.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,
- p.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
- p.Cannot_find_name_0.code
- ];
- Ys({
- errorCodes: fke,
- getCodeActions(e) {
- const t = e.program.getTypeChecker(), n = pke(e.sourceFile, e.span.start, e.errorCode, t, e.program);
- if (n) {
- if (n.kind === 3) {
- const i = sn.ChangeTracker.with(e, (s) => xke(s, e, n));
- return [Ls(Wq, i, p.Add_missing_properties, Wq, p.Add_all_missing_properties)];
- }
- if (n.kind === 4) {
- const i = sn.ChangeTracker.with(e, (s) => Tke(s, e, n));
- return [Ls(Uq, i, p.Add_missing_attributes, Uq, p.Add_all_missing_attributes)];
- }
- if (n.kind === 2 || n.kind === 5) {
- const i = sn.ChangeTracker.with(e, (s) => Ske(s, e, n));
- return [Ls(Vq, i, [p.Add_missing_function_declaration_0, n.token.text], Vq, p.Add_all_missing_function_declarations)];
- }
- if (n.kind === 1) {
- const i = sn.ChangeTracker.with(e, (s) => bke(s, e.program.getTypeChecker(), n));
- return [Ls(Pv, i, [p.Add_missing_enum_member_0, n.token.text], Pv, p.Add_all_missing_members)];
- }
- return Qi(Pqe(e, n), kqe(e, n));
- }
- },
- fixIds: [Pv, Vq, Wq, Uq],
- getAllCodeActions: (e) => {
- const { program: t, fixId: n } = e, i = t.getTypeChecker(), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
- return ik(sn.ChangeTracker.with(e, (c) => {
- sk(e, fke, (_) => {
- const u = pke(_.file, _.start, _.code, i, e.program);
- if (!(!u || !zp(s, Ma(u.parentDeclaration) + "#" + (u.kind === 3 ? u.identifier : u.token.text)))) {
- if (n === Vq && (u.kind === 2 || u.kind === 5))
- Ske(c, e, u);
- else if (n === Wq && u.kind === 3)
- xke(c, e, u);
- else if (n === Uq && u.kind === 4)
- Tke(c, e, u);
- else if (u.kind === 1 && bke(c, i, u), u.kind === 0) {
- const { parentDeclaration: d, token: g } = u, h = NE(o, d, () => []);
- h.some((S) => S.token.text === g.text) || h.push(u);
- }
- }
- }), o.forEach((_, u) => {
- const d = Qu(u) ? void 0 : ole(u, i);
- for (const g of _) {
- if (d?.some((I) => {
- const F = o.get(I);
- return !!F && F.some(({ token: O }) => O.text === g.token.text);
- })) continue;
- const { parentDeclaration: h, declSourceFile: S, modifierFlags: T, token: C, call: D, isJSFile: P } = g;
- if (D && !Di(C))
- vke(e, c, D, C, T & 256, h, S);
- else if (P && !Xl(h) && !Qu(h))
- dke(c, S, h, C, !!(T & 256));
- else {
- const I = gke(i, h, C);
- hke(
- c,
- S,
- h,
- C.text,
- I,
- T & 256
- /* Static */
- );
- }
- }
- });
- }));
- }
- });
- function pke(e, t, n, i, s) {
- var o;
- const c = xi(e, t), _ = c.parent;
- if (n === p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
- if (!(c.kind === 19 && Ks(_) && Fs(_.parent))) return;
- const T = ac(_.parent.arguments, (I) => I === _);
- if (T < 0) return;
- const C = i.getResolvedSignature(_.parent);
- if (!(C && C.declaration && C.parameters[T])) return;
- const D = C.parameters[T].valueDeclaration;
- if (!(D && Ii(D) && Oe(D.name))) return;
- const P = as(i.getUnmatchedProperties(
- i.getTypeAtLocation(_),
- i.getParameterType(C, T),
- /*requireOptionalProperties*/
- !1,
- /*matchDiscriminantProperties*/
- !1
- ));
- return Nr(P) ? { kind: 3, token: D.name, identifier: D.name.text, properties: P, parentDeclaration: _ } : void 0;
- }
- if (c.kind === 19 && Ks(_)) {
- const T = i.getContextualType(_) || i.getTypeAtLocation(_), C = as(i.getUnmatchedProperties(
- i.getTypeAtLocation(_),
- T,
- /*requireOptionalProperties*/
- !1,
- /*matchDiscriminantProperties*/
- !1
- ));
- return Nr(C) ? { kind: 3, token: _, identifier: "", properties: C, parentDeclaration: _ } : void 0;
- }
- if (!Fg(c)) return;
- if (Oe(c) && m0(_) && _.initializer && Ks(_.initializer)) {
- const T = i.getContextualType(c) || i.getTypeAtLocation(c), C = as(i.getUnmatchedProperties(
- i.getTypeAtLocation(_.initializer),
- T,
- /*requireOptionalProperties*/
- !1,
- /*matchDiscriminantProperties*/
- !1
- ));
- return Nr(C) ? { kind: 3, token: c, identifier: c.text, properties: C, parentDeclaration: _.initializer } : void 0;
- }
- if (Oe(c) && ou(c.parent)) {
- const T = pa(s.getCompilerOptions()), C = Aqe(i, T, c.parent);
- return Nr(C) ? { kind: 4, token: c, attributes: C, parentDeclaration: c.parent } : void 0;
- }
- if (Oe(c)) {
- const T = (o = i.getContextualType(c)) == null ? void 0 : o.getNonNullableType();
- if (T && wn(T) & 16) {
- const C = el(i.getSignaturesOfType(
- T,
- 0
- /* Call */
- ));
- return C === void 0 ? void 0 : { kind: 5, token: c, signature: C, sourceFile: e, parentDeclaration: kke(c) };
- }
- if (Fs(_) && _.expression === c)
- return { kind: 2, token: c, call: _, sourceFile: e, modifierFlags: 0, parentDeclaration: kke(c) };
- }
- if (!Cn(_)) return;
- const u = cV(i.getTypeAtLocation(_.expression)), d = u.symbol;
- if (!d || !d.declarations) return;
- if (Oe(c) && Fs(_.parent)) {
- const T = On(d.declarations, zc), C = T?.getSourceFile();
- if (T && C && !w6(s, C))
- return { kind: 2, token: c, call: _.parent, sourceFile: C, modifierFlags: 32, parentDeclaration: T };
- const D = On(d.declarations, Si);
- if (e.commonJsModuleIndicator) return;
- if (D && !w6(s, D))
- return { kind: 2, token: c, call: _.parent, sourceFile: D, modifierFlags: 32, parentDeclaration: D };
- }
- const g = On(d.declarations, Zn);
- if (!g && Di(c)) return;
- const h = g || On(d.declarations, (T) => Xl(T) || Qu(T));
- if (h && !w6(s, h.getSourceFile())) {
- const T = !Qu(h) && (u.target || u) !== i.getDeclaredTypeOfSymbol(d);
- if (T && (Di(c) || Xl(h))) return;
- const C = h.getSourceFile(), D = Qu(h) ? 0 : (T ? 256 : 0) | (RV(c.text) ? 2 : 0), P = Gu(C), I = Wn(_.parent, Fs);
- return { kind: 0, token: c, call: I, modifierFlags: D, parentDeclaration: h, declSourceFile: C, isJSFile: P };
- }
- const S = On(d.declarations, Bb);
- if (S && !(u.flags & 1056) && !Di(c) && !w6(s, S.getSourceFile()))
- return { kind: 1, token: c, parentDeclaration: S };
- }
- function kqe(e, t) {
- return t.isJSFile ? MT(Cqe(e, t)) : Eqe(e, t);
- }
- function Cqe(e, { parentDeclaration: t, declSourceFile: n, modifierFlags: i, token: s }) {
- if (Xl(t) || Qu(t))
- return;
- const o = sn.ChangeTracker.with(e, (_) => dke(_, n, t, s, !!(i & 256)));
- if (o.length === 0)
- return;
- const c = i & 256 ? p.Initialize_static_property_0 : Di(s) ? p.Declare_a_private_field_named_0 : p.Initialize_property_0_in_the_constructor;
- return Ls(Pv, o, [c, s.text], Pv, p.Add_all_missing_members);
- }
- function dke(e, t, n, i, s) {
- const o = i.text;
- if (s) {
- if (n.kind === 231)
- return;
- const c = n.name.getText(), _ = mke(A.createIdentifier(c), o);
- e.insertNodeAfter(t, n, _);
- } else if (Di(i)) {
- const c = A.createPropertyDeclaration(
- /*modifiers*/
- void 0,
- o,
- /*questionOrExclamationToken*/
- void 0,
- /*type*/
- void 0,
- /*initializer*/
- void 0
- ), _ = yke(n);
- _ ? e.insertNodeAfter(t, _, c) : e.insertMemberAtStart(t, n, c);
- } else {
- const c = Bg(n);
- if (!c)
- return;
- const _ = mke(A.createThis(), o);
- e.insertNodeAtConstructorEnd(t, c, _);
- }
- }
- function mke(e, t) {
- return A.createExpressionStatement(A.createAssignment(A.createPropertyAccessExpression(e, t), ok()));
- }
- function Eqe(e, { parentDeclaration: t, declSourceFile: n, modifierFlags: i, token: s }) {
- const o = s.text, c = i & 256, _ = gke(e.program.getTypeChecker(), t, s), u = (g) => sn.ChangeTracker.with(e, (h) => hke(h, n, t, o, _, g)), d = [Ls(Pv, u(
- i & 256
- /* Static */
- ), [c ? p.Declare_static_property_0 : p.Declare_property_0, o], Pv, p.Add_all_missing_members)];
- return c || Di(s) || (i & 2 && d.unshift(Rd(Pv, u(
- 2
- /* Private */
- ), [p.Declare_private_property_0, o])), d.push(Dqe(e, n, t, s.text, _))), d;
- }
- function gke(e, t, n) {
- let i;
- if (n.parent.parent.kind === 226) {
- const s = n.parent.parent, o = n.parent === s.left ? s.right : s.left, c = e.getWidenedType(e.getBaseTypeOfLiteralType(e.getTypeAtLocation(o)));
- i = e.typeToTypeNode(
- c,
- t,
- 1,
- 8
- /* AllowUnresolvedNames */
- );
- } else {
- const s = e.getContextualType(n.parent);
- i = s ? e.typeToTypeNode(
- s,
- /*enclosingDeclaration*/
- void 0,
- 1,
- 8
- /* AllowUnresolvedNames */
- ) : void 0;
- }
- return i || A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- );
- }
- function hke(e, t, n, i, s, o) {
- const c = o ? A.createNodeArray(A.createModifiersFromModifierFlags(o)) : void 0, _ = Zn(n) ? A.createPropertyDeclaration(
- c,
- i,
- /*questionOrExclamationToken*/
- void 0,
- s,
- /*initializer*/
- void 0
- ) : A.createPropertySignature(
- /*modifiers*/
- void 0,
- i,
- /*questionToken*/
- void 0,
- s
- ), u = yke(n);
- u ? e.insertNodeAfter(t, u, _) : e.insertMemberAtStart(t, n, _);
- }
- function yke(e) {
- let t;
- for (const n of e.members) {
- if (!cs(n)) break;
- t = n;
- }
- return t;
- }
- function Dqe(e, t, n, i, s) {
- const o = A.createKeywordTypeNode(
- 154
- /* StringKeyword */
- ), c = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- "x",
- /*questionToken*/
- void 0,
- o,
- /*initializer*/
- void 0
- ), _ = A.createIndexSignature(
- /*modifiers*/
- void 0,
- [c],
- s
- ), u = sn.ChangeTracker.with(e, (d) => d.insertMemberAtStart(t, n, _));
- return Rd(Pv, u, [p.Add_index_signature_for_property_0, i]);
- }
- function Pqe(e, t) {
- const { parentDeclaration: n, declSourceFile: i, modifierFlags: s, token: o, call: c } = t;
- if (c === void 0)
- return;
- const _ = o.text, u = (g) => sn.ChangeTracker.with(e, (h) => vke(e, h, c, o, g, n, i)), d = [Ls(Pv, u(
- s & 256
- /* Static */
- ), [s & 256 ? p.Declare_static_method_0 : p.Declare_method_0, _], Pv, p.Add_all_missing_members)];
- return s & 2 && d.unshift(Rd(Pv, u(
- 2
- /* Private */
- ), [p.Declare_private_method_0, _])), d;
- }
- function vke(e, t, n, i, s, o, c) {
- const _ = s2(c, e.program, e.preferences, e.host), u = Zn(o) ? 174 : 173, d = ele(u, e, _, n, i, s, o), g = Nqe(o, n);
- g ? t.insertNodeAfter(c, g, d) : t.insertMemberAtStart(c, o, d), _.writeFixes(t);
- }
- function bke(e, t, { token: n, parentDeclaration: i }) {
- const s = ut(i.members, (u) => {
- const d = t.getTypeAtLocation(u);
- return !!(d && d.flags & 402653316);
- }), o = i.getSourceFile(), c = A.createEnumMember(n, s ? A.createStringLiteral(n.text) : void 0), _ = Ro(i.members);
- _ ? e.insertNodeInListAfter(o, _, c, i.members) : e.insertMemberAtStart(o, i, c);
- }
- function Ske(e, t, n) {
- const i = bf(t.sourceFile, t.preferences), s = s2(t.sourceFile, t.program, t.preferences, t.host), o = n.kind === 2 ? ele(262, t, s, n.call, Nn(n.token), n.modifierFlags, n.parentDeclaration) : eH(
- 262,
- t,
- i,
- n.signature,
- Q9(p.Function_not_implemented.message, i),
- n.token,
- /*modifiers*/
- void 0,
- /*optional*/
- void 0,
- /*enclosingDeclaration*/
- void 0,
- s
- );
- o === void 0 && E.fail("fixMissingFunctionDeclaration codefix got unexpected error."), Up(n.parentDeclaration) ? e.insertNodeBefore(
- n.sourceFile,
- n.parentDeclaration,
- o,
- /*blankLineBetween*/
- !0
- ) : e.insertNodeAtEndOfScope(n.sourceFile, n.parentDeclaration, o), s.writeFixes(e);
- }
- function Tke(e, t, n) {
- const i = s2(t.sourceFile, t.program, t.preferences, t.host), s = bf(t.sourceFile, t.preferences), o = t.program.getTypeChecker(), c = n.parentDeclaration.attributes, _ = ut(c.properties, Lx), u = lr(n.attributes, (h) => {
- const S = qq(t, o, i, s, o.getTypeOfSymbol(h), n.parentDeclaration), T = A.createIdentifier(h.name), C = A.createJsxAttribute(T, A.createJsxExpression(
- /*dotDotDotToken*/
- void 0,
- S
- ));
- return Aa(T, C), C;
- }), d = A.createJsxAttributes(_ ? [...u, ...c.properties] : [...c.properties, ...u]), g = { prefix: c.pos === c.end ? " " : void 0 };
- e.replaceNode(t.sourceFile, c, d, g), i.writeFixes(e);
- }
- function xke(e, t, n) {
- const i = s2(t.sourceFile, t.program, t.preferences, t.host), s = bf(t.sourceFile, t.preferences), o = pa(t.program.getCompilerOptions()), c = t.program.getTypeChecker(), _ = lr(n.properties, (d) => {
- const g = qq(t, c, i, s, c.getTypeOfSymbol(d), n.parentDeclaration);
- return A.createPropertyAssignment(Iqe(d, o, s, c), g);
- }), u = {
- leadingTriviaOption: sn.LeadingTriviaOption.Exclude,
- trailingTriviaOption: sn.TrailingTriviaOption.Exclude,
- indentation: n.indentation
- };
- e.replaceNode(t.sourceFile, n.parentDeclaration, A.createObjectLiteralExpression(
- [...n.parentDeclaration.properties, ..._],
- /*multiLine*/
- !0
- ), u), i.writeFixes(e);
- }
- function qq(e, t, n, i, s, o) {
- if (s.flags & 3)
- return ok();
- if (s.flags & 134217732)
- return A.createStringLiteral(
- "",
- /* isSingleQuote */
- i === 0
- /* Single */
- );
- if (s.flags & 8)
- return A.createNumericLiteral(0);
- if (s.flags & 64)
- return A.createBigIntLiteral("0n");
- if (s.flags & 16)
- return A.createFalse();
- if (s.flags & 1056) {
- const c = s.symbol.exports ? rw(s.symbol.exports.values()) : s.symbol, _ = t.symbolToExpression(
- s.symbol.parent ? s.symbol.parent : s.symbol,
- 111551,
- /*enclosingDeclaration*/
- void 0,
- /*flags*/
- 64
- /* UseFullyQualifiedType */
- );
- return c === void 0 || _ === void 0 ? A.createNumericLiteral(0) : A.createPropertyAccessExpression(_, t.symbolToString(c));
- }
- if (s.flags & 256)
- return A.createNumericLiteral(s.value);
- if (s.flags & 2048)
- return A.createBigIntLiteral(s.value);
- if (s.flags & 128)
- return A.createStringLiteral(
- s.value,
- /* isSingleQuote */
- i === 0
- /* Single */
- );
- if (s.flags & 512)
- return s === t.getFalseType() || s === t.getFalseType(
- /*fresh*/
- !0
- ) ? A.createFalse() : A.createTrue();
- if (s.flags & 65536)
- return A.createNull();
- if (s.flags & 1048576)
- return Tc(s.types, (_) => qq(e, t, n, i, _, o)) ?? ok();
- if (t.isArrayLikeType(s))
- return A.createArrayLiteralExpression();
- if (wqe(s)) {
- const c = lr(t.getPropertiesOfType(s), (_) => {
- const u = qq(e, t, n, i, t.getTypeOfSymbol(_), o);
- return A.createPropertyAssignment(_.name, u);
- });
- return A.createObjectLiteralExpression(
- c,
- /*multiLine*/
- !0
- );
- }
- if (wn(s) & 16) {
- if (On(s.symbol.declarations || Ue, Nf(lg, vm, hc)) === void 0) return ok();
- const _ = t.getSignaturesOfType(
- s,
- 0
- /* Call */
- );
- return _ === void 0 ? ok() : eH(
- 218,
- e,
- i,
- _[0],
- Q9(p.Function_not_implemented.message, i),
- /*name*/
- void 0,
- /*modifiers*/
- void 0,
- /*optional*/
- void 0,
- /*enclosingDeclaration*/
- o,
- n
- ) ?? ok();
- }
- if (wn(s) & 1) {
- const c = Ah(s.symbol);
- if (c === void 0 || wb(c)) return ok();
- const _ = Bg(c);
- return _ && Nr(_.parameters) ? ok() : A.createNewExpression(
- A.createIdentifier(s.symbol.name),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- void 0
- );
- }
- return ok();
- }
- function ok() {
- return A.createIdentifier("undefined");
- }
- function wqe(e) {
- return e.flags & 524288 && (wn(e) & 128 || e.symbol && Wn(Qm(e.symbol.declarations), Qu));
- }
- function Aqe(e, t, n) {
- const i = e.getContextualType(n.attributes);
- if (i === void 0) return Ue;
- const s = i.getProperties();
- if (!Nr(s)) return Ue;
- const o = /* @__PURE__ */ new Set();
- for (const c of n.attributes.properties)
- if (km(c) && o.add(X4(c.name)), Lx(c)) {
- const _ = e.getTypeAtLocation(c.expression);
- for (const u of _.getProperties())
- o.add(u.escapedName);
- }
- return Ln(s, (c) => k_(
- c.name,
- t,
- 1
- /* JSX */
- ) && !(c.flags & 16777216 || gc(c) & 48 || o.has(c.escapedName)));
- }
- function Nqe(e, t) {
- if (Qu(e))
- return;
- const n = or(t, (i) => hc(i) || Qo(i));
- return n && n.parent === e ? n : void 0;
- }
- function Iqe(e, t, n, i) {
- if (Lg(e)) {
- const s = i.symbolToNode(
- e,
- 111551,
- /*enclosingDeclaration*/
- void 0,
- /*flags*/
- void 0,
- 1
- /* WriteComputedProps */
- );
- if (s && ma(s)) return s;
- }
- return w5(
- e.name,
- t,
- n === 0,
- /*stringNamed*/
- !1,
- /*isMethod*/
- !1
- );
- }
- function kke(e) {
- if (or(e, lD)) {
- const t = or(e.parent, Up);
- if (t) return t;
- }
- return Tr(e);
- }
- var Cce = "addMissingNewOperator", Cke = [p.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];
- Ys({
- errorCodes: Cke,
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = sn.ChangeTracker.with(e, (s) => Eke(s, t, n));
- return [Ls(Cce, i, p.Add_missing_new_operator_to_call, Cce, p.Add_missing_new_operator_to_all_calls)];
- },
- fixIds: [Cce],
- getAllCodeActions: (e) => Za(e, Cke, (t, n) => Eke(t, e.sourceFile, n))
- });
- function Eke(e, t, n) {
- const i = Bs(Oqe(t, n), Fs), s = A.createNewExpression(i.expression, i.typeArguments, i.arguments);
- e.replaceNode(t, i, s);
- }
- function Oqe(e, t) {
- let n = xi(e, t.start);
- const i = ec(t);
- for (; n.end < i; )
- n = n.parent;
- return n;
- }
- var Hq = "addMissingParam", Gq = "addOptionalParam", Dke = [p.Expected_0_arguments_but_got_1.code];
- Ys({
- errorCodes: Dke,
- fixIds: [Hq, Gq],
- getCodeActions(e) {
- const t = Pke(e.sourceFile, e.program, e.span.start);
- if (t === void 0) return;
- const { name: n, declarations: i, newParameters: s, newOptionalParameters: o } = t, c = [];
- return Nr(s) && wr(
- c,
- Ls(
- Hq,
- sn.ChangeTracker.with(e, (_) => $q(_, e.program, e.preferences, e.host, i, s)),
- [Nr(s) > 1 ? p.Add_missing_parameters_to_0 : p.Add_missing_parameter_to_0, n],
- Hq,
- p.Add_all_missing_parameters
- )
- ), Nr(o) && wr(
- c,
- Ls(
- Gq,
- sn.ChangeTracker.with(e, (_) => $q(_, e.program, e.preferences, e.host, i, o)),
- [Nr(o) > 1 ? p.Add_optional_parameters_to_0 : p.Add_optional_parameter_to_0, n],
- Gq,
- p.Add_all_optional_parameters
- )
- ), c;
- },
- getAllCodeActions: (e) => Za(e, Dke, (t, n) => {
- const i = Pke(e.sourceFile, e.program, n.start);
- if (i) {
- const { declarations: s, newParameters: o, newOptionalParameters: c } = i;
- e.fixId === Hq && $q(t, e.program, e.preferences, e.host, s, o), e.fixId === Gq && $q(t, e.program, e.preferences, e.host, s, c);
- }
- })
- });
- function Pke(e, t, n) {
- const i = xi(e, n), s = or(i, Fs);
- if (s === void 0 || Nr(s.arguments) === 0)
- return;
- const o = t.getTypeChecker(), c = o.getTypeAtLocation(s.expression), _ = Ln(c.symbol.declarations, wke);
- if (_ === void 0)
- return;
- const u = Ro(_);
- if (u === void 0 || u.body === void 0 || w6(t, u.getSourceFile()))
- return;
- const d = Fqe(u);
- if (d === void 0)
- return;
- const g = [], h = [], S = Nr(u.parameters), T = Nr(s.arguments);
- if (S > T)
- return;
- const C = [u, ...Mqe(u, _)];
- for (let D = 0, P = 0, I = 0; D < T; D++) {
- const F = s.arguments[D], O = xo(F) ? GB(F) : F, B = o.getWidenedType(o.getBaseTypeOfLiteralType(o.getTypeAtLocation(F))), z = P < S ? u.parameters[P] : void 0;
- if (z && o.isTypeAssignableTo(B, o.getTypeAtLocation(z))) {
- P++;
- continue;
- }
- const X = O && Oe(O) ? O.text : `p${I++}`, q = Lqe(o, B, u);
- wr(g, {
- pos: D,
- declaration: Nke(
- X,
- q,
- /*questionToken*/
- void 0
- )
- }), !jqe(C, P) && wr(h, {
- pos: D,
- declaration: Nke(X, q, A.createToken(
- 58
- /* QuestionToken */
- ))
- });
- }
- return {
- newParameters: g,
- newOptionalParameters: h,
- name: _o(d),
- declarations: C
- };
- }
- function Fqe(e) {
- const t = os(e);
- if (t)
- return t;
- if (ii(e.parent) && Oe(e.parent.name) || cs(e.parent) || Ii(e.parent))
- return e.parent.name;
- }
- function Lqe(e, t, n) {
- return e.typeToTypeNode(
- e.getWidenedType(t),
- n,
- 1,
- 8
- /* AllowUnresolvedNames */
- ) ?? A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- );
- }
- function $q(e, t, n, i, s, o) {
- const c = pa(t.getCompilerOptions());
- ir(s, (_) => {
- const u = Tr(_), d = s2(u, t, n, i);
- Nr(_.parameters) ? e.replaceNodeRangeWithNodes(
- u,
- xa(_.parameters),
- _a(_.parameters),
- Ake(d, c, _, o),
- {
- joiner: ", ",
- indentation: 0,
- leadingTriviaOption: sn.LeadingTriviaOption.IncludeAll,
- trailingTriviaOption: sn.TrailingTriviaOption.Include
- }
- ) : ir(Ake(d, c, _, o), (g, h) => {
- Nr(_.parameters) === 0 && h === 0 ? e.insertNodeAt(u, _.parameters.end, g) : e.insertNodeAtEndOfList(u, _.parameters, g);
- }), d.writeFixes(e);
- });
- }
- function wke(e) {
- switch (e.kind) {
- case 262:
- case 218:
- case 174:
- case 219:
- return !0;
- default:
- return !1;
- }
- }
- function Ake(e, t, n, i) {
- const s = lr(n.parameters, (o) => A.createParameterDeclaration(
- o.modifiers,
- o.dotDotDotToken,
- o.name,
- o.questionToken,
- o.type,
- o.initializer
- ));
- for (const { pos: o, declaration: c } of i) {
- const _ = o > 0 ? s[o - 1] : void 0;
- s.splice(
- o,
- 0,
- A.updateParameterDeclaration(
- c,
- c.modifiers,
- c.dotDotDotToken,
- c.name,
- _ && _.questionToken ? A.createToken(
- 58
- /* QuestionToken */
- ) : c.questionToken,
- Bqe(e, c.type, t),
- c.initializer
- )
- );
- }
- return s;
- }
- function Mqe(e, t) {
- const n = [];
- for (const i of t)
- if (Rqe(i)) {
- if (Nr(i.parameters) === Nr(e.parameters)) {
- n.push(i);
- continue;
- }
- if (Nr(i.parameters) > Nr(e.parameters))
- return [];
- }
- return n;
- }
- function Rqe(e) {
- return wke(e) && e.body === void 0;
- }
- function Nke(e, t, n) {
- return A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- e,
- n,
- t,
- /*initializer*/
- void 0
- );
- }
- function jqe(e, t) {
- return Nr(e) && ut(e, (n) => t < Nr(n.parameters) && !!n.parameters[t] && n.parameters[t].questionToken === void 0);
- }
- function Bqe(e, t, n) {
- const i = a2(t, n);
- return i ? (OS(e, i.symbols), i.typeNode) : t;
- }
- var Jqe = "fixCannotFindModule", Ece = "installTypesPackage", Ike = p.Cannot_find_module_0_or_its_corresponding_type_declarations.code, Oke = [
- Ike,
- p.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code
- ];
- Ys({
- errorCodes: Oke,
- getCodeActions: function(t) {
- const { host: n, sourceFile: i, span: { start: s } } = t, o = Lke(i, s);
- if (o === void 0) return;
- const c = Mke(o, n, t.errorCode);
- return c === void 0 ? [] : [Ls(
- Jqe,
- /*changes*/
- [],
- [p.Install_0, c],
- Ece,
- p.Install_all_missing_types_packages,
- Fke(i.fileName, c)
- )];
- },
- fixIds: [Ece],
- getAllCodeActions: (e) => Za(e, Oke, (t, n, i) => {
- const s = Lke(n.file, n.start);
- if (s !== void 0)
- switch (e.fixId) {
- case Ece: {
- const o = Mke(s, e.host, n.code);
- o && i.push(Fke(n.file.fileName, o));
- break;
- }
- default:
- E.fail(`Bad fixId: ${e.fixId}`);
- }
- })
- });
- function Fke(e, t) {
- return { type: "install package", file: e, packageName: t };
- }
- function Lke(e, t) {
- const n = Wn(xi(e, t), oa);
- if (!n) return;
- const i = n.text, { packageName: s } = MO(i);
- return Sl(s) ? void 0 : s;
- }
- function Mke(e, t, n) {
- var i;
- return n === Ike ? Dm.nodeCoreModules.has(e) ? "@types/node" : void 0 : (i = t.isKnownTypesPackageName) != null && i.call(t, e) ? jO(e) : void 0;
- }
- var Rke = [
- p.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,
- p.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code,
- p.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code,
- p.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,
- p.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code,
- p.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code
- ], Dce = "fixClassDoesntImplementInheritedAbstractMember";
- Ys({
- errorCodes: Rke,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = sn.ChangeTracker.with(t, (o) => Bke(jke(n, i.start), n, t, o, t.preferences));
- return s.length === 0 ? void 0 : [Ls(Dce, s, p.Implement_inherited_abstract_class, Dce, p.Implement_all_inherited_abstract_classes)];
- },
- fixIds: [Dce],
- getAllCodeActions: function(t) {
- const n = /* @__PURE__ */ new Map();
- return Za(t, Rke, (i, s) => {
- const o = jke(s.file, s.start);
- zp(n, Ma(o)) && Bke(o, t.sourceFile, t, i, t.preferences);
- });
- }
- });
- function jke(e, t) {
- const n = xi(e, t);
- return Bs(n.parent, Zn);
- }
- function Bke(e, t, n, i, s) {
- const o = _m(e), c = n.program.getTypeChecker(), _ = c.getTypeAtLocation(o), u = c.getPropertiesOfType(_).filter(zqe), d = s2(t, n.program, s, n.host);
- Kce(e, u, t, n, s, d, (g) => i.insertMemberAtStart(t, e, g)), d.writeFixes(i);
- }
- function zqe(e) {
- const t = T0(xa(e.getDeclarations()));
- return !(t & 2) && !!(t & 64);
- }
- var Pce = "classSuperMustPrecedeThisAccess", Jke = [p.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];
- Ys({
- errorCodes: Jke,
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = Wke(t, n.start);
- if (!i) return;
- const { constructor: s, superCall: o } = i, c = sn.ChangeTracker.with(e, (_) => zke(_, t, s, o));
- return [Ls(Pce, c, p.Make_super_call_the_first_statement_in_the_constructor, Pce, p.Make_all_super_calls_the_first_statement_in_their_constructor)];
- },
- fixIds: [Pce],
- getAllCodeActions(e) {
- const { sourceFile: t } = e, n = /* @__PURE__ */ new Map();
- return Za(e, Jke, (i, s) => {
- const o = Wke(s.file, s.start);
- if (!o) return;
- const { constructor: c, superCall: _ } = o;
- zp(n, Ma(c.parent)) && zke(i, t, c, _);
- });
- }
- });
- function zke(e, t, n, i) {
- e.insertNodeAtConstructorStart(t, n, i), e.delete(t, i);
- }
- function Wke(e, t) {
- const n = xi(e, t);
- if (n.kind !== 110) return;
- const i = yf(n), s = Uke(i.body);
- return s && !s.expression.arguments.some((o) => Cn(o) && o.expression === n) ? { constructor: i, superCall: s } : void 0;
- }
- function Uke(e) {
- return Pl(e) && rS(e.expression) ? e : ys(e) ? void 0 : bs(e, Uke);
- }
- var wce = "constructorForDerivedNeedSuperCall", Vke = [p.Constructors_for_derived_classes_must_contain_a_super_call.code];
- Ys({
- errorCodes: Vke,
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = qke(t, n.start), s = sn.ChangeTracker.with(e, (o) => Hke(o, t, i));
- return [Ls(wce, s, p.Add_missing_super_call, wce, p.Add_all_missing_super_calls)];
- },
- fixIds: [wce],
- getAllCodeActions: (e) => Za(e, Vke, (t, n) => Hke(t, e.sourceFile, qke(n.file, n.start)))
- });
- function qke(e, t) {
- const n = xi(e, t);
- return E.assert(Qo(n.parent), "token should be at the constructor declaration"), n.parent;
- }
- function Hke(e, t, n) {
- const i = A.createExpressionStatement(A.createCallExpression(
- A.createSuper(),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- Ue
- ));
- e.insertNodeAtConstructorStart(t, n, i);
- }
- var Gke = "fixEnableJsxFlag", $ke = [p.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];
- Ys({
- errorCodes: $ke,
- getCodeActions: function(t) {
- const { configFile: n } = t.program.getCompilerOptions();
- if (n === void 0)
- return;
- const i = sn.ChangeTracker.with(t, (s) => Xke(s, n));
- return [
- Rd(Gke, i, p.Enable_the_jsx_flag_in_your_configuration_file)
- ];
- },
- fixIds: [Gke],
- getAllCodeActions: (e) => Za(e, $ke, (t) => {
- const { configFile: n } = e.program.getCompilerOptions();
- n !== void 0 && Xke(t, n);
- })
- });
- function Xke(e, t) {
- ile(e, t, "jsx", A.createStringLiteral("react"));
- }
- var Ace = "fixNaNEquality", Qke = [
- p.This_condition_will_always_return_0.code
- ];
- Ys({
- errorCodes: Qke,
- getCodeActions(e) {
- const { sourceFile: t, span: n, program: i } = e, s = Yke(i, t, n);
- if (s === void 0) return;
- const { suggestion: o, expression: c, arg: _ } = s, u = sn.ChangeTracker.with(e, (d) => Zke(d, t, _, c));
- return [Ls(Ace, u, [p.Use_0, o], Ace, p.Use_Number_isNaN_in_all_conditions)];
- },
- fixIds: [Ace],
- getAllCodeActions: (e) => Za(e, Qke, (t, n) => {
- const i = Yke(e.program, n.file, Ul(n.start, n.length));
- i && Zke(t, n.file, i.arg, i.expression);
- })
- });
- function Yke(e, t, n) {
- const i = On(e.getSemanticDiagnostics(t), (c) => c.start === n.start && c.length === n.length);
- if (i === void 0 || i.relatedInformation === void 0) return;
- const s = On(i.relatedInformation, (c) => c.code === p.Did_you_mean_0.code);
- if (s === void 0 || s.file === void 0 || s.start === void 0 || s.length === void 0) return;
- const o = ale(s.file, Ul(s.start, s.length));
- if (o !== void 0 && _t(o) && dn(o.parent))
- return { suggestion: Wqe(s.messageText), expression: o.parent, arg: o };
- }
- function Zke(e, t, n, i) {
- const s = A.createCallExpression(
- A.createPropertyAccessExpression(A.createIdentifier("Number"), A.createIdentifier("isNaN")),
- /*typeArguments*/
- void 0,
- [n]
- ), o = i.operatorToken.kind;
- e.replaceNode(
- t,
- i,
- o === 38 || o === 36 ? A.createPrefixUnaryExpression(54, s) : s
- );
- }
- function Wqe(e) {
- const [, t] = Em(e, `
-`, 0).match(/'(.*)'/) || [];
- return t;
- }
- Ys({
- errorCodes: [
- p.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
- p.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
- p.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
- ],
- getCodeActions: function(t) {
- const n = t.program.getCompilerOptions(), { configFile: i } = n;
- if (i === void 0)
- return;
- const s = [], o = Ru(n);
- if (o >= 5 && o < 99) {
- const d = sn.ChangeTracker.with(t, (g) => {
- ile(g, i, "module", A.createStringLiteral("esnext"));
- });
- s.push(Rd("fixModuleOption", d, [p.Set_the_module_option_in_your_configuration_file_to_0, "esnext"]));
- }
- const _ = pa(n);
- if (_ < 4 || _ > 99) {
- const d = sn.ChangeTracker.with(t, (g) => {
- if (!d4(i)) return;
- const S = [["target", A.createStringLiteral("es2017")]];
- o === 1 && S.push(["module", A.createStringLiteral("commonjs")]), nle(g, i, S);
- });
- s.push(Rd("fixTargetOption", d, [p.Set_the_target_option_in_your_configuration_file_to_0, "es2017"]));
- }
- return s.length ? s : void 0;
- }
- });
- var Nce = "fixPropertyAssignment", Kke = [
- p.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code
- ];
- Ys({
- errorCodes: Kke,
- fixIds: [Nce],
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = tCe(t, n.start), s = sn.ChangeTracker.with(e, (o) => eCe(o, e.sourceFile, i));
- return [Ls(Nce, s, [p.Change_0_to_1, "=", ":"], Nce, [p.Switch_each_misused_0_to_1, "=", ":"])];
- },
- getAllCodeActions: (e) => Za(e, Kke, (t, n) => eCe(t, n.file, tCe(n.file, n.start)))
- });
- function eCe(e, t, n) {
- e.replaceNode(t, n, A.createPropertyAssignment(n.name, n.objectAssignmentInitializer));
- }
- function tCe(e, t) {
- return Bs(xi(e, t).parent, uu);
- }
- var Ice = "extendsInterfaceBecomesImplements", rCe = [p.Cannot_extend_an_interface_0_Did_you_mean_implements.code];
- Ys({
- errorCodes: rCe,
- getCodeActions(e) {
- const { sourceFile: t } = e, n = nCe(t, e.span.start);
- if (!n) return;
- const { extendsToken: i, heritageClauses: s } = n, o = sn.ChangeTracker.with(e, (c) => iCe(c, t, i, s));
- return [Ls(Ice, o, p.Change_extends_to_implements, Ice, p.Change_all_extended_interfaces_to_implements)];
- },
- fixIds: [Ice],
- getAllCodeActions: (e) => Za(e, rCe, (t, n) => {
- const i = nCe(n.file, n.start);
- i && iCe(t, n.file, i.extendsToken, i.heritageClauses);
- })
- });
- function nCe(e, t) {
- const n = xi(e, t), i = Ol(n).heritageClauses, s = i[0].getFirstToken();
- return s.kind === 96 ? { extendsToken: s, heritageClauses: i } : void 0;
- }
- function iCe(e, t, n, i) {
- if (e.replaceNode(t, n, A.createToken(
- 119
- /* ImplementsKeyword */
- )), i.length === 2 && i[0].token === 96 && i[1].token === 119) {
- const s = i[1].getFirstToken(), o = s.getFullStart();
- e.replaceRange(t, { pos: o, end: o }, A.createToken(
- 28
- /* CommaToken */
- ));
- const c = t.text;
- let _ = s.end;
- for (; _ < c.length && sm(c.charCodeAt(_)); )
- _++;
- e.deleteRange(t, { pos: s.getStart(), end: _ });
- }
- }
- var Oce = "forgottenThisPropertyAccess", sCe = p.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, aCe = [
- p.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
- p.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
- sCe
- ];
- Ys({
- errorCodes: aCe,
- getCodeActions(e) {
- const { sourceFile: t } = e, n = oCe(t, e.span.start, e.errorCode);
- if (!n)
- return;
- const i = sn.ChangeTracker.with(e, (s) => cCe(s, t, n));
- return [Ls(Oce, i, [p.Add_0_to_unresolved_variable, n.className || "this"], Oce, p.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)];
- },
- fixIds: [Oce],
- getAllCodeActions: (e) => Za(e, aCe, (t, n) => {
- const i = oCe(n.file, n.start, n.code);
- i && cCe(t, e.sourceFile, i);
- })
- });
- function oCe(e, t, n) {
- const i = xi(e, t);
- if (Oe(i) || Di(i))
- return { node: i, className: n === sCe ? Ol(i).name.text : void 0 };
- }
- function cCe(e, t, { node: n, className: i }) {
- af(n), e.replaceNode(t, n, A.createPropertyAccessExpression(i ? A.createIdentifier(i) : A.createThis(), n));
- }
- var Fce = "fixInvalidJsxCharacters_expression", Xq = "fixInvalidJsxCharacters_htmlEntity", lCe = [
- p.Unexpected_token_Did_you_mean_or_gt.code,
- p.Unexpected_token_Did_you_mean_or_rbrace.code
- ];
- Ys({
- errorCodes: lCe,
- fixIds: [Fce, Xq],
- getCodeActions(e) {
- const { sourceFile: t, preferences: n, span: i } = e, s = sn.ChangeTracker.with(e, (c) => Lce(
- c,
- n,
- t,
- i.start,
- /*useHtmlEntity*/
- !1
- )), o = sn.ChangeTracker.with(e, (c) => Lce(
- c,
- n,
- t,
- i.start,
- /*useHtmlEntity*/
- !0
- ));
- return [
- Ls(Fce, s, p.Wrap_invalid_character_in_an_expression_container, Fce, p.Wrap_all_invalid_characters_in_an_expression_container),
- Ls(Xq, o, p.Convert_invalid_character_to_its_html_entity_code, Xq, p.Convert_all_invalid_characters_to_HTML_entity_code)
- ];
- },
- getAllCodeActions(e) {
- return Za(e, lCe, (t, n) => Lce(t, e.preferences, n.file, n.start, e.fixId === Xq));
- }
- });
- var uCe = {
- ">": ">",
- "}": "}"
- };
- function Uqe(e) {
- return co(uCe, e);
- }
- function Lce(e, t, n, i, s) {
- const o = n.getText()[i];
- if (!Uqe(o))
- return;
- const c = s ? uCe[o] : `{${KD(n, t, o)}}`;
- e.replaceRangeWithText(n, { pos: i, end: i + 1 }, c);
- }
- var Qq = "deleteUnmatchedParameter", _Ce = "renameUnmatchedParameter", fCe = [
- p.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code
- ];
- Ys({
- fixIds: [Qq, _Ce],
- errorCodes: fCe,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = [], o = pCe(n, i.start);
- if (o)
- return wr(s, Vqe(t, o)), wr(s, qqe(t, o)), s;
- },
- getAllCodeActions: function(t) {
- const n = /* @__PURE__ */ new Map();
- return ik(sn.ChangeTracker.with(t, (i) => {
- sk(t, fCe, ({ file: s, start: o }) => {
- const c = pCe(s, o);
- c && n.set(c.signature, wr(n.get(c.signature), c.jsDocParameterTag));
- }), n.forEach((s, o) => {
- if (t.fixId === Qq) {
- const c = new Set(s);
- i.filterJSDocTags(o.getSourceFile(), o, (_) => !c.has(_));
- }
- });
- }));
- }
- });
- function Vqe(e, { name: t, jsDocHost: n, jsDocParameterTag: i }) {
- const s = sn.ChangeTracker.with(e, (o) => o.filterJSDocTags(e.sourceFile, n, (c) => c !== i));
- return Ls(
- Qq,
- s,
- [p.Delete_unused_param_tag_0, t.getText(e.sourceFile)],
- Qq,
- p.Delete_all_unused_param_tags
- );
- }
- function qqe(e, { name: t, jsDocHost: n, signature: i, jsDocParameterTag: s }) {
- if (!Nr(i.parameters)) return;
- const o = e.sourceFile, c = H1(i), _ = /* @__PURE__ */ new Set();
- for (const h of c)
- dp(h) && Oe(h.name) && _.add(h.name.escapedText);
- const u = Tc(i.parameters, (h) => Oe(h.name) && !_.has(h.name.escapedText) ? h.name.getText(o) : void 0);
- if (u === void 0) return;
- const d = A.updateJSDocParameterTag(
- s,
- s.tagName,
- A.createIdentifier(u),
- s.isBracketed,
- s.typeExpression,
- s.isNameFirst,
- s.comment
- ), g = sn.ChangeTracker.with(e, (h) => h.replaceJSDocComment(o, n, lr(c, (S) => S === s ? d : S)));
- return Rd(_Ce, g, [p.Rename_param_tag_name_0_to_1, t.getText(o), u]);
- }
- function pCe(e, t) {
- const n = xi(e, t);
- if (n.parent && dp(n.parent) && Oe(n.parent.name)) {
- const i = n.parent, s = xb(i), o = ev(i);
- if (s && o)
- return { jsDocHost: s, signature: o, name: n.parent.name, jsDocParameterTag: i };
- }
- }
- var Mce = "fixUnreferenceableDecoratorMetadata", Hqe = [p.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code];
- Ys({
- errorCodes: Hqe,
- getCodeActions: (e) => {
- const t = Gqe(e.sourceFile, e.program, e.span.start);
- if (!t) return;
- const n = sn.ChangeTracker.with(e, (o) => t.kind === 276 && Xqe(o, e.sourceFile, t, e.program)), i = sn.ChangeTracker.with(e, (o) => $qe(o, e.sourceFile, t, e.program));
- let s;
- return n.length && (s = wr(s, Rd(Mce, n, p.Convert_named_imports_to_namespace_import))), i.length && (s = wr(s, Rd(Mce, i, p.Use_import_type))), s;
- },
- fixIds: [Mce]
- });
- function Gqe(e, t, n) {
- const i = Wn(xi(e, n), Oe);
- if (!i || i.parent.kind !== 183) return;
- const o = t.getTypeChecker().getSymbolAtLocation(i);
- return On(o?.declarations || Ue, Nf(Ad, Zu, gl));
- }
- function $qe(e, t, n, i) {
- if (n.kind === 271) {
- e.insertModifierBefore(t, 156, n.name);
- return;
- }
- const s = n.kind === 273 ? n : n.parent.parent;
- if (s.name && s.namedBindings)
- return;
- const o = i.getTypeChecker();
- UZ(s, (_) => {
- if (Hl(_.symbol, o).flags & 111551) return !0;
- }) || e.insertModifierBefore(t, 156, s);
- }
- function Xqe(e, t, n, i) {
- rk.doChangeNamedToNamespaceOrDefault(t, i, e, n.parent);
- }
- var $9 = "unusedIdentifier", Rce = "unusedIdentifier_prefix", jce = "unusedIdentifier_delete", Yq = "unusedIdentifier_deleteImports", Bce = "unusedIdentifier_infer", dCe = [
- p._0_is_declared_but_its_value_is_never_read.code,
- p._0_is_declared_but_never_used.code,
- p.Property_0_is_declared_but_its_value_is_never_read.code,
- p.All_imports_in_import_declaration_are_unused.code,
- p.All_destructured_elements_are_unused.code,
- p.All_variables_are_unused.code,
- p.All_type_parameters_are_unused.code
- ];
- Ys({
- errorCodes: dCe,
- getCodeActions(e) {
- const { errorCode: t, sourceFile: n, program: i, cancellationToken: s } = e, o = i.getTypeChecker(), c = i.getSourceFiles(), _ = xi(n, e.span.start);
- if (qp(_))
- return [cP(sn.ChangeTracker.with(e, (h) => h.delete(n, _)), p.Remove_template_tag)];
- if (_.kind === 30) {
- const h = sn.ChangeTracker.with(e, (S) => gCe(S, n, _));
- return [cP(h, p.Remove_type_parameters)];
- }
- const u = hCe(_);
- if (u) {
- const h = sn.ChangeTracker.with(e, (S) => S.delete(n, u));
- return [Ls($9, h, [p.Remove_import_from_0, AK(u)], Yq, p.Delete_all_unused_imports)];
- } else if (Jce(_)) {
- const h = sn.ChangeTracker.with(e, (S) => Zq(
- n,
- _,
- S,
- o,
- c,
- i,
- s,
- /*isFixAll*/
- !1
- ));
- if (h.length)
- return [Ls($9, h, [p.Remove_unused_declaration_for_Colon_0, _.getText(n)], Yq, p.Delete_all_unused_imports)];
- }
- if (Mf(_.parent) || w0(_.parent)) {
- if (Ii(_.parent.parent)) {
- const h = _.parent.elements, S = [
- h.length > 1 ? p.Remove_unused_declarations_for_Colon_0 : p.Remove_unused_declaration_for_Colon_0,
- lr(h, (T) => T.getText(n)).join(", ")
- ];
- return [
- cP(sn.ChangeTracker.with(e, (T) => Qqe(T, n, _.parent)), S)
- ];
- }
- return [
- cP(sn.ChangeTracker.with(e, (h) => Yqe(e, h, n, _.parent)), p.Remove_unused_destructuring_declaration)
- ];
- }
- if (yCe(n, _))
- return [
- cP(sn.ChangeTracker.with(e, (h) => vCe(h, n, _.parent)), p.Remove_variable_statement)
- ];
- if (Oe(_) && Ec(_.parent))
- return [cP(sn.ChangeTracker.with(e, (h) => iHe(h, n, _.parent)), [p.Remove_unused_declaration_for_Colon_0, _.getText(n)])];
- const d = [];
- if (_.kind === 140) {
- const h = sn.ChangeTracker.with(e, (T) => mCe(T, n, _)), S = Bs(_.parent, pS).typeParameter.name.text;
- d.push(Ls($9, h, [p.Replace_infer_0_with_unknown, S], Bce, p.Replace_all_unused_infer_with_unknown));
- } else {
- const h = sn.ChangeTracker.with(e, (S) => Zq(
- n,
- _,
- S,
- o,
- c,
- i,
- s,
- /*isFixAll*/
- !1
- ));
- if (h.length) {
- const S = ma(_.parent) ? _.parent : _;
- d.push(cP(h, [p.Remove_unused_declaration_for_Colon_0, S.getText(n)]));
- }
- }
- const g = sn.ChangeTracker.with(e, (h) => bCe(h, t, n, _));
- return g.length && d.push(Ls($9, g, [p.Prefix_0_with_an_underscore, _.getText(n)], Rce, p.Prefix_all_unused_declarations_with_where_possible)), d;
- },
- fixIds: [Rce, jce, Yq, Bce],
- getAllCodeActions: (e) => {
- const { sourceFile: t, program: n, cancellationToken: i } = e, s = n.getTypeChecker(), o = n.getSourceFiles();
- return Za(e, dCe, (c, _) => {
- const u = xi(t, _.start);
- switch (e.fixId) {
- case Rce:
- bCe(c, _.code, t, u);
- break;
- case Yq: {
- const d = hCe(u);
- d ? c.delete(t, d) : Jce(u) && Zq(
- t,
- u,
- c,
- s,
- o,
- n,
- i,
- /*isFixAll*/
- !0
- );
- break;
- }
- case jce: {
- if (u.kind === 140 || Jce(u))
- break;
- if (qp(u))
- c.delete(t, u);
- else if (u.kind === 30)
- gCe(c, t, u);
- else if (Mf(u.parent)) {
- if (u.parent.parent.initializer)
- break;
- (!Ii(u.parent.parent) || SCe(u.parent.parent, s, o)) && c.delete(t, u.parent.parent);
- } else {
- if (w0(u.parent.parent) && u.parent.parent.parent.initializer)
- break;
- yCe(t, u) ? vCe(c, t, u.parent) : Zq(
- t,
- u,
- c,
- s,
- o,
- n,
- i,
- /*isFixAll*/
- !0
- );
- }
- break;
- }
- case Bce:
- u.kind === 140 && mCe(c, t, u);
- break;
- default:
- E.fail(JSON.stringify(e.fixId));
- }
- });
- }
- });
- function mCe(e, t, n) {
- e.replaceNode(t, n.parent, A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- ));
- }
- function cP(e, t) {
- return Ls($9, e, t, jce, p.Delete_all_unused_declarations);
- }
- function gCe(e, t, n) {
- e.delete(t, E.checkDefined(Bs(n.parent, Xj).typeParameters, "The type parameter to delete should exist"));
- }
- function Jce(e) {
- return e.kind === 102 || e.kind === 80 && (e.parent.kind === 276 || e.parent.kind === 273);
- }
- function hCe(e) {
- return e.kind === 102 ? Wn(e.parent, ic) : void 0;
- }
- function yCe(e, t) {
- return Fl(t.parent) && xa(t.parent.getChildren(e)) === t;
- }
- function vCe(e, t, n) {
- e.delete(t, n.parent.kind === 243 ? n.parent : n);
- }
- function Qqe(e, t, n) {
- ir(n.elements, (i) => e.delete(t, i));
- }
- function Yqe(e, t, n, { parent: i }) {
- if (ii(i) && i.initializer && mb(i.initializer))
- if (Fl(i.parent) && Nr(i.parent.declarations) > 1) {
- const s = i.parent.parent, o = s.getStart(n), c = s.end;
- t.delete(n, i), t.insertNodeAt(n, c, i.initializer, {
- prefix: jh(e.host, e.formatContext.options) + n.text.slice(c9(n.text, o - 1), o),
- suffix: d8(n) ? ";" : ""
- });
- } else
- t.replaceNode(n, i.parent, i.initializer);
- else
- t.delete(n, i);
- }
- function bCe(e, t, n, i) {
- t !== p.Property_0_is_declared_but_its_value_is_never_read.code && (i.kind === 140 && (i = Bs(i.parent, pS).typeParameter.name), Oe(i) && Zqe(i) && (e.replaceNode(n, i, A.createIdentifier(`_${i.text}`)), Ii(i.parent) && aC(i.parent).forEach((s) => {
- Oe(s.name) && e.replaceNode(n, s.name, A.createIdentifier(`_${s.name.text}`));
- })));
- }
- function Zqe(e) {
- switch (e.parent.kind) {
- case 169:
- case 168:
- return !0;
- case 260:
- switch (e.parent.parent.parent.kind) {
- case 250:
- case 249:
- return !0;
- }
- }
- return !1;
- }
- function Zq(e, t, n, i, s, o, c, _) {
- Kqe(t, n, e, i, s, o, c, _), Oe(t) && Eo.Core.eachSymbolReferenceInFile(t, i, e, (u) => {
- Cn(u.parent) && u.parent.name === u && (u = u.parent), !_ && nHe(u) && n.delete(e, u.parent.parent);
- });
- }
- function Kqe(e, t, n, i, s, o, c, _) {
- const { parent: u } = e;
- if (Ii(u))
- eHe(t, n, u, i, s, o, c, _);
- else if (!(_ && Oe(e) && Eo.Core.isSymbolReferencedInFile(e, i, n))) {
- const d = Ad(u) ? e : ma(u) ? u.parent : u;
- E.assert(d !== n, "should not delete whole source file"), t.delete(n, d);
- }
- }
- function eHe(e, t, n, i, s, o, c, _ = !1) {
- if (tHe(i, t, n, s, o, c, _))
- if (n.modifiers && n.modifiers.length > 0 && (!Oe(n.name) || Eo.Core.isSymbolReferencedInFile(n.name, i, t)))
- for (const u of n.modifiers)
- ra(u) && e.deleteModifier(t, u);
- else !n.initializer && SCe(n, i, s) && e.delete(t, n);
- }
- function SCe(e, t, n) {
- const i = e.parent.parameters.indexOf(e);
- return !Eo.Core.someSignatureUsage(e.parent, n, t, (s, o) => !o || o.arguments.length > i);
- }
- function tHe(e, t, n, i, s, o, c) {
- const { parent: _ } = n;
- switch (_.kind) {
- case 174:
- case 176:
- const u = _.parameters.indexOf(n), d = hc(_) ? _.name : _, g = Eo.Core.getReferencedSymbolsForNode(_.pos, d, s, i, o);
- if (g) {
- for (const h of g)
- for (const S of h.references)
- if (S.kind === Eo.EntryKind.Node) {
- const T = rD(S.node) && Fs(S.node.parent) && S.node.parent.arguments.length > u, C = Cn(S.node.parent) && rD(S.node.parent.expression) && Fs(S.node.parent.parent) && S.node.parent.parent.arguments.length > u, D = (hc(S.node.parent) || vm(S.node.parent)) && S.node.parent !== n.parent && S.node.parent.parameters.length > u;
- if (T || C || D) return !1;
- }
- }
- return !0;
- case 262:
- return _.name && rHe(e, t, _.name) ? TCe(_, n, c) : !0;
- case 218:
- case 219:
- return TCe(_, n, c);
- case 178:
- return !1;
- case 177:
- return !0;
- default:
- return E.failBadSyntaxKind(_);
- }
- }
- function rHe(e, t, n) {
- return !!Eo.Core.eachSymbolReferenceInFile(n, e, t, (i) => Oe(i) && Fs(i.parent) && i.parent.arguments.includes(i));
- }
- function TCe(e, t, n) {
- const i = e.parameters, s = i.indexOf(t);
- return E.assert(s !== -1, "The parameter should already be in the list"), n ? i.slice(s + 1).every((o) => Oe(o.name) && !o.symbol.isReferenced) : s === i.length - 1;
- }
- function nHe(e) {
- return (dn(e.parent) && e.parent.left === e || (FJ(e.parent) || uv(e.parent)) && e.parent.operand === e) && Pl(e.parent.parent);
- }
- function iHe(e, t, n) {
- const i = n.symbol.declarations;
- if (i)
- for (const s of i)
- e.delete(t, s);
- }
- var zce = "fixUnreachableCode", xCe = [p.Unreachable_code_detected.code];
- Ys({
- errorCodes: xCe,
- getCodeActions(e) {
- if (e.program.getSyntacticDiagnostics(e.sourceFile, e.cancellationToken).length) return;
- const n = sn.ChangeTracker.with(e, (i) => kCe(i, e.sourceFile, e.span.start, e.span.length, e.errorCode));
- return [Ls(zce, n, p.Remove_unreachable_code, zce, p.Remove_all_unreachable_code)];
- },
- fixIds: [zce],
- getAllCodeActions: (e) => Za(e, xCe, (t, n) => kCe(t, n.file, n.start, n.length, n.code))
- });
- function kCe(e, t, n, i, s) {
- const o = xi(t, n), c = or(o, bi);
- if (c.getStart(t) !== o.getStart(t)) {
- const u = JSON.stringify({
- statementKind: E.formatSyntaxKind(c.kind),
- tokenKind: E.formatSyntaxKind(o.kind),
- errorCode: s,
- start: n,
- length: i
- });
- E.fail("Token and statement should start at the same point. " + u);
- }
- const _ = (Cs(c.parent) ? c.parent : c).parent;
- if (!Cs(c.parent) || c === xa(c.parent.statements))
- switch (_.kind) {
- case 245:
- if (_.elseStatement) {
- if (Cs(c.parent))
- break;
- e.replaceNode(t, c, A.createBlock(Ue));
- return;
- }
- case 247:
- case 248:
- e.delete(t, _);
- return;
- }
- if (Cs(c.parent)) {
- const u = n + i, d = E.checkDefined(sHe(cJ(c.parent.statements, c), (g) => g.pos < u), "Some statement should be last");
- e.deleteNodeRange(t, c, d);
- } else
- e.delete(t, c);
- }
- function sHe(e, t) {
- let n;
- for (const i of e) {
- if (!t(i)) break;
- n = i;
- }
- return n;
- }
- var Wce = "fixUnusedLabel", CCe = [p.Unused_label.code];
- Ys({
- errorCodes: CCe,
- getCodeActions(e) {
- const t = sn.ChangeTracker.with(e, (n) => ECe(n, e.sourceFile, e.span.start));
- return [Ls(Wce, t, p.Remove_unused_label, Wce, p.Remove_all_unused_labels)];
- },
- fixIds: [Wce],
- getAllCodeActions: (e) => Za(e, CCe, (t, n) => ECe(t, n.file, n.start))
- });
- function ECe(e, t, n) {
- const i = xi(t, n), s = Bs(i.parent, Gy), o = i.getStart(t), c = s.statement.getStart(t), _ = cp(o, c, t) ? c : aa(
- t.text,
- Ya(s, 59, t).end,
- /*stopAfterLineBreak*/
- !0
- );
- e.deleteRange(t, { pos: o, end: _ });
- }
- var DCe = "fixJSDocTypes_plain", Uce = "fixJSDocTypes_nullable", PCe = [
- p.JSDoc_types_can_only_be_used_inside_documentation_comments.code,
- p._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,
- p._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code
- ];
- Ys({
- errorCodes: PCe,
- getCodeActions(e) {
- const { sourceFile: t } = e, n = e.program.getTypeChecker(), i = ACe(t, e.span.start, n);
- if (!i) return;
- const { typeNode: s, type: o } = i, c = s.getText(t), _ = [u(o, DCe, p.Change_all_jsdoc_style_types_to_TypeScript)];
- return s.kind === 314 && _.push(u(o, Uce, p.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)), _;
- function u(d, g, h) {
- const S = sn.ChangeTracker.with(e, (T) => wCe(T, t, s, d, n));
- return Ls("jdocTypes", S, [p.Change_0_to_1, c, n.typeToString(d)], g, h);
- }
- },
- fixIds: [DCe, Uce],
- getAllCodeActions(e) {
- const { fixId: t, program: n, sourceFile: i } = e, s = n.getTypeChecker();
- return Za(e, PCe, (o, c) => {
- const _ = ACe(c.file, c.start, s);
- if (!_) return;
- const { typeNode: u, type: d } = _, g = u.kind === 314 && t === Uce ? s.getNullableType(
- d,
- 32768
- /* Undefined */
- ) : d;
- wCe(o, i, u, g, s);
- });
- }
- });
- function wCe(e, t, n, i, s) {
- e.replaceNode(t, n, s.typeToTypeNode(
- i,
- /*enclosingDeclaration*/
- n,
- /*flags*/
- void 0
- ));
- }
- function ACe(e, t, n) {
- const i = or(xi(e, t), aHe), s = i && i.type;
- return s && { typeNode: s, type: oHe(n, s) };
- }
- function aHe(e) {
- switch (e.kind) {
- case 234:
- case 179:
- case 180:
- case 262:
- case 177:
- case 181:
- case 200:
- case 174:
- case 173:
- case 169:
- case 172:
- case 171:
- case 178:
- case 265:
- case 216:
- case 260:
- return !0;
- default:
- return !1;
- }
- }
- function oHe(e, t) {
- if (QC(t)) {
- const n = e.getTypeFromTypeNode(t.type);
- return n === e.getNeverType() || n === e.getVoidType() ? n : e.getUnionType(
- wr([n, e.getUndefinedType()], t.postfix ? void 0 : e.getNullType())
- );
- }
- return e.getTypeFromTypeNode(t);
- }
- var Vce = "fixMissingCallParentheses", NCe = [
- p.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code
- ];
- Ys({
- errorCodes: NCe,
- fixIds: [Vce],
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = OCe(t, n.start);
- if (!i) return;
- const s = sn.ChangeTracker.with(e, (o) => ICe(o, e.sourceFile, i));
- return [Ls(Vce, s, p.Add_missing_call_parentheses, Vce, p.Add_all_missing_call_parentheses)];
- },
- getAllCodeActions: (e) => Za(e, NCe, (t, n) => {
- const i = OCe(n.file, n.start);
- i && ICe(t, n.file, i);
- })
- });
- function ICe(e, t, n) {
- e.replaceNodeWithText(t, n, `${n.text}()`);
- }
- function OCe(e, t) {
- const n = xi(e, t);
- if (Cn(n.parent)) {
- let i = n.parent;
- for (; Cn(i.parent); )
- i = i.parent;
- return i.name;
- }
- if (Oe(n))
- return n;
- }
- var FCe = "fixMissingTypeAnnotationOnExports", qce = "add-annotation", Hce = "add-type-assertion", cHe = "extract-expression", LCe = [
- p.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
- p.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
- p.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
- p.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
- p.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
- p.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
- p.Expression_type_can_t_be_inferred_with_isolatedDeclarations.code,
- p.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations.code,
- p.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations.code,
- p.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations.code,
- p.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations.code,
- p.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations.code,
- p.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations.code,
- p.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations.code,
- p.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations.code,
- p.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code,
- p.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code,
- p.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code,
- p.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations.code,
- p.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code,
- p.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code
- ], lHe = /* @__PURE__ */ new Set([
- 177,
- 174,
- 172,
- 262,
- 218,
- 219,
- 260,
- 169,
- 277,
- 263,
- 206,
- 207
- /* ArrayBindingPattern */
- ]), MCe = 531469, RCe = 1;
- Ys({
- errorCodes: LCe,
- fixIds: [FCe],
- getCodeActions(e) {
- const t = [];
- return lP(qce, t, e, 0, (n) => n.addTypeAnnotation(e.span)), lP(qce, t, e, 1, (n) => n.addTypeAnnotation(e.span)), lP(qce, t, e, 2, (n) => n.addTypeAnnotation(e.span)), lP(Hce, t, e, 0, (n) => n.addInlineAssertion(e.span)), lP(Hce, t, e, 1, (n) => n.addInlineAssertion(e.span)), lP(Hce, t, e, 2, (n) => n.addInlineAssertion(e.span)), lP(cHe, t, e, 0, (n) => n.extractAsVariable(e.span)), t;
- },
- getAllCodeActions: (e) => {
- const t = jCe(e, 0, (n) => {
- sk(e, LCe, (i) => {
- n.addTypeAnnotation(i);
- });
- });
- return ik(t.textChanges);
- }
- });
- function lP(e, t, n, i, s) {
- const o = jCe(n, i, s);
- o.result && o.textChanges.length && t.push(Ls(
- e,
- o.textChanges,
- o.result,
- FCe,
- p.Add_all_missing_type_annotations
- ));
- }
- function jCe(e, t, n) {
- const i = { typeNode: void 0, mutatedTarget: !1 }, s = sn.ChangeTracker.fromContext(e), o = e.sourceFile, c = e.program, _ = c.getTypeChecker(), u = pa(c.getCompilerOptions()), d = s2(e.sourceFile, e.program, e.preferences, e.host), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), S = Ky({
- preserveSourceNewlines: !1
- }), T = n({ addTypeAnnotation: C, addInlineAssertion: O, extractAsVariable: B });
- return d.writeFixes(s), {
- result: T,
- textChanges: s.getChanges()
- };
- function C(fe) {
- e.cancellationToken.throwIfCancellationRequested();
- const Me = xi(o, fe.start), Qe = z(Me);
- if (Qe)
- return Ec(Qe) ? D(Qe) : X(Qe);
- const et = Te(Me);
- if (et)
- return X(et);
- }
- function D(fe) {
- var Me;
- if (h?.has(fe)) return;
- h?.add(fe);
- const Qe = _.getTypeAtLocation(fe), et = _.getPropertiesOfType(Qe);
- if (!fe.name || et.length === 0) return;
- const Re = [];
- for (const _r of et)
- k_(_r.name, pa(c.getCompilerOptions())) && (_r.valueDeclaration && ii(_r.valueDeclaration) || Re.push(A.createVariableStatement(
- [A.createModifier(
- 95
- /* ExportKeyword */
- )],
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- _r.name,
- /*exclamationToken*/
- void 0,
- le(_.getTypeOfSymbol(_r), fe),
- /*initializer*/
- void 0
- )]
- )
- )));
- if (Re.length === 0) return;
- const ft = [];
- (Me = fe.modifiers) != null && Me.some(
- (_r) => _r.kind === 95
- /* ExportKeyword */
- ) && ft.push(A.createModifier(
- 95
- /* ExportKeyword */
- )), ft.push(A.createModifier(
- 138
- /* DeclareKeyword */
- ));
- const Wt = A.createModuleDeclaration(
- ft,
- fe.name,
- A.createModuleBlock(Re),
- /*flags*/
- 101441696
- /* ContextFlags */
- );
- return s.insertNodeAfter(o, fe, Wt), [p.Annotate_types_of_properties_expando_function_in_a_namespace];
- }
- function P(fe) {
- return !yo(fe) && !Fs(fe) && !Ks(fe) && !$l(fe);
- }
- function I(fe, Me) {
- return P(fe) && (fe = A.createParenthesizedExpression(fe)), A.createAsExpression(fe, Me);
- }
- function F(fe, Me) {
- return P(fe) && (fe = A.createParenthesizedExpression(fe)), A.createAsExpression(A.createSatisfiesExpression(fe, Ja(Me)), Me);
- }
- function O(fe) {
- e.cancellationToken.throwIfCancellationRequested();
- const Me = xi(o, fe.start);
- if (z(Me)) return;
- const et = we(Me, fe);
- if (!et || nx(et) || nx(et.parent)) return;
- const Re = _t(et), ft = uu(et);
- if (!ft && ql(et) || or(et, As) || or(et, A0) || Re && (or(et, ef) || or(et, fi)) || fp(et))
- return;
- const Wt = or(et, ii), _r = Wt && _.getTypeAtLocation(Wt);
- if (_r && _r.flags & 8192 || !(Re || ft)) return;
- const { typeNode: Ir, mutatedTarget: jr } = ne(et, _r);
- if (!(!Ir || jr))
- return ft ? s.insertNodeAt(
- o,
- et.end,
- I(
- Ja(et.name),
- Ir
- ),
- {
- prefix: ": "
- }
- ) : Re ? s.replaceNode(
- o,
- et,
- F(
- Ja(et),
- Ir
- )
- ) : E.assertNever(et), [p.Add_satisfies_and_an_inline_type_assertion_with_0, tt(Ir)];
- }
- function B(fe) {
- e.cancellationToken.throwIfCancellationRequested();
- const Me = xi(o, fe.start), Qe = we(Me, fe);
- if (!Qe || nx(Qe) || nx(Qe.parent) || !_t(Qe)) return;
- if ($l(Qe))
- return s.replaceNode(
- o,
- Qe,
- I(Qe, A.createTypeReferenceNode("const"))
- ), [p.Mark_array_literal_as_const];
- const Re = or(Qe, Qc);
- if (Re) {
- if (Re === Qe.parent && yo(Qe)) return;
- const ft = A.createUniqueName(
- Xae(Qe, o, _, o),
- 16
- /* Optimistic */
- );
- let Wt = Qe, _r = Qe;
- if (fp(Wt) && (Wt = ag(Wt.parent), _e(Wt.parent) ? _r = Wt = Wt.parent : _r = I(
- Wt,
- A.createTypeReferenceNode("const")
- )), yo(Wt)) return;
- const Ir = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- ft,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- _r
- )
- ],
- 2
- /* Const */
- )
- ), jr = or(Qe, bi);
- return s.insertNodeBefore(o, jr, Ir), s.replaceNode(
- o,
- Wt,
- A.createAsExpression(
- A.cloneNode(ft),
- A.createTypeQueryNode(
- A.cloneNode(ft)
- )
- )
- ), [p.Extract_to_variable_and_replace_with_0_as_typeof_0, tt(ft)];
- }
- }
- function z(fe) {
- const Me = or(fe, (Qe) => bi(Qe) ? "quit" : vx(Qe));
- if (Me && vx(Me)) {
- let Qe = Me;
- if (dn(Qe) && (Qe = Qe.left, !vx(Qe)))
- return;
- const et = _.getTypeAtLocation(Qe.expression);
- if (!et) return;
- const Re = _.getPropertiesOfType(et);
- if (ut(Re, (ft) => ft.valueDeclaration === Me || ft.valueDeclaration === Me.parent)) {
- const ft = et.symbol.valueDeclaration;
- if (ft) {
- if (Wy(ft) && ii(ft.parent))
- return ft.parent;
- if (Ec(ft))
- return ft;
- }
- }
- }
- }
- function X(fe) {
- if (!g?.has(fe))
- switch (g?.add(fe), fe.kind) {
- case 169:
- case 172:
- case 260:
- return ve(fe);
- case 219:
- case 218:
- case 262:
- case 174:
- case 177:
- return q(fe, o);
- case 277:
- return V(fe);
- case 263:
- return ae(fe);
- case 206:
- case 207:
- return ee(fe);
- default:
- throw new Error(`Cannot find a fix for the given node ${fe.kind}`);
- }
- }
- function q(fe, Me) {
- if (fe.type)
- return;
- const { typeNode: Qe } = ne(fe);
- if (Qe)
- return s.tryInsertTypeAnnotation(
- Me,
- fe,
- Qe
- ), [p.Add_return_type_0, tt(Qe)];
- }
- function V(fe) {
- if (fe.isExportEquals)
- return;
- const { typeNode: Me } = ne(fe.expression);
- if (!Me) return;
- const Qe = A.createUniqueName("_default");
- return s.replaceNodeWithNodes(o, fe, [
- A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- Qe,
- /*exclamationToken*/
- void 0,
- Me,
- fe.expression
- )],
- 2
- /* Const */
- )
- ),
- A.updateExportAssignment(fe, fe?.modifiers, Qe)
- ]), [
- p.Extract_default_export_to_variable
- ];
- }
- function ae(fe) {
- var Me, Qe;
- const et = (Me = fe.heritageClauses) == null ? void 0 : Me.find(
- (Nt) => Nt.token === 96
- /* ExtendsKeyword */
- ), Re = et?.types[0];
- if (!Re)
- return;
- const { typeNode: ft } = ne(Re.expression);
- if (!ft)
- return;
- const Wt = A.createUniqueName(
- fe.name ? fe.name.text + "Base" : "Anonymous",
- 16
- /* Optimistic */
- ), _r = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- Wt,
- /*exclamationToken*/
- void 0,
- ft,
- Re.expression
- )],
- 2
- /* Const */
- )
- );
- s.insertNodeBefore(o, fe, _r);
- const Ir = ky(o.text, Re.end), jr = ((Qe = Ir?.[Ir.length - 1]) == null ? void 0 : Qe.end) ?? Re.end;
- return s.replaceRange(
- o,
- {
- pos: Re.getFullStart(),
- end: jr
- },
- Wt,
- {
- prefix: " "
- }
- ), [p.Extract_base_class_to_variable];
- }
- function ee(fe) {
- var Me;
- const Qe = fe.parent, et = fe.parent.parent.parent;
- if (!Qe.initializer) return;
- let Re;
- const ft = [];
- if (Oe(Qe.initializer))
- Re = { expression: { kind: 3, identifier: Qe.initializer } };
- else {
- const Ir = A.createUniqueName(
- "dest",
- 16
- /* Optimistic */
- );
- Re = { expression: { kind: 3, identifier: Ir } }, ft.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- Ir,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Qe.initializer
- )],
- 2
- /* Const */
- )
- ));
- }
- const Wt = [];
- w0(fe) ? G(fe, Wt, Re) : ue(fe, Wt, Re);
- const _r = /* @__PURE__ */ new Map();
- for (const Ir of Wt) {
- if (Ir.element.propertyName && ma(Ir.element.propertyName)) {
- const Nt = Ir.element.propertyName.expression, Qt = A.getGeneratedNameForNode(Nt), Br = A.createVariableDeclaration(
- Qt,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Nt
- ), xr = A.createVariableDeclarationList(
- [Br],
- 2
- /* Const */
- ), zn = A.createVariableStatement(
- /*modifiers*/
- void 0,
- xr
- );
- ft.push(zn), _r.set(Nt, Qt);
- }
- const jr = Ir.element.name;
- if (w0(jr))
- G(jr, Wt, Ir);
- else if (Mf(jr))
- ue(jr, Wt, Ir);
- else {
- const { typeNode: Nt } = ne(jr);
- let Qt = re(Ir, _r);
- if (Ir.element.initializer) {
- const xr = (Me = Ir.element) == null ? void 0 : Me.propertyName, zn = A.createUniqueName(
- xr && Oe(xr) ? xr.text : "temp",
- 16
- /* Optimistic */
- );
- ft.push(A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- zn,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- Qt
- )],
- 2
- /* Const */
- )
- )), Qt = A.createConditionalExpression(
- A.createBinaryExpression(
- zn,
- A.createToken(
- 37
- /* EqualsEqualsEqualsToken */
- ),
- A.createIdentifier("undefined")
- ),
- A.createToken(
- 58
- /* QuestionToken */
- ),
- Ir.element.initializer,
- A.createToken(
- 59
- /* ColonToken */
- ),
- Qt
- );
- }
- const Br = Gn(
- et,
- 32
- /* Export */
- ) ? [A.createToken(
- 95
- /* ExportKeyword */
- )] : void 0;
- ft.push(A.createVariableStatement(
- Br,
- A.createVariableDeclarationList(
- [A.createVariableDeclaration(
- jr,
- /*exclamationToken*/
- void 0,
- Nt,
- Qt
- )],
- 2
- /* Const */
- )
- ));
- }
- }
- return et.declarationList.declarations.length > 1 && ft.push(A.updateVariableStatement(
- et,
- et.modifiers,
- A.updateVariableDeclarationList(
- et.declarationList,
- et.declarationList.declarations.filter((Ir) => Ir !== fe.parent)
- )
- )), s.replaceNodeWithNodes(o, et, ft), [
- p.Extract_binding_expressions_to_variable
- ];
- }
- function G(fe, Me, Qe) {
- for (let et = 0; et < fe.elements.length; ++et) {
- const Re = fe.elements[et];
- ml(Re) || Me.push({
- element: Re,
- parent: Qe,
- expression: { kind: 2, arrayIndex: et }
- });
- }
- }
- function ue(fe, Me, Qe) {
- for (const et of fe.elements) {
- let Re;
- if (et.propertyName)
- if (ma(et.propertyName)) {
- Me.push({
- element: et,
- parent: Qe,
- expression: { kind: 1, computed: et.propertyName.expression }
- });
- continue;
- } else
- Re = et.propertyName.text;
- else
- Re = et.name.text;
- Me.push({
- element: et,
- parent: Qe,
- expression: { kind: 0, text: Re }
- });
- }
- }
- function re(fe, Me) {
- const Qe = [fe];
- for (; fe.parent; )
- fe = fe.parent, Qe.push(fe);
- let et = Qe[Qe.length - 1].expression.identifier;
- for (let Re = Qe.length - 2; Re >= 0; --Re) {
- const ft = Qe[Re].expression;
- ft.kind === 0 ? et = A.createPropertyAccessChain(
- et,
- /*questionDotToken*/
- void 0,
- A.createIdentifier(ft.text)
- ) : ft.kind === 1 ? et = A.createElementAccessExpression(
- et,
- Me.get(ft.computed)
- ) : ft.kind === 2 && (et = A.createElementAccessExpression(
- et,
- ft.arrayIndex
- ));
- }
- return et;
- }
- function ne(fe, Me) {
- if (t === 1)
- return he(fe);
- let Qe;
- if (nx(fe)) {
- const ft = _.getSignatureFromDeclaration(fe);
- if (ft) {
- const Wt = _.getTypePredicateOfSignature(ft);
- if (Wt)
- return Wt.type ? {
- typeNode: me(Wt, or(fe, ql) ?? o, Re(Wt.type)),
- mutatedTarget: !1
- } : i;
- Qe = _.getReturnTypeOfSignature(ft);
- }
- } else
- Qe = _.getTypeAtLocation(fe);
- if (!Qe)
- return i;
- if (t === 2) {
- Me && (Qe = Me);
- const ft = _.getWidenedLiteralType(Qe);
- if (_.isTypeAssignableTo(ft, Qe))
- return i;
- Qe = ft;
- }
- const et = or(fe, ql) ?? o;
- return Ii(fe) && _.requiresAddingImplicitUndefined(fe, et) && (Qe = _.getUnionType(
- [_.getUndefinedType(), Qe],
- 0
- /* None */
- )), {
- typeNode: le(Qe, et, Re(Qe)),
- mutatedTarget: !1
- };
- function Re(ft) {
- return (ii(fe) || cs(fe) && Gn(
- fe,
- 264
- /* Readonly */
- )) && ft.flags & 8192 ? 1048576 : 0;
- }
- }
- function ie(fe) {
- return A.createTypeQueryNode(Ja(fe));
- }
- function Se(fe, Me = "temp") {
- const Qe = !!or(fe, _e);
- return Qe ? oe(
- fe,
- Me,
- Qe,
- (et) => et.elements,
- fp,
- A.createSpreadElement,
- (et) => A.createArrayLiteralExpression(
- et,
- /*multiLine*/
- !0
- ),
- (et) => A.createTupleTypeNode(et.map(A.createRestTypeNode))
- ) : i;
- }
- function J(fe, Me = "temp") {
- const Qe = !!or(fe, _e);
- return oe(
- fe,
- Me,
- Qe,
- (et) => et.properties,
- $g,
- A.createSpreadAssignment,
- (et) => A.createObjectLiteralExpression(
- et,
- /*multiLine*/
- !0
- ),
- A.createIntersectionTypeNode
- );
- }
- function oe(fe, Me, Qe, et, Re, ft, Wt, _r) {
- const Ir = [], jr = [];
- let Nt;
- const Qt = or(fe, bi);
- for (const zn of et(fe))
- Re(zn) ? (xr(), yo(zn.expression) ? (Ir.push(ie(zn.expression)), jr.push(zn)) : Br(zn.expression)) : (Nt ?? (Nt = [])).push(zn);
- if (jr.length === 0)
- return i;
- return xr(), s.replaceNode(o, fe, Wt(jr)), {
- typeNode: _r(Ir),
- mutatedTarget: !0
- };
- function Br(zn) {
- const ki = A.createUniqueName(
- Me + "_Part" + (jr.length + 1),
- 16
- /* Optimistic */
- ), rs = Qe ? A.createAsExpression(
- zn,
- A.createTypeReferenceNode("const")
- ) : zn, ei = A.createVariableStatement(
- /*modifiers*/
- void 0,
- A.createVariableDeclarationList(
- [
- A.createVariableDeclaration(
- ki,
- /*exclamationToken*/
- void 0,
- /*type*/
- void 0,
- rs
- )
- ],
- 2
- /* Const */
- )
- );
- s.insertNodeBefore(o, Qt, ei), Ir.push(ie(ki)), jr.push(ft(ki));
- }
- function xr() {
- Nt && (Br(Wt(
- Nt
- )), Nt = void 0);
- }
- }
- function _e(fe) {
- return $1(fe) && xd(fe.type);
- }
- function he(fe) {
- if (Ii(fe))
- return i;
- if (uu(fe))
- return {
- typeNode: ie(fe.name),
- mutatedTarget: !1
- };
- if (yo(fe))
- return {
- typeNode: ie(fe),
- mutatedTarget: !1
- };
- if (_e(fe))
- return he(fe.expression);
- if ($l(fe)) {
- const Me = or(fe, ii), Qe = Me && Oe(Me.name) ? Me.name.text : void 0;
- return Se(fe, Qe);
- }
- if (Ks(fe)) {
- const Me = or(fe, ii), Qe = Me && Oe(Me.name) ? Me.name.text : void 0;
- return J(fe, Qe);
- }
- if (ii(fe) && fe.initializer)
- return he(fe.initializer);
- if (Ix(fe)) {
- const { typeNode: Me, mutatedTarget: Qe } = he(fe.whenTrue);
- if (!Me) return i;
- const { typeNode: et, mutatedTarget: Re } = he(fe.whenFalse);
- return et ? {
- typeNode: A.createUnionTypeNode([Me, et]),
- mutatedTarget: Qe || Re
- } : i;
- }
- return i;
- }
- function le(fe, Me, Qe = 0) {
- let et = !1;
- const Re = X9(_, d, fe, Me, u, MCe | Qe, RCe, {
- moduleResolverHost: c,
- trackSymbol() {
- return !0;
- },
- reportTruncationError() {
- et = !0;
- }
- });
- return et ? A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ) : Re;
- }
- function me(fe, Me, Qe = 0) {
- let et = !1;
- const Re = a6e(_, d, fe, Me, u, MCe | Qe, RCe, {
- moduleResolverHost: c,
- trackSymbol() {
- return !0;
- },
- reportTruncationError() {
- et = !0;
- }
- });
- return et ? A.createKeywordTypeNode(
- 133
- /* AnyKeyword */
- ) : Re;
- }
- function ve(fe) {
- const { typeNode: Me } = ne(fe);
- if (Me)
- return fe.type ? s.replaceNode(Tr(fe), fe.type, Me) : s.tryInsertTypeAnnotation(Tr(fe), fe, Me), [p.Add_annotation_of_type_0, tt(Me)];
- }
- function tt(fe) {
- an(
- fe,
- 1
- /* SingleLine */
- );
- const Me = S.printNode(4, fe, o);
- return Me.length > l4 ? Me.substring(0, l4 - 3) + "..." : (an(
- fe,
- 0
- /* None */
- ), Me);
- }
- function Te(fe) {
- return or(fe, (Me) => lHe.has(Me.kind) && (!Mf(Me) && !w0(Me) || ii(Me.parent)));
- }
- function we(fe, Me) {
- for (; fe && fe.end < Me.start + Me.length; )
- fe = fe.parent;
- for (; fe.parent.pos === fe.pos && fe.parent.end === fe.end; )
- fe = fe.parent;
- return Oe(fe) && m0(fe.parent) && fe.parent.initializer ? fe.parent.initializer : fe;
- }
- }
- var Gce = "fixAwaitInSyncFunction", BCe = [
- p.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
- p.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
- p.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
- p.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code
- ];
- Ys({
- errorCodes: BCe,
- getCodeActions(e) {
- const { sourceFile: t, span: n } = e, i = JCe(t, n.start);
- if (!i) return;
- const s = sn.ChangeTracker.with(e, (o) => zCe(o, t, i));
- return [Ls(Gce, s, p.Add_async_modifier_to_containing_function, Gce, p.Add_all_missing_async_modifiers)];
- },
- fixIds: [Gce],
- getAllCodeActions: function(t) {
- const n = /* @__PURE__ */ new Map();
- return Za(t, BCe, (i, s) => {
- const o = JCe(s.file, s.start);
- !o || !zp(n, Ma(o.insertBefore)) || zCe(i, t.sourceFile, o);
- });
- }
- });
- function uHe(e) {
- if (e.type)
- return e.type;
- if (ii(e.parent) && e.parent.type && lg(e.parent.type))
- return e.parent.type.type;
- }
- function JCe(e, t) {
- const n = xi(e, t), i = yf(n);
- if (!i)
- return;
- let s;
- switch (i.kind) {
- case 174:
- s = i.name;
- break;
- case 262:
- case 218:
- s = Ya(i, 100, e);
- break;
- case 219:
- const o = i.typeParameters ? 30 : 21;
- s = Ya(i, o, e) || xa(i.parameters);
- break;
- default:
- return;
- }
- return s && {
- insertBefore: s,
- returnType: uHe(i)
- };
- }
- function zCe(e, t, { insertBefore: n, returnType: i }) {
- if (i) {
- const s = Yw(i);
- (!s || s.kind !== 80 || s.text !== "Promise") && e.replaceNode(t, i, A.createTypeReferenceNode("Promise", A.createNodeArray([i])));
- }
- e.insertModifierBefore(t, 134, n);
- }
- var WCe = [
- p._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,
- p._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code
- ], $ce = "fixPropertyOverrideAccessor";
- Ys({
- errorCodes: WCe,
- getCodeActions(e) {
- const t = UCe(e.sourceFile, e.span.start, e.span.length, e.errorCode, e);
- if (t)
- return [Ls($ce, t, p.Generate_get_and_set_accessors, $ce, p.Generate_get_and_set_accessors_for_all_overriding_properties)];
- },
- fixIds: [$ce],
- getAllCodeActions: (e) => Za(e, WCe, (t, n) => {
- const i = UCe(n.file, n.start, n.length, n.code, e);
- if (i)
- for (const s of i)
- t.pushRaw(e.sourceFile, s);
- })
- });
- function UCe(e, t, n, i, s) {
- let o, c;
- if (i === p._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)
- o = t, c = t + n;
- else if (i === p._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) {
- const _ = s.program.getTypeChecker(), u = xi(e, t).parent;
- E.assert(Ay(u), "error span of fixPropertyOverrideAccessor should only be on an accessor");
- const d = u.parent;
- E.assert(Zn(d), "erroneous accessors should only be inside classes");
- const g = Qm(ole(d, _));
- if (!g) return [];
- const h = Ei(QT(u.name)), S = _.getPropertyOfType(_.getTypeAtLocation(g), h);
- if (!S || !S.valueDeclaration) return [];
- o = S.valueDeclaration.pos, c = S.valueDeclaration.end, e = Tr(S.valueDeclaration);
- } else
- E.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + i);
- return _6e(e, s.program, o, c, s, p.Generate_get_and_set_accessors.message);
- }
- var Xce = "inferFromUsage", VCe = [
- // Variable declarations
- p.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,
- // Variable uses
- p.Variable_0_implicitly_has_an_1_type.code,
- // Parameter declarations
- p.Parameter_0_implicitly_has_an_1_type.code,
- p.Rest_parameter_0_implicitly_has_an_any_type.code,
- // Get Accessor declarations
- p.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,
- p._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,
- // Set Accessor declarations
- p.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,
- // Property declarations
- p.Member_0_implicitly_has_an_1_type.code,
- //// Suggestions
- // Variable declarations
- p.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,
- // Variable uses
- p.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,
- // Parameter declarations
- p.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,
- p.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,
- // Get Accessor declarations
- p.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,
- p._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,
- // Set Accessor declarations
- p.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,
- // Property declarations
- p.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,
- // Function expressions and declarations
- p.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code
- ];
- Ys({
- errorCodes: VCe,
- getCodeActions(e) {
- const { sourceFile: t, program: n, span: { start: i }, errorCode: s, cancellationToken: o, host: c, preferences: _ } = e, u = xi(t, i);
- let d;
- const g = sn.ChangeTracker.with(e, (S) => {
- d = qCe(
- S,
- t,
- u,
- s,
- n,
- o,
- /*markSeen*/
- B1,
- c,
- _
- );
- }), h = d && os(d);
- return !h || g.length === 0 ? void 0 : [Ls(Xce, g, [_He(s, u), nc(h)], Xce, p.Infer_all_types_from_usage)];
- },
- fixIds: [Xce],
- getAllCodeActions(e) {
- const { sourceFile: t, program: n, cancellationToken: i, host: s, preferences: o } = e, c = x6();
- return Za(e, VCe, (_, u) => {
- qCe(_, t, xi(u.file, u.start), u.code, n, i, c, s, o);
- });
- }
- });
- function _He(e, t) {
- switch (e) {
- case p.Parameter_0_implicitly_has_an_1_type.code:
- case p.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:
- return K_(yf(t)) ? p.Infer_type_of_0_from_usage : p.Infer_parameter_types_from_usage;
- case p.Rest_parameter_0_implicitly_has_an_any_type.code:
- case p.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Infer_parameter_types_from_usage;
- case p.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:
- return p.Infer_this_type_of_0_from_usage;
- default:
- return p.Infer_type_of_0_from_usage;
- }
- }
- function fHe(e) {
- switch (e) {
- case p.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;
- case p.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Variable_0_implicitly_has_an_1_type.code;
- case p.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Parameter_0_implicitly_has_an_1_type.code;
- case p.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Rest_parameter_0_implicitly_has_an_any_type.code;
- case p.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:
- return p.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;
- case p._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;
- case p.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:
- return p.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;
- case p.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:
- return p.Member_0_implicitly_has_an_1_type.code;
- }
- return e;
- }
- function qCe(e, t, n, i, s, o, c, _, u) {
- if (!s4(n.kind) && n.kind !== 80 && n.kind !== 26 && n.kind !== 110)
- return;
- const { parent: d } = n, g = s2(t, s, u, _);
- switch (i = fHe(i), i) {
- case p.Member_0_implicitly_has_an_1_type.code:
- case p.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:
- if (ii(d) && c(d) || cs(d) || m_(d))
- return HCe(e, g, t, d, s, _, o), g.writeFixes(e), d;
- if (Cn(d)) {
- const T = L8(d.name, s, o), C = eP(T, d, s, _);
- if (C) {
- const D = A.createJSDocTypeTag(
- /*tagName*/
- void 0,
- A.createJSDocTypeExpression(C),
- /*comment*/
- void 0
- );
- e.addJSDocTags(t, Bs(d.parent.parent, Pl), [D]);
- }
- return g.writeFixes(e), d;
- }
- return;
- case p.Variable_0_implicitly_has_an_1_type.code: {
- const T = s.getTypeChecker().getSymbolAtLocation(n);
- return T && T.valueDeclaration && ii(T.valueDeclaration) && c(T.valueDeclaration) ? (HCe(e, g, Tr(T.valueDeclaration), T.valueDeclaration, s, _, o), g.writeFixes(e), T.valueDeclaration) : void 0;
- }
- }
- const h = yf(n);
- if (h === void 0)
- return;
- let S;
- switch (i) {
- case p.Parameter_0_implicitly_has_an_1_type.code:
- if (K_(h)) {
- GCe(e, g, t, h, s, _, o), S = h;
- break;
- }
- case p.Rest_parameter_0_implicitly_has_an_any_type.code:
- if (c(h)) {
- const T = Bs(d, Ii);
- pHe(e, g, t, T, h, s, _, o), S = T;
- }
- break;
- case p.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:
- case p._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:
- Lf(h) && Oe(h.name) && (Kq(e, g, t, h, L8(h.name, s, o), s, _), S = h);
- break;
- case p.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:
- K_(h) && (GCe(e, g, t, h, s, _, o), S = h);
- break;
- case p.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:
- sn.isThisTypeAnnotatable(h) && c(h) && (dHe(e, t, h, s, _, o), S = h);
- break;
- default:
- return E.fail(String(i));
- }
- return g.writeFixes(e), S;
- }
- function HCe(e, t, n, i, s, o, c) {
- Oe(i.name) && Kq(e, t, n, i, L8(i.name, s, c), s, o);
- }
- function pHe(e, t, n, i, s, o, c, _) {
- if (!Oe(i.name))
- return;
- const u = hHe(s, n, o, _);
- if (E.assert(s.parameters.length === u.length, "Parameter count and inference count should match"), cn(s))
- $Ce(e, n, u, o, c);
- else {
- const d = Co(s) && !Ya(s, 21, n);
- d && e.insertNodeBefore(n, xa(s.parameters), A.createToken(
- 21
- /* OpenParenToken */
- ));
- for (const { declaration: g, type: h } of u)
- g && !g.type && !g.initializer && Kq(e, t, n, g, h, o, c);
- d && e.insertNodeAfter(n, _a(s.parameters), A.createToken(
- 22
- /* CloseParenToken */
- ));
- }
- }
- function dHe(e, t, n, i, s, o) {
- const c = XCe(n, t, i, o);
- if (!c || !c.length)
- return;
- const _ = Yce(i, c, o).thisParameter(), u = eP(_, n, i, s);
- u && (cn(n) ? mHe(e, t, n, u) : e.tryInsertThisTypeAnnotation(t, n, u));
- }
- function mHe(e, t, n, i) {
- e.addJSDocTags(t, n, [
- A.createJSDocThisTag(
- /*tagName*/
- void 0,
- A.createJSDocTypeExpression(i)
- )
- ]);
- }
- function GCe(e, t, n, i, s, o, c) {
- const _ = el(i.parameters);
- if (_ && Oe(i.name) && Oe(_.name)) {
- let u = L8(i.name, s, c);
- u === s.getTypeChecker().getAnyType() && (u = L8(_.name, s, c)), cn(i) ? $Ce(e, n, [{ declaration: _, type: u }], s, o) : Kq(e, t, n, _, u, s, o);
- }
- }
- function Kq(e, t, n, i, s, o, c) {
- const _ = eP(s, i, o, c);
- if (_)
- if (cn(n) && i.kind !== 171) {
- const u = ii(i) ? Wn(i.parent.parent, yc) : i;
- if (!u)
- return;
- const d = A.createJSDocTypeExpression(_), g = Lf(i) ? A.createJSDocReturnTag(
- /*tagName*/
- void 0,
- d,
- /*comment*/
- void 0
- ) : A.createJSDocTypeTag(
- /*tagName*/
- void 0,
- d,
- /*comment*/
- void 0
- );
- e.addJSDocTags(n, u, [g]);
- } else gHe(_, i, n, e, t, pa(o.getCompilerOptions())) || e.tryInsertTypeAnnotation(n, i, _);
- }
- function gHe(e, t, n, i, s, o) {
- const c = a2(e, o);
- return c && i.tryInsertTypeAnnotation(n, t, c.typeNode) ? (ir(c.symbols, (_) => s.addImportFromExportedSymbol(
- _,
- /*isValidTypeOnlyUseSite*/
- !0
- )), !0) : !1;
- }
- function $Ce(e, t, n, i, s) {
- const o = n.length && n[0].declaration.parent;
- if (!o)
- return;
- const c = Ai(n, (_) => {
- const u = _.declaration;
- if (u.initializer || q1(u) || !Oe(u.name))
- return;
- const d = _.type && eP(_.type, u, i, s);
- if (d) {
- const g = A.cloneNode(u.name);
- return an(
- g,
- 7168
- /* NoNestedComments */
- ), { name: A.cloneNode(u.name), param: u, isOptional: !!_.isOptional, typeNode: d };
- }
- });
- if (c.length)
- if (Co(o) || vo(o)) {
- const _ = Co(o) && !Ya(o, 21, t);
- _ && e.insertNodeBefore(t, xa(o.parameters), A.createToken(
- 21
- /* OpenParenToken */
- )), ir(c, ({ typeNode: u, param: d }) => {
- const g = A.createJSDocTypeTag(
- /*tagName*/
- void 0,
- A.createJSDocTypeExpression(u)
- ), h = A.createJSDocComment(
- /*comment*/
- void 0,
- [g]
- );
- e.insertNodeAt(t, d.getStart(t), h, { suffix: " " });
- }), _ && e.insertNodeAfter(t, _a(o.parameters), A.createToken(
- 22
- /* CloseParenToken */
- ));
- } else {
- const _ = lr(c, ({ name: u, typeNode: d, isOptional: g }) => A.createJSDocParameterTag(
- /*tagName*/
- void 0,
- u,
- /*isBracketed*/
- !!g,
- A.createJSDocTypeExpression(d),
- /*isNameFirst*/
- !1,
- /*comment*/
- void 0
- ));
- e.addJSDocTags(t, o, _);
- }
- }
- function Qce(e, t, n) {
- return Ai(Eo.getReferenceEntriesForNode(-1, e, t, t.getSourceFiles(), n), (i) => i.kind !== Eo.EntryKind.Span ? Wn(i.node, Oe) : void 0);
- }
- function L8(e, t, n) {
- const i = Qce(e, t, n);
- return Yce(t, i, n).single();
- }
- function hHe(e, t, n, i) {
- const s = XCe(e, t, n, i);
- return s && Yce(n, s, i).parameters(e) || e.parameters.map((o) => ({
- declaration: o,
- type: Oe(o.name) ? L8(o.name, n, i) : n.getTypeChecker().getAnyType()
- }));
- }
- function XCe(e, t, n, i) {
- let s;
- switch (e.kind) {
- case 176:
- s = Ya(e, 137, t);
- break;
- case 219:
- case 218:
- const o = e.parent;
- s = (ii(o) || cs(o)) && Oe(o.name) ? o.name : e.name;
- break;
- case 262:
- case 174:
- case 173:
- s = e.name;
- break;
- }
- if (s)
- return Qce(s, n, i);
- }
- function Yce(e, t, n) {
- const i = e.getTypeChecker(), s = {
- string: () => i.getStringType(),
- number: () => i.getNumberType(),
- Array: (me) => i.createArrayType(me),
- Promise: (me) => i.createPromiseType(me)
- }, o = [
- i.getStringType(),
- i.getNumberType(),
- i.createArrayType(i.getAnyType()),
- i.createPromiseType(i.getAnyType())
- ];
- return {
- single: u,
- parameters: d,
- thisParameter: g
- };
- function c() {
- return {
- isNumber: void 0,
- isString: void 0,
- isNumberOrString: void 0,
- candidateTypes: void 0,
- properties: void 0,
- calls: void 0,
- constructs: void 0,
- numberIndex: void 0,
- stringIndex: void 0,
- candidateThisTypes: void 0,
- inferredTypes: void 0
- };
- }
- function _(me) {
- const ve = /* @__PURE__ */ new Map();
- for (const Te of me)
- Te.properties && Te.properties.forEach((we, fe) => {
- ve.has(fe) || ve.set(fe, []), ve.get(fe).push(we);
- });
- const tt = /* @__PURE__ */ new Map();
- return ve.forEach((Te, we) => {
- tt.set(we, _(Te));
- }), {
- isNumber: me.some((Te) => Te.isNumber),
- isString: me.some((Te) => Te.isString),
- isNumberOrString: me.some((Te) => Te.isNumberOrString),
- candidateTypes: ta(me, (Te) => Te.candidateTypes),
- properties: tt,
- calls: ta(me, (Te) => Te.calls),
- constructs: ta(me, (Te) => Te.constructs),
- numberIndex: ir(me, (Te) => Te.numberIndex),
- stringIndex: ir(me, (Te) => Te.stringIndex),
- candidateThisTypes: ta(me, (Te) => Te.candidateThisTypes),
- inferredTypes: void 0
- // clear type cache
- };
- }
- function u() {
- return ae(h(t));
- }
- function d(me) {
- if (t.length === 0 || !me.parameters)
- return;
- const ve = c();
- for (const Te of t)
- n.throwIfCancellationRequested(), S(Te, ve);
- const tt = [...ve.constructs || [], ...ve.calls || []];
- return me.parameters.map((Te, we) => {
- const fe = [], Me = rg(Te);
- let Qe = !1;
- for (const Re of tt)
- if (Re.argumentTypes.length <= we)
- Qe = cn(me), fe.push(i.getUndefinedType());
- else if (Me)
- for (let ft = we; ft < Re.argumentTypes.length; ft++)
- fe.push(i.getBaseTypeOfLiteralType(Re.argumentTypes[ft]));
- else
- fe.push(i.getBaseTypeOfLiteralType(Re.argumentTypes[we]));
- if (Oe(Te.name)) {
- const Re = h(Qce(Te.name, e, n));
- fe.push(...Me ? Ai(Re, i.getElementTypeOfArrayType) : Re);
- }
- const et = ae(fe);
- return {
- type: Me ? i.createArrayType(et) : et,
- isOptional: Qe && !Me,
- declaration: Te
- };
- });
- }
- function g() {
- const me = c();
- for (const ve of t)
- n.throwIfCancellationRequested(), S(ve, me);
- return ae(me.candidateThisTypes || Ue);
- }
- function h(me) {
- const ve = c();
- for (const tt of me)
- n.throwIfCancellationRequested(), S(tt, ve);
- return G(ve);
- }
- function S(me, ve) {
- for (; A4(me); )
- me = me.parent;
- switch (me.parent.kind) {
- case 244:
- C(me, ve);
- break;
- case 225:
- ve.isNumber = !0;
- break;
- case 224:
- D(me.parent, ve);
- break;
- case 226:
- P(me, me.parent, ve);
- break;
- case 296:
- case 297:
- I(me.parent, ve);
- break;
- case 213:
- case 214:
- me.parent.expression === me ? F(me.parent, ve) : T(me, ve);
- break;
- case 211:
- O(me.parent, ve);
- break;
- case 212:
- B(me.parent, me, ve);
- break;
- case 303:
- case 304:
- z(me.parent, ve);
- break;
- case 172:
- X(me.parent, ve);
- break;
- case 260: {
- const { name: tt, initializer: Te } = me.parent;
- if (me === tt) {
- Te && he(ve, i.getTypeAtLocation(Te));
- break;
- }
- }
- default:
- return T(me, ve);
- }
- }
- function T(me, ve) {
- Ed(me) && he(ve, i.getContextualType(me));
- }
- function C(me, ve) {
- he(ve, Fs(me) ? i.getVoidType() : i.getAnyType());
- }
- function D(me, ve) {
- switch (me.operator) {
- case 46:
- case 47:
- case 41:
- case 55:
- ve.isNumber = !0;
- break;
- case 40:
- ve.isNumberOrString = !0;
- break;
- }
- }
- function P(me, ve, tt) {
- switch (ve.operatorToken.kind) {
- case 43:
- case 42:
- case 44:
- case 45:
- case 48:
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 66:
- case 68:
- case 67:
- case 69:
- case 70:
- case 74:
- case 75:
- case 79:
- case 71:
- case 73:
- case 72:
- case 41:
- case 30:
- case 33:
- case 32:
- case 34:
- const Te = i.getTypeAtLocation(ve.left === me ? ve.right : ve.left);
- Te.flags & 1056 ? he(tt, Te) : tt.isNumber = !0;
- break;
- case 65:
- case 40:
- const we = i.getTypeAtLocation(ve.left === me ? ve.right : ve.left);
- we.flags & 1056 ? he(tt, we) : we.flags & 296 ? tt.isNumber = !0 : we.flags & 402653316 ? tt.isString = !0 : we.flags & 1 || (tt.isNumberOrString = !0);
- break;
- case 64:
- case 35:
- case 37:
- case 38:
- case 36:
- case 77:
- case 78:
- case 76:
- he(tt, i.getTypeAtLocation(ve.left === me ? ve.right : ve.left));
- break;
- case 103:
- me === ve.left && (tt.isString = !0);
- break;
- case 57:
- case 61:
- me === ve.left && (me.parent.parent.kind === 260 || Dl(
- me.parent.parent,
- /*excludeCompoundAssignment*/
- !0
- )) && he(tt, i.getTypeAtLocation(ve.right));
- break;
- }
- }
- function I(me, ve) {
- he(ve, i.getTypeAtLocation(me.parent.parent.expression));
- }
- function F(me, ve) {
- const tt = {
- argumentTypes: [],
- return_: c()
- };
- if (me.arguments)
- for (const Te of me.arguments)
- tt.argumentTypes.push(i.getTypeAtLocation(Te));
- S(me, tt.return_), me.kind === 213 ? (ve.calls || (ve.calls = [])).push(tt) : (ve.constructs || (ve.constructs = [])).push(tt);
- }
- function O(me, ve) {
- const tt = tc(me.name.text);
- ve.properties || (ve.properties = /* @__PURE__ */ new Map());
- const Te = ve.properties.get(tt) || c();
- S(me, Te), ve.properties.set(tt, Te);
- }
- function B(me, ve, tt) {
- if (ve === me.argumentExpression) {
- tt.isNumberOrString = !0;
- return;
- } else {
- const Te = i.getTypeAtLocation(me.argumentExpression), we = c();
- S(me, we), Te.flags & 296 ? tt.numberIndex = we : tt.stringIndex = we;
- }
- }
- function z(me, ve) {
- const tt = ii(me.parent.parent) ? me.parent.parent : me.parent;
- le(ve, i.getTypeAtLocation(tt));
- }
- function X(me, ve) {
- le(ve, i.getTypeAtLocation(me.parent));
- }
- function q(me, ve) {
- const tt = [];
- for (const Te of me)
- for (const { high: we, low: fe } of ve)
- we(Te) && (E.assert(!fe(Te), "Priority can't have both low and high"), tt.push(fe));
- return me.filter((Te) => tt.every((we) => !we(Te)));
- }
- function V(me) {
- return ae(G(me));
- }
- function ae(me) {
- if (!me.length) return i.getAnyType();
- const ve = i.getUnionType([i.getStringType(), i.getNumberType()]);
- let Te = q(me, [
- {
- high: (fe) => fe === i.getStringType() || fe === i.getNumberType(),
- low: (fe) => fe === ve
- },
- {
- high: (fe) => !(fe.flags & 16385),
- low: (fe) => !!(fe.flags & 16385)
- },
- {
- high: (fe) => !(fe.flags & 114689) && !(wn(fe) & 16),
- low: (fe) => !!(wn(fe) & 16)
- }
- ]);
- const we = Te.filter(
- (fe) => wn(fe) & 16
- /* Anonymous */
- );
- return we.length && (Te = Te.filter((fe) => !(wn(fe) & 16)), Te.push(ee(we))), i.getWidenedType(i.getUnionType(
- Te.map(i.getBaseTypeOfLiteralType),
- 2
- /* Subtype */
- ));
- }
- function ee(me) {
- if (me.length === 1)
- return me[0];
- const ve = [], tt = [], Te = [], we = [];
- let fe = !1, Me = !1;
- const Qe = Ip();
- for (const ft of me) {
- for (const Ir of i.getPropertiesOfType(ft))
- Qe.add(Ir.escapedName, Ir.valueDeclaration ? i.getTypeOfSymbolAtLocation(Ir, Ir.valueDeclaration) : i.getAnyType());
- ve.push(...i.getSignaturesOfType(
- ft,
- 0
- /* Call */
- )), tt.push(...i.getSignaturesOfType(
- ft,
- 1
- /* Construct */
- ));
- const Wt = i.getIndexInfoOfType(
- ft,
- 0
- /* String */
- );
- Wt && (Te.push(Wt.type), fe = fe || Wt.isReadonly);
- const _r = i.getIndexInfoOfType(
- ft,
- 1
- /* Number */
- );
- _r && (we.push(_r.type), Me = Me || _r.isReadonly);
- }
- const et = dX(Qe, (ft, Wt) => {
- const _r = Wt.length < me.length ? 16777216 : 0, Ir = i.createSymbol(4 | _r, ft);
- return Ir.links.type = i.getUnionType(Wt), [ft, Ir];
- }), Re = [];
- return Te.length && Re.push(i.createIndexInfo(i.getStringType(), i.getUnionType(Te), fe)), we.length && Re.push(i.createIndexInfo(i.getNumberType(), i.getUnionType(we), Me)), i.createAnonymousType(
- me[0].symbol,
- et,
- ve,
- tt,
- Re
- );
- }
- function G(me) {
- var ve, tt, Te;
- const we = [];
- me.isNumber && we.push(i.getNumberType()), me.isString && we.push(i.getStringType()), me.isNumberOrString && we.push(i.getUnionType([i.getStringType(), i.getNumberType()])), me.numberIndex && we.push(i.createArrayType(V(me.numberIndex))), ((ve = me.properties) != null && ve.size || (tt = me.constructs) != null && tt.length || me.stringIndex) && we.push(ue(me));
- const fe = (me.candidateTypes || []).map((Qe) => i.getBaseTypeOfLiteralType(Qe)), Me = (Te = me.calls) != null && Te.length ? ue(me) : void 0;
- return Me && fe ? we.push(i.getUnionType(
- [Me, ...fe],
- 2
- /* Subtype */
- )) : (Me && we.push(Me), Nr(fe) && we.push(...fe)), we.push(...re(me)), we;
- }
- function ue(me) {
- const ve = /* @__PURE__ */ new Map();
- me.properties && me.properties.forEach((fe, Me) => {
- const Qe = i.createSymbol(4, Me);
- Qe.links.type = V(fe), ve.set(Me, Qe);
- });
- const tt = me.calls ? [_e(me.calls)] : [], Te = me.constructs ? [_e(me.constructs)] : [], we = me.stringIndex ? [i.createIndexInfo(
- i.getStringType(),
- V(me.stringIndex),
- /*isReadonly*/
- !1
- )] : [];
- return i.createAnonymousType(
- /*symbol*/
- void 0,
- ve,
- tt,
- Te,
- we
- );
- }
- function re(me) {
- if (!me.properties || !me.properties.size) return [];
- const ve = o.filter((tt) => ne(tt, me));
- return 0 < ve.length && ve.length < 3 ? ve.map((tt) => ie(tt, me)) : [];
- }
- function ne(me, ve) {
- return ve.properties ? !El(ve.properties, (tt, Te) => {
- const we = i.getTypeOfPropertyOfType(me, Te);
- return we ? tt.calls ? !i.getSignaturesOfType(
- we,
- 0
- /* Call */
- ).length || !i.isTypeAssignableTo(we, oe(tt.calls)) : !i.isTypeAssignableTo(we, V(tt)) : !0;
- }) : !1;
- }
- function ie(me, ve) {
- if (!(wn(me) & 4) || !ve.properties)
- return me;
- const tt = me.target, Te = Qm(tt.typeParameters);
- if (!Te) return me;
- const we = [];
- return ve.properties.forEach((fe, Me) => {
- const Qe = i.getTypeOfPropertyOfType(tt, Me);
- E.assert(!!Qe, "generic should have all the properties of its reference."), we.push(...Se(Qe, V(fe), Te));
- }), s[me.symbol.escapedName](ae(we));
- }
- function Se(me, ve, tt) {
- if (me === tt)
- return [ve];
- if (me.flags & 3145728)
- return ta(me.types, (fe) => Se(fe, ve, tt));
- if (wn(me) & 4 && wn(ve) & 4) {
- const fe = i.getTypeArguments(me), Me = i.getTypeArguments(ve), Qe = [];
- if (fe && Me)
- for (let et = 0; et < fe.length; et++)
- Me[et] && Qe.push(...Se(fe[et], Me[et], tt));
- return Qe;
- }
- const Te = i.getSignaturesOfType(
- me,
- 0
- /* Call */
- ), we = i.getSignaturesOfType(
- ve,
- 0
- /* Call */
- );
- return Te.length === 1 && we.length === 1 ? J(Te[0], we[0], tt) : [];
- }
- function J(me, ve, tt) {
- var Te;
- const we = [];
- for (let Qe = 0; Qe < me.parameters.length; Qe++) {
- const et = me.parameters[Qe], Re = ve.parameters[Qe], ft = me.declaration && rg(me.declaration.parameters[Qe]);
- if (!Re)
- break;
- let Wt = et.valueDeclaration ? i.getTypeOfSymbolAtLocation(et, et.valueDeclaration) : i.getAnyType();
- const _r = ft && i.getElementTypeOfArrayType(Wt);
- _r && (Wt = _r);
- const Ir = ((Te = Wn(Re, Lg)) == null ? void 0 : Te.links.type) || (Re.valueDeclaration ? i.getTypeOfSymbolAtLocation(Re, Re.valueDeclaration) : i.getAnyType());
- we.push(...Se(Wt, Ir, tt));
- }
- const fe = i.getReturnTypeOfSignature(me), Me = i.getReturnTypeOfSignature(ve);
- return we.push(...Se(fe, Me, tt)), we;
- }
- function oe(me) {
- return i.createAnonymousType(
- /*symbol*/
- void 0,
- Js(),
- [_e(me)],
- Ue,
- Ue
- );
- }
- function _e(me) {
- const ve = [], tt = Math.max(...me.map((we) => we.argumentTypes.length));
- for (let we = 0; we < tt; we++) {
- const fe = i.createSymbol(1, tc(`arg${we}`));
- fe.links.type = ae(me.map((Me) => Me.argumentTypes[we] || i.getUndefinedType())), me.some((Me) => Me.argumentTypes[we] === void 0) && (fe.flags |= 16777216), ve.push(fe);
- }
- const Te = V(_(me.map((we) => we.return_)));
- return i.createSignature(
- /*declaration*/
- void 0,
- /*typeParameters*/
- void 0,
- /*thisParameter*/
- void 0,
- ve,
- Te,
- /*typePredicate*/
- void 0,
- tt,
- 0
- /* None */
- );
- }
- function he(me, ve) {
- ve && !(ve.flags & 1) && !(ve.flags & 131072) && (me.candidateTypes || (me.candidateTypes = [])).push(ve);
- }
- function le(me, ve) {
- ve && !(ve.flags & 1) && !(ve.flags & 131072) && (me.candidateThisTypes || (me.candidateThisTypes = [])).push(ve);
- }
- }
- var Zce = "fixReturnTypeInAsyncFunction", QCe = [
- p.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code
- ];
- Ys({
- errorCodes: QCe,
- fixIds: [Zce],
- getCodeActions: function(t) {
- const { sourceFile: n, program: i, span: s } = t, o = i.getTypeChecker(), c = YCe(n, i.getTypeChecker(), s.start);
- if (!c)
- return;
- const { returnTypeNode: _, returnType: u, promisedTypeNode: d, promisedType: g } = c, h = sn.ChangeTracker.with(t, (S) => ZCe(S, n, _, d));
- return [Ls(
- Zce,
- h,
- [p.Replace_0_with_Promise_1, o.typeToString(u), o.typeToString(g)],
- Zce,
- p.Fix_all_incorrect_return_type_of_an_async_functions
- )];
- },
- getAllCodeActions: (e) => Za(e, QCe, (t, n) => {
- const i = YCe(n.file, e.program.getTypeChecker(), n.start);
- i && ZCe(t, n.file, i.returnTypeNode, i.promisedTypeNode);
- })
- });
- function YCe(e, t, n) {
- if (cn(e))
- return;
- const i = xi(e, n), s = or(i, no), o = s?.type;
- if (!o)
- return;
- const c = t.getTypeFromTypeNode(o), _ = t.getAwaitedType(c) || t.getVoidType(), u = t.typeToTypeNode(
- _,
- /*enclosingDeclaration*/
- o,
- /*flags*/
- void 0
- );
- if (u)
- return { returnTypeNode: o, returnType: c, promisedTypeNode: u, promisedType: _ };
- }
- function ZCe(e, t, n, i) {
- e.replaceNode(t, n, A.createTypeReferenceNode("Promise", [i]));
- }
- var KCe = "disableJsDiagnostics", e6e = "disableJsDiagnostics", t6e = Ai(Object.keys(p), (e) => {
- const t = p[e];
- return t.category === 1 ? t.code : void 0;
- });
- Ys({
- errorCodes: t6e,
- getCodeActions: function(t) {
- const { sourceFile: n, program: i, span: s, host: o, formatContext: c } = t;
- if (!cn(n) || !W4(n, i.getCompilerOptions()))
- return;
- const _ = n.checkJsDirective ? "" : jh(o, c.options), u = [
- // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file.
- Rd(
- KCe,
- [GSe(n.fileName, [
- s8(
- n.checkJsDirective ? kc(n.checkJsDirective.pos, n.checkJsDirective.end) : Ul(0, 0),
- `// @ts-nocheck${_}`
- )
- ])],
- p.Disable_checking_for_this_file
- )
- ];
- return sn.isValidLocationToAddComment(n, s.start) && u.unshift(Ls(KCe, sn.ChangeTracker.with(t, (d) => r6e(d, n, s.start)), p.Ignore_this_error_message, e6e, p.Add_ts_ignore_to_all_error_messages)), u;
- },
- fixIds: [e6e],
- getAllCodeActions: (e) => {
- const t = /* @__PURE__ */ new Set();
- return Za(e, t6e, (n, i) => {
- sn.isValidLocationToAddComment(i.file, i.start) && r6e(n, i.file, i.start, t);
- });
- }
- });
- function r6e(e, t, n, i) {
- const { line: s } = Qs(t, n);
- (!i || Xm(i, s)) && e.insertCommentBeforeLine(t, s, n, " @ts-ignore");
- }
- function Kce(e, t, n, i, s, o, c) {
- const _ = e.symbol.members;
- for (const u of t)
- _.has(u.escapedName) || i6e(
- u,
- e,
- n,
- i,
- s,
- o,
- c,
- /*body*/
- void 0
- );
- }
- function F6(e) {
- return {
- trackSymbol: () => !1,
- moduleResolverHost: uV(e.program, e.host)
- };
- }
- var n6e = /* @__PURE__ */ ((e) => (e[e.Method = 1] = "Method", e[e.Property = 2] = "Property", e[e.All = 3] = "All", e))(n6e || {});
- function i6e(e, t, n, i, s, o, c, _, u = 3, d = !1) {
- const g = e.getDeclarations(), h = el(g), S = i.program.getTypeChecker(), T = pa(i.program.getCompilerOptions()), C = h?.kind ?? 171, D = re(e, h), P = h ? Mu(h) : 0;
- let I = P & 256;
- I |= P & 1 ? 1 : P & 4 ? 4 : 0, h && u_(h) && (I |= 512);
- const F = V(), O = S.getWidenedType(S.getTypeOfSymbolAtLocation(e, t)), B = !!(e.flags & 16777216), z = !!(t.flags & 33554432) || d, X = bf(n, s);
- switch (C) {
- case 171:
- case 172:
- let ne = 1;
- ne |= X === 0 ? 268435456 : 0;
- let ie = S.typeToTypeNode(O, t, ne, 8, F6(i));
- if (o) {
- const J = a2(ie, T);
- J && (ie = J.typeNode, OS(o, J.symbols));
- }
- c(A.createPropertyDeclaration(
- F,
- h ? ee(D) : e.getName(),
- B && u & 2 ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- ie,
- /*initializer*/
- void 0
- ));
- break;
- case 177:
- case 178: {
- E.assertIsDefined(g);
- let J = S.typeToTypeNode(
- O,
- t,
- /*flags*/
- void 0,
- /*internalFlags*/
- void 0,
- F6(i)
- );
- const oe = My(g, h), _e = oe.secondAccessor ? [oe.firstAccessor, oe.secondAccessor] : [oe.firstAccessor];
- if (o) {
- const he = a2(J, T);
- he && (J = he.typeNode, OS(o, he.symbols));
- }
- for (const he of _e)
- if (Lf(he))
- c(A.createGetAccessorDeclaration(
- F,
- ee(D),
- Ue,
- ue(J),
- G(_, X, z)
- ));
- else {
- E.assertNode(he, K_, "The counterpart to a getter should be a setter");
- const le = IC(he), me = le && Oe(le.name) ? Nn(le.name) : void 0;
- c(A.createSetAccessorDeclaration(
- F,
- ee(D),
- tle(
- 1,
- [me],
- [ue(J)],
- 1,
- /*inJs*/
- !1
- ),
- G(_, X, z)
- ));
- }
- break;
- }
- case 173:
- case 174:
- E.assertIsDefined(g);
- const Se = O.isUnion() ? ta(O.types, (J) => J.getCallSignatures()) : O.getCallSignatures();
- if (!ut(Se))
- break;
- if (g.length === 1) {
- E.assert(Se.length === 1, "One declaration implies one signature");
- const J = Se[0];
- q(X, J, F, ee(D), G(_, X, z));
- break;
- }
- for (const J of Se)
- J.declaration && J.declaration.flags & 33554432 || q(X, J, F, ee(D));
- if (!z)
- if (g.length > Se.length) {
- const J = S.getSignatureFromDeclaration(g[g.length - 1]);
- q(X, J, F, ee(D), G(_, X));
- } else
- E.assert(g.length === Se.length, "Declarations and signatures should match count"), c(SHe(S, i, t, Se, ee(D), B && !!(u & 1), F, X, _));
- break;
- }
- function q(ne, ie, Se, J, oe) {
- const _e = eH(174, i, ne, ie, oe, J, Se, B && !!(u & 1), t, o);
- _e && c(_e);
- }
- function V() {
- let ne;
- return I && (ne = NT(ne, A.createModifiersFromModifierFlags(I))), ae() && (ne = wr(ne, A.createToken(
- 164
- /* OverrideKeyword */
- ))), ne && A.createNodeArray(ne);
- }
- function ae() {
- return !!(i.program.getCompilerOptions().noImplicitOverride && h && wb(h));
- }
- function ee(ne) {
- return Oe(ne) && ne.escapedText === "constructor" ? A.createComputedPropertyName(A.createStringLiteral(
- Nn(ne),
- X === 0
- /* Single */
- )) : Ja(
- ne,
- /*includeTrivia*/
- !1
- );
- }
- function G(ne, ie, Se) {
- return Se ? void 0 : Ja(
- ne,
- /*includeTrivia*/
- !1
- ) || rle(ie);
- }
- function ue(ne) {
- return Ja(
- ne,
- /*includeTrivia*/
- !1
- );
- }
- function re(ne, ie) {
- if (gc(ne) & 262144) {
- const Se = ne.links.nameType;
- if (Se && up(Se))
- return A.createIdentifier(Ei(_p(Se)));
- }
- return Ja(
- os(ie),
- /*includeTrivia*/
- !1
- );
- }
- }
- function eH(e, t, n, i, s, o, c, _, u, d) {
- const g = t.program, h = g.getTypeChecker(), S = pa(g.getCompilerOptions()), T = cn(u), C = 524545 | (n === 0 ? 268435456 : 0), D = h.signatureToSignatureDeclaration(i, e, u, C, 8, F6(t));
- if (!D)
- return;
- let P = T ? void 0 : D.typeParameters, I = D.parameters, F = T ? void 0 : Ja(D.type);
- if (d) {
- if (P) {
- const X = qc(P, (q) => {
- let V = q.constraint, ae = q.default;
- if (V) {
- const ee = a2(V, S);
- ee && (V = ee.typeNode, OS(d, ee.symbols));
- }
- if (ae) {
- const ee = a2(ae, S);
- ee && (ae = ee.typeNode, OS(d, ee.symbols));
- }
- return A.updateTypeParameterDeclaration(
- q,
- q.modifiers,
- q.name,
- V,
- ae
- );
- });
- P !== X && (P = lt(A.createNodeArray(X, P.hasTrailingComma), P));
- }
- const z = qc(I, (X) => {
- let q = T ? void 0 : X.type;
- if (q) {
- const V = a2(q, S);
- V && (q = V.typeNode, OS(d, V.symbols));
- }
- return A.updateParameterDeclaration(
- X,
- X.modifiers,
- X.dotDotDotToken,
- X.name,
- T ? void 0 : X.questionToken,
- q,
- X.initializer
- );
- });
- if (I !== z && (I = lt(A.createNodeArray(z, I.hasTrailingComma), I)), F) {
- const X = a2(F, S);
- X && (F = X.typeNode, OS(d, X.symbols));
- }
- }
- const O = _ ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0, B = D.asteriskToken;
- if (vo(D))
- return A.updateFunctionExpression(D, c, D.asteriskToken, Wn(o, Oe), P, I, F, s ?? D.body);
- if (Co(D))
- return A.updateArrowFunction(D, c, P, I, F, D.equalsGreaterThanToken, s ?? D.body);
- if (hc(D))
- return A.updateMethodDeclaration(D, c, B, o ?? A.createIdentifier(""), O, P, I, F, s);
- if (Ec(D))
- return A.updateFunctionDeclaration(D, c, D.asteriskToken, Wn(o, Oe), P, I, F, s ?? D.body);
- }
- function ele(e, t, n, i, s, o, c) {
- const _ = bf(t.sourceFile, t.preferences), u = pa(t.program.getCompilerOptions()), d = F6(t), g = t.program.getTypeChecker(), h = cn(c), { typeArguments: S, arguments: T, parent: C } = i, D = h ? void 0 : g.getContextualType(i), P = lr(T, (ae) => Oe(ae) ? ae.text : Cn(ae) && Oe(ae.name) ? ae.name.text : void 0), I = h ? [] : lr(T, (ae) => g.getTypeAtLocation(ae)), { argumentTypeNodes: F, argumentTypeParameters: O } = vHe(
- g,
- n,
- I,
- c,
- u,
- 1,
- 8,
- d
- ), B = o ? A.createNodeArray(A.createModifiersFromModifierFlags(o)) : void 0, z = Q5(C) ? A.createToken(
- 42
- /* AsteriskToken */
- ) : void 0, X = h ? void 0 : yHe(g, O, S), q = tle(
- T.length,
- P,
- F,
- /*minArgumentCount*/
- void 0,
- h
- ), V = h || D === void 0 ? void 0 : g.typeToTypeNode(
- D,
- c,
- /*flags*/
- void 0,
- /*internalFlags*/
- void 0,
- d
- );
- switch (e) {
- case 174:
- return A.createMethodDeclaration(
- B,
- z,
- s,
- /*questionToken*/
- void 0,
- X,
- q,
- V,
- rle(_)
- );
- case 173:
- return A.createMethodSignature(
- B,
- s,
- /*questionToken*/
- void 0,
- X,
- q,
- V === void 0 ? A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- ) : V
- );
- case 262:
- return E.assert(typeof s == "string" || Oe(s), "Unexpected name"), A.createFunctionDeclaration(
- B,
- z,
- s,
- X,
- q,
- V,
- Q9(p.Function_not_implemented.message, _)
- );
- default:
- E.fail("Unexpected kind");
- }
- }
- function yHe(e, t, n) {
- const i = new Set(t.map((o) => o[0])), s = new Map(t);
- if (n) {
- const o = n.filter((_) => !t.some((u) => {
- var d;
- return e.getTypeAtLocation(_) === ((d = u[1]) == null ? void 0 : d.argumentType);
- })), c = i.size + o.length;
- for (let _ = 0; i.size < c; _ += 1)
- i.add(s6e(_));
- }
- return as(
- i.values(),
- (o) => {
- var c;
- return A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- o,
- (c = s.get(o)) == null ? void 0 : c.constraint
- );
- }
- );
- }
- function s6e(e) {
- return 84 + e <= 90 ? String.fromCharCode(84 + e) : `T${e}`;
- }
- function X9(e, t, n, i, s, o, c, _) {
- let u = e.typeToTypeNode(n, i, o, c, _);
- if (u && bm(u)) {
- const d = a2(u, s);
- d && (OS(t, d.symbols), u = d.typeNode);
- }
- return Ja(u);
- }
- function a6e(e, t, n, i, s, o, c, _) {
- let u = e.typePredicateToTypePredicateNode(n, i, o, c, _);
- if (u?.type && bm(u.type)) {
- const d = a2(u.type, s);
- d && (OS(t, d.symbols), u = A.updateTypePredicateNode(u, u.assertsModifier, u.parameterName, d.typeNode));
- }
- return Ja(u);
- }
- function o6e(e) {
- return e.isUnionOrIntersection() ? e.types.some(o6e) : e.flags & 262144;
- }
- function vHe(e, t, n, i, s, o, c, _) {
- const u = [], d = /* @__PURE__ */ new Map();
- for (let g = 0; g < n.length; g += 1) {
- const h = n[g];
- if (h.isUnionOrIntersection() && h.types.some(o6e)) {
- const P = s6e(g);
- u.push(A.createTypeReferenceNode(P)), d.set(P, void 0);
- continue;
- }
- const S = e.getBaseTypeOfLiteralType(h), T = X9(e, t, S, i, s, o, c, _);
- if (!T)
- continue;
- u.push(T);
- const C = c6e(h), D = h.isTypeParameter() && h.constraint && !bHe(h.constraint) ? X9(e, t, h.constraint, i, s, o, c, _) : void 0;
- C && d.set(C, { argumentType: h, constraint: D });
- }
- return { argumentTypeNodes: u, argumentTypeParameters: as(d.entries()) };
- }
- function bHe(e) {
- return e.flags & 524288 && e.objectFlags === 16;
- }
- function c6e(e) {
- var t;
- if (e.flags & 3145728)
- for (const n of e.types) {
- const i = c6e(n);
- if (i)
- return i;
- }
- return e.flags & 262144 ? (t = e.getSymbol()) == null ? void 0 : t.getName() : void 0;
- }
- function tle(e, t, n, i, s) {
- const o = [], c = /* @__PURE__ */ new Map();
- for (let _ = 0; _ < e; _++) {
- const u = t?.[_] || `arg${_}`, d = c.get(u);
- c.set(u, (d || 0) + 1);
- const g = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- /*name*/
- u + (d || ""),
- /*questionToken*/
- i !== void 0 && _ >= i ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- /*type*/
- s ? void 0 : n?.[_] || A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- ),
- /*initializer*/
- void 0
- );
- o.push(g);
- }
- return o;
- }
- function SHe(e, t, n, i, s, o, c, _, u) {
- let d = i[0], g = i[0].minArgumentCount, h = !1;
- for (const D of i)
- g = Math.min(D.minArgumentCount, g), Su(D) && (h = !0), D.parameters.length >= d.parameters.length && (!Su(D) || Su(d)) && (d = D);
- const S = d.parameters.length - (Su(d) ? 1 : 0), T = d.parameters.map((D) => D.name), C = tle(
- S,
- T,
- /*types*/
- void 0,
- g,
- /*inJs*/
- !1
- );
- if (h) {
- const D = A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- A.createToken(
- 26
- /* DotDotDotToken */
- ),
- T[S] || "rest",
- /*questionToken*/
- S >= g ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- A.createArrayTypeNode(A.createKeywordTypeNode(
- 159
- /* UnknownKeyword */
- )),
- /*initializer*/
- void 0
- );
- C.push(D);
- }
- return xHe(
- c,
- s,
- o,
- /*typeParameters*/
- void 0,
- C,
- THe(i, e, t, n),
- _,
- u
- );
- }
- function THe(e, t, n, i) {
- if (Nr(e)) {
- const s = t.getUnionType(lr(e, t.getReturnTypeOfSignature));
- return t.typeToTypeNode(s, i, 1, 8, F6(n));
- }
- }
- function xHe(e, t, n, i, s, o, c, _) {
- return A.createMethodDeclaration(
- e,
- /*asteriskToken*/
- void 0,
- t,
- n ? A.createToken(
- 58
- /* QuestionToken */
- ) : void 0,
- i,
- s,
- o,
- _ || rle(c)
- );
- }
- function rle(e) {
- return Q9(p.Method_not_implemented.message, e);
- }
- function Q9(e, t) {
- return A.createBlock(
- [A.createThrowStatement(
- A.createNewExpression(
- A.createIdentifier("Error"),
- /*typeArguments*/
- void 0,
- // TODO Handle auto quote preference.
- [A.createStringLiteral(
- e,
- /*isSingleQuote*/
- t === 0
- /* Single */
- )]
- )
- )],
- /*multiLine*/
- !0
- );
- }
- function nle(e, t, n) {
- const i = d4(t);
- if (!i) return;
- const s = l6e(i, "compilerOptions");
- if (s === void 0) {
- e.insertNodeAtObjectStart(
- t,
- i,
- sle(
- "compilerOptions",
- A.createObjectLiteralExpression(
- n.map(([c, _]) => sle(c, _)),
- /*multiLine*/
- !0
- )
- )
- );
- return;
- }
- const o = s.initializer;
- if (Ks(o))
- for (const [c, _] of n) {
- const u = l6e(o, c);
- u === void 0 ? e.insertNodeAtObjectStart(t, o, sle(c, _)) : e.replaceNode(t, u.initializer, _);
- }
- }
- function ile(e, t, n, i) {
- nle(e, t, [[n, i]]);
- }
- function sle(e, t) {
- return A.createPropertyAssignment(A.createStringLiteral(e), t);
- }
- function l6e(e, t) {
- return On(e.properties, (n) => Qc(n) && !!n.name && oa(n.name) && n.name.text === t);
- }
- function a2(e, t) {
- let n;
- const i = Ge(e, s, fi);
- if (n && i)
- return { typeNode: i, symbols: n };
- function s(o) {
- if (h0(o) && o.qualifier) {
- const c = E_(o.qualifier);
- if (!c.symbol)
- return br(
- o,
- s,
- /*context*/
- void 0
- );
- const _ = h9(c.symbol, t), u = _ !== c.text ? u6e(o.qualifier, A.createIdentifier(_)) : o.qualifier;
- n = wr(n, c.symbol);
- const d = Fr(o.typeArguments, s, fi);
- return A.createTypeReferenceNode(u, d);
- }
- return br(
- o,
- s,
- /*context*/
- void 0
- );
- }
- }
- function u6e(e, t) {
- return e.kind === 80 ? t : A.createQualifiedName(u6e(e.left, t), e.right);
- }
- function OS(e, t) {
- t.forEach((n) => e.addImportFromExportedSymbol(
- n,
- /*isValidTypeOnlyUseSite*/
- !0
- ));
- }
- function ale(e, t) {
- const n = ec(t);
- let i = xi(e, t.start);
- for (; i.end < n; )
- i = i.parent;
- return i;
- }
- function _6e(e, t, n, i, s, o) {
- const c = d6e(e, t, n, i);
- if (!c || rk.isRefactorErrorInfo(c)) return;
- const _ = sn.ChangeTracker.fromContext(s), { isStatic: u, isReadonly: d, fieldName: g, accessorName: h, originalName: S, type: T, container: C, declaration: D } = c;
- af(g), af(h), af(D), af(C);
- let P, I;
- if (Zn(C)) {
- const O = Mu(D);
- if (Gu(e)) {
- const B = A.createModifiersFromModifierFlags(O);
- P = B, I = B;
- } else
- P = A.createModifiersFromModifierFlags(EHe(O)), I = A.createModifiersFromModifierFlags(DHe(O));
- Vb(D) && (I = Qi(Cy(D), I));
- }
- IHe(_, e, D, T, g, I);
- const F = PHe(g, h, T, P, u, C);
- if (af(F), m6e(_, e, F, D, C), d) {
- const O = Bg(C);
- O && OHe(_, e, O, g.text, S);
- } else {
- const O = wHe(g, h, T, P, u, C);
- af(O), m6e(_, e, O, D, C);
- }
- return _.getChanges();
- }
- function kHe(e) {
- return Oe(e) || oa(e);
- }
- function CHe(e) {
- return G_(e, e.parent) || cs(e) || Qc(e);
- }
- function f6e(e, t) {
- return Oe(t) ? A.createIdentifier(e) : A.createStringLiteral(e);
- }
- function p6e(e, t, n) {
- const i = t ? n.name : A.createThis();
- return Oe(e) ? A.createPropertyAccessExpression(i, e) : A.createElementAccessExpression(i, A.createStringLiteralFromNode(e));
- }
- function EHe(e) {
- return e &= -9, e &= -3, e & 4 || (e |= 1), e;
- }
- function DHe(e) {
- return e &= -2, e &= -5, e |= 2, e;
- }
- function d6e(e, t, n, i, s = !0) {
- const o = xi(e, n), c = n === i && s, _ = or(o.parent, CHe), u = 271;
- if (!_ || !(qF(_.name, e, n, i) || c))
- return {
- error: ms(p.Could_not_find_property_for_which_to_generate_accessor)
- };
- if (!kHe(_.name))
- return {
- error: ms(p.Name_is_not_valid)
- };
- if ((Mu(_) & 98303 | u) !== u)
- return {
- error: ms(p.Can_only_convert_property_with_modifier)
- };
- const d = _.name.text, g = RV(d), h = f6e(g ? d : IS(`_${d}`, e), _.name), S = f6e(g ? IS(d.substring(1), e) : d, _.name);
- return {
- isStatic: tl(_),
- isReadonly: P4(_),
- type: FHe(_, t),
- container: _.kind === 169 ? _.parent.parent : _.parent,
- originalName: _.name.text,
- declaration: _,
- fieldName: h,
- accessorName: S,
- renameAccessor: g
- };
- }
- function PHe(e, t, n, i, s, o) {
- return A.createGetAccessorDeclaration(
- i,
- t,
- [],
- n,
- A.createBlock(
- [
- A.createReturnStatement(
- p6e(e, s, o)
- )
- ],
- /*multiLine*/
- !0
- )
- );
- }
- function wHe(e, t, n, i, s, o) {
- return A.createSetAccessorDeclaration(
- i,
- t,
- [A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- /*dotDotDotToken*/
- void 0,
- A.createIdentifier("value"),
- /*questionToken*/
- void 0,
- n
- )],
- A.createBlock(
- [
- A.createExpressionStatement(
- A.createAssignment(
- p6e(e, s, o),
- A.createIdentifier("value")
- )
- )
- ],
- /*multiLine*/
- !0
- )
- );
- }
- function AHe(e, t, n, i, s, o) {
- const c = A.updatePropertyDeclaration(
- n,
- o,
- s,
- n.questionToken || n.exclamationToken,
- i,
- n.initializer
- );
- e.replaceNode(t, n, c);
- }
- function NHe(e, t, n, i) {
- let s = A.updatePropertyAssignment(n, i, n.initializer);
- (s.modifiers || s.questionToken || s.exclamationToken) && (s === n && (s = A.cloneNode(s)), s.modifiers = void 0, s.questionToken = void 0, s.exclamationToken = void 0), e.replacePropertyAssignment(t, n, s);
- }
- function IHe(e, t, n, i, s, o) {
- cs(n) ? AHe(e, t, n, i, s, o) : Qc(n) ? NHe(e, t, n, s) : e.replaceNode(t, n, A.updateParameterDeclaration(n, o, n.dotDotDotToken, Bs(s, Oe), n.questionToken, n.type, n.initializer));
- }
- function m6e(e, t, n, i, s) {
- G_(i, i.parent) ? e.insertMemberAtStart(t, s, n) : Qc(i) ? e.insertNodeAfterComma(t, i, n) : e.insertNodeAfter(t, i, n);
- }
- function OHe(e, t, n, i, s) {
- n.body && n.body.forEachChild(function o(c) {
- ko(c) && c.expression.kind === 110 && oa(c.argumentExpression) && c.argumentExpression.text === s && ux(c) && e.replaceNode(t, c.argumentExpression, A.createStringLiteral(i)), Cn(c) && c.expression.kind === 110 && c.name.text === s && ux(c) && e.replaceNode(t, c.name, A.createIdentifier(i)), !ys(c) && !Zn(c) && c.forEachChild(o);
- });
- }
- function FHe(e, t) {
- const n = cK(e);
- if (cs(e) && n && e.questionToken) {
- const i = t.getTypeChecker(), s = i.getTypeFromTypeNode(n);
- if (!i.isTypeAssignableTo(i.getUndefinedType(), s)) {
- const o = qy(n) ? n.types : [n];
- return A.createUnionTypeNode([...o, A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- )]);
- }
- }
- return n;
- }
- function ole(e, t) {
- const n = [];
- for (; e; ) {
- const i = Cb(e), s = i && t.getSymbolAtLocation(i.expression);
- if (!s) break;
- const o = s.flags & 2097152 ? t.getAliasedSymbol(s) : s, c = o.declarations && On(o.declarations, Zn);
- if (!c) break;
- n.push(c), e = c;
- }
- return n;
- }
- var g6e = "invalidImportSyntax";
- function LHe(e, t) {
- const n = Tr(t), i = kC(t), s = e.program.getCompilerOptions(), o = [];
- return o.push(h6e(e, n, t, t1(
- i.name,
- /*namedImports*/
- void 0,
- t.moduleSpecifier,
- bf(n, e.preferences)
- ))), Ru(s) === 1 && o.push(h6e(
- e,
- n,
- t,
- A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- i.name,
- A.createExternalModuleReference(t.moduleSpecifier)
- )
- )), o;
- }
- function h6e(e, t, n, i) {
- const s = sn.ChangeTracker.with(e, (o) => o.replaceNode(t, n, i));
- return Rd(g6e, s, [p.Replace_import_with_0, s[0].textChanges[0].newText]);
- }
- Ys({
- errorCodes: [
- p.This_expression_is_not_callable.code,
- p.This_expression_is_not_constructable.code
- ],
- getCodeActions: MHe
- });
- function MHe(e) {
- const t = e.sourceFile, n = p.This_expression_is_not_callable.code === e.errorCode ? 213 : 214, i = or(xi(t, e.span.start), (o) => o.kind === n);
- if (!i)
- return [];
- const s = i.expression;
- return y6e(e, s);
- }
- Ys({
- errorCodes: [
- // The following error codes cover pretty much all assignability errors that could involve an expression
- p.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
- p.Type_0_does_not_satisfy_the_constraint_1.code,
- p.Type_0_is_not_assignable_to_type_1.code,
- p.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,
- p.Type_predicate_0_is_not_assignable_to_1.code,
- p.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,
- p._0_index_type_1_is_not_assignable_to_2_index_type_3.code,
- p.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,
- p.Property_0_in_type_1_is_not_assignable_to_type_2.code,
- p.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,
- p.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code
- ],
- getCodeActions: RHe
- });
- function RHe(e) {
- const t = e.sourceFile, n = or(xi(t, e.span.start), (i) => i.getStart() === e.span.start && i.getEnd() === e.span.start + e.span.length);
- return n ? y6e(e, n) : [];
- }
- function y6e(e, t) {
- const n = e.program.getTypeChecker().getTypeAtLocation(t);
- if (!(n.symbol && Lg(n.symbol) && n.symbol.links.originatingImport))
- return [];
- const i = [], s = n.symbol.links.originatingImport;
- if (hf(s) || Fn(i, LHe(e, s)), _t(t) && !(Vl(t.parent) && t.parent.name === t)) {
- const o = e.sourceFile, c = sn.ChangeTracker.with(e, (_) => _.replaceNode(o, t, A.createPropertyAccessExpression(t, "default"), {}));
- i.push(Rd(g6e, c, p.Use_synthetic_default_member));
- }
- return i;
- }
- var cle = "strictClassInitialization", lle = "addMissingPropertyDefiniteAssignmentAssertions", ule = "addMissingPropertyUndefinedType", _le = "addMissingPropertyInitializer", v6e = [p.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];
- Ys({
- errorCodes: v6e,
- getCodeActions: function(t) {
- const n = b6e(t.sourceFile, t.span.start);
- if (!n) return;
- const i = [];
- return wr(i, BHe(t, n)), wr(i, jHe(t, n)), wr(i, JHe(t, n)), i;
- },
- fixIds: [lle, ule, _le],
- getAllCodeActions: (e) => Za(e, v6e, (t, n) => {
- const i = b6e(n.file, n.start);
- if (i)
- switch (e.fixId) {
- case lle:
- S6e(t, n.file, i.prop);
- break;
- case ule:
- T6e(t, n.file, i);
- break;
- case _le:
- const s = e.program.getTypeChecker(), o = k6e(s, i.prop);
- if (!o) return;
- x6e(t, n.file, i.prop, o);
- break;
- default:
- E.fail(JSON.stringify(e.fixId));
- }
- })
- });
- function b6e(e, t) {
- const n = xi(e, t);
- if (Oe(n) && cs(n.parent)) {
- const i = Gc(n.parent);
- if (i)
- return { type: i, prop: n.parent, isJs: cn(n.parent) };
- }
- }
- function jHe(e, t) {
- if (t.isJs) return;
- const n = sn.ChangeTracker.with(e, (i) => S6e(i, e.sourceFile, t.prop));
- return Ls(cle, n, [p.Add_definite_assignment_assertion_to_property_0, t.prop.getText()], lle, p.Add_definite_assignment_assertions_to_all_uninitialized_properties);
- }
- function S6e(e, t, n) {
- af(n);
- const i = A.updatePropertyDeclaration(
- n,
- n.modifiers,
- n.name,
- A.createToken(
- 54
- /* ExclamationToken */
- ),
- n.type,
- n.initializer
- );
- e.replaceNode(t, n, i);
- }
- function BHe(e, t) {
- const n = sn.ChangeTracker.with(e, (i) => T6e(i, e.sourceFile, t));
- return Ls(cle, n, [p.Add_undefined_type_to_property_0, t.prop.name.getText()], ule, p.Add_undefined_type_to_all_uninitialized_properties);
- }
- function T6e(e, t, n) {
- const i = A.createKeywordTypeNode(
- 157
- /* UndefinedKeyword */
- ), s = qy(n.type) ? n.type.types.concat(i) : [n.type, i], o = A.createUnionTypeNode(s);
- n.isJs ? e.addJSDocTags(t, n.prop, [A.createJSDocTypeTag(
- /*tagName*/
- void 0,
- A.createJSDocTypeExpression(o)
- )]) : e.replaceNode(t, n.type, o);
- }
- function JHe(e, t) {
- if (t.isJs) return;
- const n = e.program.getTypeChecker(), i = k6e(n, t.prop);
- if (!i) return;
- const s = sn.ChangeTracker.with(e, (o) => x6e(o, e.sourceFile, t.prop, i));
- return Ls(cle, s, [p.Add_initializer_to_property_0, t.prop.name.getText()], _le, p.Add_initializers_to_all_uninitialized_properties);
- }
- function x6e(e, t, n, i) {
- af(n);
- const s = A.updatePropertyDeclaration(
- n,
- n.modifiers,
- n.name,
- n.questionToken,
- n.type,
- i
- );
- e.replaceNode(t, n, s);
- }
- function k6e(e, t) {
- return C6e(e, e.getTypeFromTypeNode(t.type));
- }
- function C6e(e, t) {
- if (t.flags & 512)
- return t === e.getFalseType() || t === e.getFalseType(
- /*fresh*/
- !0
- ) ? A.createFalse() : A.createTrue();
- if (t.isStringLiteral())
- return A.createStringLiteral(t.value);
- if (t.isNumberLiteral())
- return A.createNumericLiteral(t.value);
- if (t.flags & 2048)
- return A.createBigIntLiteral(t.value);
- if (t.isUnion())
- return Tc(t.types, (n) => C6e(e, n));
- if (t.isClass()) {
- const n = Ah(t.symbol);
- if (!n || Gn(
- n,
- 64
- /* Abstract */
- )) return;
- const i = Bg(n);
- return i && i.parameters.length ? void 0 : A.createNewExpression(
- A.createIdentifier(t.symbol.name),
- /*typeArguments*/
- void 0,
- /*argumentsArray*/
- void 0
- );
- } else if (e.isArrayLikeType(t))
- return A.createArrayLiteralExpression();
- }
- var fle = "requireInTs", E6e = [p.require_call_may_be_converted_to_an_import.code];
- Ys({
- errorCodes: E6e,
- getCodeActions(e) {
- const t = P6e(e.sourceFile, e.program, e.span.start, e.preferences);
- if (!t)
- return;
- const n = sn.ChangeTracker.with(e, (i) => D6e(i, e.sourceFile, t));
- return [Ls(fle, n, p.Convert_require_to_import, fle, p.Convert_all_require_to_import)];
- },
- fixIds: [fle],
- getAllCodeActions: (e) => Za(e, E6e, (t, n) => {
- const i = P6e(n.file, e.program, n.start, e.preferences);
- i && D6e(t, e.sourceFile, i);
- })
- });
- function D6e(e, t, n) {
- const { allowSyntheticDefaults: i, defaultImportName: s, namedImports: o, statement: c, moduleSpecifier: _ } = n;
- e.replaceNode(
- t,
- c,
- s && !i ? A.createImportEqualsDeclaration(
- /*modifiers*/
- void 0,
- /*isTypeOnly*/
- !1,
- s,
- A.createExternalModuleReference(_)
- ) : A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.createImportClause(
- /*isTypeOnly*/
- !1,
- s,
- o
- ),
- _,
- /*attributes*/
- void 0
- )
- );
- }
- function P6e(e, t, n, i) {
- const { parent: s } = xi(e, n);
- f_(
- s,
- /*requireStringLiteralLikeArgument*/
- !0
- ) || E.failBadSyntaxKind(s);
- const o = Bs(s.parent, ii), c = bf(e, i), _ = Wn(o.name, Oe), u = Mf(o.name) ? zHe(o.name) : void 0;
- if (_ || u) {
- const d = xa(s.arguments);
- return {
- allowSyntheticDefaults: mx(t.getCompilerOptions()),
- defaultImportName: _,
- namedImports: u,
- statement: Bs(o.parent.parent, yc),
- moduleSpecifier: fS(d) ? A.createStringLiteral(
- d.text,
- c === 0
- /* Single */
- ) : d
- };
- }
- }
- function zHe(e) {
- const t = [];
- for (const n of e.elements) {
- if (!Oe(n.name) || n.initializer)
- return;
- t.push(A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- Wn(n.propertyName, Oe),
- n.name
- ));
- }
- if (t.length)
- return A.createNamedImports(t);
- }
- var ple = "useDefaultImport", w6e = [p.Import_may_be_converted_to_a_default_import.code];
- Ys({
- errorCodes: w6e,
- getCodeActions(e) {
- const { sourceFile: t, span: { start: n } } = e, i = A6e(t, n);
- if (!i) return;
- const s = sn.ChangeTracker.with(e, (o) => N6e(o, t, i, e.preferences));
- return [Ls(ple, s, p.Convert_to_default_import, ple, p.Convert_all_to_default_imports)];
- },
- fixIds: [ple],
- getAllCodeActions: (e) => Za(e, w6e, (t, n) => {
- const i = A6e(n.file, n.start);
- i && N6e(t, n.file, i, e.preferences);
- })
- });
- function A6e(e, t) {
- const n = xi(e, t);
- if (!Oe(n)) return;
- const { parent: i } = n;
- if (gl(i) && Fh(i.moduleReference))
- return { importNode: i, name: n, moduleSpecifier: i.moduleReference.expression };
- if (Hg(i) && ic(i.parent.parent)) {
- const s = i.parent.parent;
- return { importNode: s, name: n, moduleSpecifier: s.moduleSpecifier };
- }
- }
- function N6e(e, t, n, i) {
- e.replaceNode(t, n.importNode, t1(
- n.name,
- /*namedImports*/
- void 0,
- n.moduleSpecifier,
- bf(t, i)
- ));
- }
- var dle = "useBigintLiteral", I6e = [
- p.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code
- ];
- Ys({
- errorCodes: I6e,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => O6e(i, t.sourceFile, t.span));
- if (n.length > 0)
- return [Ls(dle, n, p.Convert_to_a_bigint_numeric_literal, dle, p.Convert_all_to_bigint_numeric_literals)];
- },
- fixIds: [dle],
- getAllCodeActions: (e) => Za(e, I6e, (t, n) => O6e(t, n.file, n))
- });
- function O6e(e, t, n) {
- const i = Wn(xi(t, n.start), d_);
- if (!i)
- return;
- const s = i.getText(t) + "n";
- e.replaceNode(t, i, A.createBigIntLiteral(s));
- }
- var WHe = "fixAddModuleReferTypeMissingTypeof", mle = WHe, F6e = [p.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];
- Ys({
- errorCodes: F6e,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = L6e(n, i.start), o = sn.ChangeTracker.with(t, (c) => M6e(c, n, s));
- return [Ls(mle, o, p.Add_missing_typeof, mle, p.Add_missing_typeof)];
- },
- fixIds: [mle],
- getAllCodeActions: (e) => Za(e, F6e, (t, n) => M6e(t, e.sourceFile, L6e(n.file, n.start)))
- });
- function L6e(e, t) {
- const n = xi(e, t);
- return E.assert(n.kind === 102, "This token should be an ImportKeyword"), E.assert(n.parent.kind === 205, "Token parent should be an ImportType"), n.parent;
- }
- function M6e(e, t, n) {
- const i = A.updateImportTypeNode(
- n,
- n.argument,
- n.attributes,
- n.qualifier,
- n.typeArguments,
- /*isTypeOf*/
- !0
- );
- e.replaceNode(t, n, i);
- }
- var gle = "wrapJsxInFragment", R6e = [p.JSX_expressions_must_have_one_parent_element.code];
- Ys({
- errorCodes: R6e,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = j6e(n, i.start);
- if (!s) return;
- const o = sn.ChangeTracker.with(t, (c) => B6e(c, n, s));
- return [Ls(gle, o, p.Wrap_in_JSX_fragment, gle, p.Wrap_all_unparented_JSX_in_JSX_fragment)];
- },
- fixIds: [gle],
- getAllCodeActions: (e) => Za(e, R6e, (t, n) => {
- const i = j6e(e.sourceFile, n.start);
- i && B6e(t, e.sourceFile, i);
- })
- });
- function j6e(e, t) {
- let s = xi(e, t).parent.parent;
- if (!(!dn(s) && (s = s.parent, !dn(s))) && rc(s.operatorToken))
- return s;
- }
- function B6e(e, t, n) {
- const i = UHe(n);
- i && e.replaceNode(t, n, A.createJsxFragment(A.createJsxOpeningFragment(), i, A.createJsxJsxClosingFragment()));
- }
- function UHe(e) {
- const t = [];
- let n = e;
- for (; ; )
- if (dn(n) && rc(n.operatorToken) && n.operatorToken.kind === 28) {
- if (t.push(n.left), Mw(n.right))
- return t.push(n.right), t;
- if (dn(n.right)) {
- n = n.right;
- continue;
- } else return;
- } else return;
- }
- var hle = "wrapDecoratorInParentheses", J6e = [p.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];
- Ys({
- errorCodes: J6e,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => z6e(i, t.sourceFile, t.span.start));
- return [Ls(hle, n, p.Wrap_in_parentheses, hle, p.Wrap_all_invalid_decorator_expressions_in_parentheses)];
- },
- fixIds: [hle],
- getAllCodeActions: (e) => Za(e, J6e, (t, n) => z6e(t, n.file, n.start))
- });
- function z6e(e, t, n) {
- const i = xi(t, n), s = or(i, dl);
- E.assert(!!s, "Expected position to be owned by a decorator.");
- const o = A.createParenthesizedExpression(s.expression);
- e.replaceNode(t, s.expression, o);
- }
- var yle = "fixConvertToMappedObjectType", W6e = [p.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
- Ys({
- errorCodes: W6e,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i } = t, s = U6e(n, i.start);
- if (!s) return;
- const o = sn.ChangeTracker.with(t, (_) => V6e(_, n, s)), c = Nn(s.container.name);
- return [Ls(yle, o, [p.Convert_0_to_mapped_object_type, c], yle, [p.Convert_0_to_mapped_object_type, c])];
- },
- fixIds: [yle],
- getAllCodeActions: (e) => Za(e, W6e, (t, n) => {
- const i = U6e(n.file, n.start);
- i && V6e(t, n.file, i);
- })
- });
- function U6e(e, t) {
- const n = xi(e, t), i = Wn(n.parent.parent, Fb);
- if (!i) return;
- const s = Xl(i.parent) ? i.parent : Wn(i.parent.parent, Vp);
- if (s)
- return { indexSignature: i, container: s };
- }
- function VHe(e, t) {
- return A.createTypeAliasDeclaration(e.modifiers, e.name, e.typeParameters, t);
- }
- function V6e(e, t, { indexSignature: n, container: i }) {
- const o = (Xl(i) ? i.members : i.type.members).filter((g) => !Fb(g)), c = xa(n.parameters), _ = A.createTypeParameterDeclaration(
- /*modifiers*/
- void 0,
- Bs(c.name, Oe),
- c.type
- ), u = A.createMappedTypeNode(
- P4(n) ? A.createModifier(
- 148
- /* ReadonlyKeyword */
- ) : void 0,
- _,
- /*nameType*/
- void 0,
- n.questionToken,
- n.type,
- /*members*/
- void 0
- ), d = A.createIntersectionTypeNode([
- ...T4(i),
- u,
- ...o.length ? [A.createTypeLiteralNode(o)] : Ue
- ]);
- e.replaceNode(t, i, VHe(i, d));
- }
- var q6e = "removeAccidentalCallParentheses", qHe = [
- p.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code
- ];
- Ys({
- errorCodes: qHe,
- getCodeActions(e) {
- const t = or(xi(e.sourceFile, e.span.start), Fs);
- if (!t)
- return;
- const n = sn.ChangeTracker.with(e, (i) => {
- i.deleteRange(e.sourceFile, { pos: t.expression.end, end: t.end });
- });
- return [Rd(q6e, n, p.Remove_parentheses)];
- },
- fixIds: [q6e]
- });
- var vle = "removeUnnecessaryAwait", H6e = [
- p.await_has_no_effect_on_the_type_of_this_expression.code
- ];
- Ys({
- errorCodes: H6e,
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => G6e(i, t.sourceFile, t.span));
- if (n.length > 0)
- return [Ls(vle, n, p.Remove_unnecessary_await, vle, p.Remove_all_unnecessary_uses_of_await)];
- },
- fixIds: [vle],
- getAllCodeActions: (e) => Za(e, H6e, (t, n) => G6e(t, n.file, n))
- });
- function G6e(e, t, n) {
- const i = Wn(
- xi(t, n.start),
- (_) => _.kind === 135
- /* AwaitKeyword */
- ), s = i && Wn(i.parent, Hy);
- if (!s)
- return;
- let o = s;
- if (Yu(s.parent)) {
- const _ = MC(
- s.expression,
- /*stopAtCallExpressions*/
- !1
- );
- if (Oe(_)) {
- const u = sl(s.parent.pos, t);
- u && u.kind !== 105 && (o = s.parent);
- }
- }
- e.replaceNode(t, o, s.expression);
- }
- var $6e = [p.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code], ble = "splitTypeOnlyImport";
- Ys({
- errorCodes: $6e,
- fixIds: [ble],
- getCodeActions: function(t) {
- const n = sn.ChangeTracker.with(t, (i) => Q6e(i, X6e(t.sourceFile, t.span), t));
- if (n.length)
- return [Ls(ble, n, p.Split_into_two_separate_import_declarations, ble, p.Split_all_invalid_type_only_imports)];
- },
- getAllCodeActions: (e) => Za(e, $6e, (t, n) => {
- Q6e(t, X6e(e.sourceFile, n), e);
- })
- });
- function X6e(e, t) {
- return or(xi(e, t.start), ic);
- }
- function Q6e(e, t, n) {
- if (!t)
- return;
- const i = E.checkDefined(t.importClause);
- e.replaceNode(
- n.sourceFile,
- t,
- A.updateImportDeclaration(
- t,
- t.modifiers,
- A.updateImportClause(
- i,
- i.isTypeOnly,
- i.name,
- /*namedBindings*/
- void 0
- ),
- t.moduleSpecifier,
- t.attributes
- )
- ), e.insertNodeAfter(
- n.sourceFile,
- t,
- A.createImportDeclaration(
- /*modifiers*/
- void 0,
- A.updateImportClause(
- i,
- i.isTypeOnly,
- /*name*/
- void 0,
- i.namedBindings
- ),
- t.moduleSpecifier,
- t.attributes
- )
- );
- }
- var Sle = "fixConvertConstToLet", Y6e = [p.Cannot_assign_to_0_because_it_is_a_constant.code];
- Ys({
- errorCodes: Y6e,
- getCodeActions: function(t) {
- const { sourceFile: n, span: i, program: s } = t, o = Z6e(n, i.start, s);
- if (o === void 0) return;
- const c = sn.ChangeTracker.with(t, (_) => K6e(_, n, o.token));
- return [Foe(Sle, c, p.Convert_const_to_let, Sle, p.Convert_all_const_to_let)];
- },
- getAllCodeActions: (e) => {
- const { program: t } = e, n = /* @__PURE__ */ new Map();
- return ik(sn.ChangeTracker.with(e, (i) => {
- sk(e, Y6e, (s) => {
- const o = Z6e(s.file, s.start, t);
- if (o && zp(n, na(o.symbol)))
- return K6e(i, s.file, o.token);
- });
- }));
- },
- fixIds: [Sle]
- });
- function Z6e(e, t, n) {
- var i;
- const o = n.getTypeChecker().getSymbolAtLocation(xi(e, t));
- if (o === void 0) return;
- const c = Wn((i = o?.valueDeclaration) == null ? void 0 : i.parent, Fl);
- if (c === void 0) return;
- const _ = Ya(c, 87, e);
- if (_ !== void 0)
- return { symbol: o, token: _ };
- }
- function K6e(e, t, n) {
- e.replaceNode(t, n, A.createToken(
- 121
- /* LetKeyword */
- ));
- }
- var Tle = "fixExpectedComma", HHe = p._0_expected.code, eEe = [HHe];
- Ys({
- errorCodes: eEe,
- getCodeActions(e) {
- const { sourceFile: t } = e, n = tEe(t, e.span.start, e.errorCode);
- if (!n) return;
- const i = sn.ChangeTracker.with(e, (s) => rEe(s, t, n));
- return [Ls(
- Tle,
- i,
- [p.Change_0_to_1, ";", ","],
- Tle,
- [p.Change_0_to_1, ";", ","]
- )];
- },
- fixIds: [Tle],
- getAllCodeActions: (e) => Za(e, eEe, (t, n) => {
- const i = tEe(n.file, n.start, n.code);
- i && rEe(t, e.sourceFile, i);
- })
- });
- function tEe(e, t, n) {
- const i = xi(e, t);
- return i.kind === 27 && i.parent && (Ks(i.parent) || $l(i.parent)) ? { node: i } : void 0;
- }
- function rEe(e, t, { node: n }) {
- const i = A.createToken(
- 28
- /* CommaToken */
- );
- e.replaceNode(t, n, i);
- }
- var GHe = "addVoidToPromise", nEe = "addVoidToPromise", iEe = [
- p.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,
- p.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code
- ];
- Ys({
- errorCodes: iEe,
- fixIds: [nEe],
- getCodeActions(e) {
- const t = sn.ChangeTracker.with(e, (n) => sEe(n, e.sourceFile, e.span, e.program));
- if (t.length > 0)
- return [Ls(GHe, t, p.Add_void_to_Promise_resolved_without_a_value, nEe, p.Add_void_to_all_Promises_resolved_without_a_value)];
- },
- getAllCodeActions(e) {
- return Za(e, iEe, (t, n) => sEe(t, n.file, n, e.program, /* @__PURE__ */ new Set()));
- }
- });
- function sEe(e, t, n, i, s) {
- const o = xi(t, n.start);
- if (!Oe(o) || !Fs(o.parent) || o.parent.expression !== o || o.parent.arguments.length !== 0) return;
- const c = i.getTypeChecker(), _ = c.getSymbolAtLocation(o), u = _?.valueDeclaration;
- if (!u || !Ii(u) || !jb(u.parent.parent) || s?.has(u)) return;
- s?.add(u);
- const d = $He(u.parent.parent);
- if (ut(d)) {
- const g = d[0], h = !qy(g) && !dS(g) && dS(A.createUnionTypeNode([g, A.createKeywordTypeNode(
- 116
- /* VoidKeyword */
- )]).types[0]);
- h && e.insertText(t, g.pos, "("), e.insertText(t, g.end, h ? ") | void" : " | void");
- } else {
- const g = c.getResolvedSignature(o.parent), h = g?.parameters[0], S = h && c.getTypeOfSymbolAtLocation(h, u.parent.parent);
- cn(u) ? (!S || S.flags & 3) && (e.insertText(t, u.parent.parent.end, ")"), e.insertText(t, aa(t.text, u.parent.parent.pos), "/** @type {Promise} */(")) : (!S || S.flags & 2) && e.insertText(t, u.parent.parent.expression.end, "");
- }
- }
- function $He(e) {
- var t;
- if (cn(e)) {
- if (Yu(e.parent)) {
- const n = (t = V1(e.parent)) == null ? void 0 : t.typeExpression.type;
- if (n && vf(n) && Oe(n.typeName) && Nn(n.typeName) === "Promise")
- return n.typeArguments;
- }
- } else
- return e.typeArguments;
- }
- var ck = {};
- La(ck, {
- CompletionKind: () => xEe,
- CompletionSource: () => oEe,
- SortText: () => ku,
- StringCompletions: () => _H,
- SymbolOriginInfoKind: () => cEe,
- createCompletionDetails: () => K9,
- createCompletionDetailsForSymbol: () => Ale,
- getCompletionEntriesFromSymbols: () => Ple,
- getCompletionEntryDetails: () => CGe,
- getCompletionEntrySymbol: () => DGe,
- getCompletionsAtPosition: () => rGe,
- getDefaultCommitCharacters: () => FS,
- getPropertiesForObjectExpression: () => cH,
- moduleSpecifierResolutionCacheAttemptLimit: () => aEe,
- moduleSpecifierResolutionLimit: () => xle
- });
- var xle = 100, aEe = 1e3, ku = {
- // Presets
- LocalDeclarationPriority: "10",
- LocationPriority: "11",
- OptionalMember: "12",
- MemberDeclaredBySpreadAssignment: "13",
- SuggestedClassMembers: "14",
- GlobalsOrKeywords: "15",
- AutoImportSuggestions: "16",
- ClassMemberSnippets: "17",
- JavascriptIdentifiers: "18",
- // Transformations
- Deprecated(e) {
- return "z" + e;
- },
- ObjectLiteralProperty(e, t) {
- return `${e}\0${t}\0`;
- },
- SortBelow(e) {
- return e + "1";
- }
- }, oEe = /* @__PURE__ */ ((e) => (e.ThisProperty = "ThisProperty/", e.ClassMemberSnippet = "ClassMemberSnippet/", e.TypeOnlyAlias = "TypeOnlyAlias/", e.ObjectLiteralMethodSnippet = "ObjectLiteralMethodSnippet/", e.SwitchCases = "SwitchCases/", e.ObjectLiteralMemberWithComma = "ObjectLiteralMemberWithComma/", e))(oEe || {}), cEe = /* @__PURE__ */ ((e) => (e[e.ThisType = 1] = "ThisType", e[e.SymbolMember = 2] = "SymbolMember", e[e.Export = 4] = "Export", e[e.Promise = 8] = "Promise", e[e.Nullable = 16] = "Nullable", e[e.ResolvedExport = 32] = "ResolvedExport", e[e.TypeOnlyAlias = 64] = "TypeOnlyAlias", e[e.ObjectLiteralMethod = 128] = "ObjectLiteralMethod", e[e.Ignore = 256] = "Ignore", e[e.ComputedPropertyName = 512] = "ComputedPropertyName", e[
- e.SymbolMemberNoExport = 2
- /* SymbolMember */
- ] = "SymbolMemberNoExport", e[e.SymbolMemberExport = 6] = "SymbolMemberExport", e))(cEe || {});
- function XHe(e) {
- return !!(e.kind & 1);
- }
- function QHe(e) {
- return !!(e.kind & 2);
- }
- function Y9(e) {
- return !!(e && e.kind & 4);
- }
- function uP(e) {
- return !!(e && e.kind === 32);
- }
- function YHe(e) {
- return Y9(e) || uP(e) || kle(e);
- }
- function ZHe(e) {
- return (Y9(e) || uP(e)) && !!e.isFromPackageJson;
- }
- function KHe(e) {
- return !!(e.kind & 8);
- }
- function eGe(e) {
- return !!(e.kind & 16);
- }
- function lEe(e) {
- return !!(e && e.kind & 64);
- }
- function uEe(e) {
- return !!(e && e.kind & 128);
- }
- function tGe(e) {
- return !!(e && e.kind & 256);
- }
- function kle(e) {
- return !!(e && e.kind & 512);
- }
- function _Ee(e, t, n, i, s, o, c, _, u) {
- var d, g, h, S;
- const T = lo(), C = c || M3(i.getCompilerOptions()) || ((d = o.autoImportSpecifierExcludeRegexes) == null ? void 0 : d.length);
- let D = !1, P = 0, I = 0, F = 0, O = 0;
- const B = u({
- tryResolve: X,
- skippedAny: () => D,
- resolvedAny: () => I > 0,
- resolvedBeyondLimit: () => I > xle
- }), z = O ? ` (${(F / O * 100).toFixed(1)}% hit rate)` : "";
- return (g = t.log) == null || g.call(t, `${e}: resolved ${I} module specifiers, plus ${P} ambient and ${F} from cache${z}`), (h = t.log) == null || h.call(t, `${e}: response is ${D ? "incomplete" : "complete"}`), (S = t.log) == null || S.call(t, `${e}: ${lo() - T}`), B;
- function X(q, V) {
- if (V) {
- const ue = n.getModuleSpecifierForBestExportInfo(q, s, _);
- return ue && P++, ue || "failed";
- }
- const ae = C || o.allowIncompleteCompletions && I < xle, ee = !ae && o.allowIncompleteCompletions && O < aEe, G = ae || ee ? n.getModuleSpecifierForBestExportInfo(q, s, _, ee) : void 0;
- return (!ae && !ee || ee && !G) && (D = !0), I += G?.computedWithoutCacheCount || 0, F += q.length - (G?.computedWithoutCacheCount || 0), ee && O++, G || (C ? "failed" : "skipped");
- }
- }
- function FS(e) {
- return e ? [] : [".", ",", ";"];
- }
- function rGe(e, t, n, i, s, o, c, _, u, d, g = !1) {
- var h;
- const { previousToken: S } = iH(s, i);
- if (c && !Qx(i, s, S) && !jGe(i, c, S, s))
- return;
- if (c === " ")
- return o.includeCompletionsForImportStatements && o.includeCompletionsWithInsertText ? {
- isGlobalCompletion: !0,
- isMemberCompletion: !1,
- isNewIdentifierLocation: !0,
- isIncomplete: !0,
- entries: [],
- defaultCommitCharacters: FS(
- /*isNewIdentifierLocation*/
- !0
- )
- } : void 0;
- const T = t.getCompilerOptions(), C = t.getTypeChecker(), D = o.allowIncompleteCompletions ? (h = e.getIncompleteCompletionsCache) == null ? void 0 : h.call(e) : void 0;
- if (D && _ === 3 && S && Oe(S)) {
- const F = nGe(D, i, S, t, e, o, u, s);
- if (F)
- return F;
- } else
- D?.clear();
- const P = _H.getStringLiteralCompletions(i, s, S, T, e, t, n, o, g);
- if (P)
- return P;
- if (S && t4(S.parent) && (S.kind === 83 || S.kind === 88 || S.kind === 80))
- return xGe(S.parent);
- const I = kEe(
- t,
- n,
- i,
- T,
- s,
- o,
- /*detailsEntryId*/
- void 0,
- e,
- d,
- u
- );
- if (I)
- switch (I.kind) {
- case 0:
- const F = cGe(i, e, t, T, n, I, o, d, s, g);
- return F?.isIncomplete && D?.set(F), F;
- case 1:
- return Cle([
- ...wv.getJSDocTagNameCompletions(),
- ...pEe(
- i,
- s,
- C,
- T,
- o,
- /*tagNameOnly*/
- !0
- )
- ]);
- case 2:
- return Cle([
- ...wv.getJSDocTagCompletions(),
- ...pEe(
- i,
- s,
- C,
- T,
- o,
- /*tagNameOnly*/
- !1
- )
- ]);
- case 3:
- return Cle(wv.getJSDocParameterNameCompletions(I.tag));
- case 4:
- return aGe(I.keywordCompletions, I.isNewIdentifierLocation);
- default:
- return E.assertNever(I);
- }
- }
- function Z9(e, t) {
- var n, i;
- let s = aw(e.sortText, t.sortText);
- return s === 0 && (s = aw(e.name, t.name)), s === 0 && ((n = e.data) != null && n.moduleSpecifier) && ((i = t.data) != null && i.moduleSpecifier) && (s = z3(
- e.data.moduleSpecifier,
- t.data.moduleSpecifier
- )), s === 0 ? -1 : s;
- }
- function fEe(e) {
- return !!e?.moduleSpecifier;
- }
- function nGe(e, t, n, i, s, o, c, _) {
- const u = e.get();
- if (!u) return;
- const d = h_(t, _), g = n.text.toLowerCase(), h = S8(t, s, i, o, c), S = _Ee(
- "continuePreviousIncompleteResponse",
- s,
- xu.createImportSpecifierResolver(t, i, s, o),
- i,
- n.getStart(),
- o,
- /*isForImportStatementCompletion*/
- !1,
- av(n),
- (T) => {
- const C = Ai(u.entries, (D) => {
- var P;
- if (!D.hasAction || !D.source || !D.data || fEe(D.data))
- return D;
- if (!BEe(D.name, g))
- return;
- const { origin: I } = E.checkDefined(CEe(D.name, D.data, i, s)), F = h.get(t.path, D.data.exportMapKey), O = F && T.tryResolve(F, !Sl(ap(I.moduleSymbol.name)));
- if (O === "skipped") return D;
- if (!O || O === "failed") {
- (P = s.log) == null || P.call(s, `Unexpected failure resolving auto import for '${D.name}' from '${D.source}'`);
- return;
- }
- const B = {
- ...I,
- kind: 32,
- moduleSpecifier: O.moduleSpecifier
- };
- return D.data = bEe(B), D.source = Dle(B), D.sourceDisplay = [Jf(B.moduleSpecifier)], D;
- });
- return T.skippedAny() || (u.isIncomplete = void 0), C;
- }
- );
- return u.entries = S, u.flags = (u.flags || 0) | 4, u.optionalReplacementSpan = gEe(d), u;
- }
- function Cle(e) {
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !1,
- isNewIdentifierLocation: !1,
- entries: e,
- defaultCommitCharacters: FS(
- /*isNewIdentifierLocation*/
- !1
- )
- };
- }
- function pEe(e, t, n, i, s, o) {
- const c = xi(e, t);
- if (!_C(c) && !Id(c))
- return [];
- const _ = Id(c) ? c : c.parent;
- if (!Id(_))
- return [];
- const u = _.parent;
- if (!ys(u))
- return [];
- const d = Gu(e), g = s.includeCompletionsWithSnippetText || void 0, h = py(_.tags, (S) => dp(S) && S.getEnd() <= t);
- return Ai(u.parameters, (S) => {
- if (!aC(S).length) {
- if (Oe(S.name)) {
- const T = { tabstop: 1 }, C = S.name.text;
- let D = M8(
- C,
- S.initializer,
- S.dotDotDotToken,
- d,
- /*isObject*/
- !1,
- /*isSnippet*/
- !1,
- n,
- i,
- s
- ), P = g ? M8(
- C,
- S.initializer,
- S.dotDotDotToken,
- d,
- /*isObject*/
- !1,
- /*isSnippet*/
- !0,
- n,
- i,
- s,
- T
- ) : void 0;
- return o && (D = D.slice(1), P && (P = P.slice(1))), {
- name: D,
- kind: "parameter",
- sortText: ku.LocationPriority,
- insertText: g ? P : void 0,
- isSnippet: g
- };
- } else if (S.parent.parameters.indexOf(S) === h) {
- const T = `param${h}`, C = dEe(
- T,
- S.name,
- S.initializer,
- S.dotDotDotToken,
- d,
- /*isSnippet*/
- !1,
- n,
- i,
- s
- ), D = g ? dEe(
- T,
- S.name,
- S.initializer,
- S.dotDotDotToken,
- d,
- /*isSnippet*/
- !0,
- n,
- i,
- s
- ) : void 0;
- let P = C.join(k0(i) + "* "), I = D?.join(k0(i) + "* ");
- return o && (P = P.slice(1), I && (I = I.slice(1))), {
- name: P,
- kind: "parameter",
- sortText: ku.LocationPriority,
- insertText: g ? I : void 0,
- isSnippet: g
- };
- }
- }
- });
- }
- function dEe(e, t, n, i, s, o, c, _, u) {
- if (!s)
- return [
- M8(
- e,
- n,
- i,
- s,
- /*isObject*/
- !1,
- o,
- c,
- _,
- u,
- { tabstop: 1 }
- )
- ];
- return d(e, t, n, i, { tabstop: 1 });
- function d(h, S, T, C, D) {
- if (Mf(S) && !C) {
- const I = { tabstop: D.tabstop }, F = M8(
- h,
- T,
- C,
- s,
- /*isObject*/
- !0,
- o,
- c,
- _,
- u,
- I
- );
- let O = [];
- for (const B of S.elements) {
- const z = g(h, B, I);
- if (z)
- O.push(...z);
- else {
- O = void 0;
- break;
- }
- }
- if (O)
- return D.tabstop = I.tabstop, [F, ...O];
- }
- return [
- M8(
- h,
- T,
- C,
- s,
- /*isObject*/
- !1,
- o,
- c,
- _,
- u,
- D
- )
- ];
- }
- function g(h, S, T) {
- if (!S.propertyName && Oe(S.name) || Oe(S.name)) {
- const C = S.propertyName ? f4(S.propertyName) : S.name.text;
- if (!C)
- return;
- const D = `${h}.${C}`;
- return [
- M8(
- D,
- S.initializer,
- S.dotDotDotToken,
- s,
- /*isObject*/
- !1,
- o,
- c,
- _,
- u,
- T
- )
- ];
- } else if (S.propertyName) {
- const C = f4(S.propertyName);
- return C && d(`${h}.${C}`, S.name, S.initializer, S.dotDotDotToken, T);
- }
- }
- }
- function M8(e, t, n, i, s, o, c, _, u, d) {
- if (o && E.assertIsDefined(d), t && (e = iGe(e, t)), o && (e = Ob(e)), i) {
- let g = "*";
- if (s)
- E.assert(!n, "Cannot annotate a rest parameter with type 'Object'."), g = "Object";
- else {
- if (t) {
- const T = c.getTypeAtLocation(t.parent);
- if (!(T.flags & 16385)) {
- const C = t.getSourceFile(), P = bf(C, u) === 0 ? 268435456 : 0, I = c.typeToTypeNode(T, or(t, ys), P);
- if (I) {
- const F = o ? nH({
- removeComments: !0,
- module: _.module,
- moduleResolution: _.moduleResolution,
- target: _.target
- }) : Ky({
- removeComments: !0,
- module: _.module,
- moduleResolution: _.moduleResolution,
- target: _.target
- });
- an(
- I,
- 1
- /* SingleLine */
- ), g = F.printNode(4, I, C);
- }
- }
- }
- o && g === "*" && (g = `\${${d.tabstop++}:${g}}`);
- }
- const h = !s && n ? "..." : "", S = o ? `\${${d.tabstop++}}` : "";
- return `@param {${h}${g}} ${e} ${S}`;
- } else {
- const g = o ? `\${${d.tabstop++}}` : "";
- return `@param ${e} ${g}`;
- }
- }
- function iGe(e, t) {
- const n = t.getText().trim();
- return n.includes(`
-`) || n.length > 80 ? `[${e}]` : `[${e}=${n}]`;
- }
- function sGe(e) {
- return {
- name: qs(e),
- kind: "keyword",
- kindModifiers: "",
- sortText: ku.GlobalsOrKeywords
- };
- }
- function aGe(e, t) {
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !1,
- isNewIdentifierLocation: t,
- entries: e.slice(),
- defaultCommitCharacters: FS(t)
- };
- }
- function mEe(e, t, n) {
- return {
- kind: 4,
- keywordCompletions: DEe(e, t),
- isNewIdentifierLocation: n
- };
- }
- function oGe(e) {
- switch (e) {
- case 156:
- return 8;
- default:
- E.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters");
- }
- }
- function gEe(e) {
- return e?.kind === 80 ? t_(e) : void 0;
- }
- function cGe(e, t, n, i, s, o, c, _, u, d) {
- const {
- symbols: g,
- contextToken: h,
- completionKind: S,
- isInSnippetScope: T,
- isNewIdentifierLocation: C,
- location: D,
- propertyAccessToConvert: P,
- keywordFilters: I,
- symbolToOriginInfoMap: F,
- recommendedCompletion: O,
- isJsxInitializer: B,
- isTypeOnlyLocation: z,
- isJsxIdentifierExpected: X,
- isRightOfOpenTag: q,
- isRightOfDotOrQuestionDot: V,
- importStatementCompletion: ae,
- insideJsDocTagTypeExpression: ee,
- symbolToSortTextMap: G,
- hasUnresolvedAutoImports: ue
- } = o;
- let re = o.literals;
- const ne = n.getTypeChecker();
- if (F3(e.scriptKind) === 1) {
- const he = uGe(D, e);
- if (he)
- return he;
- }
- const ie = or(h, XC);
- if (ie && (qee(h) || kb(h, ie.expression))) {
- const he = S9(ne, ie.parent.clauses);
- re = re.filter((le) => !he.hasValue(le)), g.forEach((le, me) => {
- if (le.valueDeclaration && A0(le.valueDeclaration)) {
- const ve = ne.getConstantValue(le.valueDeclaration);
- ve !== void 0 && he.hasValue(ve) && (F[me] = {
- kind: 256
- /* Ignore */
- });
- }
- });
- }
- const Se = cR(), J = hEe(e, i);
- if (J && !C && (!g || g.length === 0) && I === 0)
- return;
- const oe = Ple(
- g,
- Se,
- /*replacementToken*/
- void 0,
- h,
- D,
- u,
- e,
- t,
- n,
- pa(i),
- s,
- S,
- c,
- i,
- _,
- z,
- P,
- X,
- B,
- ae,
- O,
- F,
- G,
- X,
- q,
- d
- );
- if (I !== 0)
- for (const he of DEe(I, !ee && Gu(e)))
- (z && GD(H2(he.name)) || !z && HGe(he.name) || !oe.has(he.name)) && (oe.add(he.name), my(
- Se,
- he,
- Z9,
- /*equalityComparer*/
- void 0,
- /*allowDuplicates*/
- !0
- ));
- for (const he of OGe(h, u))
- oe.has(he.name) || (oe.add(he.name), my(
- Se,
- he,
- Z9,
- /*equalityComparer*/
- void 0,
- /*allowDuplicates*/
- !0
- ));
- for (const he of re) {
- const le = fGe(e, c, he);
- oe.add(le.name), my(
- Se,
- le,
- Z9,
- /*equalityComparer*/
- void 0,
- /*allowDuplicates*/
- !0
- );
- }
- J || _Ge(e, D.pos, oe, pa(i), Se);
- let _e;
- if (c.includeCompletionsWithInsertText && h && !q && !V && (_e = or(h, cD))) {
- const he = yEe(_e, e, c, i, t, n, _);
- he && Se.push(he.entry);
- }
- return {
- flags: o.flags,
- isGlobalCompletion: T,
- isIncomplete: c.allowIncompleteCompletions && ue ? !0 : void 0,
- isMemberCompletion: lGe(S),
- isNewIdentifierLocation: C,
- optionalReplacementSpan: gEe(D),
- entries: Se,
- defaultCommitCharacters: FS(C)
- };
- }
- function hEe(e, t) {
- return !Gu(e) || !!W4(e, t);
- }
- function yEe(e, t, n, i, s, o, c) {
- const _ = e.clauses, u = o.getTypeChecker(), d = u.getTypeAtLocation(e.parent.expression);
- if (d && d.isUnion() && Mi(d.types, (g) => g.isLiteral())) {
- const g = S9(u, _), h = pa(i), S = bf(t, n), T = xu.createImportAdder(t, o, n, s), C = [];
- for (const z of d.types)
- if (z.flags & 1024) {
- E.assert(z.symbol, "An enum member type should have a symbol"), E.assert(z.symbol.parent, "An enum member type should have a parent symbol (the enum symbol)");
- const X = z.symbol.valueDeclaration && u.getConstantValue(z.symbol.valueDeclaration);
- if (X !== void 0) {
- if (g.hasValue(X))
- continue;
- g.addValue(X);
- }
- const q = xu.typeToAutoImportableTypeNode(u, T, z, e, h);
- if (!q)
- return;
- const V = tH(q, h, S);
- if (!V)
- return;
- C.push(V);
- } else if (!g.hasValue(z.value))
- switch (typeof z.value) {
- case "object":
- C.push(z.value.negative ? A.createPrefixUnaryExpression(41, A.createBigIntLiteral({ negative: !1, base10Value: z.value.base10Value })) : A.createBigIntLiteral(z.value));
- break;
- case "number":
- C.push(z.value < 0 ? A.createPrefixUnaryExpression(41, A.createNumericLiteral(-z.value)) : A.createNumericLiteral(z.value));
- break;
- case "string":
- C.push(A.createStringLiteral(
- z.value,
- S === 0
- /* Single */
- ));
- break;
- }
- if (C.length === 0)
- return;
- const D = lr(C, (z) => A.createCaseClause(z, [])), P = jh(s, c?.options), I = nH({
- removeComments: !0,
- module: i.module,
- moduleResolution: i.moduleResolution,
- target: i.target,
- newLine: v8(P)
- }), F = c ? (z) => I.printAndFormatNode(4, z, t, c) : (z) => I.printNode(4, z, t), O = lr(D, (z, X) => n.includeCompletionsWithSnippetText ? `${F(z)}$${X + 1}` : `${F(z)}`).join(P);
- return {
- entry: {
- name: `${I.printNode(4, D[0], t)} ...`,
- kind: "",
- sortText: ku.GlobalsOrKeywords,
- insertText: O,
- hasAction: T.hasFixes() || void 0,
- source: "SwitchCases/",
- isSnippet: n.includeCompletionsWithSnippetText ? !0 : void 0
- },
- importAdder: T
- };
- }
- }
- function tH(e, t, n) {
- switch (e.kind) {
- case 183:
- const i = e.typeName;
- return rH(i, t, n);
- case 199:
- const s = tH(e.objectType, t, n), o = tH(e.indexType, t, n);
- return s && o && A.createElementAccessExpression(s, o);
- case 201:
- const c = e.literal;
- switch (c.kind) {
- case 11:
- return A.createStringLiteral(
- c.text,
- n === 0
- /* Single */
- );
- case 9:
- return A.createNumericLiteral(c.text, c.numericLiteralFlags);
- }
- return;
- case 196:
- const _ = tH(e.type, t, n);
- return _ && (Oe(_) ? _ : A.createParenthesizedExpression(_));
- case 186:
- return rH(e.exprName, t, n);
- case 205:
- E.fail("We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.");
- }
- }
- function rH(e, t, n) {
- if (Oe(e))
- return e;
- const i = Ei(e.right.escapedText);
- return dJ(i, t) ? A.createPropertyAccessExpression(
- rH(e.left, t, n),
- i
- ) : A.createElementAccessExpression(
- rH(e.left, t, n),
- A.createStringLiteral(
- i,
- n === 0
- /* Single */
- )
- );
- }
- function lGe(e) {
- switch (e) {
- case 0:
- case 3:
- case 2:
- return !0;
- default:
- return !1;
- }
- }
- function uGe(e, t) {
- const n = or(e, (i) => {
- switch (i.kind) {
- case 287:
- return !0;
- case 44:
- case 32:
- case 80:
- case 211:
- return !1;
- default:
- return "quit";
- }
- });
- if (n) {
- const i = !!Ya(n, 32, t), c = n.parent.openingElement.tagName.getText(t) + (i ? "" : ">"), _ = t_(n.tagName), u = {
- name: c,
- kind: "class",
- kindModifiers: void 0,
- sortText: ku.LocationPriority
- };
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !0,
- isNewIdentifierLocation: !1,
- optionalReplacementSpan: _,
- entries: [u],
- defaultCommitCharacters: FS(
- /*isNewIdentifierLocation*/
- !1
- )
- };
- }
- }
- function _Ge(e, t, n, i, s) {
- Cq(e).forEach((o, c) => {
- if (o === t)
- return;
- const _ = Ei(c);
- !n.has(_) && k_(_, i) && (n.add(_), my(s, {
- name: _,
- kind: "warning",
- kindModifiers: "",
- sortText: ku.JavascriptIdentifiers,
- isFromUncheckedFile: !0,
- commitCharacters: []
- }, Z9));
- });
- }
- function Ele(e, t, n) {
- return typeof n == "object" ? Ib(n) + "n" : _s(n) ? KD(e, t, n) : JSON.stringify(n);
- }
- function fGe(e, t, n) {
- return {
- name: Ele(e, t, n),
- kind: "string",
- kindModifiers: "",
- sortText: ku.LocationPriority,
- commitCharacters: []
- };
- }
- function pGe(e, t, n, i, s, o, c, _, u, d, g, h, S, T, C, D, P, I, F, O, B, z, X, q) {
- var V, ae;
- let ee, G, ue = iV(n, o), re, ne, ie = Dle(h), Se, J, oe;
- const _e = u.getTypeChecker(), he = h && eGe(h), le = h && QHe(h) || g;
- if (h && XHe(h))
- ee = g ? `this${he ? "?." : ""}[${SEe(c, F, d)}]` : `this${he ? "?." : "."}${d}`;
- else if ((le || he) && T) {
- ee = le ? g ? `[${SEe(c, F, d)}]` : `[${d}]` : d, (he || T.questionDotToken) && (ee = `?.${ee}`);
- const Te = Ya(T, 25, c) || Ya(T, 29, c);
- if (!Te)
- return;
- const we = Ui(d, T.name.text) ? T.name.end : Te.end;
- ue = kc(Te.getStart(c), we);
- }
- if (C && (ee === void 0 && (ee = d), ee = `{${ee}}`, typeof C != "boolean" && (ue = t_(C, c))), h && KHe(h) && T) {
- ee === void 0 && (ee = d);
- const Te = sl(T.pos, c);
- let we = "";
- Te && f9(Te.end, Te.parent, c) && (we = ";"), we += `(await ${T.expression.getText()})`, ee = g ? `${we}${ee}` : `${we}${he ? "?." : "."}${ee}`;
- const Me = Wn(T.parent, Hy) ? T.parent : T.expression;
- ue = kc(Me.getStart(c), T.end);
- }
- if (uP(h) && (Se = [Jf(h.moduleSpecifier)], D && ({ insertText: ee, replacementSpan: ue } = SGe(d, D, h, P, c, u, F), ne = F.includeCompletionsWithSnippetText ? !0 : void 0)), h?.kind === 64 && (J = !0), O === 0 && i && ((V = sl(i.pos, c, i)) == null ? void 0 : V.kind) !== 28 && (hc(i.parent.parent) || Lf(i.parent.parent) || K_(i.parent.parent) || $g(i.parent) || ((ae = or(i.parent, Qc)) == null ? void 0 : ae.getLastToken(c)) === i || uu(i.parent) && Qs(c, i.getEnd()).line !== Qs(c, o).line) && (ie = "ObjectLiteralMemberWithComma/", J = !0), F.includeCompletionsWithClassMemberSnippets && F.includeCompletionsWithInsertText && O === 3 && mGe(e, s, c)) {
- let Te;
- const we = vEe(
- _,
- u,
- I,
- F,
- d,
- e,
- s,
- o,
- i,
- B
- );
- if (we)
- ({ insertText: ee, filterText: G, isSnippet: ne, importAdder: Te } = we), (Te?.hasFixes() || we.eraseRange) && (J = !0, ie = "ClassMemberSnippet/");
- else
- return;
- }
- if (h && uEe(h) && ({ insertText: ee, isSnippet: ne, labelDetails: oe } = h, F.useLabelDetailsInCompletionEntries || (d = d + oe.detail, oe = void 0), ie = "ObjectLiteralMethodSnippet/", t = ku.SortBelow(t)), z && !X && F.includeCompletionsWithSnippetText && F.jsxAttributeCompletionStyle && F.jsxAttributeCompletionStyle !== "none" && !(km(s.parent) && s.parent.initializer)) {
- let Te = F.jsxAttributeCompletionStyle === "braces";
- const we = _e.getTypeOfSymbolAtLocation(e, s);
- F.jsxAttributeCompletionStyle === "auto" && !(we.flags & 528) && !(we.flags & 1048576 && On(we.types, (fe) => !!(fe.flags & 528))) && (we.flags & 402653316 || we.flags & 1048576 && Mi(we.types, (fe) => !!(fe.flags & 402686084 || vse(fe))) ? (ee = `${Ob(d)}=${KD(c, F, "$1")}`, ne = !0) : Te = !0), Te && (ee = `${Ob(d)}={$1}`, ne = !0);
- }
- if (ee !== void 0 && !F.includeCompletionsWithInsertText)
- return;
- (Y9(h) || uP(h)) && (re = bEe(h), J = !D);
- const me = or(s, i5);
- if (me) {
- const Te = pa(_.getCompilationSettings());
- if (!k_(d, Te))
- ee = JSON.stringify(d), me.kind === 275 && (ee += " as " + dGe(d, Te));
- else if (me.kind === 275) {
- const we = H2(d);
- we && (we === 135 || gB(we)) && (ee = `${d} as ${d}_`);
- }
- }
- const ve = j0.getSymbolKind(_e, e, s), tt = ve === "warning" || ve === "string" ? [] : void 0;
- return {
- name: d,
- kind: ve,
- kindModifiers: j0.getSymbolModifiers(_e, e),
- sortText: t,
- source: ie,
- hasAction: J ? !0 : void 0,
- isRecommended: TGe(e, S, _e) || void 0,
- insertText: ee,
- filterText: G,
- replacementSpan: ue,
- sourceDisplay: Se,
- labelDetails: oe,
- isSnippet: ne,
- isPackageJsonImport: ZHe(h) || void 0,
- isImportStatementCompletion: !!D || void 0,
- data: re,
- commitCharacters: tt,
- ...q ? { symbol: e } : void 0
- };
- }
- function dGe(e, t) {
- let n = !1, i = "", s;
- for (let o = 0; o < e.length; o += s !== void 0 && s >= 65536 ? 2 : 1)
- s = e.codePointAt(o), s !== void 0 && (o === 0 ? eg(s, t) : Th(s, t)) ? (n && (i += "_"), i += String.fromCodePoint(s), n = !1) : n = !0;
- return n && (i += "_"), i || "_";
- }
- function mGe(e, t, n) {
- return cn(t) ? !1 : !!(e.flags & 106500) && (Zn(t) || t.parent && t.parent.parent && _l(t.parent) && t === t.parent.name && t.parent.getLastToken(n) === t.parent.name && Zn(t.parent.parent) || t.parent && KC(t) && Zn(t.parent));
- }
- function vEe(e, t, n, i, s, o, c, _, u, d) {
- const g = or(c, Zn);
- if (!g)
- return;
- let h, S = s;
- const T = s, C = t.getTypeChecker(), D = c.getSourceFile(), P = nH({
- removeComments: !0,
- module: n.module,
- moduleResolution: n.moduleResolution,
- target: n.target,
- omitTrailingSemicolon: !1,
- newLine: v8(jh(e, d?.options))
- }), I = xu.createImportAdder(D, t, i, e);
- let F;
- if (i.includeCompletionsWithSnippetText) {
- h = !0;
- const ae = A.createEmptyStatement();
- F = A.createBlock(
- [ae],
- /*multiLine*/
- !0
- ), CJ(ae, { kind: 0, order: 0 });
- } else
- F = A.createBlock(
- [],
- /*multiLine*/
- !0
- );
- let O = 0;
- const { modifiers: B, range: z, decorators: X } = gGe(u, D, _), q = B & 64 && g.modifierFlagsCache & 64;
- let V = [];
- if (xu.addNewNodeForMemberSymbol(
- o,
- g,
- D,
- { program: t, host: e },
- i,
- I,
- // `addNewNodeForMemberSymbol` calls this callback function for each new member node
- // it adds for the given member symbol.
- // We store these member nodes in the `completionNodes` array.
- // Note: there might be:
- // - No nodes if `addNewNodeForMemberSymbol` cannot figure out a node for the member;
- // - One node;
- // - More than one node if the member is overloaded (e.g. a method with overload signatures).
- (ae) => {
- let ee = 0;
- q && (ee |= 64), _l(ae) && C.getMemberOverrideModifierStatus(g, ae, o) === 1 && (ee |= 16), V.length || (O = ae.modifierFlagsCache | ee), ae = A.replaceModifiers(ae, O), V.push(ae);
- },
- F,
- xu.PreserveOptionalFlags.Property,
- !!q
- ), V.length) {
- const ae = o.flags & 8192;
- let ee = O | 16 | 1;
- ae ? ee |= 1024 : ee |= 136;
- const G = B & ee;
- if (B & ~ee)
- return;
- if (O & 4 && G & 1 && (O &= -5), G !== 0 && !(G & 1) && (O &= -2), O |= G, V = V.map((re) => A.replaceModifiers(re, O)), X?.length) {
- const re = V[V.length - 1];
- Vb(re) && (V[V.length - 1] = A.replaceDecoratorsAndModifiers(re, X.concat(fb(re) || [])));
- }
- const ue = 131073;
- d ? S = P.printAndFormatSnippetList(
- ue,
- A.createNodeArray(V),
- D,
- d
- ) : S = P.printSnippetList(
- ue,
- A.createNodeArray(V),
- D
- );
- }
- return { insertText: S, filterText: T, isSnippet: h, importAdder: I, eraseRange: z };
- }
- function gGe(e, t, n) {
- if (!e || Qs(t, n).line > Qs(t, e.getEnd()).line)
- return {
- modifiers: 0
- /* None */
- };
- let i = 0, s, o;
- const c = { pos: n, end: n };
- if (cs(e.parent) && (o = hGe(e))) {
- e.parent.modifiers && (i |= mm(e.parent.modifiers) & 98303, s = e.parent.modifiers.filter(dl) || [], c.pos = Math.min(...e.parent.modifiers.map((u) => u.getStart(t))));
- const _ = cx(o);
- i & _ || (i |= _, c.pos = Math.min(c.pos, e.getStart(t))), e.parent.name !== e && (c.end = e.parent.name.getStart(t));
- }
- return { modifiers: i, decorators: s, range: c.pos < c.end ? c : void 0 };
- }
- function hGe(e) {
- if (ra(e))
- return e.kind;
- if (Oe(e)) {
- const t = G2(e);
- if (t && wy(t))
- return t;
- }
- }
- function yGe(e, t, n, i, s, o, c, _) {
- const u = c.includeCompletionsWithSnippetText || void 0;
- let d = t;
- const g = n.getSourceFile(), h = vGe(e, n, g, i, s, c);
- if (!h)
- return;
- const S = nH({
- removeComments: !0,
- module: o.module,
- moduleResolution: o.moduleResolution,
- target: o.target,
- omitTrailingSemicolon: !1,
- newLine: v8(jh(s, _?.options))
- });
- _ ? d = S.printAndFormatSnippetList(80, A.createNodeArray(
- [h],
- /*hasTrailingComma*/
- !0
- ), g, _) : d = S.printSnippetList(80, A.createNodeArray(
- [h],
- /*hasTrailingComma*/
- !0
- ), g);
- const T = Ky({
- removeComments: !0,
- module: o.module,
- moduleResolution: o.moduleResolution,
- target: o.target,
- omitTrailingSemicolon: !0
- }), C = A.createMethodSignature(
- /*modifiers*/
- void 0,
- /*name*/
- "",
- h.questionToken,
- h.typeParameters,
- h.parameters,
- h.type
- ), D = { detail: T.printNode(4, C, g) };
- return { isSnippet: u, insertText: d, labelDetails: D };
- }
- function vGe(e, t, n, i, s, o) {
- const c = e.getDeclarations();
- if (!(c && c.length))
- return;
- const _ = i.getTypeChecker(), u = c[0], d = Ja(
- os(u),
- /*includeTrivia*/
- !1
- ), g = _.getWidenedType(_.getTypeOfSymbolAtLocation(e, t)), S = 33554432 | (bf(n, o) === 0 ? 268435456 : 0);
- switch (u.kind) {
- case 171:
- case 172:
- case 173:
- case 174: {
- let T = g.flags & 1048576 && g.types.length < 10 ? _.getUnionType(
- g.types,
- 2
- /* Subtype */
- ) : g;
- if (T.flags & 1048576) {
- const F = Ln(T.types, (O) => _.getSignaturesOfType(
- O,
- 0
- /* Call */
- ).length > 0);
- if (F.length === 1)
- T = F[0];
- else
- return;
- }
- if (_.getSignaturesOfType(
- T,
- 0
- /* Call */
- ).length !== 1)
- return;
- const D = _.typeToTypeNode(
- T,
- t,
- S,
- /*internalFlags*/
- void 0,
- xu.getNoopSymbolTrackerWithResolver({ program: i, host: s })
- );
- if (!D || !lg(D))
- return;
- let P;
- if (o.includeCompletionsWithSnippetText) {
- const F = A.createEmptyStatement();
- P = A.createBlock(
- [F],
- /*multiLine*/
- !0
- ), CJ(F, { kind: 0, order: 0 });
- } else
- P = A.createBlock(
- [],
- /*multiLine*/
- !0
- );
- const I = D.parameters.map(
- (F) => A.createParameterDeclaration(
- /*modifiers*/
- void 0,
- F.dotDotDotToken,
- F.name,
- /*questionToken*/
- void 0,
- /*type*/
- void 0,
- F.initializer
- )
- );
- return A.createMethodDeclaration(
- /*modifiers*/
- void 0,
- /*asteriskToken*/
- void 0,
- d,
- /*questionToken*/
- void 0,
- /*typeParameters*/
- void 0,
- I,
- /*type*/
- void 0,
- P
- );
- }
- default:
- return;
- }
- }
- function nH(e) {
- let t;
- const n = sn.createWriter(k0(e)), i = Ky(e, n), s = {
- ...n,
- write: (S) => o(S, () => n.write(S)),
- nonEscapingWrite: n.write,
- writeLiteral: (S) => o(S, () => n.writeLiteral(S)),
- writeStringLiteral: (S) => o(S, () => n.writeStringLiteral(S)),
- writeSymbol: (S, T) => o(S, () => n.writeSymbol(S, T)),
- writeParameter: (S) => o(S, () => n.writeParameter(S)),
- writeComment: (S) => o(S, () => n.writeComment(S)),
- writeProperty: (S) => o(S, () => n.writeProperty(S))
- };
- return {
- printSnippetList: c,
- printAndFormatSnippetList: u,
- printNode: d,
- printAndFormatNode: h
- };
- function o(S, T) {
- const C = Ob(S);
- if (C !== S) {
- const D = n.getTextPos();
- T();
- const P = n.getTextPos();
- t = wr(t || (t = []), { newText: C, span: { start: D, length: P - D } });
- } else
- T();
- }
- function c(S, T, C) {
- const D = _(S, T, C);
- return t ? sn.applyChanges(D, t) : D;
- }
- function _(S, T, C) {
- return t = void 0, s.clear(), i.writeList(S, T, C, s), s.getText();
- }
- function u(S, T, C, D) {
- const P = {
- text: _(
- S,
- T,
- C
- ),
- getLineAndCharacterOfPosition(B) {
- return Qs(this, B);
- }
- }, I = b9(D, C), F = ta(T, (B) => {
- const z = sn.assignPositionsToNode(B);
- return Yc.formatNodeGivenIndentation(
- z,
- P,
- C.languageVariant,
- /* indentation */
- 0,
- /* delta */
- 0,
- { ...D, options: I }
- );
- }), O = t ? V_(Qi(F, t), (B, z) => dI(B.span, z.span)) : F;
- return sn.applyChanges(P.text, O);
- }
- function d(S, T, C) {
- const D = g(S, T, C);
- return t ? sn.applyChanges(D, t) : D;
- }
- function g(S, T, C) {
- return t = void 0, s.clear(), i.writeNode(S, T, C, s), s.getText();
- }
- function h(S, T, C, D) {
- const P = {
- text: g(
- S,
- T,
- C
- ),
- getLineAndCharacterOfPosition(z) {
- return Qs(this, z);
- }
- }, I = b9(D, C), F = sn.assignPositionsToNode(T), O = Yc.formatNodeGivenIndentation(
- F,
- P,
- C.languageVariant,
- /* indentation */
- 0,
- /* delta */
- 0,
- { ...D, options: I }
- ), B = t ? V_(Qi(O, t), (z, X) => dI(z.span, X.span)) : O;
- return sn.applyChanges(P.text, B);
- }
- }
- function bEe(e) {
- const t = e.fileName ? void 0 : ap(e.moduleSymbol.name), n = e.isFromPackageJson ? !0 : void 0;
- return uP(e) ? {
- exportName: e.exportName,
- exportMapKey: e.exportMapKey,
- moduleSpecifier: e.moduleSpecifier,
- ambientModuleName: t,
- fileName: e.fileName,
- isPackageJsonImport: n
- } : {
- exportName: e.exportName,
- exportMapKey: e.exportMapKey,
- fileName: e.fileName,
- ambientModuleName: e.fileName ? void 0 : ap(e.moduleSymbol.name),
- isPackageJsonImport: e.isFromPackageJson ? !0 : void 0
- };
- }
- function bGe(e, t, n) {
- const i = e.exportName === "default", s = !!e.isPackageJsonImport;
- return fEe(e) ? {
- kind: 32,
- exportName: e.exportName,
- exportMapKey: e.exportMapKey,
- moduleSpecifier: e.moduleSpecifier,
- symbolName: t,
- fileName: e.fileName,
- moduleSymbol: n,
- isDefaultExport: i,
- isFromPackageJson: s
- } : {
- kind: 4,
- exportName: e.exportName,
- exportMapKey: e.exportMapKey,
- symbolName: t,
- fileName: e.fileName,
- moduleSymbol: n,
- isDefaultExport: i,
- isFromPackageJson: s
- };
- }
- function SGe(e, t, n, i, s, o, c) {
- const _ = t.replacementSpan, u = Ob(KD(s, c, n.moduleSpecifier)), d = n.isDefaultExport ? 1 : n.exportName === "export=" ? 2 : 0, g = c.includeCompletionsWithSnippetText ? "$1" : "", h = xu.getImportKind(
- s,
- d,
- o,
- /*forceImportKeyword*/
- !0
- ), S = t.couldBeTypeOnlyImportSpecifier, T = t.isTopLevelTypeOnly ? ` ${qs(
- 156
- /* TypeKeyword */
- )} ` : " ", C = S ? `${qs(
- 156
- /* TypeKeyword */
- )} ` : "", D = i ? ";" : "";
- switch (h) {
- case 3:
- return { replacementSpan: _, insertText: `import${T}${Ob(e)}${g} = require(${u})${D}` };
- case 1:
- return { replacementSpan: _, insertText: `import${T}${Ob(e)}${g} from ${u}${D}` };
- case 2:
- return { replacementSpan: _, insertText: `import${T}* as ${Ob(e)} from ${u}${D}` };
- case 0:
- return { replacementSpan: _, insertText: `import${T}{ ${C}${Ob(e)}${g} } from ${u}${D}` };
- }
- }
- function SEe(e, t, n) {
- return /^\d+$/.test(n) ? n : KD(e, t, n);
- }
- function TGe(e, t, n) {
- return e === t || !!(e.flags & 1048576) && n.getExportSymbolOfSymbol(e) === t;
- }
- function Dle(e) {
- if (Y9(e))
- return ap(e.moduleSymbol.name);
- if (uP(e))
- return e.moduleSpecifier;
- if (e?.kind === 1)
- return "ThisProperty/";
- if (e?.kind === 64)
- return "TypeOnlyAlias/";
- }
- function Ple(e, t, n, i, s, o, c, _, u, d, g, h, S, T, C, D, P, I, F, O, B, z, X, q, V, ae = !1) {
- const ee = lo(), G = UGe(i, s), ue = d8(c), re = u.getTypeChecker(), ne = /* @__PURE__ */ new Map();
- for (let J = 0; J < e.length; J++) {
- const oe = e[J], _e = z?.[J], he = sH(oe, d, _e, h, !!I);
- if (!he || ne.get(he.name) && (!_e || !uEe(_e)) || h === 1 && X && !ie(oe, X) || !D && cn(c) && Se(oe))
- continue;
- const { name: le, needsConvertPropertyAccess: me } = he, ve = X?.[na(oe)] ?? ku.LocationPriority, tt = VGe(oe, re) ? ku.Deprecated(ve) : ve, Te = pGe(
- oe,
- tt,
- n,
- i,
- s,
- o,
- c,
- _,
- u,
- le,
- me,
- _e,
- B,
- P,
- F,
- O,
- ue,
- T,
- S,
- h,
- C,
- q,
- V,
- ae
- );
- if (!Te)
- continue;
- const we = (!_e || lEe(_e)) && !(oe.parent === void 0 && !ut(oe.declarations, (fe) => fe.getSourceFile() === s.getSourceFile()));
- ne.set(le, we), my(
- t,
- Te,
- Z9,
- /*equalityComparer*/
- void 0,
- /*allowDuplicates*/
- !0
- );
- }
- return g("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (lo() - ee)), {
- has: (J) => ne.has(J),
- add: (J) => ne.set(J, !0)
- };
- function ie(J, oe) {
- var _e;
- let he = J.flags;
- if (!Si(s)) {
- if (wo(s.parent))
- return !0;
- if (Wn(G, ii) && J.valueDeclaration === G)
- return !1;
- const le = J.valueDeclaration ?? ((_e = J.declarations) == null ? void 0 : _e[0]);
- if (G && le && (zo(G) && zo(le) || Ii(G) && Ii(le))) {
- const ve = le.pos, tt = Ii(G) ? G.parent.parameters : pS(G.parent) ? void 0 : G.parent.typeParameters;
- if (ve >= G.pos && tt && ve < tt.end)
- return !1;
- }
- const me = Hl(J, re);
- if (c.externalModuleIndicator && !T.allowUmdGlobalAccess && oe[na(J)] === ku.GlobalsOrKeywords && (oe[na(me)] === ku.AutoImportSuggestions || oe[na(me)] === ku.LocationPriority))
- return !1;
- if (he |= FC(me), zF(s))
- return !!(he & 1920);
- if (D)
- return Ole(J, re);
- }
- return !!(he & 111551);
- }
- function Se(J) {
- var oe;
- const _e = FC(Hl(J, re));
- return !(_e & 111551) && (!cn((oe = J.declarations) == null ? void 0 : oe[0]) || !!(_e & 788968));
- }
- }
- function xGe(e) {
- const t = kGe(e);
- if (t.length)
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !1,
- isNewIdentifierLocation: !1,
- entries: t,
- defaultCommitCharacters: FS(
- /*isNewIdentifierLocation*/
- !1
- )
- };
- }
- function kGe(e) {
- const t = [], n = /* @__PURE__ */ new Map();
- let i = e;
- for (; i && !ys(i); ) {
- if (Gy(i)) {
- const s = i.label.text;
- n.has(s) || (n.set(s, !0), t.push({
- name: s,
- kindModifiers: "",
- kind: "label",
- sortText: ku.LocationPriority
- }));
- }
- i = i.parent;
- }
- return t;
- }
- function TEe(e, t, n, i, s, o, c) {
- if (s.source === "SwitchCases/")
- return { type: "cases" };
- if (s.data) {
- const O = CEe(s.name, s.data, e, o);
- if (O) {
- const { contextToken: B, previousToken: z } = iH(i, n);
- return {
- type: "symbol",
- symbol: O.symbol,
- location: h_(n, i),
- previousToken: z,
- contextToken: B,
- isJsxInitializer: !1,
- isTypeOnlyLocation: !1,
- origin: O.origin
- };
- }
- }
- const _ = e.getCompilerOptions(), u = kEe(
- e,
- t,
- n,
- _,
- i,
- { includeCompletionsForModuleExports: !0, includeCompletionsWithInsertText: !0 },
- s,
- o,
- /*formatContext*/
- void 0
- );
- if (!u)
- return { type: "none" };
- if (u.kind !== 0)
- return { type: "request", request: u };
- const { symbols: d, literals: g, location: h, completionKind: S, symbolToOriginInfoMap: T, contextToken: C, previousToken: D, isJsxInitializer: P, isTypeOnlyLocation: I } = u, F = On(g, (O) => Ele(n, c, O) === s.name);
- return F !== void 0 ? { type: "literal", literal: F } : Tc(d, (O, B) => {
- const z = T[B], X = sH(O, pa(_), z, S, u.isJsxIdentifierExpected);
- return X && X.name === s.name && (s.source === "ClassMemberSnippet/" && O.flags & 106500 || s.source === "ObjectLiteralMethodSnippet/" && O.flags & 8196 || Dle(z) === s.source || s.source === "ObjectLiteralMemberWithComma/") ? { type: "symbol", symbol: O, location: h, origin: z, contextToken: C, previousToken: D, isJsxInitializer: P, isTypeOnlyLocation: I } : void 0;
- }) || { type: "none" };
- }
- function CGe(e, t, n, i, s, o, c, _, u) {
- const d = e.getTypeChecker(), g = e.getCompilerOptions(), { name: h, source: S, data: T } = s, { previousToken: C, contextToken: D } = iH(i, n);
- if (Qx(n, i, C))
- return _H.getStringLiteralCompletionDetails(h, n, i, C, e, o, u, _);
- const P = TEe(e, t, n, i, s, o, _);
- switch (P.type) {
- case "request": {
- const { request: I } = P;
- switch (I.kind) {
- case 1:
- return wv.getJSDocTagNameCompletionDetails(h);
- case 2:
- return wv.getJSDocTagCompletionDetails(h);
- case 3:
- return wv.getJSDocParameterNameCompletionDetails(h);
- case 4:
- return ut(I.keywordCompletions, (F) => F.name === h) ? wle(
- h,
- "keyword",
- 5
- /* keyword */
- ) : void 0;
- default:
- return E.assertNever(I);
- }
- }
- case "symbol": {
- const { symbol: I, location: F, contextToken: O, origin: B, previousToken: z } = P, { codeActions: X, sourceDisplay: q } = EGe(h, F, O, B, I, e, o, g, n, i, z, c, _, T, S, u), V = kle(B) ? B.symbolName : I.name;
- return Ale(I, V, d, n, F, u, X, q);
- }
- case "literal": {
- const { literal: I } = P;
- return wle(
- Ele(n, _, I),
- "string",
- typeof I == "string" ? 8 : 7
- /* numericLiteral */
- );
- }
- case "cases": {
- const I = yEe(
- D.parent,
- n,
- _,
- e.getCompilerOptions(),
- o,
- e,
- /*formatContext*/
- void 0
- );
- if (I?.importAdder.hasFixes()) {
- const { entry: F, importAdder: O } = I, B = sn.ChangeTracker.with(
- { host: o, formatContext: c, preferences: _ },
- O.writeFixes
- );
- return {
- name: F.name,
- kind: "",
- kindModifiers: "",
- displayParts: [],
- sourceDisplay: void 0,
- codeActions: [{
- changes: B,
- description: e2([p.Includes_imports_of_types_referenced_by_0, h])
- }]
- };
- }
- return {
- name: h,
- kind: "",
- kindModifiers: "",
- displayParts: [],
- sourceDisplay: void 0
- };
- }
- case "none":
- return EEe().some((I) => I.name === h) ? wle(
- h,
- "keyword",
- 5
- /* keyword */
- ) : void 0;
- default:
- E.assertNever(P);
- }
- }
- function wle(e, t, n) {
- return K9(e, "", t, [w_(e, n)]);
- }
- function Ale(e, t, n, i, s, o, c, _) {
- const { displayParts: u, documentation: d, symbolKind: g, tags: h } = n.runWithCancellationToken(o, (S) => j0.getSymbolDisplayPartsDocumentationAndSymbolKind(
- S,
- e,
- i,
- s,
- s,
- 7
- /* All */
- ));
- return K9(t, j0.getSymbolModifiers(n, e), g, u, d, h, c, _);
- }
- function K9(e, t, n, i, s, o, c, _) {
- return { name: e, kindModifiers: t, kind: n, displayParts: i, documentation: s, tags: o, codeActions: c, source: _, sourceDisplay: _ };
- }
- function EGe(e, t, n, i, s, o, c, _, u, d, g, h, S, T, C, D) {
- if (T?.moduleSpecifier && g && FEe(n || g, u).replacementSpan)
- return { codeActions: void 0, sourceDisplay: [Jf(T.moduleSpecifier)] };
- if (C === "ClassMemberSnippet/") {
- const { importAdder: X, eraseRange: q } = vEe(
- c,
- o,
- _,
- S,
- e,
- s,
- t,
- d,
- n,
- h
- );
- if (X?.hasFixes() || q)
- return {
- sourceDisplay: void 0,
- codeActions: [{
- changes: sn.ChangeTracker.with(
- { host: c, formatContext: h, preferences: S },
- (ae) => {
- X && X.writeFixes(ae), q && ae.deleteRange(u, q);
- }
- ),
- description: X?.hasFixes() ? e2([p.Includes_imports_of_types_referenced_by_0, e]) : e2([p.Update_modifiers_of_0, e])
- }]
- };
- }
- if (lEe(i)) {
- const X = xu.getPromoteTypeOnlyCompletionAction(
- u,
- i.declaration.name,
- o,
- c,
- h,
- S
- );
- return E.assertIsDefined(X, "Expected to have a code action for promoting type-only alias"), { codeActions: [X], sourceDisplay: void 0 };
- }
- if (C === "ObjectLiteralMemberWithComma/" && n) {
- const X = sn.ChangeTracker.with(
- { host: c, formatContext: h, preferences: S },
- (q) => q.insertText(u, n.end, ",")
- );
- if (X)
- return {
- sourceDisplay: void 0,
- codeActions: [{
- changes: X,
- description: e2([p.Add_missing_comma_for_object_member_completion_0, e])
- }]
- };
- }
- if (!i || !(Y9(i) || uP(i)))
- return { codeActions: void 0, sourceDisplay: void 0 };
- const P = i.isFromPackageJson ? c.getPackageJsonAutoImportProvider().getTypeChecker() : o.getTypeChecker(), { moduleSymbol: I } = i, F = P.getMergedSymbol(Hl(s.exportSymbol || s, P)), O = n?.kind === 30 && ou(n.parent), { moduleSpecifier: B, codeAction: z } = xu.getImportCompletionAction(
- F,
- I,
- T?.exportMapKey,
- u,
- e,
- O,
- c,
- o,
- h,
- g && Oe(g) ? g.getStart(u) : d,
- S,
- D
- );
- return E.assert(!T?.moduleSpecifier || B === T.moduleSpecifier), { sourceDisplay: [Jf(B)], codeActions: [z] };
- }
- function DGe(e, t, n, i, s, o, c) {
- const _ = TEe(e, t, n, i, s, o, c);
- return _.type === "symbol" ? _.symbol : void 0;
- }
- var xEe = /* @__PURE__ */ ((e) => (e[e.ObjectPropertyDeclaration = 0] = "ObjectPropertyDeclaration", e[e.Global = 1] = "Global", e[e.PropertyAccess = 2] = "PropertyAccess", e[e.MemberLike = 3] = "MemberLike", e[e.String = 4] = "String", e[e.None = 5] = "None", e))(xEe || {});
- function PGe(e, t, n) {
- return Tc(t && (t.isUnion() ? t.types : [t]), (i) => {
- const s = i && i.symbol;
- return s && s.flags & 424 && !wK(s) ? Nle(s, e, n) : void 0;
- });
- }
- function wGe(e, t, n, i) {
- const { parent: s } = e;
- switch (e.kind) {
- case 80:
- return u9(e, i);
- case 64:
- switch (s.kind) {
- case 260:
- return i.getContextualType(s.initializer);
- case 226:
- return i.getTypeAtLocation(s.left);
- case 291:
- return i.getContextualTypeForJsxAttribute(s);
- default:
- return;
- }
- case 105:
- return i.getContextualType(s);
- case 84:
- const o = Wn(s, XC);
- return o ? PV(o, i) : void 0;
- case 19:
- return lD(s) && !Gg(s.parent) && !zb(s.parent) ? i.getContextualTypeForJsxAttribute(s.parent) : void 0;
- default:
- const c = U8.getArgumentInfoForCompletions(e, t, n, i);
- return c ? i.getContextualTypeForArgumentAtIndex(c.invocation, c.argumentIndex) : _9(e.kind) && dn(s) && _9(s.operatorToken.kind) ? (
- // completion at `x ===/**/` should be for the right side
- i.getTypeAtLocation(s.left)
- ) : i.getContextualType(
- e,
- 4
- /* Completions */
- ) || i.getContextualType(e);
- }
- }
- function Nle(e, t, n) {
- const i = n.getAccessibleSymbolChain(
- e,
- t,
- /*meaning*/
- -1,
- /*useOnlyExternalAliasing*/
- !1
- );
- return i ? xa(i) : e.parent && (AGe(e.parent) ? e : Nle(e.parent, t, n));
- }
- function AGe(e) {
- var t;
- return !!((t = e.declarations) != null && t.some(
- (n) => n.kind === 307
- /* SourceFile */
- ));
- }
- function kEe(e, t, n, i, s, o, c, _, u, d) {
- const g = e.getTypeChecker(), h = hEe(n, i);
- let S = lo(), T = xi(n, s);
- t("getCompletionData: Get current token: " + (lo() - S)), S = lo();
- const C = O0(n, s, T);
- t("getCompletionData: Is inside comment: " + (lo() - S));
- let D = !1, P = !1, I = !1;
- if (C) {
- if (gse(n, s)) {
- if (n.text.charCodeAt(s - 1) === 64)
- return {
- kind: 1
- /* JsDocTagName */
- };
- {
- const Ie = $p(s, n);
- if (!/[^*|\s(/)]/.test(n.text.substring(Ie, s)))
- return {
- kind: 2
- /* JsDocTag */
- };
- }
- }
- const Le = FGe(T, s);
- if (Le) {
- if (Le.tagName.pos <= s && s <= Le.tagName.end)
- return {
- kind: 1
- /* JsDocTagName */
- };
- if (Cm(Le))
- P = !0;
- else {
- const Ie = _r(Le);
- if (Ie && (T = xi(n, s), (!T || !og(T) && (T.parent.kind !== 348 || T.parent.name !== T)) && (D = ht(Ie))), !D && dp(Le) && (rc(Le.name) || Le.name.pos <= s && s <= Le.name.end))
- return { kind: 3, tag: Le };
- }
- }
- if (!D && !P) {
- t("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
- return;
- }
- }
- S = lo();
- const F = !D && !P && Gu(n), O = iH(s, n), B = O.previousToken;
- let z = O.contextToken;
- t("getCompletionData: Get previous token: " + (lo() - S));
- let X = T, q, V = !1, ae = !1, ee = !1, G = !1, ue = !1, re = !1, ne, ie = h_(n, s), Se = 0, J = !1, oe = 0;
- if (z) {
- const Le = FEe(z, n);
- if (Le.keywordCompletion) {
- if (Le.isKeywordOnlyCompletion)
- return {
- kind: 4,
- keywordCompletions: [sGe(Le.keywordCompletion)],
- isNewIdentifierLocation: Le.isNewIdentifierLocation
- };
- Se = oGe(Le.keywordCompletion);
- }
- if (Le.replacementSpan && o.includeCompletionsForImportStatements && o.includeCompletionsWithInsertText && (oe |= 2, ne = Le, J = Le.isNewIdentifierLocation), !Le.replacementSpan && Oi(z))
- return t("Returning an empty list because completion was requested in an invalid position."), Se ? mEe(Se, F, Hs()) : void 0;
- let Ie = z.parent;
- if (z.kind === 25 || z.kind === 29)
- switch (V = z.kind === 25, ae = z.kind === 29, Ie.kind) {
- case 211:
- q = Ie, X = q.expression;
- const At = LC(q);
- if (rc(At) || (Fs(X) || ys(X)) && X.end === z.pos && X.getChildCount(n) && _a(X.getChildren(n)).kind !== 22)
- return;
- break;
- case 166:
- X = Ie.left;
- break;
- case 267:
- X = Ie.name;
- break;
- case 205:
- X = Ie;
- break;
- case 236:
- X = Ie.getFirstToken(n), E.assert(
- X.kind === 102 || X.kind === 105
- /* NewKeyword */
- );
- break;
- default:
- return;
- }
- else if (!ne) {
- if (Ie && Ie.kind === 211 && (z = Ie, Ie = Ie.parent), T.parent === ie)
- switch (T.kind) {
- case 32:
- (T.parent.kind === 284 || T.parent.kind === 286) && (ie = T);
- break;
- case 44:
- T.parent.kind === 285 && (ie = T);
- break;
- }
- switch (Ie.kind) {
- case 287:
- z.kind === 44 && (G = !0, ie = z);
- break;
- case 226:
- if (!OEe(Ie))
- break;
- case 285:
- case 284:
- case 286:
- re = !0, z.kind === 30 && (ee = !0, ie = z);
- break;
- case 294:
- case 293:
- (B.kind === 20 || B.kind === 80 && B.parent.kind === 291) && (re = !0);
- break;
- case 291:
- if (Ie.initializer === B && B.end < s) {
- re = !0;
- break;
- }
- switch (B.kind) {
- case 64:
- ue = !0;
- break;
- case 80:
- re = !0, Ie !== B.parent && !Ie.initializer && Ya(Ie, 64, n) && (ue = B);
- }
- break;
- }
- }
- }
- const _e = lo();
- let he = 5, le = !1, me = [], ve;
- const tt = [], Te = [], we = /* @__PURE__ */ new Map(), fe = Jr(), Me = im((Le) => Zx(Le ? _.getPackageJsonAutoImportProvider() : e, _));
- if (V || ae)
- Ir();
- else if (ee)
- me = g.getJsxIntrinsicTagNamesAt(ie), E.assertEachIsDefined(me, "getJsxIntrinsicTagNames() should all be defined"), Br(), he = 1, Se = 0;
- else if (G) {
- const Le = z.parent.parent.openingElement.tagName, Ie = g.getSymbolAtLocation(Le);
- Ie && (me = [Ie]), he = 1, Se = 0;
- } else if (!Br())
- return Se ? mEe(Se, F, J) : void 0;
- t("getCompletionData: Semantic work: " + (lo() - _e));
- const Qe = B && wGe(B, s, n, g), Re = !Wn(B, Xa) && !re ? Ai(
- Qe && (Qe.isUnion() ? Qe.types : [Qe]),
- (Le) => Le.isLiteral() && !(Le.flags & 1024) ? Le.value : void 0
- ) : [], ft = B && Qe && PGe(B, Qe, g);
- return {
- kind: 0,
- symbols: me,
- completionKind: he,
- isInSnippetScope: I,
- propertyAccessToConvert: q,
- isNewIdentifierLocation: J,
- location: ie,
- keywordFilters: Se,
- literals: Re,
- symbolToOriginInfoMap: tt,
- recommendedCompletion: ft,
- previousToken: B,
- contextToken: z,
- isJsxInitializer: ue,
- insideJsDocTagTypeExpression: D,
- symbolToSortTextMap: Te,
- isTypeOnlyLocation: fe,
- isJsxIdentifierExpected: re,
- isRightOfOpenTag: ee,
- isRightOfDotOrQuestionDot: V || ae,
- importStatementCompletion: ne,
- hasUnresolvedAutoImports: le,
- flags: oe
- };
- function Wt(Le) {
- switch (Le.kind) {
- case 341:
- case 348:
- case 342:
- case 344:
- case 346:
- case 349:
- case 350:
- return !0;
- case 345:
- return !!Le.constraint;
- default:
- return !1;
- }
- }
- function _r(Le) {
- if (Wt(Le)) {
- const Ie = qp(Le) ? Le.constraint : Le.typeExpression;
- return Ie && Ie.kind === 309 ? Ie : void 0;
- }
- if (Mx(Le) || iO(Le))
- return Le.class;
- }
- function Ir() {
- he = 2;
- const Le = h0(X), Ie = Le && !X.isTypeOf || um(X.parent) || n8(z, n, g), At = zF(X);
- if (l_(X) || Le || Cn(X)) {
- const Dr = zc(X.parent);
- Dr && (J = !0);
- let yr = g.getSymbolAtLocation(X);
- if (yr && (yr = Hl(yr, g), yr.flags & 1920)) {
- const $r = g.getExportsOfModule(yr);
- E.assertEachIsDefined($r, "getExportsOfModule() should all be defined");
- const nt = (jt) => g.isValidPropertyAccess(Le ? X : X.parent, jt.name), ot = (jt) => Ole(jt, g), wt = Dr ? (jt) => {
- var Xt;
- return !!(jt.flags & 1920) && !((Xt = jt.declarations) != null && Xt.every((Ht) => Ht.parent === X.parent));
- } : At ? (
- // Any kind is allowed when dotting off namespace in internal import equals declaration
- (jt) => ot(jt) || nt(jt)
- ) : Ie || D ? ot : nt;
- for (const jt of $r)
- wt(jt) && me.push(jt);
- if (!Ie && !D && yr.declarations && yr.declarations.some(
- (jt) => jt.kind !== 307 && jt.kind !== 267 && jt.kind !== 266
- /* EnumDeclaration */
- )) {
- let jt = g.getTypeOfSymbolAtLocation(yr, X).getNonOptionalType(), Xt = !1;
- if (jt.isNullableType()) {
- const Ht = V && !ae && o.includeAutomaticOptionalChainCompletions !== !1;
- (Ht || ae) && (jt = jt.getNonNullableType(), Ht && (Xt = !0));
- }
- jr(jt, !!(X.flags & 65536), Xt);
- }
- return;
- }
- }
- if (!Ie || ax(X)) {
- g.tryGetThisTypeAt(
- X,
- /*includeGlobalThis*/
- !1
- );
- let Dr = g.getTypeAtLocation(X).getNonOptionalType();
- if (Ie)
- jr(
- Dr.getNonNullableType(),
- /*insertAwait*/
- !1,
- /*insertQuestionDot*/
- !1
- );
- else {
- let yr = !1;
- if (Dr.isNullableType()) {
- const $r = V && !ae && o.includeAutomaticOptionalChainCompletions !== !1;
- ($r || ae) && (Dr = Dr.getNonNullableType(), $r && (yr = !0));
- }
- jr(Dr, !!(X.flags & 65536), yr);
- }
- }
- }
- function jr(Le, Ie, At) {
- J = !!Le.getStringIndexType(), ae && ut(Le.getCallSignatures()) && (J = !0);
- const Dr = X.kind === 205 ? X : X.parent;
- if (h)
- for (const yr of Le.getApparentProperties())
- g.isValidPropertyAccessForCompletions(Dr, Le, yr) && Nt(
- yr,
- /*insertAwait*/
- !1,
- At
- );
- else
- me.push(...Ln(lH(Le, g), (yr) => g.isValidPropertyAccessForCompletions(Dr, Le, yr)));
- if (Ie && o.includeCompletionsWithInsertText) {
- const yr = g.getPromisedTypeOfPromise(Le);
- if (yr)
- for (const $r of yr.getApparentProperties())
- g.isValidPropertyAccessForCompletions(Dr, yr, $r) && Nt(
- $r,
- /*insertAwait*/
- !0,
- At
- );
- }
- }
- function Nt(Le, Ie, At) {
- var Dr;
- const yr = Tc(Le.declarations, (wt) => Wn(os(wt), ma));
- if (yr) {
- const wt = Qt(yr.expression), jt = wt && g.getSymbolAtLocation(wt), Xt = jt && Nle(jt, z, g), Ht = Xt && na(Xt);
- if (Ht && zp(we, Ht)) {
- const en = me.length;
- me.push(Xt);
- const zt = Xt.parent;
- if (!zt || !fC(zt) || g.tryGetMemberInModuleExportsAndProperties(Xt.name, zt) !== Xt)
- tt[en] = { kind: ot(
- 2
- /* SymbolMemberNoExport */
- ) };
- else {
- const mr = Sl(ap(zt.name)) ? (Dr = s7(zt)) == null ? void 0 : Dr.fileName : void 0, { moduleSpecifier: Kt } = (ve || (ve = xu.createImportSpecifierResolver(n, e, _, o))).getModuleSpecifierForBestExportInfo(
- [{
- exportKind: 0,
- moduleFileName: mr,
- isFromPackageJson: !1,
- moduleSymbol: zt,
- symbol: Xt,
- targetFlags: Hl(Xt, g).flags
- }],
- s,
- av(ie)
- ) || {};
- if (Kt) {
- const hr = {
- kind: ot(
- 6
- /* SymbolMemberExport */
- ),
- moduleSymbol: zt,
- isDefaultExport: !1,
- symbolName: Xt.name,
- exportName: Xt.name,
- fileName: mr,
- moduleSpecifier: Kt
- };
- tt[en] = hr;
- }
- }
- } else if (o.includeCompletionsWithInsertText) {
- if (Ht && we.has(Ht))
- return;
- nt(Le), $r(Le), me.push(Le);
- }
- } else
- nt(Le), $r(Le), me.push(Le);
- function $r(wt) {
- JGe(wt) && (Te[na(wt)] = ku.LocalDeclarationPriority);
- }
- function nt(wt) {
- o.includeCompletionsWithInsertText && (Ie && zp(we, na(wt)) ? tt[me.length] = { kind: ot(
- 8
- /* Promise */
- ) } : At && (tt[me.length] = {
- kind: 16
- /* Nullable */
- }));
- }
- function ot(wt) {
- return At ? wt | 16 : wt;
- }
- }
- function Qt(Le) {
- return Oe(Le) ? Le : Cn(Le) ? Qt(Le.expression) : void 0;
- }
- function Br() {
- return (Ea() || Xe() || ki() || Tt() || te() || ze() || xr() || K() || zn() || (rs(), 1)) === 1;
- }
- function xr() {
- return Ve(z) ? (he = 5, J = !0, Se = 4, 1) : 0;
- }
- function zn() {
- const Le = xe(z), Ie = Le && g.getContextualType(Le.attributes);
- if (!Ie) return 0;
- const At = Le && g.getContextualType(
- Le.attributes,
- 4
- /* Completions */
- );
- return me = Qi(me, Z(cH(Ie, At, Le.attributes, g), Le.attributes.properties)), Ae(), he = 3, J = !1, 1;
- }
- function ki() {
- return ne ? (J = !0, Ot(), 1) : 0;
- }
- function rs() {
- Se = Ke(z) ? 5 : 1, he = 1, J = Hs(), B !== z && E.assert(!!B, "Expected 'contextToken' to be defined when different from 'previousToken'.");
- const Le = B !== z ? B.getStart() : s, Ie = qn(z, Le, n) || n;
- I = Ri(Ie);
- const At = (fe ? 0 : 111551) | 788968 | 1920 | 2097152, Dr = B && !av(B);
- me = Qi(me, g.getSymbolsInScope(Ie, At)), E.assertEachIsDefined(me, "getSymbolsInScope() should all be defined");
- for (let yr = 0; yr < me.length; yr++) {
- const $r = me[yr];
- if (!g.isArgumentsSymbol($r) && !ut($r.declarations, (nt) => nt.getSourceFile() === n) && (Te[na($r)] = ku.GlobalsOrKeywords), Dr && !($r.flags & 111551)) {
- const nt = $r.declarations && On($r.declarations, i4);
- if (nt) {
- const ot = { kind: 64, declaration: nt };
- tt[yr] = ot;
- }
- }
- }
- if (o.includeCompletionsWithInsertText && Ie.kind !== 307) {
- const yr = g.tryGetThisTypeAt(
- Ie,
- /*includeGlobalThis*/
- !1,
- Zn(Ie.parent) ? Ie : void 0
- );
- if (yr && !BGe(yr, n, g))
- for (const $r of lH(yr, g))
- tt[me.length] = {
- kind: 1
- /* ThisType */
- }, me.push($r), Te[na($r)] = ku.SuggestedClassMembers;
- }
- Ot(), fe && (Se = z && $1(z.parent) ? 6 : 7);
- }
- function ei() {
- var Le;
- return ne ? !0 : o.includeCompletionsForModuleExports ? n.externalModuleIndicator || n.commonJsModuleIndicator || lV(e.getCompilerOptions()) ? !0 : ((Le = e.getSymlinkCache) == null ? void 0 : Le.call(e).hasAnySymlinks()) || !!e.getCompilerOptions().paths || Tse(e) : !1;
- }
- function Ri(Le) {
- switch (Le.kind) {
- case 307:
- case 228:
- case 294:
- case 241:
- return !0;
- default:
- return bi(Le);
- }
- }
- function Jr() {
- return D || P || !!ne && Py(ie.parent) || !ji(z) && (n8(z, n, g) || um(ie) || Fe(z));
- }
- function ji(Le) {
- return Le && (Le.kind === 114 && (Le.parent.kind === 186 || GC(Le.parent)) || Le.kind === 131 && Le.parent.kind === 182);
- }
- function Fe(Le) {
- if (Le) {
- const Ie = Le.parent.kind;
- switch (Le.kind) {
- case 59:
- return Ie === 172 || Ie === 171 || Ie === 169 || Ie === 260 || WT(Ie);
- case 64:
- return Ie === 265 || Ie === 168;
- case 130:
- return Ie === 234;
- case 30:
- return Ie === 183 || Ie === 216;
- case 96:
- return Ie === 168;
- case 152:
- return Ie === 238;
- }
- }
- return !1;
- }
- function Ot() {
- var Le, Ie;
- if (!ei() || (E.assert(!c?.data, "Should not run 'collectAutoImports' when faster path is available via `data`"), c && !c.source))
- return;
- oe |= 1;
- const Dr = B === z && ne ? "" : B && Oe(B) ? B.text.toLowerCase() : "", yr = (Le = _.getModuleSpecifierCache) == null ? void 0 : Le.call(_), $r = S8(n, _, e, o, d), nt = (Ie = _.getPackageJsonAutoImportProvider) == null ? void 0 : Ie.call(_), ot = c ? void 0 : P6(n, o, _);
- _Ee(
- "collectAutoImports",
- _,
- ve || (ve = xu.createImportSpecifierResolver(n, e, _, o)),
- e,
- s,
- o,
- !!ne,
- av(ie),
- (jt) => {
- $r.search(
- n.path,
- /*preferCapitalized*/
- ee,
- (Xt, Ht) => {
- if (!k_(Xt, pa(_.getCompilationSettings())) || !c && ix(Xt) || !fe && !ne && !(Ht & 111551) || fe && !(Ht & 790504)) return !1;
- const en = Xt.charCodeAt(0);
- return ee && (en < 65 || en > 90) ? !1 : c ? !0 : BEe(Xt, Dr);
- },
- (Xt, Ht, en, zt) => {
- if (c && !ut(Xt, (gs) => c.source === ap(gs.moduleSymbol.name)) || (Xt = Ln(Xt, wt), !Xt.length))
- return;
- const mr = jt.tryResolve(Xt, en) || {};
- if (mr === "failed") return;
- let Kt = Xt[0], hr;
- mr !== "skipped" && ({ exportInfo: Kt = Xt[0], moduleSpecifier: hr } = mr);
- const Ft = Kt.exportKind === 1, Ss = Ft && N4(E.checkDefined(Kt.symbol)) || E.checkDefined(Kt.symbol);
- Ar(Ss, {
- kind: hr ? 32 : 4,
- moduleSpecifier: hr,
- symbolName: Ht,
- exportMapKey: zt,
- exportName: Kt.exportKind === 2 ? "export=" : E.checkDefined(Kt.symbol).name,
- fileName: Kt.moduleFileName,
- isDefaultExport: Ft,
- moduleSymbol: Kt.moduleSymbol,
- isFromPackageJson: Kt.isFromPackageJson
- });
- }
- ), le = jt.skippedAny(), oe |= jt.resolvedAny() ? 8 : 0, oe |= jt.resolvedBeyondLimit() ? 16 : 0;
- }
- );
- function wt(jt) {
- const Xt = Wn(jt.moduleSymbol.valueDeclaration, Si);
- if (!Xt) {
- const Ht = ap(jt.moduleSymbol.name);
- return Dm.nodeCoreModules.has(Ht) && Ui(Ht, "node:") !== v9(n, e) ? !1 : (ot?.allowsImportingAmbientModule(jt.moduleSymbol, Me(jt.isFromPackageJson)) ?? !0) || b8(n, Ht);
- }
- return zV(
- jt.isFromPackageJson ? nt : e,
- n,
- Xt,
- o,
- ot,
- Me(jt.isFromPackageJson),
- yr
- );
- }
- }
- function Ar(Le, Ie) {
- const At = na(Le);
- Te[At] !== ku.GlobalsOrKeywords && (tt[me.length] = Ie, Te[At] = ne ? ku.LocationPriority : ku.AutoImportSuggestions, me.push(Le));
- }
- function mn(Le, Ie) {
- cn(ie) || Le.forEach((At) => {
- if (!ti(At))
- return;
- const Dr = sH(
- At,
- pa(i),
- /*origin*/
- void 0,
- 0,
- /*jsxIdentifierExpected*/
- !1
- );
- if (!Dr)
- return;
- const { name: yr } = Dr, $r = yGe(
- At,
- yr,
- Ie,
- e,
- _,
- i,
- o,
- u
- );
- if (!$r)
- return;
- const nt = { kind: 128, ...$r };
- oe |= 32, tt[me.length] = nt, me.push(At);
- });
- }
- function ti(Le) {
- return !!(Le.flags & 8196);
- }
- function qn(Le, Ie, At) {
- let Dr = Le;
- for (; Dr && !$U(Dr, Ie, At); )
- Dr = Dr.parent;
- return Dr;
- }
- function Oi(Le) {
- const Ie = lo(), At = rr(Le) || $e(Le) || Vt(Le) || Ws(Le) || eD(Le);
- return t("getCompletionsAtPosition: isCompletionListBlocker: " + (lo() - Ie)), At;
- }
- function Ws(Le) {
- if (Le.kind === 12)
- return !0;
- if (Le.kind === 32 && Le.parent) {
- if (ie === Le.parent && (ie.kind === 286 || ie.kind === 285))
- return !1;
- if (Le.parent.kind === 286)
- return ie.parent.kind !== 286;
- if (Le.parent.kind === 287 || Le.parent.kind === 285)
- return !!Le.parent.parent && Le.parent.parent.kind === 284;
- }
- return !1;
- }
- function Hs() {
- if (z) {
- const Le = z.parent.kind, Ie = oH(z);
- switch (Ie) {
- case 28:
- return Le === 213 || Le === 176 || Le === 214 || Le === 209 || Le === 226 || Le === 184 || Le === 210;
- case 21:
- return Le === 213 || Le === 176 || Le === 214 || Le === 217 || Le === 196;
- case 23:
- return Le === 209 || Le === 181 || Le === 167;
- case 144:
- case 145:
- case 102:
- return !0;
- case 25:
- return Le === 267;
- case 19:
- return Le === 263 || Le === 210;
- case 64:
- return Le === 260 || Le === 226;
- case 16:
- return Le === 228;
- case 17:
- return Le === 239;
- case 134:
- return Le === 174 || Le === 304;
- case 42:
- return Le === 174;
- }
- if (eL(Ie))
- return !0;
- }
- return !1;
- }
- function rr(Le) {
- return (DJ(Le) || bj(Le)) && (e8(Le, s) || s === Le.end && (!!Le.isUnterminated || DJ(Le)));
- }
- function Ea() {
- const Le = RGe(z);
- if (!Le) return 0;
- const At = (Ax(Le.parent) ? Le.parent : void 0) || Le, Dr = IEe(At, g);
- if (!Dr) return 0;
- const yr = g.getTypeFromTypeNode(At), $r = lH(Dr, g), nt = lH(yr, g), ot = /* @__PURE__ */ new Set();
- return nt.forEach((wt) => ot.add(wt.escapedName)), me = Qi(me, Ln($r, (wt) => !ot.has(wt.escapedName))), he = 0, J = !0, 1;
- }
- function Xe() {
- if (z?.kind === 26) return 0;
- const Le = me.length, Ie = NGe(z, s, n);
- if (!Ie) return 0;
- he = 0;
- let At, Dr;
- if (Ie.kind === 210) {
- const yr = zGe(Ie, g);
- if (yr === void 0)
- return Ie.flags & 67108864 ? 2 : 0;
- const $r = g.getContextualType(
- Ie,
- 4
- /* Completions */
- ), nt = ($r || yr).getStringIndexType(), ot = ($r || yr).getNumberIndexType();
- if (J = !!nt || !!ot, At = cH(yr, $r, Ie, g), Dr = Ie.properties, At.length === 0 && !ot)
- return 0;
- } else {
- E.assert(
- Ie.kind === 206
- /* ObjectBindingPattern */
- ), J = !1;
- const yr = pm(Ie.parent);
- if (!YT(yr)) return E.fail("Root declaration is not variable-like.");
- let $r = m0(yr) || !!Gc(yr) || yr.parent.parent.kind === 250;
- if (!$r && yr.kind === 169 && (_t(yr.parent) ? $r = !!g.getContextualType(yr.parent) : (yr.parent.kind === 174 || yr.parent.kind === 178) && ($r = _t(yr.parent.parent) && !!g.getContextualType(yr.parent.parent))), $r) {
- const nt = g.getTypeAtLocation(Ie);
- if (!nt) return 2;
- At = g.getPropertiesOfType(nt).filter((ot) => g.isPropertyAccessible(
- Ie,
- /*isSuper*/
- !1,
- /*isWrite*/
- !1,
- nt,
- ot
- )), Dr = Ie.elements;
- }
- }
- if (At && At.length > 0) {
- const yr = vn(At, E.checkDefined(Dr));
- me = Qi(me, yr), Ae(), Ie.kind === 210 && o.includeCompletionsWithObjectLiteralMethodSnippets && o.includeCompletionsWithInsertText && (U(Le), mn(yr, Ie));
- }
- return 1;
- }
- function Tt() {
- if (!z) return 0;
- const Le = z.kind === 19 || z.kind === 28 ? Wn(z.parent, i5) : r9(z) ? Wn(z.parent.parent, i5) : void 0;
- if (!Le) return 0;
- r9(z) || (Se = 8);
- const { moduleSpecifier: Ie } = Le.kind === 275 ? Le.parent.parent : Le.parent;
- if (!Ie)
- return J = !0, Le.kind === 275 ? 2 : 0;
- const At = g.getSymbolAtLocation(Ie);
- if (!At)
- return J = !0, 2;
- he = 3, J = !1;
- const Dr = g.getExportsAndPropertiesOfModule(At), yr = new Set(Le.elements.filter((nt) => !ht(nt)).map((nt) => hb(nt.propertyName || nt.name))), $r = Dr.filter((nt) => nt.escapedName !== "default" && !yr.has(nt.escapedName));
- return me = Qi(me, $r), $r.length || (Se = 0), 1;
- }
- function te() {
- if (z === void 0) return 0;
- const Le = z.kind === 19 || z.kind === 28 ? Wn(z.parent, hS) : z.kind === 59 ? Wn(z.parent.parent, hS) : void 0;
- if (Le === void 0) return 0;
- const Ie = new Set(Le.elements.map(O5));
- return me = Ln(g.getTypeAtLocation(Le).getApparentProperties(), (At) => !Ie.has(At.escapedName)), 1;
- }
- function ze() {
- var Le;
- const Ie = z && (z.kind === 19 || z.kind === 28) ? Wn(z.parent, pp) : void 0;
- if (!Ie)
- return 0;
- const At = or(Ie, Nf(Si, zc));
- return he = 5, J = !1, (Le = At.locals) == null || Le.forEach((Dr, yr) => {
- var $r, nt;
- me.push(Dr), (nt = ($r = At.symbol) == null ? void 0 : $r.exports) != null && nt.has(yr) && (Te[na(Dr)] = ku.OptionalMember);
- }), 1;
- }
- function K() {
- const Le = MGe(n, z, ie, s);
- if (!Le) return 0;
- if (he = 3, J = !0, Se = z.kind === 42 ? 0 : Zn(Le) ? 2 : 3, !Zn(Le)) return 1;
- const Ie = z.kind === 27 ? z.parent.parent : z.parent;
- let At = _l(Ie) ? Mu(Ie) : 0;
- if (z.kind === 80 && !ht(z))
- switch (z.getText()) {
- case "private":
- At = At | 2;
- break;
- case "static":
- At = At | 256;
- break;
- case "override":
- At = At | 16;
- break;
- }
- if (oc(Ie) && (At |= 256), !(At & 2)) {
- const Dr = Zn(Le) && At & 16 ? MT(_m(Le)) : T4(Le), yr = ta(Dr, ($r) => {
- const nt = g.getTypeAtLocation($r);
- return At & 256 ? nt?.symbol && g.getPropertiesOfType(g.getTypeOfSymbolAtLocation(nt.symbol, Le)) : nt && g.getPropertiesOfType(nt);
- });
- me = Qi(me, be(yr, Le.members, At)), ir(me, ($r, nt) => {
- const ot = $r?.valueDeclaration;
- if (ot && _l(ot) && ot.name && ma(ot.name)) {
- const wt = {
- kind: 512,
- symbolName: g.symbolToString($r)
- };
- tt[nt] = wt;
- }
- });
- }
- return 1;
- }
- function De(Le) {
- return !!Le.parent && Ii(Le.parent) && Qo(Le.parent.parent) && (s4(Le.kind) || og(Le));
- }
- function Ve(Le) {
- if (Le) {
- const Ie = Le.parent;
- switch (Le.kind) {
- case 21:
- case 28:
- return Qo(Le.parent) ? Le.parent : void 0;
- default:
- if (De(Le))
- return Ie.parent;
- }
- }
- }
- function Ke(Le) {
- if (Le) {
- let Ie;
- const At = or(Le.parent, (Dr) => Zn(Dr) ? "quit" : no(Dr) && Ie === Dr.body ? !0 : (Ie = Dr, !1));
- return At && At;
- }
- }
- function xe(Le) {
- if (Le) {
- const Ie = Le.parent;
- switch (Le.kind) {
- case 32:
- case 31:
- case 44:
- case 80:
- case 211:
- case 292:
- case 291:
- case 293:
- if (Ie && (Ie.kind === 285 || Ie.kind === 286)) {
- if (Le.kind === 32) {
- const At = sl(
- Le.pos,
- n,
- /*startNode*/
- void 0
- );
- if (!Ie.typeArguments || At && At.kind === 44) break;
- }
- return Ie;
- } else if (Ie.kind === 291)
- return Ie.parent.parent;
- break;
- case 11:
- if (Ie && (Ie.kind === 291 || Ie.kind === 293))
- return Ie.parent.parent;
- break;
- case 20:
- if (Ie && Ie.kind === 294 && Ie.parent && Ie.parent.kind === 291)
- return Ie.parent.parent.parent;
- if (Ie && Ie.kind === 293)
- return Ie.parent.parent;
- break;
- }
- }
- }
- function at(Le, Ie) {
- return n.getLineEndOfPosition(Le.getEnd()) < Ie;
- }
- function $e(Le) {
- const Ie = Le.parent, At = Ie.kind;
- switch (Le.kind) {
- case 28:
- return At === 260 || Zt(Le) || At === 243 || At === 266 || // enum a { foo, |
- He(At) || At === 264 || // interface A= Le.pos;
- case 25:
- return At === 207;
- case 59:
- return At === 208;
- case 23:
- return At === 207;
- case 21:
- return At === 299 || He(At);
- case 19:
- return At === 266;
- case 30:
- return At === 263 || // class A< |
- At === 231 || // var C = class D< |
- At === 264 || // interface A< |
- At === 265 || // type List< |
- WT(At);
- case 126:
- return At === 172 && !Zn(Ie.parent);
- case 26:
- return At === 169 || !!Ie.parent && Ie.parent.kind === 207;
- case 125:
- case 123:
- case 124:
- return At === 169 && !Qo(Ie.parent);
- case 130:
- return At === 276 || At === 281 || At === 274;
- case 139:
- case 153:
- return !uH(Le);
- case 80: {
- if (At === 276 && Le === Ie.name && Le.text === "type" || or(
- Le.parent,
- ii
- ) && at(Le, s))
- return !1;
- break;
- }
- case 86:
- case 94:
- case 120:
- case 100:
- case 115:
- case 102:
- case 121:
- case 87:
- case 140:
- return !0;
- case 156:
- return At !== 276;
- case 42:
- return ys(Le.parent) && !hc(Le.parent);
- }
- if (eL(oH(Le)) && uH(Le) || De(Le) && (!Oe(Le) || s4(oH(Le)) || ht(Le)))
- return !1;
- switch (oH(Le)) {
- case 128:
- case 86:
- case 87:
- case 138:
- case 94:
- case 100:
- case 120:
- case 121:
- case 123:
- case 124:
- case 125:
- case 126:
- case 115:
- return !0;
- case 134:
- return cs(Le.parent);
- }
- if (or(Le.parent, Zn) && Le === B && bt(Le, s))
- return !1;
- const yr = nv(
- Le.parent,
- 172
- /* PropertyDeclaration */
- );
- if (yr && Le !== B && Zn(B.parent.parent) && s <= B.end) {
- if (bt(Le, B.end))
- return !1;
- if (Le.kind !== 64 && (AA(yr) || YI(yr)))
- return !0;
- }
- return og(Le) && !uu(Le.parent) && !km(Le.parent) && !((Zn(Le.parent) || Xl(Le.parent) || zo(Le.parent)) && (Le !== B || s > B.end));
- }
- function bt(Le, Ie) {
- return Le.kind !== 64 && (Le.kind === 27 || !cp(Le.end, Ie, n));
- }
- function He(Le) {
- return WT(Le) && Le !== 176;
- }
- function Vt(Le) {
- if (Le.kind === 9) {
- const Ie = Le.getFullText();
- return Ie.charAt(Ie.length - 1) === ".";
- }
- return !1;
- }
- function Zt(Le) {
- return Le.parent.kind === 261 && !n8(Le, n, g);
- }
- function vn(Le, Ie) {
- if (Ie.length === 0)
- return Le;
- const At = /* @__PURE__ */ new Set(), Dr = /* @__PURE__ */ new Set();
- for (const $r of Ie) {
- if ($r.kind !== 303 && $r.kind !== 304 && $r.kind !== 208 && $r.kind !== 174 && $r.kind !== 177 && $r.kind !== 178 && $r.kind !== 305 || ht($r))
- continue;
- let nt;
- if ($g($r))
- M($r, At);
- else if (va($r) && $r.propertyName)
- $r.propertyName.kind === 80 && (nt = $r.propertyName.escapedText);
- else {
- const ot = os($r);
- nt = ot && fm(ot) ? C4(ot) : void 0;
- }
- nt !== void 0 && Dr.add(nt);
- }
- const yr = Le.filter(($r) => !Dr.has($r.escapedName));
- return dt(At, yr), yr;
- }
- function M(Le, Ie) {
- const At = Le.expression, Dr = g.getSymbolAtLocation(At), yr = Dr && g.getTypeOfSymbolAtLocation(Dr, At), $r = yr && yr.properties;
- $r && $r.forEach((nt) => {
- Ie.add(nt.name);
- });
- }
- function Ae() {
- me.forEach((Le) => {
- if (Le.flags & 16777216) {
- const Ie = na(Le);
- Te[Ie] = Te[Ie] ?? ku.OptionalMember;
- }
- });
- }
- function dt(Le, Ie) {
- if (Le.size !== 0)
- for (const At of Ie)
- Le.has(At.name) && (Te[na(At)] = ku.MemberDeclaredBySpreadAssignment);
- }
- function U(Le) {
- for (let Ie = Le; Ie < me.length; Ie++) {
- const At = me[Ie], Dr = na(At), yr = tt?.[Ie], $r = pa(i), nt = sH(
- At,
- $r,
- yr,
- 0,
- /*jsxIdentifierExpected*/
- !1
- );
- if (nt) {
- const ot = Te[Dr] ?? ku.LocationPriority, { name: wt } = nt;
- Te[Dr] = ku.ObjectLiteralProperty(ot, wt);
- }
- }
- }
- function be(Le, Ie, At) {
- const Dr = /* @__PURE__ */ new Set();
- for (const yr of Ie) {
- if (yr.kind !== 172 && yr.kind !== 174 && yr.kind !== 177 && yr.kind !== 178 || ht(yr) || Z_(
- yr,
- 2
- /* Private */
- ) || zs(yr) !== !!(At & 256))
- continue;
- const $r = oS(yr.name);
- $r && Dr.add($r);
- }
- return Le.filter(
- (yr) => !Dr.has(yr.escapedName) && !!yr.declarations && !(lp(yr) & 2) && !(yr.valueDeclaration && Ou(yr.valueDeclaration))
- );
- }
- function Z(Le, Ie) {
- const At = /* @__PURE__ */ new Set(), Dr = /* @__PURE__ */ new Set();
- for (const $r of Ie)
- ht($r) || ($r.kind === 291 ? At.add(X4($r.name)) : Lx($r) && M($r, Dr));
- const yr = Le.filter(($r) => !At.has($r.escapedName));
- return dt(Dr, yr), yr;
- }
- function ht(Le) {
- return Le.getStart(n) <= s && s <= Le.getEnd();
- }
- }
- function NGe(e, t, n) {
- var i;
- if (e) {
- const { parent: s } = e;
- switch (e.kind) {
- case 19:
- case 28:
- if (Ks(s) || Mf(s))
- return s;
- break;
- case 42:
- return hc(s) ? Wn(s.parent, Ks) : void 0;
- case 134:
- return Wn(s.parent, Ks);
- case 80:
- if (e.text === "async" && uu(e.parent))
- return e.parent.parent;
- {
- if (Ks(e.parent.parent) && ($g(e.parent) || uu(e.parent) && Qs(n, e.getEnd()).line !== Qs(n, t).line))
- return e.parent.parent;
- const c = or(s, Qc);
- if (c?.getLastToken(n) === e && Ks(c.parent))
- return c.parent;
- }
- break;
- default:
- if ((i = s.parent) != null && i.parent && (hc(s.parent) || Lf(s.parent) || K_(s.parent)) && Ks(s.parent.parent))
- return s.parent.parent;
- if ($g(s) && Ks(s.parent))
- return s.parent;
- const o = or(s, Qc);
- if (e.kind !== 59 && o?.getLastToken(n) === e && Ks(o.parent))
- return o.parent;
- }
- }
- }
- function iH(e, t) {
- const n = sl(e, t);
- return n && e <= n.end && (Fg(n) || p_(n.kind)) ? { contextToken: sl(
- n.getFullStart(),
- t,
- /*startNode*/
- void 0
- ), previousToken: n } : { contextToken: n, previousToken: n };
- }
- function CEe(e, t, n, i) {
- const s = t.isPackageJsonImport ? i.getPackageJsonAutoImportProvider() : n, o = s.getTypeChecker(), c = t.ambientModuleName ? o.tryFindAmbientModule(t.ambientModuleName) : t.fileName ? o.getMergedSymbol(E.checkDefined(s.getSourceFile(t.fileName)).symbol) : void 0;
- if (!c) return;
- let _ = t.exportName === "export=" ? o.resolveExternalModuleSymbol(c) : o.tryGetMemberInModuleExportsAndProperties(t.exportName, c);
- return _ ? (_ = t.exportName === "default" && N4(_) || _, { symbol: _, origin: bGe(t, e, c) }) : void 0;
- }
- function sH(e, t, n, i, s) {
- if (tGe(n))
- return;
- const o = YHe(n) ? n.symbolName : e.name;
- if (o === void 0 || e.flags & 1536 && n3(o.charCodeAt(0)) || b3(e))
- return;
- const c = { name: o, needsConvertPropertyAccess: !1 };
- if (k_(
- o,
- t,
- s ? 1 : 0
- /* Standard */
- ) || e.valueDeclaration && Ou(e.valueDeclaration))
- return c;
- if (e.flags & 2097152)
- return { name: o, needsConvertPropertyAccess: !0 };
- switch (i) {
- case 3:
- return kle(n) ? { name: n.symbolName, needsConvertPropertyAccess: !1 } : void 0;
- case 0:
- return { name: JSON.stringify(o), needsConvertPropertyAccess: !1 };
- case 2:
- case 1:
- return o.charCodeAt(0) === 32 ? void 0 : { name: o, needsConvertPropertyAccess: !0 };
- case 5:
- case 4:
- return c;
- default:
- E.assertNever(i);
- }
- }
- var aH = [], EEe = Iu(() => {
- const e = [];
- for (let t = 83; t <= 165; t++)
- e.push({
- name: qs(t),
- kind: "keyword",
- kindModifiers: "",
- sortText: ku.GlobalsOrKeywords
- });
- return e;
- });
- function DEe(e, t) {
- if (!t) return PEe(e);
- const n = e + 8 + 1;
- return aH[n] || (aH[n] = PEe(e).filter((i) => !IGe(H2(i.name))));
- }
- function PEe(e) {
- return aH[e] || (aH[e] = EEe().filter((t) => {
- const n = H2(t.name);
- switch (e) {
- case 0:
- return !1;
- case 1:
- return AEe(n) || n === 138 || n === 144 || n === 156 || n === 145 || n === 128 || GD(n) && n !== 157;
- case 5:
- return AEe(n);
- case 2:
- return eL(n);
- case 3:
- return wEe(n);
- case 4:
- return s4(n);
- case 6:
- return GD(n) || n === 87;
- case 7:
- return GD(n);
- case 8:
- return n === 156;
- default:
- return E.assertNever(e);
- }
- }));
- }
- function IGe(e) {
- switch (e) {
- case 128:
- case 133:
- case 163:
- case 136:
- case 138:
- case 94:
- case 162:
- case 119:
- case 140:
- case 120:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 150:
- case 151:
- case 164:
- case 123:
- case 124:
- case 125:
- case 148:
- case 154:
- case 155:
- case 156:
- case 158:
- case 159:
- return !0;
- default:
- return !1;
- }
- }
- function wEe(e) {
- return e === 148;
- }
- function eL(e) {
- switch (e) {
- case 128:
- case 129:
- case 137:
- case 139:
- case 153:
- case 134:
- case 138:
- case 164:
- return !0;
- default:
- return Sj(e);
- }
- }
- function AEe(e) {
- return e === 134 || e === 135 || e === 160 || e === 130 || e === 152 || e === 156 || !L7(e) && !eL(e);
- }
- function oH(e) {
- return Oe(e) ? G2(e) ?? 0 : e.kind;
- }
- function OGe(e, t) {
- const n = [];
- if (e) {
- const i = e.getSourceFile(), s = e.parent, o = i.getLineAndCharacterOfPosition(e.end).line, c = i.getLineAndCharacterOfPosition(t).line;
- (ic(s) || Nc(s) && s.moduleSpecifier) && e === s.moduleSpecifier && o === c && n.push({
- name: qs(
- 132
- /* AssertKeyword */
- ),
- kind: "keyword",
- kindModifiers: "",
- sortText: ku.GlobalsOrKeywords
- });
- }
- return n;
- }
- function FGe(e, t) {
- return or(e, (n) => _C(n) && VD(n, t) ? !0 : Id(n) ? "quit" : !1);
- }
- function cH(e, t, n, i) {
- const s = t && t !== e, o = i.getUnionType(
- Ln(
- e.flags & 1048576 ? e.types : [e],
- (d) => !i.getPromisedTypeOfPromise(d)
- )
- ), c = s && !(t.flags & 3) ? i.getUnionType([o, t]) : o, _ = LGe(c, n, i);
- return c.isClass() && NEe(_) ? [] : s ? Ln(_, u) : _;
- function u(d) {
- return Nr(d.declarations) ? ut(d.declarations, (g) => g.parent !== n) : !0;
- }
- }
- function LGe(e, t, n) {
- return e.isUnion() ? n.getAllPossiblePropertiesOfTypes(Ln(e.types, (i) => !(i.flags & 402784252 || n.isArrayLikeType(i) || n.isTypeInvalidDueToUnionDiscriminant(i, t) || n.typeHasCallOrConstructSignatures(i) || i.isClass() && NEe(i.getApparentProperties())))) : e.getApparentProperties();
- }
- function NEe(e) {
- return ut(e, (t) => !!(lp(t) & 6));
- }
- function lH(e, t) {
- return e.isUnion() ? E.checkEachDefined(t.getAllPossiblePropertiesOfTypes(e.types), "getAllPossiblePropertiesOfTypes() should all be defined") : E.checkEachDefined(e.getApparentProperties(), "getApparentProperties() should all be defined");
- }
- function MGe(e, t, n, i) {
- switch (n.kind) {
- case 352:
- return Wn(n.parent, _x);
- case 1:
- const s = Wn(Ro(Bs(n.parent, Si).statements), _x);
- if (s && !Ya(s, 20, e))
- return s;
- break;
- case 81:
- if (Wn(n.parent, cs))
- return or(n, Zn);
- break;
- case 80: {
- if (G2(n) || cs(n.parent) && n.parent.initializer === n)
- return;
- if (uH(n))
- return or(n, _x);
- }
- }
- if (t) {
- if (n.kind === 137 || Oe(t) && cs(t.parent) && Zn(n))
- return or(t, Zn);
- switch (t.kind) {
- case 64:
- return;
- case 27:
- case 20:
- return uH(n) && n.parent.name === n ? n.parent.parent : Wn(n, _x);
- case 19:
- case 28:
- return Wn(t.parent, _x);
- default:
- if (_x(n)) {
- if (Qs(e, t.getEnd()).line !== Qs(e, i).line)
- return n;
- const s = Zn(t.parent.parent) ? eL : wEe;
- return s(t.kind) || t.kind === 42 || Oe(t) && s(
- G2(t) ?? 0
- /* Unknown */
- ) ? t.parent.parent : void 0;
- }
- return;
- }
- }
- }
- function RGe(e) {
- if (!e) return;
- const t = e.parent;
- switch (e.kind) {
- case 19:
- if (Qu(t))
- return t;
- break;
- case 27:
- case 28:
- case 80:
- if (t.kind === 171 && Qu(t.parent))
- return t.parent;
- break;
- }
- }
- function IEe(e, t) {
- if (!e) return;
- if (fi(e) && ZI(e.parent))
- return t.getTypeArgumentConstraint(e);
- const n = IEe(e.parent, t);
- if (n)
- switch (e.kind) {
- case 171:
- return t.getTypeOfPropertyOfContextualType(n, e.symbol.escapedName);
- case 193:
- case 187:
- case 192:
- return n;
- }
- }
- function uH(e) {
- return e.parent && VI(e.parent) && _x(e.parent.parent);
- }
- function jGe(e, t, n, i) {
- switch (t) {
- case ".":
- case "@":
- return !0;
- case '"':
- case "'":
- case "`":
- return !!n && Bse(n) && i === n.getStart(e) + 1;
- case "#":
- return !!n && Di(n) && !!Ol(n);
- case "<":
- return !!n && n.kind === 30 && (!dn(n.parent) || OEe(n.parent));
- case "/":
- return !!n && (Xa(n) ? !!u3(n) : n.kind === 44 && Jb(n.parent));
- case " ":
- return !!n && nD(n) && n.parent.kind === 307;
- default:
- return E.assertNever(t);
- }
- }
- function OEe({ left: e }) {
- return rc(e);
- }
- function BGe(e, t, n) {
- const i = n.resolveName(
- "self",
- /*location*/
- void 0,
- 111551,
- /*excludeGlobals*/
- !1
- );
- if (i && n.getTypeOfSymbolAtLocation(i, t) === e)
- return !0;
- const s = n.resolveName(
- "global",
- /*location*/
- void 0,
- 111551,
- /*excludeGlobals*/
- !1
- );
- if (s && n.getTypeOfSymbolAtLocation(s, t) === e)
- return !0;
- const o = n.resolveName(
- "globalThis",
- /*location*/
- void 0,
- 111551,
- /*excludeGlobals*/
- !1
- );
- return !!(o && n.getTypeOfSymbolAtLocation(o, t) === e);
- }
- function JGe(e) {
- return !!(e.valueDeclaration && Mu(e.valueDeclaration) & 256 && Zn(e.valueDeclaration.parent));
- }
- function zGe(e, t) {
- const n = t.getContextualType(e);
- if (n)
- return n;
- const i = ag(e.parent);
- if (dn(i) && i.operatorToken.kind === 64 && e === i.left)
- return t.getTypeAtLocation(i);
- if (_t(i))
- return t.getContextualType(i);
- }
- function FEe(e, t) {
- var n, i, s;
- let o, c = !1;
- const _ = u();
- return {
- isKeywordOnlyCompletion: c,
- keywordCompletion: o,
- isNewIdentifierLocation: !!(_ || o === 156),
- isTopLevelTypeOnly: !!((i = (n = Wn(_, ic)) == null ? void 0 : n.importClause) != null && i.isTypeOnly) || !!((s = Wn(_, gl)) != null && s.isTypeOnly),
- couldBeTypeOnlyImportSpecifier: !!_ && MEe(_, e),
- replacementSpan: WGe(_)
- };
- function u() {
- const d = e.parent;
- if (gl(d)) {
- const g = d.getLastToken(t);
- if (Oe(e) && g !== e) {
- o = 161, c = !0;
- return;
- }
- return o = e.kind === 156 ? void 0 : 156, Ile(d.moduleReference) ? d : void 0;
- }
- if (MEe(d, e) && REe(d.parent))
- return d;
- if (Tm(d) || Hg(d)) {
- if (!d.parent.isTypeOnly && (e.kind === 19 || e.kind === 102 || e.kind === 28) && (o = 156), REe(d))
- if (e.kind === 20 || e.kind === 80)
- c = !0, o = 161;
- else
- return d.parent.parent;
- return;
- }
- if (Nc(d) && e.kind === 42 || pp(d) && e.kind === 20) {
- c = !0, o = 161;
- return;
- }
- if (nD(e) && Si(d))
- return o = 156, e;
- if (nD(e) && ic(d))
- return o = 156, Ile(d.moduleSpecifier) ? d : void 0;
- }
- }
- function WGe(e) {
- var t;
- if (!e) return;
- const n = or(e, Nf(ic, gl, Cm)) ?? e, i = n.getSourceFile();
- if (lS(n, i))
- return t_(n, i);
- E.assert(
- n.kind !== 102 && n.kind !== 276
- /* ImportSpecifier */
- );
- const s = n.kind === 272 || n.kind === 351 ? LEe((t = n.importClause) == null ? void 0 : t.namedBindings) ?? n.moduleSpecifier : n.moduleReference, o = {
- pos: n.getFirstToken().getStart(),
- end: s.pos
- };
- if (lS(o, i))
- return L0(o);
- }
- function LEe(e) {
- var t;
- return On(
- (t = Wn(e, Tm)) == null ? void 0 : t.elements,
- (n) => {
- var i;
- return !n.propertyName && ix(n.name.text) && ((i = sl(n.name.pos, e.getSourceFile(), e)) == null ? void 0 : i.kind) !== 28;
- }
- );
- }
- function MEe(e, t) {
- return Zu(e) && (e.isTypeOnly || t === e.name && r9(t));
- }
- function REe(e) {
- if (!Ile(e.parent.parent.moduleSpecifier) || e.parent.name)
- return !1;
- if (Tm(e)) {
- const t = LEe(e);
- return (t ? e.elements.indexOf(t) : e.elements.length) < 2;
- }
- return !0;
- }
- function Ile(e) {
- var t;
- return rc(e) ? !0 : !((t = Wn(Fh(e) ? e.expression : e, Xa)) != null && t.text);
- }
- function UGe(e, t) {
- if (!e) return;
- const n = or(e, (s) => vb(s) || jEe(s) || As(s) ? "quit" : (Ii(s) || zo(s)) && !Fb(s.parent)), i = or(t, (s) => vb(s) || jEe(s) || As(s) ? "quit" : ii(s));
- return n || i;
- }
- function jEe(e) {
- return e.parent && Co(e.parent) && (e.parent.body === e || // const a = () => /**/;
- e.kind === 39);
- }
- function Ole(e, t, n = /* @__PURE__ */ new Map()) {
- return i(e) || i(Hl(e.exportSymbol || e, t));
- function i(s) {
- return !!(s.flags & 788968) || t.isUnknownSymbol(s) || !!(s.flags & 1536) && zp(n, na(s)) && t.getExportsOfModule(s).some((o) => Ole(o, t, n));
- }
- }
- function VGe(e, t) {
- const n = Hl(e, t).declarations;
- return !!Nr(n) && Mi(n, y9);
- }
- function BEe(e, t) {
- if (t.length === 0)
- return !0;
- let n = !1, i, s = 0;
- const o = e.length;
- for (let c = 0; c < o; c++) {
- const _ = e.charCodeAt(c), u = t.charCodeAt(s);
- if ((_ === u || _ === qGe(u)) && (n || (n = i === void 0 || // Beginning of word
- 97 <= i && i <= 122 && 65 <= _ && _ <= 90 || // camelCase transition
- i === 95 && _ !== 95), n && s++, s === t.length))
- return !0;
- i = _;
- }
- return !1;
- }
- function qGe(e) {
- return 97 <= e && e <= 122 ? e - 32 : e;
- }
- function HGe(e) {
- return e === "abstract" || e === "async" || e === "await" || e === "declare" || e === "module" || e === "namespace" || e === "type" || e === "satisfies" || e === "as";
- }
- var _H = {};
- La(_H, {
- getStringLiteralCompletionDetails: () => XGe,
- getStringLiteralCompletions: () => GGe
- });
- var JEe = {
- directory: 0,
- script: 1,
- "external module name": 2
- };
- function Fle() {
- const e = /* @__PURE__ */ new Map();
- function t(n) {
- const i = e.get(n.name);
- (!i || JEe[i.kind] < JEe[n.kind]) && e.set(n.name, n);
- }
- return {
- add: t,
- has: e.has.bind(e),
- values: e.values.bind(e)
- };
- }
- function GGe(e, t, n, i, s, o, c, _, u) {
- if (bse(e, t)) {
- const d = l$e(e, t, o, s);
- return d && zEe(d);
- }
- if (Qx(e, t, n)) {
- if (!n || !Xa(n)) return;
- const d = UEe(e, n, t, o, s, _);
- return $Ge(d, n, e, s, o, c, i, _, t, u);
- }
- }
- function $Ge(e, t, n, i, s, o, c, _, u, d) {
- if (e === void 0)
- return;
- const g = sV(t, u);
- switch (e.kind) {
- case 0:
- return zEe(e.paths);
- case 1: {
- const h = cR();
- return Ple(
- e.symbols,
- h,
- t,
- t,
- n,
- u,
- n,
- i,
- s,
- 99,
- o,
- 4,
- _,
- c,
- /*formatContext*/
- void 0,
- /*isTypeOnlyLocation*/
- void 0,
- /*propertyAccessToConvert*/
- void 0,
- /*jsxIdentifierExpected*/
- void 0,
- /*isJsxInitializer*/
- void 0,
- /*importStatementCompletion*/
- void 0,
- /*recommendedCompletion*/
- void 0,
- /*symbolToOriginInfoMap*/
- void 0,
- /*symbolToSortTextMap*/
- void 0,
- /*isJsxIdentifierExpected*/
- void 0,
- /*isRightOfOpenTag*/
- void 0,
- d
- ), {
- isGlobalCompletion: !1,
- isMemberCompletion: !0,
- isNewIdentifierLocation: e.hasIndexSignature,
- optionalReplacementSpan: g,
- entries: h,
- defaultCommitCharacters: FS(e.hasIndexSignature)
- };
- }
- case 2: {
- const h = t.kind === 15 ? 96 : Ui(nc(t), "'") ? 39 : 34, S = e.types.map((T) => ({
- name: cg(T.value, h),
- kindModifiers: "",
- kind: "string",
- sortText: ku.LocationPriority,
- replacementSpan: iV(t, u),
- commitCharacters: []
- }));
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !1,
- isNewIdentifierLocation: e.isNewIdentifier,
- optionalReplacementSpan: g,
- entries: S,
- defaultCommitCharacters: FS(e.isNewIdentifier)
- };
- }
- default:
- return E.assertNever(e);
- }
- }
- function XGe(e, t, n, i, s, o, c, _) {
- if (!i || !Xa(i)) return;
- const u = UEe(t, i, n, s, o, _);
- return u && QGe(e, i, u, t, s.getTypeChecker(), c);
- }
- function QGe(e, t, n, i, s, o) {
- switch (n.kind) {
- case 0: {
- const c = On(n.paths, (_) => _.name === e);
- return c && K9(e, WEe(c.extension), c.kind, [Jf(e)]);
- }
- case 1: {
- const c = On(n.symbols, (_) => _.name === e);
- return c && Ale(c, c.name, s, i, t, o);
- }
- case 2:
- return On(n.types, (c) => c.value === e) ? K9(e, "", "string", [Jf(e)]) : void 0;
- default:
- return E.assertNever(n);
- }
- }
- function zEe(e) {
- return {
- isGlobalCompletion: !1,
- isMemberCompletion: !1,
- isNewIdentifierLocation: !0,
- entries: e.map(({ name: s, kind: o, span: c, extension: _ }) => ({ name: s, kind: o, kindModifiers: WEe(_), sortText: ku.LocationPriority, replacementSpan: c })),
- defaultCommitCharacters: FS(!0)
- };
- }
- function WEe(e) {
- switch (e) {
- case ".d.ts":
- return ".d.ts";
- case ".js":
- return ".js";
- case ".json":
- return ".json";
- case ".jsx":
- return ".jsx";
- case ".ts":
- return ".ts";
- case ".tsx":
- return ".tsx";
- case ".d.mts":
- return ".d.mts";
- case ".mjs":
- return ".mjs";
- case ".mts":
- return ".mts";
- case ".d.cts":
- return ".d.cts";
- case ".cjs":
- return ".cjs";
- case ".cts":
- return ".cts";
- case ".tsbuildinfo":
- return E.fail("Extension .tsbuildinfo is unsupported.");
- case void 0:
- return "";
- default:
- return E.assertNever(e);
- }
- }
- function UEe(e, t, n, i, s, o) {
- const c = i.getTypeChecker(), _ = Lle(t.parent);
- switch (_.kind) {
- case 201: {
- const B = Lle(_.parent);
- return B.kind === 205 ? { kind: 0, paths: HEe(e, t, i, s, o) } : u(B);
- }
- case 303:
- return Ks(_.parent) && _.name === t ? KGe(c, _.parent) : d() || d(
- 0
- /* None */
- );
- case 212: {
- const { expression: B, argumentExpression: z } = _;
- return t === Ba(z) ? VEe(c.getTypeAtLocation(B)) : void 0;
- }
- case 213:
- case 214:
- case 291:
- if (!m$e(t) && !hf(_)) {
- const B = U8.getArgumentInfoForCompletions(_.kind === 291 ? _.parent : t, n, e, c);
- return B && ZGe(B.invocation, t, B, c) || d(
- 0
- /* None */
- );
- }
- case 272:
- case 278:
- case 283:
- case 351:
- return { kind: 0, paths: HEe(e, t, i, s, o) };
- case 296:
- const g = S9(c, _.parent.clauses), h = d();
- return h ? { kind: 2, types: h.types.filter((B) => !g.hasValue(B.value)), isNewIdentifier: !1 } : void 0;
- case 276:
- case 281:
- const T = _;
- if (T.propertyName && t !== T.propertyName)
- return;
- const C = T.parent, { moduleSpecifier: D } = C.kind === 275 ? C.parent.parent : C.parent;
- if (!D) return;
- const P = c.getSymbolAtLocation(D);
- if (!P) return;
- const I = c.getExportsAndPropertiesOfModule(P), F = new Set(C.elements.map((B) => hb(B.propertyName || B.name)));
- return { kind: 1, symbols: I.filter((B) => B.escapedName !== "default" && !F.has(B.escapedName)), hasIndexSignature: !1 };
- default:
- return d() || d(
- 0
- /* None */
- );
- }
- function u(g) {
- switch (g.kind) {
- case 233:
- case 183: {
- const T = or(_, (C) => C.parent === g);
- return T ? { kind: 2, types: fH(c.getTypeArgumentConstraint(T)), isNewIdentifier: !1 } : void 0;
- }
- case 199:
- const { indexType: h, objectType: S } = g;
- return VD(h, n) ? VEe(c.getTypeFromTypeNode(S)) : void 0;
- case 192: {
- const T = u(Lle(g.parent));
- if (!T)
- return;
- const C = YGe(g, _);
- return T.kind === 1 ? { kind: 1, symbols: T.symbols.filter((D) => !ss(C, D.name)), hasIndexSignature: T.hasIndexSignature } : { kind: 2, types: T.types.filter((D) => !ss(C, D.value)), isNewIdentifier: !1 };
- }
- default:
- return;
- }
- }
- function d(g = 4) {
- const h = fH(u9(t, c, g));
- if (h.length)
- return { kind: 2, types: h, isNewIdentifier: !1 };
- }
- }
- function Lle(e) {
- switch (e.kind) {
- case 196:
- return m3(e);
- case 217:
- return ag(e);
- default:
- return e;
- }
- }
- function YGe(e, t) {
- return Ai(e.types, (n) => n !== t && P0(n) && oa(n.literal) ? n.literal.text : void 0);
- }
- function ZGe(e, t, n, i) {
- let s = !1;
- const o = /* @__PURE__ */ new Map(), c = ou(e) ? E.checkDefined(or(t.parent, km)) : t, _ = i.getCandidateSignaturesForStringLiteralCompletions(e, c), u = ta(_, (d) => {
- if (!Su(d) && n.argumentCount > d.parameters.length) return;
- let g = d.getTypeParameterAtPosition(n.argumentIndex);
- if (ou(e)) {
- const h = i.getTypeOfPropertyOfType(g, q3(c.name));
- h && (g = h);
- }
- return s = s || !!(g.flags & 4), fH(g, o);
- });
- return Nr(u) ? { kind: 2, types: u, isNewIdentifier: s } : void 0;
- }
- function VEe(e) {
- return e && {
- kind: 1,
- symbols: Ln(e.getApparentProperties(), (t) => !(t.valueDeclaration && Ou(t.valueDeclaration))),
- hasIndexSignature: DV(e)
- };
- }
- function KGe(e, t) {
- const n = e.getContextualType(t);
- if (!n) return;
- const i = e.getContextualType(
- t,
- 4
- /* Completions */
- );
- return {
- kind: 1,
- symbols: cH(
- n,
- i,
- t,
- e
- ),
- hasIndexSignature: DV(n)
- };
- }
- function fH(e, t = /* @__PURE__ */ new Map()) {
- return e ? (e = cV(e), e.isUnion() ? ta(e.types, (n) => fH(n, t)) : e.isStringLiteral() && !(e.flags & 1024) && zp(t, e.value) ? [e] : Ue) : Ue;
- }
- function _P(e, t, n) {
- return { name: e, kind: t, extension: n };
- }
- function Mle(e) {
- return _P(
- e,
- "directory",
- /*extension*/
- void 0
- );
- }
- function qEe(e, t, n) {
- const i = _$e(e, t), s = e.length === 0 ? void 0 : Ul(t, e.length);
- return n.map(({ name: o, kind: c, extension: _ }) => o.includes(Vo) || o.includes(CI) ? { name: o, kind: c, extension: _, span: s } : { name: o, kind: c, extension: _, span: i });
- }
- function HEe(e, t, n, i, s) {
- return qEe(t.text, t.getStart(e) + 1, e$e(e, t, n, i, s));
- }
- function e$e(e, t, n, i, s) {
- const o = Wl(t.text), c = Xa(t) ? n.getModeForUsageLocation(e, t) : void 0, _ = e.path, u = Xn(_), d = n.getCompilerOptions(), g = n.getTypeChecker(), h = Rle(d, 1, e, g, s, c);
- return f$e(o) || !d.baseUrl && !d.paths && (H_(o) || $Q(o)) ? t$e(o, u, n, i, _, h) : s$e(o, u, c, n, i, h);
- }
- function Rle(e, t, n, i, s, o) {
- return {
- extensionsToSearch: Np(r$e(e, i)),
- referenceKind: t,
- importingSourceFile: n,
- endingPreference: s?.importModuleSpecifierEnding,
- resolutionMode: o
- };
- }
- function t$e(e, t, n, i, s, o) {
- const c = n.getCompilerOptions();
- return c.rootDirs ? i$e(
- c.rootDirs,
- e,
- t,
- o,
- n,
- i,
- s
- ) : as(R8(
- e,
- t,
- o,
- n,
- i,
- /*moduleSpecifierIsRelative*/
- !0,
- s
- ).values());
- }
- function r$e(e, t) {
- const n = t ? Ai(t.getAmbientModules(), (o) => {
- const c = o.name.slice(1, -1);
- if (!(!c.startsWith("*.") || c.includes("/")))
- return c.slice(1);
- }) : [], i = [...B4(e), n], s = yu(e);
- return n9(s) ? J3(e, i) : i;
- }
- function n$e(e, t, n, i) {
- e = e.map((o) => ul(Os(H_(o) ? o : Bn(t, o))));
- const s = Tc(e, (o) => np(o, n, t, i) ? n.substr(o.length) : void 0);
- return cb(
- [...e.map((o) => Bn(o, s)), n].map((o) => W1(o)),
- ub,
- au
- );
- }
- function i$e(e, t, n, i, s, o, c) {
- const u = s.getCompilerOptions().project || o.getCurrentDirectory(), d = !(o.useCaseSensitiveFileNames && o.useCaseSensitiveFileNames()), g = n$e(e, u, n, d);
- return cb(
- ta(g, (h) => as(R8(
- t,
- h,
- i,
- s,
- o,
- /*moduleSpecifierIsRelative*/
- !0,
- c
- ).values())),
- (h, S) => h.name === S.name && h.kind === S.kind && h.extension === S.extension
- );
- }
- function R8(e, t, n, i, s, o, c, _ = Fle()) {
- var u;
- e === void 0 && (e = ""), e = Wl(e), xy(e) || (e = Xn(e)), e === "" && (e = "." + Vo), e = ul(e);
- const d = z1(t, e), g = xy(d) ? d : Xn(d);
- if (!o) {
- const C = Use(g, s);
- if (C) {
- const P = I4(C, s).typesVersions;
- if (typeof P == "object") {
- const I = (u = AO(P)) == null ? void 0 : u.paths;
- if (I) {
- const F = Xn(C), O = d.slice(ul(F).length);
- if ($Ee(_, O, F, n, i, s, I))
- return _;
- }
- }
- }
- }
- const h = !(s.useCaseSensitiveFileNames && s.useCaseSensitiveFileNames());
- if (!d9(s, g)) return _;
- const S = AV(
- s,
- g,
- n.extensionsToSearch,
- /*exclude*/
- void 0,
- /*include*/
- ["./*"]
- );
- if (S)
- for (let C of S) {
- if (C = Os(C), c && Sh(C, c, t, h) === 0)
- continue;
- const { name: D, extension: P } = GEe(
- Hc(C),
- i,
- n,
- /*isExportsWildcard*/
- !1
- );
- _.add(_P(D, "script", P));
- }
- const T = p9(s, g);
- if (T)
- for (const C of T) {
- const D = Hc(Os(C));
- D !== "@types" && _.add(Mle(D));
- }
- return _;
- }
- function GEe(e, t, n, i) {
- const s = N0.tryGetRealFileNameForNonJsDeclarationFileName(e);
- if (s)
- return { name: s, extension: Vg(s) };
- if (n.referenceKind === 0)
- return { name: e, extension: Vg(e) };
- let o = N0.getModuleSpecifierPreferences(
- { importModuleSpecifierEnding: n.endingPreference },
- t,
- t.getCompilerOptions(),
- n.importingSourceFile
- ).getAllowedEndingsInPreferredOrder(n.resolutionMode);
- if (i && (o = o.filter(
- (_) => _ !== 0 && _ !== 1
- /* Index */
- )), o[0] === 3) {
- if (xc(e, B3))
- return { name: e, extension: Vg(e) };
- const _ = N0.tryGetJSExtensionForFile(e, t.getCompilerOptions());
- return _ ? { name: zy(e, _), extension: _ } : { name: e, extension: Vg(e) };
- }
- if (!i && (o[0] === 0 || o[0] === 1) && xc(e, [
- ".js",
- ".jsx",
- ".ts",
- ".tsx",
- ".d.ts"
- /* Dts */
- ]))
- return { name: $u(e), extension: Vg(e) };
- const c = N0.tryGetJSExtensionForFile(e, t.getCompilerOptions());
- return c ? { name: zy(e, c), extension: c } : { name: e, extension: Vg(e) };
- }
- function $Ee(e, t, n, i, s, o, c) {
- const _ = (d) => c[d], u = (d, g) => {
- const h = BC(d), S = BC(g), T = typeof h == "object" ? h.prefix.length : d.length, C = typeof S == "object" ? S.prefix.length : g.length;
- return ho(C, T);
- };
- return XEe(
- e,
- /*isExports*/
- !1,
- t,
- n,
- i,
- s,
- o,
- rm(c),
- _,
- u
- );
- }
- function XEe(e, t, n, i, s, o, c, _, u, d) {
- let g = [], h;
- for (const S of _) {
- if (S === ".") continue;
- const T = S.replace(/^\.\//, ""), C = u(S);
- if (C) {
- const D = BC(T);
- if (!D) continue;
- const P = typeof D == "object" && mI(D, n);
- P && (h === void 0 || d(S, h) === -1) && (h = S, g = g.filter((F) => !F.matchedPattern)), (typeof D == "string" || h === void 0 || d(S, h) !== 1) && g.push({
- matchedPattern: P,
- results: a$e(T, C, n, i, s, t && P, o, c).map(({ name: F, kind: O, extension: B }) => _P(F, O, B))
- });
- }
- }
- return g.forEach((S) => S.results.forEach((T) => e.add(T))), h !== void 0;
- }
- function s$e(e, t, n, i, s, o) {
- const c = i.getTypeChecker(), _ = i.getCompilerOptions(), { baseUrl: u, paths: d } = _, g = Fle(), h = yu(_);
- if (u) {
- const T = Os(Bn(s.getCurrentDirectory(), u));
- R8(
- e,
- T,
- o,
- i,
- s,
- /*moduleSpecifierIsRelative*/
- !1,
- /*exclude*/
- void 0,
- g
- );
- }
- if (d) {
- const T = U7(_, s);
- $Ee(g, e, T, o, i, s, d);
- }
- const S = YEe(e);
- for (const T of c$e(e, S, c))
- g.add(_P(
- T,
- "external module name",
- /*extension*/
- void 0
- ));
- if (e4e(s, i, t, S, o, g), n9(h)) {
- let T = !1;
- if (S === void 0)
- for (const C of u$e(s, t)) {
- const D = _P(
- C,
- "external module name",
- /*extension*/
- void 0
- );
- g.has(D.name) || (T = !0, g.add(D));
- }
- if (!T) {
- let C = (D) => {
- const P = Bn(D, "node_modules");
- d9(s, P) && R8(
- e,
- P,
- o,
- i,
- s,
- /*moduleSpecifierIsRelative*/
- !1,
- /*exclude*/
- void 0,
- g
- );
- };
- if (S && M3(_)) {
- const D = C;
- C = (P) => {
- const I = Cl(e);
- I.shift();
- let F = I.shift();
- if (!F)
- return D(P);
- if (Ui(F, "@")) {
- const z = I.shift();
- if (!z)
- return D(P);
- F = Bn(F, z);
- }
- const O = Bn(P, "node_modules", F), B = Bn(O, "package.json");
- if (m8(s, B)) {
- const X = I4(B, s).exports;
- if (X) {
- if (typeof X != "object" || X === null)
- return;
- const q = rm(X), V = I.join("/") + (I.length && xy(e) ? "/" : ""), ae = Qy(_, n);
- XEe(
- g,
- /*isExports*/
- !0,
- V,
- O,
- o,
- i,
- s,
- q,
- (ee) => MT(QEe(X[ee], ae)),
- zz
- );
- return;
- }
- }
- return D(P);
- };
- }
- Fp(t, C);
- }
- }
- return as(g.values());
- }
- function QEe(e, t) {
- if (typeof e == "string")
- return e;
- if (e && typeof e == "object" && !us(e)) {
- for (const n in e)
- if (n === "default" || t.includes(n) || CA(t, n)) {
- const i = e[n];
- return QEe(i, t);
- }
- }
- }
- function YEe(e) {
- return jle(e) ? xy(e) ? e : Xn(e) : void 0;
- }
- function a$e(e, t, n, i, s, o, c, _) {
- if (!Zo(e, "*"))
- return e.includes("*") ? Ue : g(
- e,
- "script"
- /* scriptElement */
- );
- const u = e.slice(0, e.length - 1), d = xR(n, u);
- if (d === void 0)
- return e[e.length - 2] === "/" ? g(
- u,
- "directory"
- /* directory */
- ) : ta(t, (S) => {
- var T;
- return (T = ZEe("", i, S, s, o, c, _)) == null ? void 0 : T.map(({ name: C, ...D }) => ({ name: u + C, ...D }));
- });
- return ta(t, (h) => ZEe(d, i, h, s, o, c, _));
- function g(h, S) {
- return Ui(h, n) ? [{ name: W1(h), kind: S, extension: void 0 }] : Ue;
- }
- }
- function ZEe(e, t, n, i, s, o, c) {
- if (!c.readDirectory)
- return;
- const _ = BC(n);
- if (_ === void 0 || _s(_))
- return;
- const u = z1(_.prefix), d = xy(_.prefix) ? u : Xn(u), g = xy(_.prefix) ? "" : Hc(u), h = jle(e), S = h ? xy(e) ? e : Xn(e) : void 0, T = h ? Bn(d, g + S) : d, C = Os(_.suffix), D = C && W7("_" + C), P = D ? [zy(C, D), C] : [C], I = Os(Bn(t, T)), F = h ? I : ul(I) + g, O = C ? P.map((q) => "**/*" + q) : ["./*"], B = Ai(AV(
- c,
- I,
- i.extensionsToSearch,
- /*exclude*/
- void 0,
- O
- ), (q) => {
- const V = X(q);
- if (V) {
- if (jle(V))
- return Mle(Cl(KEe(V))[1]);
- const { name: ae, extension: ee } = GEe(V, o, i, s);
- return _P(ae, "script", ee);
- }
- }), z = C ? Ue : Ai(p9(c, I), (q) => q === "node_modules" ? void 0 : Mle(q));
- return [...B, ...z];
- function X(q) {
- return Tc(P, (V) => {
- const ae = o$e(Os(q), F, V);
- return ae === void 0 ? void 0 : KEe(ae);
- });
- }
- }
- function o$e(e, t, n) {
- return Ui(e, t) && Zo(e, n) ? e.slice(t.length, e.length - n.length) : void 0;
- }
- function KEe(e) {
- return e[0] === Vo ? e.slice(1) : e;
- }
- function c$e(e, t, n) {
- const s = n.getAmbientModules().map((o) => ap(o.name)).filter((o) => Ui(o, e) && !o.includes("*"));
- if (t !== void 0) {
- const o = ul(t);
- return s.map((c) => FE(c, o));
- }
- return s;
- }
- function l$e(e, t, n, i) {
- const s = n.getCompilerOptions(), o = xi(e, t), c = Ig(e.text, o.pos), _ = c && On(c, (D) => t >= D.pos && t <= D.end);
- if (!_)
- return;
- const u = e.text.slice(_.pos, t), d = p$e.exec(u);
- if (!d)
- return;
- const [, g, h, S] = d, T = Xn(e.path), C = h === "path" ? R8(
- S,
- T,
- Rle(s, 0, e),
- n,
- i,
- /*moduleSpecifierIsRelative*/
- !0,
- e.path
- ) : h === "types" ? e4e(i, n, T, YEe(S), Rle(s, 1, e)) : E.fail();
- return qEe(S, _.pos + g.length, as(C.values()));
- }
- function e4e(e, t, n, i, s, o = Fle()) {
- const c = t.getCompilerOptions(), _ = /* @__PURE__ */ new Map(), u = m9(() => TD(c, e)) || Ue;
- for (const g of u)
- d(g);
- for (const g of NV(n, e)) {
- const h = Bn(Xn(g), "node_modules/@types");
- d(h);
- }
- return o;
- function d(g) {
- if (d9(e, g))
- for (const h of p9(e, g)) {
- const S = EA(h);
- if (!(c.types && !ss(c.types, S)))
- if (i === void 0)
- _.has(S) || (o.add(_P(
- S,
- "external module name",
- /*extension*/
- void 0
- )), _.set(S, !0));
- else {
- const T = Bn(g, h), C = tJ(i, S, S0(e));
- C !== void 0 && R8(
- C,
- T,
- s,
- t,
- e,
- /*moduleSpecifierIsRelative*/
- !1,
- /*exclude*/
- void 0,
- o
- );
- }
- }
- }
- }
- function u$e(e, t) {
- if (!e.readFile || !e.fileExists) return Ue;
- const n = [];
- for (const i of NV(t, e)) {
- const s = I4(i, e);
- for (const o of d$e) {
- const c = s[o];
- if (c)
- for (const _ in c)
- co(c, _) && !Ui(_, "@types/") && n.push(_);
- }
- }
- return n;
- }
- function _$e(e, t) {
- const n = Math.max(e.lastIndexOf(Vo), e.lastIndexOf(CI)), i = n !== -1 ? n + 1 : 0, s = e.length - i;
- return s === 0 || k_(
- e.substr(i, s),
- 99
- /* ESNext */
- ) ? void 0 : Ul(t + i, s);
- }
- function f$e(e) {
- if (e && e.length >= 2 && e.charCodeAt(0) === 46) {
- const t = e.length >= 3 && e.charCodeAt(1) === 46 ? 2 : 1, n = e.charCodeAt(t);
- return n === 47 || n === 92;
- }
- return !1;
- }
- var p$e = /^(\/\/\/\s* lk,
- DefinitionKind: () => o4e,
- EntryKind: () => c4e,
- ExportKind: () => t4e,
- FindReferencesUse: () => l4e,
- ImportExport: () => r4e,
- createImportTracker: () => Ble,
- findModuleReferences: () => n4e,
- findReferenceOrRenameEntries: () => w$e,
- findReferencedSymbols: () => E$e,
- getContextNode: () => LS,
- getExportInfo: () => Jle,
- getImplementationsAtPosition: () => P$e,
- getImportOrExportSymbol: () => a4e,
- getReferenceEntriesForNode: () => _4e,
- isContextWithStartAndEndNode: () => Wle,
- isDeclarationOfSymbol: () => g4e,
- isWriteAccessForReference: () => Vle,
- toContextSpan: () => Ule,
- toHighlightSpan: () => M$e,
- toReferenceEntry: () => d4e,
- toRenameLocation: () => N$e
- });
- function Ble(e, t, n, i) {
- const s = v$e(e, n, i);
- return (o, c, _) => {
- const { directImports: u, indirectUsers: d } = g$e(e, t, s, c, n, i);
- return { indirectUsers: d, ...h$e(u, o, c.exportKind, n, _) };
- };
- }
- var t4e = /* @__PURE__ */ ((e) => (e[e.Named = 0] = "Named", e[e.Default = 1] = "Default", e[e.ExportEquals = 2] = "ExportEquals", e))(t4e || {}), r4e = /* @__PURE__ */ ((e) => (e[e.Import = 0] = "Import", e[e.Export = 1] = "Export", e))(r4e || {});
- function g$e(e, t, n, { exportingModuleSymbol: i, exportKind: s }, o, c) {
- const _ = x6(), u = x6(), d = [], g = !!i.globalExports, h = g ? void 0 : [];
- return T(i), { directImports: d, indirectUsers: S() };
- function S() {
- if (g)
- return e;
- if (i.declarations)
- for (const O of i.declarations)
- yb(O) && t.has(O.getSourceFile().fileName) && I(O);
- return h.map(Tr);
- }
- function T(O) {
- const B = F(O);
- if (B) {
- for (const z of B)
- if (_(z))
- switch (c && c.throwIfCancellationRequested(), z.kind) {
- case 213:
- if (hf(z)) {
- C(z);
- break;
- }
- if (!g) {
- const q = z.parent;
- if (s === 2 && q.kind === 260) {
- const { name: V } = q;
- if (V.kind === 80) {
- d.push(V);
- break;
- }
- }
- }
- break;
- case 80:
- break;
- case 271:
- P(
- z,
- z.name,
- Gn(
- z,
- 32
- /* Export */
- ),
- /*alreadyAddedDirect*/
- !1
- );
- break;
- case 272:
- case 351:
- d.push(z);
- const X = z.importClause && z.importClause.namedBindings;
- X && X.kind === 274 ? P(
- z,
- X.name,
- /*isReExport*/
- !1,
- /*alreadyAddedDirect*/
- !0
- ) : !g && ex(z) && I(tL(z));
- break;
- case 278:
- z.exportClause ? z.exportClause.kind === 280 ? I(
- tL(z),
- /*addTransitiveDependencies*/
- !0
- ) : d.push(z) : T(k$e(z, o));
- break;
- case 205:
- !g && z.isTypeOf && !z.qualifier && D(z) && I(
- z.getSourceFile(),
- /*addTransitiveDependencies*/
- !0
- ), d.push(z);
- break;
- default:
- E.failBadSyntaxKind(z, "Unexpected import kind.");
- }
- }
- }
- function C(O) {
- const B = or(O, pH) || O.getSourceFile();
- I(
- B,
- /** addTransitiveDependencies */
- !!D(
- O,
- /*stopAtAmbientModule*/
- !0
- )
- );
- }
- function D(O, B = !1) {
- return or(O, (z) => B && pH(z) ? "quit" : Hp(z) && ut(z.modifiers, Cx));
- }
- function P(O, B, z, X) {
- if (s === 2)
- X || d.push(O);
- else if (!g) {
- const q = tL(O);
- E.assert(
- q.kind === 307 || q.kind === 267
- /* ModuleDeclaration */
- ), z || y$e(q, B, o) ? I(
- q,
- /*addTransitiveDependencies*/
- !0
- ) : I(q);
- }
- }
- function I(O, B = !1) {
- if (E.assert(!g), !u(O) || (h.push(O), !B)) return;
- const X = o.getMergedSymbol(O.symbol);
- if (!X) return;
- E.assert(!!(X.flags & 1536));
- const q = F(X);
- if (q)
- for (const V of q)
- bm(V) || I(
- tL(V),
- /*addTransitiveDependencies*/
- !0
- );
- }
- function F(O) {
- return n.get(na(O).toString());
- }
- }
- function h$e(e, t, n, i, s) {
- const o = [], c = [];
- function _(S, T) {
- o.push([S, T]);
- }
- if (e)
- for (const S of e)
- u(S);
- return { importSearches: o, singleReferences: c };
- function u(S) {
- if (S.kind === 271) {
- zle(S) && d(S.name);
- return;
- }
- if (S.kind === 80) {
- d(S);
- return;
- }
- if (S.kind === 205) {
- if (S.qualifier) {
- const D = E_(S.qualifier);
- D.escapedText === mc(t) && c.push(D);
- } else n === 2 && c.push(S.argument.literal);
- return;
- }
- if (S.moduleSpecifier.kind !== 11)
- return;
- if (S.kind === 278) {
- S.exportClause && pp(S.exportClause) && g(S.exportClause);
- return;
- }
- const { name: T, namedBindings: C } = S.importClause || { name: void 0, namedBindings: void 0 };
- if (C)
- switch (C.kind) {
- case 274:
- d(C.name);
- break;
- case 275:
- (n === 0 || n === 1) && g(C);
- break;
- default:
- E.assertNever(C);
- }
- if (T && (n === 1 || n === 2) && (!s || T.escapedText === i9(t))) {
- const D = i.getSymbolAtLocation(T);
- _(T, D);
- }
- }
- function d(S) {
- n === 2 && (!s || h(S.escapedText)) && _(S, i.getSymbolAtLocation(S));
- }
- function g(S) {
- if (S)
- for (const T of S.elements) {
- const { name: C, propertyName: D } = T;
- if (h(hb(D || C)))
- if (D)
- c.push(D), (!s || hb(C) === t.escapedName) && _(C, i.getSymbolAtLocation(C));
- else {
- const P = T.kind === 281 && T.propertyName ? i.getExportSpecifierLocalTargetSymbol(T) : i.getSymbolAtLocation(C);
- _(C, P);
- }
- }
- }
- function h(S) {
- return S === t.escapedName || n !== 0 && S === "default";
- }
- }
- function y$e(e, t, n) {
- const i = n.getSymbolAtLocation(t);
- return !!i4e(e, (s) => {
- if (!Nc(s)) return;
- const { exportClause: o, moduleSpecifier: c } = s;
- return !c && o && pp(o) && o.elements.some((_) => n.getExportSpecifierLocalTargetSymbol(_) === i);
- });
- }
- function n4e(e, t, n) {
- var i;
- const s = [], o = e.getTypeChecker();
- for (const c of t) {
- const _ = n.valueDeclaration;
- if (_?.kind === 307) {
- for (const u of c.referencedFiles)
- e.getSourceFileFromReference(c, u) === _ && s.push({ kind: "reference", referencingFile: c, ref: u });
- for (const u of c.typeReferenceDirectives) {
- const d = (i = e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(u, c)) == null ? void 0 : i.resolvedTypeReferenceDirective;
- d !== void 0 && d.resolvedFileName === _.fileName && s.push({ kind: "reference", referencingFile: c, ref: u });
- }
- }
- s4e(c, (u, d) => {
- o.getSymbolAtLocation(d) === n && s.push(fo(u) ? { kind: "implicit", literal: d, referencingFile: c } : { kind: "import", literal: d });
- });
- }
- return s;
- }
- function v$e(e, t, n) {
- const i = /* @__PURE__ */ new Map();
- for (const s of e)
- n && n.throwIfCancellationRequested(), s4e(s, (o, c) => {
- const _ = t.getSymbolAtLocation(c);
- if (_) {
- const u = na(_).toString();
- let d = i.get(u);
- d || i.set(u, d = []), d.push(o);
- }
- });
- return i;
- }
- function i4e(e, t) {
- return ir(e.kind === 307 ? e.statements : e.body.statements, (n) => (
- // TODO: GH#18217
- t(n) || pH(n) && ir(n.body && n.body.statements, t)
- ));
- }
- function s4e(e, t) {
- if (e.externalModuleIndicator || e.imports !== void 0)
- for (const n of e.imports)
- t(v4(n), n);
- else
- i4e(e, (n) => {
- switch (n.kind) {
- case 278:
- case 272: {
- const i = n;
- i.moduleSpecifier && oa(i.moduleSpecifier) && t(i, i.moduleSpecifier);
- break;
- }
- case 271: {
- const i = n;
- zle(i) && t(i, i.moduleReference.expression);
- break;
- }
- }
- });
- }
- function a4e(e, t, n, i) {
- return i ? s() : s() || o();
- function s() {
- var u;
- const { parent: d } = e, g = d.parent;
- if (t.exportSymbol)
- return d.kind === 211 ? (u = t.declarations) != null && u.some((T) => T === d) && dn(g) ? S(
- g,
- /*useLhsSymbol*/
- !1
- ) : void 0 : c(t.exportSymbol, _(d));
- {
- const T = S$e(d, e);
- if (T && Gn(
- T,
- 32
- /* Export */
- ))
- return gl(T) && T.moduleReference === e ? i ? void 0 : { kind: 0, symbol: n.getSymbolAtLocation(T.name) } : c(t, _(T));
- if (ug(d))
- return c(
- t,
- 0
- /* Named */
- );
- if (wo(d))
- return h(d);
- if (wo(g))
- return h(g);
- if (dn(d))
- return S(
- d,
- /*useLhsSymbol*/
- !0
- );
- if (dn(g))
- return S(
- g,
- /*useLhsSymbol*/
- !0
- );
- if (SS(d) || JJ(d))
- return c(
- t,
- 0
- /* Named */
- );
- }
- function h(T) {
- if (!T.symbol.parent) return;
- const C = T.isExportEquals ? 2 : 1;
- return { kind: 1, symbol: t, exportInfo: { exportingModuleSymbol: T.symbol.parent, exportKind: C } };
- }
- function S(T, C) {
- let D;
- switch (Cc(T)) {
- case 1:
- D = 0;
- break;
- case 2:
- D = 2;
- break;
- default:
- return;
- }
- const P = C ? n.getSymbolAtLocation(GB(Bs(T.left, xo))) : t;
- return P && c(P, D);
- }
- }
- function o() {
- if (!T$e(e)) return;
- let d = n.getImmediateAliasedSymbol(t);
- if (!d || (d = x$e(d, n), d.escapedName === "export=" && (d = b$e(d, n), d === void 0)))
- return;
- const g = i9(d);
- if (g === void 0 || g === "default" || g === t.escapedName)
- return { kind: 0, symbol: d };
- }
- function c(u, d) {
- const g = Jle(u, d, n);
- return g && { kind: 1, symbol: u, exportInfo: g };
- }
- function _(u) {
- return Gn(
- u,
- 2048
- /* Default */
- ) ? 1 : 0;
- }
- }
- function b$e(e, t) {
- var n, i;
- if (e.flags & 2097152)
- return t.getImmediateAliasedSymbol(e);
- const s = E.checkDefined(e.valueDeclaration);
- if (wo(s))
- return (n = Wn(s.expression, kd)) == null ? void 0 : n.symbol;
- if (dn(s))
- return (i = Wn(s.right, kd)) == null ? void 0 : i.symbol;
- if (Si(s))
- return s.symbol;
- }
- function S$e(e, t) {
- const n = ii(e) ? e : va(e) ? JT(e) : void 0;
- return n ? e.name !== t || Ub(n.parent) ? void 0 : yc(n.parent.parent) ? n.parent.parent : void 0 : e;
- }
- function T$e(e) {
- const { parent: t } = e;
- switch (t.kind) {
- case 271:
- return t.name === e && zle(t);
- case 276:
- return !t.propertyName;
- case 273:
- case 274:
- return E.assert(t.name === e), !0;
- case 208:
- return cn(e) && Sb(t.parent.parent);
- default:
- return !1;
- }
- }
- function Jle(e, t, n) {
- const i = e.parent;
- if (!i) return;
- const s = n.getMergedSymbol(i);
- return fC(s) ? { exportingModuleSymbol: s, exportKind: t } : void 0;
- }
- function x$e(e, t) {
- if (e.declarations)
- for (const n of e.declarations) {
- if (vu(n) && !n.propertyName && !n.parent.parent.moduleSpecifier)
- return t.getExportSpecifierLocalTargetSymbol(n) || e;
- if (Cn(n) && jg(n.expression) && !Di(n.name))
- return t.getSymbolAtLocation(n);
- if (uu(n) && dn(n.parent.parent) && Cc(n.parent.parent) === 2)
- return t.getExportSpecifierLocalTargetSymbol(n.name);
- }
- return e;
- }
- function k$e(e, t) {
- return t.getMergedSymbol(tL(e).symbol);
- }
- function tL(e) {
- if (e.kind === 213 || e.kind === 351)
- return e.getSourceFile();
- const { parent: t } = e;
- return t.kind === 307 ? t : (E.assert(
- t.kind === 268
- /* ModuleBlock */
- ), Bs(t.parent, pH));
- }
- function pH(e) {
- return e.kind === 267 && e.name.kind === 11;
- }
- function zle(e) {
- return e.moduleReference.kind === 283 && e.moduleReference.expression.kind === 11;
- }
- var o4e = /* @__PURE__ */ ((e) => (e[e.Symbol = 0] = "Symbol", e[e.Label = 1] = "Label", e[e.Keyword = 2] = "Keyword", e[e.This = 3] = "This", e[e.String = 4] = "String", e[e.TripleSlashReference = 5] = "TripleSlashReference", e))(o4e || {}), c4e = /* @__PURE__ */ ((e) => (e[e.Span = 0] = "Span", e[e.Node = 1] = "Node", e[e.StringLiteral = 2] = "StringLiteral", e[e.SearchedLocalFoundProperty = 3] = "SearchedLocalFoundProperty", e[e.SearchedPropertyFoundLocal = 4] = "SearchedPropertyFoundLocal", e))(c4e || {});
- function Jh(e, t = 1) {
- return {
- kind: t,
- node: e.name || e,
- context: C$e(e)
- };
- }
- function Wle(e) {
- return e && e.kind === void 0;
- }
- function C$e(e) {
- if (ql(e))
- return LS(e);
- if (e.parent) {
- if (!ql(e.parent) && !wo(e.parent)) {
- if (cn(e)) {
- const n = dn(e.parent) ? e.parent : xo(e.parent) && dn(e.parent.parent) && e.parent.parent.left === e.parent ? e.parent.parent : void 0;
- if (n && Cc(n) !== 0)
- return LS(n);
- }
- if (xm(e.parent) || Jb(e.parent))
- return e.parent.parent;
- if (yS(e.parent) || Gy(e.parent) || t4(e.parent))
- return e.parent;
- if (Xa(e)) {
- const n = u3(e);
- if (n) {
- const i = or(n, (s) => ql(s) || bi(s) || _C(s));
- return ql(i) ? LS(i) : i;
- }
- }
- const t = or(e, ma);
- return t ? LS(t.parent) : void 0;
- }
- if (e.parent.name === e || // node is name of declaration, use parent
- Qo(e.parent) || wo(e.parent) || // Property name of the import export specifier or binding pattern, use parent
- (G1(e.parent) || va(e.parent)) && e.parent.propertyName === e || // Is default export
- e.kind === 90 && Gn(
- e.parent,
- 2080
- /* ExportDefault */
- ))
- return LS(e.parent);
- }
- }
- function LS(e) {
- if (e)
- switch (e.kind) {
- case 260:
- return !Fl(e.parent) || e.parent.declarations.length !== 1 ? e : yc(e.parent.parent) ? e.parent.parent : Z2(e.parent.parent) ? LS(e.parent.parent) : e.parent;
- case 208:
- return LS(e.parent.parent);
- case 276:
- return e.parent.parent.parent;
- case 281:
- case 274:
- return e.parent.parent;
- case 273:
- case 280:
- return e.parent;
- case 226:
- return Pl(e.parent) ? e.parent : e;
- case 250:
- case 249:
- return {
- start: e.initializer,
- end: e.expression
- };
- case 303:
- case 304:
- return F0(e.parent) ? LS(
- or(e.parent, (t) => dn(t) || Z2(t))
- ) : e;
- case 255:
- return {
- start: On(
- e.getChildren(e.getSourceFile()),
- (t) => t.kind === 109
- /* SwitchKeyword */
- ),
- end: e.caseBlock
- };
- default:
- return e;
- }
- }
- function Ule(e, t, n) {
- if (!n) return;
- const i = Wle(n) ? nL(n.start, t, n.end) : nL(n, t);
- return i.start !== e.start || i.length !== e.length ? { contextSpan: i } : void 0;
- }
- var l4e = /* @__PURE__ */ ((e) => (e[e.Other = 0] = "Other", e[e.References = 1] = "References", e[e.Rename = 2] = "Rename", e))(l4e || {});
- function E$e(e, t, n, i, s) {
- const o = h_(i, s), c = {
- use: 1
- /* References */
- }, _ = lk.getReferencedSymbolsForNode(s, o, e, n, t, c), u = e.getTypeChecker(), d = lk.getAdjustedNode(o, c), g = D$e(d) ? u.getSymbolAtLocation(d) : void 0;
- return !_ || !_.length ? void 0 : Ai(_, ({ definition: h, references: S }) => (
- // Only include referenced symbols that have a valid definition.
- h && {
- definition: u.runWithCancellationToken(t, (T) => A$e(h, T, o)),
- references: S.map((T) => I$e(T, g))
- }
- ));
- }
- function D$e(e) {
- return e.kind === 90 || !!S4(e) || g3(e) || e.kind === 137 && Qo(e.parent);
- }
- function P$e(e, t, n, i, s) {
- const o = h_(i, s);
- let c;
- const _ = u4e(e, t, n, o, s);
- if (o.parent.kind === 211 || o.parent.kind === 208 || o.parent.kind === 212 || o.kind === 108)
- c = _ && [..._];
- else if (_) {
- const d = iw(_), g = /* @__PURE__ */ new Map();
- for (; !d.isEmpty(); ) {
- const h = d.dequeue();
- if (!zp(g, Ma(h.node)))
- continue;
- c = wr(c, h);
- const S = u4e(e, t, n, h.node, h.node.pos);
- S && d.enqueue(...S);
- }
- }
- const u = e.getTypeChecker();
- return lr(c, (d) => F$e(d, u));
- }
- function u4e(e, t, n, i, s) {
- if (i.kind === 307)
- return;
- const o = e.getTypeChecker();
- if (i.parent.kind === 304) {
- const c = [];
- return lk.getReferenceEntriesForShorthandPropertyAssignment(i, o, (_) => c.push(Jh(_))), c;
- } else if (i.kind === 108 || C_(i.parent)) {
- const c = o.getSymbolAtLocation(i);
- return c.valueDeclaration && [Jh(c.valueDeclaration)];
- } else
- return _4e(s, i, e, n, t, {
- implementations: !0,
- use: 1
- /* References */
- });
- }
- function w$e(e, t, n, i, s, o, c) {
- return lr(f4e(lk.getReferencedSymbolsForNode(s, i, e, n, t, o)), (_) => c(_, i, e.getTypeChecker()));
- }
- function _4e(e, t, n, i, s, o = {}, c = new Set(i.map((_) => _.fileName))) {
- return f4e(lk.getReferencedSymbolsForNode(e, t, n, i, s, o, c));
- }
- function f4e(e) {
- return e && ta(e, (t) => t.references);
- }
- function A$e(e, t, n) {
- const i = (() => {
- switch (e.type) {
- case 0: {
- const { symbol: g } = e, { displayParts: h, kind: S } = p4e(g, t, n), T = h.map((P) => P.text).join(""), C = g.declarations && el(g.declarations), D = C ? os(C) || C : n;
- return {
- ...rL(D),
- name: T,
- kind: S,
- displayParts: h,
- context: LS(C)
- };
- }
- case 1: {
- const { node: g } = e;
- return { ...rL(g), name: g.text, kind: "label", displayParts: [w_(
- g.text,
- 17
- /* text */
- )] };
- }
- case 2: {
- const { node: g } = e, h = qs(g.kind);
- return { ...rL(g), name: h, kind: "keyword", displayParts: [{
- text: h,
- kind: "keyword"
- /* keyword */
- }] };
- }
- case 3: {
- const { node: g } = e, h = t.getSymbolAtLocation(g), S = h && j0.getSymbolDisplayPartsDocumentationAndSymbolKind(
- t,
- h,
- g.getSourceFile(),
- AS(g),
- g
- ).displayParts || [Jf("this")];
- return { ...rL(g), name: "this", kind: "var", displayParts: S };
- }
- case 4: {
- const { node: g } = e;
- return {
- ...rL(g),
- name: g.text,
- kind: "var",
- displayParts: [w_(
- nc(g),
- 8
- /* stringLiteral */
- )]
- };
- }
- case 5:
- return {
- textSpan: L0(e.reference),
- sourceFile: e.file,
- name: e.reference.fileName,
- kind: "string",
- displayParts: [w_(
- `"${e.reference.fileName}"`,
- 8
- /* stringLiteral */
- )]
- };
- default:
- return E.assertNever(e);
- }
- })(), { sourceFile: s, textSpan: o, name: c, kind: _, displayParts: u, context: d } = i;
- return {
- containerKind: "",
- containerName: "",
- fileName: s.fileName,
- kind: _,
- name: c,
- textSpan: o,
- displayParts: u,
- ...Ule(o, s, d)
- };
- }
- function rL(e) {
- const t = e.getSourceFile();
- return {
- sourceFile: t,
- textSpan: nL(ma(e) ? e.expression : e, t)
- };
- }
- function p4e(e, t, n) {
- const i = lk.getIntersectingMeaningFromDeclarations(n, e), s = e.declarations && el(e.declarations) || n, { displayParts: o, symbolKind: c } = j0.getSymbolDisplayPartsDocumentationAndSymbolKind(t, e, s.getSourceFile(), s, s, i);
- return { displayParts: o, kind: c };
- }
- function N$e(e, t, n, i, s) {
- return { ...dH(e), ...i && O$e(e, t, n, s) };
- }
- function I$e(e, t) {
- const n = d4e(e);
- return t ? {
- ...n,
- isDefinition: e.kind !== 0 && g4e(e.node, t)
- } : n;
- }
- function d4e(e) {
- const t = dH(e);
- if (e.kind === 0)
- return { ...t, isWriteAccess: !1 };
- const { kind: n, node: i } = e;
- return {
- ...t,
- isWriteAccess: Vle(i),
- isInString: n === 2 ? !0 : void 0
- };
- }
- function dH(e) {
- if (e.kind === 0)
- return { textSpan: e.textSpan, fileName: e.fileName };
- {
- const t = e.node.getSourceFile(), n = nL(e.node, t);
- return {
- textSpan: n,
- fileName: t.fileName,
- ...Ule(n, t, e.context)
- };
- }
- }
- function O$e(e, t, n, i) {
- if (e.kind !== 0 && (Oe(t) || Xa(t))) {
- const { node: s, kind: o } = e, c = s.parent, _ = t.text, u = uu(c);
- if (u || c8(c) && c.name === s && c.dotDotDotToken === void 0) {
- const d = { prefixText: _ + ": " }, g = { suffixText: ": " + _ };
- if (o === 3)
- return d;
- if (o === 4)
- return g;
- if (u) {
- const h = c.parent;
- return Ks(h) && dn(h.parent) && jg(h.parent.left) ? d : g;
- } else
- return d;
- } else if (Zu(c) && !c.propertyName) {
- const d = vu(t.parent) ? n.getExportSpecifierLocalTargetSymbol(t.parent) : n.getSymbolAtLocation(t);
- return ss(d.declarations, c) ? { prefixText: _ + " as " } : Gp;
- } else if (vu(c) && !c.propertyName)
- return t === e.node || n.getSymbolAtLocation(t) === n.getSymbolAtLocation(e.node) ? { prefixText: _ + " as " } : { suffixText: " as " + _ };
- }
- if (e.kind !== 0 && d_(e.node) && xo(e.node.parent)) {
- const s = fV(i);
- return { prefixText: s, suffixText: s };
- }
- return Gp;
- }
- function F$e(e, t) {
- const n = dH(e);
- if (e.kind !== 0) {
- const { node: i } = e;
- return {
- ...n,
- ...L$e(i, t)
- };
- } else
- return { ...n, kind: "", displayParts: [] };
- }
- function L$e(e, t) {
- const n = t.getSymbolAtLocation(ql(e) && e.name ? e.name : e);
- return n ? p4e(n, t, e) : e.kind === 210 ? {
- kind: "interface",
- displayParts: [Tu(
- 21
- /* OpenParenToken */
- ), Jf("object literal"), Tu(
- 22
- /* CloseParenToken */
- )]
- } : e.kind === 231 ? {
- kind: "local class",
- displayParts: [Tu(
- 21
- /* OpenParenToken */
- ), Jf("anonymous local class"), Tu(
- 22
- /* CloseParenToken */
- )]
- } : { kind: Yb(e), displayParts: [] };
- }
- function M$e(e) {
- const t = dH(e);
- if (e.kind === 0)
- return {
- fileName: t.fileName,
- span: {
- textSpan: t.textSpan,
- kind: "reference"
- /* reference */
- }
- };
- const n = Vle(e.node), i = {
- textSpan: t.textSpan,
- kind: n ? "writtenReference" : "reference",
- isInString: e.kind === 2 ? !0 : void 0,
- ...t.contextSpan && { contextSpan: t.contextSpan }
- };
- return { fileName: t.fileName, span: i };
- }
- function nL(e, t, n) {
- let i = e.getStart(t), s = (n || e).getEnd();
- return Xa(e) && s - i > 2 && (E.assert(n === void 0), i += 1, s -= 1), n?.kind === 269 && (s = n.getFullStart()), kc(i, s);
- }
- function m4e(e) {
- return e.kind === 0 ? e.textSpan : nL(e.node, e.node.getSourceFile());
- }
- function Vle(e) {
- const t = S4(e);
- return !!t && R$e(t) || e.kind === 90 || ux(e);
- }
- function g4e(e, t) {
- var n;
- if (!t) return !1;
- const i = S4(e) || (e.kind === 90 ? e.parent : g3(e) || e.kind === 137 && Qo(e.parent) ? e.parent.parent : void 0), s = i && dn(i) ? i.left : void 0;
- return !!(i && ((n = t.declarations) != null && n.some((o) => o === i || o === s)));
- }
- function R$e(e) {
- if (e.flags & 33554432) return !0;
- switch (e.kind) {
- case 226:
- case 208:
- case 263:
- case 231:
- case 90:
- case 266:
- case 306:
- case 281:
- case 273:
- case 271:
- case 276:
- case 264:
- case 338:
- case 346:
- case 291:
- case 267:
- case 270:
- case 274:
- case 280:
- case 169:
- case 304:
- case 265:
- case 168:
- return !0;
- case 303:
- return !F0(e.parent);
- case 262:
- case 218:
- case 176:
- case 174:
- case 177:
- case 178:
- return !!e.body;
- case 260:
- case 172:
- return !!e.initializer || Ub(e.parent);
- case 173:
- case 171:
- case 348:
- case 341:
- return !1;
- default:
- return E.failBadSyntaxKind(e);
- }
- }
- var lk;
- ((e) => {
- function t(Xe, Tt, te, ze, K, De = {}, Ve = new Set(ze.map((Ke) => Ke.fileName))) {
- var Ke, xe;
- if (Tt = n(Tt, De), Si(Tt)) {
- const vn = L6.getReferenceAtPosition(Tt, Xe, te);
- if (!vn?.file)
- return;
- const M = te.getTypeChecker().getMergedSymbol(vn.file.symbol);
- if (M)
- return d(
- te,
- M,
- /*excludeImportTypeOfExportEquals*/
- !1,
- ze,
- Ve
- );
- const Ae = te.getFileIncludeReasons();
- return Ae ? [{
- definition: { type: 5, reference: vn.reference, file: Tt },
- references: s(vn.file, Ae, te) || Ue
- }] : void 0;
- }
- if (!De.implementations) {
- const vn = h(Tt, ze, K);
- if (vn)
- return vn;
- }
- const at = te.getTypeChecker(), $e = at.getSymbolAtLocation(Qo(Tt) && Tt.parent.name || Tt);
- if (!$e) {
- if (!De.implementations && Xa(Tt)) {
- if (s9(Tt)) {
- const vn = te.getFileIncludeReasons(), M = (xe = (Ke = te.getResolvedModuleFromModuleSpecifier(Tt)) == null ? void 0 : Ke.resolvedModule) == null ? void 0 : xe.resolvedFileName, Ae = M ? te.getSourceFile(M) : void 0;
- if (Ae)
- return [{ definition: { type: 4, node: Tt }, references: s(Ae, vn, te) || Ue }];
- }
- return Ri(Tt, ze, at, K);
- }
- return;
- }
- if ($e.escapedName === "export=")
- return d(
- te,
- $e.parent,
- /*excludeImportTypeOfExportEquals*/
- !1,
- ze,
- Ve
- );
- const bt = c($e, te, ze, K, De, Ve);
- if (bt && !($e.flags & 33554432))
- return bt;
- const He = o(Tt, $e, at), Vt = He && c(He, te, ze, K, De, Ve), Zt = S($e, Tt, ze, Ve, at, K, De);
- return _(te, bt, Zt, Vt);
- }
- e.getReferencedSymbolsForNode = t;
- function n(Xe, Tt) {
- return Tt.use === 1 ? Xe = YU(Xe) : Tt.use === 2 && (Xe = XF(Xe)), Xe;
- }
- e.getAdjustedNode = n;
- function i(Xe, Tt, te, ze = new Set(te.map((K) => K.fileName))) {
- var K, De;
- const Ve = (K = Tt.getSourceFile(Xe)) == null ? void 0 : K.symbol;
- if (Ve)
- return ((De = d(
- Tt,
- Ve,
- /*excludeImportTypeOfExportEquals*/
- !1,
- te,
- ze
- )[0]) == null ? void 0 : De.references) || Ue;
- const Ke = Tt.getFileIncludeReasons(), xe = Tt.getSourceFile(Xe);
- return xe && Ke && s(xe, Ke, Tt) || Ue;
- }
- e.getReferencesForFileName = i;
- function s(Xe, Tt, te) {
- let ze;
- const K = Tt.get(Xe.path) || Ue;
- for (const De of K)
- if (Sv(De)) {
- const Ve = te.getSourceFileByPath(De.file), Ke = jD(te, De);
- m6(Ke) && (ze = wr(ze, {
- kind: 0,
- fileName: Ve.fileName,
- textSpan: L0(Ke)
- }));
- }
- return ze;
- }
- function o(Xe, Tt, te) {
- if (Xe.parent && iA(Xe.parent)) {
- const ze = te.getAliasedSymbol(Tt), K = te.getMergedSymbol(ze);
- if (ze !== K)
- return K;
- }
- }
- function c(Xe, Tt, te, ze, K, De) {
- const Ve = Xe.flags & 1536 && Xe.declarations && On(Xe.declarations, Si);
- if (!Ve) return;
- const Ke = Xe.exports.get(
- "export="
- /* ExportEquals */
- ), xe = d(Tt, Xe, !!Ke, te, De);
- if (!Ke || !De.has(Ve.fileName)) return xe;
- const at = Tt.getTypeChecker();
- return Xe = Hl(Ke, at), _(Tt, xe, S(
- Xe,
- /*node*/
- void 0,
- te,
- De,
- at,
- ze,
- K
- ));
- }
- function _(Xe, ...Tt) {
- let te;
- for (const ze of Tt)
- if (!(!ze || !ze.length)) {
- if (!te) {
- te = ze;
- continue;
- }
- for (const K of ze) {
- if (!K.definition || K.definition.type !== 0) {
- te.push(K);
- continue;
- }
- const De = K.definition.symbol, Ve = ac(te, (xe) => !!xe.definition && xe.definition.type === 0 && xe.definition.symbol === De);
- if (Ve === -1) {
- te.push(K);
- continue;
- }
- const Ke = te[Ve];
- te[Ve] = {
- definition: Ke.definition,
- references: Ke.references.concat(K.references).sort((xe, at) => {
- const $e = u(Xe, xe), bt = u(Xe, at);
- if ($e !== bt)
- return ho($e, bt);
- const He = m4e(xe), Vt = m4e(at);
- return He.start !== Vt.start ? ho(He.start, Vt.start) : ho(He.length, Vt.length);
- })
- };
- }
- }
- return te;
- }
- function u(Xe, Tt) {
- const te = Tt.kind === 0 ? Xe.getSourceFile(Tt.fileName) : Tt.node.getSourceFile();
- return Xe.getSourceFiles().indexOf(te);
- }
- function d(Xe, Tt, te, ze, K) {
- E.assert(!!Tt.valueDeclaration);
- const De = Ai(n4e(Xe, ze, Tt), (Ke) => {
- if (Ke.kind === "import") {
- const xe = Ke.literal.parent;
- if (P0(xe)) {
- const at = Bs(xe.parent, bm);
- if (te && !at.qualifier)
- return;
- }
- return Jh(Ke.literal);
- } else if (Ke.kind === "implicit") {
- const xe = Ke.literal.text !== X1 && jx(
- Ke.referencingFile,
- (at) => at.transformFlags & 2 ? Gg(at) || yS(at) || zb(at) ? at : void 0 : "skip"
- ) || Ke.referencingFile.statements[0] || Ke.referencingFile;
- return Jh(xe);
- } else
- return {
- kind: 0,
- fileName: Ke.referencingFile.fileName,
- textSpan: L0(Ke.ref)
- };
- });
- if (Tt.declarations)
- for (const Ke of Tt.declarations)
- switch (Ke.kind) {
- case 307:
- break;
- case 267:
- K.has(Ke.getSourceFile().fileName) && De.push(Jh(Ke.name));
- break;
- default:
- E.assert(!!(Tt.flags & 33554432), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.");
- }
- const Ve = Tt.exports.get(
- "export="
- /* ExportEquals */
- );
- if (Ve?.declarations)
- for (const Ke of Ve.declarations) {
- const xe = Ke.getSourceFile();
- if (K.has(xe.fileName)) {
- const at = dn(Ke) && Cn(Ke.left) ? Ke.left.expression : wo(Ke) ? E.checkDefined(Ya(Ke, 95, xe)) : os(Ke) || Ke;
- De.push(Jh(at));
- }
- }
- return De.length ? [{ definition: { type: 0, symbol: Tt }, references: De }] : Ue;
- }
- function g(Xe) {
- return Xe.kind === 148 && cv(Xe.parent) && Xe.parent.operator === 148;
- }
- function h(Xe, Tt, te) {
- if (GD(Xe.kind))
- return Xe.kind === 116 && Nx(Xe.parent) || Xe.kind === 148 && !g(Xe) ? void 0 : _e(
- Tt,
- Xe.kind,
- te,
- Xe.kind === 148 ? g : void 0
- );
- if (yC(Xe.parent) && Xe.parent.name === Xe)
- return oe(Tt, te);
- if (Ex(Xe) && oc(Xe.parent))
- return [{ definition: { type: 2, node: Xe }, references: [Jh(Xe)] }];
- if (KA(Xe)) {
- const ze = UF(Xe.parent, Xe.text);
- return ze && Se(ze.parent, ze);
- } else if (zU(Xe))
- return Se(Xe.parent, Xe);
- if (S6(Xe))
- return ei(Xe, Tt, te);
- if (Xe.kind === 108)
- return ki(Xe);
- }
- function S(Xe, Tt, te, ze, K, De, Ve) {
- const Ke = Tt && D(
- Xe,
- Tt,
- K,
- /*useLocalSymbolForExportSpecifier*/
- !Ea(Ve)
- ) || Xe, xe = Tt ? ti(Tt, Ke) : 7, at = [], $e = new F(te, ze, Tt ? C(Tt) : 0, K, De, xe, Ve, at), bt = !Ea(Ve) || !Ke.declarations ? void 0 : On(Ke.declarations, vu);
- if (bt)
- Te(
- bt.name,
- Ke,
- bt,
- $e.createSearch(
- Tt,
- Xe,
- /*comingFrom*/
- void 0
- ),
- $e,
- /*addReferencesHere*/
- !0,
- /*alwaysGetReferences*/
- !0
- );
- else if (Tt && Tt.kind === 90 && Ke.escapedName === "default" && Ke.parent)
- et(Tt, Ke, $e), O(Tt, Ke, {
- exportingModuleSymbol: Ke.parent,
- exportKind: 1
- /* Default */
- }, $e);
- else {
- const He = $e.createSearch(
- Tt,
- Ke,
- /*comingFrom*/
- void 0,
- { allSearchSymbols: Tt ? ji(Ke, Tt, K, Ve.use === 2, !!Ve.providePrefixAndSuffixTextForRename, !!Ve.implementations) : [Ke] }
- );
- T(Ke, $e, He);
- }
- return at;
- }
- function T(Xe, Tt, te) {
- const ze = ae(Xe);
- if (ze)
- le(
- ze,
- ze.getSourceFile(),
- te,
- Tt,
- /*addReferencesHere*/
- !(Si(ze) && !ss(Tt.sourceFiles, ze))
- );
- else
- for (const K of Tt.sourceFiles)
- Tt.cancellationToken.throwIfCancellationRequested(), q(K, te, Tt);
- }
- function C(Xe) {
- switch (Xe.kind) {
- case 176:
- case 137:
- return 1;
- case 80:
- if (Zn(Xe.parent))
- return E.assert(Xe.parent.name === Xe), 2;
- default:
- return 0;
- }
- }
- function D(Xe, Tt, te, ze) {
- const { parent: K } = Tt;
- return vu(K) && ze ? we(Tt, Xe, K, te) : Tc(Xe.declarations, (De) => {
- if (!De.parent) {
- if (Xe.flags & 33554432) return;
- E.fail(`Unexpected symbol at ${E.formatSyntaxKind(Tt.kind)}: ${E.formatSymbol(Xe)}`);
- }
- return Qu(De.parent) && qy(De.parent.parent) ? te.getPropertyOfType(te.getTypeFromTypeNode(De.parent.parent), Xe.name) : void 0;
- });
- }
- let P;
- ((Xe) => {
- Xe[Xe.None = 0] = "None", Xe[Xe.Constructor = 1] = "Constructor", Xe[Xe.Class = 2] = "Class";
- })(P || (P = {}));
- function I(Xe) {
- if (!(Xe.flags & 33555968)) return;
- const Tt = Xe.declarations && On(Xe.declarations, (te) => !Si(te) && !zc(te));
- return Tt && Tt.symbol;
- }
- class F {
- constructor(Tt, te, ze, K, De, Ve, Ke, xe) {
- this.sourceFiles = Tt, this.sourceFilesSet = te, this.specialSearchKind = ze, this.checker = K, this.cancellationToken = De, this.searchMeaning = Ve, this.options = Ke, this.result = xe, this.inheritsFromCache = /* @__PURE__ */ new Map(), this.markSeenContainingTypeReference = x6(), this.markSeenReExportRHS = x6(), this.symbolIdToReferences = [], this.sourceFileToSeenSymbols = [];
- }
- includesSourceFile(Tt) {
- return this.sourceFilesSet.has(Tt.fileName);
- }
- /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */
- getImportSearches(Tt, te) {
- return this.importTracker || (this.importTracker = Ble(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken)), this.importTracker(
- Tt,
- te,
- this.options.use === 2
- /* Rename */
- );
- }
- /** @param allSearchSymbols set of additional symbols for use by `includes`. */
- createSearch(Tt, te, ze, K = {}) {
- const {
- text: De = ap(mc(N4(te) || I(te) || te)),
- allSearchSymbols: Ve = [te]
- } = K, Ke = tc(De), xe = this.options.implementations && Tt ? rr(Tt, te, this.checker) : void 0;
- return { symbol: te, comingFrom: ze, text: De, escapedText: Ke, parents: xe, allSearchSymbols: Ve, includes: (at) => ss(Ve, at) };
- }
- /**
- * Callback to add references for a particular searched symbol.
- * This initializes a reference group, so only call this if you will add at least one reference.
- */
- referenceAdder(Tt) {
- const te = na(Tt);
- let ze = this.symbolIdToReferences[te];
- return ze || (ze = this.symbolIdToReferences[te] = [], this.result.push({ definition: { type: 0, symbol: Tt }, references: ze })), (K, De) => ze.push(Jh(K, De));
- }
- /** Add a reference with no associated definition. */
- addStringOrCommentReference(Tt, te) {
- this.result.push({
- definition: void 0,
- references: [{ kind: 0, fileName: Tt, textSpan: te }]
- });
- }
- /** Returns `true` the first time we search for a symbol in a file and `false` afterwards. */
- markSearchedSymbols(Tt, te) {
- const ze = Ma(Tt), K = this.sourceFileToSeenSymbols[ze] || (this.sourceFileToSeenSymbols[ze] = /* @__PURE__ */ new Set());
- let De = !1;
- for (const Ve of te)
- De = Xm(K, na(Ve)) || De;
- return De;
- }
- }
- function O(Xe, Tt, te, ze) {
- const { importSearches: K, singleReferences: De, indirectUsers: Ve } = ze.getImportSearches(Tt, te);
- if (De.length) {
- const Ke = ze.referenceAdder(Tt);
- for (const xe of De)
- z(xe, ze) && Ke(xe);
- }
- for (const [Ke, xe] of K)
- he(Ke.getSourceFile(), ze.createSearch(
- Ke,
- xe,
- 1
- /* Export */
- ), ze);
- if (Ve.length) {
- let Ke;
- switch (te.exportKind) {
- case 0:
- Ke = ze.createSearch(
- Xe,
- Tt,
- 1
- /* Export */
- );
- break;
- case 1:
- Ke = ze.options.use === 2 ? void 0 : ze.createSearch(Xe, Tt, 1, { text: "default" });
- break;
- }
- if (Ke)
- for (const xe of Ve)
- q(xe, Ke, ze);
- }
- }
- function B(Xe, Tt, te, ze, K, De, Ve, Ke) {
- const xe = Ble(Xe, new Set(Xe.map((He) => He.fileName)), Tt, te), { importSearches: at, indirectUsers: $e, singleReferences: bt } = xe(
- ze,
- { exportKind: Ve ? 1 : 0, exportingModuleSymbol: K },
- /*isForRename*/
- !1
- );
- for (const [He] of at)
- Ke(He);
- for (const He of bt)
- Oe(He) && bm(He.parent) && Ke(He);
- for (const He of $e)
- for (const Vt of ne(He, Ve ? "default" : De)) {
- const Zt = Tt.getSymbolAtLocation(Vt), vn = ut(Zt?.declarations, (M) => !!Wn(M, wo));
- Oe(Vt) && !G1(Vt.parent) && (Zt === ze || vn) && Ke(Vt);
- }
- }
- e.eachExportReference = B;
- function z(Xe, Tt) {
- return me(Xe, Tt) ? Tt.options.use !== 2 ? !0 : !Oe(Xe) && !G1(Xe.parent) ? !1 : !(G1(Xe.parent) && ng(Xe)) : !1;
- }
- function X(Xe, Tt) {
- if (Xe.declarations)
- for (const te of Xe.declarations) {
- const ze = te.getSourceFile();
- he(ze, Tt.createSearch(
- te,
- Xe,
- 0
- /* Import */
- ), Tt, Tt.includesSourceFile(ze));
- }
- }
- function q(Xe, Tt, te) {
- Cq(Xe).get(Tt.escapedText) !== void 0 && he(Xe, Tt, te);
- }
- function V(Xe, Tt) {
- return F0(Xe.parent.parent) ? Tt.getPropertySymbolOfDestructuringAssignment(Xe) : void 0;
- }
- function ae(Xe) {
- const { declarations: Tt, flags: te, parent: ze, valueDeclaration: K } = Xe;
- if (K && (K.kind === 218 || K.kind === 231))
- return K;
- if (!Tt)
- return;
- if (te & 8196) {
- const Ke = On(Tt, (xe) => Z_(
- xe,
- 2
- /* Private */
- ) || Ou(xe));
- return Ke ? nv(
- Ke,
- 263
- /* ClassDeclaration */
- ) : void 0;
- }
- if (Tt.some(c8))
- return;
- const De = ze && !(Xe.flags & 262144);
- if (De && !(fC(ze) && !ze.globalExports))
- return;
- let Ve;
- for (const Ke of Tt) {
- const xe = AS(Ke);
- if (Ve && Ve !== xe || !xe || xe.kind === 307 && !X_(xe))
- return;
- if (Ve = xe, vo(Ve)) {
- let at;
- for (; at = lB(Ve); )
- Ve = at;
- }
- }
- return De ? Ve.getSourceFile() : Ve;
- }
- function ee(Xe, Tt, te, ze = te) {
- return G(Xe, Tt, te, () => !0, ze) || !1;
- }
- e.isSymbolReferencedInFile = ee;
- function G(Xe, Tt, te, ze, K = te) {
- const De = G_(Xe.parent, Xe.parent.parent) ? xa(Tt.getSymbolsOfParameterPropertyDeclaration(Xe.parent, Xe.text)) : Tt.getSymbolAtLocation(Xe);
- if (De)
- for (const Ve of ne(te, De.name, K)) {
- if (!Oe(Ve) || Ve === Xe || Ve.escapedText !== Xe.escapedText) continue;
- const Ke = Tt.getSymbolAtLocation(Ve);
- if (Ke === De || Tt.getShorthandAssignmentValueSymbol(Ve.parent) === De || vu(Ve.parent) && we(Ve, Ke, Ve.parent, Tt) === De) {
- const xe = ze(Ve);
- if (xe) return xe;
- }
- }
- }
- e.eachSymbolReferenceInFile = G;
- function ue(Xe, Tt) {
- return Ln(ne(Tt, Xe), (K) => !!S4(K)).reduce((K, De) => {
- const Ve = ze(De);
- return !ut(K.declarationNames) || Ve === K.depth ? (K.declarationNames.push(De), K.depth = Ve) : Ve < K.depth && (K.declarationNames = [De], K.depth = Ve), K;
- }, { depth: 1 / 0, declarationNames: [] }).declarationNames;
- function ze(K) {
- let De = 0;
- for (; K; )
- K = AS(K), De++;
- return De;
- }
- }
- e.getTopMostDeclarationNamesInFile = ue;
- function re(Xe, Tt, te, ze) {
- if (!Xe.name || !Oe(Xe.name)) return !1;
- const K = E.checkDefined(te.getSymbolAtLocation(Xe.name));
- for (const De of Tt)
- for (const Ve of ne(De, K.name)) {
- if (!Oe(Ve) || Ve === Xe.name || Ve.escapedText !== Xe.name.escapedText) continue;
- const Ke = WF(Ve), xe = Fs(Ke.parent) && Ke.parent.expression === Ke ? Ke.parent : void 0, at = te.getSymbolAtLocation(Ve);
- if (at && te.getRootSymbols(at).some(($e) => $e === K) && ze(Ve, xe))
- return !0;
- }
- return !1;
- }
- e.someSignatureUsage = re;
- function ne(Xe, Tt, te = Xe) {
- return Ai(ie(Xe, Tt, te), (ze) => {
- const K = h_(Xe, ze);
- return K === Xe ? void 0 : K;
- });
- }
- function ie(Xe, Tt, te = Xe) {
- const ze = [];
- if (!Tt || !Tt.length)
- return ze;
- const K = Xe.text, De = K.length, Ve = Tt.length;
- let Ke = K.indexOf(Tt, te.pos);
- for (; Ke >= 0 && !(Ke > te.end); ) {
- const xe = Ke + Ve;
- (Ke === 0 || !Th(
- K.charCodeAt(Ke - 1),
- 99
- /* Latest */
- )) && (xe === De || !Th(
- K.charCodeAt(xe),
- 99
- /* Latest */
- )) && ze.push(Ke), Ke = K.indexOf(Tt, Ke + Ve + 1);
- }
- return ze;
- }
- function Se(Xe, Tt) {
- const te = Xe.getSourceFile(), ze = Tt.text, K = Ai(ne(te, ze, Xe), (De) => (
- // Only pick labels that are either the target label, or have a target that is the target label
- De === Tt || KA(De) && UF(De, ze) === Tt ? Jh(De) : void 0
- ));
- return [{ definition: { type: 1, node: Tt }, references: K }];
- }
- function J(Xe, Tt) {
- switch (Xe.kind) {
- case 81:
- if (dv(Xe.parent))
- return !0;
- case 80:
- return Xe.text.length === Tt.length;
- case 15:
- case 11: {
- const te = Xe;
- return te.text.length === Tt.length && (VF(te) || qU(Xe) || cse(Xe) || Fs(Xe.parent) && sS(Xe.parent) && Xe.parent.arguments[1] === Xe || G1(Xe.parent));
- }
- case 9:
- return VF(Xe) && Xe.text.length === Tt.length;
- case 90:
- return Tt.length === 7;
- default:
- return !1;
- }
- }
- function oe(Xe, Tt) {
- const te = ta(Xe, (ze) => (Tt.throwIfCancellationRequested(), Ai(ne(ze, "meta", ze), (K) => {
- const De = K.parent;
- if (yC(De))
- return Jh(De);
- })));
- return te.length ? [{ definition: { type: 2, node: te[0].node }, references: te }] : void 0;
- }
- function _e(Xe, Tt, te, ze) {
- const K = ta(Xe, (De) => (te.throwIfCancellationRequested(), Ai(ne(De, qs(Tt), De), (Ve) => {
- if (Ve.kind === Tt && (!ze || ze(Ve)))
- return Jh(Ve);
- })));
- return K.length ? [{ definition: { type: 2, node: K[0].node }, references: K }] : void 0;
- }
- function he(Xe, Tt, te, ze = !0) {
- return te.cancellationToken.throwIfCancellationRequested(), le(Xe, Xe, Tt, te, ze);
- }
- function le(Xe, Tt, te, ze, K) {
- if (ze.markSearchedSymbols(Tt, te.allSearchSymbols))
- for (const De of ie(Tt, te.text, Xe))
- ve(Tt, De, te, ze, K);
- }
- function me(Xe, Tt) {
- return !!(wS(Xe) & Tt.searchMeaning);
- }
- function ve(Xe, Tt, te, ze, K) {
- const De = h_(Xe, Tt);
- if (!J(De, te.text)) {
- !ze.options.implementations && (ze.options.findInStrings && Qx(Xe, Tt) || ze.options.findInComments && Sse(Xe, Tt)) && ze.addStringOrCommentReference(Xe.fileName, Ul(Tt, te.text.length));
- return;
- }
- if (!me(De, ze)) return;
- let Ve = ze.checker.getSymbolAtLocation(De);
- if (!Ve)
- return;
- const Ke = De.parent;
- if (Zu(Ke) && Ke.propertyName === De)
- return;
- if (vu(Ke)) {
- E.assert(
- De.kind === 80 || De.kind === 11
- /* StringLiteral */
- ), Te(De, Ve, Ke, te, ze, K);
- return;
- }
- if (r4(Ke) && Ke.isNameFirst && Ke.typeExpression && bS(Ke.typeExpression.type) && Ke.typeExpression.type.jsDocPropertyTags && Nr(Ke.typeExpression.type.jsDocPropertyTags)) {
- tt(Ke.typeExpression.type.jsDocPropertyTags, De, te, ze);
- return;
- }
- const xe = mn(te, Ve, De, ze);
- if (!xe) {
- Qe(Ve, te, ze);
- return;
- }
- switch (ze.specialSearchKind) {
- case 0:
- K && et(De, xe, ze);
- break;
- case 1:
- Re(De, Xe, te, ze);
- break;
- case 2:
- ft(De, te, ze);
- break;
- default:
- E.assertNever(ze.specialSearchKind);
- }
- cn(De) && va(De.parent) && Sb(De.parent.parent.parent) && (Ve = De.parent.symbol, !Ve) || Me(De, Ve, te, ze);
- }
- function tt(Xe, Tt, te, ze) {
- const K = ze.referenceAdder(te.symbol);
- et(Tt, te.symbol, ze), ir(Xe, (De) => {
- Xu(De.name) && K(De.name.left);
- });
- }
- function Te(Xe, Tt, te, ze, K, De, Ve) {
- E.assert(!Ve || !!K.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled");
- const { parent: Ke, propertyName: xe, name: at } = te, $e = Ke.parent, bt = we(Xe, Tt, te, K.checker);
- if (!Ve && !ze.includes(bt))
- return;
- if (xe ? Xe === xe ? ($e.moduleSpecifier || He(), De && K.options.use !== 2 && K.markSeenReExportRHS(at) && et(at, E.checkDefined(te.symbol), K)) : K.markSeenReExportRHS(Xe) && He() : K.options.use === 2 && ng(at) || He(), !Ea(K.options) || Ve) {
- const Zt = ng(Xe) || ng(te.name) ? 1 : 0, vn = E.checkDefined(te.symbol), M = Jle(vn, Zt, K.checker);
- M && O(Xe, vn, M, K);
- }
- if (ze.comingFrom !== 1 && $e.moduleSpecifier && !xe && !Ea(K.options)) {
- const Vt = K.checker.getExportSpecifierLocalTargetSymbol(te);
- Vt && X(Vt, K);
- }
- function He() {
- De && et(Xe, bt, K);
- }
- }
- function we(Xe, Tt, te, ze) {
- return fe(Xe, te) && ze.getExportSpecifierLocalTargetSymbol(te) || Tt;
- }
- function fe(Xe, Tt) {
- const { parent: te, propertyName: ze, name: K } = Tt;
- return E.assert(ze === Xe || K === Xe), ze ? ze === Xe : !te.parent.moduleSpecifier;
- }
- function Me(Xe, Tt, te, ze) {
- const K = a4e(
- Xe,
- Tt,
- ze.checker,
- te.comingFrom === 1
- /* Export */
- );
- if (!K) return;
- const { symbol: De } = K;
- K.kind === 0 ? Ea(ze.options) || X(De, ze) : O(Xe, De, K.exportInfo, ze);
- }
- function Qe({ flags: Xe, valueDeclaration: Tt }, te, ze) {
- const K = ze.checker.getShorthandAssignmentValueSymbol(Tt), De = Tt && os(Tt);
- !(Xe & 33554432) && De && te.includes(K) && et(De, K, ze);
- }
- function et(Xe, Tt, te) {
- const { kind: ze, symbol: K } = "kind" in Tt ? Tt : { kind: void 0, symbol: Tt };
- if (te.options.use === 2 && Xe.kind === 90)
- return;
- const De = te.referenceAdder(K);
- te.options.implementations ? Qt(Xe, De, te) : De(Xe, ze);
- }
- function Re(Xe, Tt, te, ze) {
- UD(Xe) && et(Xe, te.symbol, ze);
- const K = () => ze.referenceAdder(te.symbol);
- if (Zn(Xe.parent))
- E.assert(Xe.kind === 90 || Xe.parent.name === Xe), Wt(te.symbol, Tt, K());
- else {
- const De = Hs(Xe);
- De && (Ir(De, K()), Nt(De, ze));
- }
- }
- function ft(Xe, Tt, te) {
- et(Xe, Tt.symbol, te);
- const ze = Xe.parent;
- if (te.options.use === 2 || !Zn(ze)) return;
- E.assert(ze.name === Xe);
- const K = te.referenceAdder(Tt.symbol);
- for (const De of ze.members)
- UT(De) && zs(De) && De.body && De.body.forEachChild(function Ve(Ke) {
- Ke.kind === 110 ? K(Ke) : !ys(Ke) && !Zn(Ke) && Ke.forEachChild(Ve);
- });
- }
- function Wt(Xe, Tt, te) {
- const ze = _r(Xe);
- if (ze && ze.declarations)
- for (const K of ze.declarations) {
- const De = Ya(K, 137, Tt);
- E.assert(K.kind === 176 && !!De), te(De);
- }
- Xe.exports && Xe.exports.forEach((K) => {
- const De = K.valueDeclaration;
- if (De && De.kind === 174) {
- const Ve = De.body;
- Ve && Ws(Ve, 110, (Ke) => {
- UD(Ke) && te(Ke);
- });
- }
- });
- }
- function _r(Xe) {
- return Xe.members && Xe.members.get(
- "__constructor"
- /* Constructor */
- );
- }
- function Ir(Xe, Tt) {
- const te = _r(Xe.symbol);
- if (te && te.declarations)
- for (const ze of te.declarations) {
- E.assert(
- ze.kind === 176
- /* Constructor */
- );
- const K = ze.body;
- K && Ws(K, 108, (De) => {
- jU(De) && Tt(De);
- });
- }
- }
- function jr(Xe) {
- return !!_r(Xe.symbol);
- }
- function Nt(Xe, Tt) {
- if (jr(Xe)) return;
- const te = Xe.symbol, ze = Tt.createSearch(
- /*location*/
- void 0,
- te,
- /*comingFrom*/
- void 0
- );
- T(te, Tt, ze);
- }
- function Qt(Xe, Tt, te) {
- if (og(Xe) && qn(Xe.parent)) {
- Tt(Xe);
- return;
- }
- if (Xe.kind !== 80)
- return;
- Xe.parent.kind === 304 && Oi(Xe, te.checker, Tt);
- const ze = Br(Xe);
- if (ze) {
- Tt(ze);
- return;
- }
- const K = or(Xe, (Ke) => !Xu(Ke.parent) && !fi(Ke.parent) && !db(Ke.parent)), De = K.parent;
- if (YI(De) && De.type === K && te.markSeenContainingTypeReference(De))
- if (m0(De))
- Ve(De.initializer);
- else if (ys(De) && De.body) {
- const Ke = De.body;
- Ke.kind === 241 ? y0(Ke, (xe) => {
- xe.expression && Ve(xe.expression);
- }) : Ve(Ke);
- } else $1(De) && Ve(De.expression);
- function Ve(Ke) {
- xr(Ke) && Tt(Ke);
- }
- }
- function Br(Xe) {
- return Oe(Xe) || Cn(Xe) ? Br(Xe.parent) : Oh(Xe) ? Wn(Xe.parent.parent, Nf(Zn, Xl)) : void 0;
- }
- function xr(Xe) {
- switch (Xe.kind) {
- case 217:
- return xr(Xe.expression);
- case 219:
- case 218:
- case 210:
- case 231:
- case 209:
- return !0;
- default:
- return !1;
- }
- }
- function zn(Xe, Tt, te, ze) {
- if (Xe === Tt)
- return !0;
- const K = na(Xe) + "," + na(Tt), De = te.get(K);
- if (De !== void 0)
- return De;
- te.set(K, !1);
- const Ve = !!Xe.declarations && Xe.declarations.some(
- (Ke) => T4(Ke).some((xe) => {
- const at = ze.getTypeAtLocation(xe);
- return !!at && !!at.symbol && zn(at.symbol, Tt, te, ze);
- })
- );
- return te.set(K, Ve), Ve;
- }
- function ki(Xe) {
- let Tt = Xw(
- Xe,
- /*stopOnFunctions*/
- !1
- );
- if (!Tt)
- return;
- let te = 256;
- switch (Tt.kind) {
- case 172:
- case 171:
- case 174:
- case 173:
- case 176:
- case 177:
- case 178:
- te &= T0(Tt), Tt = Tt.parent;
- break;
- default:
- return;
- }
- const ze = Tt.getSourceFile(), K = Ai(ne(ze, "super", Tt), (De) => {
- if (De.kind !== 108)
- return;
- const Ve = Xw(
- De,
- /*stopOnFunctions*/
- !1
- );
- return Ve && zs(Ve) === !!te && Ve.parent.symbol === Tt.symbol ? Jh(De) : void 0;
- });
- return [{ definition: { type: 0, symbol: Tt.symbol }, references: K }];
- }
- function rs(Xe) {
- return Xe.kind === 80 && Xe.parent.kind === 169 && Xe.parent.name === Xe;
- }
- function ei(Xe, Tt, te) {
- let ze = Lu(
- Xe,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- ), K = 256;
- switch (ze.kind) {
- case 174:
- case 173:
- if (jp(ze)) {
- K &= T0(ze), ze = ze.parent;
- break;
- }
- case 172:
- case 171:
- case 176:
- case 177:
- case 178:
- K &= T0(ze), ze = ze.parent;
- break;
- case 307:
- if (il(ze) || rs(Xe))
- return;
- case 262:
- case 218:
- break;
- default:
- return;
- }
- const De = ta(ze.kind === 307 ? Tt : [ze.getSourceFile()], (Ke) => (te.throwIfCancellationRequested(), ne(Ke, "this", Si(ze) ? Ke : ze).filter((xe) => {
- if (!S6(xe))
- return !1;
- const at = Lu(
- xe,
- /*includeArrowFunctions*/
- !1,
- /*includeClassComputedPropertyName*/
- !1
- );
- if (!kd(at)) return !1;
- switch (ze.kind) {
- case 218:
- case 262:
- return ze.symbol === at.symbol;
- case 174:
- case 173:
- return jp(ze) && ze.symbol === at.symbol;
- case 231:
- case 263:
- case 210:
- return at.parent && kd(at.parent) && ze.symbol === at.parent.symbol && zs(at) === !!K;
- case 307:
- return at.kind === 307 && !il(at) && !rs(xe);
- }
- }))).map((Ke) => Jh(Ke));
- return [{
- definition: { type: 3, node: Tc(De, (Ke) => Ii(Ke.node.parent) ? Ke.node : void 0) || Xe },
- references: De
- }];
- }
- function Ri(Xe, Tt, te, ze) {
- const K = $F(Xe, te), De = ta(Tt, (Ve) => (ze.throwIfCancellationRequested(), Ai(ne(Ve, Xe.text), (Ke) => {
- if (Xa(Ke) && Ke.text === Xe.text)
- if (K) {
- const xe = $F(Ke, te);
- if (K !== te.getStringType() && (K === xe || Jr(Ke, te)))
- return Jh(
- Ke,
- 2
- /* StringLiteral */
- );
- } else
- return fS(Ke) && !lS(Ke, Ve) ? void 0 : Jh(
- Ke,
- 2
- /* StringLiteral */
- );
- })));
- return [{
- definition: { type: 4, node: Xe },
- references: De
- }];
- }
- function Jr(Xe, Tt) {
- if (m_(Xe.parent))
- return Tt.getPropertyOfType(Tt.getTypeAtLocation(Xe.parent.parent), Xe.text);
- }
- function ji(Xe, Tt, te, ze, K, De) {
- const Ve = [];
- return Fe(
- Xe,
- Tt,
- te,
- ze,
- !(ze && K),
- (Ke, xe, at) => {
- at && Ar(Xe) !== Ar(at) && (at = void 0), Ve.push(at || xe || Ke);
- },
- // when try to find implementation, implementations is true, and not allowed to find base class
- /*allowBaseTypes*/
- () => !De
- ), Ve;
- }
- function Fe(Xe, Tt, te, ze, K, De, Ve) {
- const Ke = w8(Tt);
- if (Ke) {
- const Zt = te.getShorthandAssignmentValueSymbol(Tt.parent);
- if (Zt && ze)
- return De(
- Zt,
- /*rootSymbol*/
- void 0,
- /*baseSymbol*/
- void 0,
- 3
- /* SearchedLocalFoundProperty */
- );
- const vn = te.getContextualType(Ke.parent), M = vn && Tc(
- W9(
- Ke,
- te,
- vn,
- /*unionSymbolOk*/
- !0
- ),
- (be) => He(
- be,
- 4
- /* SearchedPropertyFoundLocal */
- )
- );
- if (M) return M;
- const Ae = V(Tt, te), dt = Ae && De(
- Ae,
- /*rootSymbol*/
- void 0,
- /*baseSymbol*/
- void 0,
- 4
- /* SearchedPropertyFoundLocal */
- );
- if (dt) return dt;
- const U = Zt && De(
- Zt,
- /*rootSymbol*/
- void 0,
- /*baseSymbol*/
- void 0,
- 3
- /* SearchedLocalFoundProperty */
- );
- if (U) return U;
- }
- const xe = o(Tt, Xe, te);
- if (xe) {
- const Zt = De(
- xe,
- /*rootSymbol*/
- void 0,
- /*baseSymbol*/
- void 0,
- 1
- /* Node */
- );
- if (Zt) return Zt;
- }
- const at = He(Xe);
- if (at) return at;
- if (Xe.valueDeclaration && G_(Xe.valueDeclaration, Xe.valueDeclaration.parent)) {
- const Zt = te.getSymbolsOfParameterPropertyDeclaration(Bs(Xe.valueDeclaration, Ii), Xe.name);
- return E.assert(Zt.length === 2 && !!(Zt[0].flags & 1) && !!(Zt[1].flags & 4)), He(Xe.flags & 1 ? Zt[1] : Zt[0]);
- }
- const $e = Jo(
- Xe,
- 281
- /* ExportSpecifier */
- );
- if (!ze || $e && !$e.propertyName) {
- const Zt = $e && te.getExportSpecifierLocalTargetSymbol($e);
- if (Zt) {
- const vn = De(
- Zt,
- /*rootSymbol*/
- void 0,
- /*baseSymbol*/
- void 0,
- 1
- /* Node */
- );
- if (vn) return vn;
- }
- }
- if (!ze) {
- let Zt;
- return K ? Zt = c8(Tt.parent) ? a9(te, Tt.parent) : void 0 : Zt = Vt(Xe, te), Zt && He(
- Zt,
- 4
- /* SearchedPropertyFoundLocal */
- );
- }
- if (E.assert(ze), K) {
- const Zt = Vt(Xe, te);
- return Zt && He(
- Zt,
- 4
- /* SearchedPropertyFoundLocal */
- );
- }
- function He(Zt, vn) {
- return Tc(te.getRootSymbols(Zt), (M) => De(
- Zt,
- M,
- /*baseSymbol*/
- void 0,
- vn
- ) || (M.parent && M.parent.flags & 96 && Ve(M) ? Ot(M.parent, M.name, te, (Ae) => De(Zt, M, Ae, vn)) : void 0));
- }
- function Vt(Zt, vn) {
- const M = Jo(
- Zt,
- 208
- /* BindingElement */
- );
- if (M && c8(M))
- return a9(vn, M);
- }
- }
- function Ot(Xe, Tt, te, ze) {
- const K = /* @__PURE__ */ new Map();
- return De(Xe);
- function De(Ve) {
- if (!(!(Ve.flags & 96) || !zp(K, na(Ve))))
- return Tc(Ve.declarations, (Ke) => Tc(T4(Ke), (xe) => {
- const at = te.getTypeAtLocation(xe), $e = at && at.symbol && te.getPropertyOfType(at, Tt);
- return at && $e && (Tc(te.getRootSymbols($e), ze) || De(at.symbol));
- }));
- }
- }
- function Ar(Xe) {
- return Xe.valueDeclaration ? !!(Mu(Xe.valueDeclaration) & 256) : !1;
- }
- function mn(Xe, Tt, te, ze) {
- const { checker: K } = ze;
- return Fe(
- Tt,
- te,
- K,
- /*isForRenamePopulateSearchSymbolSet*/
- !1,
- /*onlyIncludeBindingElementAtReferenceLocation*/
- ze.options.use !== 2 || !!ze.options.providePrefixAndSuffixTextForRename,
- (De, Ve, Ke, xe) => (Ke && Ar(Tt) !== Ar(Ke) && (Ke = void 0), Xe.includes(Ke || Ve || De) ? { symbol: Ve && !(gc(De) & 6) ? Ve : De, kind: xe } : void 0),
- /*allowBaseTypes*/
- (De) => !(Xe.parents && !Xe.parents.some((Ve) => zn(De.parent, Ve, ze.inheritsFromCache, K)))
- );
- }
- function ti(Xe, Tt) {
- let te = wS(Xe);
- const { declarations: ze } = Tt;
- if (ze) {
- let K;
- do {
- K = te;
- for (const De of ze) {
- const Ve = JF(De);
- Ve & te && (te |= Ve);
- }
- } while (te !== K);
- }
- return te;
- }
- e.getIntersectingMeaningFromDeclarations = ti;
- function qn(Xe) {
- return Xe.flags & 33554432 ? !(Xl(Xe) || Vp(Xe)) : YT(Xe) ? m0(Xe) : no(Xe) ? !!Xe.body : Zn(Xe) || Fw(Xe);
- }
- function Oi(Xe, Tt, te) {
- const ze = Tt.getSymbolAtLocation(Xe), K = Tt.getShorthandAssignmentValueSymbol(ze.valueDeclaration);
- if (K)
- for (const De of K.getDeclarations())
- JF(De) & 1 && te(De);
- }
- e.getReferenceEntriesForShorthandPropertyAssignment = Oi;
- function Ws(Xe, Tt, te) {
- bs(Xe, (ze) => {
- ze.kind === Tt && te(ze), Ws(ze, Tt, te);
- });
- }
- function Hs(Xe) {
- return LB(WF(Xe).parent);
- }
- function rr(Xe, Tt, te) {
- const ze = b6(Xe) ? Xe.parent : void 0, K = ze && te.getTypeAtLocation(ze.expression), De = Ai(K && (K.isUnionOrIntersection() ? K.types : K.symbol === Tt.parent ? void 0 : [K]), (Ve) => Ve.symbol && Ve.symbol.flags & 96 ? Ve.symbol : void 0);
- return De.length === 0 ? void 0 : De;
- }
- function Ea(Xe) {
- return Xe.use === 2 && Xe.providePrefixAndSuffixTextForRename;
- }
- })(lk || (lk = {}));
- var L6 = {};
- La(L6, {
- createDefinitionInfo: () => B8,
- getDefinitionAndBoundSpan: () => V$e,
- getDefinitionAtPosition: () => h4e,
- getReferenceAtPosition: () => v4e,
- getTypeDefinitionAtPosition: () => W$e
- });
- function h4e(e, t, n, i, s) {
- var o;
- const c = v4e(t, n, e), _ = c && [X$e(c.reference.fileName, c.fileName, c.unverified)] || Ue;
- if (c?.file)
- return _;
- const u = h_(t, n);
- if (u === t)
- return;
- const { parent: d } = u, g = e.getTypeChecker();
- if (u.kind === 164 || Oe(u) && rO(d) && d.tagName === u)
- return B$e(g, u) || Ue;
- if (KA(u)) {
- const P = UF(u.parent, u.text);
- return P ? [qle(
- g,
- P,
- "label",
- u.text,
- /*containerName*/
- void 0
- )] : void 0;
- }
- switch (u.kind) {
- case 107:
- const P = or(u.parent, (F) => oc(F) ? "quit" : no(F));
- return P ? [iL(g, P)] : void 0;
- case 90:
- if (!uD(u.parent))
- break;
- case 84:
- const I = or(u.parent, oD);
- if (I)
- return [$$e(I, t)];
- break;
- }
- if (u.kind === 135) {
- const P = or(u, (F) => no(F));
- return P && ut(
- P.modifiers,
- (F) => F.kind === 134
- /* AsyncKeyword */
- ) ? [iL(g, P)] : void 0;
- }
- if (u.kind === 127) {
- const P = or(u, (F) => no(F));
- return P && P.asteriskToken ? [iL(g, P)] : void 0;
- }
- if (Ex(u) && oc(u.parent)) {
- const P = u.parent.parent, { symbol: I, failedAliasResolution: F } = mH(P, g, s), O = Ln(P.members, oc), B = I ? g.symbolToString(I, P) : "", z = u.getSourceFile();
- return lr(O, (X) => {
- let { pos: q } = gm(X);
- return q = aa(z.text, q), qle(
- g,
- X,
- "constructor",
- "static {}",
- B,
- /*unverified*/
- !1,
- F,
- { start: q, length: 6 }
- );
- });
- }
- let { symbol: h, failedAliasResolution: S } = mH(u, g, s), T = u;
- if (i && S) {
- const P = ir([u, ...h?.declarations || Ue], (F) => or(F, _Z)), I = P && xC(P);
- I && ({ symbol: h, failedAliasResolution: S } = mH(I, g, s), T = I);
- }
- if (!h && s9(T)) {
- const P = (o = e.getResolvedModuleFromModuleSpecifier(T, t)) == null ? void 0 : o.resolvedModule;
- if (P)
- return [{
- name: T.text,
- fileName: P.resolvedFileName,
- containerName: void 0,
- containerKind: void 0,
- kind: "script",
- textSpan: Ul(0, 0),
- failedAliasResolution: S,
- isAmbient: wl(P.resolvedFileName),
- unverified: T !== u
- }];
- }
- if (!h)
- return Qi(_, q$e(u, g));
- if (i && Mi(h.declarations, (P) => P.getSourceFile().fileName === t.fileName)) return;
- const C = Y$e(g, u);
- if (C && !(ou(u.parent) && Z$e(C))) {
- const P = iL(g, C, S);
- let I = (O) => O !== C;
- if (g.getRootSymbols(h).some((O) => j$e(O, C))) {
- if (!Qo(C)) return [P];
- I = (O) => O !== C && (Xc(O) || $c(O));
- }
- const F = fP(g, h, u, S, I) || Ue;
- return u.kind === 108 ? [P, ...F] : [...F, P];
- }
- if (u.parent.kind === 304) {
- const P = g.getShorthandAssignmentValueSymbol(h.valueDeclaration), I = P?.declarations ? P.declarations.map((F) => B8(
- F,
- g,
- P,
- u,
- /*unverified*/
- !1,
- S
- )) : Ue;
- return Qi(I, y4e(g, u));
- }
- if (Bc(u) && va(d) && Mf(d.parent) && u === (d.propertyName || d.name)) {
- const P = o8(u), I = g.getTypeAtLocation(d.parent);
- return P === void 0 ? Ue : ta(I.isUnion() ? I.types : [I], (F) => {
- const O = F.getProperty(P);
- return O && fP(g, O, u);
- });
- }
- const D = y4e(g, u);
- return Qi(_, D.length ? D : fP(g, h, u, S));
- }
- function j$e(e, t) {
- var n;
- return e === t.symbol || e === t.symbol.parent || Dl(t.parent) || !mb(t.parent) && e === ((n = Wn(t.parent, kd)) == null ? void 0 : n.symbol);
- }
- function y4e(e, t) {
- const n = w8(t);
- if (n) {
- const i = n && e.getContextualType(n.parent);
- if (i)
- return ta(W9(
- n,
- e,
- i,
- /*unionSymbolOk*/
- !1
- ), (s) => fP(e, s, t));
- }
- return Ue;
- }
- function B$e(e, t) {
- const n = or(t, _l);
- if (!(n && n.name)) return;
- const i = or(n, Zn);
- if (!i) return;
- const s = _m(i);
- if (!s) return;
- const o = Ba(s.expression), c = $c(o) ? o.symbol : e.getSymbolAtLocation(o);
- if (!c) return;
- const _ = Ei(QT(n.name)), u = tl(n) ? e.getPropertyOfType(e.getTypeOfSymbol(c), _) : e.getPropertyOfType(e.getDeclaredTypeOfSymbol(c), _);
- if (u)
- return fP(e, u, t);
- }
- function v4e(e, t, n) {
- var i, s;
- const o = J8(e.referencedFiles, t);
- if (o) {
- const u = n.getSourceFileFromReference(e, o);
- return u && { reference: o, fileName: u.fileName, file: u, unverified: !1 };
- }
- const c = J8(e.typeReferenceDirectives, t);
- if (c) {
- const u = (i = n.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(c, e)) == null ? void 0 : i.resolvedTypeReferenceDirective, d = u && n.getSourceFile(u.resolvedFileName);
- return d && { reference: c, fileName: d.fileName, file: d, unverified: !1 };
- }
- const _ = J8(e.libReferenceDirectives, t);
- if (_) {
- const u = n.getLibFileFromReference(_);
- return u && { reference: _, fileName: u.fileName, file: u, unverified: !1 };
- }
- if (e.imports.length || e.moduleAugmentations.length) {
- const u = T6(e, t);
- let d;
- if (s9(u) && Sl(u.text) && (d = n.getResolvedModuleFromModuleSpecifier(u, e))) {
- const g = (s = d.resolvedModule) == null ? void 0 : s.resolvedFileName, h = g || z1(Xn(e.fileName), u.text);
- return {
- file: n.getSourceFile(h),
- fileName: h,
- reference: {
- pos: u.getStart(),
- end: u.getEnd(),
- fileName: u.text
- },
- unverified: !g
- };
- }
- }
- }
- var b4e = /* @__PURE__ */ new Set([
- "Array",
- "ArrayLike",
- "ReadonlyArray",
- "Promise",
- "PromiseLike",
- "Iterable",
- "IterableIterator",
- "AsyncIterable",
- "Set",
- "WeakSet",
- "ReadonlySet",
- "Map",
- "WeakMap",
- "ReadonlyMap",
- "Partial",
- "Required",
- "Readonly",
- "Pick",
- "Omit"
- ]);
- function J$e(e, t) {
- const n = t.symbol.name;
- if (!b4e.has(n))
- return !1;
- const i = e.resolveName(
- n,
- /*location*/
- void 0,
- 788968,
- /*excludeGlobals*/
- !1
- );
- return !!i && i === t.target.symbol;
- }
- function S4e(e, t) {
- if (!t.aliasSymbol)
- return !1;
- const n = t.aliasSymbol.name;
- if (!b4e.has(n))
- return !1;
- const i = e.resolveName(
- n,
- /*location*/
- void 0,
- 788968,
- /*excludeGlobals*/
- !1
- );
- return !!i && i === t.aliasSymbol;
- }
- function z$e(e, t, n, i) {
- var s, o;
- if (wn(t) & 4 && J$e(e, t))
- return j8(e.getTypeArguments(t)[0], e, n, i);
- if (S4e(e, t) && t.aliasTypeArguments)
- return j8(t.aliasTypeArguments[0], e, n, i);
- if (wn(t) & 32 && t.target && S4e(e, t.target)) {
- const c = (o = (s = t.aliasSymbol) == null ? void 0 : s.declarations) == null ? void 0 : o[0];
- if (c && Vp(c) && vf(c.type) && c.type.typeArguments)
- return j8(e.getTypeAtLocation(c.type.typeArguments[0]), e, n, i);
- }
- return [];
- }
- function W$e(e, t, n) {
- const i = h_(t, n);
- if (i === t)
- return;
- if (yC(i.parent) && i.parent.name === i)
- return j8(
- e.getTypeAtLocation(i.parent),
- e,
- i.parent,
- /*failedAliasResolution*/
- !1
- );
- const { symbol: s, failedAliasResolution: o } = mH(
- i,
- e,
- /*stopAtAlias*/
- !1
- );
- if (!s) return;
- const c = e.getTypeOfSymbolAtLocation(s, i), _ = U$e(s, c, e), u = _ && j8(_, e, i, o), [d, g] = u && u.length !== 0 ? [_, u] : [c, j8(c, e, i, o)];
- return g.length ? [...z$e(e, d, i, o), ...g] : !(s.flags & 111551) && s.flags & 788968 ? fP(e, Hl(s, e), i, o) : void 0;
- }
- function j8(e, t, n, i) {
- return ta(e.isUnion() && !(e.flags & 32) ? e.types : [e], (s) => s.symbol && fP(t, s.symbol, n, i));
- }
- function U$e(e, t, n) {
- if (t.symbol === e || // At `const f = () => {}`, the symbol is `f` and the type symbol is at `() => {}`
- e.valueDeclaration && t.symbol && ii(e.valueDeclaration) && e.valueDeclaration.initializer === t.symbol.valueDeclaration) {
- const i = t.getCallSignatures();
- if (i.length === 1) return n.getReturnTypeOfSignature(xa(i));
- }
- }
- function V$e(e, t, n) {
- const i = h4e(e, t, n);
- if (!i || i.length === 0)
- return;
- const s = J8(t.referencedFiles, n) || J8(t.typeReferenceDirectives, n) || J8(t.libReferenceDirectives, n);
- if (s)
- return { definitions: i, textSpan: L0(s) };
- const o = h_(t, n), c = Ul(o.getStart(), o.getWidth());
- return { definitions: i, textSpan: c };
- }
- function q$e(e, t) {
- return Ai(t.getIndexInfosAtLocation(e), (n) => n.declaration && iL(t, n.declaration));
- }
- function mH(e, t, n) {
- const i = t.getSymbolAtLocation(e);
- let s = !1;
- if (i?.declarations && i.flags & 2097152 && !n && H$e(e, i.declarations[0])) {
- const o = t.getAliasedSymbol(i);
- if (o.declarations)
- return { symbol: o };
- s = !0;
- }
- return { symbol: i, failedAliasResolution: s };
- }
- function H$e(e, t) {
- return e.kind !== 80 && (e.kind !== 11 || !G1(e.parent)) ? !1 : e.parent === t ? !0 : t.kind !== 274;
- }
- function G$e(e) {
- if (!h4(e)) return !1;
- const t = or(e, (n) => Dl(n) ? !0 : h4(n) ? !1 : "quit");
- return !!t && Cc(t) === 5;
- }
- function fP(e, t, n, i, s) {
- const o = s !== void 0 ? Ln(t.declarations, s) : t.declarations, c = !s && (d() || g());
- if (c)
- return c;
- const _ = Ln(o, (S) => !G$e(S)), u = ut(_) ? _ : o;
- return lr(u, (S) => B8(
- S,
- e,
- t,
- n,
- /*unverified*/
- !1,
- i
- ));
- function d() {
- if (t.flags & 32 && !(t.flags & 19) && (UD(n) || n.kind === 137)) {
- const S = On(o, Zn);
- return S && h(
- S.members,
- /*selectConstructors*/
- !0
- );
- }
- }
- function g() {
- return BU(n) || HU(n) ? h(
- o,
- /*selectConstructors*/
- !1
- ) : void 0;
- }
- function h(S, T) {
- if (!S)
- return;
- const C = S.filter(T ? Qo : ys), D = C.filter((P) => !!P.body);
- return C.length ? D.length !== 0 ? D.map((P) => B8(P, e, t, n)) : [B8(
- _a(C),
- e,
- t,
- n,
- /*unverified*/
- !1,
- i
- )] : void 0;
- }
- }
- function B8(e, t, n, i, s, o) {
- const c = t.symbolToString(n), _ = j0.getSymbolKind(t, n, i), u = n.parent ? t.symbolToString(n.parent, i) : "";
- return qle(t, e, _, c, u, s, o);
- }
- function qle(e, t, n, i, s, o, c, _) {
- const u = t.getSourceFile();
- if (!_) {
- const d = os(t) || t;
- _ = t_(d, u);
- }
- return {
- fileName: u.fileName,
- textSpan: _,
- kind: n,
- name: i,
- containerKind: void 0,
- // TODO: GH#18217
- containerName: s,
- ...Eo.toContextSpan(
- _,
- u,
- Eo.getContextNode(t)
- ),
- isLocal: !Hle(e, t),
- isAmbient: !!(t.flags & 33554432),
- unverified: o,
- failedAliasResolution: c
- };
- }
- function $$e(e, t) {
- const n = Eo.getContextNode(e), i = t_(Wle(n) ? n.start : n, t);
- return {
- fileName: t.fileName,
- textSpan: i,
- kind: "keyword",
- name: "switch",
- containerKind: void 0,
- containerName: "",
- ...Eo.toContextSpan(i, t, n),
- isLocal: !0,
- isAmbient: !1,
- unverified: !1,
- failedAliasResolution: void 0
- };
- }
- function Hle(e, t) {
- if (e.isDeclarationVisible(t)) return !0;
- if (!t.parent) return !1;
- if (m0(t.parent) && t.parent.initializer === t) return Hle(e, t.parent);
- switch (t.kind) {
- case 172:
- case 177:
- case 178:
- case 174:
- if (Z_(
- t,
- 2
- /* Private */
- )) return !1;
- case 176:
- case 303:
- case 304:
- case 210:
- case 231:
- case 219:
- case 218:
- return Hle(e, t.parent);
- default:
- return !1;
- }
- }
- function iL(e, t, n) {
- return B8(
- t,
- e,
- t.symbol,
- t,
- /*unverified*/
- !1,
- n
- );
- }
- function J8(e, t) {
- return On(e, (n) => vw(n, t));
- }
- function X$e(e, t, n) {
- return {
- fileName: t,
- textSpan: kc(0, 0),
- kind: "script",
- name: e,
- containerName: void 0,
- containerKind: void 0,
- // TODO: GH#18217
- unverified: n
- };
- }
- function Q$e(e) {
- const t = or(e, (i) => !b6(i)), n = t?.parent;
- return n && mb(n) && x7(n) === t ? n : void 0;
- }
- function Y$e(e, t) {
- const n = Q$e(t), i = n && e.getResolvedSignature(n);
- return Wn(i && i.declaration, (s) => ys(s) && !lg(s));
- }
- function Z$e(e) {
- switch (e.kind) {
- case 176:
- case 185:
- case 179:
- case 180:
- return !0;
- default:
- return !1;
- }
- }
- var gH = {};
- La(gH, {
- provideInlayHints: () => rXe
- });
- var K$e = (e) => new RegExp(`^\\s?/\\*\\*?\\s?${e}\\s?\\*\\/\\s?$`);
- function eXe(e) {
- return e.includeInlayParameterNameHints === "literals" || e.includeInlayParameterNameHints === "all";
- }
- function tXe(e) {
- return e.includeInlayParameterNameHints === "literals";
- }
- function Gle(e) {
- return e.interactiveInlayHints === !0;
- }
- function rXe(e) {
- const { file: t, program: n, span: i, cancellationToken: s, preferences: o } = e, c = t.text, _ = n.getCompilerOptions(), u = bf(t, o), d = n.getTypeChecker(), g = [];
- return h(t), g;
- function h(_e) {
- if (!(!_e || _e.getFullWidth() === 0)) {
- switch (_e.kind) {
- case 267:
- case 263:
- case 264:
- case 262:
- case 231:
- case 218:
- case 174:
- case 219:
- s.throwIfCancellationRequested();
- }
- if (bw(i, _e.pos, _e.getFullWidth()) && !(fi(_e) && !Oh(_e)))
- return o.includeInlayVariableTypeHints && ii(_e) || o.includeInlayPropertyDeclarationTypeHints && cs(_e) ? F(_e) : o.includeInlayEnumMemberValueHints && A0(_e) ? P(_e) : eXe(o) && (Fs(_e) || jb(_e)) ? O(_e) : (o.includeInlayFunctionParameterTypeHints && no(_e) && P5(_e) && ae(_e), o.includeInlayFunctionLikeReturnTypeHints && S(_e) && q(_e)), bs(_e, h);
- }
- }
- function S(_e) {
- return Co(_e) || vo(_e) || Ec(_e) || hc(_e) || Lf(_e);
- }
- function T(_e, he, le, me) {
- let ve = `${me ? "..." : ""}${_e}`, tt;
- Gle(o) ? (tt = [oe(ve, he), { text: ":" }], ve = "") : ve += ":", g.push({
- text: ve,
- position: le,
- kind: "Parameter",
- whitespaceAfter: !0,
- displayParts: tt
- });
- }
- function C(_e, he) {
- g.push({
- text: typeof _e == "string" ? `: ${_e}` : "",
- displayParts: typeof _e == "string" ? void 0 : [{ text: ": " }, ..._e],
- position: he,
- kind: "Type",
- whitespaceBefore: !0
- });
- }
- function D(_e, he) {
- g.push({
- text: `= ${_e}`,
- position: he,
- kind: "Enum",
- whitespaceBefore: !0
- });
- }
- function P(_e) {
- if (_e.initializer)
- return;
- const he = d.getConstantValue(_e);
- he !== void 0 && D(he.toString(), _e.end);
- }
- function I(_e) {
- return _e.symbol && _e.symbol.flags & 1536;
- }
- function F(_e) {
- if (_e.initializer === void 0 && !(cs(_e) && !(d.getTypeAtLocation(_e).flags & 1)) || As(_e.name) || ii(_e) && !J(_e) || Gc(_e))
- return;
- const le = d.getTypeAtLocation(_e);
- if (I(le))
- return;
- const me = re(le);
- if (me) {
- const ve = typeof me == "string" ? me : me.map((Te) => Te.text).join("");
- if (o.includeInlayVariableTypeHintsWhenTypeMatchesName === !1 && Sy(_e.name.getText(), ve))
- return;
- C(me, _e.name.end);
- }
- }
- function O(_e) {
- const he = _e.arguments;
- if (!he || !he.length)
- return;
- const le = [], me = d.getResolvedSignatureForSignatureHelp(_e, le);
- if (!me || !le.length)
- return;
- let ve = 0;
- for (const tt of he) {
- const Te = Ba(tt);
- if (tXe(o) && !X(Te)) {
- ve++;
- continue;
- }
- let we = 0;
- if (fp(Te)) {
- const Me = d.getTypeAtLocation(Te.expression);
- if (d.isTupleType(Me)) {
- const { elementFlags: Qe, fixedLength: et } = Me.target;
- if (et === 0)
- continue;
- const Re = ac(Qe, (Wt) => !(Wt & 1));
- (Re < 0 ? et : Re) > 0 && (we = Re < 0 ? et : Re);
- }
- }
- const fe = d.getParameterIdentifierInfoAtPosition(me, ve);
- if (ve = ve + (we || 1), fe) {
- const { parameter: Me, parameterName: Qe, isRestParameter: et } = fe;
- if (!(o.includeInlayParameterNameHintsWhenArgumentMatchesName || !B(Te, Qe)) && !et)
- continue;
- const ft = Ei(Qe);
- if (z(Te, ft))
- continue;
- T(ft, Me, tt.getStart(), et);
- }
- }
- }
- function B(_e, he) {
- return Oe(_e) ? _e.text === he : Cn(_e) ? _e.name.text === he : !1;
- }
- function z(_e, he) {
- if (!k_(he, pa(_), F3(t.scriptKind)))
- return !1;
- const le = Ig(c, _e.pos);
- if (!le?.length)
- return !1;
- const me = K$e(he);
- return ut(le, (ve) => me.test(c.substring(ve.pos, ve.end)));
- }
- function X(_e) {
- switch (_e.kind) {
- case 224: {
- const he = _e.operand;
- return X2(he) || Oe(he) && G4(he.escapedText);
- }
- case 112:
- case 97:
- case 106:
- case 15:
- case 228:
- return !0;
- case 80: {
- const he = _e.escapedText;
- return Se(he) || G4(he);
- }
- }
- return X2(_e);
- }
- function q(_e) {
- if (Co(_e) && !Ya(_e, 21, t) || Y_(_e) || !_e.body)
- return;
- const le = d.getSignatureFromDeclaration(_e);
- if (!le)
- return;
- const me = d.getTypePredicateOfSignature(le);
- if (me?.type) {
- const Te = ne(me);
- if (Te) {
- C(Te, V(_e));
- return;
- }
- }
- const ve = d.getReturnTypeOfSignature(le);
- if (I(ve))
- return;
- const tt = re(ve);
- tt && C(tt, V(_e));
- }
- function V(_e) {
- const he = Ya(_e, 22, t);
- return he ? he.end : _e.parameters.end;
- }
- function ae(_e) {
- const he = d.getSignatureFromDeclaration(_e);
- if (he)
- for (let le = 0; le < _e.parameters.length && le < he.parameters.length; ++le) {
- const me = _e.parameters[le];
- if (!J(me) || Gc(me))
- continue;
- const tt = ee(he.parameters[le]);
- tt && C(tt, me.questionToken ? me.questionToken.end : me.name.end);
- }
- }
- function ee(_e) {
- const he = _e.valueDeclaration;
- if (!he || !Ii(he))
- return;
- const le = d.getTypeOfSymbolAtLocation(_e, he);
- if (!I(le))
- return re(le);
- }
- function G(_e) {
- const le = $b();
- return dC((me) => {
- const ve = d.typeToTypeNode(
- _e,
- /*enclosingDeclaration*/
- void 0,
- 71286784
- );
- E.assertIsDefined(ve, "should always get typenode"), le.writeNode(
- 4,
- ve,
- /*sourceFile*/
- t,
- me
- );
- });
- }
- function ue(_e) {
- const le = $b();
- return dC((me) => {
- const ve = d.typePredicateToTypePredicateNode(
- _e,
- /*enclosingDeclaration*/
- void 0,
- 71286784
- );
- E.assertIsDefined(ve, "should always get typePredicateNode"), le.writeNode(
- 4,
- ve,
- /*sourceFile*/
- t,
- me
- );
- });
- }
- function re(_e) {
- if (!Gle(o))
- return G(_e);
- const le = d.typeToTypeNode(
- _e,
- /*enclosingDeclaration*/
- void 0,
- 71286784
- );
- return E.assertIsDefined(le, "should always get typeNode"), ie(le);
- }
- function ne(_e) {
- if (!Gle(o))
- return ue(_e);
- const le = d.typePredicateToTypePredicateNode(
- _e,
- /*enclosingDeclaration*/
- void 0,
- 71286784
- );
- return E.assertIsDefined(le, "should always get typenode"), ie(le);
- }
- function ie(_e) {
- const he = [];
- return le(_e), he;
- function le(Te) {
- var we, fe;
- if (!Te)
- return;
- const Me = qs(Te.kind);
- if (Me) {
- he.push({ text: Me });
- return;
- }
- if (X2(Te)) {
- he.push({ text: tt(Te) });
- return;
- }
- switch (Te.kind) {
- case 80:
- E.assertNode(Te, Oe);
- const Qe = Nn(Te), et = Te.symbol && Te.symbol.declarations && Te.symbol.declarations.length && os(Te.symbol.declarations[0]);
- et ? he.push(oe(Qe, et)) : he.push({ text: Qe });
- break;
- case 166:
- E.assertNode(Te, Xu), le(Te.left), he.push({ text: "." }), le(Te.right);
- break;
- case 182:
- E.assertNode(Te, Px), Te.assertsModifier && he.push({ text: "asserts " }), le(Te.parameterName), Te.type && (he.push({ text: " is " }), le(Te.type));
- break;
- case 183:
- E.assertNode(Te, vf), le(Te.typeName), Te.typeArguments && (he.push({ text: "<" }), ve(Te.typeArguments, ", "), he.push({ text: ">" }));
- break;
- case 168:
- E.assertNode(Te, zo), Te.modifiers && ve(Te.modifiers, " "), le(Te.name), Te.constraint && (he.push({ text: " extends " }), le(Te.constraint)), Te.default && (he.push({ text: " = " }), le(Te.default));
- break;
- case 169:
- E.assertNode(Te, Ii), Te.modifiers && ve(Te.modifiers, " "), Te.dotDotDotToken && he.push({ text: "..." }), le(Te.name), Te.questionToken && he.push({ text: "?" }), Te.type && (he.push({ text: ": " }), le(Te.type));
- break;
- case 185:
- E.assertNode(Te, VC), he.push({ text: "new " }), me(Te), he.push({ text: " => " }), le(Te.type);
- break;
- case 186:
- E.assertNode(Te, Lb), he.push({ text: "typeof " }), le(Te.exprName), Te.typeArguments && (he.push({ text: "<" }), ve(Te.typeArguments, ", "), he.push({ text: ">" }));
- break;
- case 187:
- E.assertNode(Te, Qu), he.push({ text: "{" }), Te.members.length && (he.push({ text: " " }), ve(Te.members, "; "), he.push({ text: " " })), he.push({ text: "}" });
- break;
- case 188:
- E.assertNode(Te, rA), le(Te.elementType), he.push({ text: "[]" });
- break;
- case 189:
- E.assertNode(Te, wx), he.push({ text: "[" }), ve(Te.elements, ", "), he.push({ text: "]" });
- break;
- case 202:
- E.assertNode(Te, qC), Te.dotDotDotToken && he.push({ text: "..." }), le(Te.name), Te.questionToken && he.push({ text: "?" }), he.push({ text: ": " }), le(Te.type);
- break;
- case 190:
- E.assertNode(Te, G5), le(Te.type), he.push({ text: "?" });
- break;
- case 191:
- E.assertNode(Te, $5), he.push({ text: "..." }), le(Te.type);
- break;
- case 192:
- E.assertNode(Te, qy), ve(Te.types, " | ");
- break;
- case 193:
- E.assertNode(Te, Ax), ve(Te.types, " & ");
- break;
- case 194:
- E.assertNode(Te, Mb), le(Te.checkType), he.push({ text: " extends " }), le(Te.extendsType), he.push({ text: " ? " }), le(Te.trueType), he.push({ text: " : " }), le(Te.falseType);
- break;
- case 195:
- E.assertNode(Te, pS), he.push({ text: "infer " }), le(Te.typeParameter);
- break;
- case 196:
- E.assertNode(Te, dS), he.push({ text: "(" }), le(Te.type), he.push({ text: ")" });
- break;
- case 198:
- E.assertNode(Te, cv), he.push({ text: `${qs(Te.operator)} ` }), le(Te.type);
- break;
- case 199:
- E.assertNode(Te, Rb), le(Te.objectType), he.push({ text: "[" }), le(Te.indexType), he.push({ text: "]" });
- break;
- case 200:
- E.assertNode(Te, mS), he.push({ text: "{ " }), Te.readonlyToken && (Te.readonlyToken.kind === 40 ? he.push({ text: "+" }) : Te.readonlyToken.kind === 41 && he.push({ text: "-" }), he.push({ text: "readonly " })), he.push({ text: "[" }), le(Te.typeParameter), Te.nameType && (he.push({ text: " as " }), le(Te.nameType)), he.push({ text: "]" }), Te.questionToken && (Te.questionToken.kind === 40 ? he.push({ text: "+" }) : Te.questionToken.kind === 41 && he.push({ text: "-" }), he.push({ text: "?" })), he.push({ text: ": " }), Te.type && le(Te.type), he.push({ text: "; }" });
- break;
- case 201:
- E.assertNode(Te, P0), le(Te.literal);
- break;
- case 184:
- E.assertNode(Te, lg), me(Te), he.push({ text: " => " }), le(Te.type);
- break;
- case 205:
- E.assertNode(Te, bm), Te.isTypeOf && he.push({ text: "typeof " }), he.push({ text: "import(" }), le(Te.argument), Te.assertions && (he.push({ text: ", { assert: " }), ve(Te.assertions.assertClause.elements, ", "), he.push({ text: " }" })), he.push({ text: ")" }), Te.qualifier && (he.push({ text: "." }), le(Te.qualifier)), Te.typeArguments && (he.push({ text: "<" }), ve(Te.typeArguments, ", "), he.push({ text: ">" }));
- break;
- case 171:
- E.assertNode(Te, m_), (we = Te.modifiers) != null && we.length && (ve(Te.modifiers, " "), he.push({ text: " " })), le(Te.name), Te.questionToken && he.push({ text: "?" }), Te.type && (he.push({ text: ": " }), le(Te.type));
- break;
- case 181:
- E.assertNode(Te, Fb), he.push({ text: "[" }), ve(Te.parameters, ", "), he.push({ text: "]" }), Te.type && (he.push({ text: ": " }), le(Te.type));
- break;
- case 173:
- E.assertNode(Te, vm), (fe = Te.modifiers) != null && fe.length && (ve(Te.modifiers, " "), he.push({ text: " " })), le(Te.name), Te.questionToken && he.push({ text: "?" }), me(Te), Te.type && (he.push({ text: ": " }), le(Te.type));
- break;
- case 179:
- E.assertNode(Te, Dx), me(Te), Te.type && (he.push({ text: ": " }), le(Te.type));
- break;
- case 207:
- E.assertNode(Te, w0), he.push({ text: "[" }), ve(Te.elements, ", "), he.push({ text: "]" });
- break;
- case 206:
- E.assertNode(Te, Mf), he.push({ text: "{" }), Te.elements.length && (he.push({ text: " " }), ve(Te.elements, ", "), he.push({ text: " " })), he.push({ text: "}" });
- break;
- case 208:
- E.assertNode(Te, va), le(Te.name);
- break;
- case 224:
- E.assertNode(Te, uv), he.push({ text: qs(Te.operator) }), le(Te.operand);
- break;
- case 203:
- E.assertNode(Te, Hee), le(Te.head), Te.templateSpans.forEach(le);
- break;
- case 16:
- E.assertNode(Te, kx), he.push({ text: tt(Te) });
- break;
- case 204:
- E.assertNode(Te, IJ), le(Te.type), le(Te.literal);
- break;
- case 17:
- E.assertNode(Te, PJ), he.push({ text: tt(Te) });
- break;
- case 18:
- E.assertNode(Te, U5), he.push({ text: tt(Te) });
- break;
- case 197:
- E.assertNode(Te, HC), he.push({ text: "this" });
- break;
- default:
- E.failBadSyntaxKind(Te);
- }
- }
- function me(Te) {
- Te.typeParameters && (he.push({ text: "<" }), ve(Te.typeParameters, ", "), he.push({ text: ">" })), he.push({ text: "(" }), ve(Te.parameters, ", "), he.push({ text: ")" });
- }
- function ve(Te, we) {
- Te.forEach((fe, Me) => {
- Me > 0 && he.push({ text: we }), le(fe);
- });
- }
- function tt(Te) {
- switch (Te.kind) {
- case 11:
- return u === 0 ? `'${cg(
- Te.text,
- 39
- /* singleQuote */
- )}'` : `"${cg(
- Te.text,
- 34
- /* doubleQuote */
- )}"`;
- case 16:
- case 17:
- case 18: {
- const we = Te.rawText ?? xB(cg(
- Te.text,
- 96
- /* backtick */
- ));
- switch (Te.kind) {
- case 16:
- return "`" + we + "${";
- case 17:
- return "}" + we + "${";
- case 18:
- return "}" + we + "`";
- }
- }
- }
- return Te.text;
- }
- }
- function Se(_e) {
- return _e === "undefined";
- }
- function J(_e) {
- if ((iv(_e) || ii(_e) && hC(_e)) && _e.initializer) {
- const he = Ba(_e.initializer);
- return !(X(he) || jb(he) || Ks(he) || $1(he));
- }
- return !0;
- }
- function oe(_e, he) {
- const le = he.getSourceFile();
- return {
- text: _e,
- span: t_(he, le),
- file: le.fileName
- };
- }
- }
- var wv = {};
- La(wv, {
- getDocCommentTemplateAtPosition: () => pXe,
- getJSDocParameterNameCompletionDetails: () => fXe,
- getJSDocParameterNameCompletions: () => _Xe,
- getJSDocTagCompletionDetails: () => P4e,
- getJSDocTagCompletions: () => uXe,
- getJSDocTagNameCompletionDetails: () => lXe,
- getJSDocTagNameCompletions: () => cXe,
- getJsDocCommentsFromDeclarations: () => nXe,
- getJsDocTagsFromDeclarations: () => aXe
- });
- var T4e = [
- "abstract",
- "access",
- "alias",
- "argument",
- "async",
- "augments",
- "author",
- "borrows",
- "callback",
- "class",
- "classdesc",
- "constant",
- "constructor",
- "constructs",
- "copyright",
- "default",
- "deprecated",
- "description",
- "emits",
- "enum",
- "event",
- "example",
- "exports",
- "extends",
- "external",
- "field",
- "file",
- "fileoverview",
- "fires",
- "function",
- "generator",
- "global",
- "hideconstructor",
- "host",
- "ignore",
- "implements",
- "import",
- "inheritdoc",
- "inner",
- "instance",
- "interface",
- "kind",
- "lends",
- "license",
- "link",
- "linkcode",
- "linkplain",
- "listens",
- "member",
- "memberof",
- "method",
- "mixes",
- "module",
- "name",
- "namespace",
- "overload",
- "override",
- "package",
- "param",
- "private",
- "prop",
- "property",
- "protected",
- "public",
- "readonly",
- "requires",
- "returns",
- "satisfies",
- "see",
- "since",
- "static",
- "summary",
- "template",
- "this",
- "throws",
- "todo",
- "tutorial",
- "type",
- "typedef",
- "var",
- "variation",
- "version",
- "virtual",
- "yields"
- ], x4e, k4e;
- function nXe(e, t) {
- const n = [];
- return yV(e, (i) => {
- for (const s of sXe(i)) {
- const o = Id(s) && s.tags && On(s.tags, (_) => _.kind === 327 && (_.tagName.escapedText === "inheritDoc" || _.tagName.escapedText === "inheritdoc"));
- if (s.comment === void 0 && !o || Id(s) && i.kind !== 346 && i.kind !== 338 && s.tags && s.tags.some(
- (_) => _.kind === 346 || _.kind === 338
- /* JSDocCallbackTag */
- ) && !s.tags.some(
- (_) => _.kind === 341 || _.kind === 342
- /* JSDocReturnTag */
- ))
- continue;
- let c = s.comment ? M6(s.comment, t) : [];
- o && o.comment && (c = c.concat(M6(o.comment, t))), ss(n, c, iXe) || n.push(c);
- }
- }), Np(rR(n, [E6()]));
- }
- function iXe(e, t) {
- return Af(e, t, (n, i) => n.kind === i.kind && n.text === i.text);
- }
- function sXe(e) {
- switch (e.kind) {
- case 341:
- case 348:
- return [e];
- case 338:
- case 346:
- return [e, e.parent];
- case 323:
- if (ZC(e.parent))
- return [e.parent.parent];
- default:
- return cB(e);
- }
- }
- function aXe(e, t) {
- const n = [];
- return yV(e, (i) => {
- const s = H1(i);
- if (!(s.some(
- (o) => o.kind === 346 || o.kind === 338
- /* JSDocCallbackTag */
- ) && !s.some(
- (o) => o.kind === 341 || o.kind === 342
- /* JSDocReturnTag */
- )))
- for (const o of s)
- n.push({ name: o.tagName.text, text: D4e(o, t) }), n.push(...C4e(E4e(o), t));
- }), n;
- }
- function C4e(e, t) {
- return ta(e, (n) => Qi([{ name: n.tagName.text, text: D4e(n, t) }], C4e(E4e(n), t)));
- }
- function E4e(e) {
- return r4(e) && e.isNameFirst && e.typeExpression && bS(e.typeExpression.type) ? e.typeExpression.type.jsDocPropertyTags : void 0;
- }
- function M6(e, t) {
- return typeof e == "string" ? [Jf(e)] : ta(
- e,
- (n) => n.kind === 321 ? [Jf(n.text)] : Ise(n, t)
- );
- }
- function D4e(e, t) {
- const { comment: n, kind: i } = e, s = oXe(i);
- switch (i) {
- case 349:
- const _ = e.typeExpression;
- return _ ? o(_) : n === void 0 ? void 0 : M6(n, t);
- case 329:
- return o(e.class);
- case 328:
- return o(e.class);
- case 345:
- const u = e, d = [];
- if (u.constraint && d.push(Jf(u.constraint.getText())), Nr(u.typeParameters)) {
- Nr(d) && d.push(uc());
- const h = u.typeParameters[u.typeParameters.length - 1];
- ir(u.typeParameters, (S) => {
- d.push(s(S.getText())), h !== S && d.push(Tu(
- 28
- /* CommaToken */
- ), uc());
- });
- }
- return n && d.push(uc(), ...M6(n, t)), d;
- case 344:
- case 350:
- return o(e.typeExpression);
- case 346:
- case 338:
- case 348:
- case 341:
- case 347:
- const { name: g } = e;
- return g ? o(g) : n === void 0 ? void 0 : M6(n, t);
- default:
- return n === void 0 ? void 0 : M6(n, t);
- }
- function o(_) {
- return c(_.getText());
- }
- function c(_) {
- return n ? _.match(/^https?$/) ? [Jf(_), ...M6(n, t)] : [s(_), uc(), ...M6(n, t)] : [Jf(_)];
- }
- }
- function oXe(e) {
- switch (e) {
- case 341:
- return Dse;
- case 348:
- return Pse;
- case 345:
- return Ase;
- case 346:
- case 338:
- return wse;
- default:
- return Jf;
- }
- }
- function cXe() {
- return x4e || (x4e = lr(T4e, (e) => ({
- name: e,
- kind: "keyword",
- kindModifiers: "",
- sortText: ck.SortText.LocationPriority
- })));
- }
- var lXe = P4e;
- function uXe() {
- return k4e || (k4e = lr(T4e, (e) => ({
- name: `@${e}`,
- kind: "keyword",
- kindModifiers: "",
- sortText: ck.SortText.LocationPriority
- })));
- }
- function P4e(e) {
- return {
- name: e,
- kind: "",
- // TODO: should have its own kind?
- kindModifiers: "",
- displayParts: [Jf(e)],
- documentation: Ue,
- tags: void 0,
- codeActions: void 0
- };
- }
- function _Xe(e) {
- if (!Oe(e.name))
- return Ue;
- const t = e.name.text, n = e.parent, i = n.parent;
- return ys(i) ? Ai(i.parameters, (s) => {
- if (!Oe(s.name)) return;
- const o = s.name.text;
- if (!(n.tags.some((c) => c !== e && dp(c) && Oe(c.name) && c.name.escapedText === o) || t !== void 0 && !Ui(o, t)))
- return { name: o, kind: "parameter", kindModifiers: "", sortText: ck.SortText.LocationPriority };
- }) : [];
- }
- function fXe(e) {
- return {
- name: e,
- kind: "parameter",
- kindModifiers: "",
- displayParts: [Jf(e)],
- documentation: Ue,
- tags: void 0,
- codeActions: void 0
- };
- }
- function pXe(e, t, n, i) {
- const s = xi(t, n), o = or(s, Id);
- if (o && (o.comment !== void 0 || Nr(o.tags)))
- return;
- const c = s.getStart(t);
- if (!o && c < n)
- return;
- const _ = hXe(s, i);
- if (!_)
- return;
- const { commentOwner: u, parameters: d, hasReturn: g } = _, h = gf(u) && u.jsDoc ? u.jsDoc : void 0, S = Ro(h);
- if (u.getStart(t) < n || S && o && S !== o)
- return;
- const T = dXe(t, n), C = Ug(t.fileName), D = (d ? mXe(d || [], C, T, e) : "") + (g ? gXe(T, e) : ""), P = "/**", I = " */", F = Nr(H1(u)) > 0;
- if (D && !F) {
- const O = P + e + T + " * ", B = c === n ? e + T : "";
- return { newText: O + e + D + T + I + B, caretOffset: O.length };
- }
- return { newText: P + I, caretOffset: 3 };
- }
- function dXe(e, t) {
- const { text: n } = e, i = $p(t, e);
- let s = i;
- for (; s <= t && sm(n.charCodeAt(s)); s++) ;
- return n.slice(i, s);
- }
- function mXe(e, t, n, i) {
- return e.map(({ name: s, dotDotDotToken: o }, c) => {
- const _ = s.kind === 80 ? s.text : "param" + c;
- return `${n} * @param ${t ? o ? "{...any} " : "{any} " : ""}${_}${i}`;
- }).join("");
- }
- function gXe(e, t) {
- return `${e} * @returns${t}`;
- }
- function hXe(e, t) {
- return KY(e, (n) => $le(n, t));
- }
- function $le(e, t) {
- switch (e.kind) {
- case 262:
- case 218:
- case 174:
- case 176:
- case 173:
- case 219:
- const n = e;
- return { commentOwner: e, parameters: n.parameters, hasReturn: sL(n, t) };
- case 303:
- return $le(e.initializer, t);
- case 263:
- case 264:
- case 266:
- case 306:
- case 265:
- return { commentOwner: e };
- case 171: {
- const s = e;
- return s.type && lg(s.type) ? { commentOwner: e, parameters: s.type.parameters, hasReturn: sL(s.type, t) } : { commentOwner: e };
- }
- case 243: {
- const o = e.declarationList.declarations, c = o.length === 1 && o[0].initializer ? yXe(o[0].initializer) : void 0;
- return c ? { commentOwner: e, parameters: c.parameters, hasReturn: sL(c, t) } : { commentOwner: e };
- }
- case 307:
- return "quit";
- case 267:
- return e.parent.kind === 267 ? void 0 : { commentOwner: e };
- case 244:
- return $le(e.expression, t);
- case 226: {
- const s = e;
- return Cc(s) === 0 ? "quit" : ys(s.right) ? { commentOwner: e, parameters: s.right.parameters, hasReturn: sL(s.right, t) } : { commentOwner: e };
- }
- case 172:
- const i = e.initializer;
- if (i && (vo(i) || Co(i)))
- return { commentOwner: e, parameters: i.parameters, hasReturn: sL(i, t) };
- }
- }
- function sL(e, t) {
- return !!t?.generateReturnInDocTemplate && (lg(e) || Co(e) && _t(e.body) || no(e) && e.body && Cs(e.body) && !!y0(e.body, (n) => n));
- }
- function yXe(e) {
- for (; e.kind === 217; )
- e = e.expression;
- switch (e.kind) {
- case 218:
- case 219:
- return e;
- case 231:
- return On(e.members, Qo);
- }
- }
- var hH = {};
- La(hH, {
- mapCode: () => vXe
- });
- function vXe(e, t, n, i, s, o) {
- return sn.ChangeTracker.with(
- { host: i, formatContext: s, preferences: o },
- (c) => {
- const _ = t.map((d) => bXe(e, d)), u = n && Np(n);
- for (const d of _)
- SXe(
- e,
- c,
- d,
- u
- );
- }
- );
- }
- function bXe(e, t) {
- const n = [
- {
- parse: () => Bx(
- "__mapcode_content_nodes.ts",
- t,
- e.languageVersion,
- /*setParentNodes*/
- !0,
- e.scriptKind
- ),
- body: (o) => o.statements
- },
- {
- parse: () => Bx(
- "__mapcode_class_content_nodes.ts",
- `class __class {
-${t}
-}`,
- e.languageVersion,
- /*setParentNodes*/
- !0,
- e.scriptKind
- ),
- body: (o) => o.statements[0].members
- }
- ], i = [];
- for (const { parse: o, body: c } of n) {
- const _ = o(), u = c(_);
- if (u.length && _.parseDiagnostics.length === 0)
- return u;
- u.length && i.push({ sourceFile: _, body: u });
- }
- i.sort(
- (o, c) => o.sourceFile.parseDiagnostics.length - c.sourceFile.parseDiagnostics.length
- );
- const { body: s } = i[0];
- return s;
- }
- function SXe(e, t, n, i) {
- _l(n[0]) || db(n[0]) ? TXe(
- e,
- t,
- n,
- i
- ) : xXe(
- e,
- t,
- n,
- i
- );
- }
- function TXe(e, t, n, i) {
- let s;
- if (!i || !i.length ? s = On(e.statements, Nf(Zn, Xl)) : s = ir(i, (c) => or(
- xi(e, c.start),
- Nf(Zn, Xl)
- )), !s)
- return;
- const o = s.members.find((c) => n.some((_) => aL(_, c)));
- if (o) {
- const c = ob(
- s.members,
- (_) => n.some((u) => aL(u, _))
- );
- ir(n, yH), t.replaceNodeRangeWithNodes(
- e,
- o,
- c,
- n
- );
- return;
- }
- ir(n, yH), t.insertNodesAfter(
- e,
- s.members[s.members.length - 1],
- n
- );
- }
- function xXe(e, t, n, i) {
- if (!i?.length) {
- t.insertNodesAtEndOfFile(
- e,
- n,
- /*blankLineBetween*/
- !1
- );
- return;
- }
- for (const o of i) {
- const c = or(
- xi(e, o.start),
- (_) => Nf(Cs, Si)(_) && ut(_.statements, (u) => n.some((d) => aL(d, u)))
- );
- if (c) {
- const _ = c.statements.find((u) => n.some((d) => aL(d, u)));
- if (_) {
- const u = ob(c.statements, (d) => n.some((g) => aL(g, d)));
- ir(n, yH), t.replaceNodeRangeWithNodes(
- e,
- _,
- u,
- n
- );
- return;
- }
- }
- }
- let s = e.statements;
- for (const o of i) {
- const c = or(
- xi(e, o.start),
- Cs
- );
- if (c) {
- s = c.statements;
- break;
- }
- }
- ir(n, yH), t.insertNodesAfter(
- e,
- s[s.length - 1],
- n
- );
- }
- function aL(e, t) {
- var n, i, s, o, c, _;
- return e.kind !== t.kind ? !1 : e.kind === 176 ? e.kind === t.kind : Vl(e) && Vl(t) ? e.name.getText() === t.name.getText() : _v(e) && _v(t) || RJ(e) && RJ(t) ? e.expression.getText() === t.expression.getText() : fv(e) && fv(t) ? ((n = e.initializer) == null ? void 0 : n.getText()) === ((i = t.initializer) == null ? void 0 : i.getText()) && ((s = e.incrementor) == null ? void 0 : s.getText()) === ((o = t.incrementor) == null ? void 0 : o.getText()) && ((c = e.condition) == null ? void 0 : c.getText()) === ((_ = t.condition) == null ? void 0 : _.getText()) : Z2(e) && Z2(t) ? e.expression.getText() === t.expression.getText() && e.initializer.getText() === t.initializer.getText() : Gy(e) && Gy(t) ? e.label.getText() === t.label.getText() : e.getText() === t.getText();
- }
- function yH(e) {
- w4e(e), e.parent = void 0;
- }
- function w4e(e) {
- e.pos = -1, e.end = -1, e.forEachChild(w4e);
- }
- var Av = {};
- La(Av, {
- compareImportsOrRequireStatements: () => rue,
- compareModuleSpecifiers: () => WXe,
- getImportDeclarationInsertionIndex: () => jXe,
- getImportSpecifierInsertionIndex: () => BXe,
- getNamedImportSpecifierComparerWithDetection: () => RXe,
- getOrganizeImportsStringComparerWithDetection: () => MXe,
- organizeImports: () => kXe,
- testCoalesceExports: () => zXe,
- testCoalesceImports: () => JXe
- });
- function kXe(e, t, n, i, s, o) {
- const c = sn.ChangeTracker.fromContext({ host: n, formatContext: t, preferences: s }), _ = o === "SortAndCombine" || o === "All", u = _, d = o === "RemoveUnused" || o === "All", g = e.statements.filter(ic), h = Qle(e, g), { comparersToTest: S, typeOrdersToTest: T } = Xle(s), C = S[0], D = {
- moduleSpecifierComparer: typeof s.organizeImportsIgnoreCase == "boolean" ? C : void 0,
- namedImportComparer: typeof s.organizeImportsIgnoreCase == "boolean" ? C : void 0,
- typeOrder: s.organizeImportsTypeOrder
- };
- if (typeof s.organizeImportsIgnoreCase != "boolean" && ({ comparer: D.moduleSpecifierComparer } = I4e(h, S)), !D.typeOrder || typeof s.organizeImportsIgnoreCase != "boolean") {
- const O = eue(g, S, T);
- if (O) {
- const { namedImportComparer: B, typeOrder: z } = O;
- D.namedImportComparer = D.namedImportComparer ?? B, D.typeOrder = D.typeOrder ?? z;
- }
- }
- h.forEach((O) => I(O, D)), o !== "RemoveUnused" && EXe(e).forEach((O) => F(O, D.namedImportComparer));
- for (const O of e.statements.filter(Fu)) {
- if (!O.body) continue;
- if (Qle(e, O.body.statements.filter(ic)).forEach((z) => I(z, D)), o !== "RemoveUnused") {
- const z = O.body.statements.filter(Nc);
- F(z, D.namedImportComparer);
- }
- }
- return c.getChanges();
- function P(O, B) {
- if (Nr(O) === 0)
- return;
- an(
- O[0],
- 1024
- /* NoLeadingComments */
- );
- const z = u ? Zk(O, (V) => oL(V.moduleSpecifier)) : [O], X = _ ? V_(z, (V, ae) => Zle(V[0].moduleSpecifier, ae[0].moduleSpecifier, D.moduleSpecifierComparer ?? C)) : z, q = ta(X, (V) => oL(V[0].moduleSpecifier) || V[0].moduleSpecifier === void 0 ? B(V) : V);
- if (q.length === 0)
- c.deleteNodes(
- e,
- O,
- {
- leadingTriviaOption: sn.LeadingTriviaOption.Exclude,
- trailingTriviaOption: sn.TrailingTriviaOption.Include
- },
- /*hasTrailingComment*/
- !0
- );
- else {
- const V = {
- leadingTriviaOption: sn.LeadingTriviaOption.Exclude,
- // Leave header comment in place
- trailingTriviaOption: sn.TrailingTriviaOption.Include,
- suffix: jh(n, t.options)
- };
- c.replaceNodeWithNodes(e, O[0], q, V);
- const ae = c.nodeHasTrailingComment(e, O[0], V);
- c.deleteNodes(e, O.slice(1), {
- trailingTriviaOption: sn.TrailingTriviaOption.Include
- }, ae);
- }
- }
- function I(O, B) {
- const z = B.moduleSpecifierComparer ?? C, X = B.namedImportComparer ?? C, q = B.typeOrder ?? "last", V = W8({ organizeImportsTypeOrder: q }, X);
- P(O, (ee) => (d && (ee = DXe(ee, e, i)), u && (ee = A4e(ee, z, V, e)), _ && (ee = V_(ee, (G, ue) => rue(G, ue, z))), ee));
- }
- function F(O, B) {
- const z = W8(s, B);
- P(O, (X) => N4e(X, z));
- }
- }
- function Xle(e) {
- return {
- comparersToTest: typeof e.organizeImportsIgnoreCase == "boolean" ? [tue(e, e.organizeImportsIgnoreCase)] : [tue(
- e,
- /*ignoreCase*/
- !0
- ), tue(
- e,
- /*ignoreCase*/
- !1
- )],
- typeOrdersToTest: e.organizeImportsTypeOrder ? [e.organizeImportsTypeOrder] : ["last", "inline", "first"]
- };
- }
- function Qle(e, t) {
- const n = Og(
- e.languageVersion,
- /*skipTrivia*/
- !1,
- e.languageVariant
- ), i = [];
- let s = 0;
- for (const o of t)
- i[s] && CXe(e, o, n) && s++, i[s] || (i[s] = []), i[s].push(o);
- return i;
- }
- function CXe(e, t, n) {
- const i = t.getFullStart(), s = t.getStart();
- n.setText(e.text, i, s - i);
- let o = 0;
- for (; n.getTokenStart() < s; )
- if (n.scan() === 4 && (o++, o >= 2))
- return !0;
- return !1;
- }
- function EXe(e) {
- const t = [], n = e.statements, i = Nr(n);
- let s = 0, o = 0;
- for (; s < i; )
- if (Nc(n[s])) {
- t[o] === void 0 && (t[o] = []);
- const c = n[s];
- if (c.moduleSpecifier)
- t[o].push(c), s++;
- else {
- for (; s < i && Nc(n[s]); )
- t[o].push(n[s++]);
- o++;
- }
- } else
- s++;
- return ta(t, (c) => Qle(e, c));
- }
- function DXe(e, t, n) {
- const i = n.getTypeChecker(), s = n.getCompilerOptions(), o = i.getJsxNamespace(t), c = i.getJsxFragmentFactory(t), _ = !!(t.transformFlags & 2), u = [];
- for (const g of e) {
- const { importClause: h, moduleSpecifier: S } = g;
- if (!h) {
- u.push(g);
- continue;
- }
- let { name: T, namedBindings: C } = h;
- if (T && !d(T) && (T = void 0), C)
- if (Hg(C))
- d(C.name) || (C = void 0);
- else {
- const D = C.elements.filter((P) => d(P.name));
- D.length < C.elements.length && (C = D.length ? A.updateNamedImports(C, D) : void 0);
- }
- T || C ? u.push(z8(g, T, C)) : AXe(t, S) && (t.isDeclarationFile ? u.push(A.createImportDeclaration(
- g.modifiers,
- /*importClause*/
- void 0,
- S,
- /*attributes*/
- void 0
- )) : u.push(g));
- }
- return u;
- function d(g) {
- return _ && (g.text === o || c && g.text === c) && jV(s.jsx) || Eo.Core.isSymbolReferencedInFile(g, i, t);
- }
- }
- function oL(e) {
- return e !== void 0 && Xa(e) ? e.text : void 0;
- }
- function PXe(e) {
- let t;
- const n = { defaultImports: [], namespaceImports: [], namedImports: [] }, i = { defaultImports: [], namespaceImports: [], namedImports: [] };
- for (const s of e) {
- if (s.importClause === void 0) {
- t = t || s;
- continue;
- }
- const o = s.importClause.isTypeOnly ? n : i, { name: c, namedBindings: _ } = s.importClause;
- c && o.defaultImports.push(s), _ && (Hg(_) ? o.namespaceImports.push(s) : o.namedImports.push(s));
- }
- return {
- importWithoutClause: t,
- typeOnlyImports: n,
- regularImports: i
- };
- }
- function A4e(e, t, n, i) {
- if (e.length === 0)
- return e;
- const s = dR(e, (c) => {
- if (c.attributes) {
- let _ = c.attributes.token + " ";
- for (const u of V_(c.attributes.elements, (d, g) => au(d.name.text, g.name.text)))
- _ += u.name.text + ":", _ += Xa(u.value) ? `"${u.value.text}"` : u.value.getText() + " ";
- return _;
- }
- return "";
- }), o = [];
- for (const c in s) {
- const _ = s[c], { importWithoutClause: u, typeOnlyImports: d, regularImports: g } = PXe(_);
- u && o.push(u);
- for (const h of [g, d]) {
- const S = h === d, { defaultImports: T, namespaceImports: C, namedImports: D } = h;
- if (!S && T.length === 1 && C.length === 1 && D.length === 0) {
- const V = T[0];
- o.push(
- z8(V, V.importClause.name, C[0].importClause.namedBindings)
- );
- continue;
- }
- const P = V_(C, (V, ae) => t(V.importClause.namedBindings.name.text, ae.importClause.namedBindings.name.text));
- for (const V of P)
- o.push(
- z8(
- V,
- /*name*/
- void 0,
- V.importClause.namedBindings
- )
- );
- const I = el(T), F = el(D), O = I ?? F;
- if (!O)
- continue;
- let B;
- const z = [];
- if (T.length === 1)
- B = T[0].importClause.name;
- else
- for (const V of T)
- z.push(
- A.createImportSpecifier(
- /*isTypeOnly*/
- !1,
- A.createIdentifier("default"),
- V.importClause.name
- )
- );
- z.push(...NXe(D));
- const X = A.createNodeArray(
- V_(z, n),
- F?.importClause.namedBindings.elements.hasTrailingComma
- ), q = X.length === 0 ? B ? void 0 : A.createNamedImports(Ue) : F ? A.updateNamedImports(F.importClause.namedBindings, X) : A.createNamedImports(X);
- i && q && F?.importClause.namedBindings && !lS(F.importClause.namedBindings, i) && an(
- q,
- 2
- /* MultiLine */
- ), S && B && q ? (o.push(
- z8(
- O,
- B,
- /*namedBindings*/
- void 0
- )
- ), o.push(
- z8(
- F ?? O,
- /*name*/
- void 0,
- q
- )
- )) : o.push(
- z8(O, B, q)
- );
- }
- }
- return o;
- }
- function N4e(e, t) {
- if (e.length === 0)
- return e;
- const { exportWithoutClause: n, namedExports: i, typeOnlyExports: s } = c(e), o = [];
- n && o.push(n);
- for (const _ of [i, s]) {
- if (_.length === 0)
- continue;
- const u = [];
- u.push(...ta(_, (h) => h.exportClause && pp(h.exportClause) ? h.exportClause.elements : Ue));
- const d = V_(u, t), g = _[0];
- o.push(
- A.updateExportDeclaration(
- g,
- g.modifiers,
- g.isTypeOnly,
- g.exportClause && (pp(g.exportClause) ? A.updateNamedExports(g.exportClause, d) : A.updateNamespaceExport(g.exportClause, g.exportClause.name)),
- g.moduleSpecifier,
- g.attributes
- )
- );
- }
- return o;
- function c(_) {
- let u;
- const d = [], g = [];
- for (const h of _)
- h.exportClause === void 0 ? u = u || h : h.isTypeOnly ? g.push(h) : d.push(h);
- return {
- exportWithoutClause: u,
- namedExports: d,
- typeOnlyExports: g
- };
- }
- }
- function z8(e, t, n) {
- return A.updateImportDeclaration(
- e,
- e.modifiers,
- A.updateImportClause(e.importClause, e.importClause.isTypeOnly, t, n),
- // TODO: GH#18217
- e.moduleSpecifier,
- e.attributes
- );
- }
- function Yle(e, t, n, i) {
- switch (i?.organizeImportsTypeOrder) {
- case "first":
- return J1(t.isTypeOnly, e.isTypeOnly) || n(e.name.text, t.name.text);
- case "inline":
- return n(e.name.text, t.name.text);
- default:
- return J1(e.isTypeOnly, t.isTypeOnly) || n(e.name.text, t.name.text);
- }
- }
- function Zle(e, t, n) {
- const i = e === void 0 ? void 0 : oL(e), s = t === void 0 ? void 0 : oL(t);
- return J1(i === void 0, s === void 0) || J1(Sl(i), Sl(s)) || n(i, s);
- }
- function wXe(e) {
- return e.map((t) => oL(Kle(t)) || "");
- }
- function Kle(e) {
- var t;
- switch (e.kind) {
- case 271:
- return (t = Wn(e.moduleReference, Fh)) == null ? void 0 : t.expression;
- case 272:
- return e.moduleSpecifier;
- case 243:
- return e.declarationList.declarations[0].initializer.arguments[0];
- }
- }
- function AXe(e, t) {
- const n = oa(t) && t.text;
- return _s(n) && ut(e.moduleAugmentations, (i) => oa(i) && i.text === n);
- }
- function NXe(e) {
- return ta(e, (t) => lr(IXe(t), (n) => n.name && n.propertyName && hb(n.name) === hb(n.propertyName) ? A.updateImportSpecifier(
- n,
- n.isTypeOnly,
- /*propertyName*/
- void 0,
- n.name
- ) : n));
- }
- function IXe(e) {
- var t;
- return (t = e.importClause) != null && t.namedBindings && Tm(e.importClause.namedBindings) ? e.importClause.namedBindings.elements : void 0;
- }
- function I4e(e, t) {
- const n = [];
- return e.forEach((i) => {
- n.push(wXe(i));
- }), F4e(n, t);
- }
- function eue(e, t, n) {
- let i = !1;
- const s = e.filter((u) => {
- var d, g;
- const h = (g = Wn((d = u.importClause) == null ? void 0 : d.namedBindings, Tm)) == null ? void 0 : g.elements;
- return h?.length ? (!i && h.some((S) => S.isTypeOnly) && h.some((S) => !S.isTypeOnly) && (i = !0), !0) : !1;
- });
- if (s.length === 0) return;
- const o = s.map((u) => {
- var d, g;
- return (g = Wn((d = u.importClause) == null ? void 0 : d.namedBindings, Tm)) == null ? void 0 : g.elements;
- }).filter((u) => u !== void 0);
- if (!i || n.length === 0) {
- const u = F4e(o.map((d) => d.map((g) => g.name.text)), t);
- return {
- namedImportComparer: u.comparer,
- typeOrder: n.length === 1 ? n[0] : void 0,
- isSorted: u.isSorted
- };
- }
- const c = { first: 1 / 0, last: 1 / 0, inline: 1 / 0 }, _ = { first: t[0], last: t[0], inline: t[0] };
- for (const u of t) {
- const d = { first: 0, last: 0, inline: 0 };
- for (const g of o)
- for (const h of n)
- d[h] = (d[h] ?? 0) + O4e(g, (S, T) => Yle(S, T, u, { organizeImportsTypeOrder: h }));
- for (const g of n) {
- const h = g;
- d[h] < c[h] && (c[h] = d[h], _[h] = u);
- }
- }
- e: for (const u of n) {
- const d = u;
- for (const g of n)
- if (c[g] < c[d]) continue e;
- return { namedImportComparer: _[d], typeOrder: d, isSorted: c[d] === 0 };
- }
- return { namedImportComparer: _.last, typeOrder: "last", isSorted: c.last === 0 };
- }
- function O4e(e, t) {
- let n = 0;
- for (let i = 0; i < e.length - 1; i++)
- t(e[i], e[i + 1]) > 0 && n++;
- return n;
- }
- function F4e(e, t) {
- let n, i = 1 / 0;
- for (const s of t) {
- let o = 0;
- for (const c of e) {
- if (c.length <= 1) continue;
- const _ = O4e(c, s);
- o += _;
- }
- o < i && (i = o, n = s);
- }
- return {
- comparer: n ?? t[0],
- isSorted: i === 0
- };
- }
- function OXe(e, t) {
- return ho(L4e(e), L4e(t));
- }
- function L4e(e) {
- var t;
- switch (e.kind) {
- case 272:
- return e.importClause ? e.importClause.isTypeOnly ? 1 : ((t = e.importClause.namedBindings) == null ? void 0 : t.kind) === 274 ? 2 : e.importClause.name ? 3 : 4 : 0;
- case 271:
- return 5;
- case 243:
- return 6;
- }
- }
- function cL(e) {
- return e ? TX : au;
- }
- function FXe(e, t) {
- const n = LXe(t), i = t.organizeImportsCaseFirst ?? !1, s = t.organizeImportsNumericCollation ?? !1, o = t.organizeImportsAccentCollation ?? !0, c = e ? o ? "accent" : "base" : o ? "variant" : "case";
- return new Intl.Collator(n, {
- usage: "sort",
- caseFirst: i || "false",
- sensitivity: c,
- numeric: s
- }).compare;
- }
- function LXe(e) {
- let t = e.organizeImportsLocale;
- t === "auto" && (t = xX()), t === void 0 && (t = "en");
- const n = Intl.Collator.supportedLocalesOf(t);
- return n.length ? n[0] : "en";
- }
- function tue(e, t) {
- return (e.organizeImportsCollation ?? "ordinal") === "unicode" ? FXe(t, e) : cL(t);
- }
- function MXe(e, t) {
- return I4e([e], Xle(t).comparersToTest);
- }
- function W8(e, t) {
- const n = t ?? cL(!!e.organizeImportsIgnoreCase);
- return (i, s) => Yle(i, s, n, e);
- }
- function RXe(e, t, n) {
- const { comparersToTest: i, typeOrdersToTest: s } = Xle(t), o = eue([e], i, s);
- let c = W8(t, i[0]), _;
- if (typeof t.organizeImportsIgnoreCase != "boolean" || !t.organizeImportsTypeOrder) {
- if (o) {
- const { namedImportComparer: u, typeOrder: d, isSorted: g } = o;
- _ = g, c = W8({ organizeImportsTypeOrder: d }, u);
- } else if (n) {
- const u = eue(n.statements.filter(ic), i, s);
- if (u) {
- const { namedImportComparer: d, typeOrder: g, isSorted: h } = u;
- _ = h, c = W8({ organizeImportsTypeOrder: g }, d);
- }
- }
- }
- return { specifierComparer: c, isSorted: _ };
- }
- function jXe(e, t, n) {
- const i = hy(e, t, go, (s, o) => rue(s, o, n));
- return i < 0 ? ~i : i;
- }
- function BXe(e, t, n) {
- const i = hy(e, t, go, n);
- return i < 0 ? ~i : i;
- }
- function rue(e, t, n) {
- return Zle(Kle(e), Kle(t), n) || OXe(e, t);
- }
- function JXe(e, t, n, i) {
- const s = cL(t), o = W8({ organizeImportsTypeOrder: i?.organizeImportsTypeOrder }, s);
- return A4e(e, s, o, n);
- }
- function zXe(e, t, n) {
- return N4e(e, (s, o) => Yle(s, o, cL(t), { organizeImportsTypeOrder: n?.organizeImportsTypeOrder ?? "last" }));
- }
- function WXe(e, t, n) {
- const i = cL(!!n);
- return Zle(e, t, i);
- }
- var vH = {};
- La(vH, {
- collectElements: () => UXe
- });
- function UXe(e, t) {
- const n = [];
- return VXe(e, t, n), qXe(e, n), n.sort((i, s) => i.textSpan.start - s.textSpan.start), n;
- }
- function VXe(e, t, n) {
- let i = 40, s = 0;
- const o = [...e.statements, e.endOfFileToken], c = o.length;
- for (; s < c; ) {
- for (; s < c && !XT(o[s]); )
- _(o[s]), s++;
- if (s === c) break;
- const u = s;
- for (; s < c && XT(o[s]); )
- _(o[s]), s++;
- const d = s - 1;
- d !== u && n.push(lL(
- Ya(o[u], 102, e).getStart(e),
- o[d].getEnd(),
- "imports"
- /* Imports */
- ));
- }
- function _(u) {
- var d;
- if (i === 0) return;
- t.throwIfCancellationRequested(), (ql(u) || yc(u) || Up(u) || am(u) || u.kind === 1) && R4e(u, e, t, n), ys(u) && dn(u.parent) && Cn(u.parent.left) && R4e(u.parent.left, e, t, n), (Cs(u) || Sm(u)) && nue(u.statements.end, e, t, n), (Zn(u) || Xl(u)) && nue(u.members.end, e, t, n);
- const g = GXe(u, e);
- g && n.push(g), i--, Fs(u) ? (i++, _(u.expression), i--, u.arguments.forEach(_), (d = u.typeArguments) == null || d.forEach(_)) : _v(u) && u.elseStatement && _v(u.elseStatement) ? (_(u.expression), _(u.thenStatement), i++, _(u.elseStatement), i--) : u.forEachChild(_), i++;
- }
- }
- function qXe(e, t) {
- const n = [], i = e.getLineStarts();
- for (const s of i) {
- const o = e.getLineEndOfPosition(s), c = e.text.substring(s, o), _ = M4e(c);
- if (!(!_ || O0(e, s)))
- if (_.isStart) {
- const u = kc(e.text.indexOf("//", s), o);
- n.push(uk(
- u,
- "region",
- u,
- /*autoCollapse*/
- !1,
- _.name || "#region"
- ));
- } else {
- const u = n.pop();
- u && (u.textSpan.length = o - u.textSpan.start, u.hintSpan.length = o - u.textSpan.start, t.push(u));
- }
- }
- }
- var HXe = /^#(end)?region(.*)\r?$/;
- function M4e(e) {
- if (e = e.trimStart(), !Ui(e, "//"))
- return null;
- e = e.slice(2).trim();
- const t = HXe.exec(e);
- if (t)
- return { isStart: !t[1], name: t[2].trim() };
- }
- function nue(e, t, n, i) {
- const s = Ig(t.text, e);
- if (!s) return;
- let o = -1, c = -1, _ = 0;
- const u = t.getFullText();
- for (const { kind: g, pos: h, end: S } of s)
- switch (n.throwIfCancellationRequested(), g) {
- case 2:
- const T = u.slice(h, S);
- if (M4e(T)) {
- d(), _ = 0;
- break;
- }
- _ === 0 && (o = h), c = S, _++;
- break;
- case 3:
- d(), i.push(lL(
- h,
- S,
- "comment"
- /* Comment */
- )), _ = 0;
- break;
- default:
- E.assertNever(g);
- }
- d();
- function d() {
- _ > 1 && i.push(lL(
- o,
- c,
- "comment"
- /* Comment */
- ));
- }
- }
- function R4e(e, t, n, i) {
- xx(e) || nue(e.pos, t, n, i);
- }
- function lL(e, t, n) {
- return uk(kc(e, t), n);
- }
- function GXe(e, t) {
- switch (e.kind) {
- case 241:
- if (ys(e.parent))
- return $Xe(e.parent, e, t);
- switch (e.parent.kind) {
- case 246:
- case 249:
- case 250:
- case 248:
- case 245:
- case 247:
- case 254:
- case 299:
- return g(e.parent);
- case 258:
- const T = e.parent;
- if (T.tryBlock === e)
- return g(e.parent);
- if (T.finallyBlock === e) {
- const C = Ya(T, 98, t);
- if (C) return g(C);
- }
- default:
- return uk(
- t_(e, t),
- "code"
- /* Code */
- );
- }
- case 268:
- return g(e.parent);
- case 263:
- case 231:
- case 264:
- case 266:
- case 269:
- case 187:
- case 206:
- return g(e);
- case 189:
- return g(
- e,
- /*autoCollapse*/
- !1,
- /*useFullStart*/
- !wx(e.parent),
- 23
- /* OpenBracketToken */
- );
- case 296:
- case 297:
- return h(e.statements);
- case 210:
- return d(e);
- case 209:
- return d(
- e,
- 23
- /* OpenBracketToken */
- );
- case 284:
- return o(e);
- case 288:
- return c(e);
- case 285:
- case 286:
- return _(e.attributes);
- case 228:
- case 15:
- return u(e);
- case 207:
- return g(
- e,
- /*autoCollapse*/
- !1,
- /*useFullStart*/
- !va(e.parent),
- 23
- /* OpenBracketToken */
- );
- case 219:
- return s(e);
- case 213:
- return i(e);
- case 217:
- return S(e);
- case 275:
- case 279:
- case 300:
- return n(e);
- }
- function n(T) {
- if (!T.elements.length)
- return;
- const C = Ya(T, 19, t), D = Ya(T, 20, t);
- if (!(!C || !D || cp(C.pos, D.pos, t)))
- return bH(
- C,
- D,
- T,
- t,
- /*autoCollapse*/
- !1,
- /*useFullStart*/
- !1
- );
- }
- function i(T) {
- if (!T.arguments.length)
- return;
- const C = Ya(T, 21, t), D = Ya(T, 22, t);
- if (!(!C || !D || cp(C.pos, D.pos, t)))
- return bH(
- C,
- D,
- T,
- t,
- /*autoCollapse*/
- !1,
- /*useFullStart*/
- !0
- );
- }
- function s(T) {
- if (Cs(T.body) || Yu(T.body) || cp(T.body.getFullStart(), T.body.getEnd(), t))
- return;
- const C = kc(T.body.getFullStart(), T.body.getEnd());
- return uk(C, "code", t_(T));
- }
- function o(T) {
- const C = kc(T.openingElement.getStart(t), T.closingElement.getEnd()), D = T.openingElement.tagName.getText(t), P = "<" + D + ">..." + D + ">";
- return uk(
- C,
- "code",
- C,
- /*autoCollapse*/
- !1,
- P
- );
- }
- function c(T) {
- const C = kc(T.openingFragment.getStart(t), T.closingFragment.getEnd());
- return uk(
- C,
- "code",
- C,
- /*autoCollapse*/
- !1,
- "<>...>"
- );
- }
- function _(T) {
- if (T.properties.length !== 0)
- return lL(
- T.getStart(t),
- T.getEnd(),
- "code"
- /* Code */
- );
- }
- function u(T) {
- if (!(T.kind === 15 && T.text.length === 0))
- return lL(
- T.getStart(t),
- T.getEnd(),
- "code"
- /* Code */
- );
- }
- function d(T, C = 19) {
- return g(
- T,
- /*autoCollapse*/
- !1,
- /*useFullStart*/
- !$l(T.parent) && !Fs(T.parent),
- C
- );
- }
- function g(T, C = !1, D = !0, P = 19, I = P === 19 ? 20 : 24) {
- const F = Ya(e, P, t), O = Ya(e, I, t);
- return F && O && bH(F, O, T, t, C, D);
- }
- function h(T) {
- return T.length ? uk(
- L0(T),
- "code"
- /* Code */
- ) : void 0;
- }
- function S(T) {
- if (cp(T.getStart(), T.getEnd(), t)) return;
- const C = kc(T.getStart(), T.getEnd());
- return uk(C, "code", t_(T));
- }
- }
- function $Xe(e, t, n) {
- const i = XXe(e, t, n), s = Ya(t, 20, n);
- return i && s && bH(
- i,
- s,
- e,
- n,
- /*autoCollapse*/
- e.kind !== 219
- /* ArrowFunction */
- );
- }
- function bH(e, t, n, i, s = !1, o = !0) {
- const c = kc(o ? e.getFullStart() : e.getStart(i), t.getEnd());
- return uk(c, "code", t_(n, i), s);
- }
- function uk(e, t, n = e, i = !1, s = "...") {
- return { textSpan: e, kind: t, hintSpan: n, bannerText: s, autoCollapse: i };
- }
- function XXe(e, t, n) {
- if (EK(e.parameters, n)) {
- const i = Ya(e, 21, n);
- if (i)
- return i;
- }
- return Ya(t, 19, n);
- }
- var uL = {};
- La(uL, {
- getRenameInfo: () => QXe,
- nodeIsEligibleForRename: () => B4e
- });
- function QXe(e, t, n, i) {
- const s = XF(h_(t, n));
- if (B4e(s)) {
- const o = YXe(s, e.getTypeChecker(), t, e, i);
- if (o)
- return o;
- }
- return SH(p.You_cannot_rename_this_element);
- }
- function YXe(e, t, n, i, s) {
- const o = t.getSymbolAtLocation(e);
- if (!o) {
- if (Xa(e)) {
- const S = $F(e, t);
- if (S && (S.flags & 128 || S.flags & 1048576 && Mi(S.types, (T) => !!(T.flags & 128))))
- return iue(e.text, e.text, "string", "", e, n);
- } else if (WU(e)) {
- const S = nc(e);
- return iue(S, S, "label", "", e, n);
- }
- return;
- }
- const { declarations: c } = o;
- if (!c || c.length === 0) return;
- if (c.some((S) => ZXe(i, S)))
- return SH(p.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
- if (Oe(e) && e.escapedText === "default" && o.parent && o.parent.flags & 1536)
- return;
- if (Xa(e) && u3(e))
- return s.allowRenameOfImportPath ? eQe(e, n, o) : void 0;
- const _ = KXe(n, o, t, s);
- if (_)
- return SH(_);
- const u = j0.getSymbolKind(t, o, e), d = Ose(e) || Of(e) && e.parent.kind === 167 ? ap(Jp(e)) : void 0, g = d || t.symbolToString(o), h = d || t.getFullyQualifiedName(o);
- return iue(g, h, u, j0.getSymbolModifiers(t, o), e, n);
- }
- function ZXe(e, t) {
- const n = t.getSourceFile();
- return e.isSourceFileDefaultLibrary(n) && qo(
- n.fileName,
- ".d.ts"
- /* Dts */
- );
- }
- function KXe(e, t, n, i) {
- if (!i.providePrefixAndSuffixTextForRename && t.flags & 2097152) {
- const c = t.declarations && On(t.declarations, (_) => Zu(_));
- c && !c.propertyName && (t = n.getAliasedSymbol(t));
- }
- const { declarations: s } = t;
- if (!s)
- return;
- const o = j4e(e.path);
- if (o === void 0)
- return ut(s, (c) => g8(c.getSourceFile().path)) ? p.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder : void 0;
- for (const c of s) {
- const _ = j4e(c.getSourceFile().path);
- if (_) {
- const u = Math.min(o.length, _.length);
- for (let d = 0; d <= u; d++)
- if (au(o[d], _[d]) !== 0)
- return p.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder;
- }
- }
- }
- function j4e(e) {
- const t = Cl(e), n = t.lastIndexOf("node_modules");
- if (n !== -1)
- return t.slice(0, n + 2);
- }
- function eQe(e, t, n) {
- if (!Sl(e.text))
- return SH(p.You_cannot_rename_a_module_via_a_global_import);
- const i = n.declarations && On(n.declarations, Si);
- if (!i) return;
- const s = Zo(e.text, "/index") || Zo(e.text, "/index.js") ? void 0 : EX($u(i.fileName), "/index"), o = s === void 0 ? i.fileName : s, c = s === void 0 ? "module" : "directory", _ = e.text.lastIndexOf("/") + 1, u = Ul(e.getStart(t) + 1 + _, e.text.length - _);
- return {
- canRename: !0,
- fileToRename: o,
- kind: c,
- displayName: o,
- fullDisplayName: e.text,
- kindModifiers: "",
- triggerSpan: u
- };
- }
- function iue(e, t, n, i, s, o) {
- return {
- canRename: !0,
- fileToRename: void 0,
- kind: n,
- displayName: e,
- fullDisplayName: t,
- kindModifiers: i,
- triggerSpan: tQe(s, o)
- };
- }
- function SH(e) {
- return { canRename: !1, localizedErrorMessage: ms(e) };
- }
- function tQe(e, t) {
- let n = e.getStart(t), i = e.getWidth(t);
- return Xa(e) && (n += 1, i -= 2), Ul(n, i);
- }
- function B4e(e) {
- switch (e.kind) {
- case 80:
- case 81:
- case 11:
- case 15:
- case 110:
- return !0;
- case 9:
- return VF(e);
- default:
- return !1;
- }
- }
- var U8 = {};
- La(U8, {
- getArgumentInfoForCompletions: () => aQe,
- getSignatureHelpItems: () => rQe
- });
- function rQe(e, t, n, i, s) {
- const o = e.getTypeChecker(), c = r8(t, n);
- if (!c)
- return;
- const _ = !!i && i.kind === "characterTyped";
- if (_ && (Qx(t, n, c) || O0(t, n)))
- return;
- const u = !!i && i.kind === "invoked", d = vQe(c, n, t, o, u);
- if (!d) return;
- s.throwIfCancellationRequested();
- const g = nQe(d, o, t, c, _);
- return s.throwIfCancellationRequested(), g ? o.runWithCancellationToken(s, (h) => g.kind === 0 ? G4e(g.candidates, g.resolvedSignature, d, t, h) : SQe(g.symbol, d, t, h)) : Gu(t) ? sQe(d, e, s) : void 0;
- }
- function nQe({ invocation: e, argumentCount: t }, n, i, s, o) {
- switch (e.kind) {
- case 0: {
- if (o && !iQe(s, e.node, i))
- return;
- const c = [], _ = n.getResolvedSignatureForSignatureHelp(e.node, c, t);
- return c.length === 0 ? void 0 : { kind: 0, candidates: c, resolvedSignature: _ };
- }
- case 1: {
- const { called: c } = e;
- if (o && !J4e(s, i, Oe(c) ? c.parent : c))
- return;
- const _ = KU(c, t, n);
- if (_.length !== 0) return { kind: 0, candidates: _, resolvedSignature: xa(_) };
- const u = n.getSymbolAtLocation(c);
- return u && { kind: 1, symbol: u };
- }
- case 2:
- return { kind: 0, candidates: [e.signature], resolvedSignature: e.signature };
- default:
- return E.assertNever(e);
- }
- }
- function iQe(e, t, n) {
- if (!am(t)) return !1;
- const i = t.getChildren(n);
- switch (e.kind) {
- case 21:
- return ss(i, e);
- case 28: {
- const s = GF(e);
- return !!s && ss(i, s);
- }
- case 30:
- return J4e(e, n, t.expression);
- default:
- return !1;
- }
- }
- function sQe(e, t, n) {
- if (e.invocation.kind === 2) return;
- const i = q4e(e.invocation), s = Cn(i) ? i.name.text : void 0, o = t.getTypeChecker();
- return s === void 0 ? void 0 : Tc(t.getSourceFiles(), (c) => Tc(c.getNamedDeclarations().get(s), (_) => {
- const u = _.symbol && o.getTypeOfSymbolAtLocation(_.symbol, _), d = u && u.getCallSignatures();
- if (d && d.length)
- return o.runWithCancellationToken(
- n,
- (g) => G4e(
- d,
- d[0],
- e,
- c,
- g,
- /*useFullPrefix*/
- !0
- )
- );
- }));
- }
- function J4e(e, t, n) {
- const i = e.getFullStart();
- let s = e.parent;
- for (; s; ) {
- const o = sl(
- i,
- t,
- s,
- /*excludeJsdoc*/
- !0
- );
- if (o)
- return nf(n, o);
- s = s.parent;
- }
- return E.fail("Could not find preceding token");
- }
- function aQe(e, t, n, i) {
- const s = W4e(e, t, n, i);
- return !s || s.isTypeParameterList || s.invocation.kind !== 0 ? void 0 : { invocation: s.invocation.node, argumentCount: s.argumentCount, argumentIndex: s.argumentIndex };
- }
- function z4e(e, t, n, i) {
- const s = oQe(e, n, i);
- if (!s) return;
- const { list: o, argumentIndex: c } = s, _ = mQe(i, o), u = hQe(o, n);
- return { list: o, argumentIndex: c, argumentCount: _, argumentsSpan: u };
- }
- function oQe(e, t, n) {
- if (e.kind === 30 || e.kind === 21)
- return { list: bQe(e.parent, e, t), argumentIndex: 0 };
- {
- const i = GF(e);
- return i && { list: i, argumentIndex: dQe(n, i, e) };
- }
- }
- function W4e(e, t, n, i) {
- const { parent: s } = e;
- if (am(s)) {
- const o = s, c = z4e(e, t, n, i);
- if (!c) return;
- const { list: _, argumentIndex: u, argumentCount: d, argumentsSpan: g } = c;
- return { isTypeParameterList: !!s.typeArguments && s.typeArguments.pos === _.pos, invocation: { kind: 0, node: o }, argumentsSpan: g, argumentIndex: u, argumentCount: d };
- } else {
- if (fS(e) && lv(s))
- return i8(e, t, n) ? aue(
- s,
- /*argumentIndex*/
- 0,
- n
- ) : void 0;
- if (kx(e) && s.parent.kind === 215) {
- const o = s, c = o.parent;
- E.assert(
- o.kind === 228
- /* TemplateExpression */
- );
- const _ = i8(e, t, n) ? 0 : 1;
- return aue(c, _, n);
- } else if ($C(s) && lv(s.parent.parent)) {
- const o = s, c = s.parent.parent;
- if (U5(e) && !i8(e, t, n))
- return;
- const _ = o.parent.templateSpans.indexOf(o), u = gQe(_, e, t, n);
- return aue(c, u, n);
- } else if (ou(s)) {
- const o = s.attributes.pos, c = aa(
- n.text,
- s.attributes.end,
- /*stopAfterLineBreak*/
- !1
- );
- return {
- isTypeParameterList: !1,
- invocation: { kind: 0, node: s },
- argumentsSpan: Ul(o, c - o),
- argumentIndex: 0,
- argumentCount: 1
- };
- } else {
- const o = eV(e, n);
- if (o) {
- const { called: c, nTypeArguments: _ } = o, u = { kind: 1, called: c }, d = kc(c.getStart(n), e.end);
- return { isTypeParameterList: !0, invocation: u, argumentsSpan: d, argumentIndex: _, argumentCount: _ + 1 };
- }
- return;
- }
- }
- }
- function cQe(e, t, n, i) {
- return lQe(e, t, n, i) || W4e(e, t, n, i);
- }
- function U4e(e) {
- return dn(e.parent) ? U4e(e.parent) : e;
- }
- function sue(e) {
- return dn(e.left) ? sue(e.left) + 1 : 2;
- }
- function lQe(e, t, n, i) {
- const s = uQe(e);
- if (s === void 0) return;
- const o = _Qe(s, n, t, i);
- if (o === void 0) return;
- const { contextualType: c, argumentIndex: _, argumentCount: u, argumentsSpan: d } = o, g = c.getNonNullableType(), h = g.symbol;
- if (h === void 0) return;
- const S = Ro(g.getCallSignatures());
- return S === void 0 ? void 0 : { isTypeParameterList: !1, invocation: { kind: 2, signature: S, node: e, symbol: fQe(h) }, argumentsSpan: d, argumentIndex: _, argumentCount: u };
- }
- function uQe(e) {
- switch (e.kind) {
- case 21:
- case 28:
- return e;
- default:
- return or(e.parent, (t) => Ii(t) ? !0 : va(t) || Mf(t) || w0(t) ? !1 : "quit");
- }
- }
- function _Qe(e, t, n, i) {
- const { parent: s } = e;
- switch (s.kind) {
- case 217:
- case 174:
- case 218:
- case 219:
- const o = z4e(e, n, t, i);
- if (!o) return;
- const { argumentIndex: c, argumentCount: _, argumentsSpan: u } = o, d = hc(s) ? i.getContextualTypeForObjectLiteralElement(s) : i.getContextualType(s);
- return d && { contextualType: d, argumentIndex: c, argumentCount: _, argumentsSpan: u };
- case 226: {
- const g = U4e(s), h = i.getContextualType(g), S = e.kind === 21 ? 0 : sue(s) - 1, T = sue(g);
- return h && { contextualType: h, argumentIndex: S, argumentCount: T, argumentsSpan: t_(s) };
- }
- default:
- return;
- }
- }
- function fQe(e) {
- return e.name === "__type" && Tc(e.declarations, (t) => {
- var n;
- return lg(t) ? (n = Wn(t.parent, kd)) == null ? void 0 : n.symbol : void 0;
- }) || e;
- }
- function pQe(e, t) {
- const n = t.getTypeAtLocation(e.expression);
- if (t.isTupleType(n)) {
- const { elementFlags: i, fixedLength: s } = n.target;
- if (s === 0)
- return 0;
- const o = ac(i, (c) => !(c & 1));
- return o < 0 ? s : o;
- }
- return 0;
- }
- function dQe(e, t, n) {
- return V4e(e, t, n);
- }
- function mQe(e, t) {
- return V4e(
- e,
- t,
- /*node*/
- void 0
- );
- }
- function V4e(e, t, n) {
- const i = t.getChildren();
- let s = 0, o = !1;
- for (const c of i) {
- if (n && c === n)
- return !o && c.kind === 28 && s++, s;
- if (fp(c)) {
- s += pQe(c, e), o = !0;
- continue;
- }
- if (c.kind !== 28) {
- s++, o = !0;
- continue;
- }
- if (o) {
- o = !1;
- continue;
- }
- s++;
- }
- return n ? s : i.length && _a(i).kind === 28 ? s + 1 : s;
- }
- function gQe(e, t, n, i) {
- return E.assert(n >= t.getStart(), "Assumed 'position' could not occur before node."), IY(t) ? i8(t, n, i) ? 0 : e + 2 : e + 1;
- }
- function aue(e, t, n) {
- const i = fS(e.template) ? 1 : e.template.templateSpans.length + 1;
- return t !== 0 && E.assertLessThan(t, i), {
- isTypeParameterList: !1,
- invocation: { kind: 0, node: e },
- argumentsSpan: yQe(e, n),
- argumentIndex: t,
- argumentCount: i
- };
- }
- function hQe(e, t) {
- const n = e.getFullStart(), i = aa(
- t.text,
- e.getEnd(),
- /*stopAfterLineBreak*/
- !1
- );
- return Ul(n, i - n);
- }
- function yQe(e, t) {
- const n = e.template, i = n.getStart();
- let s = n.getEnd();
- return n.kind === 228 && _a(n.templateSpans).literal.getFullWidth() === 0 && (s = aa(
- t.text,
- s,
- /*stopAfterLineBreak*/
- !1
- )), Ul(i, s - i);
- }
- function vQe(e, t, n, i, s) {
- for (let o = e; !Si(o) && (s || !Cs(o)); o = o.parent) {
- E.assert(nf(o.parent, o), "Not a subspan", () => `Child: ${E.formatSyntaxKind(o.kind)}, parent: ${E.formatSyntaxKind(o.parent.kind)}`);
- const c = cQe(o, t, n, i);
- if (c)
- return c;
- }
- }
- function bQe(e, t, n) {
- const i = e.getChildren(n), s = i.indexOf(t);
- return E.assert(s >= 0 && i.length > s + 1), i[s + 1];
- }
- function q4e(e) {
- return e.kind === 0 ? x7(e.node) : e.called;
- }
- function H4e(e) {
- return e.kind === 0 ? e.node : e.kind === 1 ? e.called : e.node;
- }
- var _L = 70246400;
- function G4e(e, t, { isTypeParameterList: n, argumentCount: i, argumentsSpan: s, invocation: o, argumentIndex: c }, _, u, d) {
- var g;
- const h = H4e(o), S = o.kind === 2 ? o.symbol : u.getSymbolAtLocation(q4e(o)) || d && ((g = t.declaration) == null ? void 0 : g.symbol), T = S ? YD(
- u,
- S,
- d ? _ : void 0,
- /*meaning*/
- void 0
- ) : Ue, C = lr(e, (O) => xQe(O, T, n, u, h, _));
- let D = 0, P = 0;
- for (let O = 0; O < C.length; O++) {
- const B = C[O];
- if (e[O] === t && (D = P, B.length > 1)) {
- let z = 0;
- for (const X of B) {
- if (X.isVariadic || X.parameters.length >= i) {
- D = P + z;
- break;
- }
- z++;
- }
- }
- P += B.length;
- }
- E.assert(D !== -1);
- const I = { items: AE(C, go), applicableSpan: s, selectedItemIndex: D, argumentIndex: c, argumentCount: i }, F = I.items[D];
- if (F.isVariadic) {
- const O = ac(F.parameters, (B) => !!B.isRest);
- -1 < O && O < F.parameters.length - 1 ? I.argumentIndex = F.parameters.length : I.argumentIndex = Math.min(I.argumentIndex, F.parameters.length - 1);
- }
- return I;
- }
- function SQe(e, { argumentCount: t, argumentsSpan: n, invocation: i, argumentIndex: s }, o, c) {
- const _ = c.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);
- return _ ? { items: [TQe(e, _, c, H4e(i), o)], applicableSpan: n, selectedItemIndex: 0, argumentIndex: s, argumentCount: t } : void 0;
- }
- function TQe(e, t, n, i, s) {
- const o = YD(n, e), c = $b(), _ = t.map((h) => X4e(h, n, i, s, c)), u = e.getDocumentationComment(n), d = e.getJsDocTags(n);
- return { isVariadic: !1, prefixDisplayParts: [...o, Tu(
- 30
- /* LessThanToken */
- )], suffixDisplayParts: [Tu(
- 32
- /* GreaterThanToken */
- )], separatorDisplayParts: $4e, parameters: _, documentation: u, tags: d };
- }
- var $4e = [Tu(
- 28
- /* CommaToken */
- ), uc()];
- function xQe(e, t, n, i, s, o) {
- const c = (n ? CQe : EQe)(e, i, s, o);
- return lr(c, ({ isVariadic: _, parameters: u, prefix: d, suffix: g }) => {
- const h = [...t, ...d], S = [...g, ...kQe(e, s, i)], T = e.getDocumentationComment(i), C = e.getJsDocTags();
- return { isVariadic: _, prefixDisplayParts: h, suffixDisplayParts: S, separatorDisplayParts: $4e, parameters: u, documentation: T, tags: C };
- });
- }
- function kQe(e, t, n) {
- return xv((i) => {
- i.writePunctuation(":"), i.writeSpace(" ");
- const s = n.getTypePredicateOfSignature(e);
- s ? n.writeTypePredicate(
- s,
- t,
- /*flags*/
- void 0,
- i
- ) : n.writeType(
- n.getReturnTypeOfSignature(e),
- t,
- /*flags*/
- void 0,
- i
- );
- });
- }
- function CQe(e, t, n, i) {
- const s = (e.target || e).typeParameters, o = $b(), c = (s || Ue).map((u) => X4e(u, t, n, i, o)), _ = e.thisParameter ? [t.symbolToParameterDeclaration(e.thisParameter, n, _L)] : [];
- return t.getExpandedParameters(e).map((u) => {
- const d = A.createNodeArray([..._, ...lr(u, (h) => t.symbolToParameterDeclaration(h, n, _L))]), g = xv((h) => {
- o.writeList(2576, d, i, h);
- });
- return { isVariadic: !1, parameters: c, prefix: [Tu(
- 30
- /* LessThanToken */
- )], suffix: [Tu(
- 32
- /* GreaterThanToken */
- ), ...g] };
- });
- }
- function EQe(e, t, n, i) {
- const s = $b(), o = xv((u) => {
- if (e.typeParameters && e.typeParameters.length) {
- const d = A.createNodeArray(e.typeParameters.map((g) => t.typeParameterToDeclaration(g, n, _L)));
- s.writeList(53776, d, i, u);
- }
- }), c = t.getExpandedParameters(e), _ = t.hasEffectiveRestParameter(e) ? c.length === 1 ? (u) => !0 : (u) => {
- var d;
- return !!(u.length && ((d = Wn(u[u.length - 1], Lg)) == null ? void 0 : d.links.checkFlags) & 32768);
- } : (u) => !1;
- return c.map((u) => ({
- isVariadic: _(u),
- parameters: u.map((d) => DQe(d, t, n, i, s)),
- prefix: [...o, Tu(
- 21
- /* OpenParenToken */
- )],
- suffix: [Tu(
- 22
- /* CloseParenToken */
- )]
- }));
- }
- function DQe(e, t, n, i, s) {
- const o = xv((u) => {
- const d = t.symbolToParameterDeclaration(e, n, _L);
- s.writeNode(4, d, i, u);
- }), c = t.isOptionalParameter(e.valueDeclaration), _ = Lg(e) && !!(e.links.checkFlags & 32768);
- return { name: e.name, documentation: e.getDocumentationComment(t), displayParts: o, isOptional: c, isRest: _ };
- }
- function X4e(e, t, n, i, s) {
- const o = xv((c) => {
- const _ = t.typeParameterToDeclaration(e, n, _L);
- s.writeNode(4, _, i, c);
- });
- return { name: e.symbol.name, documentation: e.symbol.getDocumentationComment(t), displayParts: o, isOptional: !1, isRest: !1 };
- }
- var TH = {};
- La(TH, {
- getSmartSelectionRange: () => PQe
- });
- function PQe(e, t) {
- var n, i;
- let s = {
- textSpan: kc(t.getFullStart(), t.getEnd())
- }, o = t;
- e:
- for (; ; ) {
- const u = NQe(o);
- if (!u.length) break;
- for (let d = 0; d < u.length; d++) {
- const g = u[d - 1], h = u[d], S = u[d + 1];
- if (Oy(
- h,
- t,
- /*includeJsDoc*/
- !0
- ) > e)
- break e;
- const T = Qm(ky(t.text, h.end));
- if (T && T.kind === 2 && _(T.pos, T.end), wQe(t, e, h)) {
- if (Dj(h) && no(o) && !cp(h.getStart(t), h.getEnd(), t) && c(h.getStart(t), h.getEnd()), Cs(h) || $C(h) || kx(h) || U5(h) || g && kx(g) || Fl(h) && yc(o) || KC(h) && Fl(o) || ii(h) && KC(o) && u.length === 1 || pv(h) || Lh(h) || bS(h)) {
- o = h;
- break;
- }
- if ($C(o) && S && UI(S)) {
- const I = h.getFullStart() - 2, F = S.getStart() + 1;
- c(I, F);
- }
- const C = KC(h) && IQe(g) && OQe(S) && !cp(g.getStart(), S.getStart(), t);
- let D = C ? g.getEnd() : h.getStart();
- const P = C ? S.getStart() : FQe(t, h);
- if (gf(h) && ((n = h.jsDoc) != null && n.length) && c(xa(h.jsDoc).getStart(), P), KC(h)) {
- const I = h.getChildren()[0];
- I && gf(I) && ((i = I.jsDoc) != null && i.length) && I.getStart() !== h.pos && (D = Math.min(D, xa(I.jsDoc).getStart()));
- }
- c(D, P), (oa(h) || VT(h)) && c(D + 1, P - 1), o = h;
- break;
- }
- if (d === u.length - 1)
- break e;
- }
- }
- return s;
- function c(u, d) {
- if (u !== d) {
- const g = kc(u, d);
- (!s || // Skip ranges that are identical to the parent
- !C6(g, s.textSpan) && // Skip ranges that don't contain the original position
- lY(g, e)) && (s = { textSpan: g, ...s && { parent: s } });
- }
- }
- function _(u, d) {
- c(u, d);
- let g = u;
- for (; t.text.charCodeAt(g) === 47; )
- g++;
- c(g, d);
- }
- }
- function wQe(e, t, n) {
- return E.assert(n.pos <= t), t < n.end ? !0 : n.getEnd() === t ? h_(e, t).pos < n.end : !1;
- }
- var AQe = Nf(ic, gl);
- function NQe(e) {
- var t;
- if (Si(e))
- return V8(e.getChildAt(0).getChildren(), AQe);
- if (mS(e)) {
- const [n, ...i] = e.getChildren(), s = E.checkDefined(i.pop());
- E.assertEqual(
- n.kind,
- 19
- /* OpenBraceToken */
- ), E.assertEqual(
- s.kind,
- 20
- /* CloseBraceToken */
- );
- const o = V8(
- i,
- (_) => _ === e.readonlyToken || _.kind === 148 || _ === e.questionToken || _.kind === 58
- /* QuestionToken */
- ), c = V8(
- o,
- ({ kind: _ }) => _ === 23 || _ === 168 || _ === 24
- /* CloseBracketToken */
- );
- return [
- n,
- // Pivot on `:`
- q8(xH(
- c,
- ({ kind: _ }) => _ === 59
- /* ColonToken */
- )),
- s
- ];
- }
- if (m_(e)) {
- const n = V8(e.getChildren(), (c) => c === e.name || ss(e.modifiers, c)), i = ((t = n[0]) == null ? void 0 : t.kind) === 320 ? n[0] : void 0, s = i ? n.slice(1) : n, o = xH(
- s,
- ({ kind: c }) => c === 59
- /* ColonToken */
- );
- return i ? [i, q8(o)] : o;
- }
- if (Ii(e)) {
- const n = V8(e.getChildren(), (s) => s === e.dotDotDotToken || s === e.name), i = V8(n, (s) => s === n[0] || s === e.questionToken);
- return xH(
- i,
- ({ kind: s }) => s === 64
- /* EqualsToken */
- );
- }
- return va(e) ? xH(
- e.getChildren(),
- ({ kind: n }) => n === 64
- /* EqualsToken */
- ) : e.getChildren();
- }
- function V8(e, t) {
- const n = [];
- let i;
- for (const s of e)
- t(s) ? (i = i || [], i.push(s)) : (i && (n.push(q8(i)), i = void 0), n.push(s));
- return i && n.push(q8(i)), n;
- }
- function xH(e, t, n = !0) {
- if (e.length < 2)
- return e;
- const i = ac(e, t);
- if (i === -1)
- return e;
- const s = e.slice(0, i), o = e[i], c = _a(e), _ = n && c.kind === 27, u = e.slice(i + 1, _ ? e.length - 1 : void 0), d = tw([
- s.length ? q8(s) : void 0,
- o,
- u.length ? q8(u) : void 0
- ]);
- return _ ? d.concat(c) : d;
- }
- function q8(e) {
- return E.assertGreaterThanOrEqual(e.length, 1), wd(gv.createSyntaxList(e), e[0].pos, _a(e).end);
- }
- function IQe(e) {
- const t = e && e.kind;
- return t === 19 || t === 23 || t === 21 || t === 286;
- }
- function OQe(e) {
- const t = e && e.kind;
- return t === 20 || t === 24 || t === 22 || t === 287;
- }
- function FQe(e, t) {
- switch (t.kind) {
- case 341:
- case 338:
- case 348:
- case 346:
- case 343:
- return e.getLineEndOfPosition(t.getStart());
- default:
- return t.getEnd();
- }
- }
- var j0 = {};
- La(j0, {
- getSymbolDisplayPartsDocumentationAndSymbolKind: () => MQe,
- getSymbolKind: () => Y4e,
- getSymbolModifiers: () => LQe
- });
- var Q4e = 70246400;
- function Y4e(e, t, n) {
- const i = Z4e(e, t, n);
- if (i !== "")
- return i;
- const s = FC(t);
- return s & 32 ? Jo(
- t,
- 231
- /* ClassExpression */
- ) ? "local class" : "class" : s & 384 ? "enum" : s & 524288 ? "type" : s & 64 ? "interface" : s & 262144 ? "type parameter" : s & 8 ? "enum member" : s & 2097152 ? "alias" : s & 1536 ? "module" : i;
- }
- function Z4e(e, t, n) {
- const i = e.getRootSymbols(t);
- if (i.length === 1 && xa(i).flags & 8192 && e.getTypeOfSymbolAtLocation(t, n).getNonNullableType().getCallSignatures().length !== 0)
- return "method";
- if (e.isUndefinedSymbol(t))
- return "var";
- if (e.isArgumentsSymbol(t))
- return "local var";
- if (n.kind === 110 && _t(n) || Pb(n))
- return "parameter";
- const s = FC(t);
- if (s & 3)
- return bV(t) ? "parameter" : t.valueDeclaration && hC(t.valueDeclaration) ? "const" : t.valueDeclaration && Hw(t.valueDeclaration) ? "using" : t.valueDeclaration && qw(t.valueDeclaration) ? "await using" : ir(t.declarations, p7) ? "let" : tDe(t) ? "local var" : "var";
- if (s & 16) return tDe(t) ? "local function" : "function";
- if (s & 32768) return "getter";
- if (s & 65536) return "setter";
- if (s & 8192) return "method";
- if (s & 16384) return "constructor";
- if (s & 131072) return "index";
- if (s & 4) {
- if (s & 33554432 && t.links.checkFlags & 6) {
- const o = ir(e.getRootSymbols(t), (c) => {
- if (c.getFlags() & 98311)
- return "property";
- });
- return o || (e.getTypeOfSymbolAtLocation(t, n).getCallSignatures().length ? "method" : "property");
- }
- return "property";
- }
- return "";
- }
- function K4e(e) {
- if (e.declarations && e.declarations.length) {
- const [t, ...n] = e.declarations, i = Nr(n) && y9(t) && ut(n, (o) => !y9(o)) ? 65536 : 0, s = HD(t, i);
- if (s)
- return s.split(",");
- }
- return [];
- }
- function LQe(e, t) {
- if (!t)
- return "";
- const n = new Set(K4e(t));
- if (t.flags & 2097152) {
- const i = e.getAliasedSymbol(t);
- i !== t && ir(K4e(i), (s) => {
- n.add(s);
- });
- }
- return t.flags & 16777216 && n.add(
- "optional"
- /* optionalModifier */
- ), n.size > 0 ? as(n.values()).join(",") : "";
- }
- function eDe(e, t, n, i, s, o, c, _) {
- var u;
- const d = [];
- let g = [], h = [];
- const S = FC(t);
- let T = c & 1 ? Z4e(e, t, s) : "", C = !1;
- const D = s.kind === 110 && k7(s) || Pb(s);
- let P, I, F = !1;
- if (s.kind === 110 && !D)
- return { displayParts: [sf(
- 110
- /* ThisKeyword */
- )], documentation: [], symbolKind: "primitive type", tags: void 0 };
- if (T !== "" || S & 32 || S & 2097152) {
- if (T === "getter" || T === "setter") {
- const ne = On(t.declarations, (ie) => ie.name === s);
- if (ne)
- switch (ne.kind) {
- case 177:
- T = "getter";
- break;
- case 178:
- T = "setter";
- break;
- case 172:
- T = "accessor";
- break;
- default:
- E.assertNever(ne);
- }
- else
- T = "property";
- }
- let ue;
- if (o ?? (o = D ? e.getTypeAtLocation(s) : e.getTypeOfSymbolAtLocation(t, s)), s.parent && s.parent.kind === 211) {
- const ne = s.parent.name;
- (ne === s || ne && ne.getFullWidth() === 0) && (s = s.parent);
- }
- let re;
- if (am(s) ? re = s : (jU(s) || UD(s) || s.parent && (ou(s.parent) || lv(s.parent)) && ys(t.valueDeclaration)) && (re = s.parent), re) {
- ue = e.getResolvedSignature(re);
- const ne = re.kind === 214 || Fs(re) && re.expression.kind === 108, ie = ne ? o.getConstructSignatures() : o.getCallSignatures();
- if (ue && !ss(ie, ue.target) && !ss(ie, ue) && (ue = ie.length ? ie[0] : void 0), ue) {
- switch (ne && S & 32 ? (T = "constructor", V(o.symbol, T)) : S & 2097152 ? (T = "alias", ae(T), d.push(uc()), ne && (ue.flags & 4 && (d.push(sf(
- 128
- /* AbstractKeyword */
- )), d.push(uc())), d.push(sf(
- 105
- /* NewKeyword */
- )), d.push(uc())), q(t)) : V(t, T), T) {
- case "JSX attribute":
- case "property":
- case "var":
- case "const":
- case "let":
- case "parameter":
- case "local var":
- d.push(Tu(
- 59
- /* ColonToken */
- )), d.push(uc()), !(wn(o) & 16) && o.symbol && (Fn(d, YD(
- e,
- o.symbol,
- i,
- /*meaning*/
- void 0,
- 5
- /* WriteTypeParametersOrArguments */
- )), d.push(E6())), ne && (ue.flags & 4 && (d.push(sf(
- 128
- /* AbstractKeyword */
- )), d.push(uc())), d.push(sf(
- 105
- /* NewKeyword */
- )), d.push(uc())), ee(
- ue,
- ie,
- 262144
- /* WriteArrowStyleSignature */
- );
- break;
- default:
- ee(ue, ie);
- }
- C = !0, F = ie.length > 1;
- }
- } else if (HU(s) && !(S & 98304) || // name of function declaration
- s.kind === 137 && s.parent.kind === 176) {
- const ne = s.parent;
- if (t.declarations && On(t.declarations, (Se) => Se === (s.kind === 137 ? ne.parent : ne))) {
- const Se = ne.kind === 176 ? o.getNonNullableType().getConstructSignatures() : o.getNonNullableType().getCallSignatures();
- e.isImplementationOfOverload(ne) ? ue = Se[0] : ue = e.getSignatureFromDeclaration(ne), ne.kind === 176 ? (T = "constructor", V(o.symbol, T)) : V(
- ne.kind === 179 && !(o.symbol.flags & 2048 || o.symbol.flags & 4096) ? o.symbol : t,
- T
- ), ue && ee(ue, Se), C = !0, F = Se.length > 1;
- }
- }
- }
- if (S & 32 && !C && !D && (z(), Jo(
- t,
- 231
- /* ClassExpression */
- ) ? ae(
- "local class"
- /* localClassElement */
- ) : d.push(sf(
- 86
- /* ClassKeyword */
- )), d.push(uc()), q(t), G(t, n)), S & 64 && c & 2 && (B(), d.push(sf(
- 120
- /* InterfaceKeyword */
- )), d.push(uc()), q(t), G(t, n)), S & 524288 && c & 2 && (B(), d.push(sf(
- 156
- /* TypeKeyword */
- )), d.push(uc()), q(t), G(t, n), d.push(uc()), d.push(QD(
- 64
- /* EqualsToken */
- )), d.push(uc()), Fn(d, u8(
- e,
- s.parent && xd(s.parent) ? e.getTypeAtLocation(s.parent) : e.getDeclaredTypeOfSymbol(t),
- i,
- 8388608
- /* InTypeAlias */
- ))), S & 384 && (B(), ut(t.declarations, (ue) => Bb(ue) && Y1(ue)) && (d.push(sf(
- 87
- /* ConstKeyword */
- )), d.push(uc())), d.push(sf(
- 94
- /* EnumKeyword */
- )), d.push(uc()), q(t)), S & 1536 && !D) {
- B();
- const ue = Jo(
- t,
- 267
- /* ModuleDeclaration */
- ), re = ue && ue.name && ue.name.kind === 80;
- d.push(sf(
- re ? 145 : 144
- /* ModuleKeyword */
- )), d.push(uc()), q(t);
- }
- if (S & 262144 && c & 2)
- if (B(), d.push(Tu(
- 21
- /* OpenParenToken */
- )), d.push(Jf("type parameter")), d.push(Tu(
- 22
- /* CloseParenToken */
- )), d.push(uc()), q(t), t.parent)
- X(), q(t.parent, i), G(t.parent, i);
- else {
- const ue = Jo(
- t,
- 168
- /* TypeParameter */
- );
- if (ue === void 0) return E.fail();
- const re = ue.parent;
- if (re)
- if (ys(re)) {
- X();
- const ne = e.getSignatureFromDeclaration(re);
- re.kind === 180 ? (d.push(sf(
- 105
- /* NewKeyword */
- )), d.push(uc())) : re.kind !== 179 && re.name && q(re.symbol), Fn(d, TV(
- e,
- ne,
- n,
- 32
- /* WriteTypeArgumentsOfSignature */
- ));
- } else Vp(re) && (X(), d.push(sf(
- 156
- /* TypeKeyword */
- )), d.push(uc()), q(re.symbol), G(re.symbol, n));
- }
- if (S & 8) {
- T = "enum member", V(t, "enum member");
- const ue = (u = t.declarations) == null ? void 0 : u[0];
- if (ue?.kind === 306) {
- const re = e.getConstantValue(ue);
- re !== void 0 && (d.push(uc()), d.push(QD(
- 64
- /* EqualsToken */
- )), d.push(uc()), d.push(w_(
- cZ(re),
- typeof re == "number" ? 7 : 8
- /* stringLiteral */
- )));
- }
- }
- if (t.flags & 2097152) {
- if (B(), !C || g.length === 0 && h.length === 0) {
- const ue = e.getAliasedSymbol(t);
- if (ue !== t && ue.declarations && ue.declarations.length > 0) {
- const re = ue.declarations[0], ne = os(re);
- if (ne && !C) {
- const ie = l7(re) && Gn(
- re,
- 128
- /* Ambient */
- ), Se = t.name !== "default" && !ie, J = eDe(
- e,
- ue,
- Tr(re),
- i,
- ne,
- o,
- c,
- Se ? t : ue
- );
- d.push(...J.displayParts), d.push(E6()), P = J.documentation, I = J.tags;
- } else
- P = ue.getContextualDocumentationComment(re, e), I = ue.getJsDocTags(e);
- }
- }
- if (t.declarations)
- switch (t.declarations[0].kind) {
- case 270:
- d.push(sf(
- 95
- /* ExportKeyword */
- )), d.push(uc()), d.push(sf(
- 145
- /* NamespaceKeyword */
- ));
- break;
- case 277:
- d.push(sf(
- 95
- /* ExportKeyword */
- )), d.push(uc()), d.push(sf(
- t.declarations[0].isExportEquals ? 64 : 90
- /* DefaultKeyword */
- ));
- break;
- case 281:
- d.push(sf(
- 95
- /* ExportKeyword */
- ));
- break;
- default:
- d.push(sf(
- 102
- /* ImportKeyword */
- ));
- }
- d.push(uc()), q(t), ir(t.declarations, (ue) => {
- if (ue.kind === 271) {
- const re = ue;
- if (Z1(re))
- d.push(uc()), d.push(QD(
- 64
- /* EqualsToken */
- )), d.push(uc()), d.push(sf(
- 149
- /* RequireKeyword */
- )), d.push(Tu(
- 21
- /* OpenParenToken */
- )), d.push(w_(
- nc(g4(re)),
- 8
- /* stringLiteral */
- )), d.push(Tu(
- 22
- /* CloseParenToken */
- ));
- else {
- const ne = e.getSymbolAtLocation(re.moduleReference);
- ne && (d.push(uc()), d.push(QD(
- 64
- /* EqualsToken */
- )), d.push(uc()), q(ne, i));
- }
- return !0;
- }
- });
- }
- if (!C)
- if (T !== "") {
- if (o) {
- if (D ? (B(), d.push(sf(
- 110
- /* ThisKeyword */
- ))) : V(t, T), T === "property" || T === "accessor" || T === "getter" || T === "setter" || T === "JSX attribute" || S & 3 || T === "local var" || T === "index" || T === "using" || T === "await using" || D) {
- if (d.push(Tu(
- 59
- /* ColonToken */
- )), d.push(uc()), o.symbol && o.symbol.flags & 262144 && T !== "index") {
- const ue = xv((re) => {
- const ne = e.typeParameterToDeclaration(o, i, Q4e);
- O().writeNode(4, ne, Tr(fs(i)), re);
- });
- Fn(d, ue);
- } else
- Fn(d, u8(e, o, i));
- if (Lg(t) && t.links.target && Lg(t.links.target) && t.links.target.links.tupleLabelDeclaration) {
- const ue = t.links.target.links.tupleLabelDeclaration;
- E.assertNode(ue.name, Oe), d.push(uc()), d.push(Tu(
- 21
- /* OpenParenToken */
- )), d.push(Jf(Nn(ue.name))), d.push(Tu(
- 22
- /* CloseParenToken */
- ));
- }
- } else if (S & 16 || S & 8192 || S & 16384 || S & 131072 || S & 98304 || T === "method") {
- const ue = o.getNonNullableType().getCallSignatures();
- ue.length && (ee(ue[0], ue), F = ue.length > 1);
- }
- }
- } else
- T = Y4e(e, t, s);
- if (g.length === 0 && !F && (g = t.getContextualDocumentationComment(i, e)), g.length === 0 && S & 4 && t.parent && t.declarations && ir(
- t.parent.declarations,
- (ue) => ue.kind === 307
- /* SourceFile */
- ))
- for (const ue of t.declarations) {
- if (!ue.parent || ue.parent.kind !== 226)
- continue;
- const re = e.getSymbolAtLocation(ue.parent.right);
- if (re && (g = re.getDocumentationComment(e), h = re.getJsDocTags(e), g.length > 0))
- break;
- }
- if (g.length === 0 && Oe(s) && t.valueDeclaration && va(t.valueDeclaration)) {
- const ue = t.valueDeclaration, re = ue.parent, ne = ue.propertyName || ue.name;
- if (Oe(ne) && Mf(re)) {
- const ie = Jp(ne), Se = e.getTypeAtLocation(re);
- g = Tc(Se.isUnion() ? Se.types : [Se], (J) => {
- const oe = J.getProperty(ie);
- return oe ? oe.getDocumentationComment(e) : void 0;
- }) || Ue;
- }
- }
- return h.length === 0 && !F && (h = t.getContextualJsDocTags(i, e)), g.length === 0 && P && (g = P), h.length === 0 && I && (h = I), { displayParts: d, documentation: g, symbolKind: T, tags: h.length === 0 ? void 0 : h };
- function O() {
- return $b();
- }
- function B() {
- d.length && d.push(E6()), z();
- }
- function z() {
- _ && (ae(
- "alias"
- /* alias */
- ), d.push(uc()));
- }
- function X() {
- d.push(uc()), d.push(sf(
- 103
- /* InKeyword */
- )), d.push(uc());
- }
- function q(ue, re) {
- let ne;
- _ && ue === t && (ue = _), T === "index" && (ne = e.getIndexInfosOfIndexSymbol(ue));
- let ie = [];
- ue.flags & 131072 && ne ? (ue.parent && (ie = YD(e, ue.parent)), ie.push(Tu(
- 23
- /* OpenBracketToken */
- )), ne.forEach((Se, J) => {
- ie.push(...u8(e, Se.keyType)), J !== ne.length - 1 && (ie.push(uc()), ie.push(Tu(
- 52
- /* BarToken */
- )), ie.push(uc()));
- }), ie.push(Tu(
- 24
- /* CloseBracketToken */
- ))) : ie = YD(
- e,
- ue,
- re || n,
- /*meaning*/
- void 0,
- 7
- /* AllowAnyNodeKind */
- ), Fn(d, ie), t.flags & 16777216 && d.push(Tu(
- 58
- /* QuestionToken */
- ));
- }
- function V(ue, re) {
- B(), re && (ae(re), ue && !ut(ue.declarations, (ne) => Co(ne) || (vo(ne) || $c(ne)) && !ne.name) && (d.push(uc()), q(ue)));
- }
- function ae(ue) {
- switch (ue) {
- case "var":
- case "function":
- case "let":
- case "const":
- case "constructor":
- case "using":
- case "await using":
- d.push(SV(ue));
- return;
- default:
- d.push(Tu(
- 21
- /* OpenParenToken */
- )), d.push(SV(ue)), d.push(Tu(
- 22
- /* CloseParenToken */
- ));
- return;
- }
- }
- function ee(ue, re, ne = 0) {
- Fn(d, TV(
- e,
- ue,
- i,
- ne | 32
- /* WriteTypeArgumentsOfSignature */
- )), re.length > 1 && (d.push(uc()), d.push(Tu(
- 21
- /* OpenParenToken */
- )), d.push(QD(
- 40
- /* PlusToken */
- )), d.push(w_(
- (re.length - 1).toString(),
- 7
- /* numericLiteral */
- )), d.push(uc()), d.push(Jf(re.length === 2 ? "overload" : "overloads")), d.push(Tu(
- 22
- /* CloseParenToken */
- ))), g = ue.getDocumentationComment(e), h = ue.getJsDocTags(), re.length > 1 && g.length === 0 && h.length === 0 && (g = re[0].getDocumentationComment(e), h = re[0].getJsDocTags().filter((ie) => ie.name !== "deprecated"));
- }
- function G(ue, re) {
- const ne = xv((ie) => {
- const Se = e.symbolToTypeParameterDeclarations(ue, re, Q4e);
- O().writeList(53776, Se, Tr(fs(re)), ie);
- });
- Fn(d, ne);
- }
- }
- function MQe(e, t, n, i, s, o = wS(s), c) {
- return eDe(
- e,
- t,
- n,
- i,
- s,
- /*type*/
- void 0,
- o,
- c
- );
- }
- function tDe(e) {
- return e.parent ? !1 : ir(e.declarations, (t) => {
- if (t.kind === 218)
- return !0;
- if (t.kind !== 260 && t.kind !== 262)
- return !1;
- for (let n = t.parent; !vb(n); n = n.parent)
- if (n.kind === 307 || n.kind === 268)
- return !1;
- return !0;
- });
- }
- var sn = {};
- La(sn, {
- ChangeTracker: () => BQe,
- LeadingTriviaOption: () => iDe,
- TrailingTriviaOption: () => sDe,
- applyChanges: () => _ue,
- assignPositionsToNode: () => DH,
- createWriter: () => oDe,
- deleteNode: () => zh,
- isThisTypeAnnotatable: () => jQe,
- isValidLocationToAddComment: () => cDe
- });
- function rDe(e) {
- const t = e.__pos;
- return E.assert(typeof t == "number"), t;
- }
- function oue(e, t) {
- E.assert(typeof t == "number"), e.__pos = t;
- }
- function nDe(e) {
- const t = e.__end;
- return E.assert(typeof t == "number"), t;
- }
- function cue(e, t) {
- E.assert(typeof t == "number"), e.__end = t;
- }
- var iDe = /* @__PURE__ */ ((e) => (e[e.Exclude = 0] = "Exclude", e[e.IncludeAll = 1] = "IncludeAll", e[e.JSDoc = 2] = "JSDoc", e[e.StartLine = 3] = "StartLine", e))(iDe || {}), sDe = /* @__PURE__ */ ((e) => (e[e.Exclude = 0] = "Exclude", e[e.ExcludeWhitespace = 1] = "ExcludeWhitespace", e[e.Include = 2] = "Include", e))(sDe || {});
- function aDe(e, t) {
- return aa(
- e,
- t,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- );
- }
- function RQe(e, t) {
- let n = t;
- for (; n < e.length; ) {
- const i = e.charCodeAt(n);
- if (sm(i)) {
- n++;
- continue;
- }
- return i === 47;
- }
- return !1;
- }
- var H8 = {
- leadingTriviaOption: 0,
- trailingTriviaOption: 0
- /* Exclude */
- };
- function G8(e, t, n, i) {
- return { pos: MS(e, t, i), end: R6(e, n, i) };
- }
- function MS(e, t, n, i = !1) {
- var s, o;
- const { leadingTriviaOption: c } = n;
- if (c === 0)
- return t.getStart(e);
- if (c === 3) {
- const T = t.getStart(e), C = $p(T, e);
- return VD(t, C) ? C : T;
- }
- if (c === 2) {
- const T = Zj(t, e.text);
- if (T?.length)
- return $p(T[0].pos, e);
- }
- const _ = t.getFullStart(), u = t.getStart(e);
- if (_ === u)
- return u;
- const d = $p(_, e);
- if ($p(u, e) === d)
- return c === 1 ? _ : u;
- if (i) {
- const T = ((s = Ig(e.text, _)) == null ? void 0 : s[0]) || ((o = ky(e.text, _)) == null ? void 0 : o[0]);
- if (T)
- return aa(
- e.text,
- T.end,
- /*stopAfterLineBreak*/
- !0,
- /*stopAtComments*/
- !0
- );
- }
- const h = _ > 0 ? 1 : 0;
- let S = Iy(D4(e, d) + h, e);
- return S = aDe(e.text, S), Iy(D4(e, S), e);
- }
- function lue(e, t, n) {
- const { end: i } = t, { trailingTriviaOption: s } = n;
- if (s === 2) {
- const o = ky(e.text, i);
- if (o) {
- const c = D4(e, t.end);
- for (const _ of o) {
- if (_.kind === 2 || D4(e, _.pos) > c)
- break;
- if (D4(e, _.end) > c)
- return aa(
- e.text,
- _.end,
- /*stopAfterLineBreak*/
- !0,
- /*stopAtComments*/
- !0
- );
- }
- }
- }
- }
- function R6(e, t, n) {
- var i;
- const { end: s } = t, { trailingTriviaOption: o } = n;
- if (o === 0)
- return s;
- if (o === 1) {
- const u = Qi(ky(e.text, s), Ig(e.text, s)), d = (i = u?.[u.length - 1]) == null ? void 0 : i.end;
- return d || s;
- }
- const c = lue(e, t, n);
- if (c)
- return c;
- const _ = aa(
- e.text,
- s,
- /*stopAfterLineBreak*/
- !0
- );
- return _ !== s && (o === 2 || gu(e.text.charCodeAt(_ - 1))) ? _ : s;
- }
- function kH(e, t) {
- return !!t && !!e.parent && (t.kind === 28 || t.kind === 27 && e.parent.kind === 210);
- }
- function jQe(e) {
- return vo(e) || Ec(e);
- }
- var BQe = class lme {
- /** Public for tests only. Other callers should use `ChangeTracker.with`. */
- constructor(t, n) {
- this.newLineCharacter = t, this.formatContext = n, this.changes = [], this.classesWithNodesInsertedAtStart = /* @__PURE__ */ new Map(), this.deletedNodes = [];
- }
- static fromContext(t) {
- return new lme(jh(t.host, t.formatContext.options), t.formatContext);
- }
- static with(t, n) {
- const i = lme.fromContext(t);
- return n(i), i.getChanges();
- }
- pushRaw(t, n) {
- E.assertEqual(t.fileName, n.fileName);
- for (const i of n.textChanges)
- this.changes.push({
- kind: 3,
- sourceFile: t,
- text: i.newText,
- range: e9(i.span)
- });
- }
- deleteRange(t, n) {
- this.changes.push({ kind: 0, sourceFile: t, range: n });
- }
- delete(t, n) {
- this.deletedNodes.push({ sourceFile: t, node: n });
- }
- /** Stop! Consider using `delete` instead, which has logic for deleting nodes from delimited lists. */
- deleteNode(t, n, i = {
- leadingTriviaOption: 1
- /* IncludeAll */
- }) {
- this.deleteRange(t, G8(t, n, n, i));
- }
- deleteNodes(t, n, i = {
- leadingTriviaOption: 1
- /* IncludeAll */
- }, s) {
- for (const o of n) {
- const c = MS(t, o, i, s), _ = R6(t, o, i);
- this.deleteRange(t, { pos: c, end: _ }), s = !!lue(t, o, i);
- }
- }
- deleteModifier(t, n) {
- this.deleteRange(t, { pos: n.getStart(t), end: aa(
- t.text,
- n.end,
- /*stopAfterLineBreak*/
- !0
- ) });
- }
- deleteNodeRange(t, n, i, s = {
- leadingTriviaOption: 1
- /* IncludeAll */
- }) {
- const o = MS(t, n, s), c = R6(t, i, s);
- this.deleteRange(t, { pos: o, end: c });
- }
- deleteNodeRangeExcludingEnd(t, n, i, s = {
- leadingTriviaOption: 1
- /* IncludeAll */
- }) {
- const o = MS(t, n, s), c = i === void 0 ? t.text.length : MS(t, i, s);
- this.deleteRange(t, { pos: o, end: c });
- }
- replaceRange(t, n, i, s = {}) {
- this.changes.push({ kind: 1, sourceFile: t, range: n, options: s, node: i });
- }
- replaceNode(t, n, i, s = H8) {
- this.replaceRange(t, G8(t, n, n, s), i, s);
- }
- replaceNodeRange(t, n, i, s, o = H8) {
- this.replaceRange(t, G8(t, n, i, o), s, o);
- }
- replaceRangeWithNodes(t, n, i, s = {}) {
- this.changes.push({ kind: 2, sourceFile: t, range: n, options: s, nodes: i });
- }
- replaceNodeWithNodes(t, n, i, s = H8) {
- this.replaceRangeWithNodes(t, G8(t, n, n, s), i, s);
- }
- replaceNodeWithText(t, n, i) {
- this.replaceRangeWithText(t, G8(t, n, n, H8), i);
- }
- replaceNodeRangeWithNodes(t, n, i, s, o = H8) {
- this.replaceRangeWithNodes(t, G8(t, n, i, o), s, o);
- }
- nodeHasTrailingComment(t, n, i = H8) {
- return !!lue(t, n, i);
- }
- nextCommaToken(t, n) {
- const i = Zb(n, n.parent, t);
- return i && i.kind === 28 ? i : void 0;
- }
- replacePropertyAssignment(t, n, i) {
- const s = this.nextCommaToken(t, n) ? "" : "," + this.newLineCharacter;
- this.replaceNode(t, n, i, { suffix: s });
- }
- insertNodeAt(t, n, i, s = {}) {
- this.replaceRange(t, op(n), i, s);
- }
- insertNodesAt(t, n, i, s = {}) {
- this.replaceRangeWithNodes(t, op(n), i, s);
- }
- insertNodeAtTopOfFile(t, n, i) {
- this.insertAtTopOfFile(t, n, i);
- }
- insertNodesAtTopOfFile(t, n, i) {
- this.insertAtTopOfFile(t, n, i);
- }
- insertAtTopOfFile(t, n, i) {
- const s = GQe(t), o = {
- prefix: s === 0 ? void 0 : this.newLineCharacter,
- suffix: (gu(t.text.charCodeAt(s)) ? "" : this.newLineCharacter) + (i ? this.newLineCharacter : "")
- };
- us(n) ? this.insertNodesAt(t, s, n, o) : this.insertNodeAt(t, s, n, o);
- }
- insertNodesAtEndOfFile(t, n, i) {
- this.insertAtEndOfFile(t, n, i);
- }
- insertAtEndOfFile(t, n, i) {
- const s = t.end + 1, o = {
- prefix: this.newLineCharacter,
- suffix: this.newLineCharacter + (i ? this.newLineCharacter : "")
- };
- this.insertNodesAt(t, s, n, o);
- }
- insertStatementsInNewFile(t, n, i) {
- this.newFileChanges || (this.newFileChanges = Ip()), this.newFileChanges.add(t, { oldFile: i, statements: n });
- }
- insertFirstParameter(t, n, i) {
- const s = el(n);
- s ? this.insertNodeBefore(t, s, i) : this.insertNodeAt(t, n.pos, i);
- }
- insertNodeBefore(t, n, i, s = !1, o = {}) {
- this.insertNodeAt(t, MS(t, n, o), i, this.getOptionsForInsertNodeBefore(n, i, s));
- }
- insertNodesBefore(t, n, i, s = !1, o = {}) {
- this.insertNodesAt(t, MS(t, n, o), i, this.getOptionsForInsertNodeBefore(n, xa(i), s));
- }
- insertModifierAt(t, n, i, s = {}) {
- this.insertNodeAt(t, n, A.createToken(i), s);
- }
- insertModifierBefore(t, n, i) {
- return this.insertModifierAt(t, i.getStart(t), n, { suffix: " " });
- }
- insertCommentBeforeLine(t, n, i, s) {
- const o = Iy(n, t), c = Lse(t.text, o), _ = cDe(t, c), u = T6(t, _ ? c : i), d = t.text.slice(o, c), g = `${_ ? "" : this.newLineCharacter}//${s}${this.newLineCharacter}${d}`;
- this.insertText(t, u.getStart(t), g);
- }
- insertJsdocCommentBefore(t, n, i) {
- const s = n.getStart(t);
- if (n.jsDoc)
- for (const _ of n.jsDoc)
- this.deleteRange(t, {
- pos: $p(_.getStart(t), t),
- end: R6(
- t,
- _,
- /*options*/
- {}
- )
- });
- const o = c9(t.text, s - 1), c = t.text.slice(o, s);
- this.insertNodeAt(t, s, i, { suffix: this.newLineCharacter + c });
- }
- createJSDocText(t, n) {
- const i = ta(n.jsDoc, (o) => _s(o.comment) ? A.createJSDocText(o.comment) : o.comment), s = Qm(n.jsDoc);
- return s && cp(s.pos, s.end, t) && Nr(i) === 0 ? void 0 : A.createNodeArray(rR(i, A.createJSDocText(`
-`)));
- }
- replaceJSDocComment(t, n, i) {
- this.insertJsdocCommentBefore(t, JQe(n), A.createJSDocComment(this.createJSDocText(t, n), A.createNodeArray(i)));
- }
- addJSDocTags(t, n, i) {
- const s = AE(n.jsDoc, (c) => c.tags), o = i.filter(
- (c) => !s.some((_, u) => {
- const d = zQe(_, c);
- return d && (s[u] = d), !!d;
- })
- );
- this.replaceJSDocComment(t, n, [...s, ...o]);
- }
- filterJSDocTags(t, n, i) {
- this.replaceJSDocComment(t, n, Ln(AE(n.jsDoc, (s) => s.tags), i));
- }
- replaceRangeWithText(t, n, i) {
- this.changes.push({ kind: 3, sourceFile: t, range: n, text: i });
- }
- insertText(t, n, i) {
- this.replaceRangeWithText(t, op(n), i);
- }
- /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */
- tryInsertTypeAnnotation(t, n, i) {
- let s;
- if (ys(n)) {
- if (s = Ya(n, 22, t), !s) {
- if (!Co(n)) return !1;
- s = xa(n.parameters);
- }
- } else
- s = (n.kind === 260 ? n.exclamationToken : n.questionToken) ?? n.name;
- return this.insertNodeAt(t, s.end, i, { prefix: ": " }), !0;
- }
- tryInsertThisTypeAnnotation(t, n, i) {
- const s = Ya(n, 21, t).getStart(t) + 1, o = n.parameters.length ? ", " : "";
- this.insertNodeAt(t, s, i, { prefix: "this: ", suffix: o });
- }
- insertTypeParameters(t, n, i) {
- const s = (Ya(n, 21, t) || xa(n.parameters)).getStart(t);
- this.insertNodesAt(t, s, i, { prefix: "<", suffix: ">", joiner: ", " });
- }
- getOptionsForInsertNodeBefore(t, n, i) {
- return bi(t) || _l(t) ? { suffix: i ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter } : ii(t) ? { suffix: ", " } : Ii(t) ? Ii(n) ? { suffix: ", " } : {} : oa(t) && ic(t.parent) || Tm(t) ? { suffix: ", " } : Zu(t) ? { suffix: "," + (i ? this.newLineCharacter : " ") } : E.failBadSyntaxKind(t);
- }
- insertNodeAtConstructorStart(t, n, i) {
- const s = el(n.body.statements);
- !s || !n.body.multiLine ? this.replaceConstructorBody(t, n, [i, ...n.body.statements]) : this.insertNodeBefore(t, s, i);
- }
- insertNodeAtConstructorStartAfterSuperCall(t, n, i) {
- const s = On(n.body.statements, (o) => Pl(o) && rS(o.expression));
- !s || !n.body.multiLine ? this.replaceConstructorBody(t, n, [...n.body.statements, i]) : this.insertNodeAfter(t, s, i);
- }
- insertNodeAtConstructorEnd(t, n, i) {
- const s = Ro(n.body.statements);
- !s || !n.body.multiLine ? this.replaceConstructorBody(t, n, [...n.body.statements, i]) : this.insertNodeAfter(t, s, i);
- }
- replaceConstructorBody(t, n, i) {
- this.replaceNode(t, n.body, A.createBlock(
- i,
- /*multiLine*/
- !0
- ));
- }
- insertNodeAtEndOfScope(t, n, i) {
- const s = MS(t, n.getLastToken(), {});
- this.insertNodeAt(t, s, i, {
- prefix: gu(t.text.charCodeAt(n.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter,
- suffix: this.newLineCharacter
- });
- }
- insertMemberAtStart(t, n, i) {
- this.insertNodeAtStartWorker(t, n, i);
- }
- insertNodeAtObjectStart(t, n, i) {
- this.insertNodeAtStartWorker(t, n, i);
- }
- insertNodeAtStartWorker(t, n, i) {
- const s = this.guessIndentationFromExistingMembers(t, n) ?? this.computeIndentationForNewMember(t, n);
- this.insertNodeAt(t, CH(n).pos, i, this.getInsertNodeAtStartInsertOptions(t, n, s));
- }
- /**
- * Tries to guess the indentation from the existing members of a class/interface/object. All members must be on
- * new lines and must share the same indentation.
- */
- guessIndentationFromExistingMembers(t, n) {
- let i, s = n;
- for (const o of CH(n)) {
- if (t5(s, o, t))
- return;
- const c = o.getStart(t), _ = Yc.SmartIndenter.findFirstNonWhitespaceColumn($p(c, t), c, t, this.formatContext.options);
- if (i === void 0)
- i = _;
- else if (_ !== i)
- return;
- s = o;
- }
- return i;
- }
- computeIndentationForNewMember(t, n) {
- const i = n.getStart(t);
- return Yc.SmartIndenter.findFirstNonWhitespaceColumn($p(i, t), i, t, this.formatContext.options) + (this.formatContext.options.indentSize ?? 4);
- }
- getInsertNodeAtStartInsertOptions(t, n, i) {
- const o = CH(n).length === 0, c = zp(this.classesWithNodesInsertedAtStart, Ma(n), { node: n, sourceFile: t }), _ = Ks(n) && (!Rp(t) || !o), u = Ks(n) && Rp(t) && o && !c;
- return {
- indentation: i,
- prefix: (u ? "," : "") + this.newLineCharacter,
- suffix: _ ? "," : Xl(n) && o ? ";" : ""
- };
- }
- insertNodeAfterComma(t, n, i) {
- const s = this.insertNodeAfterWorker(t, this.nextCommaToken(t, n) || n, i);
- this.insertNodeAt(t, s, i, this.getInsertNodeAfterOptions(t, n));
- }
- insertNodeAfter(t, n, i) {
- const s = this.insertNodeAfterWorker(t, n, i);
- this.insertNodeAt(t, s, i, this.getInsertNodeAfterOptions(t, n));
- }
- insertNodeAtEndOfList(t, n, i) {
- this.insertNodeAt(t, n.end, i, { prefix: ", " });
- }
- insertNodesAfter(t, n, i) {
- const s = this.insertNodeAfterWorker(t, n, xa(i));
- this.insertNodesAt(t, s, i, this.getInsertNodeAfterOptions(t, n));
- }
- insertNodeAfterWorker(t, n, i) {
- return $Qe(n, i) && t.text.charCodeAt(n.end - 1) !== 59 && this.replaceRange(t, op(n.end), A.createToken(
- 27
- /* SemicolonToken */
- )), R6(t, n, {});
- }
- getInsertNodeAfterOptions(t, n) {
- const i = this.getInsertNodeAfterOptionsWorker(n);
- return {
- ...i,
- prefix: n.end === t.end && bi(n) ? i.prefix ? `
-${i.prefix}` : `
-` : i.prefix
- };
- }
- getInsertNodeAfterOptionsWorker(t) {
- switch (t.kind) {
- case 263:
- case 267:
- return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
- case 260:
- case 11:
- case 80:
- return { prefix: ", " };
- case 303:
- return { suffix: "," + this.newLineCharacter };
- case 95:
- return { prefix: " " };
- case 169:
- return {};
- default:
- return E.assert(bi(t) || VI(t)), { suffix: this.newLineCharacter };
- }
- }
- insertName(t, n, i) {
- if (E.assert(!n.name), n.kind === 219) {
- const s = Ya(n, 39, t), o = Ya(n, 21, t);
- o ? (this.insertNodesAt(t, o.getStart(t), [A.createToken(
- 100
- /* FunctionKeyword */
- ), A.createIdentifier(i)], { joiner: " " }), zh(this, t, s)) : (this.insertText(t, xa(n.parameters).getStart(t), `function ${i}(`), this.replaceRange(t, s, A.createToken(
- 22
- /* CloseParenToken */
- ))), n.body.kind !== 241 && (this.insertNodesAt(t, n.body.getStart(t), [A.createToken(
- 19
- /* OpenBraceToken */
- ), A.createToken(
- 107
- /* ReturnKeyword */
- )], { joiner: " ", suffix: " " }), this.insertNodesAt(t, n.body.end, [A.createToken(
- 27
- /* SemicolonToken */
- ), A.createToken(
- 20
- /* CloseBraceToken */
- )], { joiner: " " }));
- } else {
- const s = Ya(n, n.kind === 218 ? 100 : 86, t).end;
- this.insertNodeAt(t, s, A.createIdentifier(i), { prefix: " " });
- }
- }
- insertExportModifier(t, n) {
- this.insertText(t, n.getStart(t), "export ");
- }
- insertImportSpecifierAtIndex(t, n, i, s) {
- const o = i.elements[s - 1];
- o ? this.insertNodeInListAfter(t, o, n) : this.insertNodeBefore(
- t,
- i.elements[0],
- n,
- !cp(i.elements[0].getStart(), i.parent.parent.getStart(), t)
- );
- }
- /**
- * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range,
- * i.e. arguments in arguments lists, parameters in parameter lists etc.
- * Note that separators are part of the node in statements and class elements.
- */
- insertNodeInListAfter(t, n, i, s = Yc.SmartIndenter.getContainingList(n, t)) {
- if (!s) {
- E.fail("node is not a list element");
- return;
- }
- const o = mC(s, n);
- if (o < 0)
- return;
- const c = n.getEnd();
- if (o !== s.length - 1) {
- const _ = xi(t, n.end);
- if (_ && kH(n, _)) {
- const u = s[o + 1], d = aDe(t.text, u.getFullStart()), g = `${qs(_.kind)}${t.text.substring(_.end, d)}`;
- this.insertNodesAt(t, d, [i], { suffix: g });
- }
- } else {
- const _ = n.getStart(t), u = $p(_, t);
- let d, g = !1;
- if (s.length === 1)
- d = 28;
- else {
- const h = sl(n.pos, t);
- d = kH(n, h) ? h.kind : 28, g = $p(s[o - 1].getStart(t), t) !== u;
- }
- if ((RQe(t.text, n.end) || !cp(s.pos, s.end, t)) && (g = !0), g) {
- this.replaceRange(t, op(c), A.createToken(d));
- const h = Yc.SmartIndenter.findFirstNonWhitespaceColumn(u, _, t, this.formatContext.options);
- let S = aa(
- t.text,
- c,
- /*stopAfterLineBreak*/
- !0,
- /*stopAtComments*/
- !1
- );
- for (; S !== c && gu(t.text.charCodeAt(S - 1)); )
- S--;
- this.replaceRange(t, op(S), i, { indentation: h, prefix: this.newLineCharacter });
- } else
- this.replaceRange(t, op(c), i, { prefix: `${qs(d)} ` });
- }
- }
- parenthesizeExpression(t, n) {
- this.replaceRange(t, lJ(n), A.createParenthesizedExpression(n));
- }
- finishClassesWithNodesInsertedAtStart() {
- this.classesWithNodesInsertedAtStart.forEach(({ node: t, sourceFile: n }) => {
- const [i, s] = UQe(t, n);
- if (i !== void 0 && s !== void 0) {
- const o = CH(t).length === 0, c = cp(i, s, n);
- o && c && i !== s - 1 && this.deleteRange(n, op(i, s - 1)), c && this.insertText(n, s - 1, this.newLineCharacter);
- }
- });
- }
- finishDeleteDeclarations() {
- const t = /* @__PURE__ */ new Set();
- for (const { sourceFile: n, node: i } of this.deletedNodes)
- this.deletedNodes.some((s) => s.sourceFile === n && lse(s.node, i)) || (us(i) ? this.deleteRange(n, uJ(n, i)) : fue.deleteDeclaration(this, t, n, i));
- t.forEach((n) => {
- const i = n.getSourceFile(), s = Yc.SmartIndenter.getContainingList(n, i);
- if (n !== _a(s)) return;
- const o = uI(s, (c) => !t.has(c), s.length - 2);
- o !== -1 && this.deleteRange(i, { pos: s[o].end, end: uue(i, s[o + 1]) });
- });
- }
- /**
- * Note: after calling this, the TextChanges object must be discarded!
- * @param validate only for tests
- * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions,
- * so we can only call this once and can't get the non-formatted text separately.
- */
- getChanges(t) {
- this.finishDeleteDeclarations(), this.finishClassesWithNodesInsertedAtStart();
- const n = EH.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, t);
- return this.newFileChanges && this.newFileChanges.forEach((i, s) => {
- n.push(EH.newFileChanges(s, i, this.newLineCharacter, this.formatContext));
- }), n;
- }
- createNewFile(t, n, i) {
- this.insertStatementsInNewFile(n, i, t);
- }
- };
- function JQe(e) {
- if (e.kind !== 219)
- return e;
- const t = e.parent.kind === 172 ? e.parent : e.parent.parent;
- return t.jsDoc = e.jsDoc, t;
- }
- function zQe(e, t) {
- if (e.kind === t.kind)
- switch (e.kind) {
- case 341: {
- const n = e, i = t;
- return Oe(n.name) && Oe(i.name) && n.name.escapedText === i.name.escapedText ? A.createJSDocParameterTag(
- /*tagName*/
- void 0,
- i.name,
- /*isBracketed*/
- !1,
- i.typeExpression,
- i.isNameFirst,
- n.comment
- ) : void 0;
- }
- case 342:
- return A.createJSDocReturnTag(
- /*tagName*/
- void 0,
- t.typeExpression,
- e.comment
- );
- case 344:
- return A.createJSDocTypeTag(
- /*tagName*/
- void 0,
- t.typeExpression,
- e.comment
- );
- }
- }
- function uue(e, t) {
- return aa(
- e.text,
- MS(e, t, {
- leadingTriviaOption: 1
- /* IncludeAll */
- }),
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- );
- }
- function WQe(e, t, n, i) {
- const s = uue(e, i);
- if (n === void 0 || cp(R6(e, t, {}), s, e))
- return s;
- const o = sl(i.getStart(e), e);
- if (kH(t, o)) {
- const c = sl(t.getStart(e), e);
- if (kH(n, c)) {
- const _ = aa(
- e.text,
- o.getEnd(),
- /*stopAfterLineBreak*/
- !0,
- /*stopAtComments*/
- !0
- );
- if (cp(c.getStart(e), o.getStart(e), e))
- return gu(e.text.charCodeAt(_ - 1)) ? _ - 1 : _;
- if (gu(e.text.charCodeAt(_)))
- return _;
- }
- }
- return s;
- }
- function UQe(e, t) {
- const n = Ya(e, 19, t), i = Ya(e, 20, t);
- return [n?.end, i?.end];
- }
- function CH(e) {
- return Ks(e) ? e.properties : e.members;
- }
- var EH;
- ((e) => {
- function t(_, u, d, g) {
- return Ai(Zk(_, (h) => h.sourceFile.path), (h) => {
- const S = h[0].sourceFile, T = V_(h, (D, P) => D.range.pos - P.range.pos || D.range.end - P.range.end);
- for (let D = 0; D < T.length - 1; D++)
- E.assert(T[D].range.end <= T[D + 1].range.pos, "Changes overlap", () => `${JSON.stringify(T[D].range)} and ${JSON.stringify(T[D + 1].range)}`);
- const C = Ai(T, (D) => {
- const P = L0(D.range), I = D.kind === 1 ? Tr(Ho(D.node)) ?? D.sourceFile : D.kind === 2 ? Tr(Ho(D.nodes[0])) ?? D.sourceFile : D.sourceFile, F = s(D, I, S, u, d, g);
- if (!(P.length === F.length && Hse(I.text, F, P.start)))
- return s8(P, F);
- });
- return C.length > 0 ? { fileName: S.fileName, textChanges: C } : void 0;
- });
- }
- e.getTextChangesFromChanges = t;
- function n(_, u, d, g) {
- const h = i(b5(_), u, d, g);
- return { fileName: _, textChanges: [s8(Ul(0, 0), h)], isNewFile: !0 };
- }
- e.newFileChanges = n;
- function i(_, u, d, g) {
- const h = ta(u, (C) => C.statements.map((D) => D === 4 ? "" : c(D, C.oldFile, d).text)).join(d), S = Bx(
- "any file name",
- h,
- {
- languageVersion: 99,
- jsDocParsingMode: 1
- /* ParseNone */
- },
- /*setParentNodes*/
- !0,
- _
- ), T = Yc.formatDocument(S, g);
- return _ue(h, T) + d;
- }
- e.newFileChangesWorker = i;
- function s(_, u, d, g, h, S) {
- var T;
- if (_.kind === 0)
- return "";
- if (_.kind === 3)
- return _.text;
- const { options: C = {}, range: { pos: D } } = _, P = (O) => o(O, u, d, D, C, g, h, S), I = _.kind === 2 ? _.nodes.map((O) => eC(P(O), g)).join(((T = _.options) == null ? void 0 : T.joiner) || g) : P(_.node), F = C.indentation !== void 0 || $p(D, u) === D ? I : I.replace(/^\s+/, "");
- return (C.prefix || "") + F + (!C.suffix || Zo(F, C.suffix) ? "" : C.suffix);
- }
- function o(_, u, d, g, { indentation: h, prefix: S, delta: T }, C, D, P) {
- const { node: I, text: F } = c(_, u, C);
- P && P(I, F);
- const O = b9(D, u), B = h !== void 0 ? h : Yc.SmartIndenter.getIndentation(g, d, O, S === C || $p(g, u) === g);
- T === void 0 && (T = Yc.SmartIndenter.shouldIndentChildNode(O, _) && O.indentSize || 0);
- const z = {
- text: F,
- getLineAndCharacterOfPosition(q) {
- return Qs(this, q);
- }
- }, X = Yc.formatNodeGivenIndentation(I, z, u.languageVariant, B, T, { ...D, options: O });
- return _ue(F, X);
- }
- function c(_, u, d) {
- const g = oDe(d), h = v8(d);
- return Ky({
- newLine: h,
- neverAsciiEscape: !0,
- preserveSourceNewlines: !0,
- terminateUnterminatedLiterals: !0
- }, g).writeNode(4, _, u, g), { text: g.getText(), node: DH(_) };
- }
- e.getNonformattedText = c;
- })(EH || (EH = {}));
- function _ue(e, t) {
- for (let n = t.length - 1; n >= 0; n--) {
- const { span: i, newText: s } = t[n];
- e = `${e.substring(0, i.start)}${s}${e.substring(ec(i))}`;
- }
- return e;
- }
- function VQe(e) {
- return aa(e, 0) === e.length;
- }
- var qQe = {
- ...MA,
- factory: G3(
- MA.factory.flags | 1,
- MA.factory.baseFactory
- )
- };
- function DH(e) {
- const t = br(e, DH, qQe, HQe, DH), n = fo(t) ? t : Object.create(t);
- return wd(n, rDe(e), nDe(e)), n;
- }
- function HQe(e, t, n, i, s) {
- const o = Fr(e, t, n, i, s);
- if (!o)
- return o;
- E.assert(e);
- const c = o === e ? A.createNodeArray(o.slice(0)) : o;
- return wd(c, rDe(e), nDe(e)), c;
- }
- function oDe(e) {
- let t = 0;
- const n = E3(e), i = (J) => {
- J && oue(J, t);
- }, s = (J) => {
- J && cue(J, t);
- }, o = (J) => {
- J && oue(J, t);
- }, c = (J) => {
- J && cue(J, t);
- }, _ = (J) => {
- J && oue(J, t);
- }, u = (J) => {
- J && cue(J, t);
- };
- function d(J, oe) {
- if (oe || !VQe(J)) {
- t = n.getTextPos();
- let _e = 0;
- for (; Ng(J.charCodeAt(J.length - _e - 1)); )
- _e++;
- t -= _e;
- }
- }
- function g(J) {
- n.write(J), d(
- J,
- /*force*/
- !1
- );
- }
- function h(J) {
- n.writeComment(J);
- }
- function S(J) {
- n.writeKeyword(J), d(
- J,
- /*force*/
- !1
- );
- }
- function T(J) {
- n.writeOperator(J), d(
- J,
- /*force*/
- !1
- );
- }
- function C(J) {
- n.writePunctuation(J), d(
- J,
- /*force*/
- !1
- );
- }
- function D(J) {
- n.writeTrailingSemicolon(J), d(
- J,
- /*force*/
- !1
- );
- }
- function P(J) {
- n.writeParameter(J), d(
- J,
- /*force*/
- !1
- );
- }
- function I(J) {
- n.writeProperty(J), d(
- J,
- /*force*/
- !1
- );
- }
- function F(J) {
- n.writeSpace(J), d(
- J,
- /*force*/
- !1
- );
- }
- function O(J) {
- n.writeStringLiteral(J), d(
- J,
- /*force*/
- !1
- );
- }
- function B(J, oe) {
- n.writeSymbol(J, oe), d(
- J,
- /*force*/
- !1
- );
- }
- function z(J) {
- n.writeLine(J);
- }
- function X() {
- n.increaseIndent();
- }
- function q() {
- n.decreaseIndent();
- }
- function V() {
- return n.getText();
- }
- function ae(J) {
- n.rawWrite(J), d(
- J,
- /*force*/
- !1
- );
- }
- function ee(J) {
- n.writeLiteral(J), d(
- J,
- /*force*/
- !0
- );
- }
- function G() {
- return n.getTextPos();
- }
- function ue() {
- return n.getLine();
- }
- function re() {
- return n.getColumn();
- }
- function ne() {
- return n.getIndent();
- }
- function ie() {
- return n.isAtStartOfLine();
- }
- function Se() {
- n.clear(), t = 0;
- }
- return {
- onBeforeEmitNode: i,
- onAfterEmitNode: s,
- onBeforeEmitNodeArray: o,
- onAfterEmitNodeArray: c,
- onBeforeEmitToken: _,
- onAfterEmitToken: u,
- write: g,
- writeComment: h,
- writeKeyword: S,
- writeOperator: T,
- writePunctuation: C,
- writeTrailingSemicolon: D,
- writeParameter: P,
- writeProperty: I,
- writeSpace: F,
- writeStringLiteral: O,
- writeSymbol: B,
- writeLine: z,
- increaseIndent: X,
- decreaseIndent: q,
- getText: V,
- rawWrite: ae,
- writeLiteral: ee,
- getTextPos: G,
- getLine: ue,
- getColumn: re,
- getIndent: ne,
- isAtStartOfLine: ie,
- hasTrailingComment: () => n.hasTrailingComment(),
- hasTrailingWhitespace: () => n.hasTrailingWhitespace(),
- clear: Se
- };
- }
- function GQe(e) {
- let t;
- for (const d of e.statements)
- if (lm(d))
- t = d;
- else
- break;
- let n = 0;
- const i = e.text;
- if (t)
- return n = t.end, u(), n;
- const s = II(i);
- s !== void 0 && (n = s.length, u());
- const o = Ig(i, n);
- if (!o) return n;
- let c, _;
- for (const d of o) {
- if (d.kind === 3) {
- if (o7(i, d.pos)) {
- c = { range: d, pinnedOrTripleSlash: !0 };
- continue;
- }
- } else if (Rj(i, d.pos, d.end)) {
- c = { range: d, pinnedOrTripleSlash: !0 };
- continue;
- }
- if (c) {
- if (c.pinnedOrTripleSlash) break;
- const g = e.getLineAndCharacterOfPosition(d.pos).line, h = e.getLineAndCharacterOfPosition(c.range.end).line;
- if (g >= h + 2) break;
- }
- if (e.statements.length) {
- _ === void 0 && (_ = e.getLineAndCharacterOfPosition(e.statements[0].getStart()).line);
- const g = e.getLineAndCharacterOfPosition(d.end).line;
- if (_ < g + 2) break;
- }
- c = { range: d, pinnedOrTripleSlash: !1 };
- }
- return c && (n = c.range.end, u()), n;
- function u() {
- if (n < i.length) {
- const d = i.charCodeAt(n);
- gu(d) && (n++, n < i.length && d === 13 && i.charCodeAt(n) === 10 && n++);
- }
- }
- }
- function cDe(e, t) {
- return !O0(e, t) && !Qx(e, t) && !ZU(e, t) && !mse(e, t);
- }
- function $Qe(e, t) {
- return (m_(e) || cs(e)) && VI(t) && t.name.kind === 167 || Lw(e) && Lw(t);
- }
- var fue;
- ((e) => {
- function t(o, c, _, u) {
- switch (u.kind) {
- case 169: {
- const T = u.parent;
- Co(T) && T.parameters.length === 1 && !Ya(T, 21, _) ? o.replaceNodeWithText(_, u, "()") : $8(o, c, _, u);
- break;
- }
- case 272:
- case 271:
- const d = _.imports.length && u === xa(_.imports).parent || u === On(_.statements, XT);
- zh(o, _, u, {
- leadingTriviaOption: d ? 0 : gf(u) ? 2 : 3
- /* StartLine */
- });
- break;
- case 208:
- const g = u.parent;
- g.kind === 207 && u !== _a(g.elements) ? zh(o, _, u) : $8(o, c, _, u);
- break;
- case 260:
- s(o, c, _, u);
- break;
- case 168:
- $8(o, c, _, u);
- break;
- case 276:
- const S = u.parent;
- S.elements.length === 1 ? i(o, _, S) : $8(o, c, _, u);
- break;
- case 274:
- i(o, _, u);
- break;
- case 27:
- zh(o, _, u, {
- trailingTriviaOption: 0
- /* Exclude */
- });
- break;
- case 100:
- zh(o, _, u, {
- leadingTriviaOption: 0
- /* Exclude */
- });
- break;
- case 263:
- case 262:
- zh(o, _, u, {
- leadingTriviaOption: gf(u) ? 2 : 3
- /* StartLine */
- });
- break;
- default:
- u.parent ? Ad(u.parent) && u.parent.name === u ? n(o, _, u.parent) : Fs(u.parent) && ss(u.parent.arguments, u) ? $8(o, c, _, u) : zh(o, _, u) : zh(o, _, u);
- }
- }
- e.deleteDeclaration = t;
- function n(o, c, _) {
- if (!_.namedBindings)
- zh(o, c, _.parent);
- else {
- const u = _.name.getStart(c), d = xi(c, _.name.end);
- if (d && d.kind === 28) {
- const g = aa(
- c.text,
- d.end,
- /*stopAfterLineBreak*/
- !1,
- /*stopAtComments*/
- !0
- );
- o.deleteRange(c, { pos: u, end: g });
- } else
- zh(o, c, _.name);
- }
- }
- function i(o, c, _) {
- if (_.parent.name) {
- const u = E.checkDefined(xi(c, _.pos - 1));
- o.deleteRange(c, { pos: u.getStart(c), end: _.end });
- } else {
- const u = nv(
- _,
- 272
- /* ImportDeclaration */
- );
- zh(o, c, u);
- }
- }
- function s(o, c, _, u) {
- const { parent: d } = u;
- if (d.kind === 299) {
- o.deleteNodeRange(_, Ya(d, 21, _), Ya(d, 22, _));
- return;
- }
- if (d.declarations.length !== 1) {
- $8(o, c, _, u);
- return;
- }
- const g = d.parent;
- switch (g.kind) {
- case 250:
- case 249:
- o.replaceNode(_, u, A.createObjectLiteralExpression());
- break;
- case 248:
- zh(o, _, d);
- break;
- case 243:
- zh(o, _, g, {
- leadingTriviaOption: gf(g) ? 2 : 3
- /* StartLine */
- });
- break;
- default:
- E.assertNever(g);
- }
- }
- })(fue || (fue = {}));
- function zh(e, t, n, i = {
- leadingTriviaOption: 1
- /* IncludeAll */
- }) {
- const s = MS(t, n, i), o = R6(t, n, i);
- e.deleteRange(t, { pos: s, end: o });
- }
- function $8(e, t, n, i) {
- const s = E.checkDefined(Yc.SmartIndenter.getContainingList(i, n)), o = mC(s, i);
- if (E.assert(o !== -1), s.length === 1) {
- zh(e, n, i);
- return;
- }
- E.assert(!t.has(i), "Deleting a node twice"), t.add(i), e.deleteRange(n, {
- pos: uue(n, i),
- end: o === s.length - 1 ? R6(n, i, {}) : WQe(n, i, s[o - 1], s[o + 1])
- });
- }
- var Yc = {};
- La(Yc, {
- FormattingContext: () => uDe,
- FormattingRequestKind: () => lDe,
- RuleAction: () => _De,
- RuleFlags: () => fDe,
- SmartIndenter: () => wm,
- anyContext: () => PH,
- createTextRangeWithKind: () => IH,
- formatDocument: () => BYe,
- formatNodeGivenIndentation: () => HYe,
- formatOnClosingCurly: () => jYe,
- formatOnEnter: () => LYe,
- formatOnOpeningCurly: () => RYe,
- formatOnSemicolon: () => MYe,
- formatSelection: () => JYe,
- getAllRules: () => pDe,
- getFormatContext: () => DYe,
- getFormattingScanner: () => pue,
- getIndentationString: () => Due,
- getRangeOfEnclosingComment: () => jDe
- });
- var lDe = /* @__PURE__ */ ((e) => (e[e.FormatDocument = 0] = "FormatDocument", e[e.FormatSelection = 1] = "FormatSelection", e[e.FormatOnEnter = 2] = "FormatOnEnter", e[e.FormatOnSemicolon = 3] = "FormatOnSemicolon", e[e.FormatOnOpeningCurlyBrace = 4] = "FormatOnOpeningCurlyBrace", e[e.FormatOnClosingCurlyBrace = 5] = "FormatOnClosingCurlyBrace", e))(lDe || {}), uDe = class {
- constructor(e, t, n) {
- this.sourceFile = e, this.formattingRequestKind = t, this.options = n;
- }
- updateContext(e, t, n, i, s) {
- this.currentTokenSpan = E.checkDefined(e), this.currentTokenParent = E.checkDefined(t), this.nextTokenSpan = E.checkDefined(n), this.nextTokenParent = E.checkDefined(i), this.contextNode = E.checkDefined(s), this.contextNodeAllOnSameLine = void 0, this.nextNodeAllOnSameLine = void 0, this.tokensAreOnSameLine = void 0, this.contextNodeBlockIsOnOneLine = void 0, this.nextNodeBlockIsOnOneLine = void 0;
- }
- ContextNodeAllOnSameLine() {
- return this.contextNodeAllOnSameLine === void 0 && (this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode)), this.contextNodeAllOnSameLine;
- }
- NextNodeAllOnSameLine() {
- return this.nextNodeAllOnSameLine === void 0 && (this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent)), this.nextNodeAllOnSameLine;
- }
- TokensAreOnSameLine() {
- if (this.tokensAreOnSameLine === void 0) {
- const e = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line, t = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;
- this.tokensAreOnSameLine = e === t;
- }
- return this.tokensAreOnSameLine;
- }
- ContextNodeBlockIsOnOneLine() {
- return this.contextNodeBlockIsOnOneLine === void 0 && (this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode)), this.contextNodeBlockIsOnOneLine;
- }
- NextNodeBlockIsOnOneLine() {
- return this.nextNodeBlockIsOnOneLine === void 0 && (this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent)), this.nextNodeBlockIsOnOneLine;
- }
- NodeIsOnOneLine(e) {
- const t = this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line, n = this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line;
- return t === n;
- }
- BlockIsOnOneLine(e) {
- const t = Ya(e, 19, this.sourceFile), n = Ya(e, 20, this.sourceFile);
- if (t && n) {
- const i = this.sourceFile.getLineAndCharacterOfPosition(t.getEnd()).line, s = this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line;
- return i === s;
- }
- return !1;
- }
- }, XQe = Og(
- 99,
- /*skipTrivia*/
- !1,
- 0
- /* Standard */
- ), QQe = Og(
- 99,
- /*skipTrivia*/
- !1,
- 1
- /* JSX */
- );
- function pue(e, t, n, i, s) {
- const o = t === 1 ? QQe : XQe;
- o.setText(e), o.resetTokenState(n);
- let c = !0, _, u, d, g, h;
- const S = s({
- advance: T,
- readTokenInfo: z,
- readEOFTokenRange: q,
- isOnToken: V,
- isOnEOF: ae,
- getCurrentLeadingTrivia: () => _,
- lastTrailingTriviaWasNewLine: () => c,
- skipToEndOf: G,
- skipToStartOf: ue,
- getTokenFullStart: () => h?.token.pos ?? o.getTokenStart(),
- getStartPos: () => h?.token.pos ?? o.getTokenStart()
- });
- return h = void 0, o.setText(void 0), S;
- function T() {
- h = void 0, o.getTokenFullStart() !== n ? c = !!u && _a(u).kind === 4 : o.scan(), _ = void 0, u = void 0;
- let ne = o.getTokenFullStart();
- for (; ne < i; ) {
- const ie = o.getToken();
- if (!PC(ie))
- break;
- o.scan();
- const Se = {
- pos: ne,
- end: o.getTokenFullStart(),
- kind: ie
- };
- ne = o.getTokenFullStart(), _ = wr(_, Se);
- }
- d = o.getTokenFullStart();
- }
- function C(re) {
- switch (re.kind) {
- case 34:
- case 72:
- case 73:
- case 50:
- case 49:
- return !0;
- }
- return !1;
- }
- function D(re) {
- if (re.parent)
- switch (re.parent.kind) {
- case 291:
- case 286:
- case 287:
- case 285:
- return p_(re.kind) || re.kind === 80;
- }
- return !1;
- }
- function P(re) {
- return xx(re) || Gg(re) && h?.token.kind === 12;
- }
- function I(re) {
- return re.kind === 14;
- }
- function F(re) {
- return re.kind === 17 || re.kind === 18;
- }
- function O(re) {
- return re.parent && km(re.parent) && re.parent.initializer === re;
- }
- function B(re) {
- return re === 44 || re === 69;
- }
- function z(re) {
- E.assert(V());
- const ne = C(re) ? 1 : I(re) ? 2 : F(re) ? 3 : D(re) ? 4 : P(re) ? 5 : O(re) ? 6 : 0;
- if (h && ne === g)
- return ee(h, re);
- o.getTokenFullStart() !== d && (E.assert(h !== void 0), o.resetTokenState(d), o.scan());
- let ie = X(re, ne);
- const Se = IH(
- o.getTokenFullStart(),
- o.getTokenEnd(),
- ie
- );
- for (u && (u = void 0); o.getTokenFullStart() < i && (ie = o.scan(), !!PC(ie)); ) {
- const J = IH(
- o.getTokenFullStart(),
- o.getTokenEnd(),
- ie
- );
- if (u || (u = []), u.push(J), ie === 4) {
- o.scan();
- break;
- }
- }
- return h = { leadingTrivia: _, trailingTrivia: u, token: Se }, ee(h, re);
- }
- function X(re, ne) {
- const ie = o.getToken();
- switch (g = 0, ne) {
- case 1:
- if (ie === 32) {
- g = 1;
- const Se = o.reScanGreaterToken();
- return E.assert(re.kind === Se), Se;
- }
- break;
- case 2:
- if (B(ie)) {
- g = 2;
- const Se = o.reScanSlashToken();
- return E.assert(re.kind === Se), Se;
- }
- break;
- case 3:
- if (ie === 20)
- return g = 3, o.reScanTemplateToken(
- /*isTaggedTemplate*/
- !1
- );
- break;
- case 4:
- return g = 4, o.scanJsxIdentifier();
- case 5:
- return g = 5, o.reScanJsxToken(
- /*allowMultilineJsxText*/
- !1
- );
- case 6:
- return g = 6, o.reScanJsxAttributeValue();
- case 0:
- break;
- default:
- E.assertNever(ne);
- }
- return ie;
- }
- function q() {
- return E.assert(ae()), IH(
- o.getTokenFullStart(),
- o.getTokenEnd(),
- 1
- /* EndOfFileToken */
- );
- }
- function V() {
- const re = h ? h.token.kind : o.getToken();
- return re !== 1 && !PC(re);
- }
- function ae() {
- return (h ? h.token.kind : o.getToken()) === 1;
- }
- function ee(re, ne) {
- return zT(ne) && re.token.kind !== ne.kind && (re.token.kind = ne.kind), re;
- }
- function G(re) {
- o.resetTokenState(re.end), d = o.getTokenFullStart(), g = void 0, h = void 0, c = !1, _ = void 0, u = void 0;
- }
- function ue(re) {
- o.resetTokenState(re.pos), d = o.getTokenFullStart(), g = void 0, h = void 0, c = !1, _ = void 0, u = void 0;
- }
- }
- var PH = Ue, _De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.StopProcessingSpaceActions = 1] = "StopProcessingSpaceActions", e[e.StopProcessingTokenActions = 2] = "StopProcessingTokenActions", e[e.InsertSpace = 4] = "InsertSpace", e[e.InsertNewLine = 8] = "InsertNewLine", e[e.DeleteSpace = 16] = "DeleteSpace", e[e.DeleteToken = 32] = "DeleteToken", e[e.InsertTrailingSemicolon = 64] = "InsertTrailingSemicolon", e[e.StopAction = 3] = "StopAction", e[e.ModifySpaceAction = 28] = "ModifySpaceAction", e[e.ModifyTokenAction = 96] = "ModifyTokenAction", e))(_De || {}), fDe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.CanDeleteNewLines = 1] = "CanDeleteNewLines", e))(fDe || {});
- function pDe() {
- const e = [];
- for (let X = 0; X <= 165; X++)
- X !== 1 && e.push(X);
- function t(...X) {
- return { tokens: e.filter((q) => !X.some((V) => V === q)), isSpecific: !1 };
- }
- const n = { tokens: e, isSpecific: !1 }, i = pP([
- ...e,
- 3
- /* MultiLineCommentTrivia */
- ]), s = pP([
- ...e,
- 1
- /* EndOfFileToken */
- ]), o = mDe(
- 83,
- 165
- /* LastKeyword */
- ), c = mDe(
- 30,
- 79
- /* LastBinaryOperator */
- ), _ = [
- 103,
- 104,
- 165,
- 130,
- 142,
- 152
- /* SatisfiesKeyword */
- ], u = [
- 46,
- 47,
- 55,
- 54
- /* ExclamationToken */
- ], d = [
- 9,
- 10,
- 80,
- 21,
- 23,
- 19,
- 110,
- 105
- /* NewKeyword */
- ], g = [
- 80,
- 21,
- 110,
- 105
- /* NewKeyword */
- ], h = [
- 80,
- 22,
- 24,
- 105
- /* NewKeyword */
- ], S = [
- 80,
- 21,
- 110,
- 105
- /* NewKeyword */
- ], T = [
- 80,
- 22,
- 24,
- 105
- /* NewKeyword */
- ], C = [
- 2,
- 3
- /* MultiLineCommentTrivia */
- ], D = [80, ...oV], P = i, I = pP([
- 80,
- 32,
- 3,
- 86,
- 95,
- 102
- /* ImportKeyword */
- ]), F = pP([
- 22,
- 3,
- 92,
- 113,
- 98,
- 93,
- 85
- /* CatchKeyword */
- ]), O = [
- // Leave comments alone
- Vn(
- "IgnoreBeforeComment",
- n,
- C,
- PH,
- 1
- /* StopProcessingSpaceActions */
- ),
- Vn(
- "IgnoreAfterLineComment",
- 2,
- n,
- PH,
- 1
- /* StopProcessingSpaceActions */
- ),
- Vn(
- "NotSpaceBeforeColon",
- n,
- 59,
- [Ni, fL, yDe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceAfterColon",
- 59,
- n,
- [Ni, fL, pYe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeQuestionMark",
- n,
- 58,
- [Ni, fL, yDe],
- 16
- /* DeleteSpace */
- ),
- // insert space after '?' only when it is used in conditional operator
- Vn(
- "SpaceAfterQuestionMarkInConditionalOperator",
- 58,
- n,
- [Ni, eYe],
- 4
- /* InsertSpace */
- ),
- // in other cases there should be no space between '?' and next token
- Vn(
- "NoSpaceAfterQuestionMark",
- 58,
- n,
- [Ni, KQe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeDot",
- n,
- [
- 25,
- 29
- /* QuestionDotToken */
- ],
- [Ni, EYe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterDot",
- [
- 25,
- 29
- /* QuestionDotToken */
- ],
- n,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBetweenImportParenInImportType",
- 102,
- 21,
- [Ni, _Ye],
- 16
- /* DeleteSpace */
- ),
- // Special handling of unary operators.
- // Prefix operators generally shouldn't have a space between
- // them and their target unary expression.
- Vn(
- "NoSpaceAfterUnaryPrefixOperator",
- u,
- d,
- [Ni, fL],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterUnaryPreincrementOperator",
- 46,
- g,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterUnaryPredecrementOperator",
- 47,
- S,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeUnaryPostincrementOperator",
- h,
- 46,
- [Ni, FDe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeUnaryPostdecrementOperator",
- T,
- 47,
- [Ni, FDe],
- 16
- /* DeleteSpace */
- ),
- // More unary operator special-casing.
- // DevDiv 181814: Be careful when removing leading whitespace
- // around unary operators. Examples:
- // 1 - -2 --X--> 1--2
- // a + ++b --X--> a+++b
- Vn(
- "SpaceAfterPostincrementWhenFollowedByAdd",
- 46,
- 40,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterAddWhenFollowedByUnaryPlus",
- 40,
- 40,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterAddWhenFollowedByPreincrement",
- 40,
- 46,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterPostdecrementWhenFollowedBySubtract",
- 47,
- 41,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterSubtractWhenFollowedByUnaryMinus",
- 41,
- 41,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterSubtractWhenFollowedByPredecrement",
- 41,
- 47,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterCloseBrace",
- 20,
- [
- 28,
- 27
- /* SemicolonToken */
- ],
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // For functions and control block place } on a new line [multi-line rule]
- Vn(
- "NewLineBeforeCloseBraceInBlockContext",
- i,
- 20,
- [bDe],
- 8
- /* InsertNewLine */
- ),
- // Space/new line after }.
- Vn(
- "SpaceAfterCloseBrace",
- 20,
- t(
- 22
- /* CloseParenToken */
- ),
- [Ni, nYe],
- 4
- /* InsertSpace */
- ),
- // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied
- // Also should not apply to })
- Vn(
- "SpaceBetweenCloseBraceAndElse",
- 20,
- 93,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBetweenCloseBraceAndWhile",
- 20,
- 117,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenEmptyBraceBrackets",
- 19,
- 20,
- [Ni, EDe],
- 16
- /* DeleteSpace */
- ),
- // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];'
- Vn(
- "SpaceAfterConditionalClosingParen",
- 22,
- 23,
- [pL],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenFunctionKeywordAndStar",
- 100,
- 42,
- [xDe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceAfterStarInGeneratorDeclaration",
- 42,
- 80,
- [xDe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterFunctionInFuncDecl",
- 100,
- n,
- [RS],
- 4
- /* InsertSpace */
- ),
- // Insert new line after { and before } in multi-line contexts.
- Vn(
- "NewLineAfterOpenBraceInBlockContext",
- 19,
- n,
- [bDe],
- 8
- /* InsertNewLine */
- ),
- // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token.
- // Though, we do extra check on the context to make sure we are dealing with get/set node. Example:
- // get x() {}
- // set x(val) {}
- Vn(
- "SpaceAfterGetSetInMember",
- [
- 139,
- 153
- /* SetKeyword */
- ],
- 80,
- [RS],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenYieldKeywordAndStar",
- 127,
- 42,
- [Ni, ODe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceBetweenYieldOrYieldStarAndOperand",
- [
- 127,
- 42
- /* AsteriskToken */
- ],
- n,
- [Ni, ODe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenReturnAndSemicolon",
- 107,
- 27,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceAfterCertainKeywords",
- [
- 115,
- 111,
- 105,
- 91,
- 107,
- 114,
- 135
- /* AwaitKeyword */
- ],
- n,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterLetConstInVariableDeclaration",
- [
- 121,
- 87
- /* ConstKeyword */
- ],
- n,
- [Ni, gYe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeOpenParenInFuncCall",
- n,
- 21,
- [Ni, aYe, oYe],
- 16
- /* DeleteSpace */
- ),
- // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options.
- Vn(
- "SpaceBeforeBinaryKeywordOperator",
- n,
- _,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterBinaryKeywordOperator",
- _,
- n,
- [Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterVoidOperator",
- 116,
- n,
- [Ni, SYe],
- 4
- /* InsertSpace */
- ),
- // Async-await
- Vn(
- "SpaceBetweenAsyncAndOpenParen",
- 134,
- 21,
- [uYe, Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBetweenAsyncAndFunctionKeyword",
- 134,
- [
- 100,
- 80
- /* Identifier */
- ],
- [Ni],
- 4
- /* InsertSpace */
- ),
- // Template string
- Vn(
- "NoSpaceBetweenTagAndTemplateString",
- [
- 80,
- 22
- /* CloseParenToken */
- ],
- [
- 15,
- 16
- /* TemplateHead */
- ],
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // JSX opening elements
- Vn(
- "SpaceBeforeJsxAttribute",
- n,
- 80,
- [fYe, Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeSlashInJsxOpeningElement",
- n,
- 44,
- [ADe, Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",
- 44,
- 32,
- [ADe, Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeEqualInJsxAttribute",
- n,
- 64,
- [PDe, Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterEqualInJsxAttribute",
- 64,
- n,
- [PDe, Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeJsxNamespaceColon",
- 80,
- 59,
- [wDe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterJsxNamespaceColon",
- 59,
- 80,
- [wDe],
- 16
- /* DeleteSpace */
- ),
- // TypeScript-specific rules
- // Use of module as a function call. e.g.: import m2 = module("m2");
- Vn(
- "NoSpaceAfterModuleImport",
- [
- 144,
- 149
- /* RequireKeyword */
- ],
- 21,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // Add a space around certain TypeScript keywords
- Vn(
- "SpaceAfterCertainTypeScriptKeywords",
- [
- 128,
- 129,
- 86,
- 138,
- 90,
- 94,
- 95,
- 96,
- 139,
- 119,
- 102,
- 120,
- 144,
- 145,
- 123,
- 125,
- 124,
- 148,
- 153,
- 126,
- 156,
- 161,
- 143,
- 140
- /* InferKeyword */
- ],
- n,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeCertainTypeScriptKeywords",
- n,
- [
- 96,
- 119,
- 161
- /* FromKeyword */
- ],
- [Ni],
- 4
- /* InsertSpace */
- ),
- // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" {
- Vn(
- "SpaceAfterModuleName",
- 11,
- 19,
- [hYe],
- 4
- /* InsertSpace */
- ),
- // Lambda expressions
- Vn(
- "SpaceBeforeArrow",
- n,
- 39,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterArrow",
- 39,
- n,
- [Ni],
- 4
- /* InsertSpace */
- ),
- // Optional parameters and let args
- Vn(
- "NoSpaceAfterEllipsis",
- 26,
- 80,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterOptionalParameters",
- 58,
- [
- 22,
- 28
- /* CommaToken */
- ],
- [Ni, fL],
- 16
- /* DeleteSpace */
- ),
- // Remove spaces in empty interface literals. e.g.: x: {}
- Vn(
- "NoSpaceBetweenEmptyInterfaceBraceBrackets",
- 19,
- 20,
- [Ni, yYe],
- 16
- /* DeleteSpace */
- ),
- // generics and type assertions
- Vn(
- "NoSpaceBeforeOpenAngularBracket",
- D,
- 30,
- [Ni, dL],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBetweenCloseParenAndAngularBracket",
- 22,
- 30,
- [Ni, dL],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterOpenAngularBracket",
- 30,
- n,
- [Ni, dL],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeCloseAngularBracket",
- n,
- 32,
- [Ni, dL],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterCloseAngularBracket",
- 32,
- [
- 21,
- 23,
- 32,
- 28
- /* CommaToken */
- ],
- [
- Ni,
- dL,
- rYe,
- /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/
- bYe
- ],
- 16
- /* DeleteSpace */
- ),
- // decorators
- Vn(
- "SpaceBeforeAt",
- [
- 22,
- 80
- /* Identifier */
- ],
- 60,
- [Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterAt",
- 60,
- n,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // Insert space after @ in decorator
- Vn(
- "SpaceAfterDecorator",
- n,
- [
- 128,
- 80,
- 95,
- 90,
- 86,
- 126,
- 125,
- 123,
- 124,
- 139,
- 153,
- 23,
- 42
- /* AsteriskToken */
- ],
- [mYe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeNonNullAssertionOperator",
- n,
- 54,
- [Ni, TYe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterNewKeywordOnConstructorSignature",
- 105,
- 21,
- [Ni, vYe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceLessThanAndNonJSXTypeAnnotation",
- 30,
- 30,
- [Ni],
- 4
- /* InsertSpace */
- )
- ], B = [
- // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses
- Vn(
- "SpaceAfterConstructor",
- 137,
- 21,
- [zf("insertSpaceAfterConstructor"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterConstructor",
- 137,
- 21,
- [Pm("insertSpaceAfterConstructor"), Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceAfterComma",
- 28,
- n,
- [zf("insertSpaceAfterCommaDelimiter"), Ni, bue, cYe, lYe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterComma",
- 28,
- n,
- [Pm("insertSpaceAfterCommaDelimiter"), Ni, bue],
- 16
- /* DeleteSpace */
- ),
- // Insert space after function keyword for anonymous functions
- Vn(
- "SpaceAfterAnonymousFunctionKeyword",
- [
- 100,
- 42
- /* AsteriskToken */
- ],
- 21,
- [zf("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), RS],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterAnonymousFunctionKeyword",
- [
- 100,
- 42
- /* AsteriskToken */
- ],
- 21,
- [Pm("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), RS],
- 16
- /* DeleteSpace */
- ),
- // Insert space after keywords in control flow statements
- Vn(
- "SpaceAfterKeywordInControl",
- o,
- 21,
- [zf("insertSpaceAfterKeywordsInControlFlowStatements"), pL],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterKeywordInControl",
- o,
- 21,
- [Pm("insertSpaceAfterKeywordsInControlFlowStatements"), pL],
- 16
- /* DeleteSpace */
- ),
- // Insert space after opening and before closing nonempty parenthesis
- Vn(
- "SpaceAfterOpenParen",
- 21,
- n,
- [zf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeCloseParen",
- n,
- 22,
- [zf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBetweenOpenParens",
- 21,
- 21,
- [zf("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenParens",
- 21,
- 22,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterOpenParen",
- 21,
- n,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeCloseParen",
- n,
- 22,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), Ni],
- 16
- /* DeleteSpace */
- ),
- // Insert space after opening and before closing nonempty brackets
- Vn(
- "SpaceAfterOpenBracket",
- 23,
- n,
- [zf("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeCloseBracket",
- n,
- 24,
- [zf("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenBrackets",
- 23,
- 24,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterOpenBracket",
- 23,
- n,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeCloseBracket",
- n,
- 24,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), Ni],
- 16
- /* DeleteSpace */
- ),
- // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}.
- Vn(
- "SpaceAfterOpenBrace",
- 19,
- n,
- [hDe("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), vDe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeCloseBrace",
- n,
- 20,
- [hDe("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), vDe],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenEmptyBraceBrackets",
- 19,
- 20,
- [Ni, EDe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterOpenBrace",
- 19,
- n,
- [due("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeCloseBrace",
- n,
- 20,
- [due("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), Ni],
- 16
- /* DeleteSpace */
- ),
- // Insert a space after opening and before closing empty brace brackets
- Vn(
- "SpaceBetweenEmptyBraceBrackets",
- 19,
- 20,
- [zf("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBetweenEmptyBraceBrackets",
- 19,
- 20,
- [due("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), Ni],
- 16
- /* DeleteSpace */
- ),
- // Insert space after opening and before closing template string braces
- Vn(
- "SpaceAfterTemplateHeadAndMiddle",
- [
- 16,
- 17
- /* TemplateMiddle */
- ],
- n,
- [zf("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), DDe],
- 4,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "SpaceBeforeTemplateMiddleAndTail",
- n,
- [
- 17,
- 18
- /* TemplateTail */
- ],
- [zf("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Ni],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterTemplateHeadAndMiddle",
- [
- 16,
- 17
- /* TemplateMiddle */
- ],
- n,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), DDe],
- 16,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "NoSpaceBeforeTemplateMiddleAndTail",
- n,
- [
- 17,
- 18
- /* TemplateTail */
- ],
- [Pm("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), Ni],
- 16
- /* DeleteSpace */
- ),
- // No space after { and before } in JSX expression
- Vn(
- "SpaceAfterOpenBraceInJsxExpression",
- 19,
- n,
- [zf("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Ni, AH],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceBeforeCloseBraceInJsxExpression",
- n,
- 20,
- [zf("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Ni, AH],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterOpenBraceInJsxExpression",
- 19,
- n,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Ni, AH],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceBeforeCloseBraceInJsxExpression",
- n,
- 20,
- [Pm("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), Ni, AH],
- 16
- /* DeleteSpace */
- ),
- // Insert space after semicolon in for statement
- Vn(
- "SpaceAfterSemicolonInFor",
- 27,
- n,
- [zf("insertSpaceAfterSemicolonInForStatements"), Ni, gue],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterSemicolonInFor",
- 27,
- n,
- [Pm("insertSpaceAfterSemicolonInForStatements"), Ni, gue],
- 16
- /* DeleteSpace */
- ),
- // Insert space before and after binary operators
- Vn(
- "SpaceBeforeBinaryOperator",
- n,
- c,
- [zf("insertSpaceBeforeAndAfterBinaryOperators"), Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "SpaceAfterBinaryOperator",
- c,
- n,
- [zf("insertSpaceBeforeAndAfterBinaryOperators"), Ni, r1],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeBinaryOperator",
- n,
- c,
- [Pm("insertSpaceBeforeAndAfterBinaryOperators"), Ni, r1],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterBinaryOperator",
- c,
- n,
- [Pm("insertSpaceBeforeAndAfterBinaryOperators"), Ni, r1],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceBeforeOpenParenInFuncDecl",
- n,
- 21,
- [zf("insertSpaceBeforeFunctionParenthesis"), Ni, RS],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeOpenParenInFuncDecl",
- n,
- 21,
- [Pm("insertSpaceBeforeFunctionParenthesis"), Ni, RS],
- 16
- /* DeleteSpace */
- ),
- // Open Brace braces after control block
- Vn(
- "NewLineBeforeOpenBraceInControl",
- F,
- 19,
- [zf("placeOpenBraceOnNewLineForControlBlocks"), pL, vue],
- 8,
- 1
- /* CanDeleteNewLines */
- ),
- // Open Brace braces after function
- // TypeScript: Function can have return types, which can be made of tons of different token kinds
- Vn(
- "NewLineBeforeOpenBraceInFunction",
- P,
- 19,
- [zf("placeOpenBraceOnNewLineForFunctions"), RS, vue],
- 8,
- 1
- /* CanDeleteNewLines */
- ),
- // Open Brace braces after TypeScript module/class/interface
- Vn(
- "NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",
- I,
- 19,
- [zf("placeOpenBraceOnNewLineForFunctions"), kDe, vue],
- 8,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "SpaceAfterTypeAssertion",
- 32,
- n,
- [zf("insertSpaceAfterTypeAssertion"), Ni, Tue],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceAfterTypeAssertion",
- 32,
- n,
- [Pm("insertSpaceAfterTypeAssertion"), Ni, Tue],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceBeforeTypeAnnotation",
- n,
- [
- 58,
- 59
- /* ColonToken */
- ],
- [zf("insertSpaceBeforeTypeAnnotation"), Ni, hue],
- 4
- /* InsertSpace */
- ),
- Vn(
- "NoSpaceBeforeTypeAnnotation",
- n,
- [
- 58,
- 59
- /* ColonToken */
- ],
- [Pm("insertSpaceBeforeTypeAnnotation"), Ni, hue],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoOptionalSemicolon",
- 27,
- s,
- [gDe(
- "semicolons",
- "remove"
- /* Remove */
- ), kYe],
- 32
- /* DeleteToken */
- ),
- Vn(
- "OptionalSemicolon",
- n,
- s,
- [gDe(
- "semicolons",
- "insert"
- /* Insert */
- ), CYe],
- 64
- /* InsertTrailingSemicolon */
- )
- ], z = [
- // Space after keyword but not before ; or : or ?
- Vn(
- "NoSpaceBeforeSemicolon",
- n,
- 27,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceBeforeOpenBraceInControl",
- F,
- 19,
- [mue("placeOpenBraceOnNewLineForControlBlocks"), pL, Sue, yue],
- 4,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "SpaceBeforeOpenBraceInFunction",
- P,
- 19,
- [mue("placeOpenBraceOnNewLineForFunctions"), RS, wH, Sue, yue],
- 4,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",
- I,
- 19,
- [mue("placeOpenBraceOnNewLineForFunctions"), kDe, Sue, yue],
- 4,
- 1
- /* CanDeleteNewLines */
- ),
- Vn(
- "NoSpaceBeforeComma",
- n,
- 28,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // No space before and after indexer `x[]`
- Vn(
- "NoSpaceBeforeOpenBracket",
- t(
- 134,
- 84
- /* CaseKeyword */
- ),
- 23,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "NoSpaceAfterCloseBracket",
- 24,
- n,
- [Ni, dYe],
- 16
- /* DeleteSpace */
- ),
- Vn(
- "SpaceAfterSemicolon",
- 27,
- n,
- [Ni],
- 4
- /* InsertSpace */
- ),
- // Remove extra space between for and await
- Vn(
- "SpaceBetweenForAndAwaitKeyword",
- 99,
- 135,
- [Ni],
- 4
- /* InsertSpace */
- ),
- // Remove extra spaces between ... and type name in tuple spread
- Vn(
- "SpaceBetweenDotDotDotAndTypeName",
- 26,
- D,
- [Ni],
- 16
- /* DeleteSpace */
- ),
- // Add a space between statements. All keywords except (do,else,case) has open/close parens after them.
- // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any]
- Vn(
- "SpaceBetweenStatements",
- [
- 22,
- 92,
- 93,
- 84
- /* CaseKeyword */
- ],
- n,
- [Ni, bue, YQe],
- 4
- /* InsertSpace */
- ),
- // This low-pri rule takes care of "try {", "catch {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
- Vn(
- "SpaceAfterTryCatchFinally",
- [
- 113,
- 85,
- 98
- /* FinallyKeyword */
- ],
- 19,
- [Ni],
- 4
- /* InsertSpace */
- )
- ];
- return [
- ...O,
- ...B,
- ...z
- ];
- }
- function Vn(e, t, n, i, s, o = 0) {
- return { leftTokenRange: dDe(t), rightTokenRange: dDe(n), rule: { debugName: e, context: i, action: s, flags: o } };
- }
- function pP(e) {
- return { tokens: e, isSpecific: !0 };
- }
- function dDe(e) {
- return typeof e == "number" ? pP([e]) : us(e) ? pP(e) : e;
- }
- function mDe(e, t, n = []) {
- const i = [];
- for (let s = e; s <= t; s++)
- ss(n, s) || i.push(s);
- return pP(i);
- }
- function gDe(e, t) {
- return (n) => n.options && n.options[e] === t;
- }
- function zf(e) {
- return (t) => t.options && co(t.options, e) && !!t.options[e];
- }
- function due(e) {
- return (t) => t.options && co(t.options, e) && !t.options[e];
- }
- function Pm(e) {
- return (t) => !t.options || !co(t.options, e) || !t.options[e];
- }
- function mue(e) {
- return (t) => !t.options || !co(t.options, e) || !t.options[e] || t.TokensAreOnSameLine();
- }
- function hDe(e) {
- return (t) => !t.options || !co(t.options, e) || !!t.options[e];
- }
- function gue(e) {
- return e.contextNode.kind === 248;
- }
- function YQe(e) {
- return !gue(e);
- }
- function r1(e) {
- switch (e.contextNode.kind) {
- case 226:
- return e.contextNode.operatorToken.kind !== 28;
- case 227:
- case 194:
- case 234:
- case 281:
- case 276:
- case 182:
- case 192:
- case 193:
- case 238:
- return !0;
- case 208:
- case 265:
- case 271:
- case 277:
- case 260:
- case 169:
- case 306:
- case 172:
- case 171:
- return e.currentTokenSpan.kind === 64 || e.nextTokenSpan.kind === 64;
- case 249:
- case 168:
- return e.currentTokenSpan.kind === 103 || e.nextTokenSpan.kind === 103 || e.currentTokenSpan.kind === 64 || e.nextTokenSpan.kind === 64;
- case 250:
- return e.currentTokenSpan.kind === 165 || e.nextTokenSpan.kind === 165;
- }
- return !1;
- }
- function fL(e) {
- return !r1(e);
- }
- function yDe(e) {
- return !hue(e);
- }
- function hue(e) {
- const t = e.contextNode.kind;
- return t === 172 || t === 171 || t === 169 || t === 260 || WT(t);
- }
- function ZQe(e) {
- return cs(e.contextNode) && e.contextNode.questionToken;
- }
- function KQe(e) {
- return !ZQe(e);
- }
- function eYe(e) {
- return e.contextNode.kind === 227 || e.contextNode.kind === 194;
- }
- function yue(e) {
- return e.TokensAreOnSameLine() || wH(e);
- }
- function vDe(e) {
- return e.contextNode.kind === 206 || e.contextNode.kind === 200 || tYe(e);
- }
- function vue(e) {
- return wH(e) && !(e.NextNodeAllOnSameLine() || e.NextNodeBlockIsOnOneLine());
- }
- function bDe(e) {
- return SDe(e) && !(e.ContextNodeAllOnSameLine() || e.ContextNodeBlockIsOnOneLine());
- }
- function tYe(e) {
- return SDe(e) && (e.ContextNodeAllOnSameLine() || e.ContextNodeBlockIsOnOneLine());
- }
- function SDe(e) {
- return TDe(e.contextNode);
- }
- function wH(e) {
- return TDe(e.nextTokenParent);
- }
- function TDe(e) {
- if (CDe(e))
- return !0;
- switch (e.kind) {
- case 241:
- case 269:
- case 210:
- case 268:
- return !0;
- }
- return !1;
- }
- function RS(e) {
- switch (e.contextNode.kind) {
- case 262:
- case 174:
- case 173:
- case 177:
- case 178:
- case 179:
- case 218:
- case 176:
- case 219:
- case 264:
- return !0;
- }
- return !1;
- }
- function rYe(e) {
- return !RS(e);
- }
- function xDe(e) {
- return e.contextNode.kind === 262 || e.contextNode.kind === 218;
- }
- function kDe(e) {
- return CDe(e.contextNode);
- }
- function CDe(e) {
- switch (e.kind) {
- case 263:
- case 231:
- case 264:
- case 266:
- case 187:
- case 267:
- case 278:
- case 279:
- case 272:
- case 275:
- return !0;
- }
- return !1;
- }
- function nYe(e) {
- switch (e.currentTokenParent.kind) {
- case 263:
- case 267:
- case 266:
- case 299:
- case 268:
- case 255:
- return !0;
- case 241: {
- const t = e.currentTokenParent.parent;
- if (!t || t.kind !== 219 && t.kind !== 218)
- return !0;
- }
- }
- return !1;
- }
- function pL(e) {
- switch (e.contextNode.kind) {
- case 245:
- case 255:
- case 248:
- case 249:
- case 250:
- case 247:
- case 258:
- case 246:
- case 254:
- case 299:
- return !0;
- default:
- return !1;
- }
- }
- function EDe(e) {
- return e.contextNode.kind === 210;
- }
- function iYe(e) {
- return e.contextNode.kind === 213;
- }
- function sYe(e) {
- return e.contextNode.kind === 214;
- }
- function aYe(e) {
- return iYe(e) || sYe(e);
- }
- function oYe(e) {
- return e.currentTokenSpan.kind !== 28;
- }
- function cYe(e) {
- return e.nextTokenSpan.kind !== 24;
- }
- function lYe(e) {
- return e.nextTokenSpan.kind !== 22;
- }
- function uYe(e) {
- return e.contextNode.kind === 219;
- }
- function _Ye(e) {
- return e.contextNode.kind === 205;
- }
- function Ni(e) {
- return e.TokensAreOnSameLine() && e.contextNode.kind !== 12;
- }
- function DDe(e) {
- return e.contextNode.kind !== 12;
- }
- function bue(e) {
- return e.contextNode.kind !== 284 && e.contextNode.kind !== 288;
- }
- function AH(e) {
- return e.contextNode.kind === 294 || e.contextNode.kind === 293;
- }
- function fYe(e) {
- return e.nextTokenParent.kind === 291 || e.nextTokenParent.kind === 295 && e.nextTokenParent.parent.kind === 291;
- }
- function PDe(e) {
- return e.contextNode.kind === 291;
- }
- function pYe(e) {
- return e.nextTokenParent.kind !== 295;
- }
- function wDe(e) {
- return e.nextTokenParent.kind === 295;
- }
- function ADe(e) {
- return e.contextNode.kind === 285;
- }
- function dYe(e) {
- return !RS(e) && !wH(e);
- }
- function mYe(e) {
- return e.TokensAreOnSameLine() && Ff(e.contextNode) && NDe(e.currentTokenParent) && !NDe(e.nextTokenParent);
- }
- function NDe(e) {
- for (; e && _t(e); )
- e = e.parent;
- return e && e.kind === 170;
- }
- function gYe(e) {
- return e.currentTokenParent.kind === 261 && e.currentTokenParent.getStart(e.sourceFile) === e.currentTokenSpan.pos;
- }
- function Sue(e) {
- return e.formattingRequestKind !== 2;
- }
- function hYe(e) {
- return e.contextNode.kind === 267;
- }
- function yYe(e) {
- return e.contextNode.kind === 187;
- }
- function vYe(e) {
- return e.contextNode.kind === 180;
- }
- function IDe(e, t) {
- if (e.kind !== 30 && e.kind !== 32)
- return !1;
- switch (t.kind) {
- case 183:
- case 216:
- case 265:
- case 263:
- case 231:
- case 264:
- case 262:
- case 218:
- case 219:
- case 174:
- case 173:
- case 179:
- case 180:
- case 213:
- case 214:
- case 233:
- return !0;
- default:
- return !1;
- }
- }
- function dL(e) {
- return IDe(e.currentTokenSpan, e.currentTokenParent) || IDe(e.nextTokenSpan, e.nextTokenParent);
- }
- function Tue(e) {
- return e.contextNode.kind === 216;
- }
- function bYe(e) {
- return !Tue(e);
- }
- function SYe(e) {
- return e.currentTokenSpan.kind === 116 && e.currentTokenParent.kind === 222;
- }
- function ODe(e) {
- return e.contextNode.kind === 229 && e.contextNode.expression !== void 0;
- }
- function TYe(e) {
- return e.contextNode.kind === 235;
- }
- function FDe(e) {
- return !xYe(e);
- }
- function xYe(e) {
- switch (e.contextNode.kind) {
- case 245:
- case 248:
- case 249:
- case 250:
- case 246:
- case 247:
- return !0;
- default:
- return !1;
- }
- }
- function kYe(e) {
- let t = e.nextTokenSpan.kind, n = e.nextTokenSpan.pos;
- if (PC(t)) {
- const o = e.nextTokenParent === e.currentTokenParent ? Zb(
- e.currentTokenParent,
- or(e.currentTokenParent, (c) => !c.parent),
- e.sourceFile
- ) : e.nextTokenParent.getFirstToken(e.sourceFile);
- if (!o)
- return !0;
- t = o.kind, n = o.getStart(e.sourceFile);
- }
- const i = e.sourceFile.getLineAndCharacterOfPosition(e.currentTokenSpan.pos).line, s = e.sourceFile.getLineAndCharacterOfPosition(n).line;
- return i === s ? t === 20 || t === 1 : t === 240 || t === 27 ? !1 : e.contextNode.kind === 264 || e.contextNode.kind === 265 ? !m_(e.currentTokenParent) || !!e.currentTokenParent.type || t !== 21 : cs(e.currentTokenParent) ? !e.currentTokenParent.initializer : e.currentTokenParent.kind !== 248 && e.currentTokenParent.kind !== 242 && e.currentTokenParent.kind !== 240 && t !== 23 && t !== 21 && t !== 40 && t !== 41 && t !== 44 && t !== 14 && t !== 28 && t !== 228 && t !== 16 && t !== 15 && t !== 25;
- }
- function CYe(e) {
- return f9(e.currentTokenSpan.end, e.currentTokenParent, e.sourceFile);
- }
- function EYe(e) {
- return !Cn(e.contextNode) || !d_(e.contextNode.expression) || e.contextNode.expression.getText().includes(".");
- }
- function DYe(e, t) {
- return { options: e, getRules: PYe(), host: t };
- }
- var xue;
- function PYe() {
- return xue === void 0 && (xue = AYe(pDe())), xue;
- }
- function wYe(e) {
- let t = 0;
- return e & 1 && (t |= 28), e & 2 && (t |= 96), e & 28 && (t |= 28), e & 96 && (t |= 96), t;
- }
- function AYe(e) {
- const t = NYe(e);
- return (n) => {
- const i = t[LDe(n.currentTokenSpan.kind, n.nextTokenSpan.kind)];
- if (i) {
- const s = [];
- let o = 0;
- for (const c of i) {
- const _ = ~wYe(o);
- c.action & _ && Mi(c.context, (u) => u(n)) && (s.push(c), o |= c.action);
- }
- if (s.length)
- return s;
- }
- };
- }
- function NYe(e) {
- const t = new Array(kue * kue), n = new Array(t.length);
- for (const i of e) {
- const s = i.leftTokenRange.isSpecific && i.rightTokenRange.isSpecific;
- for (const o of i.leftTokenRange.tokens)
- for (const c of i.rightTokenRange.tokens) {
- const _ = LDe(o, c);
- let u = t[_];
- u === void 0 && (u = t[_] = []), IYe(u, i.rule, s, n, _);
- }
- }
- return t;
- }
- function LDe(e, t) {
- return E.assert(e <= 165 && t <= 165, "Must compute formatting context from tokens"), e * kue + t;
- }
- var dP = 5, NH = 31, kue = 166, X8 = ((e) => (e[e.StopRulesSpecific = 0] = "StopRulesSpecific", e[e.StopRulesAny = dP * 1] = "StopRulesAny", e[e.ContextRulesSpecific = dP * 2] = "ContextRulesSpecific", e[e.ContextRulesAny = dP * 3] = "ContextRulesAny", e[e.NoContextRulesSpecific = dP * 4] = "NoContextRulesSpecific", e[e.NoContextRulesAny = dP * 5] = "NoContextRulesAny", e))(X8 || {});
- function IYe(e, t, n, i, s) {
- const o = t.action & 3 ? n ? 0 : X8.StopRulesAny : t.context !== PH ? n ? X8.ContextRulesSpecific : X8.ContextRulesAny : n ? X8.NoContextRulesSpecific : X8.NoContextRulesAny, c = i[s] || 0;
- e.splice(OYe(c, o), 0, t), i[s] = FYe(c, o);
- }
- function OYe(e, t) {
- let n = 0;
- for (let i = 0; i <= t; i += dP)
- n += e & NH, e >>= dP;
- return n;
- }
- function FYe(e, t) {
- const n = (e >> t & NH) + 1;
- return E.assert((n & NH) === n, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."), e & ~(NH << t) | n << t;
- }
- function IH(e, t, n) {
- const i = { pos: e, end: t, kind: n };
- return E.isDebugging && Object.defineProperty(i, "__debugKind", {
- get: () => E.formatSyntaxKind(n)
- }), i;
- }
- function LYe(e, t, n) {
- const i = t.getLineAndCharacterOfPosition(e).line;
- if (i === 0)
- return [];
- let s = jw(i, t);
- for (; sm(t.text.charCodeAt(s)); )
- s--;
- gu(t.text.charCodeAt(s)) && s--;
- const o = {
- // get start position for the previous line
- pos: Iy(i - 1, t),
- // end value is exclusive so add 1 to the result
- end: s + 1
- };
- return mL(
- o,
- t,
- n,
- 2
- /* FormatOnEnter */
- );
- }
- function MYe(e, t, n) {
- const i = Cue(e, 27, t);
- return MDe(
- Eue(i),
- t,
- n,
- 3
- /* FormatOnSemicolon */
- );
- }
- function RYe(e, t, n) {
- const i = Cue(e, 19, t);
- if (!i)
- return [];
- const s = i.parent, o = Eue(s), c = {
- pos: $p(o.getStart(t), t),
- // TODO: GH#18217
- end: e
- };
- return mL(
- c,
- t,
- n,
- 4
- /* FormatOnOpeningCurlyBrace */
- );
- }
- function jYe(e, t, n) {
- const i = Cue(e, 20, t);
- return MDe(
- Eue(i),
- t,
- n,
- 5
- /* FormatOnClosingCurlyBrace */
- );
- }
- function BYe(e, t) {
- const n = {
- pos: 0,
- end: e.text.length
- };
- return mL(
- n,
- e,
- t,
- 0
- /* FormatDocument */
- );
- }
- function JYe(e, t, n, i) {
- const s = {
- pos: $p(e, n),
- end: t
- };
- return mL(
- s,
- n,
- i,
- 1
- /* FormatSelection */
- );
- }
- function Cue(e, t, n) {
- const i = sl(e, n);
- return i && i.kind === t && e === i.getEnd() ? i : void 0;
- }
- function Eue(e) {
- let t = e;
- for (; t && t.parent && t.parent.end === e.end && !zYe(t.parent, t); )
- t = t.parent;
- return t;
- }
- function zYe(e, t) {
- switch (e.kind) {
- case 263:
- case 264:
- return nf(e.members, t);
- case 267:
- const n = e.body;
- return !!n && n.kind === 268 && nf(n.statements, t);
- case 307:
- case 241:
- case 268:
- return nf(e.statements, t);
- case 299:
- return nf(e.block.statements, t);
- }
- return !1;
- }
- function WYe(e, t) {
- return n(t);
- function n(i) {
- const s = bs(i, (o) => GU(o.getStart(t), o.end, e) && o);
- if (s) {
- const o = n(s);
- if (o)
- return o;
- }
- return i;
- }
- }
- function UYe(e, t) {
- if (!e.length)
- return s;
- const n = e.filter((o) => qD(t, o.start, o.start + o.length)).sort((o, c) => o.start - c.start);
- if (!n.length)
- return s;
- let i = 0;
- return (o) => {
- for (; ; ) {
- if (i >= n.length)
- return !1;
- const c = n[i];
- if (o.end <= c.start)
- return !1;
- if (HF(o.pos, o.end, c.start, c.start + c.length))
- return !0;
- i++;
- }
- };
- function s() {
- return !1;
- }
- }
- function VYe(e, t, n) {
- const i = e.getStart(n);
- if (i === t.pos && e.end === t.end)
- return i;
- const s = sl(t.pos, n);
- return !s || s.end >= t.pos ? e.pos : s.end;
- }
- function qYe(e, t, n) {
- let i = -1, s;
- for (; e; ) {
- const o = n.getLineAndCharacterOfPosition(e.getStart(n)).line;
- if (i !== -1 && o !== i)
- break;
- if (wm.shouldIndentChildNode(t, e, s, n))
- return t.indentSize;
- i = o, s = e, e = e.parent;
- }
- return 0;
- }
- function HYe(e, t, n, i, s, o) {
- const c = { pos: e.pos, end: e.end };
- return pue(t.text, n, c.pos, c.end, (_) => RDe(
- c,
- e,
- i,
- s,
- _,
- o,
- 1,
- (u) => !1,
- // assume that node does not have any errors
- t
- ));
- }
- function MDe(e, t, n, i) {
- if (!e)
- return [];
- const s = {
- pos: $p(e.getStart(t), t),
- end: e.end
- };
- return mL(s, t, n, i);
- }
- function mL(e, t, n, i) {
- const s = WYe(e, t);
- return pue(
- t.text,
- t.languageVariant,
- VYe(s, e, t),
- e.end,
- (o) => RDe(
- e,
- s,
- wm.getIndentationForNode(s, e, t, n.options),
- qYe(s, n.options, t),
- o,
- n,
- i,
- UYe(t.parseDiagnostics, e),
- t
- )
- );
- }
- function RDe(e, t, n, i, s, { options: o, getRules: c, host: _ }, u, d, g) {
- var h;
- const S = new uDe(g, u, o);
- let T, C, D, P, I, F = -1;
- const O = [];
- if (s.advance(), s.isOnToken()) {
- const we = g.getLineAndCharacterOfPosition(t.getStart(g)).line;
- let fe = we;
- Ff(t) && (fe = g.getLineAndCharacterOfPosition(jj(t, g)).line), ae(t, t, we, fe, n, i);
- }
- const B = s.getCurrentLeadingTrivia();
- if (B) {
- const we = wm.nodeWillIndentChild(
- o,
- t,
- /*child*/
- void 0,
- g,
- /*indentByDefault*/
- !1
- ) ? n + o.indentSize : n;
- ee(
- B,
- we,
- /*indentNextTokenOrTrivia*/
- !0,
- (fe) => {
- ue(
- fe,
- g.getLineAndCharacterOfPosition(fe.pos),
- t,
- t,
- /*dynamicIndentation*/
- void 0
- ), ne(
- fe.pos,
- we,
- /*lineAdded*/
- !1
- );
- }
- ), o.trimTrailingWhitespace !== !1 && he(B);
- }
- if (C && s.getTokenFullStart() >= e.end) {
- const we = s.isOnEOF() ? s.readEOFTokenRange() : s.isOnToken() ? s.readTokenInfo(t).token : void 0;
- if (we && we.pos === T) {
- const fe = ((h = sl(we.end, g, t)) == null ? void 0 : h.parent) || D;
- re(
- we,
- g.getLineAndCharacterOfPosition(we.pos).line,
- fe,
- C,
- P,
- D,
- fe,
- /*dynamicIndentation*/
- void 0
- );
- }
- }
- return O;
- function z(we, fe, Me, Qe, et) {
- if (qD(Qe, we, fe) || t8(Qe, we, fe)) {
- if (et !== -1)
- return et;
- } else {
- const Re = g.getLineAndCharacterOfPosition(we).line, ft = $p(we, g), Wt = wm.findFirstNonWhitespaceColumn(ft, we, g, o);
- if (Re !== Me || we === Wt) {
- const _r = wm.getBaseIndentation(o);
- return _r > Wt ? _r : Wt;
- }
- }
- return -1;
- }
- function X(we, fe, Me, Qe, et, Re) {
- const ft = wm.shouldIndentChildNode(o, we) ? o.indentSize : 0;
- return Re === fe ? {
- indentation: fe === I ? F : et.getIndentation(),
- delta: Math.min(o.indentSize, et.getDelta(we) + ft)
- } : Me === -1 ? we.kind === 21 && fe === I ? { indentation: F, delta: et.getDelta(we) } : wm.childStartsOnTheSameLineWithElseInIfStatement(Qe, we, fe, g) || wm.childIsUnindentedBranchOfConditionalExpression(Qe, we, fe, g) || wm.argumentStartsOnSameLineAsPreviousArgument(Qe, we, fe, g) ? { indentation: et.getIndentation(), delta: ft } : { indentation: et.getIndentation() + et.getDelta(we), delta: ft } : { indentation: Me, delta: ft };
- }
- function q(we) {
- if (Hp(we)) {
- const fe = On(we.modifiers, ra, ac(we.modifiers, dl));
- if (fe) return fe.kind;
- }
- switch (we.kind) {
- case 263:
- return 86;
- case 264:
- return 120;
- case 262:
- return 100;
- case 266:
- return 266;
- case 177:
- return 139;
- case 178:
- return 153;
- case 174:
- if (we.asteriskToken)
- return 42;
- case 172:
- case 169:
- const fe = os(we);
- if (fe)
- return fe.kind;
- }
- }
- function V(we, fe, Me, Qe) {
- return {
- getIndentationForComment: (ft, Wt, _r) => {
- switch (ft) {
- case 20:
- case 24:
- case 22:
- return Me + Re(_r);
- }
- return Wt !== -1 ? Wt : Me;
- },
- // if list end token is LessThanToken '>' then its delta should be explicitly suppressed
- // so that LessThanToken as a binary operator can still be indented.
- // foo.then
- // <
- // number,
- // string,
- // >();
- // vs
- // var a = xValue
- // > yValue;
- getIndentationForToken: (ft, Wt, _r, Ir) => !Ir && et(ft, Wt, _r) ? Me + Re(_r) : Me,
- getIndentation: () => Me,
- getDelta: Re,
- recomputeIndentation: (ft, Wt) => {
- wm.shouldIndentChildNode(o, Wt, we, g) && (Me += ft ? o.indentSize : -o.indentSize, Qe = wm.shouldIndentChildNode(o, we) ? o.indentSize : 0);
- }
- };
- function et(ft, Wt, _r) {
- switch (Wt) {
- case 19:
- case 20:
- case 22:
- case 93:
- case 117:
- case 60:
- return !1;
- case 44:
- case 32:
- switch (_r.kind) {
- case 286:
- case 287:
- case 285:
- return !1;
- }
- break;
- case 23:
- case 24:
- if (_r.kind !== 200)
- return !1;
- break;
- }
- return fe !== ft && !(Ff(we) && Wt === q(we));
- }
- function Re(ft) {
- return wm.nodeWillIndentChild(
- o,
- we,
- ft,
- g,
- /*indentByDefault*/
- !0
- ) ? Qe : 0;
- }
- }
- function ae(we, fe, Me, Qe, et, Re) {
- if (!qD(e, we.getStart(g), we.getEnd()))
- return;
- const ft = V(we, Me, et, Re);
- let Wt = fe;
- for (bs(
- we,
- (Nt) => {
- _r(
- Nt,
- /*inheritedIndentation*/
- -1,
- we,
- ft,
- Me,
- Qe,
- /*isListItem*/
- !1
- );
- },
- (Nt) => {
- Ir(Nt, we, Me, ft);
- }
- ); s.isOnToken() && s.getTokenFullStart() < e.end; ) {
- const Nt = s.readTokenInfo(we);
- if (Nt.token.end > Math.min(we.end, e.end))
- break;
- jr(Nt, we, ft, we);
- }
- function _r(Nt, Qt, Br, xr, zn, ki, rs, ei) {
- if (E.assert(!fo(Nt)), rc(Nt) || nZ(Br, Nt))
- return Qt;
- const Ri = Nt.getStart(g), Jr = g.getLineAndCharacterOfPosition(Ri).line;
- let ji = Jr;
- Ff(Nt) && (ji = g.getLineAndCharacterOfPosition(jj(Nt, g)).line);
- let Fe = -1;
- if (rs && nf(e, Br) && (Fe = z(Ri, Nt.end, zn, e, Qt), Fe !== -1 && (Qt = Fe)), !qD(e, Nt.pos, Nt.end))
- return Nt.end < e.pos && s.skipToEndOf(Nt), Qt;
- if (Nt.getFullWidth() === 0)
- return Qt;
- for (; s.isOnToken() && s.getTokenFullStart() < e.end; ) {
- const mn = s.readTokenInfo(we);
- if (mn.token.end > e.end)
- return Qt;
- if (mn.token.end > Ri) {
- mn.token.pos > Ri && s.skipToStartOf(Nt);
- break;
- }
- jr(mn, we, xr, we);
- }
- if (!s.isOnToken() || s.getTokenFullStart() >= e.end)
- return Qt;
- if (zT(Nt)) {
- const mn = s.readTokenInfo(Nt);
- if (Nt.kind !== 12)
- return E.assert(mn.token.end === Nt.end, "Token end is child end"), jr(mn, we, xr, Nt), Qt;
- }
- const Ot = Nt.kind === 170 ? Jr : ki, Ar = X(Nt, Jr, Fe, we, xr, Ot);
- return ae(Nt, Wt, Jr, ji, Ar.indentation, Ar.delta), Wt = we, ei && Br.kind === 209 && Qt === -1 && (Qt = Ar.indentation), Qt;
- }
- function Ir(Nt, Qt, Br, xr) {
- E.assert(pb(Nt)), E.assert(!fo(Nt));
- const zn = GYe(Qt, Nt);
- let ki = xr, rs = Br;
- if (!qD(e, Nt.pos, Nt.end)) {
- Nt.end < e.pos && s.skipToEndOf(Nt);
- return;
- }
- if (zn !== 0)
- for (; s.isOnToken() && s.getTokenFullStart() < e.end; ) {
- const Jr = s.readTokenInfo(Qt);
- if (Jr.token.end > Nt.pos)
- break;
- if (Jr.token.kind === zn) {
- rs = g.getLineAndCharacterOfPosition(Jr.token.pos).line, jr(Jr, Qt, xr, Qt);
- let ji;
- if (F !== -1)
- ji = F;
- else {
- const Fe = $p(Jr.token.pos, g);
- ji = wm.findFirstNonWhitespaceColumn(Fe, Jr.token.pos, g, o);
- }
- ki = V(Qt, Br, ji, o.indentSize);
- } else
- jr(Jr, Qt, xr, Qt);
- }
- let ei = -1;
- for (let Jr = 0; Jr < Nt.length; Jr++) {
- const ji = Nt[Jr];
- ei = _r(
- ji,
- ei,
- we,
- ki,
- rs,
- rs,
- /*isListItem*/
- !0,
- /*isFirstListItem*/
- Jr === 0
- );
- }
- const Ri = $Ye(zn);
- if (Ri !== 0 && s.isOnToken() && s.getTokenFullStart() < e.end) {
- let Jr = s.readTokenInfo(Qt);
- Jr.token.kind === 28 && (jr(Jr, Qt, ki, Qt), Jr = s.isOnToken() ? s.readTokenInfo(Qt) : void 0), Jr && Jr.token.kind === Ri && nf(Qt, Jr.token) && jr(
- Jr,
- Qt,
- ki,
- Qt,
- /*isListEndToken*/
- !0
- );
- }
- }
- function jr(Nt, Qt, Br, xr, zn) {
- E.assert(nf(Qt, Nt.token));
- const ki = s.lastTrailingTriviaWasNewLine();
- let rs = !1;
- Nt.leadingTrivia && G(Nt.leadingTrivia, Qt, Wt, Br);
- let ei = 0;
- const Ri = nf(e, Nt.token), Jr = g.getLineAndCharacterOfPosition(Nt.token.pos);
- if (Ri) {
- const ji = d(Nt.token), Fe = C;
- if (ei = ue(Nt.token, Jr, Qt, Wt, Br), !ji)
- if (ei === 0) {
- const Ot = Fe && g.getLineAndCharacterOfPosition(Fe.end).line;
- rs = ki && Jr.line !== Ot;
- } else
- rs = ei === 1;
- }
- if (Nt.trailingTrivia && (T = _a(Nt.trailingTrivia).end, G(Nt.trailingTrivia, Qt, Wt, Br)), rs) {
- const ji = Ri && !d(Nt.token) ? Br.getIndentationForToken(Jr.line, Nt.token.kind, xr, !!zn) : -1;
- let Fe = !0;
- if (Nt.leadingTrivia) {
- const Ot = Br.getIndentationForComment(Nt.token.kind, ji, xr);
- Fe = ee(Nt.leadingTrivia, Ot, Fe, (Ar) => ne(
- Ar.pos,
- Ot,
- /*lineAdded*/
- !1
- ));
- }
- ji !== -1 && Fe && (ne(
- Nt.token.pos,
- ji,
- ei === 1
- /* LineAdded */
- ), I = Jr.line, F = ji);
- }
- s.advance(), Wt = Qt;
- }
- }
- function ee(we, fe, Me, Qe) {
- for (const et of we) {
- const Re = nf(e, et);
- switch (et.kind) {
- case 3:
- Re && J(
- et,
- fe,
- /*firstLineIsIndented*/
- !Me
- ), Me = !1;
- break;
- case 2:
- Me && Re && Qe(et), Me = !1;
- break;
- case 4:
- Me = !0;
- break;
- }
- }
- return Me;
- }
- function G(we, fe, Me, Qe) {
- for (const et of we)
- if (KF(et.kind) && nf(e, et)) {
- const Re = g.getLineAndCharacterOfPosition(et.pos);
- ue(et, Re, fe, Me, Qe);
- }
- }
- function ue(we, fe, Me, Qe, et) {
- const Re = d(we);
- let ft = 0;
- if (!Re)
- if (C)
- ft = re(we, fe.line, Me, C, P, D, Qe, et);
- else {
- const Wt = g.getLineAndCharacterOfPosition(e.pos);
- oe(Wt.line, fe.line);
- }
- return C = we, T = we.end, D = Me, P = fe.line, ft;
- }
- function re(we, fe, Me, Qe, et, Re, ft, Wt) {
- S.updateContext(Qe, Re, we, Me, ft);
- const _r = c(S);
- let Ir = S.options.trimTrailingWhitespace !== !1, jr = 0;
- return _r ? lX(_r, (Nt) => {
- if (jr = Te(Nt, Qe, et, we, fe), Wt)
- switch (jr) {
- case 2:
- Me.getStart(g) === we.pos && Wt.recomputeIndentation(
- /*lineAddedByFormatting*/
- !1,
- ft
- );
- break;
- case 1:
- Me.getStart(g) === we.pos && Wt.recomputeIndentation(
- /*lineAddedByFormatting*/
- !0,
- ft
- );
- break;
- default:
- E.assert(
- jr === 0
- /* None */
- );
- }
- Ir = Ir && !(Nt.action & 16) && Nt.flags !== 1;
- }) : Ir = Ir && we.kind !== 1, fe !== et && Ir && oe(et, fe, Qe), jr;
- }
- function ne(we, fe, Me) {
- const Qe = Due(fe, o);
- if (Me)
- ve(we, 0, Qe);
- else {
- const et = g.getLineAndCharacterOfPosition(we), Re = Iy(et.line, g);
- (fe !== ie(Re, et.character) || Se(Qe, Re)) && ve(Re, et.character, Qe);
- }
- }
- function ie(we, fe) {
- let Me = 0;
- for (let Qe = 0; Qe < fe; Qe++)
- g.text.charCodeAt(we + Qe) === 9 ? Me += o.tabSize - Me % o.tabSize : Me++;
- return Me;
- }
- function Se(we, fe) {
- return we !== g.text.substr(fe, we.length);
- }
- function J(we, fe, Me, Qe = !0) {
- let et = g.getLineAndCharacterOfPosition(we.pos).line;
- const Re = g.getLineAndCharacterOfPosition(we.end).line;
- if (et === Re) {
- Me || ne(
- we.pos,
- fe,
- /*lineAdded*/
- !1
- );
- return;
- }
- const ft = [];
- let Wt = we.pos;
- for (let Qt = et; Qt < Re; Qt++) {
- const Br = jw(Qt, g);
- ft.push({ pos: Wt, end: Br }), Wt = Iy(Qt + 1, g);
- }
- if (Qe && ft.push({ pos: Wt, end: we.end }), ft.length === 0) return;
- const _r = Iy(et, g), Ir = wm.findFirstNonWhitespaceCharacterAndColumn(_r, ft[0].pos, g, o);
- let jr = 0;
- Me && (jr = 1, et++);
- const Nt = fe - Ir.column;
- for (let Qt = jr; Qt < ft.length; Qt++, et++) {
- const Br = Iy(et, g), xr = Qt === 0 ? Ir : wm.findFirstNonWhitespaceCharacterAndColumn(ft[Qt].pos, ft[Qt].end, g, o), zn = xr.column + Nt;
- if (zn > 0) {
- const ki = Due(zn, o);
- ve(Br, xr.character, ki);
- } else
- me(Br, xr.character);
- }
- }
- function oe(we, fe, Me) {
- for (let Qe = we; Qe < fe; Qe++) {
- const et = Iy(Qe, g), Re = jw(Qe, g);
- if (Me && (KF(Me.kind) || tV(Me.kind)) && Me.pos <= Re && Me.end > Re)
- continue;
- const ft = _e(et, Re);
- ft !== -1 && (E.assert(ft === et || !sm(g.text.charCodeAt(ft - 1))), me(ft, Re + 1 - ft));
- }
- }
- function _e(we, fe) {
- let Me = fe;
- for (; Me >= we && sm(g.text.charCodeAt(Me)); )
- Me--;
- return Me !== fe ? Me + 1 : -1;
- }
- function he(we) {
- let fe = C ? C.end : e.pos;
- for (const Me of we)
- KF(Me.kind) && (fe < Me.pos && le(fe, Me.pos - 1, C), fe = Me.end + 1);
- fe < e.end && le(fe, e.end, C);
- }
- function le(we, fe, Me) {
- const Qe = g.getLineAndCharacterOfPosition(we).line, et = g.getLineAndCharacterOfPosition(fe).line;
- oe(Qe, et + 1, Me);
- }
- function me(we, fe) {
- fe && O.push(t9(we, fe, ""));
- }
- function ve(we, fe, Me) {
- (fe || Me) && O.push(t9(we, fe, Me));
- }
- function tt(we, fe) {
- O.push(t9(we, 0, fe));
- }
- function Te(we, fe, Me, Qe, et) {
- const Re = et !== Me;
- switch (we.action) {
- case 1:
- return 0;
- case 16:
- if (fe.end !== Qe.pos)
- return me(fe.end, Qe.pos - fe.end), Re ? 2 : 0;
- break;
- case 32:
- me(fe.pos, fe.end - fe.pos);
- break;
- case 8:
- if (we.flags !== 1 && Me !== et)
- return 0;
- if (et - Me !== 1)
- return ve(fe.end, Qe.pos - fe.end, jh(_, o)), Re ? 0 : 1;
- break;
- case 4:
- if (we.flags !== 1 && Me !== et)
- return 0;
- if (Qe.pos - fe.end !== 1 || g.text.charCodeAt(fe.end) !== 32)
- return ve(fe.end, Qe.pos - fe.end, " "), Re ? 2 : 0;
- break;
- case 64:
- tt(fe.end, ";");
- }
- return 0;
- }
- }
- function jDe(e, t, n, i = xi(e, t)) {
- const s = or(i, Id);
- if (s && (i = s.parent), i.getStart(e) <= t && t < i.getEnd())
- return;
- n = n === null ? void 0 : n === void 0 ? sl(t, e) : n;
- const c = n && ky(e.text, n.end), _ = Yj(i, e), u = Qi(c, _);
- return u && On(u, (d) => e8(d, t) || // The end marker of a single-line comment does not include the newline character.
- // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position):
- //
- // // asdf ^\n
- //
- // But for closed multi-line comments, we don't want to be inside the comment in the following case:
- //
- // /* asdf */^
- //
- // However, unterminated multi-line comments *do* contain their end.
- //
- // Internally, we represent the end of the comment at the newline and closing '/', respectively.
- //
- t === d.end && (d.kind === 2 || t === e.getFullWidth()));
- }
- function GYe(e, t) {
- switch (e.kind) {
- case 176:
- case 262:
- case 218:
- case 174:
- case 173:
- case 219:
- case 179:
- case 180:
- case 184:
- case 185:
- case 177:
- case 178:
- if (e.typeParameters === t)
- return 30;
- if (e.parameters === t)
- return 21;
- break;
- case 213:
- case 214:
- if (e.typeArguments === t)
- return 30;
- if (e.arguments === t)
- return 21;
- break;
- case 263:
- case 231:
- case 264:
- case 265:
- if (e.typeParameters === t)
- return 30;
- break;
- case 183:
- case 215:
- case 186:
- case 233:
- case 205:
- if (e.typeArguments === t)
- return 30;
- break;
- case 187:
- return 19;
- }
- return 0;
- }
- function $Ye(e) {
- switch (e) {
- case 21:
- return 22;
- case 30:
- return 32;
- case 19:
- return 20;
- }
- return 0;
- }
- var OH, Q8, Y8;
- function Due(e, t) {
- if ((!OH || OH.tabSize !== t.tabSize || OH.indentSize !== t.indentSize) && (OH = { tabSize: t.tabSize, indentSize: t.indentSize }, Q8 = Y8 = void 0), t.convertTabsToSpaces) {
- let i;
- const s = Math.floor(e / t.indentSize), o = e % t.indentSize;
- return Y8 || (Y8 = []), Y8[s] === void 0 ? (i = a8(" ", t.indentSize * s), Y8[s] = i) : i = Y8[s], o ? i + a8(" ", o) : i;
- } else {
- const i = Math.floor(e / t.tabSize), s = e - i * t.tabSize;
- let o;
- return Q8 || (Q8 = []), Q8[i] === void 0 ? Q8[i] = o = a8(" ", i) : o = Q8[i], s ? o + a8(" ", s) : o;
- }
- }
- var wm;
- ((e) => {
- let t;
- ((J) => {
- J[J.Unknown = -1] = "Unknown";
- })(t || (t = {}));
- function n(J, oe, _e, he = !1) {
- if (J > oe.text.length)
- return _(_e);
- if (_e.indentStyle === 0)
- return 0;
- const le = sl(
- J,
- oe,
- /*startNode*/
- void 0,
- /*excludeJsdoc*/
- !0
- ), me = jDe(oe, J, le || null);
- if (me && me.kind === 3)
- return i(oe, J, _e, me);
- if (!le)
- return _(_e);
- if (tV(le.kind) && le.getStart(oe) <= J && J < le.end)
- return 0;
- const tt = oe.getLineAndCharacterOfPosition(J).line, Te = xi(oe, J), we = Te.kind === 19 && Te.parent.kind === 210;
- if (_e.indentStyle === 1 || we)
- return s(oe, J, _e);
- if (le.kind === 28 && le.parent.kind !== 226) {
- const Me = g(le, oe, _e);
- if (Me !== -1)
- return Me;
- }
- const fe = B(J, le.parent, oe);
- if (fe && !nf(fe, le)) {
- const Qe = [
- 218,
- 219
- /* ArrowFunction */
- ].includes(Te.parent.kind) ? 0 : _e.indentSize;
- return q(fe, oe, _e) + Qe;
- }
- return o(oe, J, le, tt, he, _e);
- }
- e.getIndentation = n;
- function i(J, oe, _e, he) {
- const le = Qs(J, oe).line - 1, me = Qs(J, he.pos).line;
- if (E.assert(me >= 0), le <= me)
- return ue(Iy(me, J), oe, J, _e);
- const ve = Iy(le, J), { column: tt, character: Te } = G(ve, oe, J, _e);
- return tt === 0 ? tt : J.text.charCodeAt(ve + Te) === 42 ? tt - 1 : tt;
- }
- function s(J, oe, _e) {
- let he = oe;
- for (; he > 0; ) {
- const me = J.text.charCodeAt(he);
- if (!Ng(me))
- break;
- he--;
- }
- const le = $p(he, J);
- return ue(le, he, J, _e);
- }
- function o(J, oe, _e, he, le, me) {
- let ve, tt = _e;
- for (; tt; ) {
- if ($U(tt, oe, J) && ie(
- me,
- tt,
- ve,
- J,
- /*isNextChild*/
- !0
- )) {
- const we = C(tt, J), fe = T(_e, tt, he, J), Me = fe !== 0 ? le && fe === 2 ? me.indentSize : 0 : he !== we.line ? me.indentSize : 0;
- return u(
- tt,
- we,
- /*ignoreActualIndentationRange*/
- void 0,
- Me,
- J,
- /*isNextChild*/
- !0,
- me
- );
- }
- const Te = V(
- tt,
- J,
- me,
- /*listIndentsChild*/
- !0
- );
- if (Te !== -1)
- return Te;
- ve = tt, tt = tt.parent;
- }
- return _(me);
- }
- function c(J, oe, _e, he) {
- const le = _e.getLineAndCharacterOfPosition(J.getStart(_e));
- return u(
- J,
- le,
- oe,
- /*indentationDelta*/
- 0,
- _e,
- /*isNextChild*/
- !1,
- he
- );
- }
- e.getIndentationForNode = c;
- function _(J) {
- return J.baseIndentSize || 0;
- }
- e.getBaseIndentation = _;
- function u(J, oe, _e, he, le, me, ve) {
- var tt;
- let Te = J.parent;
- for (; Te; ) {
- let we = !0;
- if (_e) {
- const et = J.getStart(le);
- we = et < _e.pos || et > _e.end;
- }
- const fe = d(Te, J, le), Me = fe.line === oe.line || P(Te, J, oe.line, le);
- if (we) {
- const et = (tt = O(J, le)) == null ? void 0 : tt[0], Re = !!et && C(et, le).line > fe.line;
- let ft = V(J, le, ve, Re);
- if (ft !== -1 || (ft = h(J, Te, oe, Me, le, ve), ft !== -1))
- return ft + he;
- }
- ie(ve, Te, J, le, me) && !Me && (he += ve.indentSize);
- const Qe = D(Te, J, oe.line, le);
- J = Te, Te = J.parent, oe = Qe ? le.getLineAndCharacterOfPosition(J.getStart(le)) : fe;
- }
- return he + _(ve);
- }
- function d(J, oe, _e) {
- const he = O(oe, _e), le = he ? he.pos : J.getStart(_e);
- return _e.getLineAndCharacterOfPosition(le);
- }
- function g(J, oe, _e) {
- const he = use(J);
- return he && he.listItemIndex > 0 ? ae(he.list.getChildren(), he.listItemIndex - 1, oe, _e) : -1;
- }
- function h(J, oe, _e, he, le, me) {
- return (ql(J) || Lw(J)) && (oe.kind === 307 || !he) ? ee(_e, le, me) : -1;
- }
- let S;
- ((J) => {
- J[J.Unknown = 0] = "Unknown", J[J.OpenBrace = 1] = "OpenBrace", J[J.CloseBrace = 2] = "CloseBrace";
- })(S || (S = {}));
- function T(J, oe, _e, he) {
- const le = Zb(J, oe, he);
- if (!le)
- return 0;
- if (le.kind === 19)
- return 1;
- if (le.kind === 20) {
- const me = C(le, he).line;
- return _e === me ? 2 : 0;
- }
- return 0;
- }
- function C(J, oe) {
- return oe.getLineAndCharacterOfPosition(J.getStart(oe));
- }
- function D(J, oe, _e, he) {
- if (!(Fs(J) && ss(J.arguments, oe)))
- return !1;
- const le = J.expression.getEnd();
- return Qs(he, le).line === _e;
- }
- e.isArgumentAndStartLineOverlapsExpressionBeingCalled = D;
- function P(J, oe, _e, he) {
- if (J.kind === 245 && J.elseStatement === oe) {
- const le = Ya(J, 93, he);
- return E.assert(le !== void 0), C(le, he).line === _e;
- }
- return !1;
- }
- e.childStartsOnTheSameLineWithElseInIfStatement = P;
- function I(J, oe, _e, he) {
- if (Ix(J) && (oe === J.whenTrue || oe === J.whenFalse)) {
- const le = Qs(he, J.condition.end).line;
- if (oe === J.whenTrue)
- return _e === le;
- {
- const me = C(J.whenTrue, he).line, ve = Qs(he, J.whenTrue.end).line;
- return le === me && ve === _e;
- }
- }
- return !1;
- }
- e.childIsUnindentedBranchOfConditionalExpression = I;
- function F(J, oe, _e, he) {
- if (am(J)) {
- if (!J.arguments) return !1;
- const le = On(J.arguments, (Te) => Te.pos === oe.pos);
- if (!le) return !1;
- const me = J.arguments.indexOf(le);
- if (me === 0) return !1;
- const ve = J.arguments[me - 1], tt = Qs(he, ve.getEnd()).line;
- if (_e === tt)
- return !0;
- }
- return !1;
- }
- e.argumentStartsOnSameLineAsPreviousArgument = F;
- function O(J, oe) {
- return J.parent && z(J.getStart(oe), J.getEnd(), J.parent, oe);
- }
- e.getContainingList = O;
- function B(J, oe, _e) {
- return oe && z(J, J, oe, _e);
- }
- function z(J, oe, _e, he) {
- switch (_e.kind) {
- case 183:
- return le(_e.typeArguments);
- case 210:
- return le(_e.properties);
- case 209:
- return le(_e.elements);
- case 187:
- return le(_e.members);
- case 262:
- case 218:
- case 219:
- case 174:
- case 173:
- case 179:
- case 176:
- case 185:
- case 180:
- return le(_e.typeParameters) || le(_e.parameters);
- case 177:
- return le(_e.parameters);
- case 263:
- case 231:
- case 264:
- case 265:
- case 345:
- return le(_e.typeParameters);
- case 214:
- case 213:
- return le(_e.typeArguments) || le(_e.arguments);
- case 261:
- return le(_e.declarations);
- case 275:
- case 279:
- return le(_e.elements);
- case 206:
- case 207:
- return le(_e.elements);
- }
- function le(me) {
- return me && t8(X(_e, me, he), J, oe) ? me : void 0;
- }
- }
- function X(J, oe, _e) {
- const he = J.getChildren(_e);
- for (let le = 1; le < he.length - 1; le++)
- if (he[le].pos === oe.pos && he[le].end === oe.end)
- return { pos: he[le - 1].end, end: he[le + 1].getStart(_e) };
- return oe;
- }
- function q(J, oe, _e) {
- return J ? ee(oe.getLineAndCharacterOfPosition(J.pos), oe, _e) : -1;
- }
- function V(J, oe, _e, he) {
- if (J.parent && J.parent.kind === 261)
- return -1;
- const le = O(J, oe);
- if (le) {
- const me = le.indexOf(J);
- if (me !== -1) {
- const ve = ae(le, me, oe, _e);
- if (ve !== -1)
- return ve;
- }
- return q(le, oe, _e) + (he ? _e.indentSize : 0);
- }
- return -1;
- }
- function ae(J, oe, _e, he) {
- E.assert(oe >= 0 && oe < J.length);
- const le = J[oe];
- let me = C(le, _e);
- for (let ve = oe - 1; ve >= 0; ve--) {
- if (J[ve].kind === 28)
- continue;
- if (_e.getLineAndCharacterOfPosition(J[ve].end).line !== me.line)
- return ee(me, _e, he);
- me = C(J[ve], _e);
- }
- return -1;
- }
- function ee(J, oe, _e) {
- const he = oe.getPositionOfLineAndCharacter(J.line, 0);
- return ue(he, he + J.character, oe, _e);
- }
- function G(J, oe, _e, he) {
- let le = 0, me = 0;
- for (let ve = J; ve < oe; ve++) {
- const tt = _e.text.charCodeAt(ve);
- if (!sm(tt))
- break;
- tt === 9 ? me += he.tabSize + me % he.tabSize : me++, le++;
- }
- return { column: me, character: le };
- }
- e.findFirstNonWhitespaceCharacterAndColumn = G;
- function ue(J, oe, _e, he) {
- return G(J, oe, _e, he).column;
- }
- e.findFirstNonWhitespaceColumn = ue;
- function re(J, oe, _e, he, le) {
- const me = _e ? _e.kind : 0;
- switch (oe.kind) {
- case 244:
- case 263:
- case 231:
- case 264:
- case 266:
- case 265:
- case 209:
- case 241:
- case 268:
- case 210:
- case 187:
- case 200:
- case 189:
- case 217:
- case 211:
- case 213:
- case 214:
- case 243:
- case 277:
- case 253:
- case 227:
- case 207:
- case 206:
- case 286:
- case 289:
- case 285:
- case 294:
- case 173:
- case 179:
- case 180:
- case 169:
- case 184:
- case 185:
- case 196:
- case 215:
- case 223:
- case 279:
- case 275:
- case 281:
- case 276:
- case 172:
- case 296:
- case 297:
- return !0;
- case 269:
- return J.indentSwitchCase ?? !0;
- case 260:
- case 303:
- case 226:
- if (!J.indentMultiLineObjectLiteralBeginningOnBlankLine && he && me === 210)
- return Se(he, _e);
- if (oe.kind === 226 && he && _e && me === 284) {
- const ve = he.getLineAndCharacterOfPosition(aa(he.text, oe.pos)).line, tt = he.getLineAndCharacterOfPosition(aa(he.text, _e.pos)).line;
- return ve !== tt;
- }
- if (oe.kind !== 226)
- return !0;
- break;
- case 246:
- case 247:
- case 249:
- case 250:
- case 248:
- case 245:
- case 262:
- case 218:
- case 174:
- case 176:
- case 177:
- case 178:
- return me !== 241;
- case 219:
- return he && me === 217 ? Se(he, _e) : me !== 241;
- case 278:
- return me !== 279;
- case 272:
- return me !== 273 || !!_e.namedBindings && _e.namedBindings.kind !== 275;
- case 284:
- return me !== 287;
- case 288:
- return me !== 290;
- case 193:
- case 192:
- case 238:
- if (me === 187 || me === 189 || me === 200)
- return !1;
- break;
- }
- return le;
- }
- e.nodeWillIndentChild = re;
- function ne(J, oe) {
- switch (J) {
- case 253:
- case 257:
- case 251:
- case 252:
- return oe.kind !== 241;
- default:
- return !1;
- }
- }
- function ie(J, oe, _e, he, le = !1) {
- return re(
- J,
- oe,
- _e,
- he,
- /*indentByDefault*/
- !1
- ) && !(le && _e && ne(_e.kind, oe));
- }
- e.shouldIndentChildNode = ie;
- function Se(J, oe) {
- const _e = aa(J.text, oe.pos), he = J.getLineAndCharacterOfPosition(_e).line, le = J.getLineAndCharacterOfPosition(oe.end).line;
- return he === le;
- }
- })(wm || (wm = {}));
- var FH = {};
- La(FH, {
- pasteEditsProvider: () => QYe
- });
- var XYe = "providePostPasteEdits";
- function QYe(e, t, n, i, s, o, c, _) {
- return { edits: sn.ChangeTracker.with({ host: s, formatContext: c, preferences: o }, (d) => YYe(e, t, n, i, s, o, c, _, d)), fixId: XYe };
- }
- function YYe(e, t, n, i, s, o, c, _, u) {
- let d;
- t.length !== n.length && (d = t.length === 1 ? t[0] : t.join(jh(c.host, c.options)));
- const g = [];
- let h = e.text;
- for (let T = n.length - 1; T >= 0; T--) {
- const { pos: C, end: D } = n[T];
- h = d ? h.slice(0, C) + d + h.slice(D) : h.slice(0, C) + t[T] + h.slice(D);
- }
- let S;
- E.checkDefined(s.runWithTemporaryFileUpdate).call(s, e.fileName, h, (T, C, D) => {
- if (S = xu.createImportAdder(D, T, o, s), i?.range) {
- E.assert(i.range.length === t.length), i.range.forEach((F) => {
- const O = i.file.statements, B = ac(O, (X) => X.end > F.pos);
- if (B === -1) return;
- let z = ac(O, (X) => X.end >= F.end, B);
- z !== -1 && F.end <= O[z].getStart() && z--, g.push(...O.slice(B, z === -1 ? O.length : z + 1));
- });
- const P = A9(i.file, g, C.getTypeChecker(), $ae(D, g, C.getTypeChecker()), { pos: i.range[0].pos, end: i.range[i.range.length - 1].end });
- E.assertIsDefined(C);
- const I = !BV(e.fileName, C, s, !!i.file.commonJsModuleIndicator);
- Jae(i.file, P.targetFileImportsFromOldFile, u, I), Qae(i.file, P.oldImportsNeededByTargetFile, P.targetFileImportsFromOldFile, C.getTypeChecker(), T, S);
- } else {
- const P = {
- sourceFile: D,
- program: C,
- cancellationToken: _,
- host: s,
- preferences: o,
- formatContext: c
- };
- let I = 0;
- n.forEach((F, O) => {
- const B = F.end - F.pos, z = d ?? t[O], X = F.pos + I, q = X + z.length, V = { pos: X, end: q };
- I += z.length - B;
- const ae = or(
- xi(P.sourceFile, V.pos),
- (ee) => nf(ee, V)
- );
- ae && bs(ae, function ee(G) {
- if (Oe(G) && VD(V, G.getStart(D)) && !T?.getTypeChecker().resolveName(
- G.text,
- G,
- -1,
- /*excludeGlobals*/
- !1
- ))
- return S.addImportForUnresolvedIdentifier(
- P,
- G,
- /*useAutoImportProvider*/
- !0
- );
- G.forEachChild(ee);
- });
- });
- }
- S.writeFixes(u, bf(i ? i.file : e, o));
- }), S.hasFixes() && n.forEach((T, C) => {
- u.replaceRangeWithText(
- e,
- { pos: T.pos, end: T.end },
- d ?? t[C]
- );
- });
- }
- var BDe = {};
- La(BDe, {
- ANONYMOUS: () => wV,
- AccessFlags: () => _Q,
- AssertionLevel: () => SX,
- AssignmentDeclarationKind: () => bQ,
- AssignmentKind: () => qZ,
- Associativity: () => KZ,
- BreakpointResolver: () => Eq,
- BuilderFileEmit: () => Hne,
- BuilderProgramKind: () => eie,
- BuilderState: () => Ld,
- CallHierarchy: () => nk,
- CharacterCodes: () => NQ,
- CheckFlags: () => oQ,
- CheckMode: () => Xz,
- ClassificationType: () => RU,
- ClassificationTypeNames: () => rse,
- CommentDirectiveType: () => HX,
- Comparison: () => cX,
- CompletionInfoFlags: () => Xie,
- CompletionTriggerKind: () => LU,
- Completions: () => ck,
- ContainerFlags: () => Pre,
- ContextFlags: () => KX,
- Debug: () => E,
- DiagnosticCategory: () => SI,
- Diagnostics: () => p,
- DocumentHighlights: () => C9,
- ElementFlags: () => uQ,
- EmitFlags: () => VR,
- EmitHint: () => MQ,
- EmitOnly: () => $X,
- EndOfLineState: () => Zie,
- ExitStatus: () => XX,
- ExportKind: () => $se,
- Extension: () => IQ,
- ExternalEmitHelpers: () => LQ,
- FileIncludeKind: () => FR,
- FilePreprocessingDiagnosticsKind: () => GX,
- FileSystemEntryKind: () => qQ,
- FileWatcherEventKind: () => WQ,
- FindAllReferences: () => Eo,
- FlattenLevel: () => Xre,
- FlowFlags: () => bI,
- ForegroundColorEscapeSequences: () => jne,
- FunctionFlags: () => YZ,
- GeneratedIdentifierFlags: () => OR,
- GetLiteralTextFlags: () => aZ,
- GoToDefinition: () => L6,
- HighlightSpanKind: () => Gie,
- IdentifierNameMap: () => _6,
- ImportKind: () => Gse,
- ImportsNotUsedAsValues: () => EQ,
- IndentStyle: () => $ie,
- IndexFlags: () => fQ,
- IndexKind: () => mQ,
- InferenceFlags: () => yQ,
- InferencePriority: () => hQ,
- InlayHintKind: () => Hie,
- InlayHints: () => gH,
- InternalEmitFlags: () => OQ,
- InternalNodeBuilderFlags: () => tQ,
- InternalSymbolName: () => cQ,
- IntersectionFlags: () => ZX,
- InvalidatedProjectKind: () => xie,
- JSDocParsingMode: () => zQ,
- JsDoc: () => wv,
- JsTyping: () => Dm,
- JsxEmit: () => CQ,
- JsxFlags: () => WX,
- JsxReferenceKind: () => pQ,
- LanguageFeatureMinimumTarget: () => FQ,
- LanguageServiceMode: () => Vie,
- LanguageVariant: () => wQ,
- LexicalEnvironmentFlags: () => jQ,
- ListFormat: () => BQ,
- LogLevel: () => NX,
- MapCode: () => hH,
- MemberOverrideStatus: () => QX,
- ModifierFlags: () => NR,
- ModuleDetectionKind: () => SQ,
- ModuleInstanceState: () => Ere,
- ModuleKind: () => lw,
- ModuleResolutionKind: () => zE,
- ModuleSpecifierEnding: () => QK,
- NavigateTo: () => hae,
- NavigationBar: () => vae,
- NewLineKind: () => DQ,
- NodeBuilderFlags: () => eQ,
- NodeCheckFlags: () => RR,
- NodeFactoryFlags: () => xee,
- NodeFlags: () => AR,
- NodeResolutionFeatures: () => gre,
- ObjectFlags: () => BR,
- OperationCanceledException: () => JE,
- OperatorPrecedence: () => eK,
- OrganizeImports: () => Av,
- OrganizeImportsMode: () => FU,
- OuterExpressionKinds: () => RQ,
- OutliningElementsCollector: () => vH,
- OutliningSpanKind: () => Qie,
- OutputFileType: () => Yie,
- PackageJsonAutoImportPreference: () => Uie,
- PackageJsonDependencyGroup: () => Wie,
- PatternMatchKind: () => $V,
- PollingInterval: () => qR,
- PollingWatchKind: () => kQ,
- PragmaKindFlags: () => JQ,
- PredicateSemantics: () => UX,
- PrivateIdentifierKind: () => Oee,
- ProcessLevel: () => Kre,
- ProgramUpdateLevel: () => One,
- QuotePreference: () => kse,
- RegularExpressionFlags: () => VX,
- RelationComparisonResult: () => IR,
- Rename: () => uL,
- ScriptElementKind: () => ese,
- ScriptElementKindModifier: () => tse,
- ScriptKind: () => zR,
- ScriptSnapshot: () => RF,
- ScriptTarget: () => PQ,
- SemanticClassificationFormat: () => qie,
- SemanticMeaning: () => nse,
- SemicolonPreference: () => MU,
- SignatureCheckMode: () => Qz,
- SignatureFlags: () => JR,
- SignatureHelp: () => U8,
- SignatureInfo: () => qne,
- SignatureKind: () => dQ,
- SmartSelectionRange: () => TH,
- SnippetKind: () => UR,
- StatisticType: () => Iie,
- StructureIsReused: () => LR,
- SymbolAccessibility: () => iQ,
- SymbolDisplay: () => j0,
- SymbolDisplayPartKind: () => BF,
- SymbolFlags: () => MR,
- SymbolFormatFlags: () => nQ,
- SyntaxKind: () => wR,
- Ternary: () => vQ,
- ThrottledCancellationToken: () => Doe,
- TokenClass: () => Kie,
- TokenFlags: () => qX,
- TransformFlags: () => WR,
- TypeFacts: () => $z,
- TypeFlags: () => jR,
- TypeFormatFlags: () => rQ,
- TypeMapKind: () => gQ,
- TypePredicateKind: () => sQ,
- TypeReferenceSerializationKind: () => aQ,
- UnionReduction: () => YX,
- UpToDateStatusType: () => gie,
- VarianceFlags: () => lQ,
- Version: () => Sd,
- VersionRange: () => vI,
- WatchDirectoryFlags: () => AQ,
- WatchDirectoryKind: () => xQ,
- WatchFileKind: () => TQ,
- WatchLogLevel: () => Lne,
- WatchType: () => Tl,
- accessPrivateIdentifier: () => $re,
- addEmitFlags: () => hm,
- addEmitHelper: () => Tx,
- addEmitHelpers: () => Ih,
- addInternalEmitFlags: () => bx,
- addNodeFactoryPatcher: () => the,
- addObjectAllocatorPatcher: () => zge,
- addRange: () => Fn,
- addRelatedInfo: () => Rs,
- addSyntheticLeadingComment: () => Z4,
- addSyntheticTrailingComment: () => j5,
- addToSeen: () => zp,
- advancedAsyncSuperHelper: () => W5,
- affectsDeclarationPathOptionDeclarations: () => Bte,
- affectsEmitOptionDeclarations: () => jte,
- allKeysStartWithDot: () => RO,
- altDirectorySeparator: () => CI,
- and: () => gI,
- append: () => wr,
- appendIfUnique: () => bh,
- arrayFrom: () => as,
- arrayIsEqualTo: () => Af,
- arrayIsHomogeneous: () => see,
- arrayOf: () => hX,
- arrayReverseIterator: () => lR,
- arrayToMap: () => Yk,
- arrayToMultiMap: () => nw,
- arrayToNumericMap: () => vX,
- assertType: () => yme,
- assign: () => z2,
- asyncSuperHelper: () => z5,
- attachFileToDiagnostics: () => px,
- base64decode: () => xK,
- base64encode: () => TK,
- binarySearch: () => hy,
- binarySearchKey: () => IT,
- bindSourceFile: () => wre,
- breakIntoCharacterSpans: () => lae,
- breakIntoWordSpans: () => uae,
- buildLinkParts: () => Ise,
- buildOpts: () => hA,
- buildOverload: () => WDe,
- bundlerModuleNameResolver: () => hre,
- canBeConvertedToAsync: () => eq,
- canHaveDecorators: () => Vb,
- canHaveExportModifier: () => U3,
- canHaveFlowNode: () => f3,
- canHaveIllegalDecorators: () => nz,
- canHaveIllegalModifiers: () => yte,
- canHaveIllegalType: () => Dhe,
- canHaveIllegalTypeParameters: () => hte,
- canHaveJSDoc: () => p3,
- canHaveLocals: () => tg,
- canHaveModifiers: () => Hp,
- canHaveModuleSpecifier: () => WZ,
- canHaveSymbol: () => kd,
- canIncludeBindAndCheckDiagnostics: () => U4,
- canJsonReportNoInputFiles: () => vD,
- canProduceDiagnostics: () => eF,
- canUsePropertyAccess: () => dJ,
- canWatchAffectingLocation: () => cie,
- canWatchAtTypes: () => oie,
- canWatchDirectoryOrFile: () => bF,
- cartesianProduct: () => wX,
- cast: () => Bs,
- chainBundle: () => Fd,
- chainDiagnosticMessages: () => vs,
- changeAnyExtension: () => fw,
- changeCompilerHostLikeToUseCache: () => MD,
- changeExtension: () => zy,
- changeFullExtension: () => DI,
- changesAffectModuleResolution: () => e7,
- changesAffectingProgramStructure: () => ZY,
- characterCodeToRegularExpressionFlag: () => rj,
- childIsDecorated: () => m4,
- classElementOrClassElementParameterIsDecorated: () => tB,
- classHasClassThisAssignment: () => uW,
- classHasDeclaredOrExplicitlyAssignedName: () => _W,
- classHasExplicitlyAssignedName: () => YO,
- classOrConstructorParameterIsDecorated: () => v0,
- classicNameResolver: () => kre,
- classifier: () => Noe,
- cleanExtendedConfigCache: () => sF,
- clear: () => Ap,
- clearMap: () => D_,
- clearSharedExtendedConfigFileWatcher: () => CW,
- climbPastPropertyAccess: () => WF,
- clone: () => bX,
- cloneCompilerOptions: () => nV,
- closeFileWatcher: () => fd,
- closeFileWatcherOf: () => mp,
- codefix: () => xu,
- collapseTextChangeRangesAcrossMultipleVersions: () => pY,
- collectExternalModuleInfo: () => aW,
- combine: () => NT,
- combinePaths: () => Bn,
- commandLineOptionOfCustomType: () => Wte,
- commentPragmas: () => TI,
- commonOptionsWithBuild: () => gO,
- compact: () => tw,
- compareBooleans: () => J1,
- compareDataObjects: () => VB,
- compareDiagnostics: () => R4,
- compareEmitHelpers: () => Lee,
- compareNumberOfDirectorySeparators: () => z3,
- comparePaths: () => Sh,
- comparePathsCaseInsensitive: () => zme,
- comparePathsCaseSensitive: () => Jme,
- comparePatternKeys: () => zz,
- compareProperties: () => CX,
- compareStringsCaseInsensitive: () => sw,
- compareStringsCaseInsensitiveEslintCompatible: () => TX,
- compareStringsCaseSensitive: () => au,
- compareStringsCaseSensitiveUI: () => aw,
- compareTextSpans: () => dI,
- compareValues: () => ho,
- compilerOptionsAffectDeclarationPath: () => UK,
- compilerOptionsAffectEmit: () => WK,
- compilerOptionsAffectSemanticDiagnostics: () => zK,
- compilerOptionsDidYouMeanDiagnostics: () => bO,
- compilerOptionsIndicateEsModules: () => lV,
- computeCommonSourceDirectoryOfFilenames: () => Mne,
- computeLineAndCharacterOfPosition: () => nC,
- computeLineOfPosition: () => HE,
- computeLineStarts: () => BT,
- computePositionOfLineAndCharacter: () => NI,
- computeSignatureWithDiagnostics: () => HW,
- computeSuggestionDiagnostics: () => YV,
- computedOptions: () => rl,
- concatenate: () => Qi,
- concatenateDiagnosticMessageChains: () => MK,
- consumesNodeCoreModules: () => g9,
- contains: () => ss,
- containsIgnoredPath: () => H4,
- containsObjectRestOrSpread: () => pA,
- containsParseError: () => GT,
- containsPath: () => np,
- convertCompilerOptionsForTelemetry: () => ire,
- convertCompilerOptionsFromJson: () => L0e,
- convertJsonOption: () => kS,
- convertToBase64: () => SK,
- convertToJson: () => bA,
- convertToObject: () => Yte,
- convertToOptionsWithAbsolutePaths: () => kO,
- convertToRelativePath: () => VE,
- convertToTSConfig: () => Cz,
- convertTypeAcquisitionFromJson: () => M0e,
- copyComments: () => NS,
- copyEntries: () => t7,
- copyLeadingComments: () => D6,
- copyProperties: () => mR,
- copyTrailingAsLeadingComments: () => p8,
- copyTrailingComments: () => ZD,
- couldStartTrivia: () => eY,
- countWhere: () => py,
- createAbstractBuilder: () => V1e,
- createAccessorPropertyBackingField: () => az,
- createAccessorPropertyGetRedirector: () => Ete,
- createAccessorPropertySetRedirector: () => Dte,
- createBaseNodeFactory: () => yee,
- createBinaryExpressionTrampoline: () => fO,
- createBuilderProgram: () => GW,
- createBuilderProgramUsingIncrementalBuildInfo: () => iie,
- createBuilderStatusReporter: () => wF,
- createCacheableExportInfoMap: () => JV,
- createCachedDirectoryStructureHost: () => nF,
- createClassifier: () => Tbe,
- createCommentDirectivesMap: () => iZ,
- createCompilerDiagnostic: () => Go,
- createCompilerDiagnosticForInvalidCustomType: () => Ute,
- createCompilerDiagnosticFromMessageChain: () => a5,
- createCompilerHost: () => Rne,
- createCompilerHostFromProgramHost: () => fU,
- createCompilerHostWorker: () => aF,
- createDetachedDiagnostic: () => fx,
- createDiagnosticCollection: () => x3,
- createDiagnosticForFileFromMessageChain: () => Qj,
- createDiagnosticForNode: () => Kr,
- createDiagnosticForNodeArray: () => gC,
- createDiagnosticForNodeArrayFromMessageChain: () => Uw,
- createDiagnosticForNodeFromMessageChain: () => Rg,
- createDiagnosticForNodeInSourceFile: () => sp,
- createDiagnosticForRange: () => yZ,
- createDiagnosticMessageChainFromDiagnostic: () => hZ,
- createDiagnosticReporter: () => $x,
- createDocumentPositionMapper: () => Ure,
- createDocumentRegistry: () => Zse,
- createDocumentRegistryInternal: () => qV,
- createEmitAndSemanticDiagnosticsBuilderProgram: () => YW,
- createEmitHelperFactory: () => Fee,
- createEmptyExports: () => aA,
- createEvaluator: () => mee,
- createExpressionForJsxElement: () => _te,
- createExpressionForJsxFragment: () => fte,
- createExpressionForObjectLiteralElementLike: () => pte,
- createExpressionForPropertyName: () => YJ,
- createExpressionFromEntityName: () => oA,
- createExternalHelpersImportDeclarationIfNeeded: () => ez,
- createFileDiagnostic: () => fl,
- createFileDiagnosticFromMessageChain: () => f7,
- createFlowNode: () => _g,
- createForOfBindingStatement: () => QJ,
- createFutureSourceFile: () => T9,
- createGetCanonicalFileName: () => zl,
- createGetIsolatedDeclarationErrors: () => Tne,
- createGetSourceFile: () => AW,
- createGetSymbolAccessibilityDiagnosticForNode: () => I0,
- createGetSymbolAccessibilityDiagnosticForNodeName: () => Sne,
- createGetSymbolWalker: () => Are,
- createIncrementalCompilerHost: () => PF,
- createIncrementalProgram: () => mie,
- createJsxFactoryExpression: () => XJ,
- createLanguageService: () => Poe,
- createLanguageServiceSourceFile: () => z9,
- createMemberAccessForPropertyName: () => TS,
- createModeAwareCache: () => a6,
- createModeAwareCacheKey: () => xD,
- createModeMismatchDetails: () => Fj,
- createModuleNotFoundChain: () => n7,
- createModuleResolutionCache: () => o6,
- createModuleResolutionLoader: () => RW,
- createModuleResolutionLoaderUsingGlobalCache: () => fie,
- createModuleSpecifierResolutionHost: () => Zx,
- createMultiMap: () => Ip,
- createNameResolver: () => vJ,
- createNodeConverters: () => See,
- createNodeFactory: () => G3,
- createOptionNameMap: () => yO,
- createOverload: () => LH,
- createPackageJsonImportFilter: () => P6,
- createPackageJsonInfo: () => IV,
- createParenthesizerRules: () => vee,
- createPatternMatcher: () => nae,
- createPrinter: () => Ky,
- createPrinterWithDefaults: () => Nne,
- createPrinterWithRemoveComments: () => $b,
- createPrinterWithRemoveCommentsNeverAsciiEscape: () => Ine,
- createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => kW,
- createProgram: () => WA,
- createProgramHost: () => pU,
- createPropertyNameNodeForIdentifierOrLiteral: () => w5,
- createQueue: () => iw,
- createRange: () => op,
- createRedirectedBuilderProgram: () => QW,
- createResolutionCache: () => KW,
- createRuntimeTypeSerializer: () => ine,
- createScanner: () => Og,
- createSemanticDiagnosticsBuilderProgram: () => U1e,
- createSet: () => gR,
- createSolutionBuilder: () => bie,
- createSolutionBuilderHost: () => yie,
- createSolutionBuilderWithWatch: () => Sie,
- createSolutionBuilderWithWatchHost: () => vie,
- createSortedArray: () => cR,
- createSourceFile: () => Bx,
- createSourceMapGenerator: () => jre,
- createSourceMapSource: () => she,
- createSuperAccessVariableStatement: () => KO,
- createSymbolTable: () => Js,
- createSymlinkCache: () => eJ,
- createSyntacticTypeNodeBuilder: () => Bie,
- createSystemWatchFunctions: () => HQ,
- createTextChange: () => s8,
- createTextChangeFromStartLength: () => t9,
- createTextChangeRange: () => Tw,
- createTextRangeFromNode: () => aV,
- createTextRangeFromSpan: () => e9,
- createTextSpan: () => Ul,
- createTextSpanFromBounds: () => kc,
- createTextSpanFromNode: () => t_,
- createTextSpanFromRange: () => L0,
- createTextSpanFromStringLiteralLikeContent: () => sV,
- createTextWriter: () => E3,
- createTokenRange: () => JB,
- createTypeChecker: () => Mre,
- createTypeReferenceDirectiveResolutionCache: () => OO,
- createTypeReferenceResolutionLoader: () => lF,
- createWatchCompilerHost: () => eve,
- createWatchCompilerHostOfConfigFile: () => dU,
- createWatchCompilerHostOfFilesAndCompilerOptions: () => mU,
- createWatchFactory: () => _U,
- createWatchHost: () => uU,
- createWatchProgram: () => gU,
- createWatchStatusReporter: () => eU,
- createWriteFileMeasuringIO: () => NW,
- declarationNameToString: () => _o,
- decodeMappings: () => nW,
- decodedTextSpanIntersectsWith: () => Sw,
- deduplicate: () => cb,
- defaultInitCompilerOptions: () => yz,
- defaultMaximumTruncationLength: () => l4,
- diagnosticCategoryName: () => U2,
- diagnosticToString: () => e2,
- diagnosticsEqualityComparer: () => o5,
- directoryProbablyExists: () => Dd,
- directorySeparator: () => Vo,
- displayPart: () => w_,
- displayPartsToString: () => P8,
- disposeEmitNodes: () => xJ,
- documentSpansEqual: () => gV,
- dumpTracingLegend: () => zX,
- elementAt: () => gy,
- elideNodes: () => Cte,
- emitDetachedComments: () => _K,
- emitFiles: () => TW,
- emitFilesAndReportErrors: () => kF,
- emitFilesAndReportErrorsAndGetExitStatus: () => lU,
- emitModuleKindIsNonNodeESM: () => j3,
- emitNewLineBeforeLeadingCommentOfPosition: () => uK,
- emitResolverSkipsTypeChecking: () => SW,
- emitSkippedWithNoDiagnostics: () => zW,
- emptyArray: () => Ue,
- emptyFileSystemEntries: () => aJ,
- emptyMap: () => eR,
- emptyOptions: () => Gp,
- endsWith: () => Zo,
- ensurePathIsNonModuleName: () => q2,
- ensureScriptKind: () => v5,
- ensureTrailingDirectorySeparator: () => ul,
- entityNameToString: () => $_,
- enumerateInsertsAndDeletes: () => yI,
- equalOwnProperties: () => yX,
- equateStringsCaseInsensitive: () => Sy,
- equateStringsCaseSensitive: () => ub,
- equateValues: () => by,
- escapeJsxAttributeString: () => CB,
- escapeLeadingUnderscores: () => tc,
- escapeNonAsciiString: () => B7,
- escapeSnippetText: () => Ob,
- escapeString: () => cg,
- escapeTemplateSubstitution: () => xB,
- evaluatorResult: () => pl,
- every: () => Mi,
- executeCommandLine: () => Ove,
- expandPreOrPostfixIncrementOrDecrementExpression: () => aO,
- explainFiles: () => iU,
- explainIfFileIsRedirectAndImpliedFormat: () => sU,
- exportAssignmentIsAlias: () => h3,
- expressionResultIsUnused: () => oee,
- extend: () => pI,
- extensionFromPath: () => z4,
- extensionIsTS: () => C5,
- extensionsNotSupportingExtensionlessResolution: () => x5,
- externalHelpersModuleNameText: () => X1,
- factory: () => A,
- fileContainsPackageImport: () => b8,
- fileExtensionIs: () => qo,
- fileExtensionIsOneOf: () => xc,
- fileIncludeReasonToDiagnostics: () => cU,
- fileShouldUseJavaScriptRequire: () => BV,
- filter: () => Ln,
- filterMutate: () => nR,
- filterSemanticDiagnostics: () => dF,
- find: () => On,
- findAncestor: () => or,
- findBestPatternMatch: () => TR,
- findChildOfKind: () => Ya,
- findComputedPropertyNameCacheAssignment: () => pO,
- findConfigFile: () => PW,
- findConstructorDeclaration: () => H3,
- findContainingList: () => GF,
- findDiagnosticForNode: () => Vse,
- findFirstNonJsxWhitespaceToken: () => _se,
- findIndex: () => ac,
- findLast: () => ob,
- findLastIndex: () => uI,
- findListItemInfo: () => use,
- findModifier: () => k6,
- findNextToken: () => Zb,
- findPackageJson: () => Use,
- findPackageJsons: () => NV,
- findPrecedingMatchingToken: () => ZF,
- findPrecedingToken: () => sl,
- findSuperStatementIndexPath: () => GO,
- findTokenOnLeftOfPosition: () => r8,
- findUseStrictPrologue: () => KJ,
- first: () => xa,
- firstDefined: () => Tc,
- firstDefinedIterator: () => ew,
- firstIterator: () => _R,
- firstOrOnly: () => LV,
- firstOrUndefined: () => el,
- firstOrUndefinedIterator: () => rw,
- fixupCompilerOptions: () => tq,
- flatMap: () => ta,
- flatMapIterator: () => iR,
- flatMapToMutable: () => AE,
- flatten: () => Np,
- flattenCommaList: () => Pte,
- flattenDestructuringAssignment: () => DS,
- flattenDestructuringBinding: () => Gb,
- flattenDiagnosticMessageText: () => Em,
- forEach: () => ir,
- forEachAncestor: () => KY,
- forEachAncestorDirectory: () => Fp,
- forEachChild: () => bs,
- forEachChildRecursively: () => jx,
- forEachEmittedFile: () => hW,
- forEachEnclosingBlockScopeContainer: () => dZ,
- forEachEntry: () => El,
- forEachExternalModuleToImportFrom: () => WV,
- forEachImportClauseDeclaration: () => UZ,
- forEachKey: () => Ch,
- forEachLeadingCommentRange: () => mw,
- forEachNameInAccessChainWalkingLeft: () => NK,
- forEachNameOfDefaultExport: () => k9,
- forEachPropertyAssignment: () => vC,
- forEachResolvedProjectReference: () => jW,
- forEachReturnStatement: () => y0,
- forEachRight: () => lX,
- forEachTrailingCommentRange: () => gw,
- forEachTsConfigPropArray: () => $w,
- forEachUnique: () => yV,
- forEachYieldExpression: () => TZ,
- formatColorAndReset: () => Xb,
- formatDiagnostic: () => IW,
- formatDiagnostics: () => m1e,
- formatDiagnosticsWithColorAndContext: () => zne,
- formatGeneratedName: () => mv,
- formatGeneratedNamePart: () => r6,
- formatLocation: () => OW,
- formatMessage: () => dx,
- formatStringFromArgs: () => zg,
- formatting: () => Yc,
- generateDjb2Hash: () => WE,
- generateTSConfig: () => Kte,
- getAdjustedReferenceLocation: () => YU,
- getAdjustedRenameLocation: () => XF,
- getAliasDeclarationFromName: () => pB,
- getAllAccessorDeclarations: () => My,
- getAllDecoratorsOfClass: () => cW,
- getAllDecoratorsOfClassElement: () => XO,
- getAllJSDocTags: () => jI,
- getAllJSDocTagsOfKind: () => uge,
- getAllKeys: () => dme,
- getAllProjectOutputs: () => rF,
- getAllSuperTypeNodes: () => T4,
- getAllowJSCompilerOption: () => By,
- getAllowSyntheticDefaultImports: () => mx,
- getAncestor: () => nv,
- getAnyExtensionFromPath: () => rC,
- getAreDeclarationMapsEnabled: () => l5,
- getAssignedExpandoInitializer: () => ZT,
- getAssignedName: () => LI,
- getAssignmentDeclarationKind: () => Cc,
- getAssignmentDeclarationPropertyAccessKind: () => o3,
- getAssignmentTargetKind: () => rv,
- getAutomaticTypeDirectiveNames: () => NO,
- getBaseFileName: () => Hc,
- getBinaryOperatorPrecedence: () => T3,
- getBuildInfo: () => xW,
- getBuildInfoFileVersionMap: () => XW,
- getBuildInfoText: () => wne,
- getBuildOrderFromAnyBuildOrder: () => HA,
- getBuilderCreationParameters: () => yF,
- getBuilderFileEmit: () => e1,
- getCanonicalDiagnostic: () => vZ,
- getCheckFlags: () => gc,
- getClassExtendsHeritageElement: () => Cb,
- getClassLikeDeclarationOfSymbol: () => Ah,
- getCombinedLocalAndExportSymbolFlags: () => FC,
- getCombinedModifierFlags: () => U1,
- getCombinedNodeFlags: () => xh,
- getCombinedNodeFlagsAlwaysIncludeJSDoc: () => cj,
- getCommentRange: () => ym,
- getCommonSourceDirectory: () => LD,
- getCommonSourceDirectoryOfConfig: () => Gx,
- getCompilerOptionValue: () => f5,
- getCompilerOptionsDiffValue: () => Zte,
- getConditions: () => Qy,
- getConfigFileParsingDiagnostics: () => Qb,
- getConstantValue: () => Eee,
- getContainerFlags: () => Uz,
- getContainerNode: () => AS,
- getContainingClass: () => Ol,
- getContainingClassExcludingClassDecorators: () => b7,
- getContainingClassStaticBlock: () => IZ,
- getContainingFunction: () => yf,
- getContainingFunctionDeclaration: () => NZ,
- getContainingFunctionOrClassStaticBlock: () => v7,
- getContainingNodeArray: () => cee,
- getContainingObjectLiteralElement: () => w8,
- getContextualTypeFromParent: () => u9,
- getContextualTypeFromParentOrAncestorTypeNode: () => $F,
- getDeclarationDiagnostics: () => xne,
- getDeclarationEmitExtensionForPath: () => W7,
- getDeclarationEmitOutputFilePath: () => iK,
- getDeclarationEmitOutputFilePathWorker: () => z7,
- getDeclarationFileExtension: () => uz,
- getDeclarationFromName: () => S4,
- getDeclarationModifierFlagsFromSymbol: () => lp,
- getDeclarationOfKind: () => Jo,
- getDeclarationsOfKind: () => YY,
- getDeclaredExpandoInitializer: () => y4,
- getDecorators: () => Cy,
- getDefaultCompilerOptions: () => J9,
- getDefaultFormatCodeSettings: () => jF,
- getDefaultLibFileName: () => yw,
- getDefaultLibFilePath: () => woe,
- getDefaultLikeExportInfo: () => x9,
- getDefaultLikeExportNameFromDeclaration: () => MV,
- getDefaultResolutionModeForFileWorker: () => pF,
- getDiagnosticText: () => g_,
- getDiagnosticsWithinSpan: () => qse,
- getDirectoryPath: () => Xn,
- getDirectoryToWatchFailedLookupLocation: () => ZW,
- getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => uie,
- getDocumentPositionMapper: () => QV,
- getDocumentSpansEqualityComparer: () => hV,
- getESModuleInterop: () => Wg,
- getEditsForFileRename: () => eae,
- getEffectiveBaseTypeNode: () => _m,
- getEffectiveConstraintOfTypeParameter: () => oC,
- getEffectiveContainerForJSDocTemplateTag: () => I7,
- getEffectiveImplementsTypeNodes: () => DC,
- getEffectiveInitializer: () => i3,
- getEffectiveJSDocHost: () => tv,
- getEffectiveModifierFlags: () => Mu,
- getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => mK,
- getEffectiveModifierFlagsNoCache: () => gK,
- getEffectiveReturnTypeNode: () => Y_,
- getEffectiveSetAccessorTypeAnnotationNode: () => lK,
- getEffectiveTypeAnnotationNode: () => Gc,
- getEffectiveTypeParameterDeclarations: () => Ey,
- getEffectiveTypeRoots: () => TD,
- getElementOrPropertyAccessArgumentExpressionOrName: () => N7,
- getElementOrPropertyAccessName: () => Eh,
- getElementsOfBindingOrAssignmentPattern: () => t6,
- getEmitDeclarations: () => P_,
- getEmitFlags: () => ya,
- getEmitHelpers: () => B5,
- getEmitModuleDetectionKind: () => jK,
- getEmitModuleFormatOfFileWorker: () => BD,
- getEmitModuleKind: () => Ru,
- getEmitModuleResolutionKind: () => yu,
- getEmitScriptTarget: () => pa,
- getEmitStandardClassFields: () => ZB,
- getEnclosingBlockScopeContainer: () => Cd,
- getEnclosingContainer: () => _7,
- getEncodedSemanticClassifications: () => UV,
- getEncodedSyntacticClassifications: () => VV,
- getEndLinePosition: () => jw,
- getEntityNameFromTypeNode: () => Yw,
- getEntrypointsFromPackageJsonInfo: () => jz,
- getErrorCountForSummary: () => TF,
- getErrorSpanForNode: () => tS,
- getErrorSummaryText: () => rU,
- getEscapedTextOfIdentifierOrLiteral: () => C4,
- getEscapedTextOfJsxAttributeName: () => X4,
- getEscapedTextOfJsxNamespacedName: () => yx,
- getExpandoInitializer: () => K1,
- getExportAssignmentExpression: () => dB,
- getExportInfoMap: () => S8,
- getExportNeedsImportStarHelper: () => Vre,
- getExpressionAssociativity: () => SB,
- getExpressionPrecedence: () => E4,
- getExternalHelpersModuleName: () => lO,
- getExternalModuleImportEqualsDeclarationExpression: () => g4,
- getExternalModuleName: () => KT,
- getExternalModuleNameFromDeclaration: () => rK,
- getExternalModuleNameFromPath: () => PB,
- getExternalModuleNameLiteral: () => Rx,
- getExternalModuleRequireArgument: () => nB,
- getFallbackOptions: () => BA,
- getFileEmitOutput: () => Vne,
- getFileMatcherPatterns: () => y5,
- getFileNamesFromConfigSpecs: () => bD,
- getFileWatcherEventKind: () => $R,
- getFilesInErrorForSummary: () => xF,
- getFirstConstructorWithBody: () => Bg,
- getFirstIdentifier: () => E_,
- getFirstNonSpaceCharacterPosition: () => Lse,
- getFirstProjectOutput: () => bW,
- getFixableErrorSpanExpression: () => OV,
- getFormatCodeSettingsForWriting: () => b9,
- getFullWidth: () => Rw,
- getFunctionFlags: () => Jc,
- getHeritageClause: () => y3,
- getHostSignatureFromJSDoc: () => ev,
- getIdentifierAutoGenerate: () => che,
- getIdentifierGeneratedImportReference: () => Iee,
- getIdentifierTypeArguments: () => _S,
- getImmediatelyInvokedFunctionExpression: () => bb,
- getImpliedNodeFormatForEmitWorker: () => PS,
- getImpliedNodeFormatForFile: () => zA,
- getImpliedNodeFormatForFileWorker: () => fF,
- getImportNeedsImportDefaultHelper: () => sW,
- getImportNeedsImportStarHelper: () => qO,
- getIndentString: () => J7,
- getInferredLibraryNameResolveFrom: () => _F,
- getInitializedVariables: () => F4,
- getInitializerOfBinaryExpression: () => oB,
- getInitializerOfBindingOrAssignmentElement: () => uA,
- getInterfaceBaseTypeNodes: () => x4,
- getInternalEmitFlags: () => _d,
- getInvokedExpression: () => x7,
- getIsFileExcluded: () => Xse,
- getIsolatedModules: () => Wp,
- getJSDocAugmentsTag: () => xY,
- getJSDocClassTag: () => _j,
- getJSDocCommentRanges: () => Zj,
- getJSDocCommentsAndTags: () => cB,
- getJSDocDeprecatedTag: () => fj,
- getJSDocDeprecatedTagNoCache: () => AY,
- getJSDocEnumTag: () => pj,
- getJSDocHost: () => xb,
- getJSDocImplementsTags: () => kY,
- getJSDocOverloadTags: () => uB,
- getJSDocOverrideTagNoCache: () => wY,
- getJSDocParameterTags: () => aC,
- getJSDocParameterTagsNoCache: () => vY,
- getJSDocPrivateTag: () => age,
- getJSDocPrivateTagNoCache: () => EY,
- getJSDocProtectedTag: () => oge,
- getJSDocProtectedTagNoCache: () => DY,
- getJSDocPublicTag: () => sge,
- getJSDocPublicTagNoCache: () => CY,
- getJSDocReadonlyTag: () => cge,
- getJSDocReadonlyTagNoCache: () => PY,
- getJSDocReturnTag: () => NY,
- getJSDocReturnType: () => kw,
- getJSDocRoot: () => EC,
- getJSDocSatisfiesExpressionType: () => gJ,
- getJSDocSatisfiesTag: () => dj,
- getJSDocTags: () => H1,
- getJSDocTemplateTag: () => lge,
- getJSDocThisTag: () => MI,
- getJSDocType: () => q1,
- getJSDocTypeAliasName: () => rz,
- getJSDocTypeAssertionType: () => mD,
- getJSDocTypeParameterDeclarations: () => G7,
- getJSDocTypeParameterTags: () => bY,
- getJSDocTypeParameterTagsNoCache: () => SY,
- getJSDocTypeTag: () => V1,
- getJSXImplicitImportBase: () => d5,
- getJSXRuntimeImport: () => m5,
- getJSXTransformEnabled: () => p5,
- getKeyForCompilerOptions: () => Oz,
- getLanguageVariant: () => F3,
- getLastChild: () => qB,
- getLeadingCommentRanges: () => Ig,
- getLeadingCommentRangesOfNode: () => Yj,
- getLeftmostAccessExpression: () => LC,
- getLeftmostExpression: () => MC,
- getLibraryNameFromLibFileName: () => BW,
- getLineAndCharacterOfPosition: () => Qs,
- getLineInfo: () => rW,
- getLineOfLocalPosition: () => D4,
- getLineStartPositionForPosition: () => $p,
- getLineStarts: () => Ag,
- getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => PK,
- getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => DK,
- getLinesBetweenPositions: () => GE,
- getLinesBetweenRangeEndAndRangeStart: () => zB,
- getLinesBetweenRangeEndPositions: () => Bge,
- getLiteralText: () => oZ,
- getLocalNameForExternalImport: () => e6,
- getLocalSymbolForExportDefault: () => N4,
- getLocaleSpecificMessage: () => ms,
- getLocaleTimeString: () => qA,
- getMappedContextSpan: () => vV,
- getMappedDocumentSpan: () => o9,
- getMappedLocation: () => XD,
- getMatchedFileSpec: () => aU,
- getMatchedIncludeSpec: () => oU,
- getMeaningFromDeclaration: () => JF,
- getMeaningFromLocation: () => wS,
- getMembersOfDeclaration: () => xZ,
- getModeForFileReference: () => oF,
- getModeForResolutionAtIndex: () => S1e,
- getModeForUsageLocation: () => LW,
- getModifiedTime: () => RT,
- getModifiers: () => fb,
- getModuleInstanceState: () => Rh,
- getModuleNameStringLiteralAt: () => UA,
- getModuleSpecifierEndingPreference: () => YK,
- getModuleSpecifierResolverHost: () => uV,
- getNameForExportedSymbol: () => h9,
- getNameFromImportAttribute: () => O5,
- getNameFromIndexInfo: () => mZ,
- getNameFromPropertyName: () => o8,
- getNameOfAccessExpression: () => GB,
- getNameOfCompilerOptionValue: () => Ez,
- getNameOfDeclaration: () => os,
- getNameOfExpando: () => iB,
- getNameOfJSDocTypedef: () => yY,
- getNameOfScriptTarget: () => _5,
- getNameOrArgument: () => a3,
- getNameTable: () => Cq,
- getNamespaceDeclarationNode: () => kC,
- getNewLineCharacter: () => k0,
- getNewLineKind: () => v8,
- getNewLineOrDefaultFromHost: () => jh,
- getNewTargetContainer: () => FZ,
- getNextJSDocCommentLocation: () => lB,
- getNodeChildren: () => GJ,
- getNodeForGeneratedName: () => fA,
- getNodeId: () => Ma,
- getNodeKind: () => Yb,
- getNodeModifiers: () => HD,
- getNodeModulePathParts: () => A5,
- getNonAssignedNameOfDeclaration: () => FI,
- getNonAssignmentOperatorForCompoundAssignment: () => wD,
- getNonAugmentationDeclaration: () => Vj,
- getNonDecoratorTokenPosOfNode: () => jj,
- getNonIncrementalBuildInfoRoots: () => sie,
- getNonModifierTokenPosOfNode: () => sZ,
- getNormalizedAbsolutePath: () => es,
- getNormalizedAbsolutePathWithoutRoot: () => ZR,
- getNormalizedPathComponents: () => _w,
- getObjectFlags: () => wn,
- getOperatorAssociativity: () => TB,
- getOperatorPrecedence: () => S3,
- getOptionFromName: () => bz,
- getOptionsForLibraryResolution: () => Fz,
- getOptionsNameMap: () => i6,
- getOrCreateEmitNode: () => lu,
- getOrUpdate: () => NE,
- getOriginalNode: () => Ho,
- getOriginalNodeId: () => e_,
- getOutputDeclarationFileName: () => p6,
- getOutputDeclarationFileNameWorker: () => yW,
- getOutputExtension: () => tF,
- getOutputFileNames: () => p1e,
- getOutputJSFileNameWorker: () => vW,
- getOutputPathsFor: () => FD,
- getOwnEmitOutputFilePath: () => nK,
- getOwnKeys: () => rm,
- getOwnValues: () => OT,
- getPackageJsonTypesVersionsPaths: () => AO,
- getPackageNameFromTypesPackageName: () => ED,
- getPackageScopeForPath: () => CD,
- getParameterSymbolFromJSDoc: () => d3,
- getParentNodeInSpan: () => l8,
- getParseTreeNode: () => fs,
- getParsedCommandLineOfConfigFile: () => yA,
- getPathComponents: () => Cl,
- getPathFromPathComponents: () => p0,
- getPathUpdater: () => GV,
- getPathsBasePath: () => U7,
- getPatternFromSpec: () => GK,
- getPendingEmitKindWithSeen: () => hF,
- getPositionOfLineAndCharacter: () => pw,
- getPossibleGenericSignatures: () => KU,
- getPossibleOriginalInputExtensionForExtension: () => sK,
- getPossibleTypeArgumentsInfo: () => eV,
- getPreEmitDiagnostics: () => d1e,
- getPrecedingNonSpaceCharacterPosition: () => c9,
- getPrivateIdentifier: () => lW,
- getProperties: () => oW,
- getProperty: () => fI,
- getPropertyArrayElementValue: () => AZ,
- getPropertyAssignmentAliasLikeExpression: () => QZ,
- getPropertyNameForPropertyNameNode: () => oS,
- getPropertyNameFromType: () => _p,
- getPropertyNameOfBindingOrAssignmentElement: () => tz,
- getPropertySymbolFromBindingElement: () => a9,
- getPropertySymbolsFromContextualType: () => W9,
- getQuoteFromPreference: () => fV,
- getQuotePreference: () => bf,
- getRangesWhere: () => oR,
- getRefactorContextSpan: () => Kx,
- getReferencedFileLocation: () => jD,
- getRegexFromPattern: () => Jy,
- getRegularExpressionForWildcard: () => j4,
- getRegularExpressionsForWildcards: () => g5,
- getRelativePathFromDirectory: () => ld,
- getRelativePathFromFile: () => qE,
- getRelativePathToDirectoryOrUrl: () => jT,
- getRenameLocation: () => f8,
- getReplacementSpanForContextToken: () => iV,
- getResolutionDiagnostic: () => UW,
- getResolutionModeOverride: () => d6,
- getResolveJsonModule: () => Ab,
- getResolvePackageJsonExports: () => M3,
- getResolvePackageJsonImports: () => c5,
- getResolvedExternalModuleName: () => DB,
- getResolvedModuleFromResolution: () => HT,
- getResolvedTypeReferenceDirectiveFromResolution: () => r7,
- getRestIndicatorOfBindingOrAssignmentElement: () => uO,
- getRestParameterElementType: () => Kj,
- getRightMostAssignedExpression: () => s3,
- getRootDeclaration: () => pm,
- getRootDirectoryOfResolutionCache: () => _ie,
- getRootLength: () => Km,
- getScriptKind: () => xV,
- getScriptKindFromFileName: () => b5,
- getScriptTargetFeatures: () => Bj,
- getSelectedEffectiveModifierFlags: () => ox,
- getSelectedSyntacticModifierFlags: () => pK,
- getSemanticClassifications: () => Qse,
- getSemanticJsxChildren: () => wC,
- getSetAccessorTypeAnnotationNode: () => oK,
- getSetAccessorValueParameter: () => IC,
- getSetExternalModuleIndicator: () => L3,
- getShebang: () => II,
- getSingleVariableOfVariableStatement: () => rx,
- getSnapshotText: () => Yx,
- getSnippetElement: () => kJ,
- getSourceFileOfModule: () => s7,
- getSourceFileOfNode: () => Tr,
- getSourceFilePathInNewDir: () => q7,
- getSourceFileVersionAsHashFromText: () => CF,
- getSourceFilesToEmit: () => V7,
- getSourceMapRange: () => E0,
- getSourceMapper: () => fae,
- getSourceTextOfNodeFromSourceFile: () => gb,
- getSpanOfTokenAtPosition: () => cm,
- getSpellingSuggestion: () => _b,
- getStartPositionOfLine: () => Iy,
- getStartPositionOfRange: () => O4,
- getStartsOnNewLine: () => Y4,
- getStaticPropertiesAndClassStaticBlock: () => $O,
- getStrictOptionValue: () => cu,
- getStringComparer: () => Kk,
- getSubPatternFromSpec: () => h5,
- getSuperCallFromStatement: () => HO,
- getSuperContainer: () => Xw,
- getSupportedCodeFixes: () => xq,
- getSupportedExtensions: () => B4,
- getSupportedExtensionsWithJsonIfResolveJsonModule: () => J3,
- getSwitchedType: () => PV,
- getSymbolId: () => na,
- getSymbolNameForPrivateIdentifier: () => v3,
- getSymbolTarget: () => kV,
- getSyntacticClassifications: () => Yse,
- getSyntacticModifierFlags: () => T0,
- getSyntacticModifierFlagsNoCache: () => OB,
- getSynthesizedDeepClone: () => Ja,
- getSynthesizedDeepCloneWithReplacements: () => _8,
- getSynthesizedDeepClones: () => Kb,
- getSynthesizedDeepClonesWithReplacements: () => CV,
- getSyntheticLeadingComments: () => UC,
- getSyntheticTrailingComments: () => Y3,
- getTargetLabel: () => UF,
- getTargetOfBindingOrAssignmentElement: () => $y,
- getTemporaryModuleResolutionState: () => kD,
- getTextOfConstantValue: () => cZ,
- getTextOfIdentifierOrLiteral: () => Jp,
- getTextOfJSDocComment: () => Cw,
- getTextOfJsxAttributeName: () => q3,
- getTextOfJsxNamespacedName: () => Q4,
- getTextOfNode: () => nc,
- getTextOfNodeFromSourceText: () => _4,
- getTextOfPropertyName: () => QT,
- getThisContainer: () => Lu,
- getThisParameter: () => Eb,
- getTokenAtPosition: () => xi,
- getTokenPosOfNode: () => Oy,
- getTokenSourceMapRange: () => ahe,
- getTouchingPropertyName: () => h_,
- getTouchingToken: () => T6,
- getTrailingCommentRanges: () => ky,
- getTrailingSemicolonDeferringWriter: () => EB,
- getTransformers: () => Ene,
- getTsBuildInfoEmitOutputFilePath: () => bv,
- getTsConfigObjectLiteralExpression: () => d4,
- getTsConfigPropArrayElementValue: () => y7,
- getTypeAnnotationNode: () => cK,
- getTypeArgumentOrTypeParameterList: () => yse,
- getTypeKeywordOfTypeOnlyImport: () => mV,
- getTypeNode: () => Aee,
- getTypeNodeIfAccessible: () => eP,
- getTypeParameterFromJsDoc: () => VZ,
- getTypeParameterOwner: () => tge,
- getTypesPackageName: () => jO,
- getUILocale: () => xX,
- getUniqueName: () => IS,
- getUniqueSymbolId: () => Fse,
- getUseDefineForClassFields: () => R3,
- getWatchErrorSummaryDiagnosticMessage: () => tU,
- getWatchFactory: () => DW,
- group: () => Zk,
- groupBy: () => dR,
- guessIndentation: () => XY,
- handleNoEmitOptions: () => WW,
- handleWatchOptionsConfigDirTemplateSubstitution: () => CO,
- hasAbstractModifier: () => wb,
- hasAccessorModifier: () => dm,
- hasAmbientModifier: () => IB,
- hasChangesInResolutions: () => Lj,
- hasContextSensitiveParameters: () => P5,
- hasDecorators: () => Ff,
- hasDocComment: () => gse,
- hasDynamicName: () => Dh,
- hasEffectiveModifier: () => Z_,
- hasEffectiveModifiers: () => NB,
- hasEffectiveReadonlyModifier: () => P4,
- hasExtension: () => tC,
- hasImplementationTSFileExtension: () => XK,
- hasIndexSignature: () => DV,
- hasInferredType: () => hee,
- hasInitializer: () => m0,
- hasInvalidEscape: () => kB,
- hasJSDocNodes: () => gf,
- hasJSDocParameterTags: () => TY,
- hasJSFileExtension: () => Ug,
- hasJsonModuleEmitEnabled: () => u5,
- hasOnlyExpressionInitializer: () => K2,
- hasOverrideModifier: () => $7,
- hasPossibleExternalModuleReference: () => pZ,
- hasProperty: () => co,
- hasPropertyAccessExpressionWithName: () => ZA,
- hasQuestionToken: () => tx,
- hasRecordedExternalHelpers: () => gte,
- hasResolutionModeOverride: () => pee,
- hasRestParameter: () => Aj,
- hasScopeMarker: () => zY,
- hasStaticModifier: () => tl,
- hasSyntacticModifier: () => Gn,
- hasSyntacticModifiers: () => fK,
- hasTSFileExtension: () => gx,
- hasTabstop: () => uee,
- hasTrailingDirectorySeparator: () => xy,
- hasType: () => YI,
- hasTypeArguments: () => wge,
- hasZeroOrOneAsteriskCharacter: () => KB,
- hostGetCanonicalFileName: () => S0,
- hostUsesCaseSensitiveFileNames: () => sx,
- idText: () => Nn,
- identifierIsThisKeyword: () => AB,
- identifierToKeywordKind: () => G2,
- identity: () => go,
- identitySourceMapConsumer: () => iW,
- ignoreSourceNewlines: () => EJ,
- ignoredPaths: () => kI,
- importFromModuleSpecifier: () => v4,
- importSyntaxAffectsModuleResolution: () => YB,
- indexOfAnyCharCode: () => _X,
- indexOfNode: () => mC,
- indicesOf: () => _I,
- inferredTypesContainingFile: () => RD,
- injectClassNamedEvaluationHelperBlockIfMissing: () => ZO,
- injectClassThisAssignmentIfMissing: () => Zre,
- insertImports: () => dV,
- insertSorted: () => my,
- insertStatementAfterCustomPrologue: () => eS,
- insertStatementAfterStandardPrologue: () => Tge,
- insertStatementsAfterCustomPrologue: () => Mj,
- insertStatementsAfterStandardPrologue: () => Mg,
- intersperse: () => rR,
- intrinsicTagNameToString: () => hJ,
- introducesArgumentsExoticObject: () => DZ,
- inverseJsxOptionMap: () => gA,
- isAbstractConstructorSymbol: () => wK,
- isAbstractModifier: () => Wee,
- isAccessExpression: () => xo,
- isAccessibilityModifier: () => rV,
- isAccessor: () => Ay,
- isAccessorModifier: () => Vee,
- isAliasableExpression: () => O7,
- isAmbientModule: () => Fu,
- isAmbientPropertyDeclaration: () => Hj,
- isAnyDirectorySeparator: () => XR,
- isAnyImportOrBareOrAccessedRequire: () => _Z,
- isAnyImportOrReExport: () => zw,
- isAnyImportOrRequireStatement: () => fZ,
- isAnyImportSyntax: () => XT,
- isAnySupportedFileExtension: () => Zge,
- isApplicableVersionedTypesKey: () => CA,
- isArgumentExpressionOfElementAccess: () => VU,
- isArray: () => us,
- isArrayBindingElement: () => qI,
- isArrayBindingOrAssignmentElement: () => Nw,
- isArrayBindingOrAssignmentPattern: () => kj,
- isArrayBindingPattern: () => w0,
- isArrayLiteralExpression: () => $l,
- isArrayLiteralOrObjectLiteralDestructuringPattern: () => F0,
- isArrayTypeNode: () => rA,
- isArrowFunction: () => Co,
- isAsExpression: () => iD,
- isAssertClause: () => Qee,
- isAssertEntry: () => hhe,
- isAssertionExpression: () => $1,
- isAssertsKeyword: () => Jee,
- isAssignmentDeclaration: () => h4,
- isAssignmentExpression: () => Dl,
- isAssignmentOperator: () => Ph,
- isAssignmentPattern: () => o4,
- isAssignmentTarget: () => b0,
- isAsteriskToken: () => K3,
- isAsyncFunction: () => k4,
- isAsyncModifier: () => tD,
- isAutoAccessorPropertyDeclaration: () => u_,
- isAwaitExpression: () => Hy,
- isAwaitKeyword: () => NJ,
- isBigIntLiteral: () => eD,
- isBinaryExpression: () => dn,
- isBinaryLogicalOperator: () => D3,
- isBinaryOperatorToken: () => kte,
- isBindableObjectDefinePropertyCall: () => sS,
- isBindableStaticAccessExpression: () => Tb,
- isBindableStaticElementAccessExpression: () => A7,
- isBindableStaticNameExpression: () => aS,
- isBindingElement: () => va,
- isBindingElementOfBareOrAccessedRequire: () => RZ,
- isBindingName: () => Y2,
- isBindingOrAssignmentElement: () => RY,
- isBindingOrAssignmentPattern: () => ww,
- isBindingPattern: () => As,
- isBlock: () => Cs,
- isBlockLike: () => ek,
- isBlockOrCatchScoped: () => Jj,
- isBlockScope: () => Gj,
- isBlockScopedContainerTopLevel: () => uZ,
- isBooleanLiteral: () => a4,
- isBreakOrContinueStatement: () => t4,
- isBreakStatement: () => dhe,
- isBuild: () => Oie,
- isBuildInfoFile: () => Dne,
- isBuilderProgram: () => nU,
- isBundle: () => ete,
- isCallChain: () => $2,
- isCallExpression: () => Fs,
- isCallExpressionTarget: () => jU,
- isCallLikeExpression: () => mb,
- isCallLikeOrFunctionLikeExpression: () => Cj,
- isCallOrNewExpression: () => am,
- isCallOrNewExpressionTarget: () => BU,
- isCallSignatureDeclaration: () => Dx,
- isCallToHelper: () => K4,
- isCaseBlock: () => cD,
- isCaseClause: () => XC,
- isCaseKeyword: () => qee,
- isCaseOrDefaultClause: () => XI,
- isCatchClause: () => Ub,
- isCatchClauseVariableDeclaration: () => lee,
- isCatchClauseVariableDeclarationOrBindingElement: () => zj,
- isCheckJsEnabledForFile: () => W4,
- isCircularBuildOrder: () => Xx,
- isClassDeclaration: () => Xc,
- isClassElement: () => _l,
- isClassExpression: () => $c,
- isClassInstanceProperty: () => LY,
- isClassLike: () => Zn,
- isClassMemberModifier: () => Sj,
- isClassNamedEvaluationHelperBlock: () => Hx,
- isClassOrTypeElement: () => VI,
- isClassStaticBlockDeclaration: () => oc,
- isClassThisAssignmentBlock: () => ND,
- isColonToken: () => jee,
- isCommaExpression: () => cA,
- isCommaListExpression: () => aD,
- isCommaSequence: () => dD,
- isCommaToken: () => Ree,
- isComment: () => KF,
- isCommonJsExportPropertyAssignment: () => g7,
- isCommonJsExportedExpression: () => CZ,
- isCompoundAssignment: () => PD,
- isComputedNonLiteralName: () => Ww,
- isComputedPropertyName: () => ma,
- isConciseBody: () => GI,
- isConditionalExpression: () => Ix,
- isConditionalTypeNode: () => Mb,
- isConstAssertion: () => yJ,
- isConstTypeReference: () => xd,
- isConstructSignatureDeclaration: () => tA,
- isConstructorDeclaration: () => Qo,
- isConstructorTypeNode: () => VC,
- isContextualKeyword: () => L7,
- isContinueStatement: () => phe,
- isCustomPrologue: () => Gw,
- isDebuggerStatement: () => mhe,
- isDeclaration: () => ql,
- isDeclarationBindingElement: () => Pw,
- isDeclarationFileName: () => wl,
- isDeclarationName: () => og,
- isDeclarationNameOfEnumOrNamespace: () => WB,
- isDeclarationReadonly: () => Vw,
- isDeclarationStatement: () => qY,
- isDeclarationWithTypeParameterChildren: () => Xj,
- isDeclarationWithTypeParameters: () => $j,
- isDecorator: () => dl,
- isDecoratorTarget: () => sse,
- isDefaultClause: () => uD,
- isDefaultImport: () => ex,
- isDefaultModifier: () => H5,
- isDefaultedExpandoInitializer: () => jZ,
- isDeleteExpression: () => Gee,
- isDeleteTarget: () => fB,
- isDeprecatedDeclaration: () => y9,
- isDestructuringAssignment: () => x0,
- isDiskPathRoot: () => QR,
- isDoStatement: () => fhe,
- isDocumentRegistryEntry: () => T8,
- isDotDotDotToken: () => V5,
- isDottedName: () => w3,
- isDynamicName: () => R7,
- isEffectiveExternalModule: () => $T,
- isEffectiveStrictModeSourceFile: () => qj,
- isElementAccessChain: () => mj,
- isElementAccessExpression: () => ko,
- isEmittedFileOfProgram: () => Fne,
- isEmptyArrayLiteral: () => bK,
- isEmptyBindingElement: () => mY,
- isEmptyBindingPattern: () => dY,
- isEmptyObjectLiteral: () => jB,
- isEmptyStatement: () => MJ,
- isEmptyStringLiteral: () => rB,
- isEntityName: () => l_,
- isEntityNameExpression: () => yo,
- isEnumConst: () => Y1,
- isEnumDeclaration: () => Bb,
- isEnumMember: () => A0,
- isEqualityOperatorKind: () => _9,
- isEqualsGreaterThanToken: () => Bee,
- isExclamationToken: () => eA,
- isExcludedFile: () => tre,
- isExclusivelyTypeOnlyImportOrExport: () => FW,
- isExpandoPropertyDeclaration: () => vx,
- isExportAssignment: () => wo,
- isExportDeclaration: () => Nc,
- isExportModifier: () => Cx,
- isExportName: () => oO,
- isExportNamespaceAsDefaultDeclaration: () => c7,
- isExportOrDefaultModifier: () => _A,
- isExportSpecifier: () => vu,
- isExportsIdentifier: () => iS,
- isExportsOrModuleExportsOrAlias: () => qb,
- isExpression: () => _t,
- isExpressionNode: () => Ed,
- isExpressionOfExternalModuleImportEqualsDeclaration: () => cse,
- isExpressionOfOptionalChainRoot: () => JI,
- isExpressionStatement: () => Pl,
- isExpressionWithTypeArguments: () => Oh,
- isExpressionWithTypeArgumentsInClassExtendsClause: () => Q7,
- isExternalModule: () => il,
- isExternalModuleAugmentation: () => yb,
- isExternalModuleImportEqualsDeclaration: () => Z1,
- isExternalModuleIndicator: () => Ow,
- isExternalModuleNameRelative: () => Sl,
- isExternalModuleReference: () => Fh,
- isExternalModuleSymbol: () => fC,
- isExternalOrCommonJsModule: () => X_,
- isFileLevelReservedGeneratedIdentifier: () => Dw,
- isFileLevelUniqueName: () => a7,
- isFileProbablyExternalModule: () => dA,
- isFirstDeclarationOfSymbolParameter: () => bV,
- isFixablePromiseHandler: () => KV,
- isForInOrOfStatement: () => Z2,
- isForInStatement: () => Z5,
- isForInitializer: () => ip,
- isForOfStatement: () => nA,
- isForStatement: () => fv,
- isFullSourceFile: () => sg,
- isFunctionBlock: () => vb,
- isFunctionBody: () => Dj,
- isFunctionDeclaration: () => Ec,
- isFunctionExpression: () => vo,
- isFunctionExpressionOrArrowFunction: () => Wy,
- isFunctionLike: () => ys,
- isFunctionLikeDeclaration: () => no,
- isFunctionLikeKind: () => WT,
- isFunctionLikeOrClassStaticBlockDeclaration: () => lC,
- isFunctionOrConstructorTypeNode: () => MY,
- isFunctionOrModuleBlock: () => Tj,
- isFunctionSymbol: () => zZ,
- isFunctionTypeNode: () => lg,
- isGeneratedIdentifier: () => jo,
- isGeneratedPrivateIdentifier: () => Q2,
- isGetAccessor: () => d0,
- isGetAccessorDeclaration: () => Lf,
- isGetOrSetAccessorDeclaration: () => Ew,
- isGlobalScopeAugmentation: () => ig,
- isGlobalSourceFile: () => g0,
- isGrammarError: () => nZ,
- isHeritageClause: () => ef,
- isHoistedFunction: () => d7,
- isHoistedVariableStatement: () => m7,
- isIdentifier: () => Oe,
- isIdentifierANonContextualKeyword: () => hB,
- isIdentifierName: () => XZ,
- isIdentifierOrThisTypeNode: () => bte,
- isIdentifierPart: () => Th,
- isIdentifierStart: () => eg,
- isIdentifierText: () => k_,
- isIdentifierTypePredicate: () => PZ,
- isIdentifierTypeReference: () => iee,
- isIfStatement: () => _v,
- isIgnoredFileFromWildCardWatching: () => jA,
- isImplicitGlob: () => rJ,
- isImportAttribute: () => Yee,
- isImportAttributeName: () => FY,
- isImportAttributes: () => hS,
- isImportCall: () => hf,
- isImportClause: () => Ad,
- isImportDeclaration: () => ic,
- isImportEqualsDeclaration: () => gl,
- isImportKeyword: () => nD,
- isImportMeta: () => yC,
- isImportOrExportSpecifier: () => G1,
- isImportOrExportSpecifierName: () => Ose,
- isImportSpecifier: () => Zu,
- isImportTypeAssertionContainer: () => ghe,
- isImportTypeNode: () => bm,
- isImportableFile: () => zV,
- isInComment: () => O0,
- isInCompoundLikeAssignment: () => _B,
- isInExpressionContext: () => k7,
- isInJSDoc: () => e3,
- isInJSFile: () => cn,
- isInJSXText: () => mse,
- isInJsonFile: () => E7,
- isInNonReferenceComment: () => Sse,
- isInReferenceComment: () => bse,
- isInRightSideOfInternalImportEqualsDeclaration: () => zF,
- isInString: () => Qx,
- isInTemplateString: () => ZU,
- isInTopLevelContext: () => S7,
- isInTypeQuery: () => ax,
- isIncrementalBuildInfo: () => VA,
- isIncrementalBundleEmitBuildInfo: () => Kne,
- isIncrementalCompilation: () => Nb,
- isIndexSignatureDeclaration: () => Fb,
- isIndexedAccessTypeNode: () => Rb,
- isInferTypeNode: () => pS,
- isInfinityOrNaNString: () => G4,
- isInitializedProperty: () => AA,
- isInitializedVariable: () => O3,
- isInsideJsxElement: () => YF,
- isInsideJsxElementOrAttribute: () => dse,
- isInsideNodeModules: () => g8,
- isInsideTemplateLiteral: () => i8,
- isInstanceOfExpression: () => Y7,
- isInstantiatedModule: () => Zz,
- isInterfaceDeclaration: () => Xl,
- isInternalDeclaration: () => QY,
- isInternalModuleImportEqualsDeclaration: () => nS,
- isInternalName: () => ZJ,
- isIntersectionTypeNode: () => Ax,
- isIntrinsicJsxName: () => AC,
- isIterationStatement: () => Ny,
- isJSDoc: () => Id,
- isJSDocAllType: () => nte,
- isJSDocAugmentsTag: () => Mx,
- isJSDocAuthorTag: () => She,
- isJSDocCallbackTag: () => JJ,
- isJSDocClassTag: () => ste,
- isJSDocCommentContainingNode: () => QI,
- isJSDocConstructSignature: () => CC,
- isJSDocDeprecatedTag: () => qJ,
- isJSDocEnumTag: () => sA,
- isJSDocFunctionType: () => YC,
- isJSDocImplementsTag: () => iO,
- isJSDocImportTag: () => Cm,
- isJSDocIndexSignature: () => P7,
- isJSDocLikeText: () => oz,
- isJSDocLink: () => tte,
- isJSDocLinkCode: () => rte,
- isJSDocLinkLike: () => qT,
- isJSDocLinkPlain: () => vhe,
- isJSDocMemberName: () => dv,
- isJSDocNameReference: () => _D,
- isJSDocNamepathType: () => bhe,
- isJSDocNamespaceBody: () => mge,
- isJSDocNode: () => uC,
- isJSDocNonNullableType: () => eO,
- isJSDocNullableType: () => QC,
- isJSDocOptionalParameter: () => N5,
- isJSDocOptionalType: () => BJ,
- isJSDocOverloadTag: () => ZC,
- isJSDocOverrideTag: () => rO,
- isJSDocParameterTag: () => dp,
- isJSDocPrivateTag: () => WJ,
- isJSDocPropertyLikeTag: () => r4,
- isJSDocPropertyTag: () => ate,
- isJSDocProtectedTag: () => UJ,
- isJSDocPublicTag: () => zJ,
- isJSDocReadonlyTag: () => VJ,
- isJSDocReturnTag: () => nO,
- isJSDocSatisfiesExpression: () => mJ,
- isJSDocSatisfiesTag: () => sO,
- isJSDocSeeTag: () => The,
- isJSDocSignature: () => Lh,
- isJSDocTag: () => _C,
- isJSDocTemplateTag: () => qp,
- isJSDocThisTag: () => HJ,
- isJSDocThrowsTag: () => khe,
- isJSDocTypeAlias: () => Bp,
- isJSDocTypeAssertion: () => xS,
- isJSDocTypeExpression: () => pv,
- isJSDocTypeLiteral: () => bS,
- isJSDocTypeTag: () => fD,
- isJSDocTypedefTag: () => SS,
- isJSDocUnknownTag: () => xhe,
- isJSDocUnknownType: () => ite,
- isJSDocVariadicType: () => tO,
- isJSXTagName: () => SC,
- isJsonEqual: () => E5,
- isJsonSourceFile: () => Rp,
- isJsxAttribute: () => km,
- isJsxAttributeLike: () => $I,
- isJsxAttributeName: () => fee,
- isJsxAttributes: () => Wb,
- isJsxChild: () => Mw,
- isJsxClosingElement: () => Jb,
- isJsxClosingFragment: () => Kee,
- isJsxElement: () => Gg,
- isJsxExpression: () => lD,
- isJsxFragment: () => zb,
- isJsxNamespacedName: () => Nd,
- isJsxOpeningElement: () => xm,
- isJsxOpeningFragment: () => vS,
- isJsxOpeningLikeElement: () => ou,
- isJsxOpeningLikeElementTagName: () => ase,
- isJsxSelfClosingElement: () => yS,
- isJsxSpreadAttribute: () => Lx,
- isJsxTagNameExpression: () => c4,
- isJsxText: () => xx,
- isJumpStatementTarget: () => KA,
- isKeyword: () => p_,
- isKeywordOrPunctuation: () => F7,
- isKnownSymbol: () => b3,
- isLabelName: () => WU,
- isLabelOfLabeledStatement: () => zU,
- isLabeledStatement: () => Gy,
- isLateVisibilityPaintedStatement: () => u7,
- isLeftHandSideExpression: () => __,
- isLet: () => p7,
- isLineBreak: () => gu,
- isLiteralComputedPropertyDeclarationName: () => g3,
- isLiteralExpression: () => X2,
- isLiteralExpressionOfObject: () => vj,
- isLiteralImportTypeNode: () => h0,
- isLiteralKind: () => n4,
- isLiteralNameOfPropertyDeclarationOrIndexAccess: () => VF,
- isLiteralTypeLiteral: () => JY,
- isLiteralTypeNode: () => P0,
- isLocalName: () => Mh,
- isLogicalOperator: () => hK,
- isLogicalOrCoalescingAssignmentExpression: () => FB,
- isLogicalOrCoalescingAssignmentOperator: () => w4,
- isLogicalOrCoalescingBinaryExpression: () => P3,
- isLogicalOrCoalescingBinaryOperator: () => X7,
- isMappedTypeNode: () => mS,
- isMemberName: () => Fg,
- isMetaProperty: () => sD,
- isMethodDeclaration: () => hc,
- isMethodOrAccessor: () => UT,
- isMethodSignature: () => vm,
- isMinusToken: () => AJ,
- isMissingDeclaration: () => yhe,
- isMissingPackageJsonInfo: () => pre,
- isModifier: () => ra,
- isModifierKind: () => wy,
- isModifierLike: () => Bo,
- isModuleAugmentationExternal: () => Uj,
- isModuleBlock: () => Sm,
- isModuleBody: () => WY,
- isModuleDeclaration: () => zc,
- isModuleExportName: () => K5,
- isModuleExportsAccessExpression: () => jg,
- isModuleIdentifier: () => sB,
- isModuleName: () => xte,
- isModuleOrEnumDeclaration: () => Fw,
- isModuleReference: () => GY,
- isModuleSpecifierLike: () => s9,
- isModuleWithStringLiteralName: () => l7,
- isNameOfFunctionDeclaration: () => HU,
- isNameOfModuleDeclaration: () => qU,
- isNamedDeclaration: () => Vl,
- isNamedEvaluation: () => Q_,
- isNamedEvaluationSource: () => yB,
- isNamedExportBindings: () => hj,
- isNamedExports: () => pp,
- isNamedImportBindings: () => Pj,
- isNamedImports: () => Tm,
- isNamedImportsOrExports: () => i5,
- isNamedTupleMember: () => qC,
- isNamespaceBody: () => dge,
- isNamespaceExport: () => ug,
- isNamespaceExportDeclaration: () => iA,
- isNamespaceImport: () => Hg,
- isNamespaceReexportDeclaration: () => MZ,
- isNewExpression: () => jb,
- isNewExpressionTarget: () => UD,
- isNoSubstitutionTemplateLiteral: () => fS,
- isNodeArray: () => pb,
- isNodeArrayMultiLine: () => EK,
- isNodeDescendantOf: () => kb,
- isNodeKind: () => WI,
- isNodeLikeSystem: () => CR,
- isNodeModulesDirectory: () => PI,
- isNodeWithPossibleHoistedDeclaration: () => GZ,
- isNonContextualKeyword: () => gB,
- isNonGlobalAmbientModule: () => Wj,
- isNonNullAccess: () => _ee,
- isNonNullChain: () => zI,
- isNonNullExpression: () => Ox,
- isNonStaticMethodOrAccessorWithPrivateName: () => qre,
- isNotEmittedStatement: () => Zee,
- isNullishCoalesce: () => gj,
- isNumber: () => yy,
- isNumericLiteral: () => d_,
- isNumericLiteralName: () => qg,
- isObjectBindingElementWithoutPropertyName: () => c8,
- isObjectBindingOrAssignmentElement: () => Aw,
- isObjectBindingOrAssignmentPattern: () => xj,
- isObjectBindingPattern: () => Mf,
- isObjectLiteralElement: () => wj,
- isObjectLiteralElementLike: () => kh,
- isObjectLiteralExpression: () => Ks,
- isObjectLiteralMethod: () => jp,
- isObjectLiteralOrClassExpressionMethodOrAccessor: () => h7,
- isObjectTypeDeclaration: () => _x,
- isOmittedExpression: () => ml,
- isOptionalChain: () => hu,
- isOptionalChainRoot: () => KE,
- isOptionalDeclaration: () => WC,
- isOptionalJSDocPropertyLikeTag: () => V3,
- isOptionalTypeNode: () => G5,
- isOuterExpression: () => cO,
- isOutermostOptionalChain: () => e4,
- isOverrideModifier: () => Uee,
- isPackageJsonInfo: () => IO,
- isPackedArrayLiteral: () => pJ,
- isParameter: () => Ii,
- isParameterPropertyDeclaration: () => G_,
- isParameterPropertyModifier: () => s4,
- isParenthesizedExpression: () => Yu,
- isParenthesizedTypeNode: () => dS,
- isParseTreeNode: () => ZE,
- isPartOfParameterDeclaration: () => iv,
- isPartOfTypeNode: () => um,
- isPartOfTypeQuery: () => C7,
- isPartiallyEmittedExpression: () => LJ,
- isPatternMatch: () => mI,
- isPinnedComment: () => o7,
- isPlainJsFile: () => u4,
- isPlusToken: () => wJ,
- isPossiblyTypeArgumentPosition: () => n8,
- isPostfixUnaryExpression: () => FJ,
- isPrefixUnaryExpression: () => uv,
- isPrimitiveLiteralValue: () => F5,
- isPrivateIdentifier: () => Di,
- isPrivateIdentifierClassElementDeclaration: () => Ou,
- isPrivateIdentifierPropertyAccessExpression: () => cC,
- isPrivateIdentifierSymbol: () => ZZ,
- isProgramUptoDate: () => JW,
- isPrologueDirective: () => lm,
- isPropertyAccessChain: () => BI,
- isPropertyAccessEntityNameExpression: () => A3,
- isPropertyAccessExpression: () => Cn,
- isPropertyAccessOrQualifiedName: () => Iw,
- isPropertyAccessOrQualifiedNameOrImportTypeNode: () => jY,
- isPropertyAssignment: () => Qc,
- isPropertyDeclaration: () => cs,
- isPropertyName: () => Bc,
- isPropertyNameLiteral: () => fm,
- isPropertySignature: () => m_,
- isPrototypeAccess: () => Ry,
- isPrototypePropertyAssignment: () => c3,
- isPunctuation: () => mB,
- isPushOrUnshiftIdentifier: () => vB,
- isQualifiedName: () => Xu,
- isQuestionDotToken: () => q5,
- isQuestionOrExclamationToken: () => vte,
- isQuestionOrPlusOrMinusToken: () => Tte,
- isQuestionToken: () => Vy,
- isReadonlyKeyword: () => zee,
- isReadonlyKeywordOrPlusOrMinusToken: () => Ste,
- isRecognizedTripleSlashComment: () => Rj,
- isReferenceFileLocation: () => m6,
- isReferencedFile: () => Sv,
- isRegularExpressionLiteral: () => DJ,
- isRequireCall: () => f_,
- isRequireVariableStatement: () => r3,
- isRestParameter: () => rg,
- isRestTypeNode: () => $5,
- isReturnStatement: () => Up,
- isReturnStatementWithFixablePromiseHandler: () => E9,
- isRightSideOfAccessExpression: () => RB,
- isRightSideOfInstanceofExpression: () => vK,
- isRightSideOfPropertyAccess: () => b6,
- isRightSideOfQualifiedName: () => ose,
- isRightSideOfQualifiedNameOrPropertyAccess: () => A4,
- isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => yK,
- isRootedDiskPath: () => H_,
- isSameEntityName: () => TC,
- isSatisfiesExpression: () => Y5,
- isSemicolonClassElement: () => $ee,
- isSetAccessor: () => om,
- isSetAccessorDeclaration: () => K_,
- isShiftOperatorOrHigher: () => iz,
- isShorthandAmbientModuleSymbol: () => Jw,
- isShorthandPropertyAssignment: () => uu,
- isSideEffectImport: () => bJ,
- isSignedNumericLiteral: () => M7,
- isSimpleCopiableExpression: () => Hb,
- isSimpleInlineableExpression: () => fg,
- isSimpleParameterList: () => NA,
- isSingleOrDoubleQuote: () => n3,
- isSourceElement: () => dee,
- isSourceFile: () => Si,
- isSourceFileFromLibrary: () => w6,
- isSourceFileJS: () => Gu,
- isSourceFileNotJson: () => D7,
- isSourceMapping: () => Wre,
- isSpecialPropertyDeclaration: () => JZ,
- isSpreadAssignment: () => $g,
- isSpreadElement: () => fp,
- isStatement: () => bi,
- isStatementButNotDeclaration: () => Lw,
- isStatementOrBlock: () => HY,
- isStatementWithLocals: () => rZ,
- isStatic: () => zs,
- isStaticModifier: () => Ex,
- isString: () => _s,
- isStringANonContextualKeyword: () => ix,
- isStringAndEmptyAnonymousObjectIntersection: () => vse,
- isStringDoubleQuoted: () => w7,
- isStringLiteral: () => oa,
- isStringLiteralLike: () => Xa,
- isStringLiteralOrJsxExpression: () => $Y,
- isStringLiteralOrTemplate: () => Bse,
- isStringOrNumericLiteralLike: () => Of,
- isStringOrRegularExpressionOrTemplateLiteral: () => tV,
- isStringTextContainingNode: () => bj,
- isSuperCall: () => rS,
- isSuperKeyword: () => rD,
- isSuperProperty: () => C_,
- isSupportedSourceFileName: () => ZK,
- isSwitchStatement: () => oD,
- isSyntaxList: () => KC,
- isSyntheticExpression: () => _he,
- isSyntheticReference: () => Fx,
- isTagName: () => UU,
- isTaggedTemplateExpression: () => lv,
- isTaggedTemplateTag: () => ise,
- isTemplateExpression: () => X5,
- isTemplateHead: () => kx,
- isTemplateLiteral: () => VT,
- isTemplateLiteralKind: () => Dy,
- isTemplateLiteralToken: () => IY,
- isTemplateLiteralTypeNode: () => Hee,
- isTemplateLiteralTypeSpan: () => IJ,
- isTemplateMiddle: () => PJ,
- isTemplateMiddleOrTemplateTail: () => UI,
- isTemplateSpan: () => $C,
- isTemplateTail: () => U5,
- isTextWhiteSpaceLike: () => Cse,
- isThis: () => S6,
- isThisContainerOrFunctionBlock: () => OZ,
- isThisIdentifier: () => Ly,
- isThisInTypeQuery: () => Pb,
- isThisInitializedDeclaration: () => T7,
- isThisInitializedObjectBindingExpression: () => LZ,
- isThisProperty: () => Qw,
- isThisTypeNode: () => HC,
- isThisTypeParameter: () => $4,
- isThisTypePredicate: () => wZ,
- isThrowStatement: () => jJ,
- isToken: () => zT,
- isTokenKind: () => yj,
- isTraceEnabled: () => Xy,
- isTransientSymbol: () => Lg,
- isTrivia: () => PC,
- isTryStatement: () => gS,
- isTupleTypeNode: () => wx,
- isTypeAlias: () => _3,
- isTypeAliasDeclaration: () => Vp,
- isTypeAssertionExpression: () => OJ,
- isTypeDeclaration: () => hx,
- isTypeElement: () => db,
- isTypeKeyword: () => GD,
- isTypeKeywordTokenOrIdentifier: () => r9,
- isTypeLiteralNode: () => Qu,
- isTypeNode: () => fi,
- isTypeNodeKind: () => HB,
- isTypeOfExpression: () => GC,
- isTypeOnlyExportDeclaration: () => OY,
- isTypeOnlyImportDeclaration: () => i4,
- isTypeOnlyImportOrExportDeclaration: () => Py,
- isTypeOperatorNode: () => cv,
- isTypeParameterDeclaration: () => zo,
- isTypePredicateNode: () => Px,
- isTypeQueryNode: () => Lb,
- isTypeReferenceNode: () => vf,
- isTypeReferenceType: () => ZI,
- isTypeUsableAsPropertyName: () => up,
- isUMDExportSymbol: () => n5,
- isUnaryExpression: () => Ej,
- isUnaryExpressionWithWrite: () => BY,
- isUnicodeIdentifierStart: () => AI,
- isUnionTypeNode: () => qy,
- isUrl: () => $Q,
- isValidBigIntString: () => D5,
- isValidESSymbolDeclaration: () => EZ,
- isValidTypeOnlyAliasUseSite: () => av,
- isValueSignatureDeclaration: () => nx,
- isVarAwaitUsing: () => qw,
- isVarConst: () => hC,
- isVarConstLike: () => SZ,
- isVarUsing: () => Hw,
- isVariableDeclaration: () => ii,
- isVariableDeclarationInVariableStatement: () => p4,
- isVariableDeclarationInitializedToBareOrAccessedRequire: () => Sb,
- isVariableDeclarationInitializedToRequire: () => t3,
- isVariableDeclarationList: () => Fl,
- isVariableLike: () => YT,
- isVariableLikeOrAccessor: () => kZ,
- isVariableStatement: () => yc,
- isVoidExpression: () => Nx,
- isWatchSet: () => UB,
- isWhileStatement: () => RJ,
- isWhiteSpaceLike: () => Ng,
- isWhiteSpaceSingleLine: () => sm,
- isWithStatement: () => Xee,
- isWriteAccess: () => ux,
- isWriteOnlyAccess: () => r5,
- isYieldExpression: () => Q5,
- jsxModeNeedsExplicitImport: () => jV,
- keywordPart: () => sf,
- last: () => _a,
- lastOrUndefined: () => Ro,
- length: () => Nr,
- libMap: () => pz,
- libs: () => mO,
- lineBreakPart: () => E6,
- loadModuleFromGlobalCache: () => Cre,
- loadWithModeAwareCache: () => JA,
- makeIdentifierFromModuleName: () => lZ,
- makeImport: () => t1,
- makeStringLiteral: () => $D,
- mangleScopedPackageName: () => l6,
- map: () => lr,
- mapAllOrFail: () => sR,
- mapDefined: () => Ai,
- mapDefinedIterator: () => dy,
- mapEntries: () => dX,
- mapIterator: () => wE,
- mapOneOrMany: () => FV,
- mapToDisplayParts: () => xv,
- matchFiles: () => nJ,
- matchPatternOrExact: () => oJ,
- matchedText: () => PX,
- matchesExclude: () => PO,
- maxBy: () => hR,
- maybeBind: () => Ms,
- maybeSetLocalizedDiagnosticMessages: () => LK,
- memoize: () => Iu,
- memoizeOne: () => im,
- min: () => yR,
- minAndMax: () => tee,
- missingFileModifiedTime: () => q_,
- modifierToFlag: () => cx,
- modifiersToFlags: () => mm,
- moduleExportNameIsDefault: () => ng,
- moduleExportNameTextEscaped: () => hb,
- moduleExportNameTextUnescaped: () => Fy,
- moduleOptionDeclaration: () => Lte,
- moduleResolutionIsEqualTo: () => eZ,
- moduleResolutionNameAndModeGetter: () => cF,
- moduleResolutionOptionDeclarations: () => mz,
- moduleResolutionSupportsPackageJsonExportsAndImports: () => RC,
- moduleResolutionUsesNodeModules: () => n9,
- moduleSpecifierToValidIdentifier: () => y8,
- moduleSpecifiers: () => N0,
- moduleSymbolToValidIdentifier: () => h8,
- moveEmitHelpers: () => Pee,
- moveRangeEnd: () => e5,
- moveRangePastDecorators: () => wh,
- moveRangePastModifiers: () => gm,
- moveRangePos: () => sv,
- moveSyntheticComments: () => Cee,
- mutateMap: () => M4,
- mutateMapSkippingNewValues: () => Jg,
- needsParentheses: () => l9,
- needsScopeMarker: () => HI,
- newCaseClauseTracker: () => S9,
- newPrivateEnvironment: () => Gre,
- noEmitNotification: () => FA,
- noEmitSubstitution: () => OD,
- noTransformers: () => Cne,
- noTruncationMaximumTruncationLength: () => Ij,
- nodeCanBeDecorated: () => Zw,
- nodeHasName: () => xw,
- nodeIsDecorated: () => bC,
- nodeIsMissing: () => rc,
- nodeIsPresent: () => Mp,
- nodeIsSynthesized: () => fo,
- nodeModuleNameResolver: () => yre,
- nodeModulesPathPart: () => Xg,
- nodeNextJsonConfigResolver: () => vre,
- nodeOrChildIsDecorated: () => Kw,
- nodeOverlapsWithStartEnd: () => qF,
- nodePosToString: () => yge,
- nodeSeenTracker: () => x6,
- nodeStartsNewLexicalEnvironment: () => bB,
- noop: () => ja,
- noopFileWatcher: () => JD,
- normalizePath: () => Os,
- normalizeSlashes: () => Wl,
- normalizeSpans: () => oj,
- not: () => hI,
- notImplemented: () => Vs,
- notImplementedResolver: () => Ane,
- nullNodeConverters: () => Tee,
- nullParenthesizerRules: () => bee,
- nullTransformationContext: () => MA,
- objectAllocator: () => Gl,
- operatorPart: () => QD,
- optionDeclarations: () => Od,
- optionMapToObject: () => TO,
- optionsAffectingProgramStructure: () => Jte,
- optionsForBuild: () => hz,
- optionsForWatch: () => zx,
- optionsHaveChanges: () => pC,
- or: () => Nf,
- orderedRemoveItem: () => OE,
- orderedRemoveItemAt: () => Ty,
- packageIdToPackageName: () => i7,
- packageIdToString: () => Q1,
- parameterIsThisKeyword: () => Db,
- parameterNamePart: () => Dse,
- parseBaseNodeFactory: () => wte,
- parseBigInt: () => nee,
- parseBuildCommand: () => $te,
- parseCommandLine: () => Hte,
- parseCommandLineWorker: () => vz,
- parseConfigFileTextToJson: () => Sz,
- parseConfigFileWithSystem: () => pie,
- parseConfigHostFromCompilerHostLike: () => mF,
- parseCustomTypeOption: () => vO,
- parseIsolatedEntityName: () => Jx,
- parseIsolatedJSDocComment: () => Nte,
- parseJSDocTypeExpressionForTests: () => $he,
- parseJsonConfigFileContent: () => x0e,
- parseJsonSourceFileConfigFileContent: () => SA,
- parseJsonText: () => mA,
- parseListTypeOption: () => Vte,
- parseNodeFactory: () => gv,
- parseNodeModuleFromPath: () => kA,
- parsePackageName: () => MO,
- parsePseudoBigInt: () => V4,
- parseValidBigInt: () => _J,
- pasteEdits: () => FH,
- patchWriteFileEnsuringDirectory: () => GQ,
- pathContainsNodeModules: () => Yy,
- pathIsAbsolute: () => UE,
- pathIsBareSpecifier: () => YR,
- pathIsRelative: () => If,
- patternText: () => DX,
- performIncrementalCompilation: () => die,
- performance: () => MX,
- positionBelongsToNode: () => $U,
- positionIsASICandidate: () => f9,
- positionIsSynthesized: () => Pd,
- positionsAreOnSameLine: () => cp,
- preProcessFile: () => Mbe,
- probablyUsesSemicolons: () => d8,
- processCommentPragmas: () => _z,
- processPragmasIntoFields: () => fz,
- processTaggedTemplateExpression: () => fW,
- programContainsEsModules: () => xse,
- programContainsModules: () => Tse,
- projectReferenceIsEqualTo: () => Oj,
- propertyNamePart: () => Pse,
- pseudoBigIntToString: () => Ib,
- punctuationPart: () => Tu,
- pushIfUnique: () => tp,
- quote: () => KD,
- quotePreferenceFromString: () => _V,
- rangeContainsPosition: () => VD,
- rangeContainsPositionExclusive: () => e8,
- rangeContainsRange: () => nf,
- rangeContainsRangeExclusive: () => lse,
- rangeContainsStartEnd: () => t8,
- rangeEndIsOnSameLineAsRangeStart: () => I3,
- rangeEndPositionsAreOnSameLine: () => kK,
- rangeEquals: () => uR,
- rangeIsOnSingleLine: () => lS,
- rangeOfNode: () => lJ,
- rangeOfTypeParameters: () => uJ,
- rangeOverlapsWithStartEnd: () => qD,
- rangeStartIsOnSameLineAsRangeEnd: () => CK,
- rangeStartPositionsAreOnSameLine: () => t5,
- readBuilderProgram: () => DF,
- readConfigFile: () => vA,
- readJson: () => I4,
- readJsonConfigFile: () => Xte,
- readJsonOrUndefined: () => BB,
- reduceEachLeadingCommentRange: () => rY,
- reduceEachTrailingCommentRange: () => nY,
- reduceLeft: () => Hu,
- reduceLeftIterator: () => uX,
- reducePathComponents: () => V2,
- refactor: () => rk,
- regExpEscape: () => Gge,
- regularExpressionFlagToCharacterCode: () => Hme,
- relativeComplement: () => mX,
- removeAllComments: () => X3,
- removeEmitHelper: () => ohe,
- removeExtension: () => W3,
- removeFileExtension: () => $u,
- removeIgnoredPath: () => vF,
- removeMinAndVersionNumbers: () => SR,
- removePrefix: () => FE,
- removeSuffix: () => eC,
- removeTrailingDirectorySeparator: () => W1,
- repeatString: () => a8,
- replaceElement: () => pR,
- replaceFirstStar: () => uS,
- resolutionExtensionIsTSOrJson: () => J4,
- resolveConfigFileProjectName: () => hU,
- resolveJSModule: () => mre,
- resolveLibrary: () => FO,
- resolveModuleName: () => Vx,
- resolveModuleNameFromCache: () => K0e,
- resolvePackageNameToPackageJson: () => Iz,
- resolvePath: () => z1,
- resolveProjectReferencePath: () => g6,
- resolveTripleslashReference: () => wW,
- resolveTypeReferenceDirective: () => _re,
- resolvingEmptyArray: () => Nj,
- returnFalse: () => nm,
- returnNoopFileWatcher: () => zD,
- returnTrue: () => B1,
- returnUndefined: () => lb,
- returnsPromise: () => ZV,
- sameFlatMap: () => fX,
- sameMap: () => qc,
- sameMapping: () => Uye,
- scanTokenAtPosition: () => bZ,
- scanner: () => ju,
- semanticDiagnosticsOptionDeclarations: () => Rte,
- serializeCompilerOptions: () => xO,
- server: () => UDe,
- servicesVersion: () => ESe,
- setCommentRange: () => nl,
- setConfigFileInOptions: () => Dz,
- setConstantValue: () => Dee,
- setEmitFlags: () => an,
- setGetSourceFileAsHashVersioned: () => EF,
- setIdentifierAutoGenerate: () => Z3,
- setIdentifierGeneratedImportReference: () => Nee,
- setIdentifierTypeArguments: () => D0,
- setInternalEmitFlags: () => Q3,
- setLocalizedDiagnosticMessages: () => FK,
- setNodeChildren: () => ote,
- setNodeFlags: () => aee,
- setObjectAllocator: () => OK,
- setOriginalNode: () => kn,
- setParent: () => Aa,
- setParentRecursive: () => Nh,
- setPrivateIdentifier: () => ES,
- setSnippetElement: () => CJ,
- setSourceMapRange: () => da,
- setStackTraceLimit: () => Ame,
- setStartsOnNewLine: () => R5,
- setSyntheticLeadingComments: () => ov,
- setSyntheticTrailingComments: () => Sx,
- setSys: () => Mme,
- setSysLog: () => VQ,
- setTextRange: () => lt,
- setTextRangeEnd: () => zC,
- setTextRangePos: () => q4,
- setTextRangePosEnd: () => wd,
- setTextRangePosWidth: () => fJ,
- setTokenSourceMapRange: () => kee,
- setTypeNode: () => wee,
- setUILocale: () => kX,
- setValueDeclaration: () => l3,
- shouldAllowImportingTsExtension: () => u6,
- shouldPreserveConstEnums: () => jy,
- shouldUseUriStyleNodeCoreModules: () => v9,
- showModuleSpecifier: () => AK,
- signatureHasRestParameter: () => Su,
- signatureToDisplayParts: () => TV,
- single: () => fR,
- singleElementArray: () => MT,
- singleIterator: () => pX,
- singleOrMany: () => Ym,
- singleOrUndefined: () => Qm,
- skipAlias: () => Hl,
- skipConstraint: () => cV,
- skipOuterExpressions: () => Dc,
- skipParentheses: () => Ba,
- skipPartiallyEmittedExpressions: () => ud,
- skipTrivia: () => aa,
- skipTypeChecking: () => JC,
- skipTypeCheckingIgnoringNoCheck: () => ree,
- skipTypeParentheses: () => b4,
- skipWhile: () => AX,
- sliceAfter: () => cJ,
- some: () => ut,
- sortAndDeduplicate: () => IE,
- sortAndDeduplicateDiagnostics: () => sC,
- sourceFileAffectingCompilerOptions: () => gz,
- sourceFileMayBeEmitted: () => cS,
- sourceMapCommentRegExp: () => eW,
- sourceMapCommentRegExpDontCareLineStart: () => Bre,
- spacePart: () => uc,
- spanMap: () => aR,
- startEndContainsRange: () => GU,
- startEndOverlapsWithStartEnd: () => HF,
- startOnNewLine: () => bu,
- startTracing: () => JX,
- startsWith: () => Ui,
- startsWithDirectory: () => ej,
- startsWithUnderscore: () => RV,
- startsWithUseStrict: () => dte,
- stringContainsAt: () => Hse,
- stringToToken: () => H2,
- stripQuotes: () => ap,
- supportedDeclarationExtensions: () => T5,
- supportedJSExtensionsFlat: () => jC,
- supportedLocaleDirectories: () => hY,
- supportedTSExtensionsFlat: () => iJ,
- supportedTSImplementationExtensions: () => B3,
- suppressLeadingAndTrailingTrivia: () => af,
- suppressLeadingTrivia: () => EV,
- suppressTrailingTrivia: () => Mse,
- symbolEscapedNameNoDefault: () => i9,
- symbolName: () => mc,
- symbolNameNoDefault: () => pV,
- symbolToDisplayParts: () => YD,
- sys: () => ll,
- sysLog: () => uw,
- tagNamesAreEquivalent: () => yv,
- takeWhile: () => kR,
- targetOptionDeclaration: () => dz,
- testFormatSettings: () => nbe,
- textChangeRangeIsUnchanged: () => fY,
- textChangeRangeNewSpan: () => YE,
- textChanges: () => sn,
- textOrKeywordPart: () => SV,
- textPart: () => Jf,
- textRangeContainsPositionInclusive: () => vw,
- textRangeContainsTextSpan: () => aY,
- textRangeIntersectsWithTextSpan: () => uY,
- textSpanContainsPosition: () => sj,
- textSpanContainsTextRange: () => aj,
- textSpanContainsTextSpan: () => sY,
- textSpanEnd: () => ec,
- textSpanIntersection: () => _Y,
- textSpanIntersectsWith: () => bw,
- textSpanIntersectsWithPosition: () => lY,
- textSpanIntersectsWithTextSpan: () => cY,
- textSpanIsEmpty: () => iY,
- textSpanOverlap: () => oY,
- textSpanOverlapsWith: () => ege,
- textSpansEqual: () => C6,
- textToKeywordObj: () => wI,
- timestamp: () => lo,
- toArray: () => FT,
- toBuilderFileEmit: () => rie,
- toBuilderStateFileInfoForMultiEmit: () => tie,
- toEditorSettings: () => D8,
- toFileNameLowerCase: () => vy,
- toPath: () => uo,
- toProgramEmitPending: () => nie,
- toSorted: () => V_,
- tokenIsIdentifierOrKeyword: () => c_,
- tokenIsIdentifierOrKeywordOrGreaterThan: () => QQ,
- tokenToString: () => qs,
- trace: () => Zi,
- tracing: () => rn,
- tracingEnabled: () => cw,
- transferSourceFileChildren: () => cte,
- transform: () => MSe,
- transformClassFields: () => nne,
- transformDeclarations: () => gW,
- transformECMAScriptModule: () => mW,
- transformES2015: () => hne,
- transformES2016: () => gne,
- transformES2017: () => one,
- transformES2018: () => cne,
- transformES2019: () => lne,
- transformES2020: () => une,
- transformES2021: () => _ne,
- transformESDecorators: () => ane,
- transformESNext: () => fne,
- transformGenerators: () => yne,
- transformImpliedNodeFormatDependentModule: () => bne,
- transformJsx: () => mne,
- transformLegacyDecorators: () => sne,
- transformModule: () => dW,
- transformNamedEvaluation: () => tf,
- transformNodes: () => LA,
- transformSystemModule: () => vne,
- transformTypeScript: () => rne,
- transpile: () => qbe,
- transpileDeclaration: () => Ube,
- transpileModule: () => dae,
- transpileOptionValueCompilerOptions: () => zte,
- tryAddToSet: () => Xm,
- tryAndIgnoreErrors: () => m9,
- tryCast: () => Wn,
- tryDirectoryExists: () => d9,
- tryExtractTSExtension: () => Z7,
- tryFileExists: () => m8,
- tryGetClassExtendingExpressionWithTypeArguments: () => LB,
- tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => MB,
- tryGetDirectories: () => p9,
- tryGetExtensionFromPath: () => Vg,
- tryGetImportFromModuleSpecifier: () => u3,
- tryGetJSDocSatisfiesTypeNode: () => I5,
- tryGetModuleNameFromFile: () => lA,
- tryGetModuleSpecifierFromDeclaration: () => xC,
- tryGetNativePerformanceHooks: () => LX,
- tryGetPropertyAccessOrIdentifierToString: () => N3,
- tryGetPropertyNameOfBindingOrAssignmentElement: () => _O,
- tryGetSourceMappingURL: () => Jre,
- tryGetTextOfPropertyName: () => f4,
- tryParseJson: () => K7,
- tryParsePattern: () => BC,
- tryParsePatterns: () => k5,
- tryParseRawSourceMap: () => zre,
- tryReadDirectory: () => AV,
- tryReadFile: () => yD,
- tryRemoveDirectoryPrefix: () => tJ,
- tryRemoveExtension: () => eee,
- tryRemovePrefix: () => xR,
- tryRemoveSuffix: () => EX,
- typeAcquisitionDeclarations: () => hO,
- typeAliasNamePart: () => wse,
- typeDirectiveIsEqualTo: () => tZ,
- typeKeywords: () => oV,
- typeParameterNamePart: () => Ase,
- typeToDisplayParts: () => u8,
- unchangedPollThresholds: () => xI,
- unchangedTextChangeRange: () => OI,
- unescapeLeadingUnderscores: () => Ei,
- unmangleScopedPackageName: () => EA,
- unorderedRemoveItem: () => LT,
- unreachableCodeIsError: () => BK,
- unsetNodeChildren: () => $J,
- unusedLabelIsError: () => JK,
- unwrapInnermostStatementOfLabel: () => eB,
- unwrapParenthesizedExpression: () => gee,
- updateErrorForNoInputFiles: () => DO,
- updateLanguageServiceSourceFile: () => kq,
- updateMissingFilePathsWatch: () => EW,
- updateResolutionField: () => s6,
- updateSharedExtendedConfigFileWatcher: () => iF,
- updateSourceFile: () => cz,
- updateWatchingWildcardDirectories: () => RA,
- usingSingleLineStringWriter: () => dC,
- utf16EncodeAsString: () => QE,
- validateLocaleAndSetLanguage: () => lj,
- version: () => U_,
- versionMajorMinor: () => wf,
- visitArray: () => wA,
- visitCommaListElements: () => VO,
- visitEachChild: () => br,
- visitFunctionBody: () => Bf,
- visitIterationBody: () => Ku,
- visitLexicalEnvironment: () => Kz,
- visitNode: () => Ge,
- visitNodes: () => Fr,
- visitParameterList: () => cc,
- walkUpBindingElementsAndPatterns: () => JT,
- walkUpOuterExpressions: () => mte,
- walkUpParenthesizedExpressions: () => ag,
- walkUpParenthesizedTypes: () => m3,
- walkUpParenthesizedTypesAndGetParentAndChild: () => $Z,
- whitespaceOrMapCommentRegExp: () => tW,
- writeCommentRange: () => OC,
- writeFile: () => H7,
- writeFileEnsuringDirectories: () => wB,
- zipWith: () => tR
- });
- var JDe;
- function ZYe() {
- return JDe ?? (JDe = new Sd(U_));
- }
- function zDe(e, t, n, i, s) {
- let o = t ? "DeprecationError: " : "DeprecationWarning: ";
- return o += `'${e}' `, o += i ? `has been deprecated since v${i}` : "is deprecated", o += t ? " and can no longer be used." : n ? ` and will no longer be usable after v${n}.` : ".", o += s ? ` ${zg(s, [e])}` : "", o;
- }
- function KYe(e, t, n, i) {
- const s = zDe(
- e,
- /*error*/
- !0,
- t,
- n,
- i
- );
- return () => {
- throw new TypeError(s);
- };
- }
- function eZe(e, t, n, i) {
- let s = !1;
- return () => {
- s || (E.log.warn(zDe(
- e,
- /*error*/
- !1,
- t,
- n,
- i
- )), s = !0);
- };
- }
- function tZe(e, t = {}) {
- const n = typeof t.typeScriptVersion == "string" ? new Sd(t.typeScriptVersion) : t.typeScriptVersion ?? ZYe(), i = typeof t.errorAfter == "string" ? new Sd(t.errorAfter) : t.errorAfter, s = typeof t.warnAfter == "string" ? new Sd(t.warnAfter) : t.warnAfter, o = typeof t.since == "string" ? new Sd(t.since) : t.since ?? s, c = t.error || i && n.compareTo(i) >= 0, _ = !s || n.compareTo(s) >= 0;
- return c ? KYe(e, i, o, t.message) : _ ? eZe(e, i, o, t.message) : ja;
- }
- function rZe(e, t) {
- return function() {
- return e(), t.apply(this, arguments);
- };
- }
- function nZe(e, t) {
- const n = tZe(t?.name ?? E.getFunctionName(e), t);
- return rZe(n, e);
- }
- function LH(e, t, n, i) {
- if (Object.defineProperty(o, "name", { ...Object.getOwnPropertyDescriptor(o, "name"), value: e }), i)
- for (const c of Object.keys(i)) {
- const _ = +c;
- !isNaN(_) && co(t, `${_}`) && (t[_] = nZe(t[_], { ...i[_], name: e }));
- }
- const s = iZe(t, n);
- return o;
- function o(...c) {
- const _ = s(c), u = _ !== void 0 ? t[_] : void 0;
- if (typeof u == "function")
- return u(...c);
- throw new TypeError("Invalid arguments");
- }
- }
- function iZe(e, t) {
- return (n) => {
- for (let i = 0; co(e, `${i}`) && co(t, `${i}`); i++) {
- const s = t[i];
- if (s(n))
- return i;
- }
- };
- }
- function WDe(e) {
- return {
- overload: (t) => ({
- bind: (n) => ({
- finish: () => LH(e, t, n),
- deprecate: (i) => ({
- finish: () => LH(e, t, n, i)
- })
- })
- })
- };
- }
- var UDe = {};
- La(UDe, {
- ActionInvalidate: () => LF,
- ActionPackageInstalled: () => MF,
- ActionSet: () => FF,
- ActionWatchTypingLocations: () => QA,
- Arguments: () => OU,
- AutoImportProviderProject: () => Que,
- AuxiliaryProject: () => $ue,
- CharRangeSection: () => b_e,
- CloseFileWatcherEvent: () => $H,
- CommandNames: () => bPe,
- ConfigFileDiagEvent: () => UH,
- ConfiguredProject: () => Yue,
- ConfiguredProjectLoadKind: () => n_e,
- CreateDirectoryWatcherEvent: () => GH,
- CreateFileWatcherEvent: () => HH,
- Errors: () => Wh,
- EventBeginInstallTypes: () => NU,
- EventEndInstallTypes: () => IU,
- EventInitializationFailed: () => Jie,
- EventTypesRegistry: () => AU,
- ExternalProject: () => RH,
- GcTimer: () => jue,
- InferredProject: () => Gue,
- LargeFileReferencedEvent: () => WH,
- LineIndex: () => sN,
- LineLeaf: () => bL,
- LineNode: () => U6,
- LogLevel: () => wue,
- Msg: () => Aue,
- OpenFileInfoTelemetryEvent: () => Zue,
- Project: () => _k,
- ProjectInfoTelemetryEvent: () => qH,
- ProjectKind: () => K8,
- ProjectLanguageServiceStateEvent: () => VH,
- ProjectLoadingFinishEvent: () => zH,
- ProjectLoadingStartEvent: () => JH,
- ProjectService: () => u_e,
- ProjectsUpdatedInBackgroundEvent: () => hL,
- ScriptInfo: () => Wue,
- ScriptVersionCache: () => sG,
- Session: () => CPe,
- TextStorage: () => zue,
- ThrottledOperations: () => Rue,
- TypingsInstallerAdapter: () => NPe,
- allFilesAreJsOrDts: () => Vue,
- allRootFilesAreJsOrDts: () => Uue,
- asNormalizedPath: () => GDe,
- convertCompilerOptions: () => yL,
- convertFormatOptions: () => J6,
- convertScriptKindName: () => QH,
- convertTypeAcquisition: () => e_e,
- convertUserPreferences: () => t_e,
- convertWatchOptions: () => nN,
- countEachFileTypes: () => eN,
- createInstallTypingsRequest: () => Nue,
- createModuleSpecifierCache: () => p_e,
- createNormalizedPathMap: () => $De,
- createPackageJsonCache: () => d_e,
- createSortedArray: () => Mue,
- emptyArray: () => hl,
- findArgument: () => Hve,
- formatDiagnosticToProtocol: () => iN,
- formatMessage: () => m_e,
- getBaseConfigFileName: () => MH,
- getLocationInNewDocument: () => v_e,
- hasArgument: () => qve,
- hasNoTypeScriptSource: () => que,
- indent: () => WD,
- isBackgroundProject: () => rN,
- isConfigFile: () => __e,
- isConfiguredProject: () => B0,
- isDynamicFileName: () => Z8,
- isExternalProject: () => tN,
- isInferredProject: () => B6,
- isInferredProjectName: () => Iue,
- isProjectDeferredClose: () => gL,
- makeAutoImportProviderProjectName: () => Fue,
- makeAuxiliaryProjectName: () => Lue,
- makeInferredProjectName: () => Oue,
- maxFileSize: () => BH,
- maxProgramSizeForNonTsFiles: () => jH,
- normalizedPathToPath: () => j6,
- nowString: () => Gve,
- nullCancellationToken: () => hPe,
- nullTypingsInstaller: () => vL,
- protocol: () => Bue,
- stringifyIndented: () => Tv,
- toEvent: () => g_e,
- toNormalizedPath: () => Wo,
- tryConvertScriptKindName: () => XH,
- typingsInstaller: () => Pue,
- updateProjectIfDirty: () => gp
- });
- var Pue = {};
- La(Pue, {
- TypingsInstaller: () => oZe,
- getNpmCommandForInstallation: () => qDe,
- installNpmPackages: () => aZe,
- typingsName: () => HDe
- });
- var sZe = {
- isEnabled: () => !1,
- writeLine: ja
- };
- function VDe(e, t, n, i) {
- try {
- const s = Vx(t, Bn(e, "index.d.ts"), {
- moduleResolution: 2
- /* Node10 */
- }, n);
- return s.resolvedModule && s.resolvedModule.resolvedFileName;
- } catch (s) {
- i.isEnabled() && i.writeLine(`Failed to resolve ${t} in folder '${e}': ${s.message}`);
- return;
- }
- }
- function aZe(e, t, n, i) {
- let s = !1;
- for (let o = n.length; o > 0; ) {
- const c = qDe(e, t, n, o);
- o = c.remaining, s = i(c.command) || s;
- }
- return s;
- }
- function qDe(e, t, n, i) {
- const s = n.length - i;
- let o, c = i;
- for (; o = `${e} install --ignore-scripts ${(c === n.length ? n : n.slice(s, s + c)).join(" ")} --save-dev --user-agent="typesInstaller/${t}"`, !(o.length < 8e3); )
- c = c - Math.floor(c / 2);
- return { command: o, remaining: i - c };
- }
- var oZe = class {
- constructor(e, t, n, i, s, o = sZe) {
- this.installTypingHost = e, this.globalCachePath = t, this.safeListPath = n, this.typesMapLocation = i, this.throttleLimit = s, this.log = o, this.packageNameToTypingLocation = /* @__PURE__ */ new Map(), this.missingTypingsSet = /* @__PURE__ */ new Set(), this.knownCachesSet = /* @__PURE__ */ new Set(), this.projectWatchers = /* @__PURE__ */ new Map(), this.pendingRunRequests = [], this.installRunCount = 1, this.inFlightRequestCount = 0, this.latestDistTag = "latest", this.log.isEnabled() && this.log.writeLine(`Global cache location '${t}', safe file path '${n}', types map path ${i}`), this.processCacheLocation(this.globalCachePath);
- }
- /** @internal */
- handleRequest(e) {
- switch (e.kind) {
- case "discover":
- this.install(e);
- break;
- case "closeProject":
- this.closeProject(e);
- break;
- case "typesRegistry": {
- const t = {};
- this.typesRegistry.forEach((i, s) => {
- t[s] = i;
- });
- const n = { kind: AU, typesRegistry: t };
- this.sendResponse(n);
- break;
- }
- case "installPackage": {
- this.installPackage(e);
- break;
- }
- default:
- E.assertNever(e);
- }
- }
- closeProject(e) {
- this.closeWatchers(e.projectName);
- }
- closeWatchers(e) {
- if (this.log.isEnabled() && this.log.writeLine(`Closing file watchers for project '${e}'`), !this.projectWatchers.get(e)) {
- this.log.isEnabled() && this.log.writeLine(`No watchers are registered for project '${e}'`);
- return;
- }
- this.projectWatchers.delete(e), this.sendResponse({ kind: QA, projectName: e, files: [] }), this.log.isEnabled() && this.log.writeLine(`Closing file watchers for project '${e}' - done.`);
- }
- install(e) {
- this.log.isEnabled() && this.log.writeLine(`Got install request${Tv(e)}`), e.cachePath && (this.log.isEnabled() && this.log.writeLine(`Request specifies cache path '${e.cachePath}', loading cached information...`), this.processCacheLocation(e.cachePath)), this.safeList === void 0 && this.initializeSafeList();
- const t = Dm.discoverTypings(
- this.installTypingHost,
- this.log.isEnabled() ? (n) => this.log.writeLine(n) : void 0,
- e.fileNames,
- e.projectRootPath,
- this.safeList,
- this.packageNameToTypingLocation,
- e.typeAcquisition,
- e.unresolvedImports,
- this.typesRegistry,
- e.compilerOptions
- );
- this.watchFiles(e.projectName, t.filesToWatch), t.newTypingNames.length ? this.installTypings(e, e.cachePath || this.globalCachePath, t.cachedTypingPaths, t.newTypingNames) : (this.sendResponse(this.createSetTypings(e, t.cachedTypingPaths)), this.log.isEnabled() && this.log.writeLine("No new typings were requested as a result of typings discovery"));
- }
- /** @internal */
- installPackage(e) {
- const { fileName: t, packageName: n, projectName: i, projectRootPath: s, id: o } = e, c = Fp(Xn(t), (_) => {
- if (this.installTypingHost.fileExists(Bn(_, "package.json")))
- return _;
- }) || s;
- if (c)
- this.installWorker(-1, [n], c, (_) => {
- const u = _ ? `Package ${n} installed.` : `There was an error installing ${n}.`, d = {
- kind: MF,
- projectName: i,
- id: o,
- success: _,
- message: u
- };
- this.sendResponse(d);
- });
- else {
- const _ = {
- kind: MF,
- projectName: i,
- id: o,
- success: !1,
- message: "Could not determine a project root path."
- };
- this.sendResponse(_);
- }
- }
- initializeSafeList() {
- if (this.typesMapLocation) {
- const e = Dm.loadTypesMap(this.installTypingHost, this.typesMapLocation);
- if (e) {
- this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`), this.safeList = e;
- return;
- }
- this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`);
- }
- this.safeList = Dm.loadSafeList(this.installTypingHost, this.safeListPath);
- }
- processCacheLocation(e) {
- if (this.log.isEnabled() && this.log.writeLine(`Processing cache location '${e}'`), this.knownCachesSet.has(e)) {
- this.log.isEnabled() && this.log.writeLine("Cache location was already processed...");
- return;
- }
- const t = Bn(e, "package.json"), n = Bn(e, "package-lock.json");
- if (this.log.isEnabled() && this.log.writeLine(`Trying to find '${t}'...`), this.installTypingHost.fileExists(t) && this.installTypingHost.fileExists(n)) {
- const i = JSON.parse(this.installTypingHost.readFile(t)), s = JSON.parse(this.installTypingHost.readFile(n));
- if (this.log.isEnabled() && (this.log.writeLine(`Loaded content of '${t}':${Tv(i)}`), this.log.writeLine(`Loaded content of '${n}':${Tv(s)}`)), i.devDependencies && s.dependencies)
- for (const o in i.devDependencies) {
- if (!co(s.dependencies, o))
- continue;
- const c = Hc(o);
- if (!c)
- continue;
- const _ = VDe(e, c, this.installTypingHost, this.log);
- if (!_) {
- this.missingTypingsSet.add(c);
- continue;
- }
- const u = this.packageNameToTypingLocation.get(c);
- if (u) {
- if (u.typingLocation === _)
- continue;
- this.log.isEnabled() && this.log.writeLine(`New typing for package ${c} from '${_}' conflicts with existing typing file '${u}'`);
- }
- this.log.isEnabled() && this.log.writeLine(`Adding entry into typings cache: '${c}' => '${_}'`);
- const d = fI(s.dependencies, o), g = d && d.version;
- if (!g)
- continue;
- const h = { typingLocation: _, version: new Sd(g) };
- this.packageNameToTypingLocation.set(c, h);
- }
- }
- this.log.isEnabled() && this.log.writeLine(`Finished processing cache location '${e}'`), this.knownCachesSet.add(e);
- }
- filterTypings(e) {
- return Ai(e, (t) => {
- const n = l6(t);
- if (this.missingTypingsSet.has(n)) {
- this.log.isEnabled() && this.log.writeLine(`'${t}':: '${n}' is in missingTypingsSet - skipping...`);
- return;
- }
- const i = Dm.validatePackageName(t);
- if (i !== Dm.NameValidationResult.Ok) {
- this.missingTypingsSet.add(n), this.log.isEnabled() && this.log.writeLine(Dm.renderPackageNameValidationFailure(i, t));
- return;
- }
- if (!this.typesRegistry.has(n)) {
- this.log.isEnabled() && this.log.writeLine(`'${t}':: Entry for package '${n}' does not exist in local types registry - skipping...`);
- return;
- }
- if (this.packageNameToTypingLocation.get(n) && Dm.isTypingUpToDate(this.packageNameToTypingLocation.get(n), this.typesRegistry.get(n))) {
- this.log.isEnabled() && this.log.writeLine(`'${t}':: '${n}' already has an up-to-date typing - skipping...`);
- return;
- }
- return n;
- });
- }
- ensurePackageDirectoryExists(e) {
- const t = Bn(e, "package.json");
- this.log.isEnabled() && this.log.writeLine(`Npm config file: ${t}`), this.installTypingHost.fileExists(t) || (this.log.isEnabled() && this.log.writeLine(`Npm config file: '${t}' is missing, creating new one...`), this.ensureDirectoryExists(e, this.installTypingHost), this.installTypingHost.writeFile(t, '{ "private": true }'));
- }
- installTypings(e, t, n, i) {
- this.log.isEnabled() && this.log.writeLine(`Installing typings ${JSON.stringify(i)}`);
- const s = this.filterTypings(i);
- if (s.length === 0) {
- this.log.isEnabled() && this.log.writeLine("All typings are known to be missing or invalid - no need to install more typings"), this.sendResponse(this.createSetTypings(e, n));
- return;
- }
- this.ensurePackageDirectoryExists(t);
- const o = this.installRunCount;
- this.installRunCount++, this.sendResponse({
- kind: NU,
- eventId: o,
- typingsInstallerVersion: U_,
- projectName: e.projectName
- });
- const c = s.map(HDe);
- this.installTypingsAsync(o, c, t, (_) => {
- try {
- if (!_) {
- this.log.isEnabled() && this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(s)}`);
- for (const d of s)
- this.missingTypingsSet.add(d);
- return;
- }
- this.log.isEnabled() && this.log.writeLine(`Installed typings ${JSON.stringify(c)}`);
- const u = [];
- for (const d of s) {
- const g = VDe(t, d, this.installTypingHost, this.log);
- if (!g) {
- this.missingTypingsSet.add(d);
- continue;
- }
- const h = this.typesRegistry.get(d), S = new Sd(h[`ts${wf}`] || h[this.latestDistTag]), T = { typingLocation: g, version: S };
- this.packageNameToTypingLocation.set(d, T), u.push(g);
- }
- this.log.isEnabled() && this.log.writeLine(`Installed typing files ${JSON.stringify(u)}`), this.sendResponse(this.createSetTypings(e, n.concat(u)));
- } finally {
- const u = {
- kind: IU,
- eventId: o,
- projectName: e.projectName,
- packagesToInstall: c,
- installSuccess: _,
- typingsInstallerVersion: U_
- };
- this.sendResponse(u);
- }
- });
- }
- ensureDirectoryExists(e, t) {
- const n = Xn(e);
- t.directoryExists(n) || this.ensureDirectoryExists(n, t), t.directoryExists(e) || t.createDirectory(e);
- }
- watchFiles(e, t) {
- if (!t.length) {
- this.closeWatchers(e);
- return;
- }
- const n = this.projectWatchers.get(e), i = new Set(t);
- !n || Ch(i, (s) => !n.has(s)) || Ch(n, (s) => !i.has(s)) ? (this.projectWatchers.set(e, i), this.sendResponse({ kind: QA, projectName: e, files: t })) : this.sendResponse({ kind: QA, projectName: e, files: void 0 });
- }
- createSetTypings(e, t) {
- return {
- projectName: e.projectName,
- typeAcquisition: e.typeAcquisition,
- compilerOptions: e.compilerOptions,
- typings: t,
- unresolvedImports: e.unresolvedImports,
- kind: FF
- };
- }
- installTypingsAsync(e, t, n, i) {
- this.pendingRunRequests.unshift({ requestId: e, packageNames: t, cwd: n, onRequestCompleted: i }), this.executeWithThrottling();
- }
- executeWithThrottling() {
- for (; this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length; ) {
- this.inFlightRequestCount++;
- const e = this.pendingRunRequests.pop();
- this.installWorker(e.requestId, e.packageNames, e.cwd, (t) => {
- this.inFlightRequestCount--, e.onRequestCompleted(t), this.executeWithThrottling();
- });
- }
- }
- };
- function HDe(e) {
- return `@types/${e}@ts${wf}`;
- }
- var wue = /* @__PURE__ */ ((e) => (e[e.terse = 0] = "terse", e[e.normal = 1] = "normal", e[e.requestTime = 2] = "requestTime", e[e.verbose = 3] = "verbose", e))(wue || {}), hl = Mue(), Aue = /* @__PURE__ */ ((e) => (e.Err = "Err", e.Info = "Info", e.Perf = "Perf", e))(Aue || {});
- function Nue(e, t, n, i) {
- return {
- projectName: e.getProjectName(),
- fileNames: e.getFileNames(
- /*excludeFilesFromExternalLibraries*/
- !0,
- /*excludeConfigFiles*/
- !0
- ).concat(e.getExcludedFiles()),
- compilerOptions: e.getCompilationSettings(),
- typeAcquisition: t,
- unresolvedImports: n,
- projectRootPath: e.getCurrentDirectory(),
- cachePath: i,
- kind: "discover"
- };
- }
- var Wh;
- ((e) => {
- function t() {
- throw new Error("No Project.");
- }
- e.ThrowNoProject = t;
- function n() {
- throw new Error("The project's language service is disabled.");
- }
- e.ThrowProjectLanguageServiceDisabled = n;
- function i(s, o) {
- throw new Error(`Project '${o.getProjectName()}' does not contain document '${s}'`);
- }
- e.ThrowProjectDoesNotContainDocument = i;
- })(Wh || (Wh = {}));
- function Wo(e) {
- return Os(e);
- }
- function j6(e, t, n) {
- const i = H_(e) ? e : es(e, t);
- return n(i);
- }
- function GDe(e) {
- return e;
- }
- function $De() {
- const e = /* @__PURE__ */ new Map();
- return {
- get(t) {
- return e.get(t);
- },
- set(t, n) {
- e.set(t, n);
- },
- contains(t) {
- return e.has(t);
- },
- remove(t) {
- e.delete(t);
- }
- };
- }
- function Iue(e) {
- return /dev\/null\/inferredProject\d+\*/.test(e);
- }
- function Oue(e) {
- return `/dev/null/inferredProject${e}*`;
- }
- function Fue(e) {
- return `/dev/null/autoImportProviderProject${e}*`;
- }
- function Lue(e) {
- return `/dev/null/auxiliaryProject${e}*`;
- }
- function Mue() {
- return [];
- }
- var Rue = class D7e {
- constructor(t, n) {
- this.host = t, this.pendingTimeouts = /* @__PURE__ */ new Map(), this.logger = n.hasLevel(
- 3
- /* verbose */
- ) ? n : void 0;
- }
- /**
- * Wait `number` milliseconds and then invoke `cb`. If, while waiting, schedule
- * is called again with the same `operationId`, cancel this operation in favor
- * of the new one. (Note that the amount of time the canceled operation had been
- * waiting does not affect the amount of time that the new operation waits.)
- */
- schedule(t, n, i) {
- const s = this.pendingTimeouts.get(t);
- s && this.host.clearTimeout(s), this.pendingTimeouts.set(t, this.host.setTimeout(D7e.run, n, t, this, i)), this.logger && this.logger.info(`Scheduled: ${t}${s ? ", Cancelled earlier one" : ""}`);
- }
- cancel(t) {
- const n = this.pendingTimeouts.get(t);
- return n ? (this.host.clearTimeout(n), this.pendingTimeouts.delete(t)) : !1;
- }
- static run(t, n, i) {
- n.pendingTimeouts.delete(t), n.logger && n.logger.info(`Running: ${t}`), i();
- }
- }, jue = class P7e {
- constructor(t, n, i) {
- this.host = t, this.delay = n, this.logger = i;
- }
- scheduleCollect() {
- !this.host.gc || this.timerId !== void 0 || (this.timerId = this.host.setTimeout(P7e.run, this.delay, this));
- }
- static run(t) {
- t.timerId = void 0;
- const n = t.logger.hasLevel(
- 2
- /* requestTime */
- ), i = n && t.host.getMemoryUsage();
- if (t.host.gc(), n) {
- const s = t.host.getMemoryUsage();
- t.logger.perftrc(`GC::before ${i}, after ${s}`);
- }
- }
- };
- function MH(e) {
- const t = Hc(e);
- return t === "tsconfig.json" || t === "jsconfig.json" ? t : void 0;
- }
- var Bue = {};
- La(Bue, {
- ClassificationType: () => RU,
- CommandTypes: () => Jue,
- CompletionTriggerKind: () => LU,
- IndentStyle: () => ZDe,
- JsxEmit: () => KDe,
- ModuleKind: () => ePe,
- ModuleResolutionKind: () => tPe,
- NewLineKind: () => rPe,
- OrganizeImportsMode: () => FU,
- PollingWatchKind: () => YDe,
- ScriptTarget: () => nPe,
- SemicolonPreference: () => MU,
- WatchDirectoryKind: () => QDe,
- WatchFileKind: () => XDe
- });
- var Jue = /* @__PURE__ */ ((e) => (e.JsxClosingTag = "jsxClosingTag", e.LinkedEditingRange = "linkedEditingRange", e.Brace = "brace", e.BraceFull = "brace-full", e.BraceCompletion = "braceCompletion", e.GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", e.Change = "change", e.Close = "close", e.Completions = "completions", e.CompletionInfo = "completionInfo", e.CompletionsFull = "completions-full", e.CompletionDetails = "completionEntryDetails", e.CompletionDetailsFull = "completionEntryDetails-full", e.CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", e.CompileOnSaveEmitFile = "compileOnSaveEmitFile", e.Configure = "configure", e.Definition = "definition", e.DefinitionFull = "definition-full", e.DefinitionAndBoundSpan = "definitionAndBoundSpan", e.DefinitionAndBoundSpanFull = "definitionAndBoundSpan-full", e.Implementation = "implementation", e.ImplementationFull = "implementation-full", e.EmitOutput = "emit-output", e.Exit = "exit", e.FileReferences = "fileReferences", e.FileReferencesFull = "fileReferences-full", e.Format = "format", e.Formatonkey = "formatonkey", e.FormatFull = "format-full", e.FormatonkeyFull = "formatonkey-full", e.FormatRangeFull = "formatRange-full", e.Geterr = "geterr", e.GeterrForProject = "geterrForProject", e.SemanticDiagnosticsSync = "semanticDiagnosticsSync", e.SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", e.SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", e.NavBar = "navbar", e.NavBarFull = "navbar-full", e.Navto = "navto", e.NavtoFull = "navto-full", e.NavTree = "navtree", e.NavTreeFull = "navtree-full", e.DocumentHighlights = "documentHighlights", e.DocumentHighlightsFull = "documentHighlights-full", e.Open = "open", e.Quickinfo = "quickinfo", e.QuickinfoFull = "quickinfo-full", e.References = "references", e.ReferencesFull = "references-full", e.Reload = "reload", e.Rename = "rename", e.RenameInfoFull = "rename-full", e.RenameLocationsFull = "renameLocations-full", e.Saveto = "saveto", e.SignatureHelp = "signatureHelp", e.SignatureHelpFull = "signatureHelp-full", e.FindSourceDefinition = "findSourceDefinition", e.Status = "status", e.TypeDefinition = "typeDefinition", e.ProjectInfo = "projectInfo", e.ReloadProjects = "reloadProjects", e.Unknown = "unknown", e.OpenExternalProject = "openExternalProject", e.OpenExternalProjects = "openExternalProjects", e.CloseExternalProject = "closeExternalProject", e.SynchronizeProjectList = "synchronizeProjectList", e.ApplyChangedToOpenFiles = "applyChangedToOpenFiles", e.UpdateOpen = "updateOpen", e.EncodedSyntacticClassificationsFull = "encodedSyntacticClassifications-full", e.EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full", e.Cleanup = "cleanup", e.GetOutliningSpans = "getOutliningSpans", e.GetOutliningSpansFull = "outliningSpans", e.TodoComments = "todoComments", e.Indentation = "indentation", e.DocCommentTemplate = "docCommentTemplate", e.CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full", e.NameOrDottedNameSpan = "nameOrDottedNameSpan", e.BreakpointStatement = "breakpointStatement", e.CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", e.GetCodeFixes = "getCodeFixes", e.GetCodeFixesFull = "getCodeFixes-full", e.GetCombinedCodeFix = "getCombinedCodeFix", e.GetCombinedCodeFixFull = "getCombinedCodeFix-full", e.ApplyCodeActionCommand = "applyCodeActionCommand", e.GetSupportedCodeFixes = "getSupportedCodeFixes", e.GetApplicableRefactors = "getApplicableRefactors", e.GetEditsForRefactor = "getEditsForRefactor", e.GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions", e.GetPasteEdits = "getPasteEdits", e.GetEditsForRefactorFull = "getEditsForRefactor-full", e.OrganizeImports = "organizeImports", e.OrganizeImportsFull = "organizeImports-full", e.GetEditsForFileRename = "getEditsForFileRename", e.GetEditsForFileRenameFull = "getEditsForFileRename-full", e.ConfigurePlugin = "configurePlugin", e.SelectionRange = "selectionRange", e.SelectionRangeFull = "selectionRange-full", e.ToggleLineComment = "toggleLineComment", e.ToggleLineCommentFull = "toggleLineComment-full", e.ToggleMultilineComment = "toggleMultilineComment", e.ToggleMultilineCommentFull = "toggleMultilineComment-full", e.CommentSelection = "commentSelection", e.CommentSelectionFull = "commentSelection-full", e.UncommentSelection = "uncommentSelection", e.UncommentSelectionFull = "uncommentSelection-full", e.PrepareCallHierarchy = "prepareCallHierarchy", e.ProvideCallHierarchyIncomingCalls = "provideCallHierarchyIncomingCalls", e.ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls", e.ProvideInlayHints = "provideInlayHints", e.WatchChange = "watchChange", e.MapCode = "mapCode", e))(Jue || {}), XDe = /* @__PURE__ */ ((e) => (e.FixedPollingInterval = "FixedPollingInterval", e.PriorityPollingInterval = "PriorityPollingInterval", e.DynamicPriorityPolling = "DynamicPriorityPolling", e.FixedChunkSizePolling = "FixedChunkSizePolling", e.UseFsEvents = "UseFsEvents", e.UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory", e))(XDe || {}), QDe = /* @__PURE__ */ ((e) => (e.UseFsEvents = "UseFsEvents", e.FixedPollingInterval = "FixedPollingInterval", e.DynamicPriorityPolling = "DynamicPriorityPolling", e.FixedChunkSizePolling = "FixedChunkSizePolling", e))(QDe || {}), YDe = /* @__PURE__ */ ((e) => (e.FixedInterval = "FixedInterval", e.PriorityInterval = "PriorityInterval", e.DynamicPriority = "DynamicPriority", e.FixedChunkSize = "FixedChunkSize", e))(YDe || {}), ZDe = /* @__PURE__ */ ((e) => (e.None = "None", e.Block = "Block", e.Smart = "Smart", e))(ZDe || {}), KDe = /* @__PURE__ */ ((e) => (e.None = "none", e.Preserve = "preserve", e.ReactNative = "react-native", e.React = "react", e.ReactJSX = "react-jsx", e.ReactJSXDev = "react-jsxdev", e))(KDe || {}), ePe = /* @__PURE__ */ ((e) => (e.None = "none", e.CommonJS = "commonjs", e.AMD = "amd", e.UMD = "umd", e.System = "system", e.ES6 = "es6", e.ES2015 = "es2015", e.ES2020 = "es2020", e.ES2022 = "es2022", e.ESNext = "esnext", e.Node16 = "node16", e.NodeNext = "nodenext", e.Preserve = "preserve", e))(ePe || {}), tPe = /* @__PURE__ */ ((e) => (e.Classic = "classic", e.Node = "node", e.NodeJs = "node", e.Node10 = "node10", e.Node16 = "node16", e.NodeNext = "nodenext", e.Bundler = "bundler", e))(tPe || {}), rPe = /* @__PURE__ */ ((e) => (e.Crlf = "Crlf", e.Lf = "Lf", e))(rPe || {}), nPe = /* @__PURE__ */ ((e) => (e.ES3 = "es3", e.ES5 = "es5", e.ES6 = "es6", e.ES2015 = "es2015", e.ES2016 = "es2016", e.ES2017 = "es2017", e.ES2018 = "es2018", e.ES2019 = "es2019", e.ES2020 = "es2020", e.ES2021 = "es2021", e.ES2022 = "es2022", e.ES2023 = "es2023", e.ESNext = "esnext", e.JSON = "json", e.Latest = "esnext", e))(nPe || {}), zue = class {
- constructor(e, t, n) {
- this.host = e, this.info = t, this.isOpen = !1, this.ownFileText = !1, this.pendingReloadFromDisk = !1, this.version = n || 0;
- }
- getVersion() {
- return this.svc ? `SVC-${this.version}-${this.svc.getSnapshotVersion()}` : `Text-${this.version}`;
- }
- hasScriptVersionCache_TestOnly() {
- return this.svc !== void 0;
- }
- resetSourceMapInfo() {
- this.info.sourceFileLike = void 0, this.info.closeSourceMapFileWatcher(), this.info.sourceMapFilePath = void 0, this.info.declarationInfoPath = void 0, this.info.sourceInfos = void 0, this.info.documentPositionMapper = void 0;
- }
- /** Public for testing */
- useText(e) {
- this.svc = void 0, this.text = e, this.textSnapshot = void 0, this.lineMap = void 0, this.fileSize = void 0, this.resetSourceMapInfo(), this.version++;
- }
- edit(e, t, n) {
- this.switchToScriptVersionCache().edit(e, t - e, n), this.ownFileText = !1, this.text = void 0, this.textSnapshot = void 0, this.lineMap = void 0, this.fileSize = void 0, this.resetSourceMapInfo();
- }
- /**
- * Set the contents as newText
- * returns true if text changed
- */
- reload(e) {
- return E.assert(e !== void 0), this.pendingReloadFromDisk = !1, !this.text && this.svc && (this.text = Yx(this.svc.getSnapshot())), this.text !== e ? (this.useText(e), this.ownFileText = !1, !0) : !1;
- }
- /**
- * Reads the contents from tempFile(if supplied) or own file and sets it as contents
- * returns true if text changed
- */
- reloadWithFileText(e) {
- const { text: t, fileSize: n } = e || !this.info.isDynamicOrHasMixedContent() ? this.getFileTextAndSize(e) : { text: "", fileSize: void 0 }, i = this.reload(t);
- return this.fileSize = n, this.ownFileText = !e || e === this.info.fileName, this.ownFileText && this.info.mTime === q_.getTime() && (this.info.mTime = (this.host.getModifiedTime(this.info.fileName) || q_).getTime()), i;
- }
- /**
- * Schedule reload from the disk if its not already scheduled and its not own text
- * returns true when scheduling reload
- */
- scheduleReloadIfNeeded() {
- return !this.pendingReloadFromDisk && !this.ownFileText ? this.pendingReloadFromDisk = !0 : !1;
- }
- delayReloadFromFileIntoText() {
- this.pendingReloadFromDisk = !0;
- }
- /**
- * For telemetry purposes, we would like to be able to report the size of the file.
- * However, we do not want telemetry to require extra file I/O so we report a size
- * that may be stale (e.g. may not reflect change made on disk since the last reload).
- * NB: Will read from disk if the file contents have never been loaded because
- * telemetry falsely indicating size 0 would be counter-productive.
- */
- getTelemetryFileSize() {
- return this.fileSize ? this.fileSize : this.text ? this.text.length : this.svc ? this.svc.getSnapshot().getLength() : this.getSnapshot().getLength();
- }
- getSnapshot() {
- var e;
- return ((e = this.tryUseScriptVersionCache()) == null ? void 0 : e.getSnapshot()) || (this.textSnapshot ?? (this.textSnapshot = RF.fromString(E.checkDefined(this.text))));
- }
- getAbsolutePositionAndLineText(e) {
- const t = this.tryUseScriptVersionCache();
- if (t) return t.getAbsolutePositionAndLineText(e);
- const n = this.getLineMap();
- return e <= n.length ? {
- absolutePosition: n[e - 1],
- lineText: this.text.substring(n[e - 1], n[e])
- } : {
- absolutePosition: this.text.length,
- lineText: void 0
- };
- }
- /**
- * @param line 0 based index
- */
- lineToTextSpan(e) {
- const t = this.tryUseScriptVersionCache();
- if (t) return t.lineToTextSpan(e);
- const n = this.getLineMap(), i = n[e], s = e + 1 < n.length ? n[e + 1] : this.text.length;
- return kc(i, s);
- }
- /**
- * @param line 1 based index
- * @param offset 1 based index
- */
- lineOffsetToPosition(e, t, n) {
- const i = this.tryUseScriptVersionCache();
- return i ? i.lineOffsetToPosition(e, t) : NI(this.getLineMap(), e - 1, t - 1, this.text, n);
- }
- positionToLineOffset(e) {
- const t = this.tryUseScriptVersionCache();
- if (t) return t.positionToLineOffset(e);
- const { line: n, character: i } = nC(this.getLineMap(), e);
- return { line: n + 1, offset: i + 1 };
- }
- getFileTextAndSize(e) {
- let t;
- const n = e || this.info.fileName, i = () => t === void 0 ? t = this.host.readFile(n) || "" : t;
- if (!gx(this.info.fileName)) {
- const s = this.host.getFileSize ? this.host.getFileSize(n) : i().length;
- if (s > BH)
- return E.assert(!!this.info.containingProjects.length), this.info.containingProjects[0].projectService.logger.info(`Skipped loading contents of large file ${n} for info ${this.info.fileName}: fileSize: ${s}`), this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(n, s), { text: "", fileSize: s };
- }
- return { text: i() };
- }
- /** @internal */
- switchToScriptVersionCache() {
- return (!this.svc || this.pendingReloadFromDisk) && (this.svc = sG.fromString(this.getOrLoadText()), this.textSnapshot = void 0, this.version++), this.svc;
- }
- tryUseScriptVersionCache() {
- return (!this.svc || this.pendingReloadFromDisk) && this.getOrLoadText(), this.isOpen ? (!this.svc && !this.textSnapshot && (this.svc = sG.fromString(E.checkDefined(this.text)), this.textSnapshot = void 0), this.svc) : this.svc;
- }
- getOrLoadText() {
- return (this.text === void 0 || this.pendingReloadFromDisk) && (E.assert(!this.svc || this.pendingReloadFromDisk, "ScriptVersionCache should not be set when reloading from disk"), this.reloadWithFileText()), this.text;
- }
- getLineMap() {
- return E.assert(!this.svc, "ScriptVersionCache should not be set"), this.lineMap || (this.lineMap = BT(E.checkDefined(this.text)));
- }
- getLineInfo() {
- const e = this.tryUseScriptVersionCache();
- if (e)
- return {
- getLineCount: () => e.getLineCount(),
- getLineText: (n) => e.getAbsolutePositionAndLineText(n + 1).lineText
- };
- const t = this.getLineMap();
- return rW(this.text, t);
- }
- };
- function Z8(e) {
- return e[0] === "^" || (e.includes("walkThroughSnippet:/") || e.includes("untitled:/")) && Hc(e)[0] === "^" || e.includes(":^") && !e.includes(Vo);
- }
- var Wue = class {
- constructor(e, t, n, i, s, o) {
- this.host = e, this.fileName = t, this.scriptKind = n, this.hasMixedContent = i, this.path = s, this.containingProjects = [], this.isDynamic = Z8(t), this.textStorage = new zue(e, this, o), (i || this.isDynamic) && (this.realpath = this.path), this.scriptKind = n || b5(t);
- }
- /** @internal */
- isDynamicOrHasMixedContent() {
- return this.hasMixedContent || this.isDynamic;
- }
- isScriptOpen() {
- return this.textStorage.isOpen;
- }
- open(e) {
- this.textStorage.isOpen = !0, e !== void 0 && this.textStorage.reload(e) && this.markContainingProjectsAsDirty();
- }
- close(e = !0) {
- this.textStorage.isOpen = !1, e && this.textStorage.scheduleReloadIfNeeded() && this.markContainingProjectsAsDirty();
- }
- getSnapshot() {
- return this.textStorage.getSnapshot();
- }
- ensureRealPath() {
- if (this.realpath === void 0 && (this.realpath = this.path, this.host.realpath)) {
- E.assert(!!this.containingProjects.length);
- const e = this.containingProjects[0], t = this.host.realpath(this.path);
- t && (this.realpath = e.toPath(t), this.realpath !== this.path && e.projectService.realpathToScriptInfos.add(this.realpath, this));
- }
- }
- /** @internal */
- getRealpathIfDifferent() {
- return this.realpath && this.realpath !== this.path ? this.realpath : void 0;
- }
- /**
- * @internal
- * Does not compute realpath; uses precomputed result. Use `ensureRealPath`
- * first if a definite result is needed.
- */
- isSymlink() {
- return this.realpath && this.realpath !== this.path;
- }
- getFormatCodeSettings() {
- return this.formatSettings;
- }
- getPreferences() {
- return this.preferences;
- }
- attachToProject(e) {
- const t = !this.isAttached(e);
- return t && (this.containingProjects.push(e), e.getCompilerOptions().preserveSymlinks || this.ensureRealPath(), e.onFileAddedOrRemoved(this.isSymlink())), t;
- }
- isAttached(e) {
- switch (this.containingProjects.length) {
- case 0:
- return !1;
- case 1:
- return this.containingProjects[0] === e;
- case 2:
- return this.containingProjects[0] === e || this.containingProjects[1] === e;
- default:
- return ss(this.containingProjects, e);
- }
- }
- detachFromProject(e) {
- switch (this.containingProjects.length) {
- case 0:
- return;
- case 1:
- this.containingProjects[0] === e && (e.onFileAddedOrRemoved(this.isSymlink()), this.containingProjects.pop());
- break;
- case 2:
- this.containingProjects[0] === e ? (e.onFileAddedOrRemoved(this.isSymlink()), this.containingProjects[0] = this.containingProjects.pop()) : this.containingProjects[1] === e && (e.onFileAddedOrRemoved(this.isSymlink()), this.containingProjects.pop());
- break;
- default:
- OE(this.containingProjects, e) && e.onFileAddedOrRemoved(this.isSymlink());
- break;
- }
- }
- detachAllProjects() {
- for (const e of this.containingProjects) {
- B0(e) && e.getCachedDirectoryStructureHost().addOrDeleteFile(
- this.fileName,
- this.path,
- 2
- /* Deleted */
- );
- const t = e.getRootFilesMap().get(this.path);
- e.removeFile(
- this,
- /*fileExists*/
- !1,
- /*detachFromProject*/
- !1
- ), e.onFileAddedOrRemoved(this.isSymlink()), t && !B6(e) && e.addMissingFileRoot(t.fileName);
- }
- Ap(this.containingProjects);
- }
- getDefaultProject() {
- switch (this.containingProjects.length) {
- case 0:
- return Wh.ThrowNoProject();
- case 1:
- return gL(this.containingProjects[0]) || rN(this.containingProjects[0]) ? Wh.ThrowNoProject() : this.containingProjects[0];
- default:
- let e, t, n, i;
- for (let s = 0; s < this.containingProjects.length; s++) {
- const o = this.containingProjects[s];
- if (B0(o)) {
- if (o.deferredClose) continue;
- if (!o.isSourceOfProjectReferenceRedirect(this.fileName)) {
- if (i === void 0 && s !== this.containingProjects.length - 1 && (i = o.projectService.findDefaultConfiguredProject(this) || !1), i === o) return o;
- n || (n = o);
- }
- e || (e = o);
- } else {
- if (tN(o))
- return o;
- !t && B6(o) && (t = o);
- }
- }
- return (i || n || e || t) ?? Wh.ThrowNoProject();
- }
- }
- registerFileUpdate() {
- for (const e of this.containingProjects)
- e.registerFileUpdate(this.path);
- }
- setOptions(e, t) {
- e && (this.formatSettings ? this.formatSettings = { ...this.formatSettings, ...e } : (this.formatSettings = jF(this.host.newLine), z2(this.formatSettings, e))), t && (this.preferences || (this.preferences = Gp), this.preferences = { ...this.preferences, ...t });
- }
- getLatestVersion() {
- return this.textStorage.getSnapshot(), this.textStorage.getVersion();
- }
- saveTo(e) {
- this.host.writeFile(e, Yx(this.textStorage.getSnapshot()));
- }
- /** @internal */
- delayReloadNonMixedContentFile() {
- E.assert(!this.isDynamicOrHasMixedContent()), this.textStorage.delayReloadFromFileIntoText(), this.markContainingProjectsAsDirty();
- }
- reloadFromFile(e) {
- return this.textStorage.reloadWithFileText(e) ? (this.markContainingProjectsAsDirty(), !0) : !1;
- }
- editContent(e, t, n) {
- this.textStorage.edit(e, t, n), this.markContainingProjectsAsDirty();
- }
- markContainingProjectsAsDirty() {
- for (const e of this.containingProjects)
- e.markFileAsDirty(this.path);
- }
- isOrphan() {
- return this.deferredDelete || !ir(this.containingProjects, (e) => !e.isOrphan());
- }
- /** @internal */
- isContainedByBackgroundProject() {
- return ut(
- this.containingProjects,
- rN
- );
- }
- /**
- * @param line 1 based index
- */
- lineToTextSpan(e) {
- return this.textStorage.lineToTextSpan(e);
- }
- // eslint-disable-line @typescript-eslint/unified-signatures
- lineOffsetToPosition(e, t, n) {
- return this.textStorage.lineOffsetToPosition(e, t, n);
- }
- positionToLineOffset(e) {
- cZe(e);
- const t = this.textStorage.positionToLineOffset(e);
- return lZe(t), t;
- }
- isJavaScript() {
- return this.scriptKind === 1 || this.scriptKind === 2;
- }
- /** @internal */
- closeSourceMapFileWatcher() {
- this.sourceMapFilePath && !_s(this.sourceMapFilePath) && (mp(this.sourceMapFilePath), this.sourceMapFilePath = void 0);
- }
- };
- function cZe(e) {
- E.assert(typeof e == "number", `Expected position ${e} to be a number.`), E.assert(e >= 0, "Expected position to be non-negative.");
- }
- function lZe(e) {
- E.assert(typeof e.line == "number", `Expected line ${e.line} to be a number.`), E.assert(typeof e.offset == "number", `Expected offset ${e.offset} to be a number.`), E.assert(e.line > 0, `Expected line to be non-${e.line === 0 ? "zero" : "negative"}`), E.assert(e.offset > 0, `Expected offset to be non-${e.offset === 0 ? "zero" : "negative"}`);
- }
- var K8 = /* @__PURE__ */ ((e) => (e[e.Inferred = 0] = "Inferred", e[e.Configured = 1] = "Configured", e[e.External = 2] = "External", e[e.AutoImportProvider = 3] = "AutoImportProvider", e[e.Auxiliary = 4] = "Auxiliary", e))(K8 || {});
- function eN(e, t = !1) {
- const n = {
- js: 0,
- jsSize: 0,
- jsx: 0,
- jsxSize: 0,
- ts: 0,
- tsSize: 0,
- tsx: 0,
- tsxSize: 0,
- dts: 0,
- dtsSize: 0,
- deferred: 0,
- deferredSize: 0
- };
- for (const i of e) {
- const s = t ? i.textStorage.getTelemetryFileSize() : 0;
- switch (i.scriptKind) {
- case 1:
- n.js += 1, n.jsSize += s;
- break;
- case 2:
- n.jsx += 1, n.jsxSize += s;
- break;
- case 3:
- wl(i.fileName) ? (n.dts += 1, n.dtsSize += s) : (n.ts += 1, n.tsSize += s);
- break;
- case 4:
- n.tsx += 1, n.tsxSize += s;
- break;
- case 7:
- n.deferred += 1, n.deferredSize += s;
- break;
- }
- }
- return n;
- }
- function uZe(e) {
- const t = eN(e.getScriptInfos());
- return t.js > 0 && t.ts === 0 && t.tsx === 0;
- }
- function Uue(e) {
- const t = eN(e.getRootScriptInfos());
- return t.ts === 0 && t.tsx === 0;
- }
- function Vue(e) {
- const t = eN(e.getScriptInfos());
- return t.ts === 0 && t.tsx === 0;
- }
- function que(e) {
- return !e.some((t) => qo(
- t,
- ".ts"
- /* Ts */
- ) && !wl(t) || qo(
- t,
- ".tsx"
- /* Tsx */
- ));
- }
- function Hue(e) {
- return e.generatedFilePath !== void 0;
- }
- function iPe(e, t) {
- if (e === t || (e || hl).length === 0 && (t || hl).length === 0)
- return !0;
- const n = /* @__PURE__ */ new Map();
- let i = 0;
- for (const s of e)
- n.get(s) !== !0 && (n.set(s, !0), i++);
- for (const s of t) {
- const o = n.get(s);
- if (o === void 0)
- return !1;
- o === !0 && (n.set(s, !1), i--);
- }
- return i === 0;
- }
- function _Ze(e, t) {
- return e.enable !== t.enable || !iPe(e.include, t.include) || !iPe(e.exclude, t.exclude);
- }
- function fZe(e, t) {
- return By(e) !== By(t);
- }
- function pZe(e, t) {
- return e === t ? !1 : !Af(e, t);
- }
- var _k = class w7e {
- /** @internal */
- constructor(t, n, i, s, o, c, _, u, d, g, h) {
- switch (this.projectKind = n, this.projectService = i, this.documentRegistry = s, this.compilerOptions = _, this.compileOnSaveEnabled = u, this.watchOptions = d, this.rootFilesMap = /* @__PURE__ */ new Map(), this.plugins = [], this.cachedUnresolvedImportsPerFile = /* @__PURE__ */ new Map(), this.hasAddedorRemovedFiles = !1, this.hasAddedOrRemovedSymlinks = !1, this.lastReportedVersion = 0, this.projectProgramVersion = 0, this.projectStateVersion = 0, this.isInitialLoadPending = nm, this.dirty = !1, this.typingFiles = hl, this.moduleSpecifierCache = p_e(this), this.createHash = Ms(this.projectService.host, this.projectService.host.createHash), this.globalCacheResolutionModuleName = Dm.nonRelativeModuleNameForTypingCache, this.updateFromProjectInProgress = !1, this.projectName = t, this.directoryStructureHost = g, this.currentDirectory = this.projectService.getNormalizedAbsolutePath(h), this.getCanonicalFileName = this.projectService.toCanonicalFileName, this.jsDocParsingMode = this.projectService.jsDocParsingMode, this.cancellationToken = new Doe(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds), this.compilerOptions ? (o || By(this.compilerOptions) || this.projectService.hasDeferredExtension()) && (this.compilerOptions.allowNonTsExtensions = !0) : (this.compilerOptions = J9(), this.compilerOptions.allowNonTsExtensions = !0, this.compilerOptions.allowJs = !0), i.serverMode) {
- case 0:
- this.languageServiceEnabled = !0;
- break;
- case 1:
- this.languageServiceEnabled = !0, this.compilerOptions.noResolve = !0, this.compilerOptions.types = [];
- break;
- case 2:
- this.languageServiceEnabled = !1, this.compilerOptions.noResolve = !0, this.compilerOptions.types = [];
- break;
- default:
- E.assertNever(i.serverMode);
- }
- this.setInternalCompilerOptionsForEmittingJsFiles();
- const S = this.projectService.host;
- this.projectService.logger.loggingEnabled() ? this.trace = (T) => this.writeLog(T) : S.trace && (this.trace = (T) => S.trace(T)), this.realpath = Ms(S, S.realpath), this.preferNonRecursiveWatch = this.projectService.canUseWatchEvents || S.preferNonRecursiveWatch, this.resolutionCache = KW(
- this,
- this.currentDirectory,
- /*logChangesWhenResolvingModule*/
- !0
- ), this.languageService = Poe(this, this.documentRegistry, this.projectService.serverMode), c && this.disableLanguageService(c), this.markAsDirty(), rN(this) || (this.projectService.pendingEnsureProjectForOpenFiles = !0), this.projectService.onProjectCreation(this);
- }
- /** @internal */
- getResolvedProjectReferenceToRedirect(t) {
- }
- isNonTsProject() {
- return gp(this), Vue(this);
- }
- isJsOnlyProject() {
- return gp(this), uZe(this);
- }
- static resolveModule(t, n, i, s) {
- return w7e.importServicePluginSync({ name: t }, [n], i, s).resolvedModule;
- }
- /** @internal */
- static importServicePluginSync(t, n, i, s) {
- E.assertIsDefined(i.require);
- let o, c;
- for (const _ of n) {
- const u = Wl(i.resolvePath(Bn(_, "node_modules")));
- s(`Loading ${t.name} from ${_} (resolved to ${u})`);
- const d = i.require(u, t.name);
- if (!d.error) {
- c = d.module;
- break;
- }
- const g = d.error.stack || d.error.message || JSON.stringify(d.error);
- (o ?? (o = [])).push(`Failed to load module '${t.name}' from ${u}: ${g}`);
- }
- return { pluginConfigEntry: t, resolvedModule: c, errorLogs: o };
- }
- /** @internal */
- static async importServicePluginAsync(t, n, i, s) {
- E.assertIsDefined(i.importPlugin);
- let o, c;
- for (const _ of n) {
- const u = Bn(_, "node_modules");
- s(`Dynamically importing ${t.name} from ${_} (resolved to ${u})`);
- let d;
- try {
- d = await i.importPlugin(u, t.name);
- } catch (h) {
- d = { module: void 0, error: h };
- }
- if (!d.error) {
- c = d.module;
- break;
- }
- const g = d.error.stack || d.error.message || JSON.stringify(d.error);
- (o ?? (o = [])).push(`Failed to dynamically import module '${t.name}' from ${u}: ${g}`);
- }
- return { pluginConfigEntry: t, resolvedModule: c, errorLogs: o };
- }
- isKnownTypesPackageName(t) {
- return this.projectService.typingsInstaller.isKnownTypesPackageName(t);
- }
- installPackage(t) {
- return this.projectService.typingsInstaller.installPackage({ ...t, projectName: this.projectName, projectRootPath: this.toPath(this.currentDirectory) });
- }
- /** @internal */
- getGlobalTypingsCacheLocation() {
- return this.getGlobalCache();
- }
- /** @internal */
- getSymlinkCache() {
- return this.symlinks || (this.symlinks = eJ(this.getCurrentDirectory(), this.getCanonicalFileName)), this.program && !this.symlinks.hasProcessedResolutions() && this.symlinks.setSymlinksFromResolutions(
- this.program.forEachResolvedModule,
- this.program.forEachResolvedTypeReferenceDirective,
- this.program.getAutomaticTypeDirectiveResolutions()
- ), this.symlinks;
- }
- // Method of LanguageServiceHost
- getCompilationSettings() {
- return this.compilerOptions;
- }
- // Method to support public API
- getCompilerOptions() {
- return this.getCompilationSettings();
- }
- getNewLine() {
- return this.projectService.host.newLine;
- }
- getProjectVersion() {
- return this.projectStateVersion.toString();
- }
- getProjectReferences() {
- }
- getScriptFileNames() {
- if (!this.rootFilesMap.size)
- return Ue;
- let t;
- return this.rootFilesMap.forEach((n) => {
- (this.languageServiceEnabled || n.info && n.info.isScriptOpen()) && (t || (t = [])).push(n.fileName);
- }), Fn(t, this.typingFiles) || Ue;
- }
- getOrCreateScriptInfoAndAttachToProject(t) {
- const n = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
- t,
- this.currentDirectory,
- this.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- );
- if (n) {
- const i = this.rootFilesMap.get(n.path);
- i && i.info !== n && (i.info = n), n.attachToProject(this);
- }
- return n;
- }
- getScriptKind(t) {
- const n = this.projectService.getScriptInfoForPath(this.toPath(t));
- return n && n.scriptKind;
- }
- getScriptVersion(t) {
- const n = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
- t,
- this.currentDirectory,
- this.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- );
- return n && n.getLatestVersion();
- }
- getScriptSnapshot(t) {
- const n = this.getOrCreateScriptInfoAndAttachToProject(t);
- if (n)
- return n.getSnapshot();
- }
- getCancellationToken() {
- return this.cancellationToken;
- }
- getCurrentDirectory() {
- return this.currentDirectory;
- }
- getDefaultLibFileName() {
- const t = Xn(Os(this.projectService.getExecutingFilePath()));
- return Bn(t, yw(this.compilerOptions));
- }
- useCaseSensitiveFileNames() {
- return this.projectService.host.useCaseSensitiveFileNames;
- }
- readDirectory(t, n, i, s, o) {
- return this.directoryStructureHost.readDirectory(t, n, i, s, o);
- }
- readFile(t) {
- return this.projectService.host.readFile(t);
- }
- writeFile(t, n) {
- return this.projectService.host.writeFile(t, n);
- }
- fileExists(t) {
- const n = this.toPath(t);
- return !!this.projectService.getScriptInfoForPath(n) || !this.isWatchedMissingFile(n) && this.directoryStructureHost.fileExists(t);
- }
- /** @internal */
- resolveModuleNameLiterals(t, n, i, s, o, c) {
- return this.resolutionCache.resolveModuleNameLiterals(t, n, i, s, o, c);
- }
- /** @internal */
- getModuleResolutionCache() {
- return this.resolutionCache.getModuleResolutionCache();
- }
- /** @internal */
- resolveTypeReferenceDirectiveReferences(t, n, i, s, o, c) {
- return this.resolutionCache.resolveTypeReferenceDirectiveReferences(
- t,
- n,
- i,
- s,
- o,
- c
- );
- }
- /** @internal */
- resolveLibrary(t, n, i, s) {
- return this.resolutionCache.resolveLibrary(t, n, i, s);
- }
- directoryExists(t) {
- return this.directoryStructureHost.directoryExists(t);
- }
- getDirectories(t) {
- return this.directoryStructureHost.getDirectories(t);
- }
- /** @internal */
- getCachedDirectoryStructureHost() {
- }
- /** @internal */
- toPath(t) {
- return uo(t, this.currentDirectory, this.projectService.toCanonicalFileName);
- }
- /** @internal */
- watchDirectoryOfFailedLookupLocation(t, n, i) {
- return this.projectService.watchFactory.watchDirectory(
- t,
- n,
- i,
- this.projectService.getWatchOptions(this),
- Tl.FailedLookupLocations,
- this
- );
- }
- /** @internal */
- watchAffectingFileLocation(t, n) {
- return this.projectService.watchFactory.watchFile(
- t,
- n,
- 2e3,
- this.projectService.getWatchOptions(this),
- Tl.AffectingFileLocation,
- this
- );
- }
- /** @internal */
- clearInvalidateResolutionOfFailedLookupTimer() {
- return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`);
- }
- /** @internal */
- scheduleInvalidateResolutionsOfFailedLookupLocations() {
- this.projectService.throttledOperations.schedule(
- `${this.getProjectName()}FailedLookupInvalidation`,
- /*delay*/
- 1e3,
- () => {
- this.resolutionCache.invalidateResolutionsOfFailedLookupLocations() && this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this);
- }
- );
- }
- /** @internal */
- invalidateResolutionsOfFailedLookupLocations() {
- this.clearInvalidateResolutionOfFailedLookupTimer() && this.resolutionCache.invalidateResolutionsOfFailedLookupLocations() && (this.markAsDirty(), this.projectService.delayEnsureProjectForOpenFiles());
- }
- /** @internal */
- onInvalidatedResolution() {
- this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this);
- }
- /** @internal */
- watchTypeRootsDirectory(t, n, i) {
- return this.projectService.watchFactory.watchDirectory(
- t,
- n,
- i,
- this.projectService.getWatchOptions(this),
- Tl.TypeRoots,
- this
- );
- }
- /** @internal */
- hasChangedAutomaticTypeDirectiveNames() {
- return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames();
- }
- /** @internal */
- onChangedAutomaticTypeDirectiveNames() {
- this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this);
- }
- /** @internal */
- getGlobalCache() {
- return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0;
- }
- /** @internal */
- fileIsOpen(t) {
- return this.projectService.openFiles.has(t);
- }
- /** @internal */
- writeLog(t) {
- this.projectService.logger.info(t);
- }
- log(t) {
- this.writeLog(t);
- }
- error(t) {
- this.projectService.logger.msg(
- t,
- "Err"
- /* Err */
- );
- }
- setInternalCompilerOptionsForEmittingJsFiles() {
- (this.projectKind === 0 || this.projectKind === 2) && (this.compilerOptions.noEmitForJsFiles = !0);
- }
- /**
- * Get the errors that dont have any file name associated
- */
- getGlobalProjectErrors() {
- return Ln(this.projectErrors, (t) => !t.file) || hl;
- }
- /**
- * Get all the project errors
- */
- getAllProjectErrors() {
- return this.projectErrors || hl;
- }
- setProjectErrors(t) {
- this.projectErrors = t;
- }
- getLanguageService(t = !0) {
- return t && gp(this), this.languageService;
- }
- /** @internal */
- getSourceMapper() {
- return this.getLanguageService().getSourceMapper();
- }
- /** @internal */
- clearSourceMapperCache() {
- this.languageService.clearSourceMapperCache();
- }
- /** @internal */
- getDocumentPositionMapper(t, n) {
- return this.projectService.getDocumentPositionMapper(this, t, n);
- }
- /** @internal */
- getSourceFileLike(t) {
- return this.projectService.getSourceFileLike(t, this);
- }
- /** @internal */
- shouldEmitFile(t) {
- return t && !t.isDynamicOrHasMixedContent() && !this.program.isSourceOfProjectReferenceRedirect(t.path);
- }
- getCompileOnSaveAffectedFileList(t) {
- return this.languageServiceEnabled ? (gp(this), this.builderState = Ld.create(
- this.program,
- this.builderState,
- /*disableUseFileVersionAsSignature*/
- !0
- ), Ai(
- Ld.getFilesAffectedBy(
- this.builderState,
- this.program,
- t.path,
- this.cancellationToken,
- this.projectService.host
- ),
- (n) => this.shouldEmitFile(this.projectService.getScriptInfoForPath(n.path)) ? n.fileName : void 0
- )) : [];
- }
- /**
- * Returns true if emit was conducted
- */
- emitFile(t, n) {
- if (!this.languageServiceEnabled || !this.shouldEmitFile(t))
- return { emitSkipped: !0, diagnostics: hl };
- const { emitSkipped: i, diagnostics: s, outputFiles: o } = this.getLanguageService().getEmitOutput(t.fileName);
- if (!i) {
- for (const c of o) {
- const _ = es(c.name, this.currentDirectory);
- n(_, c.text, c.writeByteOrderMark);
- }
- if (this.builderState && P_(this.compilerOptions)) {
- const c = o.filter((_) => wl(_.name));
- if (c.length === 1) {
- const _ = this.program.getSourceFile(t.fileName), u = this.projectService.host.createHash ? this.projectService.host.createHash(c[0].text) : WE(c[0].text);
- Ld.updateSignatureOfFile(this.builderState, u, _.resolvedPath);
- }
- }
- }
- return { emitSkipped: i, diagnostics: s };
- }
- enableLanguageService() {
- this.languageServiceEnabled || this.projectService.serverMode === 2 || (this.languageServiceEnabled = !0, this.lastFileExceededProgramSize = void 0, this.projectService.onUpdateLanguageServiceStateForProject(
- this,
- /*languageServiceEnabled*/
- !0
- ));
- }
- /** @internal */
- cleanupProgram() {
- if (this.program) {
- for (const t of this.program.getSourceFiles())
- this.detachScriptInfoIfNotRoot(t.fileName);
- this.program.forEachResolvedProjectReference((t) => this.detachScriptInfoFromProject(t.sourceFile.fileName)), this.program = void 0;
- }
- }
- disableLanguageService(t) {
- this.languageServiceEnabled && (E.assert(
- this.projectService.serverMode !== 2
- /* Syntactic */
- ), this.languageService.cleanupSemanticCache(), this.languageServiceEnabled = !1, this.cleanupProgram(), this.lastFileExceededProgramSize = t, this.builderState = void 0, this.autoImportProviderHost && this.autoImportProviderHost.close(), this.autoImportProviderHost = void 0, this.resolutionCache.closeTypeRootsWatch(), this.clearGeneratedFileWatch(), this.projectService.verifyDocumentRegistry(), this.projectService.onUpdateLanguageServiceStateForProject(
- this,
- /*languageServiceEnabled*/
- !1
- ));
- }
- getProjectName() {
- return this.projectName;
- }
- removeLocalTypingsFromTypeAcquisition(t) {
- return !t.enable || !t.include ? t : { ...t, include: this.removeExistingTypings(t.include) };
- }
- getExternalFiles(t) {
- return V_(ta(this.plugins, (n) => {
- if (typeof n.module.getExternalFiles == "function")
- try {
- return n.module.getExternalFiles(
- this,
- t || 0
- /* Update */
- );
- } catch (i) {
- this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${i}`), i.stack && this.projectService.logger.info(i.stack);
- }
- }));
- }
- getSourceFile(t) {
- if (this.program)
- return this.program.getSourceFileByPath(t);
- }
- /** @internal */
- getSourceFileOrConfigFile(t) {
- const n = this.program.getCompilerOptions();
- return t === n.configFilePath ? n.configFile : this.getSourceFile(t);
- }
- close() {
- var t;
- this.typingsCache && this.projectService.typingsInstaller.onProjectClosed(this), this.typingsCache = void 0, this.closeWatchingTypingLocations(), this.cleanupProgram(), ir(this.externalFiles, (n) => this.detachScriptInfoIfNotRoot(n)), this.rootFilesMap.forEach((n) => {
- var i;
- return (i = n.info) == null ? void 0 : i.detachFromProject(this);
- }), this.projectService.pendingEnsureProjectForOpenFiles = !0, this.rootFilesMap = void 0, this.externalFiles = void 0, this.program = void 0, this.builderState = void 0, this.resolutionCache.clear(), this.resolutionCache = void 0, this.cachedUnresolvedImportsPerFile = void 0, (t = this.packageJsonWatches) == null || t.forEach((n) => {
- n.projects.delete(this), n.close();
- }), this.packageJsonWatches = void 0, this.moduleSpecifierCache.clear(), this.moduleSpecifierCache = void 0, this.directoryStructureHost = void 0, this.exportMapCache = void 0, this.projectErrors = void 0, this.plugins.length = 0, this.missingFilesMap && (D_(this.missingFilesMap, fd), this.missingFilesMap = void 0), this.clearGeneratedFileWatch(), this.clearInvalidateResolutionOfFailedLookupTimer(), this.autoImportProviderHost && this.autoImportProviderHost.close(), this.autoImportProviderHost = void 0, this.noDtsResolutionProject && this.noDtsResolutionProject.close(), this.noDtsResolutionProject = void 0, this.languageService.dispose(), this.languageService = void 0;
- }
- detachScriptInfoIfNotRoot(t) {
- const n = this.projectService.getScriptInfo(t);
- n && !this.isRoot(n) && n.detachFromProject(this);
- }
- isClosed() {
- return this.rootFilesMap === void 0;
- }
- hasRoots() {
- var t;
- return !!((t = this.rootFilesMap) != null && t.size);
- }
- /** @internal */
- isOrphan() {
- return !1;
- }
- getRootFiles() {
- return this.rootFilesMap && as(dy(this.rootFilesMap.values(), (t) => {
- var n;
- return (n = t.info) == null ? void 0 : n.fileName;
- }));
- }
- /** @internal */
- getRootFilesMap() {
- return this.rootFilesMap;
- }
- getRootScriptInfos() {
- return as(dy(this.rootFilesMap.values(), (t) => t.info));
- }
- getScriptInfos() {
- return this.languageServiceEnabled ? lr(this.program.getSourceFiles(), (t) => {
- const n = this.projectService.getScriptInfoForPath(t.resolvedPath);
- return E.assert(!!n, "getScriptInfo", () => `scriptInfo for a file '${t.fileName}' Path: '${t.path}' / '${t.resolvedPath}' is missing.`), n;
- }) : this.getRootScriptInfos();
- }
- getExcludedFiles() {
- return hl;
- }
- getFileNames(t, n) {
- if (!this.program)
- return [];
- if (!this.languageServiceEnabled) {
- let s = this.getRootFiles();
- if (this.compilerOptions) {
- const o = woe(this.compilerOptions);
- o && (s || (s = [])).push(o);
- }
- return s;
- }
- const i = [];
- for (const s of this.program.getSourceFiles())
- t && this.program.isSourceFileFromExternalLibrary(s) || i.push(s.fileName);
- if (!n) {
- const s = this.program.getCompilerOptions().configFile;
- if (s && (i.push(s.fileName), s.extendedSourceFiles))
- for (const o of s.extendedSourceFiles)
- i.push(o);
- }
- return i;
- }
- /** @internal */
- getFileNamesWithRedirectInfo(t) {
- return this.getFileNames().map((n) => ({
- fileName: n,
- isSourceOfProjectReferenceRedirect: t && this.isSourceOfProjectReferenceRedirect(n)
- }));
- }
- hasConfigFile(t) {
- if (this.program && this.languageServiceEnabled) {
- const n = this.program.getCompilerOptions().configFile;
- if (n) {
- if (t === n.fileName)
- return !0;
- if (n.extendedSourceFiles) {
- for (const i of n.extendedSourceFiles)
- if (t === i)
- return !0;
- }
- }
- }
- return !1;
- }
- containsScriptInfo(t) {
- if (this.isRoot(t)) return !0;
- if (!this.program) return !1;
- const n = this.program.getSourceFileByPath(t.path);
- return !!n && n.resolvedPath === t.path;
- }
- containsFile(t, n) {
- const i = this.projectService.getScriptInfoForNormalizedPath(t);
- return i && (i.isScriptOpen() || !n) ? this.containsScriptInfo(i) : !1;
- }
- isRoot(t) {
- var n, i;
- return ((i = (n = this.rootFilesMap) == null ? void 0 : n.get(t.path)) == null ? void 0 : i.info) === t;
- }
- // add a root file to project
- addRoot(t, n) {
- E.assert(!this.isRoot(t)), this.rootFilesMap.set(t.path, { fileName: n || t.fileName, info: t }), t.attachToProject(this), this.markAsDirty();
- }
- // add a root file that doesnt exist on host
- addMissingFileRoot(t) {
- const n = this.projectService.toPath(t);
- this.rootFilesMap.set(n, { fileName: t }), this.markAsDirty();
- }
- removeFile(t, n, i) {
- this.isRoot(t) && this.removeRoot(t), n ? this.resolutionCache.removeResolutionsOfFile(t.path) : this.resolutionCache.invalidateResolutionOfFile(t.path), this.cachedUnresolvedImportsPerFile.delete(t.path), i && t.detachFromProject(this), this.markAsDirty();
- }
- registerFileUpdate(t) {
- (this.updatedFileNames || (this.updatedFileNames = /* @__PURE__ */ new Set())).add(t);
- }
- /** @internal */
- markFileAsDirty(t) {
- this.markAsDirty(), this.exportMapCache && !this.exportMapCache.isEmpty() && (this.changedFilesForExportMapCache || (this.changedFilesForExportMapCache = /* @__PURE__ */ new Set())).add(t);
- }
- /** @internal */
- markAsDirty() {
- this.dirty || (this.projectStateVersion++, this.dirty = !0);
- }
- /** @internal */
- markAutoImportProviderAsDirty() {
- var t;
- this.autoImportProviderHost || (this.autoImportProviderHost = void 0), (t = this.autoImportProviderHost) == null || t.markAsDirty();
- }
- /** @internal */
- onAutoImportProviderSettingsChanged() {
- var t;
- this.autoImportProviderHost === !1 ? this.autoImportProviderHost = void 0 : (t = this.autoImportProviderHost) == null || t.markAsDirty();
- }
- /** @internal */
- onPackageJsonChange() {
- this.moduleSpecifierCache.clear(), this.autoImportProviderHost && this.autoImportProviderHost.markAsDirty();
- }
- /** @internal */
- onFileAddedOrRemoved(t) {
- this.hasAddedorRemovedFiles = !0, t && (this.hasAddedOrRemovedSymlinks = !0);
- }
- /** @internal */
- onDiscoveredSymlink() {
- this.hasAddedOrRemovedSymlinks = !0;
- }
- /** @internal */
- onReleaseOldSourceFile(t, n, i, s) {
- (!s || t.resolvedPath === t.path && s.resolvedPath !== t.path) && this.detachScriptInfoFromProject(t.fileName, i);
- }
- /** @internal */
- updateFromProject() {
- gp(this);
- }
- /**
- * Updates set of files that contribute to this project
- * @returns: true if set of files in the project stays the same and false - otherwise.
- */
- updateGraph() {
- var t, n;
- (t = rn) == null || t.push(rn.Phase.Session, "updateGraph", { name: this.projectName, kind: K8[this.projectKind] }), this.resolutionCache.startRecordingFilesWithChangedResolutions();
- const i = this.updateGraphWorker(), s = this.hasAddedorRemovedFiles;
- this.hasAddedorRemovedFiles = !1, this.hasAddedOrRemovedSymlinks = !1;
- const o = this.resolutionCache.finishRecordingFilesWithChangedResolutions() || hl;
- for (const _ of o)
- this.cachedUnresolvedImportsPerFile.delete(_);
- this.languageServiceEnabled && this.projectService.serverMode === 0 && !this.isOrphan() ? ((i || o.length) && (this.lastCachedUnresolvedImportsList = dZe(this.program, this.cachedUnresolvedImportsPerFile)), this.enqueueInstallTypingsForProject(s)) : this.lastCachedUnresolvedImportsList = void 0;
- const c = this.projectProgramVersion === 0 && i;
- return i && this.projectProgramVersion++, s && this.markAutoImportProviderAsDirty(), c && this.getPackageJsonAutoImportProvider(), (n = rn) == null || n.pop(), !i;
- }
- /** @internal */
- enqueueInstallTypingsForProject(t) {
- const n = this.getTypeAcquisition();
- if (!n || !n.enable || this.projectService.typingsInstaller === vL)
- return;
- const i = this.typingsCache;
- (t || !i || _Ze(n, i.typeAcquisition) || fZe(this.getCompilationSettings(), i.compilerOptions) || pZe(this.lastCachedUnresolvedImportsList, i.unresolvedImports)) && (this.typingsCache = {
- compilerOptions: this.getCompilationSettings(),
- typeAcquisition: n,
- unresolvedImports: this.lastCachedUnresolvedImportsList
- }, this.projectService.typingsInstaller.enqueueInstallTypingsRequest(this, n, this.lastCachedUnresolvedImportsList));
- }
- /** @internal */
- updateTypingFiles(t, n, i, s) {
- this.typingsCache = {
- compilerOptions: t,
- typeAcquisition: n,
- unresolvedImports: i
- };
- const o = !n || !n.enable ? hl : V_(s);
- yI(
- o,
- this.typingFiles,
- Kk(!this.useCaseSensitiveFileNames()),
- /*inserted*/
- ja,
- (c) => this.detachScriptInfoFromProject(c)
- ) && (this.typingFiles = o, this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile), this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this));
- }
- closeWatchingTypingLocations() {
- this.typingWatchers && D_(this.typingWatchers, fd), this.typingWatchers = void 0;
- }
- onTypingInstallerWatchInvoke() {
- this.typingWatchers.isInvoked = !0, this.projectService.updateTypingsForProject({ projectName: this.getProjectName(), kind: LF });
- }
- /** @internal */
- watchTypingLocations(t) {
- if (!t) {
- this.typingWatchers.isInvoked = !1;
- return;
- }
- if (!t.length) {
- this.closeWatchingTypingLocations();
- return;
- }
- const n = new Map(this.typingWatchers);
- this.typingWatchers || (this.typingWatchers = /* @__PURE__ */ new Map()), this.typingWatchers.isInvoked = !1;
- const i = (s, o) => {
- const c = this.toPath(s);
- n.delete(c), this.typingWatchers.has(c) || this.typingWatchers.set(
- c,
- o === "FileWatcher" ? this.projectService.watchFactory.watchFile(
- s,
- () => this.typingWatchers.isInvoked ? this.writeLog("TypingWatchers already invoked") : this.onTypingInstallerWatchInvoke(),
- 2e3,
- this.projectService.getWatchOptions(this),
- Tl.TypingInstallerLocationFile,
- this
- ) : this.projectService.watchFactory.watchDirectory(
- s,
- (_) => {
- if (this.typingWatchers.isInvoked) return this.writeLog("TypingWatchers already invoked");
- if (!qo(
- _,
- ".json"
- /* Json */
- )) return this.writeLog("Ignoring files that are not *.json");
- if (Sh(_, Bn(this.projectService.typingsInstaller.globalTypingsCacheLocation, "package.json"), !this.useCaseSensitiveFileNames())) return this.writeLog("Ignoring package.json change at global typings location");
- this.onTypingInstallerWatchInvoke();
- },
- 1,
- this.projectService.getWatchOptions(this),
- Tl.TypingInstallerLocationDirectory,
- this
- )
- );
- };
- for (const s of t) {
- const o = Hc(s);
- if (o === "package.json" || o === "bower.json") {
- i(
- s,
- "FileWatcher"
- /* FileWatcher */
- );
- continue;
- }
- if (np(this.currentDirectory, s, this.currentDirectory, !this.useCaseSensitiveFileNames())) {
- const c = s.indexOf(Vo, this.currentDirectory.length + 1);
- i(
- c !== -1 ? s.substr(0, c) : s,
- "DirectoryWatcher"
- /* DirectoryWatcher */
- );
- continue;
- }
- if (np(this.projectService.typingsInstaller.globalTypingsCacheLocation, s, this.currentDirectory, !this.useCaseSensitiveFileNames())) {
- i(
- this.projectService.typingsInstaller.globalTypingsCacheLocation,
- "DirectoryWatcher"
- /* DirectoryWatcher */
- );
- continue;
- }
- i(
- s,
- "DirectoryWatcher"
- /* DirectoryWatcher */
- );
- }
- n.forEach((s, o) => {
- s.close(), this.typingWatchers.delete(o);
- });
- }
- /** @internal */
- getCurrentProgram() {
- return this.program;
- }
- removeExistingTypings(t) {
- if (!t.length) return t;
- const n = NO(this.getCompilerOptions(), this.directoryStructureHost);
- return Ln(t, (i) => !n.includes(i));
- }
- updateGraphWorker() {
- var t, n;
- const i = this.languageService.getCurrentProgram();
- E.assert(i === this.program), E.assert(!this.isClosed(), "Called update graph worker of closed project"), this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);
- const s = lo(), { hasInvalidatedResolutions: o, hasInvalidatedLibResolutions: c } = this.resolutionCache.createHasInvalidatedResolutions(nm, nm);
- this.hasInvalidatedResolutions = o, this.hasInvalidatedLibResolutions = c, this.resolutionCache.startCachingPerDirectoryResolution(), this.dirty = !1, this.updateFromProjectInProgress = !0, this.program = this.languageService.getProgram(), this.updateFromProjectInProgress = !1, (t = rn) == null || t.push(rn.Phase.Session, "finishCachingPerDirectoryResolution"), this.resolutionCache.finishCachingPerDirectoryResolution(this.program, i), (n = rn) == null || n.pop(), E.assert(i === void 0 || this.program !== void 0);
- let _ = !1;
- if (this.program && (!i || this.program !== i && this.program.structureIsReused !== 2)) {
- if (_ = !0, this.rootFilesMap.forEach((g, h) => {
- var S;
- const T = this.program.getSourceFileByPath(h), C = g.info;
- !T || ((S = g.info) == null ? void 0 : S.path) === T.resolvedPath || (g.info = this.projectService.getScriptInfo(T.fileName), E.assert(g.info.isAttached(this)), C?.detachFromProject(this));
- }), EW(
- this.program,
- this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()),
- // Watch the missing files
- (g, h) => this.addMissingFileWatcher(g, h)
- ), this.generatedFilesMap) {
- const g = this.compilerOptions.outFile;
- Hue(this.generatedFilesMap) ? (!g || !this.isValidGeneratedFileWatcher(
- $u(g) + ".d.ts",
- this.generatedFilesMap
- )) && this.clearGeneratedFileWatch() : g ? this.clearGeneratedFileWatch() : this.generatedFilesMap.forEach((h, S) => {
- const T = this.program.getSourceFileByPath(S);
- (!T || T.resolvedPath !== S || !this.isValidGeneratedFileWatcher(
- z7(T.fileName, this.compilerOptions, this.program),
- h
- )) && (mp(h), this.generatedFilesMap.delete(S));
- });
- }
- this.languageServiceEnabled && this.projectService.serverMode === 0 && this.resolutionCache.updateTypeRootsWatch();
- }
- this.projectService.verifyProgram(this), this.exportMapCache && !this.exportMapCache.isEmpty() && (this.exportMapCache.releaseSymbols(), this.hasAddedorRemovedFiles || i && !this.program.structureIsReused ? this.exportMapCache.clear() : this.changedFilesForExportMapCache && i && this.program && Ch(this.changedFilesForExportMapCache, (g) => {
- const h = i.getSourceFileByPath(g), S = this.program.getSourceFileByPath(g);
- return !h || !S ? (this.exportMapCache.clear(), !0) : this.exportMapCache.onFileChanged(h, S, !!this.getTypeAcquisition().enable);
- })), this.changedFilesForExportMapCache && this.changedFilesForExportMapCache.clear(), (this.hasAddedOrRemovedSymlinks || this.program && !this.program.structureIsReused && this.getCompilerOptions().preserveSymlinks) && (this.symlinks = void 0, this.moduleSpecifierCache.clear());
- const u = this.externalFiles || hl;
- this.externalFiles = this.getExternalFiles(), yI(
- this.externalFiles,
- u,
- Kk(!this.useCaseSensitiveFileNames()),
- // Ensure a ScriptInfo is created for new external files. This is performed indirectly
- // by the host for files in the program when the program is retrieved above but
- // the program doesn't contain external files so this must be done explicitly.
- (g) => {
- const h = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
- g,
- this.currentDirectory,
- this.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- );
- h?.attachToProject(this);
- },
- (g) => this.detachScriptInfoFromProject(g)
- );
- const d = lo() - s;
- return this.sendPerformanceEvent("UpdateGraph", d), this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${_}${this.program ? ` structureIsReused:: ${LR[this.program.structureIsReused]}` : ""} Elapsed: ${d}ms`), this.projectService.logger.isTestLogger ? this.program !== i ? this.print(
- /*writeProjectFileNames*/
- !0,
- this.hasAddedorRemovedFiles,
- /*writeFileVersionAndText*/
- !0
- ) : this.writeLog("Same program as before") : this.hasAddedorRemovedFiles ? this.print(
- /*writeProjectFileNames*/
- !0,
- /*writeFileExplaination*/
- !0,
- /*writeFileVersionAndText*/
- !1
- ) : this.program !== i && this.writeLog("Different program with same set of files"), this.projectService.verifyDocumentRegistry(), _;
- }
- /** @internal */
- sendPerformanceEvent(t, n) {
- this.projectService.sendPerformanceEvent(t, n);
- }
- detachScriptInfoFromProject(t, n) {
- const i = this.projectService.getScriptInfo(t);
- i && (i.detachFromProject(this), n || this.resolutionCache.removeResolutionsOfFile(i.path));
- }
- addMissingFileWatcher(t, n) {
- var i;
- if (B0(this)) {
- const o = this.projectService.configFileExistenceInfoCache.get(t);
- if ((i = o?.config) != null && i.projects.has(this.canonicalConfigFilePath)) return JD;
- }
- const s = this.projectService.watchFactory.watchFile(
- es(n, this.currentDirectory),
- (o, c) => {
- B0(this) && this.getCachedDirectoryStructureHost().addOrDeleteFile(o, t, c), c === 0 && this.missingFilesMap.has(t) && (this.missingFilesMap.delete(t), s.close(), this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this));
- },
- 500,
- this.projectService.getWatchOptions(this),
- Tl.MissingFile,
- this
- );
- return s;
- }
- isWatchedMissingFile(t) {
- return !!this.missingFilesMap && this.missingFilesMap.has(t);
- }
- /** @internal */
- addGeneratedFileWatch(t, n) {
- if (this.compilerOptions.outFile)
- this.generatedFilesMap || (this.generatedFilesMap = this.createGeneratedFileWatcher(t));
- else {
- const i = this.toPath(n);
- if (this.generatedFilesMap) {
- if (Hue(this.generatedFilesMap)) {
- E.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`);
- return;
- }
- if (this.generatedFilesMap.has(i)) return;
- } else
- this.generatedFilesMap = /* @__PURE__ */ new Map();
- this.generatedFilesMap.set(i, this.createGeneratedFileWatcher(t));
- }
- }
- createGeneratedFileWatcher(t) {
- return {
- generatedFilePath: this.toPath(t),
- watcher: this.projectService.watchFactory.watchFile(
- t,
- () => {
- this.clearSourceMapperCache(), this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this);
- },
- 2e3,
- this.projectService.getWatchOptions(this),
- Tl.MissingGeneratedFile,
- this
- )
- };
- }
- isValidGeneratedFileWatcher(t, n) {
- return this.toPath(t) === n.generatedFilePath;
- }
- clearGeneratedFileWatch() {
- this.generatedFilesMap && (Hue(this.generatedFilesMap) ? mp(this.generatedFilesMap) : D_(this.generatedFilesMap, mp), this.generatedFilesMap = void 0);
- }
- getScriptInfoForNormalizedPath(t) {
- const n = this.projectService.getScriptInfoForPath(this.toPath(t));
- return n && !n.isAttached(this) ? Wh.ThrowProjectDoesNotContainDocument(t, this) : n;
- }
- getScriptInfo(t) {
- return this.projectService.getScriptInfo(t);
- }
- filesToString(t) {
- return this.filesToStringWorker(
- t,
- /*writeFileExplaination*/
- !0,
- /*writeFileVersionAndText*/
- !1
- );
- }
- filesToStringWorker(t, n, i) {
- if (this.isInitialLoadPending()) return ` Files (0) InitialLoadPending
-`;
- if (!this.program) return ` Files (0) NoProgram
-`;
- const s = this.program.getSourceFiles();
- let o = ` Files (${s.length})
-`;
- if (t) {
- for (const c of s)
- o += ` ${c.fileName}${i ? ` ${c.version} ${JSON.stringify(c.text)}` : ""}
-`;
- n && (o += `
-
-`, iU(this.program, (c) => o += ` ${c}
-`));
- }
- return o;
- }
- /** @internal */
- print(t, n, i) {
- var s;
- this.writeLog(`Project '${this.projectName}' (${K8[this.projectKind]})`), this.writeLog(this.filesToStringWorker(
- t && this.projectService.logger.hasLevel(
- 3
- /* verbose */
- ),
- n && this.projectService.logger.hasLevel(
- 3
- /* verbose */
- ),
- i && this.projectService.logger.hasLevel(
- 3
- /* verbose */
- )
- )), this.writeLog("-----------------------------------------------"), this.autoImportProviderHost && this.autoImportProviderHost.print(
- /*writeProjectFileNames*/
- !1,
- /*writeFileExplaination*/
- !1,
- /*writeFileVersionAndText*/
- !1
- ), (s = this.noDtsResolutionProject) == null || s.print(
- /*writeProjectFileNames*/
- !1,
- /*writeFileExplaination*/
- !1,
- /*writeFileVersionAndText*/
- !1
- );
- }
- setCompilerOptions(t) {
- var n;
- if (t) {
- t.allowNonTsExtensions = !0;
- const i = this.compilerOptions;
- this.compilerOptions = t, this.setInternalCompilerOptionsForEmittingJsFiles(), (n = this.noDtsResolutionProject) == null || n.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject()), e7(i, t) && (this.cachedUnresolvedImportsPerFile.clear(), this.lastCachedUnresolvedImportsList = void 0, this.resolutionCache.onChangesAffectModuleResolution(), this.moduleSpecifierCache.clear()), this.markAsDirty();
- }
- }
- /** @internal */
- setWatchOptions(t) {
- this.watchOptions = t;
- }
- /** @internal */
- getWatchOptions() {
- return this.watchOptions;
- }
- setTypeAcquisition(t) {
- t && (this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(t));
- }
- getTypeAcquisition() {
- return this.typeAcquisition || {};
- }
- /** @internal */
- getChangesSinceVersion(t, n) {
- var i, s;
- const o = n ? (u) => as(u.entries(), ([d, g]) => ({
- fileName: d,
- isSourceOfProjectReferenceRedirect: g
- })) : (u) => as(u.keys());
- this.isInitialLoadPending() || gp(this);
- const c = {
- projectName: this.getProjectName(),
- version: this.projectProgramVersion,
- isInferred: B6(this),
- options: this.getCompilationSettings(),
- languageServiceDisabled: !this.languageServiceEnabled,
- lastFileExceededProgramSize: this.lastFileExceededProgramSize
- }, _ = this.updatedFileNames;
- if (this.updatedFileNames = void 0, this.lastReportedFileNames && t === this.lastReportedVersion) {
- if (this.projectProgramVersion === this.lastReportedVersion && !_)
- return { info: c, projectErrors: this.getGlobalProjectErrors() };
- const u = this.lastReportedFileNames, d = ((i = this.externalFiles) == null ? void 0 : i.map((D) => ({
- fileName: Wo(D),
- isSourceOfProjectReferenceRedirect: !1
- }))) || hl, g = Yk(
- this.getFileNamesWithRedirectInfo(!!n).concat(d),
- (D) => D.fileName,
- (D) => D.isSourceOfProjectReferenceRedirect
- ), h = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), T = _ ? as(_.keys()) : [], C = [];
- return El(g, (D, P) => {
- u.has(P) ? n && D !== u.get(P) && C.push({
- fileName: P,
- isSourceOfProjectReferenceRedirect: D
- }) : h.set(P, D);
- }), El(u, (D, P) => {
- g.has(P) || S.set(P, D);
- }), this.lastReportedFileNames = g, this.lastReportedVersion = this.projectProgramVersion, {
- info: c,
- changes: {
- added: o(h),
- removed: o(S),
- updated: n ? T.map((D) => ({
- fileName: D,
- isSourceOfProjectReferenceRedirect: this.isSourceOfProjectReferenceRedirect(D)
- })) : T,
- updatedRedirects: n ? C : void 0
- },
- projectErrors: this.getGlobalProjectErrors()
- };
- } else {
- const u = this.getFileNamesWithRedirectInfo(!!n), d = ((s = this.externalFiles) == null ? void 0 : s.map((h) => ({
- fileName: Wo(h),
- isSourceOfProjectReferenceRedirect: !1
- }))) || hl, g = u.concat(d);
- return this.lastReportedFileNames = Yk(
- g,
- (h) => h.fileName,
- (h) => h.isSourceOfProjectReferenceRedirect
- ), this.lastReportedVersion = this.projectProgramVersion, {
- info: c,
- files: n ? g : g.map((h) => h.fileName),
- projectErrors: this.getGlobalProjectErrors()
- };
- }
- }
- // remove a root file from project
- removeRoot(t) {
- this.rootFilesMap.delete(t.path);
- }
- /** @internal */
- isSourceOfProjectReferenceRedirect(t) {
- return !!this.program && this.program.isSourceOfProjectReferenceRedirect(t);
- }
- /** @internal */
- getGlobalPluginSearchPaths() {
- return [
- ...this.projectService.pluginProbeLocations,
- // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
- Bn(this.projectService.getExecutingFilePath(), "../../..")
- ];
- }
- enableGlobalPlugins(t) {
- if (!this.projectService.globalPlugins.length) return;
- const n = this.projectService.host;
- if (!n.require && !n.importPlugin) {
- this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
- return;
- }
- const i = this.getGlobalPluginSearchPaths();
- for (const s of this.projectService.globalPlugins)
- s && (t.plugins && t.plugins.some((o) => o.name === s) || (this.projectService.logger.info(`Loading global plugin ${s}`), this.enablePlugin({ name: s, global: !0 }, i)));
- }
- enablePlugin(t, n) {
- this.projectService.requestEnablePlugin(this, t, n);
- }
- /** @internal */
- enableProxy(t, n) {
- try {
- if (typeof t != "function") {
- this.projectService.logger.info(`Skipped loading plugin ${n.name} because it did not expose a proper factory function`);
- return;
- }
- const i = {
- config: n,
- project: this,
- languageService: this.languageService,
- languageServiceHost: this,
- serverHost: this.projectService.host,
- session: this.projectService.session
- }, s = t({ typescript: BDe }), o = s.create(i);
- for (const c of Object.keys(this.languageService))
- c in o || (this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${c} in created LS. Patching.`), o[c] = this.languageService[c]);
- this.projectService.logger.info("Plugin validation succeeded"), this.languageService = o, this.plugins.push({ name: n.name, module: s });
- } catch (i) {
- this.projectService.logger.info(`Plugin activation failed: ${i}`);
- }
- }
- /** @internal */
- onPluginConfigurationChanged(t, n) {
- this.plugins.filter((i) => i.name === t).forEach((i) => {
- i.module.onConfigurationChanged && i.module.onConfigurationChanged(n);
- });
- }
- /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
- refreshDiagnostics() {
- this.projectService.sendProjectsUpdatedInBackgroundEvent();
- }
- /** @internal */
- getPackageJsonsVisibleToFile(t, n) {
- return this.projectService.serverMode !== 0 ? hl : this.projectService.getPackageJsonsVisibleToFile(t, this, n);
- }
- /** @internal */
- getNearestAncestorDirectoryWithPackageJson(t) {
- return this.projectService.getNearestAncestorDirectoryWithPackageJson(t);
- }
- /** @internal */
- getPackageJsonsForAutoImport(t) {
- return this.getPackageJsonsVisibleToFile(Bn(this.currentDirectory, RD), t);
- }
- /** @internal */
- getPackageJsonCache() {
- return this.projectService.packageJsonCache;
- }
- /** @internal */
- getCachedExportInfoMap() {
- return this.exportMapCache || (this.exportMapCache = JV(this));
- }
- /** @internal */
- clearCachedExportInfoMap() {
- var t;
- (t = this.exportMapCache) == null || t.clear();
- }
- /** @internal */
- getModuleSpecifierCache() {
- return this.moduleSpecifierCache;
- }
- /** @internal */
- includePackageJsonAutoImports() {
- return this.projectService.includePackageJsonAutoImports() === 0 || !this.languageServiceEnabled || g8(this.currentDirectory) || !this.isDefaultProjectForOpenFiles() ? 0 : this.projectService.includePackageJsonAutoImports();
- }
- /** @internal */
- getHostForAutoImportProvider() {
- var t, n;
- return this.program ? {
- fileExists: this.program.fileExists,
- directoryExists: this.program.directoryExists,
- realpath: this.program.realpath || ((t = this.projectService.host.realpath) == null ? void 0 : t.bind(this.projectService.host)),
- getCurrentDirectory: this.getCurrentDirectory.bind(this),
- readFile: this.projectService.host.readFile.bind(this.projectService.host),
- getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host),
- trace: (n = this.projectService.host.trace) == null ? void 0 : n.bind(this.projectService.host),
- useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(),
- readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host)
- } : this.projectService.host;
- }
- /** @internal */
- getPackageJsonAutoImportProvider() {
- var t, n, i;
- if (this.autoImportProviderHost === !1)
- return;
- if (this.projectService.serverMode !== 0) {
- this.autoImportProviderHost = !1;
- return;
- }
- if (this.autoImportProviderHost) {
- if (gp(this.autoImportProviderHost), this.autoImportProviderHost.isEmpty()) {
- this.autoImportProviderHost.close(), this.autoImportProviderHost = void 0;
- return;
- }
- return this.autoImportProviderHost.getCurrentProgram();
- }
- const s = this.includePackageJsonAutoImports();
- if (s) {
- (t = rn) == null || t.push(rn.Phase.Session, "getPackageJsonAutoImportProvider");
- const o = lo();
- if (this.autoImportProviderHost = Que.create(s, this, this.getHostForAutoImportProvider(), this.documentRegistry), this.autoImportProviderHost)
- return gp(this.autoImportProviderHost), this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", lo() - o), (n = rn) == null || n.pop(), this.autoImportProviderHost.getCurrentProgram();
- (i = rn) == null || i.pop();
- }
- }
- isDefaultProjectForOpenFiles() {
- return !!El(
- this.projectService.openFiles,
- (t, n) => this.projectService.tryGetDefaultProjectForFile(this.projectService.getScriptInfoForPath(n)) === this
- );
- }
- /** @internal */
- watchNodeModulesForPackageJsonChanges(t) {
- return this.projectService.watchPackageJsonsInNodeModules(t, this);
- }
- /** @internal */
- getIncompleteCompletionsCache() {
- return this.projectService.getIncompleteCompletionsCache();
- }
- /** @internal */
- getNoDtsResolutionProject(t) {
- return E.assert(
- this.projectService.serverMode === 0
- /* Semantic */
- ), this.noDtsResolutionProject || (this.noDtsResolutionProject = new $ue(this.projectService, this.documentRegistry, this.getCompilerOptionsForNoDtsResolutionProject(), this.currentDirectory)), this.noDtsResolutionProject.rootFile !== t && (this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject, [t]), this.noDtsResolutionProject.rootFile = t), this.noDtsResolutionProject;
- }
- /** @internal */
- runWithTemporaryFileUpdate(t, n, i) {
- var s, o, c, _;
- const u = this.program, d = E.checkDefined((s = this.program) == null ? void 0 : s.getSourceFile(t), "Expected file to be part of program"), g = E.checkDefined(d.getFullText());
- (o = this.getScriptInfo(t)) == null || o.editContent(0, g.length, n), this.updateGraph();
- try {
- i(this.program, u, (c = this.program) == null ? void 0 : c.getSourceFile(t));
- } finally {
- (_ = this.getScriptInfo(t)) == null || _.editContent(0, n.length, g);
- }
- }
- getCompilerOptionsForNoDtsResolutionProject() {
- return {
- ...this.getCompilerOptions(),
- noDtsResolution: !0,
- allowJs: !0,
- maxNodeModuleJsDepth: 3,
- diagnostics: !1,
- skipLibCheck: !0,
- sourceMap: !1,
- types: Ue,
- lib: Ue,
- noLib: !0
- };
- }
- };
- function dZe(e, t) {
- var n, i;
- const s = e.getSourceFiles();
- (n = rn) == null || n.push(rn.Phase.Session, "getUnresolvedImports", { count: s.length });
- const o = e.getTypeChecker().getAmbientModules().map((_) => ap(_.getName())), c = IE(ta(s, (_) => mZe(
- e,
- _,
- o,
- t
- )));
- return (i = rn) == null || i.pop(), c;
- }
- function mZe(e, t, n, i) {
- return NE(i, t.path, () => {
- let s;
- return e.forEachResolvedModule(({ resolvedModule: o }, c) => {
- (!o || !J4(o.extension)) && !Sl(c) && !n.some((_) => _ === c) && (s = wr(s, MO(c).packageName));
- }, t), s || hl;
- });
- }
- var Gue = class extends _k {
- /** @internal */
- constructor(e, t, n, i, s, o, c) {
- super(
- e.newInferredProjectName(),
- 0,
- e,
- t,
- // TODO: GH#18217
- /*files*/
- void 0,
- /*lastFileExceededProgramSize*/
- void 0,
- n,
- /*compileOnSaveEnabled*/
- !1,
- i,
- e.host,
- o
- ), this._isJsInferredProject = !1, this.typeAcquisition = c, this.projectRootPath = s && e.toCanonicalFileName(s), !s && !e.useSingleInferredProject && (this.canonicalCurrentDirectory = e.toCanonicalFileName(this.currentDirectory)), this.enableGlobalPlugins(this.getCompilerOptions());
- }
- toggleJsInferredProject(e) {
- e !== this._isJsInferredProject && (this._isJsInferredProject = e, this.setCompilerOptions());
- }
- setCompilerOptions(e) {
- if (!e && !this.getCompilationSettings())
- return;
- const t = nV(e || this.getCompilationSettings());
- this._isJsInferredProject && typeof t.maxNodeModuleJsDepth != "number" ? t.maxNodeModuleJsDepth = 2 : this._isJsInferredProject || (t.maxNodeModuleJsDepth = void 0), t.allowJs = !0, super.setCompilerOptions(t);
- }
- addRoot(e) {
- E.assert(e.isScriptOpen()), this.projectService.startWatchingConfigFilesForInferredProjectRoot(e), !this._isJsInferredProject && e.isJavaScript() ? this.toggleJsInferredProject(
- /*isJsInferredProject*/
- !0
- ) : this.isOrphan() && this._isJsInferredProject && !e.isJavaScript() && this.toggleJsInferredProject(
- /*isJsInferredProject*/
- !1
- ), super.addRoot(e);
- }
- removeRoot(e) {
- this.projectService.stopWatchingConfigFilesForScriptInfo(e), super.removeRoot(e), !this.isOrphan() && this._isJsInferredProject && e.isJavaScript() && Mi(this.getRootScriptInfos(), (t) => !t.isJavaScript()) && this.toggleJsInferredProject(
- /*isJsInferredProject*/
- !1
- );
- }
- /** @internal */
- isOrphan() {
- return !this.hasRoots();
- }
- isProjectWithSingleRoot() {
- return !this.projectRootPath && !this.projectService.useSingleInferredProject || this.getRootScriptInfos().length === 1;
- }
- close() {
- ir(this.getRootScriptInfos(), (e) => this.projectService.stopWatchingConfigFilesForScriptInfo(e)), super.close();
- }
- getTypeAcquisition() {
- return this.typeAcquisition || {
- enable: Uue(this),
- include: Ue,
- exclude: Ue
- };
- }
- }, $ue = class extends _k {
- constructor(e, t, n, i) {
- super(
- e.newAuxiliaryProjectName(),
- 4,
- e,
- t,
- /*hasExplicitListOfFiles*/
- !1,
- /*lastFileExceededProgramSize*/
- void 0,
- n,
- /*compileOnSaveEnabled*/
- !1,
- /*watchOptions*/
- void 0,
- e.host,
- i
- );
- }
- isOrphan() {
- return !0;
- }
- scheduleInvalidateResolutionsOfFailedLookupLocations() {
- }
- }, Xue = class ume extends _k {
- /** @internal */
- constructor(t, n, i, s) {
- super(
- t.projectService.newAutoImportProviderProjectName(),
- 3,
- t.projectService,
- i,
- /*hasExplicitListOfFiles*/
- !1,
- /*lastFileExceededProgramSize*/
- void 0,
- s,
- /*compileOnSaveEnabled*/
- !1,
- t.getWatchOptions(),
- t.projectService.host,
- t.currentDirectory
- ), this.hostProject = t, this.rootFileNames = n, this.useSourceOfProjectReferenceRedirect = Ms(this.hostProject, this.hostProject.useSourceOfProjectReferenceRedirect), this.getParsedCommandLine = Ms(this.hostProject, this.hostProject.getParsedCommandLine);
- }
- /** @internal */
- static getRootFileNames(t, n, i, s) {
- var o, c;
- if (!t)
- return Ue;
- const _ = n.getCurrentProgram();
- if (!_)
- return Ue;
- const u = lo();
- let d, g;
- const h = Bn(n.currentDirectory, RD), S = n.getPackageJsonsForAutoImport(Bn(n.currentDirectory, h));
- for (const B of S)
- (o = B.dependencies) == null || o.forEach((z, X) => I(X)), (c = B.peerDependencies) == null || c.forEach((z, X) => I(X));
- let T = 0;
- if (d) {
- const B = n.getSymlinkCache();
- for (const z of as(d.keys())) {
- if (t === 2 && T > this.maxDependencies)
- return n.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`), Ue;
- const X = Iz(
- z,
- n.currentDirectory,
- s,
- i,
- _.getModuleResolutionCache()
- );
- if (X) {
- const V = F(X, _, B);
- if (V) {
- T += P(V);
- continue;
- }
- }
- if (!ir([n.currentDirectory, n.getGlobalTypingsCacheLocation()], (V) => {
- if (V) {
- const ae = Iz(
- `@types/${z}`,
- V,
- s,
- i,
- _.getModuleResolutionCache()
- );
- if (ae) {
- const ee = F(ae, _, B);
- return T += P(ee), !0;
- }
- }
- }) && X && s.allowJs && s.maxNodeModuleJsDepth) {
- const V = F(
- X,
- _,
- B,
- /*resolveJs*/
- !0
- );
- T += P(V);
- }
- }
- }
- const C = _.getResolvedProjectReferences();
- let D = 0;
- return C?.length && n.projectService.getHostPreferences().includeCompletionsForModuleExports && C.forEach((B) => {
- if (B?.commandLine.options.outFile)
- D += P(O([
- zy(B.commandLine.options.outFile, ".d.ts")
- ]));
- else if (B) {
- const z = Iu(
- () => Gx(
- B.commandLine,
- !n.useCaseSensitiveFileNames()
- )
- );
- D += P(O(Ai(
- B.commandLine.fileNames,
- (X) => !wl(X) && !qo(
- X,
- ".json"
- /* Json */
- ) && !_.getSourceFile(X) ? p6(
- X,
- B.commandLine,
- !n.useCaseSensitiveFileNames(),
- z
- ) : void 0
- )));
- }
- }), g?.size && n.log(`AutoImportProviderProject: found ${g.size} root files in ${T} dependencies ${D} referenced projects in ${lo() - u} ms`), g ? as(g.values()) : Ue;
- function P(B) {
- return B?.length ? (g ?? (g = /* @__PURE__ */ new Set()), B.forEach((z) => g.add(z)), 1) : 0;
- }
- function I(B) {
- Ui(B, "@types/") || (d || (d = /* @__PURE__ */ new Set())).add(B);
- }
- function F(B, z, X, q) {
- var V;
- const ae = jz(
- B,
- s,
- i,
- z.getModuleResolutionCache(),
- q
- );
- if (ae) {
- const ee = (V = i.realpath) == null ? void 0 : V.call(i, B.packageDirectory), G = ee ? n.toPath(ee) : void 0, ue = G && G !== n.toPath(B.packageDirectory);
- return ue && X.setSymlinkedDirectory(B.packageDirectory, {
- real: ul(ee),
- realPath: ul(G)
- }), O(ae, ue ? (re) => re.replace(B.packageDirectory, ee) : void 0);
- }
- }
- function O(B, z) {
- return Ai(B, (X) => {
- const q = z ? z(X) : X;
- if (!_.getSourceFile(q) && !(z && _.getSourceFile(X)))
- return q;
- });
- }
- }
- /** @internal */
- static create(t, n, i, s) {
- if (t === 0)
- return;
- const o = {
- ...n.getCompilerOptions(),
- ...this.compilerOptionsOverrides
- }, c = this.getRootFileNames(t, n, i, o);
- if (c.length)
- return new ume(n, c, s, o);
- }
- /** @internal */
- isEmpty() {
- return !ut(this.rootFileNames);
- }
- /** @internal */
- isOrphan() {
- return !0;
- }
- updateGraph() {
- let t = this.rootFileNames;
- t || (t = ume.getRootFileNames(
- this.hostProject.includePackageJsonAutoImports(),
- this.hostProject,
- this.hostProject.getHostForAutoImportProvider(),
- this.getCompilationSettings()
- )), this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this, t), this.rootFileNames = t;
- const n = this.getCurrentProgram(), i = super.updateGraph();
- return n && n !== this.getCurrentProgram() && this.hostProject.clearCachedExportInfoMap(), i;
- }
- /** @internal */
- scheduleInvalidateResolutionsOfFailedLookupLocations() {
- }
- hasRoots() {
- var t;
- return !!((t = this.rootFileNames) != null && t.length);
- }
- /** @internal */
- markAsDirty() {
- this.rootFileNames = void 0, super.markAsDirty();
- }
- getScriptFileNames() {
- return this.rootFileNames || Ue;
- }
- getLanguageService() {
- throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`.");
- }
- /** @internal */
- onAutoImportProviderSettingsChanged() {
- throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead.");
- }
- /** @internal */
- onPackageJsonChange() {
- throw new Error("package.json changes should be notified on an AutoImportProvider's host project");
- }
- getHostForAutoImportProvider() {
- throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.");
- }
- getProjectReferences() {
- return this.hostProject.getProjectReferences();
- }
- /** @internal */
- includePackageJsonAutoImports() {
- return 0;
- }
- /** @internal */
- getSymlinkCache() {
- return this.hostProject.getSymlinkCache();
- }
- /** @internal */
- getModuleResolutionCache() {
- var t;
- return (t = this.hostProject.getCurrentProgram()) == null ? void 0 : t.getModuleResolutionCache();
- }
- };
- Xue.maxDependencies = 10, Xue.compilerOptionsOverrides = {
- diagnostics: !1,
- skipLibCheck: !0,
- sourceMap: !1,
- types: Ue,
- lib: Ue,
- noLib: !0
- };
- var Que = Xue, Yue = class extends _k {
- /** @internal */
- constructor(e, t, n, i, s, o) {
- super(
- e,
- 1,
- n,
- i,
- /*hasExplicitListOfFiles*/
- !1,
- /*lastFileExceededProgramSize*/
- void 0,
- /*compilerOptions*/
- {},
- /*compileOnSaveEnabled*/
- !1,
- /*watchOptions*/
- void 0,
- s,
- Xn(e)
- ), this.canonicalConfigFilePath = t, this.openFileWatchTriggered = /* @__PURE__ */ new Map(), this.canConfigFileJsonReportNoInputFiles = !1, this.isInitialLoadPending = B1, this.sendLoadingProjectFinish = !1, this.pendingUpdateLevel = 2, this.pendingUpdateReason = o;
- }
- /** @internal */
- setCompilerHost(e) {
- this.compilerHost = e;
- }
- /** @internal */
- getCompilerHost() {
- return this.compilerHost;
- }
- /** @internal */
- useSourceOfProjectReferenceRedirect() {
- return this.languageServiceEnabled;
- }
- /** @internal */
- getParsedCommandLine(e) {
- const t = Os(e), n = this.projectService.toCanonicalFileName(t);
- let i = this.projectService.configFileExistenceInfoCache.get(n);
- return i || this.projectService.configFileExistenceInfoCache.set(n, i = { exists: this.projectService.host.fileExists(t) }), this.projectService.ensureParsedConfigUptoDate(t, n, i, this), this.languageServiceEnabled && this.projectService.serverMode === 0 && this.projectService.watchWildcards(t, i, this), i.exists ? i.config.parsedCommandLine : void 0;
- }
- /** @internal */
- onReleaseParsedCommandLine(e) {
- this.releaseParsedConfig(this.projectService.toCanonicalFileName(Os(e)));
- }
- releaseParsedConfig(e) {
- this.projectService.stopWatchingWildCards(e, this), this.projectService.releaseParsedConfig(e, this);
- }
- /**
- * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
- * @returns: true if set of files in the project stays the same and false - otherwise.
- */
- updateGraph() {
- if (this.deferredClose) return !1;
- const e = this.dirty;
- this.isInitialLoadPending = nm;
- const t = this.pendingUpdateLevel;
- this.pendingUpdateLevel = 0;
- let n;
- switch (t) {
- case 1:
- this.openFileWatchTriggered.clear(), n = this.projectService.reloadFileNamesOfConfiguredProject(this);
- break;
- case 2:
- this.openFileWatchTriggered.clear();
- const i = E.checkDefined(this.pendingUpdateReason);
- this.projectService.reloadConfiguredProject(this, i), n = !0;
- break;
- default:
- n = super.updateGraph();
- }
- return this.compilerHost = void 0, this.projectService.sendProjectLoadingFinishEvent(this), this.projectService.sendProjectTelemetry(this), t === 2 || // Already sent event through reload
- n && // Not new program
- (!e || !this.triggerFileForConfigFileDiag || this.getCurrentProgram().structureIsReused === 2) ? this.triggerFileForConfigFileDiag = void 0 : this.triggerFileForConfigFileDiag || this.projectService.sendConfigFileDiagEvent(
- this,
- /*triggerFile*/
- void 0,
- /*force*/
- !1
- ), n;
- }
- /** @internal */
- getCachedDirectoryStructureHost() {
- return this.directoryStructureHost;
- }
- getConfigFilePath() {
- return this.getProjectName();
- }
- getProjectReferences() {
- return this.projectReferences;
- }
- updateReferences(e) {
- this.projectReferences = e, this.potentialProjectReferences = void 0;
- }
- /** @internal */
- setPotentialProjectReference(e) {
- E.assert(this.isInitialLoadPending()), (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(e);
- }
- /** @internal */
- getResolvedProjectReferenceToRedirect(e) {
- const t = this.getCurrentProgram();
- return t && t.getResolvedProjectReferenceToRedirect(e);
- }
- /** @internal */
- forEachResolvedProjectReference(e) {
- var t;
- return (t = this.getCurrentProgram()) == null ? void 0 : t.forEachResolvedProjectReference(e);
- }
- /** @internal */
- enablePluginsWithOptions(e) {
- var t;
- if (this.plugins.length = 0, !((t = e.plugins) != null && t.length) && !this.projectService.globalPlugins.length) return;
- const n = this.projectService.host;
- if (!n.require && !n.importPlugin) {
- this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
- return;
- }
- const i = this.getGlobalPluginSearchPaths();
- if (this.projectService.allowLocalPluginLoads) {
- const s = Xn(this.canonicalConfigFilePath);
- this.projectService.logger.info(`Local plugin loading enabled; adding ${s} to search paths`), i.unshift(s);
- }
- if (e.plugins)
- for (const s of e.plugins)
- this.enablePlugin(s, i);
- return this.enableGlobalPlugins(e);
- }
- /**
- * Get the errors that dont have any file name associated
- */
- getGlobalProjectErrors() {
- return Ln(this.projectErrors, (e) => !e.file) || hl;
- }
- /**
- * Get all the project errors
- */
- getAllProjectErrors() {
- return this.projectErrors || hl;
- }
- setProjectErrors(e) {
- this.projectErrors = e;
- }
- close() {
- this.projectService.configFileExistenceInfoCache.forEach((e, t) => this.releaseParsedConfig(t)), this.projectErrors = void 0, this.openFileWatchTriggered.clear(), this.compilerHost = void 0, super.close();
- }
- /** @internal */
- markAsDirty() {
- this.deferredClose || super.markAsDirty();
- }
- /** @internal */
- isSolution() {
- return this.getRootFilesMap().size === 0 && !this.canConfigFileJsonReportNoInputFiles;
- }
- /** @internal */
- isOrphan() {
- return !!this.deferredClose;
- }
- getEffectiveTypeRoots() {
- return TD(this.getCompilationSettings(), this) || [];
- }
- /** @internal */
- updateErrorOnNoInputFiles(e) {
- DO(e, this.getConfigFilePath(), this.getCompilerOptions().configFile.configFileSpecs, this.projectErrors, this.canConfigFileJsonReportNoInputFiles);
- }
- }, RH = class extends _k {
- /** @internal */
- constructor(e, t, n, i, s, o, c, _) {
- super(
- e,
- 2,
- t,
- n,
- /*hasExplicitListOfFiles*/
- !0,
- s,
- i,
- o,
- _,
- t.host,
- Xn(c || Wl(e))
- ), this.externalProjectName = e, this.compileOnSaveEnabled = o, this.excludedFiles = [], this.enableGlobalPlugins(this.getCompilerOptions());
- }
- updateGraph() {
- const e = super.updateGraph();
- return this.projectService.sendProjectTelemetry(this), e;
- }
- getExcludedFiles() {
- return this.excludedFiles;
- }
- };
- function B6(e) {
- return e.projectKind === 0;
- }
- function B0(e) {
- return e.projectKind === 1;
- }
- function tN(e) {
- return e.projectKind === 2;
- }
- function rN(e) {
- return e.projectKind === 3 || e.projectKind === 4;
- }
- function gL(e) {
- return B0(e) && !!e.deferredClose;
- }
- var jH = 20 * 1024 * 1024, BH = 4 * 1024 * 1024, hL = "projectsUpdatedInBackground", JH = "projectLoadingStart", zH = "projectLoadingFinish", WH = "largeFileReferenced", UH = "configFileDiag", VH = "projectLanguageServiceState", qH = "projectInfo", Zue = "openFileInfo", HH = "createFileWatcher", GH = "createDirectoryWatcher", $H = "closeFileWatcher", sPe = "*ensureProjectForOpenFiles*";
- function aPe(e) {
- const t = /* @__PURE__ */ new Map();
- for (const n of e)
- if (typeof n.type == "object") {
- const i = n.type;
- i.forEach((s) => {
- E.assert(typeof s == "number");
- }), t.set(n.name, i);
- }
- return t;
- }
- var gZe = aPe(Od), hZe = aPe(zx), yZe = new Map(Object.entries({
- none: 0,
- block: 1,
- smart: 2
- /* Smart */
- })), Kue = {
- jquery: {
- // jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js")
- match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,
- types: ["jquery"]
- },
- WinJS: {
- // e.g. c:/temp/UWApp1/lib/winjs-4.0.1/js/base.js
- match: /^(.*\/winjs-[.\d]+)\/js\/base\.js$/i,
- // If the winjs/base.js file is found..
- exclude: [["^", 1, "/.*"]],
- // ..then exclude all files under the winjs folder
- types: ["winjs"]
- // And fetch the @types package for WinJS
- },
- Kendo: {
- // e.g. /Kendo3/wwwroot/lib/kendo/kendo.all.min.js
- match: /^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i,
- exclude: [["^", 1, "/.*"]],
- types: ["kendo-ui"]
- },
- "Office Nuget": {
- // e.g. /scripts/Office/1/excel-15.debug.js
- match: /^(.*\/office\/1)\/excel-\d+\.debug\.js$/i,
- // Office NuGet package is installed under a "1/office" folder
- exclude: [["^", 1, "/.*"]],
- // Exclude that whole folder if the file indicated above is found in it
- types: ["office"]
- // @types package to fetch instead
- },
- References: {
- match: /^(.*\/_references\.js)$/i,
- exclude: [["^", 1, "$"]]
- }
- };
- function J6(e) {
- return _s(e.indentStyle) && (e.indentStyle = yZe.get(e.indentStyle.toLowerCase()), E.assert(e.indentStyle !== void 0)), e;
- }
- function yL(e) {
- return gZe.forEach((t, n) => {
- const i = e[n];
- _s(i) && (e[n] = t.get(i.toLowerCase()));
- }), e;
- }
- function nN(e, t) {
- let n, i;
- return zx.forEach((s) => {
- const o = e[s.name];
- if (o === void 0) return;
- const c = hZe.get(s.name);
- (n || (n = {}))[s.name] = c ? _s(o) ? c.get(o.toLowerCase()) : o : kS(s, o, t || "", i || (i = []));
- }), n && { watchOptions: n, errors: i };
- }
- function e_e(e) {
- let t;
- return hO.forEach((n) => {
- const i = e[n.name];
- i !== void 0 && ((t || (t = {}))[n.name] = i);
- }), t;
- }
- function XH(e) {
- return _s(e) ? QH(e) : e;
- }
- function QH(e) {
- switch (e) {
- case "JS":
- return 1;
- case "JSX":
- return 2;
- case "TS":
- return 3;
- case "TSX":
- return 4;
- default:
- return 0;
- }
- }
- function t_e(e) {
- const { lazyConfiguredProjectsFromExternalProject: t, ...n } = e;
- return n;
- }
- var YH = {
- getFileName: (e) => e,
- getScriptKind: (e, t) => {
- let n;
- if (t) {
- const i = rC(e);
- i && ut(t, (s) => s.extension === i ? (n = s.scriptKind, !0) : !1);
- }
- return n;
- },
- hasMixedContent: (e, t) => ut(t, (n) => n.isMixedContent && qo(e, n.extension))
- }, ZH = {
- getFileName: (e) => e.fileName,
- getScriptKind: (e) => XH(e.scriptKind),
- // TODO: GH#18217
- hasMixedContent: (e) => !!e.hasMixedContent
- };
- function oPe(e, t) {
- for (const n of t)
- if (n.getProjectName() === e)
- return n;
- }
- var vL = {
- isKnownTypesPackageName: nm,
- // Should never be called because we never provide a types registry.
- installPackage: Vs,
- enqueueInstallTypingsRequest: ja,
- attach: ja,
- onProjectClosed: ja,
- globalTypingsCacheLocation: void 0
- // TODO: GH#18217
- }, r_e = { close: ja };
- function cPe(e, t) {
- if (!(!t || KH(e)))
- return t.get(e.path);
- }
- function vZe(e) {
- return !!e.containingProjects;
- }
- function KH(e) {
- return !!e.configFileInfo;
- }
- var n_e = /* @__PURE__ */ ((e) => (e[e.Find = 0] = "Find", e[e.Create = 1] = "Create", e[e.Reload = 2] = "Reload", e))(n_e || {});
- function bZe(e, t, n, i, s, o, c, _) {
- for (; ; ) {
- if (!t.isInitialLoadPending() && (!t.getCompilerOptions().composite || t.getCompilerOptions().disableSolutionSearching)) return;
- const u = t.projectService.getConfigFileNameForFile(
- {
- fileName: t.getConfigFilePath(),
- path: e.path,
- configFileInfo: !0
- },
- i === 0
- /* Find */
- );
- if (!u) return;
- const d = t.projectService.findCreateOrReloadConfiguredProject(
- u,
- i,
- s,
- o,
- /*triggerFile*/
- void 0,
- c,
- /*delayLoad*/
- !0,
- _
- );
- if (!d) return;
- d.project.isInitialLoadPending() && t.getCompilerOptions().composite && d.project.setPotentialProjectReference(t.canonicalConfigFilePath);
- const g = n(d.project);
- if (g) return g;
- t = d.project;
- }
- }
- function lPe(e, t, n, i, s, o, c, _) {
- var u;
- const d = (u = e.getCurrentProgram()) == null ? void 0 : u.getResolvedProjectReferences();
- if (!d) return;
- const g = t ? e.getResolvedProjectReferenceToRedirect(t) : void 0;
- if (g) {
- const T = Wo(g.sourceFile.fileName), C = e.projectService.findConfiguredProjectByProjectName(
- T,
- o
- );
- if (C) {
- const D = S(C);
- if (D) return D;
- } else if (i !== 0) {
- const D = i_e(
- d,
- e.getCompilerOptions(),
- (P, I) => g === P ? h(P, I) : void 0,
- i,
- e.projectService
- );
- if (D) return D;
- }
- }
- return i_e(
- d,
- e.getCompilerOptions(),
- (T, C) => g !== T ? h(T, C) : void 0,
- i,
- e.projectService
- );
- function h(T, C) {
- const D = e.projectService.findCreateOrReloadConfiguredProject(
- Wo(T.sourceFile.fileName),
- C,
- s,
- o,
- c,
- _
- );
- return D && (C === i ? n(D.project, D.sentConfigFileDiag) : S(D.project));
- }
- function S(T) {
- let C = !1;
- switch (i) {
- case 1:
- C = pPe(T, c);
- break;
- case 2:
- C = T.projectService.reloadConfiguredProjectClearingSemanticCache(T, s, _);
- break;
- case 0:
- break;
- default:
- E.assertNever(i);
- }
- const D = n(T, C);
- if (D) return D;
- }
- }
- function i_e(e, t, n, i, s, o) {
- const c = t.disableReferencedProjectLoad ? 0 : i;
- return ir(e, (_) => {
- if (!_) return;
- const u = Wo(_.sourceFile.fileName), d = s.toCanonicalFileName(u), g = o?.get(d);
- if (g !== void 0 && g >= c)
- return;
- const h = n(_, c);
- return h || ((o || (o = /* @__PURE__ */ new Map())).set(d, c), _.references && i_e(_.references, _.commandLine.options, n, c, s, o));
- });
- }
- function uPe(e, t) {
- return e.potentialProjectReferences && Ch(e.potentialProjectReferences, t);
- }
- function SZe(e, t, n, i) {
- return e.getCurrentProgram() ? e.forEachResolvedProjectReference(t) : e.isInitialLoadPending() ? uPe(e, i) : ir(e.getProjectReferences(), n);
- }
- function s_e(e, t, n) {
- const i = n && e.projectService.configuredProjects.get(n);
- return i && t(i);
- }
- function _Pe(e, t) {
- return SZe(
- e,
- (n) => s_e(e, t, n.sourceFile.path),
- (n) => s_e(e, t, e.toPath(g6(n))),
- (n) => s_e(e, t, n)
- );
- }
- function TZe(e, t) {
- return `${_s(t) ? `Config: ${t} ` : t ? `Project: ${t.getProjectName()} ` : ""}WatchType: ${e}`;
- }
- function a_e(e) {
- return !e.isScriptOpen() && e.mTime !== void 0;
- }
- function gp(e) {
- return e.invalidateResolutionsOfFailedLookupLocations(), e.dirty && !e.updateGraph();
- }
- function fPe(e, t, n) {
- if (!n && (e.invalidateResolutionsOfFailedLookupLocations(), !e.dirty))
- return !1;
- e.triggerFileForConfigFileDiag = t;
- const i = e.pendingUpdateLevel;
- if (e.updateGraph(), !e.triggerFileForConfigFileDiag && !n) return i === 2;
- const s = e.projectService.sendConfigFileDiagEvent(e, t, n);
- return e.triggerFileForConfigFileDiag = void 0, s;
- }
- function pPe(e, t) {
- if (t) {
- if (fPe(
- e,
- t,
- /*isReload*/
- !1
- )) return !0;
- } else
- gp(e);
- return !1;
- }
- function dPe(e) {
- return `Creating possible configured project for ${e.fileName} to open`;
- }
- function eG(e) {
- return `User requested reload projects: ${e}`;
- }
- function o_e(e) {
- B0(e) && (e.projectOptions = !0);
- }
- function c_e(e) {
- let t = 1;
- return () => e(t++);
- }
- function l_e() {
- return { idToCallbacks: /* @__PURE__ */ new Map(), pathToId: /* @__PURE__ */ new Map() };
- }
- function mPe(e, t) {
- return !!t && !!e.eventHandler && !!e.session;
- }
- function xZe(e, t) {
- if (!mPe(e, t)) return;
- const n = l_e(), i = l_e(), s = l_e();
- let o = 1;
- return e.session.addProtocolHandler("watchChange", (T) => (d(T.arguments), { responseRequired: !1 })), {
- watchFile: c,
- watchDirectory: _,
- getCurrentDirectory: () => e.host.getCurrentDirectory(),
- useCaseSensitiveFileNames: e.host.useCaseSensitiveFileNames
- };
- function c(T, C) {
- return u(
- n,
- T,
- C,
- (D) => ({ eventName: HH, data: { id: D, path: T } })
- );
- }
- function _(T, C, D) {
- return u(
- D ? s : i,
- T,
- C,
- (P) => ({
- eventName: GH,
- data: {
- id: P,
- path: T,
- recursive: !!D,
- // Special case node_modules as we watch it for changes to closed script infos as well
- ignoreUpdate: T.endsWith("/node_modules") ? void 0 : !0
- }
- })
- );
- }
- function u({ pathToId: T, idToCallbacks: C }, D, P, I) {
- const F = e.toPath(D);
- let O = T.get(F);
- O || T.set(F, O = o++);
- let B = C.get(O);
- return B || (C.set(O, B = /* @__PURE__ */ new Set()), e.eventHandler(I(O))), B.add(P), {
- close() {
- const z = C.get(O);
- z?.delete(P) && (z.size || (C.delete(O), T.delete(F), e.eventHandler({ eventName: $H, data: { id: O } })));
- }
- };
- }
- function d(T) {
- us(T) ? T.forEach(g) : g(T);
- }
- function g({ id: T, created: C, deleted: D, updated: P }) {
- h(
- T,
- C,
- 0
- /* Created */
- ), h(
- T,
- D,
- 2
- /* Deleted */
- ), h(
- T,
- P,
- 1
- /* Changed */
- );
- }
- function h(T, C, D) {
- C?.length && (S(n, T, C, (P, I) => P(I, D)), S(i, T, C, (P, I) => P(I)), S(s, T, C, (P, I) => P(I)));
- }
- function S(T, C, D, P) {
- var I;
- (I = T.idToCallbacks.get(C)) == null || I.forEach((F) => {
- D.forEach((O) => P(F, Wl(O)));
- });
- }
- }
- var gPe = class _me {
- constructor(t) {
- this.filenameToScriptInfo = /* @__PURE__ */ new Map(), this.nodeModulesWatchers = /* @__PURE__ */ new Map(), this.filenameToScriptInfoVersion = /* @__PURE__ */ new Map(), this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Map(), this.externalProjectToConfiguredProjectMap = /* @__PURE__ */ new Map(), this.externalProjects = [], this.inferredProjects = [], this.configuredProjects = /* @__PURE__ */ new Map(), this.newInferredProjectName = c_e(Oue), this.newAutoImportProviderProjectName = c_e(Fue), this.newAuxiliaryProjectName = c_e(Lue), this.openFiles = /* @__PURE__ */ new Map(), this.configFileForOpenFiles = /* @__PURE__ */ new Map(), this.rootOfInferredProjects = /* @__PURE__ */ new Set(), this.openFilesWithNonRootedDiskPath = /* @__PURE__ */ new Map(), this.compilerOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(), this.watchOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(), this.typeAcquisitionForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(), this.projectToSizeMap = /* @__PURE__ */ new Map(), this.configFileExistenceInfoCache = /* @__PURE__ */ new Map(), this.safelist = Kue, this.legacySafelist = /* @__PURE__ */ new Map(), this.pendingProjectUpdates = /* @__PURE__ */ new Map(), this.pendingEnsureProjectForOpenFiles = !1, this.seenProjects = /* @__PURE__ */ new Map(), this.sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map(), this.extendedConfigCache = /* @__PURE__ */ new Map(), this.baseline = ja, this.verifyDocumentRegistry = ja, this.verifyProgram = ja, this.onProjectCreation = ja;
- var n;
- this.host = t.host, this.logger = t.logger, this.cancellationToken = t.cancellationToken, this.useSingleInferredProject = t.useSingleInferredProject, this.useInferredProjectPerProjectRoot = t.useInferredProjectPerProjectRoot, this.typingsInstaller = t.typingsInstaller || vL, this.throttleWaitMilliseconds = t.throttleWaitMilliseconds, this.eventHandler = t.eventHandler, this.suppressDiagnosticEvents = t.suppressDiagnosticEvents, this.globalPlugins = t.globalPlugins || hl, this.pluginProbeLocations = t.pluginProbeLocations || hl, this.allowLocalPluginLoads = !!t.allowLocalPluginLoads, this.typesMapLocation = t.typesMapLocation === void 0 ? Bn(Xn(this.getExecutingFilePath()), "typesMap.json") : t.typesMapLocation, this.session = t.session, this.jsDocParsingMode = t.jsDocParsingMode, t.serverMode !== void 0 ? this.serverMode = t.serverMode : this.serverMode = 0, this.host.realpath && (this.realpathToScriptInfos = Ip()), this.currentDirectory = Wo(this.host.getCurrentDirectory()), this.toCanonicalFileName = zl(this.host.useCaseSensitiveFileNames), this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation ? ul(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)) : void 0, this.throttledOperations = new Rue(this.host, this.logger), this.typesMapLocation ? this.loadTypesMap() : this.logger.info("No types map provided; using the default"), this.typingsInstaller.attach(this), this.hostConfiguration = {
- formatCodeOptions: jF(this.host.newLine),
- preferences: Gp,
- hostInfo: "Unknown host",
- extraFileExtensions: []
- }, this.documentRegistry = qV(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
- const i = this.logger.hasLevel(
- 3
- /* verbose */
- ) ? 2 : this.logger.loggingEnabled() ? 1 : 0, s = i !== 0 ? (o) => this.logger.info(o) : ja;
- this.packageJsonCache = d_e(this), this.watchFactory = this.serverMode !== 0 ? {
- watchFile: zD,
- watchDirectory: zD
- } : DW(
- xZe(this, t.canUseWatchEvents) || this.host,
- i,
- s,
- TZe
- ), this.canUseWatchEvents = mPe(this, t.canUseWatchEvents), (n = t.incrementalVerifier) == null || n.call(t, this);
- }
- toPath(t) {
- return uo(t, this.currentDirectory, this.toCanonicalFileName);
- }
- /** @internal */
- getExecutingFilePath() {
- return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath());
- }
- /** @internal */
- getNormalizedAbsolutePath(t) {
- return es(t, this.host.getCurrentDirectory());
- }
- /** @internal */
- setDocument(t, n, i) {
- const s = E.checkDefined(this.getScriptInfoForPath(n));
- s.cacheSourceFile = { key: t, sourceFile: i };
- }
- /** @internal */
- getDocument(t, n) {
- const i = this.getScriptInfoForPath(n);
- return i && i.cacheSourceFile && i.cacheSourceFile.key === t ? i.cacheSourceFile.sourceFile : void 0;
- }
- /** @internal */
- ensureInferredProjectsUpToDate_TestOnly() {
- this.ensureProjectStructuresUptoDate();
- }
- /** @internal */
- getCompilerOptionsForInferredProjects() {
- return this.compilerOptionsForInferredProjects;
- }
- /** @internal */
- onUpdateLanguageServiceStateForProject(t, n) {
- if (!this.eventHandler)
- return;
- const i = {
- eventName: VH,
- data: { project: t, languageServiceEnabled: n }
- };
- this.eventHandler(i);
- }
- loadTypesMap() {
- try {
- const t = this.host.readFile(this.typesMapLocation);
- if (t === void 0) {
- this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`);
- return;
- }
- const n = JSON.parse(t);
- for (const i of Object.keys(n.typesMap))
- n.typesMap[i].match = new RegExp(n.typesMap[i].match, "i");
- this.safelist = n.typesMap;
- for (const i in n.simpleMap)
- co(n.simpleMap, i) && this.legacySafelist.set(i, n.simpleMap[i].toLowerCase());
- } catch (t) {
- this.logger.info(`Error loading types map: ${t}`), this.safelist = Kue, this.legacySafelist.clear();
- }
- }
- // eslint-disable-line @typescript-eslint/unified-signatures
- updateTypingsForProject(t) {
- const n = this.findProject(t.projectName);
- if (n)
- switch (t.kind) {
- case FF:
- n.updateTypingFiles(
- t.compilerOptions,
- t.typeAcquisition,
- t.unresolvedImports,
- t.typings
- );
- return;
- case LF:
- n.enqueueInstallTypingsForProject(
- /*forceRefresh*/
- !0
- );
- return;
- }
- }
- /** @internal */
- watchTypingLocations(t) {
- var n;
- (n = this.findProject(t.projectName)) == null || n.watchTypingLocations(t.files);
- }
- /** @internal */
- delayEnsureProjectForOpenFiles() {
- this.openFiles.size && (this.pendingEnsureProjectForOpenFiles = !0, this.throttledOperations.schedule(
- sPe,
- /*delay*/
- 2500,
- () => {
- this.pendingProjectUpdates.size !== 0 ? this.delayEnsureProjectForOpenFiles() : this.pendingEnsureProjectForOpenFiles && (this.ensureProjectForOpenFiles(), this.sendProjectsUpdatedInBackgroundEvent());
- }
- ));
- }
- delayUpdateProjectGraph(t) {
- if (gL(t) || (t.markAsDirty(), rN(t))) return;
- const n = t.getProjectName();
- this.pendingProjectUpdates.set(n, t), this.throttledOperations.schedule(
- n,
- /*delay*/
- 250,
- () => {
- this.pendingProjectUpdates.delete(n) && gp(t);
- }
- );
- }
- /** @internal */
- hasPendingProjectUpdate(t) {
- return this.pendingProjectUpdates.has(t.getProjectName());
- }
- /** @internal */
- sendProjectsUpdatedInBackgroundEvent() {
- if (!this.eventHandler)
- return;
- const t = {
- eventName: hL,
- data: {
- openFiles: as(this.openFiles.keys(), (n) => this.getScriptInfoForPath(n).fileName)
- }
- };
- this.eventHandler(t);
- }
- /** @internal */
- sendLargeFileReferencedEvent(t, n) {
- if (!this.eventHandler)
- return;
- const i = {
- eventName: WH,
- data: { file: t, fileSize: n, maxFileSize: BH }
- };
- this.eventHandler(i);
- }
- /** @internal */
- sendProjectLoadingStartEvent(t, n) {
- if (!this.eventHandler)
- return;
- t.sendLoadingProjectFinish = !0;
- const i = {
- eventName: JH,
- data: { project: t, reason: n }
- };
- this.eventHandler(i);
- }
- /** @internal */
- sendProjectLoadingFinishEvent(t) {
- if (!this.eventHandler || !t.sendLoadingProjectFinish)
- return;
- t.sendLoadingProjectFinish = !1;
- const n = {
- eventName: zH,
- data: { project: t }
- };
- this.eventHandler(n);
- }
- /** @internal */
- sendPerformanceEvent(t, n) {
- this.performanceEventHandler && this.performanceEventHandler({ kind: t, durationMs: n });
- }
- /** @internal */
- delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(t) {
- this.delayUpdateProjectGraph(t), this.delayEnsureProjectForOpenFiles();
- }
- delayUpdateProjectGraphs(t, n) {
- if (t.length) {
- for (const i of t)
- n && i.clearSourceMapperCache(), this.delayUpdateProjectGraph(i);
- this.delayEnsureProjectForOpenFiles();
- }
- }
- setCompilerOptionsForInferredProjects(t, n) {
- E.assert(n === void 0 || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled");
- const i = yL(t), s = nN(t, n), o = e_e(t);
- i.allowNonTsExtensions = !0;
- const c = n && this.toCanonicalFileName(n);
- c ? (this.compilerOptionsForInferredProjectsPerProjectRoot.set(c, i), this.watchOptionsForInferredProjectsPerProjectRoot.set(c, s || !1), this.typeAcquisitionForInferredProjectsPerProjectRoot.set(c, o)) : (this.compilerOptionsForInferredProjects = i, this.watchOptionsForInferredProjects = s, this.typeAcquisitionForInferredProjects = o);
- for (const _ of this.inferredProjects)
- (c ? _.projectRootPath === c : !_.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(_.projectRootPath)) && (_.setCompilerOptions(i), _.setTypeAcquisition(o), _.setWatchOptions(s?.watchOptions), _.setProjectErrors(s?.errors), _.compileOnSaveEnabled = i.compileOnSave, _.markAsDirty(), this.delayUpdateProjectGraph(_));
- this.delayEnsureProjectForOpenFiles();
- }
- findProject(t) {
- if (t !== void 0)
- return Iue(t) ? oPe(t, this.inferredProjects) : this.findExternalProjectByProjectName(t) || this.findConfiguredProjectByProjectName(Wo(t));
- }
- /** @internal */
- forEachProject(t) {
- this.externalProjects.forEach(t), this.configuredProjects.forEach(t), this.inferredProjects.forEach(t);
- }
- /** @internal */
- forEachEnabledProject(t) {
- this.forEachProject((n) => {
- !n.isOrphan() && n.languageServiceEnabled && t(n);
- });
- }
- getDefaultProjectForFile(t, n) {
- return n ? this.ensureDefaultProjectForFile(t) : this.tryGetDefaultProjectForFile(t);
- }
- /** @internal */
- tryGetDefaultProjectForFile(t) {
- const n = _s(t) ? this.getScriptInfoForNormalizedPath(t) : t;
- return n && !n.isOrphan() ? n.getDefaultProject() : void 0;
- }
- /**
- * If there is default project calculation pending for this file,
- * then it completes that calculation so that correct default project is used for the project
- */
- tryGetDefaultProjectForEnsuringConfiguredProjectForFile(t) {
- var n;
- const i = _s(t) ? this.getScriptInfoForNormalizedPath(t) : t;
- if (i)
- return (n = this.pendingOpenFileProjectUpdates) != null && n.delete(i.path) && (this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
- i,
- 1
- /* Create */
- ), i.isOrphan() && this.assignOrphanScriptInfoToInferredProject(i, this.openFiles.get(i.path))), this.tryGetDefaultProjectForFile(i);
- }
- /** @internal */
- ensureDefaultProjectForFile(t) {
- return this.tryGetDefaultProjectForEnsuringConfiguredProjectForFile(t) || this.doEnsureDefaultProjectForFile(t);
- }
- doEnsureDefaultProjectForFile(t) {
- this.ensureProjectStructuresUptoDate();
- const n = _s(t) ? this.getScriptInfoForNormalizedPath(t) : t;
- return n ? n.getDefaultProject() : (this.logErrorForScriptInfoNotFound(_s(t) ? t : t.fileName), Wh.ThrowNoProject());
- }
- getScriptInfoEnsuringProjectsUptoDate(t) {
- return this.ensureProjectStructuresUptoDate(), this.getScriptInfo(t);
- }
- /**
- * Ensures the project structures are upto date
- * This means,
- * - we go through all the projects and update them if they are dirty
- * - if updates reflect some change in structure or there was pending request to ensure projects for open files
- * ensure that each open script info has project
- */
- ensureProjectStructuresUptoDate() {
- let t = this.pendingEnsureProjectForOpenFiles;
- this.pendingProjectUpdates.clear();
- const n = (i) => {
- t = gp(i) || t;
- };
- this.externalProjects.forEach(n), this.configuredProjects.forEach(n), this.inferredProjects.forEach(n), t && this.ensureProjectForOpenFiles();
- }
- getFormatCodeOptions(t) {
- const n = this.getScriptInfoForNormalizedPath(t);
- return n && n.getFormatCodeSettings() || this.hostConfiguration.formatCodeOptions;
- }
- getPreferences(t) {
- const n = this.getScriptInfoForNormalizedPath(t);
- return { ...this.hostConfiguration.preferences, ...n && n.getPreferences() };
- }
- getHostFormatCodeOptions() {
- return this.hostConfiguration.formatCodeOptions;
- }
- getHostPreferences() {
- return this.hostConfiguration.preferences;
- }
- onSourceFileChanged(t, n) {
- E.assert(!t.isScriptOpen()), n === 2 ? this.handleDeletedFile(
- t,
- /*deferredDelete*/
- !0
- ) : (t.deferredDelete && (t.deferredDelete = void 0), t.delayReloadNonMixedContentFile(), this.delayUpdateProjectGraphs(
- t.containingProjects,
- /*clearSourceMapperCache*/
- !1
- ), this.handleSourceMapProjects(t));
- }
- handleSourceMapProjects(t) {
- if (t.sourceMapFilePath)
- if (_s(t.sourceMapFilePath)) {
- const n = this.getScriptInfoForPath(t.sourceMapFilePath);
- this.delayUpdateSourceInfoProjects(n?.sourceInfos);
- } else
- this.delayUpdateSourceInfoProjects(t.sourceMapFilePath.sourceInfos);
- this.delayUpdateSourceInfoProjects(t.sourceInfos), t.declarationInfoPath && this.delayUpdateProjectsOfScriptInfoPath(t.declarationInfoPath);
- }
- delayUpdateSourceInfoProjects(t) {
- t && t.forEach((n, i) => this.delayUpdateProjectsOfScriptInfoPath(i));
- }
- delayUpdateProjectsOfScriptInfoPath(t) {
- const n = this.getScriptInfoForPath(t);
- n && this.delayUpdateProjectGraphs(
- n.containingProjects,
- /*clearSourceMapperCache*/
- !0
- );
- }
- handleDeletedFile(t, n) {
- E.assert(!t.isScriptOpen()), this.delayUpdateProjectGraphs(
- t.containingProjects,
- /*clearSourceMapperCache*/
- !1
- ), this.handleSourceMapProjects(t), t.detachAllProjects(), n ? (t.delayReloadNonMixedContentFile(), t.deferredDelete = !0) : this.deleteScriptInfo(t);
- }
- /**
- * This is to watch whenever files are added or removed to the wildcard directories
- */
- watchWildcardDirectory(t, n, i, s) {
- let o = this.watchFactory.watchDirectory(
- t,
- (_) => this.onWildCardDirectoryWatcherInvoke(
- t,
- i,
- s,
- c,
- _
- ),
- n,
- this.getWatchOptionsFromProjectWatchOptions(s.parsedCommandLine.watchOptions, Xn(i)),
- Tl.WildcardDirectory,
- i
- );
- const c = {
- packageJsonWatches: void 0,
- close() {
- var _;
- o && (o.close(), o = void 0, (_ = c.packageJsonWatches) == null || _.forEach((u) => {
- u.projects.delete(c), u.close();
- }), c.packageJsonWatches = void 0);
- }
- };
- return c;
- }
- onWildCardDirectoryWatcherInvoke(t, n, i, s, o) {
- const c = this.toPath(o), _ = i.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(o, c);
- if (Hc(c) === "package.json" && !g8(c) && (_ && _.fileExists || !_ && this.host.fileExists(o))) {
- const d = this.getNormalizedAbsolutePath(o);
- this.logger.info(`Config: ${n} Detected new package.json: ${d}`), this.packageJsonCache.addOrUpdate(d, c), this.watchPackageJsonFile(d, c, s);
- }
- _?.fileExists || this.sendSourceFileChange(c);
- const u = this.findConfiguredProjectByProjectName(n);
- jA({
- watchedDirPath: this.toPath(t),
- fileOrDirectory: o,
- fileOrDirectoryPath: c,
- configFileName: n,
- extraFileExtensions: this.hostConfiguration.extraFileExtensions,
- currentDirectory: this.currentDirectory,
- options: i.parsedCommandLine.options,
- program: u?.getCurrentProgram() || i.parsedCommandLine.fileNames,
- useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
- writeLog: (d) => this.logger.info(d),
- toPath: (d) => this.toPath(d),
- getScriptKind: u ? (d) => u.getScriptKind(d) : void 0
- }) || (i.updateLevel !== 2 && (i.updateLevel = 1), i.projects.forEach((d, g) => {
- var h;
- if (!d) return;
- const S = this.getConfiguredProjectByCanonicalConfigFilePath(g);
- if (!S) return;
- if (u !== S && this.getHostPreferences().includeCompletionsForModuleExports) {
- const C = this.toPath(n);
- On((h = S.getCurrentProgram()) == null ? void 0 : h.getResolvedProjectReferences(), (D) => D?.sourceFile.path === C) && S.markAutoImportProviderAsDirty();
- }
- const T = u === S ? 1 : 0;
- if (!(S.pendingUpdateLevel > T))
- if (this.openFiles.has(c))
- if (E.checkDefined(this.getScriptInfoForPath(c)).isAttached(S)) {
- const D = Math.max(
- T,
- S.openFileWatchTriggered.get(c) || 0
- /* Update */
- );
- S.openFileWatchTriggered.set(c, D);
- } else
- S.pendingUpdateLevel = T, this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(S);
- else
- S.pendingUpdateLevel = T, this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(S);
- }));
- }
- delayUpdateProjectsFromParsedConfigOnConfigFileChange(t, n) {
- const i = this.configFileExistenceInfoCache.get(t);
- if (!i?.config) return !1;
- let s = !1;
- return i.config.updateLevel = 2, i.config.projects.forEach((o, c) => {
- var _;
- const u = this.getConfiguredProjectByCanonicalConfigFilePath(c);
- if (u)
- if (s = !0, c === t) {
- if (u.isInitialLoadPending()) return;
- u.pendingUpdateLevel = 2, u.pendingUpdateReason = n, this.delayUpdateProjectGraph(u), u.markAutoImportProviderAsDirty();
- } else {
- const d = this.toPath(t);
- u.resolutionCache.removeResolutionsFromProjectReferenceRedirects(d), this.delayUpdateProjectGraph(u), this.getHostPreferences().includeCompletionsForModuleExports && On((_ = u.getCurrentProgram()) == null ? void 0 : _.getResolvedProjectReferences(), (g) => g?.sourceFile.path === d) && u.markAutoImportProviderAsDirty();
- }
- }), s;
- }
- onConfigFileChanged(t, n, i) {
- const s = this.configFileExistenceInfoCache.get(n), o = this.getConfiguredProjectByCanonicalConfigFilePath(n), c = o?.deferredClose;
- i === 2 ? (s.exists = !1, o && (o.deferredClose = !0)) : (s.exists = !0, c && (o.deferredClose = void 0, o.markAsDirty())), this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(
- n,
- "Change in config file detected"
- );
- const _ = new Set(o ? [o] : void 0);
- this.openFiles.forEach((u, d) => {
- var g, h;
- const S = this.configFileForOpenFiles.get(d);
- if (!((g = s.openFilesImpactedByConfigFile) != null && g.has(d))) return;
- this.configFileForOpenFiles.delete(d);
- const T = this.getScriptInfoForPath(d), C = this.getConfigFileNameForFile(
- T,
- /*findFromCacheOnly*/
- !1
- );
- if (!C) return;
- const D = this.findConfiguredProjectByProjectName(C) ?? this.createConfiguredProject(
- C,
- `Change in config file ${t} detected, ${dPe(T)}`
- );
- (h = this.pendingOpenFileProjectUpdates) != null && h.has(d) || (this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set(d, S), Xm(_, D) && D.isInitialLoadPending() && this.delayUpdateProjectGraph(D);
- }), this.delayEnsureProjectForOpenFiles();
- }
- removeProject(t) {
- switch (this.logger.info("`remove Project::"), t.print(
- /*writeProjectFileNames*/
- !0,
- /*writeFileExplaination*/
- !0,
- /*writeFileVersionAndText*/
- !1
- ), t.close(), E.shouldAssert(
- 1
- /* Normal */
- ) && this.filenameToScriptInfo.forEach(
- (n) => E.assert(
- !n.isAttached(t),
- "Found script Info still attached to project",
- () => `${t.projectName}: ScriptInfos still attached: ${JSON.stringify(
- as(
- dy(
- this.filenameToScriptInfo.values(),
- (i) => i.isAttached(t) ? {
- fileName: i.fileName,
- projects: i.containingProjects.map((s) => s.projectName),
- hasMixedContent: i.hasMixedContent
- } : void 0
- )
- ),
- /*replacer*/
- void 0,
- " "
- )}`
- )
- ), this.pendingProjectUpdates.delete(t.getProjectName()), t.projectKind) {
- case 2:
- LT(this.externalProjects, t), this.projectToSizeMap.delete(t.getProjectName());
- break;
- case 1:
- this.configuredProjects.delete(t.canonicalConfigFilePath), this.projectToSizeMap.delete(t.canonicalConfigFilePath);
- break;
- case 0:
- LT(this.inferredProjects, t);
- break;
- }
- }
- /** @internal */
- assignOrphanScriptInfoToInferredProject(t, n) {
- E.assert(t.isOrphan());
- const i = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(t, n) || this.getOrCreateSingleInferredProjectIfEnabled() || this.getOrCreateSingleInferredWithoutProjectRoot(
- t.isDynamic ? n || this.currentDirectory : Xn(
- H_(t.fileName) ? t.fileName : es(
- t.fileName,
- n ? this.getNormalizedAbsolutePath(n) : this.currentDirectory
- )
- )
- );
- if (i.addRoot(t), t.containingProjects[0] !== i && (OE(t.containingProjects, i), t.containingProjects.unshift(i)), i.updateGraph(), !this.useSingleInferredProject && !i.projectRootPath)
- for (const s of this.inferredProjects) {
- if (s === i || s.isOrphan())
- continue;
- const o = s.getRootScriptInfos();
- E.assert(o.length === 1 || !!s.projectRootPath), o.length === 1 && ir(o[0].containingProjects, (c) => c !== o[0].containingProjects[0] && !c.isOrphan()) && s.removeFile(
- o[0],
- /*fileExists*/
- !0,
- /*detachFromProject*/
- !0
- );
- }
- return i;
- }
- assignOrphanScriptInfosToInferredProject() {
- this.openFiles.forEach((t, n) => {
- const i = this.getScriptInfoForPath(n);
- i.isOrphan() && this.assignOrphanScriptInfoToInferredProject(i, t);
- });
- }
- /**
- * Remove this file from the set of open, non-configured files.
- * @param info The file that has been closed or newly configured
- */
- closeOpenFile(t, n) {
- var i;
- const s = t.isDynamic ? !1 : this.host.fileExists(t.fileName);
- t.close(s), this.stopWatchingConfigFilesForScriptInfo(t);
- const o = this.toCanonicalFileName(t.fileName);
- this.openFilesWithNonRootedDiskPath.get(o) === t && this.openFilesWithNonRootedDiskPath.delete(o);
- let c = !1;
- for (const _ of t.containingProjects) {
- if (B0(_)) {
- t.hasMixedContent && t.registerFileUpdate();
- const u = _.openFileWatchTriggered.get(t.path);
- u !== void 0 && (_.openFileWatchTriggered.delete(t.path), _.pendingUpdateLevel < u && (_.pendingUpdateLevel = u, _.markFileAsDirty(t.path)));
- } else B6(_) && _.isRoot(t) && (_.isProjectWithSingleRoot() && (c = !0), _.removeFile(
- t,
- s,
- /*detachFromProject*/
- !0
- ));
- _.languageServiceEnabled || _.markAsDirty();
- }
- return this.openFiles.delete(t.path), this.configFileForOpenFiles.delete(t.path), (i = this.pendingOpenFileProjectUpdates) == null || i.delete(t.path), E.assert(!this.rootOfInferredProjects.has(t)), !n && c && this.assignOrphanScriptInfosToInferredProject(), s ? this.watchClosedScriptInfo(t) : this.handleDeletedFile(
- t,
- /*deferredDelete*/
- !1
- ), c;
- }
- deleteScriptInfo(t) {
- E.assert(!t.isScriptOpen()), this.filenameToScriptInfo.delete(t.path), this.filenameToScriptInfoVersion.set(t.path, t.textStorage.version), this.stopWatchingScriptInfo(t);
- const n = t.getRealpathIfDifferent();
- n && this.realpathToScriptInfos.remove(n, t), t.closeSourceMapFileWatcher();
- }
- configFileExists(t, n, i) {
- const s = this.configFileExistenceInfoCache.get(n);
- let o;
- if (this.openFiles.has(i.path) && !KH(i) && (s ? (s.openFilesImpactedByConfigFile ?? (s.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(i.path) : (o = /* @__PURE__ */ new Set()).add(i.path)), s) return s.exists;
- const c = this.host.fileExists(t);
- return this.configFileExistenceInfoCache.set(n, { exists: c, openFilesImpactedByConfigFile: o }), c;
- }
- createConfigFileWatcherForParsedConfig(t, n, i) {
- var s, o;
- const c = this.configFileExistenceInfoCache.get(n);
- (!c.watcher || c.watcher === r_e) && (c.watcher = this.watchFactory.watchFile(
- t,
- (u, d) => this.onConfigFileChanged(t, n, d),
- 2e3,
- this.getWatchOptionsFromProjectWatchOptions((o = (s = c?.config) == null ? void 0 : s.parsedCommandLine) == null ? void 0 : o.watchOptions, Xn(t)),
- Tl.ConfigFile,
- i
- ));
- const _ = c.config.projects;
- _.set(i.canonicalConfigFilePath, _.get(i.canonicalConfigFilePath) || !1);
- }
- /** @internal */
- releaseParsedConfig(t, n) {
- var i, s, o;
- const c = this.configFileExistenceInfoCache.get(t);
- (i = c.config) != null && i.projects.delete(n.canonicalConfigFilePath) && ((s = c.config) != null && s.projects.size || (c.config = void 0, CW(t, this.sharedExtendedConfigFileWatchers), E.checkDefined(c.watcher), (o = c.openFilesImpactedByConfigFile) != null && o.size ? c.inferredProjectRoots ? bF(Cl(Xn(t))) || (c.watcher.close(), c.watcher = r_e) : (c.watcher.close(), c.watcher = void 0) : (c.watcher.close(), this.configFileExistenceInfoCache.delete(t))));
- }
- /**
- * This is called on file close or when its removed from inferred project as root,
- * so that we handle the watches and inferred project root data
- * @internal
- */
- stopWatchingConfigFilesForScriptInfo(t) {
- if (this.serverMode !== 0) return;
- const n = this.rootOfInferredProjects.delete(t), i = t.isScriptOpen();
- i && !n || this.forEachConfigFileLocation(t, (s) => {
- var o, c, _;
- const u = this.configFileExistenceInfoCache.get(s);
- if (u) {
- if (i) {
- if (!((o = u?.openFilesImpactedByConfigFile) != null && o.has(t.path))) return;
- } else if (!((c = u.openFilesImpactedByConfigFile) != null && c.delete(t.path))) return;
- n && (u.inferredProjectRoots--, u.watcher && !u.config && !u.inferredProjectRoots && (u.watcher.close(), u.watcher = void 0)), !((_ = u.openFilesImpactedByConfigFile) != null && _.size) && !u.config && (E.assert(!u.watcher), this.configFileExistenceInfoCache.delete(s));
- }
- });
- }
- /**
- * This is called by inferred project whenever script info is added as a root
- *
- * @internal
- */
- startWatchingConfigFilesForInferredProjectRoot(t) {
- this.serverMode === 0 && (E.assert(t.isScriptOpen()), this.rootOfInferredProjects.add(t), this.forEachConfigFileLocation(t, (n, i) => {
- let s = this.configFileExistenceInfoCache.get(n);
- s ? s.inferredProjectRoots = (s.inferredProjectRoots ?? 0) + 1 : (s = { exists: this.host.fileExists(i), inferredProjectRoots: 1 }, this.configFileExistenceInfoCache.set(n, s)), (s.openFilesImpactedByConfigFile ?? (s.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(t.path), s.watcher || (s.watcher = bF(Cl(Xn(n))) ? this.watchFactory.watchFile(
- i,
- (o, c) => this.onConfigFileChanged(i, n, c),
- 2e3,
- this.hostConfiguration.watchOptions,
- Tl.ConfigFileForInferredRoot
- ) : r_e);
- }));
- }
- /**
- * This function tries to search for a tsconfig.json for the given file.
- * This is different from the method the compiler uses because
- * the compiler can assume it will always start searching in the
- * current directory (the directory in which tsc was invoked).
- * The server must start searching from the directory containing
- * the newly opened file.
- */
- forEachConfigFileLocation(t, n) {
- if (this.serverMode !== 0)
- return;
- E.assert(!vZe(t) || this.openFiles.has(t.path));
- const i = this.openFiles.get(t.path);
- if (E.checkDefined(this.getScriptInfo(t.path)).isDynamic) return;
- let o = Xn(t.fileName);
- const c = () => np(i, o, this.currentDirectory, !this.host.useCaseSensitiveFileNames), _ = !i || !c();
- let u = !KH(t);
- do {
- if (u) {
- const g = j6(o, this.currentDirectory, this.toCanonicalFileName), h = Bn(o, "tsconfig.json");
- let S = n(Bn(g, "tsconfig.json"), h);
- if (S) return h;
- const T = Bn(o, "jsconfig.json");
- if (S = n(Bn(g, "jsconfig.json"), T), S) return T;
- if (PI(g))
- break;
- }
- const d = Xn(o);
- if (d === o) break;
- o = d, u = !0;
- } while (_ || c());
- }
- /** @internal */
- findDefaultConfiguredProject(t) {
- var n;
- return t.isScriptOpen() ? (n = this.tryFindDefaultConfiguredProjectForOpenScriptInfo(
- t,
- 0
- /* Find */
- )) == null ? void 0 : n.defaultProject : void 0;
- }
- /** Get cached configFileName for scriptInfo or ancestor of open script info */
- getConfigFileNameForFileFromCache(t, n) {
- if (n) {
- const i = cPe(t, this.pendingOpenFileProjectUpdates);
- if (i !== void 0) return i;
- }
- return cPe(t, this.configFileForOpenFiles);
- }
- /** Caches the configFilename for script info or ancestor of open script info */
- setConfigFileNameForFileInCache(t, n) {
- this.openFiles.has(t.path) && (KH(t) || this.configFileForOpenFiles.set(t.path, n || !1));
- }
- /**
- * This function tries to search for a tsconfig.json for the given file.
- * This is different from the method the compiler uses because
- * the compiler can assume it will always start searching in the
- * current directory (the directory in which tsc was invoked).
- * The server must start searching from the directory containing
- * the newly opened file.
- * If script info is passed in, it is asserted to be open script info
- * otherwise just file name
- * when findFromCacheOnly is true only looked up in cache instead of hitting disk to figure things out
- * @internal
- */
- getConfigFileNameForFile(t, n) {
- const i = this.getConfigFileNameForFileFromCache(t, n);
- if (i !== void 0) return i || void 0;
- if (n) return;
- const s = this.forEachConfigFileLocation(t, (o, c) => this.configFileExists(c, o, t));
- return this.logger.info(`getConfigFileNameForFile:: File: ${t.fileName} ProjectRootPath: ${this.openFiles.get(t.path)}:: Result: ${s}`), this.setConfigFileNameForFileInCache(t, s), s;
- }
- printProjects() {
- this.logger.hasLevel(
- 1
- /* normal */
- ) && (this.logger.startGroup(), this.externalProjects.forEach(f_e), this.configuredProjects.forEach(f_e), this.inferredProjects.forEach(f_e), this.logger.info("Open files: "), this.openFiles.forEach((t, n) => {
- const i = this.getScriptInfoForPath(n);
- this.logger.info(` FileName: ${i.fileName} ProjectRootPath: ${t}`), this.logger.info(` Projects: ${i.containingProjects.map((s) => s.getProjectName())}`);
- }), this.logger.endGroup());
- }
- /** @internal */
- findConfiguredProjectByProjectName(t, n) {
- const i = this.toCanonicalFileName(t), s = this.getConfiguredProjectByCanonicalConfigFilePath(i);
- return n ? s : s?.deferredClose ? void 0 : s;
- }
- getConfiguredProjectByCanonicalConfigFilePath(t) {
- return this.configuredProjects.get(t);
- }
- findExternalProjectByProjectName(t) {
- return oPe(t, this.externalProjects);
- }
- /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
- getFilenameForExceededTotalSizeLimitForNonTsFiles(t, n, i, s) {
- if (n && n.disableSizeLimit || !this.host.getFileSize)
- return;
- let o = jH;
- this.projectToSizeMap.set(t, 0), this.projectToSizeMap.forEach((_) => o -= _ || 0);
- let c = 0;
- for (const _ of i) {
- const u = s.getFileName(_);
- if (!gx(u) && (c += this.host.getFileSize(u), c > jH || c > o)) {
- const d = i.map((g) => s.getFileName(g)).filter((g) => !gx(g)).map((g) => ({ name: g, size: this.host.getFileSize(g) })).sort((g, h) => h.size - g.size).slice(0, 5);
- return this.logger.info(`Non TS file size exceeded limit (${c}). Largest files: ${d.map((g) => `${g.name}:${g.size}`).join(", ")}`), u;
- }
- }
- this.projectToSizeMap.set(t, c);
- }
- createExternalProject(t, n, i, s, o) {
- const c = yL(i), _ = nN(i, Xn(Wl(t))), u = new RH(
- t,
- this,
- this.documentRegistry,
- c,
- /*lastFileExceededProgramSize*/
- this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t, c, n, ZH),
- i.compileOnSave === void 0 ? !0 : i.compileOnSave,
- /*projectFilePath*/
- void 0,
- _?.watchOptions
- );
- return u.setProjectErrors(_?.errors), u.excludedFiles = o, this.addFilesToNonInferredProject(u, n, ZH, s), this.externalProjects.push(u), u;
- }
- /** @internal */
- sendProjectTelemetry(t) {
- if (this.seenProjects.has(t.projectName)) {
- o_e(t);
- return;
- }
- if (this.seenProjects.set(t.projectName, !0), !this.eventHandler || !this.host.createSHA256Hash) {
- o_e(t);
- return;
- }
- const n = B0(t) ? t.projectOptions : void 0;
- o_e(t);
- const i = {
- projectId: this.host.createSHA256Hash(t.projectName),
- fileStats: eN(
- t.getScriptInfos(),
- /*includeSizes*/
- !0
- ),
- compilerOptions: ire(t.getCompilationSettings()),
- typeAcquisition: o(t.getTypeAcquisition()),
- extends: n && n.configHasExtendsProperty,
- files: n && n.configHasFilesProperty,
- include: n && n.configHasIncludeProperty,
- exclude: n && n.configHasExcludeProperty,
- compileOnSave: t.compileOnSaveEnabled,
- configFileName: s(),
- projectType: t instanceof RH ? "external" : "configured",
- languageServiceEnabled: t.languageServiceEnabled,
- version: U_
- };
- this.eventHandler({ eventName: qH, data: i });
- function s() {
- return B0(t) && MH(t.getConfigFilePath()) || "other";
- }
- function o({ enable: c, include: _, exclude: u }) {
- return {
- enable: c,
- include: _ !== void 0 && _.length !== 0,
- exclude: u !== void 0 && u.length !== 0
- };
- }
- }
- addFilesToNonInferredProject(t, n, i, s) {
- this.updateNonInferredProjectFiles(t, n, i), t.setTypeAcquisition(s), t.markAsDirty();
- }
- /** @internal */
- createConfiguredProject(t, n) {
- var i;
- (i = rn) == null || i.instant(rn.Phase.Session, "createConfiguredProject", { configFilePath: t }), this.logger.info(`Creating configuration project ${t}`);
- const s = this.toCanonicalFileName(t);
- let o = this.configFileExistenceInfoCache.get(s);
- o ? o.exists = !0 : this.configFileExistenceInfoCache.set(s, o = { exists: !0 }), o.config || (o.config = {
- cachedDirectoryStructureHost: nF(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames),
- projects: /* @__PURE__ */ new Map(),
- updateLevel: 2
- /* Full */
- });
- const c = new Yue(
- t,
- s,
- this,
- this.documentRegistry,
- o.config.cachedDirectoryStructureHost,
- n
- );
- return E.assert(!this.configuredProjects.has(s)), this.configuredProjects.set(s, c), this.createConfigFileWatcherForParsedConfig(t, s, c), c;
- }
- /**
- * Read the config file of the project, and update the project root file names.
- */
- loadConfiguredProject(t, n) {
- var i, s;
- (i = rn) == null || i.push(rn.Phase.Session, "loadConfiguredProject", { configFilePath: t.canonicalConfigFilePath }), this.sendProjectLoadingStartEvent(t, n);
- const o = Os(t.getConfigFilePath()), c = this.ensureParsedConfigUptoDate(
- o,
- t.canonicalConfigFilePath,
- this.configFileExistenceInfoCache.get(t.canonicalConfigFilePath),
- t
- ), _ = c.config.parsedCommandLine;
- E.assert(!!_.fileNames);
- const u = _.options;
- t.projectOptions || (t.projectOptions = {
- configHasExtendsProperty: _.raw.extends !== void 0,
- configHasFilesProperty: _.raw.files !== void 0,
- configHasIncludeProperty: _.raw.include !== void 0,
- configHasExcludeProperty: _.raw.exclude !== void 0
- }), t.canConfigFileJsonReportNoInputFiles = vD(_.raw), t.setProjectErrors(_.options.configFile.parseDiagnostics), t.updateReferences(_.projectReferences);
- const d = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t.canonicalConfigFilePath, u, _.fileNames, YH);
- d ? (t.disableLanguageService(d), this.configFileExistenceInfoCache.forEach((h, S) => this.stopWatchingWildCards(S, t))) : (t.setCompilerOptions(u), t.setWatchOptions(_.watchOptions), t.enableLanguageService(), this.watchWildcards(o, c, t)), t.enablePluginsWithOptions(u);
- const g = _.fileNames.concat(t.getExternalFiles(
- 2
- /* Full */
- ));
- this.updateRootAndOptionsOfNonInferredProject(t, g, YH, u, _.typeAcquisition, _.compileOnSave, _.watchOptions), (s = rn) == null || s.pop();
- }
- /** @internal */
- ensureParsedConfigUptoDate(t, n, i, s) {
- var o, c, _;
- if (i.config) {
- if (!i.config.updateLevel) return i;
- if (i.config.updateLevel === 1)
- return this.reloadFileNamesOfParsedConfig(t, i.config), i;
- }
- const u = ((o = i.config) == null ? void 0 : o.cachedDirectoryStructureHost) || nF(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames), d = yD(t, (D) => this.host.readFile(D)), g = mA(t, _s(d) ? d : ""), h = g.parseDiagnostics;
- _s(d) || h.push(d);
- const S = Xn(t), T = SA(
- g,
- u,
- S,
- /*existingOptions*/
- void 0,
- t,
- /*resolutionStack*/
- void 0,
- this.hostConfiguration.extraFileExtensions,
- this.extendedConfigCache
- );
- T.errors.length && h.push(...T.errors), this.logger.info(`Config: ${t} : ${JSON.stringify(
- {
- rootNames: T.fileNames,
- options: T.options,
- watchOptions: T.watchOptions,
- projectReferences: T.projectReferences
- },
- /*replacer*/
- void 0,
- " "
- )}`);
- const C = (c = i.config) == null ? void 0 : c.parsedCommandLine;
- return i.config ? (i.config.parsedCommandLine = T, i.config.watchedDirectoriesStale = !0, i.config.updateLevel = void 0) : i.config = { parsedCommandLine: T, cachedDirectoryStructureHost: u, projects: /* @__PURE__ */ new Map() }, !C && !E5(
- // Old options
- this.getWatchOptionsFromProjectWatchOptions(
- /*projectOptions*/
- void 0,
- S
- ),
- // New options
- this.getWatchOptionsFromProjectWatchOptions(T.watchOptions, S)
- ) && ((_ = i.watcher) == null || _.close(), i.watcher = void 0), this.createConfigFileWatcherForParsedConfig(t, n, s), iF(
- n,
- T.options,
- this.sharedExtendedConfigFileWatchers,
- (D, P) => this.watchFactory.watchFile(
- D,
- () => {
- var I;
- sF(this.extendedConfigCache, P, (O) => this.toPath(O));
- let F = !1;
- (I = this.sharedExtendedConfigFileWatchers.get(P)) == null || I.projects.forEach((O) => {
- F = this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(O, `Change in extended config file ${D} detected`) || F;
- }), F && this.delayEnsureProjectForOpenFiles();
- },
- 2e3,
- this.hostConfiguration.watchOptions,
- Tl.ExtendedConfigFile,
- t
- ),
- (D) => this.toPath(D)
- ), i;
- }
- /** @internal */
- watchWildcards(t, { exists: n, config: i }, s) {
- if (i.projects.set(s.canonicalConfigFilePath, !0), n) {
- if (i.watchedDirectories && !i.watchedDirectoriesStale) return;
- i.watchedDirectoriesStale = !1, RA(
- i.watchedDirectories || (i.watchedDirectories = /* @__PURE__ */ new Map()),
- i.parsedCommandLine.wildcardDirectories,
- // Create new directory watcher
- (o, c) => this.watchWildcardDirectory(o, c, t, i)
- );
- } else {
- if (i.watchedDirectoriesStale = !1, !i.watchedDirectories) return;
- D_(i.watchedDirectories, mp), i.watchedDirectories = void 0;
- }
- }
- /** @internal */
- stopWatchingWildCards(t, n) {
- const i = this.configFileExistenceInfoCache.get(t);
- !i.config || !i.config.projects.get(n.canonicalConfigFilePath) || (i.config.projects.set(n.canonicalConfigFilePath, !1), !El(i.config.projects, go) && (i.config.watchedDirectories && (D_(i.config.watchedDirectories, mp), i.config.watchedDirectories = void 0), i.config.watchedDirectoriesStale = void 0));
- }
- updateNonInferredProjectFiles(t, n, i) {
- var s;
- const o = t.getRootFilesMap(), c = /* @__PURE__ */ new Map();
- for (const _ of n) {
- const u = i.getFileName(_), d = Wo(u), g = Z8(d);
- let h;
- if (!g && !t.fileExists(u)) {
- h = j6(d, this.currentDirectory, this.toCanonicalFileName);
- const S = o.get(h);
- S ? (((s = S.info) == null ? void 0 : s.path) === h && (t.removeFile(
- S.info,
- /*fileExists*/
- !1,
- /*detachFromProject*/
- !0
- ), S.info = void 0), S.fileName = d) : o.set(h, { fileName: d });
- } else {
- const S = i.getScriptKind(_, this.hostConfiguration.extraFileExtensions), T = i.hasMixedContent(_, this.hostConfiguration.extraFileExtensions), C = E.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(
- d,
- t.currentDirectory,
- S,
- T,
- t.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- ));
- h = C.path;
- const D = o.get(h);
- !D || D.info !== C ? (t.addRoot(C, d), C.isScriptOpen() && this.removeRootOfInferredProjectIfNowPartOfOtherProject(C)) : D.fileName = d;
- }
- c.set(h, !0);
- }
- o.size > c.size && o.forEach((_, u) => {
- c.has(u) || (_.info ? t.removeFile(
- _.info,
- t.fileExists(_.info.fileName),
- /*detachFromProject*/
- !0
- ) : o.delete(u));
- });
- }
- updateRootAndOptionsOfNonInferredProject(t, n, i, s, o, c, _) {
- t.setCompilerOptions(s), t.setWatchOptions(_), c !== void 0 && (t.compileOnSaveEnabled = c), this.addFilesToNonInferredProject(t, n, i, o);
- }
- /**
- * Reload the file names from config file specs and update the project graph
- *
- * @internal
- */
- reloadFileNamesOfConfiguredProject(t) {
- const n = this.reloadFileNamesOfParsedConfig(t.getConfigFilePath(), this.configFileExistenceInfoCache.get(t.canonicalConfigFilePath).config);
- return t.updateErrorOnNoInputFiles(n), this.updateNonInferredProjectFiles(t, n.concat(t.getExternalFiles(
- 1
- /* RootNamesAndUpdate */
- )), YH), t.markAsDirty(), t.updateGraph();
- }
- reloadFileNamesOfParsedConfig(t, n) {
- if (n.updateLevel === void 0) return n.parsedCommandLine.fileNames;
- E.assert(
- n.updateLevel === 1
- /* RootNamesAndUpdate */
- );
- const i = n.parsedCommandLine.options.configFile.configFileSpecs, s = bD(
- i,
- Xn(t),
- n.parsedCommandLine.options,
- n.cachedDirectoryStructureHost,
- this.hostConfiguration.extraFileExtensions
- );
- return n.parsedCommandLine = { ...n.parsedCommandLine, fileNames: s }, s;
- }
- /** @internal */
- setFileNamesOfAutpImportProviderOrAuxillaryProject(t, n) {
- this.updateNonInferredProjectFiles(t, n, YH);
- }
- /** @internal */
- reloadConfiguredProjectClearingSemanticCache(t, n, i) {
- return Xm(i, t) ? (this.clearSemanticCache(t), this.reloadConfiguredProject(t, eG(n)), !0) : !1;
- }
- /**
- * Read the config file of the project again by clearing the cache and update the project graph
- *
- * @internal
- */
- reloadConfiguredProject(t, n) {
- t.isInitialLoadPending = nm, t.pendingUpdateReason = void 0, t.pendingUpdateLevel = 0, t.getCachedDirectoryStructureHost().clearCache(), this.loadConfiguredProject(t, n), fPe(
- t,
- t.triggerFileForConfigFileDiag ?? t.getConfigFilePath(),
- /*isReload*/
- !0
- );
- }
- clearSemanticCache(t) {
- t.originalConfiguredProjects = void 0, t.resolutionCache.clear(), t.getLanguageService(
- /*ensureSynchronized*/
- !1
- ).cleanupSemanticCache(), t.cleanupProgram(), t.markAsDirty();
- }
- /** @internal */
- sendConfigFileDiagEvent(t, n, i) {
- if (!this.eventHandler || this.suppressDiagnosticEvents) return !1;
- const s = t.getLanguageService().getCompilerOptionsDiagnostics();
- return s.push(...t.getAllProjectErrors()), !i && s.length === (t.configDiagDiagnosticsReported ?? 0) ? !1 : (t.configDiagDiagnosticsReported = s.length, this.eventHandler(
- {
- eventName: UH,
- data: { configFileName: t.getConfigFilePath(), diagnostics: s, triggerFile: n ?? t.getConfigFilePath() }
- }
- ), !0);
- }
- getOrCreateInferredProjectForProjectRootPathIfEnabled(t, n) {
- if (!this.useInferredProjectPerProjectRoot || // Its a dynamic info opened without project root
- t.isDynamic && n === void 0)
- return;
- if (n) {
- const s = this.toCanonicalFileName(n);
- for (const o of this.inferredProjects)
- if (o.projectRootPath === s)
- return o;
- return this.createInferredProject(
- n,
- /*isSingleInferredProject*/
- !1,
- n
- );
- }
- let i;
- for (const s of this.inferredProjects)
- s.projectRootPath && np(s.projectRootPath, t.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames) && (i && i.projectRootPath.length > s.projectRootPath.length || (i = s));
- return i;
- }
- getOrCreateSingleInferredProjectIfEnabled() {
- if (this.useSingleInferredProject)
- return this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === void 0 ? this.inferredProjects[0] : this.createInferredProject(
- "",
- /*isSingleInferredProject*/
- !0
- );
- }
- getOrCreateSingleInferredWithoutProjectRoot(t) {
- E.assert(!this.useSingleInferredProject);
- const n = this.toCanonicalFileName(this.getNormalizedAbsolutePath(t));
- for (const i of this.inferredProjects)
- if (!i.projectRootPath && i.isOrphan() && i.canonicalCurrentDirectory === n)
- return i;
- return this.createInferredProject(t);
- }
- createInferredProject(t, n, i) {
- const s = i && this.compilerOptionsForInferredProjectsPerProjectRoot.get(i) || this.compilerOptionsForInferredProjects;
- let o, c;
- i && (o = this.watchOptionsForInferredProjectsPerProjectRoot.get(i), c = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(i)), o === void 0 && (o = this.watchOptionsForInferredProjects), c === void 0 && (c = this.typeAcquisitionForInferredProjects), o = o || void 0;
- const _ = new Gue(this, this.documentRegistry, s, o?.watchOptions, i, t, c);
- return _.setProjectErrors(o?.errors), n ? this.inferredProjects.unshift(_) : this.inferredProjects.push(_), _;
- }
- /** @internal */
- getOrCreateScriptInfoNotOpenedByClient(t, n, i, s) {
- return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(
- Wo(t),
- n,
- /*scriptKind*/
- void 0,
- /*hasMixedContent*/
- void 0,
- i,
- s
- );
- }
- getScriptInfo(t) {
- return this.getScriptInfoForNormalizedPath(Wo(t));
- }
- /** @internal */
- getScriptInfoOrConfig(t) {
- const n = Wo(t), i = this.getScriptInfoForNormalizedPath(n);
- if (i) return i;
- const s = this.configuredProjects.get(this.toPath(t));
- return s && s.getCompilerOptions().configFile;
- }
- /** @internal */
- logErrorForScriptInfoNotFound(t) {
- const n = as(
- dy(
- this.filenameToScriptInfo.entries(),
- (i) => i[1].deferredDelete ? void 0 : i
- ),
- ([i, s]) => ({ path: i, fileName: s.fileName })
- );
- this.logger.msg(
- `Could not find file ${JSON.stringify(t)}.
-All files are: ${JSON.stringify(n)}`,
- "Err"
- /* Err */
- );
- }
- /**
- * Returns the projects that contain script info through SymLink
- * Note that this does not return projects in info.containingProjects
- *
- * @internal
- */
- getSymlinkedProjects(t) {
- let n;
- if (this.realpathToScriptInfos) {
- const s = t.getRealpathIfDifferent();
- s && ir(this.realpathToScriptInfos.get(s), i), ir(this.realpathToScriptInfos.get(t.path), i);
- }
- return n;
- function i(s) {
- if (s !== t)
- for (const o of s.containingProjects)
- o.languageServiceEnabled && !o.isOrphan() && !o.getCompilerOptions().preserveSymlinks && !t.isAttached(o) && (n ? El(n, (c, _) => _ === s.path ? !1 : ss(c, o)) || n.add(s.path, o) : (n = Ip(), n.add(s.path, o)));
- }
- }
- watchClosedScriptInfo(t) {
- if (E.assert(!t.fileWatcher), !t.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !Ui(t.path, this.globalCacheLocationDirectoryPath))) {
- const n = t.fileName.indexOf("/node_modules/");
- !this.host.getModifiedTime || n === -1 ? t.fileWatcher = this.watchFactory.watchFile(
- t.fileName,
- (i, s) => this.onSourceFileChanged(t, s),
- 500,
- this.hostConfiguration.watchOptions,
- Tl.ClosedScriptInfo
- ) : (t.mTime = this.getModifiedTime(t), t.fileWatcher = this.watchClosedScriptInfoInNodeModules(t.fileName.substring(0, n)));
- }
- }
- createNodeModulesWatcher(t, n) {
- let i = this.watchFactory.watchDirectory(
- t,
- (o) => {
- var c;
- const _ = vF(this.toPath(o));
- if (!_) return;
- const u = Hc(_);
- if ((c = s.affectedModuleSpecifierCacheProjects) != null && c.size && (u === "package.json" || u === "node_modules") && s.affectedModuleSpecifierCacheProjects.forEach((d) => {
- var g;
- (g = d.getModuleSpecifierCache()) == null || g.clear();
- }), s.refreshScriptInfoRefCount)
- if (n === _)
- this.refreshScriptInfosInDirectory(n);
- else {
- const d = this.filenameToScriptInfo.get(_);
- d ? a_e(d) && this.refreshScriptInfo(d) : tC(_) || this.refreshScriptInfosInDirectory(_);
- }
- },
- 1,
- this.hostConfiguration.watchOptions,
- Tl.NodeModules
- );
- const s = {
- refreshScriptInfoRefCount: 0,
- affectedModuleSpecifierCacheProjects: void 0,
- close: () => {
- var o;
- i && !s.refreshScriptInfoRefCount && !((o = s.affectedModuleSpecifierCacheProjects) != null && o.size) && (i.close(), i = void 0, this.nodeModulesWatchers.delete(n));
- }
- };
- return this.nodeModulesWatchers.set(n, s), s;
- }
- /** @internal */
- watchPackageJsonsInNodeModules(t, n) {
- var i;
- const s = this.toPath(t), o = this.nodeModulesWatchers.get(s) || this.createNodeModulesWatcher(t, s);
- return E.assert(!((i = o.affectedModuleSpecifierCacheProjects) != null && i.has(n))), (o.affectedModuleSpecifierCacheProjects || (o.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(n), {
- close: () => {
- var c;
- (c = o.affectedModuleSpecifierCacheProjects) == null || c.delete(n), o.close();
- }
- };
- }
- watchClosedScriptInfoInNodeModules(t) {
- const n = t + "/node_modules", i = this.toPath(n), s = this.nodeModulesWatchers.get(i) || this.createNodeModulesWatcher(n, i);
- return s.refreshScriptInfoRefCount++, {
- close: () => {
- s.refreshScriptInfoRefCount--, s.close();
- }
- };
- }
- getModifiedTime(t) {
- return (this.host.getModifiedTime(t.fileName) || q_).getTime();
- }
- refreshScriptInfo(t) {
- const n = this.getModifiedTime(t);
- if (n !== t.mTime) {
- const i = $R(t.mTime, n);
- t.mTime = n, this.onSourceFileChanged(t, i);
- }
- }
- refreshScriptInfosInDirectory(t) {
- t = t + Vo, this.filenameToScriptInfo.forEach((n) => {
- a_e(n) && Ui(n.path, t) && this.refreshScriptInfo(n);
- });
- }
- stopWatchingScriptInfo(t) {
- t.fileWatcher && (t.fileWatcher.close(), t.fileWatcher = void 0);
- }
- getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(t, n, i, s, o, c) {
- if (H_(t) || Z8(t))
- return this.getOrCreateScriptInfoWorker(
- t,
- n,
- /*openedByClient*/
- !1,
- /*fileContent*/
- void 0,
- i,
- !!s,
- o,
- c
- );
- const _ = this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(t));
- if (_)
- return _;
- }
- getOrCreateScriptInfoForNormalizedPath(t, n, i, s, o, c) {
- return this.getOrCreateScriptInfoWorker(
- t,
- this.currentDirectory,
- n,
- i,
- s,
- !!o,
- c,
- /*deferredDeleteOk*/
- !1
- );
- }
- getOrCreateScriptInfoWorker(t, n, i, s, o, c, _, u) {
- E.assert(s === void 0 || i, "ScriptInfo needs to be opened by client to be able to set its user defined content");
- const d = j6(t, n, this.toCanonicalFileName);
- let g = this.filenameToScriptInfo.get(d);
- if (g) {
- if (g.deferredDelete) {
- if (E.assert(!g.isDynamic), !i && !(_ || this.host).fileExists(t))
- return u ? g : void 0;
- g.deferredDelete = void 0;
- }
- } else {
- const h = Z8(t);
- if (E.assert(H_(t) || h || i, "", () => `${JSON.stringify({ fileName: t, currentDirectory: n, hostCurrentDirectory: this.currentDirectory, openKeys: as(this.openFilesWithNonRootedDiskPath.keys()) })}
-Script info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`), E.assert(!H_(t) || this.currentDirectory === n || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(t)), "", () => `${JSON.stringify({ fileName: t, currentDirectory: n, hostCurrentDirectory: this.currentDirectory, openKeys: as(this.openFilesWithNonRootedDiskPath.keys()) })}
-Open script files with non rooted disk path opened with current directory context cannot have same canonical names`), E.assert(!h || this.currentDirectory === n || this.useInferredProjectPerProjectRoot, "", () => `${JSON.stringify({ fileName: t, currentDirectory: n, hostCurrentDirectory: this.currentDirectory, openKeys: as(this.openFilesWithNonRootedDiskPath.keys()) })}
-Dynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`), !i && !h && !(_ || this.host).fileExists(t))
- return;
- g = new Wue(this.host, t, o, c, d, this.filenameToScriptInfoVersion.get(d)), this.filenameToScriptInfo.set(g.path, g), this.filenameToScriptInfoVersion.delete(g.path), i ? !H_(t) && (!h || this.currentDirectory !== n) && this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(t), g) : this.watchClosedScriptInfo(g);
- }
- return i && (this.stopWatchingScriptInfo(g), g.open(s), c && g.registerFileUpdate()), g;
- }
- /**
- * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred
- */
- getScriptInfoForNormalizedPath(t) {
- return !H_(t) && this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(t)) || this.getScriptInfoForPath(j6(t, this.currentDirectory, this.toCanonicalFileName));
- }
- getScriptInfoForPath(t) {
- const n = this.filenameToScriptInfo.get(t);
- return !n || !n.deferredDelete ? n : void 0;
- }
- /** @internal */
- getDocumentPositionMapper(t, n, i) {
- const s = this.getOrCreateScriptInfoNotOpenedByClient(
- n,
- t.currentDirectory,
- this.host,
- /*deferredDeleteOk*/
- !1
- );
- if (!s) {
- i && t.addGeneratedFileWatch(n, i);
- return;
- }
- if (s.getSnapshot(), _s(s.sourceMapFilePath)) {
- const d = this.getScriptInfoForPath(s.sourceMapFilePath);
- if (d && (d.getSnapshot(), d.documentPositionMapper !== void 0))
- return d.sourceInfos = this.addSourceInfoToSourceMap(i, t, d.sourceInfos), d.documentPositionMapper ? d.documentPositionMapper : void 0;
- s.sourceMapFilePath = void 0;
- } else if (s.sourceMapFilePath) {
- s.sourceMapFilePath.sourceInfos = this.addSourceInfoToSourceMap(i, t, s.sourceMapFilePath.sourceInfos);
- return;
- } else if (s.sourceMapFilePath !== void 0)
- return;
- let o, c = (d, g) => {
- const h = this.getOrCreateScriptInfoNotOpenedByClient(
- d,
- t.currentDirectory,
- this.host,
- /*deferredDeleteOk*/
- !0
- );
- if (o = h || g, !h || h.deferredDelete) return;
- const S = h.getSnapshot();
- return h.documentPositionMapper !== void 0 ? h.documentPositionMapper : Yx(S);
- };
- const _ = t.projectName, u = QV(
- { getCanonicalFileName: this.toCanonicalFileName, log: (d) => this.logger.info(d), getSourceFileLike: (d) => this.getSourceFileLike(d, _, s) },
- s.fileName,
- s.textStorage.getLineInfo(),
- c
- );
- return c = void 0, o ? _s(o) ? s.sourceMapFilePath = {
- watcher: this.addMissingSourceMapFile(
- t.currentDirectory === this.currentDirectory ? o : es(o, t.currentDirectory),
- s.path
- ),
- sourceInfos: this.addSourceInfoToSourceMap(i, t)
- } : (s.sourceMapFilePath = o.path, o.declarationInfoPath = s.path, o.deferredDelete || (o.documentPositionMapper = u || !1), o.sourceInfos = this.addSourceInfoToSourceMap(i, t, o.sourceInfos)) : s.sourceMapFilePath = !1, u;
- }
- addSourceInfoToSourceMap(t, n, i) {
- if (t) {
- const s = this.getOrCreateScriptInfoNotOpenedByClient(
- t,
- n.currentDirectory,
- n.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- );
- (i || (i = /* @__PURE__ */ new Set())).add(s.path);
- }
- return i;
- }
- addMissingSourceMapFile(t, n) {
- return this.watchFactory.watchFile(
- t,
- () => {
- const s = this.getScriptInfoForPath(n);
- s && s.sourceMapFilePath && !_s(s.sourceMapFilePath) && (this.delayUpdateProjectGraphs(
- s.containingProjects,
- /*clearSourceMapperCache*/
- !0
- ), this.delayUpdateSourceInfoProjects(s.sourceMapFilePath.sourceInfos), s.closeSourceMapFileWatcher());
- },
- 2e3,
- this.hostConfiguration.watchOptions,
- Tl.MissingSourceMapFile
- );
- }
- /** @internal */
- getSourceFileLike(t, n, i) {
- const s = n.projectName ? n : this.findProject(n);
- if (s) {
- const c = s.toPath(t), _ = s.getSourceFile(c);
- if (_ && _.resolvedPath === c) return _;
- }
- const o = this.getOrCreateScriptInfoNotOpenedByClient(
- t,
- (s || this).currentDirectory,
- s ? s.directoryStructureHost : this.host,
- /*deferredDeleteOk*/
- !1
- );
- if (o) {
- if (i && _s(i.sourceMapFilePath) && o !== i) {
- const c = this.getScriptInfoForPath(i.sourceMapFilePath);
- c && (c.sourceInfos ?? (c.sourceInfos = /* @__PURE__ */ new Set())).add(o.path);
- }
- return o.cacheSourceFile ? o.cacheSourceFile.sourceFile : (o.sourceFileLike || (o.sourceFileLike = {
- get text() {
- return E.fail("shouldnt need text"), "";
- },
- getLineAndCharacterOfPosition: (c) => {
- const _ = o.positionToLineOffset(c);
- return { line: _.line - 1, character: _.offset - 1 };
- },
- getPositionOfLineAndCharacter: (c, _, u) => o.lineOffsetToPosition(c + 1, _ + 1, u)
- }), o.sourceFileLike);
- }
- }
- /** @internal */
- setPerformanceEventHandler(t) {
- this.performanceEventHandler = t;
- }
- setHostConfiguration(t) {
- var n;
- if (t.file) {
- const i = this.getScriptInfoForNormalizedPath(Wo(t.file));
- i && (i.setOptions(J6(t.formatOptions), t.preferences), this.logger.info(`Host configuration update for file ${t.file}`));
- } else {
- if (t.hostInfo !== void 0 && (this.hostConfiguration.hostInfo = t.hostInfo, this.logger.info(`Host information ${t.hostInfo}`)), t.formatOptions && (this.hostConfiguration.formatCodeOptions = { ...this.hostConfiguration.formatCodeOptions, ...J6(t.formatOptions) }, this.logger.info("Format host information updated")), t.preferences) {
- const {
- lazyConfiguredProjectsFromExternalProject: i,
- includePackageJsonAutoImports: s,
- includeCompletionsForModuleExports: o
- } = this.hostConfiguration.preferences;
- this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...t.preferences }, i && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject && this.externalProjectToConfiguredProjectMap.forEach(
- (c) => c.forEach((_) => {
- !_.deferredClose && !_.isClosed() && _.pendingUpdateLevel === 2 && !this.hasPendingProjectUpdate(_) && _.updateGraph();
- })
- ), (s !== t.preferences.includePackageJsonAutoImports || !!o != !!t.preferences.includeCompletionsForModuleExports) && this.forEachProject((c) => {
- c.onAutoImportProviderSettingsChanged();
- });
- }
- if (t.extraFileExtensions && (this.hostConfiguration.extraFileExtensions = t.extraFileExtensions, this.reloadProjects(), this.logger.info("Host file extension mappings updated")), t.watchOptions) {
- const i = (n = nN(t.watchOptions)) == null ? void 0 : n.watchOptions, s = CO(i, this.currentDirectory);
- this.hostConfiguration.watchOptions = s, this.hostConfiguration.beforeSubstitution = s === i ? void 0 : i, this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`);
- }
- }
- }
- /** @internal */
- getWatchOptions(t) {
- return this.getWatchOptionsFromProjectWatchOptions(t.getWatchOptions(), t.getCurrentDirectory());
- }
- getWatchOptionsFromProjectWatchOptions(t, n) {
- const i = this.hostConfiguration.beforeSubstitution ? CO(
- this.hostConfiguration.beforeSubstitution,
- n
- ) : this.hostConfiguration.watchOptions;
- return t && i ? { ...i, ...t } : t || i;
- }
- closeLog() {
- this.logger.close();
- }
- sendSourceFileChange(t) {
- this.filenameToScriptInfo.forEach((n) => {
- if (this.openFiles.has(n.path) || !n.fileWatcher) return;
- const i = Iu(
- () => this.host.fileExists(n.fileName) ? n.deferredDelete ? 0 : 1 : 2
- /* Deleted */
- );
- if (t) {
- if (a_e(n) || !n.path.startsWith(t) || i() === 2 && n.deferredDelete) return;
- this.logger.info(`Invoking sourceFileChange on ${n.fileName}:: ${i()}`);
- }
- this.onSourceFileChanged(
- n,
- i()
- );
- });
- }
- /**
- * This function rebuilds the project for every file opened by the client
- * This does not reload contents of open files from disk. But we could do that if needed
- */
- reloadProjects() {
- this.logger.info("reload projects."), this.sendSourceFileChange(
- /*inPath*/
- void 0
- ), this.pendingProjectUpdates.forEach((i, s) => {
- this.throttledOperations.cancel(s), this.pendingProjectUpdates.delete(s);
- }), this.throttledOperations.cancel(sPe), this.pendingOpenFileProjectUpdates = void 0, this.pendingEnsureProjectForOpenFiles = !1, this.configFileExistenceInfoCache.forEach((i) => {
- i.config && (i.config.updateLevel = 2);
- }), this.configFileForOpenFiles.clear(), this.externalProjects.forEach((i) => {
- this.clearSemanticCache(i), i.updateGraph();
- });
- const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
- this.externalProjectToConfiguredProjectMap.forEach((i, s) => {
- const o = `Reloading configured project in external project: ${s}`;
- i.forEach((c) => {
- this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ? (c.isInitialLoadPending() || (this.clearSemanticCache(c), c.pendingUpdateLevel = 2, c.pendingUpdateReason = eG(o)), n.add(c)) : this.reloadConfiguredProjectClearingSemanticCache(
- c,
- o,
- t
- );
- });
- }), this.openFiles.forEach((i, s) => {
- const o = this.getScriptInfoForPath(s);
- On(o.containingProjects, tN) || this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
- o,
- 2,
- t,
- n
- );
- }), n.forEach((i) => t.add(i)), this.inferredProjects.forEach((i) => this.clearSemanticCache(i)), this.ensureProjectForOpenFiles(), this.cleanupProjectsAndScriptInfos(
- t,
- new Set(this.openFiles.keys()),
- new Set(this.externalProjectToConfiguredProjectMap.keys())
- ), this.logger.info("After reloading projects.."), this.printProjects();
- }
- /**
- * Remove the root of inferred project if script info is part of another project
- */
- removeRootOfInferredProjectIfNowPartOfOtherProject(t) {
- E.assert(t.containingProjects.length > 0);
- const n = t.containingProjects[0];
- !n.isOrphan() && B6(n) && n.isRoot(t) && ir(t.containingProjects, (i) => i !== n && !i.isOrphan()) && n.removeFile(
- t,
- /*fileExists*/
- !0,
- /*detachFromProject*/
- !0
- );
- }
- /**
- * This function is to update the project structure for every inferred project.
- * It is called on the premise that all the configured projects are
- * up to date.
- * This will go through open files and assign them to inferred project if open file is not part of any other project
- * After that all the inferred project graphs are updated
- */
- ensureProjectForOpenFiles() {
- this.logger.info("Before ensureProjectForOpenFiles:"), this.printProjects();
- const t = this.pendingOpenFileProjectUpdates;
- this.pendingOpenFileProjectUpdates = void 0, t?.forEach(
- (n, i) => this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
- this.getScriptInfoForPath(i),
- 1
- /* Create */
- )
- ), this.openFiles.forEach((n, i) => {
- const s = this.getScriptInfoForPath(i);
- s.isOrphan() ? this.assignOrphanScriptInfoToInferredProject(s, n) : this.removeRootOfInferredProjectIfNowPartOfOtherProject(s);
- }), this.pendingEnsureProjectForOpenFiles = !1, this.inferredProjects.forEach(gp), this.logger.info("After ensureProjectForOpenFiles:"), this.printProjects();
- }
- /**
- * Open file whose contents is managed by the client
- * @param filename is absolute pathname
- * @param fileContent is a known version of the file content that is more up to date than the one on disk
- */
- openClientFile(t, n, i, s) {
- return this.openClientFileWithNormalizedPath(
- Wo(t),
- n,
- i,
- /*hasMixedContent*/
- !1,
- s ? Wo(s) : void 0
- );
- }
- /** @internal */
- getOriginalLocationEnsuringConfiguredProject(t, n) {
- const i = t.isSourceOfProjectReferenceRedirect(n.fileName), s = i ? n : t.getSourceMapper().tryGetSourcePosition(n);
- if (!s) return;
- const { fileName: o } = s, c = this.getScriptInfo(o);
- if (!c && !this.host.fileExists(o)) return;
- const _ = { fileName: Wo(o), path: this.toPath(o) }, u = this.getConfigFileNameForFile(
- _,
- /*findFromCacheOnly*/
- !1
- );
- if (!u) return;
- let d = this.findConfiguredProjectByProjectName(u);
- if (!d) {
- if (t.getCompilerOptions().disableReferencedProjectLoad)
- return i ? n : c?.containingProjects.length ? s : n;
- d = this.createConfiguredProject(u, `Creating project for original file: ${_.fileName}${n !== s ? " for location: " + n.fileName : ""}`);
- }
- gp(d);
- const g = (T) => {
- const C = this.getScriptInfo(o);
- return C && T.containsScriptInfo(C) && !T.isSourceOfProjectReferenceRedirect(C.path);
- };
- if (d.isSolution() || !g(d)) {
- if (d = lPe(
- d,
- o,
- (T) => g(T) ? T : void 0,
- 1,
- `Creating project referenced in solution ${d.projectName} to find possible configured project for original file: ${_.fileName}${n !== s ? " for location: " + n.fileName : ""}`
- ), !d) return;
- if (d === t) return s;
- }
- S(d);
- const h = this.getScriptInfo(o);
- if (!h || !h.containingProjects.length) return;
- return h.containingProjects.forEach((T) => {
- B0(T) && S(T);
- }), s;
- function S(T) {
- (t.originalConfiguredProjects ?? (t.originalConfiguredProjects = /* @__PURE__ */ new Set())).add(T.canonicalConfigFilePath);
- }
- }
- /** @internal */
- fileExists(t) {
- return !!this.getScriptInfoForNormalizedPath(t) || this.host.fileExists(t);
- }
- findExternalProjectContainingOpenScriptInfo(t) {
- return On(this.externalProjects, (n) => (gp(n), n.containsScriptInfo(t)));
- }
- getOrCreateOpenScriptInfo(t, n, i, s, o) {
- const c = this.getOrCreateScriptInfoWorker(
- t,
- o ? this.getNormalizedAbsolutePath(o) : this.currentDirectory,
- /*openedByClient*/
- !0,
- n,
- i,
- !!s,
- /*hostToQueryFileExistsOn*/
- void 0,
- /*deferredDeleteOk*/
- !0
- );
- return this.openFiles.set(c.path, o), c;
- }
- assignProjectToOpenedScriptInfo(t) {
- let n, i;
- const s = this.findExternalProjectContainingOpenScriptInfo(t);
- let o, c;
- if (!s && this.serverMode === 0) {
- const _ = this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
- t,
- 1
- /* Create */
- );
- _ && (o = _.seenProjects, c = _.sentConfigDiag, _.defaultProject && (n = _.defaultProject.getConfigFilePath(), i = _.defaultProject.getAllProjectErrors()));
- }
- return t.containingProjects.forEach(gp), t.isOrphan() && (o?.forEach((_) => {
- c.has(_) || this.sendConfigFileDiagEvent(
- _,
- t.fileName,
- /*force*/
- !0
- );
- }), E.assert(this.openFiles.has(t.path)), this.assignOrphanScriptInfoToInferredProject(t, this.openFiles.get(t.path))), E.assert(!t.isOrphan()), { configFileName: n, configFileErrors: i, retainProjects: o };
- }
- /**
- * Depending on kind
- * - Find the configuedProject and return it - if allowDeferredClosed is set it will find the deferredClosed project as well
- * - Create - if the project doesnt exist, it creates one as well. If not delayLoad, the project is updated (with triggerFile if passed)
- * - Reload - if the project doesnt exist, it creates one. If not delayLoad, the project is reloaded clearing semantic cache
- * @internal
- */
- findCreateOrReloadConfiguredProject(t, n, i, s, o, c, _, u) {
- let d = this.findConfiguredProjectByProjectName(t, s), g = !1;
- switch (n) {
- case 0:
- if (!d) return;
- break;
- case 1:
- d ?? (d = this.createConfiguredProject(t, i)), g = !_ && pPe(d, o);
- break;
- case 2:
- d ?? (d = this.createConfiguredProject(t, eG(i))), g = !u && this.reloadConfiguredProjectClearingSemanticCache(d, i, c), u && !u.has(d) && !c.has(d) && (d.pendingUpdateLevel = 2, d.pendingUpdateReason = eG(i), u.add(d));
- break;
- default:
- E.assertNever(n);
- }
- return { project: d, sentConfigFileDiag: g };
- }
- /**
- * Finds the default configured project for given info
- * For any tsconfig found, it looks into that project, if not then all its references,
- * The search happens for all tsconfigs till projectRootPath
- */
- tryFindDefaultConfiguredProjectForOpenScriptInfo(t, n, i, s) {
- const o = this.getConfigFileNameForFile(
- t,
- n === 0
- /* Find */
- );
- if (!o) return;
- const c = this.findCreateOrReloadConfiguredProject(
- o,
- n,
- dPe(t),
- i,
- t.fileName,
- s
- );
- if (!c) return;
- const _ = /* @__PURE__ */ new Set(), u = new Set(c.sentConfigFileDiag ? [c.project] : void 0);
- let d, g;
- return h(c.project), {
- defaultProject: d ?? g,
- sentConfigDiag: u,
- seenProjects: _
- };
- function h(C) {
- return S(C) ? d : T(C);
- }
- function S(C) {
- if (!Xm(_, C)) return;
- const D = C.containsScriptInfo(t);
- if (D && !C.isSourceOfProjectReferenceRedirect(t.path)) return d = C;
- g ?? (g = D ? C : void 0);
- }
- function T(C) {
- return lPe(
- C,
- t.path,
- (D, P) => (P && u.add(D), S(D)),
- n,
- `Creating project referenced in solution ${C.projectName} to find possible configured project for ${t.fileName} to open`,
- i,
- t.fileName,
- s
- );
- }
- }
- tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(t, n, i, s) {
- const o = n === 0, c = this.tryFindDefaultConfiguredProjectForOpenScriptInfo(
- t,
- n,
- o,
- i
- );
- if (!c) return;
- const { defaultProject: _, seenProjects: u } = c;
- return _ && bZe(
- t,
- _,
- (d) => {
- u.add(d);
- },
- n,
- `Creating project possibly referencing default composite project ${_.getProjectName()} of open file ${t.fileName}`,
- o,
- i,
- s
- ), c;
- }
- /** @internal */
- loadAncestorProjectTree(t) {
- t ?? (t = new Set(
- dy(this.configuredProjects.entries(), ([s, o]) => o.isInitialLoadPending() ? void 0 : s)
- ));
- const n = /* @__PURE__ */ new Set(), i = as(this.configuredProjects.values());
- for (const s of i)
- uPe(s, (o) => t.has(o)) && gp(s), this.ensureProjectChildren(s, t, n);
- }
- ensureProjectChildren(t, n, i) {
- var s;
- if (!Xm(i, t.canonicalConfigFilePath) || t.getCompilerOptions().disableReferencedProjectLoad) return;
- const o = (s = t.getCurrentProgram()) == null ? void 0 : s.getResolvedProjectReferences();
- if (o)
- for (const c of o) {
- if (!c) continue;
- const _ = jW(c.references, (g) => n.has(g.sourceFile.path) ? g : void 0);
- if (!_) continue;
- const u = Wo(c.sourceFile.fileName), d = this.findConfiguredProjectByProjectName(u) ?? this.createConfiguredProject(
- u,
- `Creating project referenced by : ${t.projectName} as it references project ${_.sourceFile.fileName}`
- );
- gp(d), this.ensureProjectChildren(d, n, i);
- }
- }
- cleanupConfiguredProjects(t, n, i) {
- this.getOrphanConfiguredProjects(
- t,
- i,
- n
- ).forEach((s) => this.removeProject(s));
- }
- cleanupProjectsAndScriptInfos(t, n, i) {
- this.cleanupConfiguredProjects(
- t,
- i,
- n
- );
- for (const s of this.inferredProjects.slice())
- s.isOrphan() && this.removeProject(s);
- this.removeOrphanScriptInfos();
- }
- tryInvokeWildCardDirectories(t) {
- this.configFileExistenceInfoCache.forEach((n, i) => {
- var s, o;
- !((s = n.config) != null && s.parsedCommandLine) || ss(
- n.config.parsedCommandLine.fileNames,
- t.fileName,
- this.host.useCaseSensitiveFileNames ? ub : Sy
- ) || (o = n.config.watchedDirectories) == null || o.forEach((c, _) => {
- np(_, t.fileName, !this.host.useCaseSensitiveFileNames) && (this.logger.info(`Invoking ${i}:: wildcard for open scriptInfo:: ${t.fileName}`), this.onWildCardDirectoryWatcherInvoke(
- _,
- i,
- n.config,
- c.watcher,
- t.fileName
- ));
- });
- });
- }
- openClientFileWithNormalizedPath(t, n, i, s, o) {
- const c = this.getScriptInfoForPath(j6(
- t,
- o ? this.getNormalizedAbsolutePath(o) : this.currentDirectory,
- this.toCanonicalFileName
- )), _ = this.getOrCreateOpenScriptInfo(t, n, i, s, o);
- !c && _ && !_.isDynamic && this.tryInvokeWildCardDirectories(_);
- const { retainProjects: u, ...d } = this.assignProjectToOpenedScriptInfo(_);
- return this.cleanupProjectsAndScriptInfos(
- u,
- /* @__PURE__ */ new Set([_.path]),
- /*externalProjectsRetainingConfiguredProjects*/
- void 0
- ), this.telemetryOnOpenFile(_), this.printProjects(), d;
- }
- /** @internal */
- getOrphanConfiguredProjects(t, n, i) {
- const s = new Set(this.configuredProjects.values()), o = (d) => {
- d.originalConfiguredProjects && (B0(d) || !d.isOrphan()) && d.originalConfiguredProjects.forEach(
- (g, h) => {
- const S = this.getConfiguredProjectByCanonicalConfigFilePath(h);
- return S && u(S);
- }
- );
- };
- return t?.forEach(u), this.inferredProjects.forEach(o), this.externalProjects.forEach(o), this.externalProjectToConfiguredProjectMap.forEach((d, g) => {
- i?.has(g) || d.forEach(u);
- }), this.openFiles.forEach((d, g) => {
- if (n?.has(g)) return;
- const h = this.getScriptInfoForPath(g);
- if (On(h.containingProjects, tN)) return;
- const S = this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
- h,
- 0
- /* Find */
- );
- S?.defaultProject && S?.seenProjects.forEach(u);
- }), this.configuredProjects.forEach((d) => {
- s.has(d) && (_(d) || _Pe(d, c)) && u(d);
- }), s;
- function c(d) {
- return !s.has(d) || _(d);
- }
- function _(d) {
- var g, h;
- return (d.deferredClose || d.projectService.hasPendingProjectUpdate(d)) && !!((h = (g = d.projectService.configFileExistenceInfoCache.get(d.canonicalConfigFilePath)) == null ? void 0 : g.openFilesImpactedByConfigFile) != null && h.size);
- }
- function u(d) {
- s.delete(d) && (o(d), _Pe(d, u));
- }
- }
- removeOrphanScriptInfos() {
- const t = new Map(this.filenameToScriptInfo);
- this.filenameToScriptInfo.forEach((n) => {
- if (!n.deferredDelete) {
- if (!n.isScriptOpen() && n.isOrphan() && !n.isContainedByBackgroundProject()) {
- if (!n.sourceMapFilePath) return;
- let i;
- if (_s(n.sourceMapFilePath)) {
- const s = this.filenameToScriptInfo.get(n.sourceMapFilePath);
- i = s?.sourceInfos;
- } else
- i = n.sourceMapFilePath.sourceInfos;
- if (!i || !Ch(i, (s) => {
- const o = this.getScriptInfoForPath(s);
- return !!o && (o.isScriptOpen() || !o.isOrphan());
- }))
- return;
- }
- if (t.delete(n.path), n.sourceMapFilePath) {
- let i;
- if (_s(n.sourceMapFilePath)) {
- const s = this.filenameToScriptInfo.get(n.sourceMapFilePath);
- s?.deferredDelete ? n.sourceMapFilePath = {
- watcher: this.addMissingSourceMapFile(s.fileName, n.path),
- sourceInfos: s.sourceInfos
- } : t.delete(n.sourceMapFilePath), i = s?.sourceInfos;
- } else
- i = n.sourceMapFilePath.sourceInfos;
- i && i.forEach((s, o) => t.delete(o));
- }
- }
- }), t.forEach((n) => this.deleteScriptInfo(n));
- }
- telemetryOnOpenFile(t) {
- if (this.serverMode !== 0 || !this.eventHandler || !t.isJavaScript() || !zp(this.allJsFilesForOpenFileTelemetry, t.path))
- return;
- const n = this.ensureDefaultProjectForFile(t);
- if (!n.languageServiceEnabled)
- return;
- const i = n.getSourceFile(t.path), s = !!i && !!i.checkJsDirective;
- this.eventHandler({ eventName: Zue, data: { info: { checkJs: s } } });
- }
- closeClientFile(t, n) {
- const i = this.getScriptInfoForNormalizedPath(Wo(t)), s = i ? this.closeOpenFile(i, n) : !1;
- return n || this.printProjects(), s;
- }
- collectChanges(t, n, i, s) {
- for (const o of n) {
- const c = On(t, (_) => _.projectName === o.getProjectName());
- s.push(o.getChangesSinceVersion(c && c.version, i));
- }
- }
- /** @internal */
- synchronizeProjectList(t, n) {
- const i = [];
- return this.collectChanges(t, this.externalProjects, n, i), this.collectChanges(t, dy(this.configuredProjects.values(), (s) => s.deferredClose ? void 0 : s), n, i), this.collectChanges(t, this.inferredProjects, n, i), i;
- }
- /** @internal */
- applyChangesInOpenFiles(t, n, i) {
- let s, o, c = !1;
- if (t)
- for (const u of t) {
- (s ?? (s = [])).push(this.getScriptInfoForPath(j6(
- Wo(u.fileName),
- u.projectRootPath ? this.getNormalizedAbsolutePath(u.projectRootPath) : this.currentDirectory,
- this.toCanonicalFileName
- )));
- const d = this.getOrCreateOpenScriptInfo(
- Wo(u.fileName),
- u.content,
- XH(u.scriptKind),
- u.hasMixedContent,
- u.projectRootPath ? Wo(u.projectRootPath) : void 0
- );
- (o || (o = [])).push(d);
- }
- if (n)
- for (const u of n) {
- const d = this.getScriptInfo(u.fileName);
- E.assert(!!d), this.applyChangesToFile(d, u.changes);
- }
- if (i)
- for (const u of i)
- c = this.closeClientFile(
- u,
- /*skipAssignOrphanScriptInfosToInferredProject*/
- !0
- ) || c;
- let _;
- ir(
- s,
- (u, d) => !u && o[d] && !o[d].isDynamic ? this.tryInvokeWildCardDirectories(o[d]) : void 0
- ), o?.forEach((u) => {
- var d;
- return (d = this.assignProjectToOpenedScriptInfo(u).retainProjects) == null ? void 0 : d.forEach((g) => (_ ?? (_ = /* @__PURE__ */ new Set())).add(g));
- }), c && this.assignOrphanScriptInfosToInferredProject(), o ? (this.cleanupProjectsAndScriptInfos(
- _,
- new Set(o.map((u) => u.path)),
- /*externalProjectsRetainingConfiguredProjects*/
- void 0
- ), o.forEach((u) => this.telemetryOnOpenFile(u)), this.printProjects()) : Nr(i) && this.printProjects();
- }
- /** @internal */
- applyChangesToFile(t, n) {
- for (const i of n)
- t.editContent(i.span.start, i.span.start + i.span.length, i.newText);
- }
- // eslint-disable-line @typescript-eslint/unified-signatures
- closeExternalProject(t, n) {
- const i = Wo(t);
- if (this.externalProjectToConfiguredProjectMap.get(i))
- this.externalProjectToConfiguredProjectMap.delete(i);
- else {
- const o = this.findExternalProjectByProjectName(t);
- o && this.removeProject(o);
- }
- n && (this.cleanupConfiguredProjects(), this.printProjects());
- }
- openExternalProjects(t) {
- const n = new Set(this.externalProjects.map((i) => i.getProjectName()));
- this.externalProjectToConfiguredProjectMap.forEach((i, s) => n.add(s));
- for (const i of t)
- this.openExternalProject(
- i,
- /*cleanupAfter*/
- !1
- ), n.delete(i.projectFileName);
- n.forEach((i) => this.closeExternalProject(
- i,
- /*cleanupAfter*/
- !1
- )), this.cleanupConfiguredProjects(), this.printProjects();
- }
- static escapeFilenameForRegex(t) {
- return t.replace(this.filenameEscapeRegexp, "\\$&");
- }
- resetSafeList() {
- this.safelist = Kue;
- }
- applySafeList(t) {
- const n = t.typeAcquisition;
- E.assert(!!n, "proj.typeAcquisition should be set by now");
- const i = this.applySafeListWorker(t, t.rootFiles, n);
- return i?.excludedFiles ?? [];
- }
- applySafeListWorker(t, n, i) {
- if (i.enable === !1 || i.disableFilenameBasedTypeAcquisition)
- return;
- const s = i.include || (i.include = []), o = [], c = n.map((h) => Wl(h.fileName));
- for (const h of Object.keys(this.safelist)) {
- const S = this.safelist[h];
- for (const T of c)
- if (S.match.test(T)) {
- if (this.logger.info(`Excluding files based on rule ${h} matching file '${T}'`), S.types)
- for (const C of S.types)
- s.includes(C) || s.push(C);
- if (S.exclude)
- for (const C of S.exclude) {
- const D = T.replace(S.match, (...P) => C.map((I) => typeof I == "number" ? _s(P[I]) ? _me.escapeFilenameForRegex(P[I]) : (this.logger.info(`Incorrect RegExp specification in safelist rule ${h} - not enough groups`), "\\*") : I).join(""));
- o.includes(D) || o.push(D);
- }
- else {
- const C = _me.escapeFilenameForRegex(T);
- o.includes(C) || o.push(C);
- }
- }
- }
- const _ = o.map((h) => new RegExp(h, "i"));
- let u, d;
- for (let h = 0; h < n.length; h++)
- if (_.some((S) => S.test(c[h])))
- g(h);
- else {
- if (i.enable) {
- const S = Hc(vy(c[h]));
- if (qo(S, "js")) {
- const T = $u(S), C = SR(T), D = this.legacySafelist.get(C);
- if (D !== void 0) {
- this.logger.info(`Excluded '${c[h]}' because it matched ${C} from the legacy safelist`), g(h), s.includes(D) || s.push(D);
- continue;
- }
- }
- }
- /^.+[.-]min\.js$/.test(c[h]) ? g(h) : u?.push(n[h]);
- }
- return d ? {
- rootFiles: u,
- excludedFiles: d
- } : void 0;
- function g(h) {
- d || (E.assert(!u), u = n.slice(0, h), d = []), d.push(c[h]);
- }
- }
- // eslint-disable-line @typescript-eslint/unified-signatures
- openExternalProject(t, n) {
- const i = this.findExternalProjectByProjectName(t.projectFileName);
- let s, o = [];
- for (const c of t.rootFiles) {
- const _ = Wo(c.fileName);
- if (MH(_)) {
- if (this.serverMode === 0 && this.host.fileExists(_)) {
- let u = this.findConfiguredProjectByProjectName(_);
- u || (u = this.createConfiguredProject(_, `Creating configured project in external project: ${t.projectFileName}`), this.getHostPreferences().lazyConfiguredProjectsFromExternalProject || u.updateGraph()), (s ?? (s = /* @__PURE__ */ new Set())).add(u), E.assert(!u.isClosed());
- }
- } else
- o.push(c);
- }
- if (s)
- this.externalProjectToConfiguredProjectMap.set(t.projectFileName, s), i && this.removeProject(i);
- else {
- this.externalProjectToConfiguredProjectMap.delete(t.projectFileName);
- const c = t.typeAcquisition || {};
- c.include = c.include || [], c.exclude = c.exclude || [], c.enable === void 0 && (c.enable = que(o.map((d) => d.fileName)));
- const _ = this.applySafeListWorker(t, o, c), u = _?.excludedFiles ?? [];
- if (o = _?.rootFiles ?? o, i) {
- i.excludedFiles = u;
- const d = yL(t.options), g = nN(t.options, i.getCurrentDirectory()), h = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(t.projectFileName, d, o, ZH);
- h ? i.disableLanguageService(h) : i.enableLanguageService(), i.setProjectErrors(g?.errors), this.updateRootAndOptionsOfNonInferredProject(i, o, ZH, d, c, t.options.compileOnSave, g?.watchOptions), i.updateGraph();
- } else
- this.createExternalProject(t.projectFileName, o, t.options, c, u).updateGraph();
- }
- n && (this.cleanupConfiguredProjects(
- s,
- new Set(t.projectFileName)
- ), this.printProjects());
- }
- hasDeferredExtension() {
- for (const t of this.hostConfiguration.extraFileExtensions)
- if (t.scriptKind === 7)
- return !0;
- return !1;
- }
- /**
- * Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin either asynchronously or synchronously
- * @internal
- */
- requestEnablePlugin(t, n, i) {
- if (!this.host.importPlugin && !this.host.require) {
- this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
- return;
- }
- if (this.logger.info(`Enabling plugin ${n.name} from candidate paths: ${i.join(",")}`), !n.name || Sl(n.name) || /[\\/]\.\.?(?:$|[\\/])/.test(n.name)) {
- this.logger.info(`Skipped loading plugin ${n.name || JSON.stringify(n)} because only package name is allowed plugin name`);
- return;
- }
- if (this.host.importPlugin) {
- const s = _k.importServicePluginAsync(
- n,
- i,
- this.host,
- (c) => this.logger.info(c)
- );
- this.pendingPluginEnablements ?? (this.pendingPluginEnablements = /* @__PURE__ */ new Map());
- let o = this.pendingPluginEnablements.get(t);
- o || this.pendingPluginEnablements.set(t, o = []), o.push(s);
- return;
- }
- this.endEnablePlugin(
- t,
- _k.importServicePluginSync(
- n,
- i,
- this.host,
- (s) => this.logger.info(s)
- )
- );
- }
- /**
- * Performs the remaining steps of enabling a plugin after its module has been instantiated.
- */
- endEnablePlugin(t, { pluginConfigEntry: n, resolvedModule: i, errorLogs: s }) {
- var o;
- if (i) {
- const c = (o = this.currentPluginConfigOverrides) == null ? void 0 : o.get(n.name);
- if (c) {
- const _ = n.name;
- n = c, n.name = _;
- }
- t.enableProxy(i, n);
- } else
- ir(s, (c) => this.logger.info(c)), this.logger.info(`Couldn't find ${n.name}`);
- }
- /** @internal */
- hasNewPluginEnablementRequests() {
- return !!this.pendingPluginEnablements;
- }
- /** @internal */
- hasPendingPluginEnablements() {
- return !!this.currentPluginEnablementPromise;
- }
- /**
- * Waits for any ongoing plugin enablement requests to complete.
- *
- * @internal
- */
- async waitForPendingPlugins() {
- for (; this.currentPluginEnablementPromise; )
- await this.currentPluginEnablementPromise;
- }
- /**
- * Starts enabling any requested plugins without waiting for the result.
- *
- * @internal
- */
- enableRequestedPlugins() {
- this.pendingPluginEnablements && this.enableRequestedPluginsAsync();
- }
- async enableRequestedPluginsAsync() {
- if (this.currentPluginEnablementPromise && await this.waitForPendingPlugins(), !this.pendingPluginEnablements)
- return;
- const t = as(this.pendingPluginEnablements.entries());
- this.pendingPluginEnablements = void 0, this.currentPluginEnablementPromise = this.enableRequestedPluginsWorker(t), await this.currentPluginEnablementPromise;
- }
- async enableRequestedPluginsWorker(t) {
- E.assert(this.currentPluginEnablementPromise === void 0);
- let n = !1;
- await Promise.all(lr(t, async ([i, s]) => {
- const o = await Promise.all(s);
- if (i.isClosed() || gL(i)) {
- this.logger.info(`Cancelling plugin enabling for ${i.getProjectName()} as it is ${i.isClosed() ? "closed" : "deferred close"}`);
- return;
- }
- n = !0;
- for (const c of o)
- this.endEnablePlugin(i, c);
- this.delayUpdateProjectGraph(i);
- })), this.currentPluginEnablementPromise = void 0, n && this.sendProjectsUpdatedInBackgroundEvent();
- }
- configurePlugin(t) {
- this.forEachEnabledProject((n) => n.onPluginConfigurationChanged(t.pluginName, t.configuration)), this.currentPluginConfigOverrides = this.currentPluginConfigOverrides || /* @__PURE__ */ new Map(), this.currentPluginConfigOverrides.set(t.pluginName, t.configuration);
- }
- /** @internal */
- getPackageJsonsVisibleToFile(t, n, i) {
- const s = this.packageJsonCache, o = i && this.toPath(i), c = [], _ = (u) => {
- switch (s.directoryHasPackageJson(u)) {
- case 3:
- return s.searchDirectoryAndAncestors(u), _(u);
- case -1:
- const d = Bn(u, "package.json");
- this.watchPackageJsonFile(d, this.toPath(d), n);
- const g = s.getInDirectory(u);
- g && c.push(g);
- }
- if (o && o === u)
- return !0;
- };
- return Fp(Xn(t), _), c;
- }
- /** @internal */
- getNearestAncestorDirectoryWithPackageJson(t) {
- return Fp(t, (n) => {
- switch (this.packageJsonCache.directoryHasPackageJson(n)) {
- case -1:
- return n;
- case 0:
- return;
- case 3:
- return this.host.fileExists(Bn(n, "package.json")) ? n : void 0;
- }
- });
- }
- watchPackageJsonFile(t, n, i) {
- E.assert(i !== void 0);
- let s = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(n);
- if (!s) {
- let o = this.watchFactory.watchFile(
- t,
- (c, _) => {
- switch (_) {
- case 0:
- case 1:
- this.packageJsonCache.addOrUpdate(c, n), this.onPackageJsonChange(s);
- break;
- case 2:
- this.packageJsonCache.delete(n), this.onPackageJsonChange(s), s.projects.clear(), s.close();
- }
- },
- 250,
- this.hostConfiguration.watchOptions,
- Tl.PackageJson
- );
- s = {
- projects: /* @__PURE__ */ new Set(),
- close: () => {
- var c;
- s.projects.size || !o || (o.close(), o = void 0, (c = this.packageJsonFilesMap) == null || c.delete(n), this.packageJsonCache.invalidate(n));
- }
- }, this.packageJsonFilesMap.set(n, s);
- }
- s.projects.add(i), (i.packageJsonWatches ?? (i.packageJsonWatches = /* @__PURE__ */ new Set())).add(s);
- }
- onPackageJsonChange(t) {
- t.projects.forEach((n) => {
- var i;
- return (i = n.onPackageJsonChange) == null ? void 0 : i.call(n);
- });
- }
- /** @internal */
- includePackageJsonAutoImports() {
- switch (this.hostConfiguration.preferences.includePackageJsonAutoImports) {
- case "on":
- return 1;
- case "off":
- return 0;
- default:
- return 2;
- }
- }
- /** @internal */
- getIncompleteCompletionsCache() {
- return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = kZe());
- }
- };
- gPe.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g;
- var u_e = gPe;
- function kZe() {
- let e;
- return {
- get() {
- return e;
- },
- set(t) {
- e = t;
- },
- clear() {
- e = void 0;
- }
- };
- }
- function __e(e) {
- return e.kind !== void 0;
- }
- function f_e(e) {
- e.print(
- /*writeProjectFileNames*/
- !1,
- /*writeFileExplaination*/
- !1,
- /*writeFileVersionAndText*/
- !1
- );
- }
- function p_e(e) {
- let t, n, i;
- const s = {
- get(u, d, g, h) {
- if (!(!n || i !== c(u, g, h)))
- return n.get(d);
- },
- set(u, d, g, h, S, T, C) {
- if (o(u, g, h).set(d, _(
- S,
- T,
- C,
- /*packageName*/
- void 0,
- /*isBlockedByPackageJsonDependencies*/
- !1
- )), C) {
- for (const D of T)
- if (D.isInNodeModules) {
- const P = D.path.substring(0, D.path.indexOf(Xg) + Xg.length - 1), I = e.toPath(P);
- t?.has(I) || (t || (t = /* @__PURE__ */ new Map())).set(
- I,
- e.watchNodeModulesForPackageJsonChanges(P)
- );
- }
- }
- },
- setModulePaths(u, d, g, h, S) {
- const T = o(u, g, h), C = T.get(d);
- C ? C.modulePaths = S : T.set(d, _(
- /*kind*/
- void 0,
- S,
- /*moduleSpecifiers*/
- void 0,
- /*packageName*/
- void 0,
- /*isBlockedByPackageJsonDependencies*/
- void 0
- ));
- },
- setBlockedByPackageJsonDependencies(u, d, g, h, S, T) {
- const C = o(u, g, h), D = C.get(d);
- D ? (D.isBlockedByPackageJsonDependencies = T, D.packageName = S) : C.set(d, _(
- /*kind*/
- void 0,
- /*modulePaths*/
- void 0,
- /*moduleSpecifiers*/
- void 0,
- S,
- T
- ));
- },
- clear() {
- t?.forEach(fd), n?.clear(), t?.clear(), i = void 0;
- },
- count() {
- return n ? n.size : 0;
- }
- };
- return E.isDebugging && Object.defineProperty(s, "__cache", { get: () => n }), s;
- function o(u, d, g) {
- const h = c(u, d, g);
- return n && i !== h && s.clear(), i = h, n || (n = /* @__PURE__ */ new Map());
- }
- function c(u, d, g) {
- return `${u},${d.importModuleSpecifierEnding},${d.importModuleSpecifierPreference},${g.overrideImportMode}`;
- }
- function _(u, d, g, h, S) {
- return { kind: u, modulePaths: d, moduleSpecifiers: g, packageName: h, isBlockedByPackageJsonDependencies: S };
- }
- }
- function d_e(e) {
- const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
- return {
- addOrUpdate: i,
- invalidate: s,
- delete: (c) => {
- t.delete(c), n.set(Xn(c), !0);
- },
- getInDirectory: (c) => t.get(e.toPath(Bn(c, "package.json"))) || void 0,
- directoryHasPackageJson: (c) => o(e.toPath(c)),
- searchDirectoryAndAncestors: (c) => {
- Fp(c, (_) => {
- const u = e.toPath(_);
- if (o(u) !== 3)
- return !0;
- const d = Bn(_, "package.json");
- m8(e, d) ? i(d, Bn(u, "package.json")) : n.set(u, !0);
- });
- }
- };
- function i(c, _) {
- const u = E.checkDefined(IV(c, e.host));
- t.set(_, u), n.delete(Xn(_));
- }
- function s(c) {
- t.delete(c), n.delete(Xn(c));
- }
- function o(c) {
- return t.has(Bn(c, "package.json")) ? -1 : n.has(c) ? 0 : 3;
- }
- }
- var hPe = {
- isCancellationRequested: () => !1,
- setRequest: () => {
- },
- resetRequest: () => {
- }
- };
- function CZe(e) {
- const t = e[0], n = e[1];
- return (1e9 * t + n) / 1e6;
- }
- function yPe(e, t) {
- if ((B6(e) || tN(e)) && e.isJsOnlyProject()) {
- const n = e.getScriptInfoForNormalizedPath(t);
- return n && !n.isJavaScript();
- }
- return !1;
- }
- function EZe(e) {
- return P_(e) || !!e.emitDecoratorMetadata;
- }
- function vPe(e, t, n) {
- const i = t.getScriptInfoForNormalizedPath(e);
- return {
- start: i.positionToLineOffset(n.start),
- end: i.positionToLineOffset(n.start + n.length),
- // TODO: GH#18217
- text: Em(n.messageText, `
-`),
- code: n.code,
- category: U2(n),
- reportsUnnecessary: n.reportsUnnecessary,
- reportsDeprecated: n.reportsDeprecated,
- source: n.source,
- relatedInformation: lr(n.relatedInformation, tG)
- };
- }
- function tG(e) {
- return e.file ? {
- span: {
- start: z6(Qs(e.file, e.start)),
- end: z6(Qs(e.file, e.start + e.length)),
- // TODO: GH#18217
- file: e.file.fileName
- },
- message: Em(e.messageText, `
-`),
- category: U2(e),
- code: e.code
- } : {
- message: Em(e.messageText, `
-`),
- category: U2(e),
- code: e.code
- };
- }
- function z6(e) {
- return { line: e.line + 1, offset: e.character + 1 };
- }
- function iN(e, t) {
- const n = e.file && z6(Qs(e.file, e.start)), i = e.file && z6(Qs(e.file, e.start + e.length)), s = Em(e.messageText, `
-`), { code: o, source: c } = e, _ = U2(e), u = {
- start: n,
- end: i,
- text: s,
- code: o,
- category: _,
- reportsUnnecessary: e.reportsUnnecessary,
- reportsDeprecated: e.reportsDeprecated,
- source: c,
- relatedInformation: lr(e.relatedInformation, tG)
- };
- return t ? { ...u, fileName: e.file && e.file.fileName } : u;
- }
- function DZe(e, t) {
- return e.every((n) => ec(n.span) < t);
- }
- var bPe = Jue;
- function m_e(e, t, n, i) {
- const s = t.hasLevel(
- 3
- /* verbose */
- ), o = JSON.stringify(e);
- return s && t.info(`${e.type}:${Tv(e)}`), `Content-Length: ${1 + n(o, "utf8")}\r
-\r
-${o}${i}`;
- }
- var PZe = class {
- constructor(e) {
- this.operationHost = e;
- }
- startNew(e) {
- this.complete(), this.requestId = this.operationHost.getCurrentRequestId(), this.executeAction(e);
- }
- complete() {
- this.requestId !== void 0 && (this.operationHost.sendRequestCompletedEvent(this.requestId, this.performanceData), this.requestId = void 0), this.setTimerHandle(void 0), this.setImmediateId(void 0), this.performanceData = void 0;
- }
- immediate(e, t) {
- const n = this.requestId;
- E.assert(n === this.operationHost.getCurrentRequestId(), "immediate: incorrect request id"), this.setImmediateId(
- this.operationHost.getServerHost().setImmediate(() => {
- this.immediateId = void 0, this.operationHost.executeWithRequestId(n, () => this.executeAction(t), this.performanceData);
- }, e)
- );
- }
- delay(e, t, n) {
- const i = this.requestId;
- E.assert(i === this.operationHost.getCurrentRequestId(), "delay: incorrect request id"), this.setTimerHandle(
- this.operationHost.getServerHost().setTimeout(
- () => {
- this.timerHandle = void 0, this.operationHost.executeWithRequestId(i, () => this.executeAction(n), this.performanceData);
- },
- t,
- e
- )
- );
- }
- executeAction(e) {
- var t, n, i, s, o, c;
- let _ = !1;
- try {
- this.operationHost.isCancellationRequested() ? (_ = !0, (t = rn) == null || t.instant(rn.Phase.Session, "stepCanceled", { seq: this.requestId, early: !0 })) : ((n = rn) == null || n.push(rn.Phase.Session, "stepAction", { seq: this.requestId }), e(this), (i = rn) == null || i.pop());
- } catch (u) {
- (s = rn) == null || s.popAll(), _ = !0, u instanceof JE ? (o = rn) == null || o.instant(rn.Phase.Session, "stepCanceled", { seq: this.requestId }) : ((c = rn) == null || c.instant(rn.Phase.Session, "stepError", { seq: this.requestId, message: u.message }), this.operationHost.logError(u, `delayed processing of request ${this.requestId}`));
- }
- this.performanceData = this.operationHost.getPerformanceData(), (_ || !this.hasPendingWork()) && this.complete();
- }
- setTimerHandle(e) {
- this.timerHandle !== void 0 && this.operationHost.getServerHost().clearTimeout(this.timerHandle), this.timerHandle = e;
- }
- setImmediateId(e) {
- this.immediateId !== void 0 && this.operationHost.getServerHost().clearImmediate(this.immediateId), this.immediateId = e;
- }
- hasPendingWork() {
- return !!this.timerHandle || !!this.immediateId;
- }
- };
- function g_e(e, t) {
- return {
- seq: 0,
- type: "event",
- event: e,
- body: t
- };
- }
- function wZe(e, t, n, i) {
- const s = AE(us(n) ? n : n.projects, (o) => i(o, e));
- return !us(n) && n.symLinkedProjects && n.symLinkedProjects.forEach((o, c) => {
- const _ = t(c);
- s.push(...ta(o, (u) => i(u, _)));
- }), cb(s, by);
- }
- function rG(e) {
- return gR(({ textSpan: t }) => t.start + 100003 * t.length, hV(e));
- }
- function AZe(e, t, n, i, s, o, c) {
- const _ = SPe(
- e,
- t,
- n,
- /*isForRename*/
- !0,
- (g, h) => g.getLanguageService().findRenameLocations(h.fileName, h.pos, i, s, o),
- (g, h) => h(mP(g))
- );
- if (us(_))
- return _;
- const u = [], d = rG(c);
- return _.forEach((g, h) => {
- for (const S of g)
- !d.has(S) && !nG(mP(S), h) && (u.push(S), d.add(S));
- }), u;
- }
- function NZe(e, t, n) {
- const i = e.getLanguageService().getDefinitionAtPosition(
- t.fileName,
- t.pos,
- /*searchOtherFilesOnly*/
- !1,
- /*stopAtAlias*/
- n
- ), s = i && el(i);
- return s && !s.isLocal ? { fileName: s.fileName, pos: s.textSpan.start } : void 0;
- }
- function IZe(e, t, n, i, s) {
- var o, c;
- const _ = SPe(
- e,
- t,
- n,
- /*isForRename*/
- !1,
- (h, S) => (s.info(`Finding references to ${S.fileName} position ${S.pos} in project ${h.getProjectName()}`), h.getLanguageService().findReferences(S.fileName, S.pos)),
- (h, S) => {
- S(mP(h.definition));
- for (const T of h.references)
- S(mP(T));
- }
- );
- if (us(_))
- return _;
- const u = _.get(t);
- if (((c = (o = u?.[0]) == null ? void 0 : o.references[0]) == null ? void 0 : c.isDefinition) === void 0)
- _.forEach((h) => {
- for (const S of h)
- for (const T of S.references)
- delete T.isDefinition;
- });
- else {
- const h = rG(i);
- for (const T of u)
- for (const C of T.references)
- if (C.isDefinition) {
- h.add(C);
- break;
- }
- const S = /* @__PURE__ */ new Set();
- for (; ; ) {
- let T = !1;
- if (_.forEach((C, D) => {
- if (S.has(D)) return;
- D.getLanguageService().updateIsDefinitionOfReferencedSymbols(C, h) && (S.add(D), T = !0);
- }), !T) break;
- }
- _.forEach((T, C) => {
- if (!S.has(C))
- for (const D of T)
- for (const P of D.references)
- P.isDefinition = !1;
- });
- }
- const d = [], g = rG(i);
- return _.forEach((h, S) => {
- for (const T of h) {
- const C = nG(mP(T.definition), S), D = C === void 0 ? T.definition : {
- ...T.definition,
- textSpan: Ul(C.pos, T.definition.textSpan.length),
- // Why would the length be the same in the original?
- fileName: C.fileName,
- contextSpan: LZe(T.definition, S)
- };
- let P = On(d, (I) => gV(I.definition, D, i));
- P || (P = { definition: D, references: [] }, d.push(P));
- for (const I of T.references)
- !g.has(I) && !nG(mP(I), S) && (g.add(I), P.references.push(I));
- }
- }), d.filter((h) => h.references.length !== 0);
- }
- function h_e(e, t, n) {
- for (const i of us(e) ? e : e.projects)
- n(i, t);
- !us(e) && e.symLinkedProjects && e.symLinkedProjects.forEach((i, s) => {
- for (const o of i)
- n(o, s);
- });
- }
- function SPe(e, t, n, i, s, o) {
- const c = /* @__PURE__ */ new Map(), _ = iw();
- _.enqueue({ project: t, location: n }), h_e(e, n.fileName, (D, P) => {
- const I = { fileName: P, pos: n.pos };
- _.enqueue({ project: D, location: I });
- });
- const u = t.projectService, d = t.getCancellationToken(), g = NZe(t, n, i), h = Iu(
- () => t.isSourceOfProjectReferenceRedirect(g.fileName) ? g : t.getLanguageService().getSourceMapper().tryGetGeneratedPosition(g)
- ), S = Iu(
- () => t.isSourceOfProjectReferenceRedirect(g.fileName) ? g : t.getLanguageService().getSourceMapper().tryGetSourcePosition(g)
- ), T = /* @__PURE__ */ new Set();
- e:
- for (; !_.isEmpty(); ) {
- for (; !_.isEmpty(); ) {
- if (d.isCancellationRequested()) break e;
- const { project: D, location: P } = _.dequeue();
- if (c.has(D) || TPe(D, P) || (gp(D), !D.containsFile(Wo(P.fileName))))
- continue;
- const I = C(D, P);
- c.set(D, I ?? hl), T.add(FZe(D));
- }
- g && (u.loadAncestorProjectTree(T), u.forEachEnabledProject((D) => {
- if (d.isCancellationRequested() || c.has(D)) return;
- const P = OZe(g, D, h, S);
- P && _.enqueue({ project: D, location: P });
- }));
- }
- if (c.size === 1)
- return _R(c.values());
- return c;
- function C(D, P) {
- const I = s(D, P);
- if (I) {
- for (const F of I)
- o(F, (O) => {
- const B = u.getOriginalLocationEnsuringConfiguredProject(D, O);
- if (!B) return;
- const z = u.getScriptInfo(B.fileName);
- for (const q of z.containingProjects)
- !q.isOrphan() && !c.has(q) && _.enqueue({ project: q, location: B });
- const X = u.getSymlinkedProjects(z);
- X && X.forEach((q, V) => {
- for (const ae of q)
- !ae.isOrphan() && !c.has(ae) && _.enqueue({ project: ae, location: { fileName: V, pos: B.pos } });
- });
- });
- return I;
- }
- }
- }
- function OZe(e, t, n, i) {
- if (t.containsFile(Wo(e.fileName)) && !TPe(t, e))
- return e;
- const s = n();
- if (s && t.containsFile(Wo(s.fileName))) return s;
- const o = i();
- return o && t.containsFile(Wo(o.fileName)) ? o : void 0;
- }
- function TPe(e, t) {
- if (!t) return !1;
- const n = e.getLanguageService().getProgram();
- if (!n) return !1;
- const i = n.getSourceFile(t.fileName);
- return !!i && i.resolvedPath !== i.path && i.resolvedPath !== e.toPath(t.fileName);
- }
- function FZe(e) {
- return B0(e) ? e.canonicalConfigFilePath : e.getProjectName();
- }
- function mP({ fileName: e, textSpan: t }) {
- return { fileName: e, pos: t.start };
- }
- function nG(e, t) {
- return XD(e, t.getSourceMapper(), (n) => t.projectService.fileExists(n));
- }
- function xPe(e, t) {
- return o9(e, t.getSourceMapper(), (n) => t.projectService.fileExists(n));
- }
- function LZe(e, t) {
- return vV(e, t.getSourceMapper(), (n) => t.projectService.fileExists(n));
- }
- var kPe = [
- "openExternalProject",
- "openExternalProjects",
- "closeExternalProject",
- "synchronizeProjectList",
- "emit-output",
- "compileOnSaveAffectedFileList",
- "compileOnSaveEmitFile",
- "compilerOptionsDiagnostics-full",
- "encodedSemanticClassifications-full",
- "semanticDiagnosticsSync",
- "suggestionDiagnosticsSync",
- "geterrForProject",
- "reload",
- "reloadProjects",
- "getCodeFixes",
- "getCodeFixes-full",
- "getCombinedCodeFix",
- "getCombinedCodeFix-full",
- "applyCodeActionCommand",
- "getSupportedCodeFixes",
- "getApplicableRefactors",
- "getMoveToRefactoringFileSuggestions",
- "getEditsForRefactor",
- "getEditsForRefactor-full",
- "organizeImports",
- "organizeImports-full",
- "getEditsForFileRename",
- "getEditsForFileRename-full",
- "prepareCallHierarchy",
- "provideCallHierarchyIncomingCalls",
- "provideCallHierarchyOutgoingCalls",
- "getPasteEdits"
- /* GetPasteEdits */
- ], MZe = [
- ...kPe,
- "definition",
- "definition-full",
- "definitionAndBoundSpan",
- "definitionAndBoundSpan-full",
- "typeDefinition",
- "implementation",
- "implementation-full",
- "references",
- "references-full",
- "rename",
- "renameLocations-full",
- "rename-full",
- "quickinfo",
- "quickinfo-full",
- "completionInfo",
- "completions",
- "completions-full",
- "completionEntryDetails",
- "completionEntryDetails-full",
- "signatureHelp",
- "signatureHelp-full",
- "navto",
- "navto-full",
- "documentHighlights",
- "documentHighlights-full"
- /* DocumentHighlightsFull */
- ], CPe = class oX {
- constructor(t) {
- this.changeSeq = 0, this.regionDiagLineCountThreshold = 500, this.handlers = new Map(Object.entries({
- // TODO(jakebailey): correctly type the handlers
- status: () => {
- const o = { version: U_ };
- return this.requiredResponse(o);
- },
- openExternalProject: (o) => (this.projectService.openExternalProject(
- o.arguments,
- /*cleanupAfter*/
- !0
- ), this.requiredResponse(
- /*response*/
- !0
- )),
- openExternalProjects: (o) => (this.projectService.openExternalProjects(o.arguments.projects), this.requiredResponse(
- /*response*/
- !0
- )),
- closeExternalProject: (o) => (this.projectService.closeExternalProject(
- o.arguments.projectFileName,
- /*cleanupAfter*/
- !0
- ), this.requiredResponse(
- /*response*/
- !0
- )),
- synchronizeProjectList: (o) => {
- const c = this.projectService.synchronizeProjectList(o.arguments.knownProjects, o.arguments.includeProjectReferenceRedirectInfo);
- if (!c.some((u) => u.projectErrors && u.projectErrors.length !== 0))
- return this.requiredResponse(c);
- const _ = lr(c, (u) => !u.projectErrors || u.projectErrors.length === 0 ? u : {
- info: u.info,
- changes: u.changes,
- files: u.files,
- projectErrors: this.convertToDiagnosticsWithLinePosition(
- u.projectErrors,
- /*scriptInfo*/
- void 0
- )
- });
- return this.requiredResponse(_);
- },
- updateOpen: (o) => (this.changeSeq++, this.projectService.applyChangesInOpenFiles(
- o.arguments.openFiles && wE(o.arguments.openFiles, (c) => ({
- fileName: c.file,
- content: c.fileContent,
- scriptKind: c.scriptKindName,
- projectRootPath: c.projectRootPath
- })),
- o.arguments.changedFiles && wE(o.arguments.changedFiles, (c) => ({
- fileName: c.fileName,
- changes: dy(lR(c.textChanges), (_) => {
- const u = E.checkDefined(this.projectService.getScriptInfo(c.fileName)), d = u.lineOffsetToPosition(_.start.line, _.start.offset), g = u.lineOffsetToPosition(_.end.line, _.end.offset);
- return d >= 0 ? { span: { start: d, length: g - d }, newText: _.newText } : void 0;
- })
- })),
- o.arguments.closedFiles
- ), this.requiredResponse(
- /*response*/
- !0
- )),
- applyChangedToOpenFiles: (o) => (this.changeSeq++, this.projectService.applyChangesInOpenFiles(
- o.arguments.openFiles,
- o.arguments.changedFiles && wE(o.arguments.changedFiles, (c) => ({
- fileName: c.fileName,
- // apply changes in reverse order
- changes: lR(c.changes)
- })),
- o.arguments.closedFiles
- ), this.requiredResponse(
- /*response*/
- !0
- )),
- exit: () => (this.exit(), this.notRequired(
- /*request*/
- void 0
- )),
- definition: (o) => this.requiredResponse(this.getDefinition(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "definition-full": (o) => this.requiredResponse(this.getDefinition(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- definitionAndBoundSpan: (o) => this.requiredResponse(this.getDefinitionAndBoundSpan(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "definitionAndBoundSpan-full": (o) => this.requiredResponse(this.getDefinitionAndBoundSpan(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- findSourceDefinition: (o) => this.requiredResponse(this.findSourceDefinition(o.arguments)),
- "emit-output": (o) => this.requiredResponse(this.getEmitOutput(o.arguments)),
- typeDefinition: (o) => this.requiredResponse(this.getTypeDefinition(o.arguments)),
- implementation: (o) => this.requiredResponse(this.getImplementation(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "implementation-full": (o) => this.requiredResponse(this.getImplementation(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- references: (o) => this.requiredResponse(this.getReferences(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "references-full": (o) => this.requiredResponse(this.getReferences(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- rename: (o) => this.requiredResponse(this.getRenameLocations(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "renameLocations-full": (o) => this.requiredResponse(this.getRenameLocations(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- "rename-full": (o) => this.requiredResponse(this.getRenameInfo(o.arguments)),
- open: (o) => (this.openClientFile(
- Wo(o.arguments.file),
- o.arguments.fileContent,
- QH(o.arguments.scriptKindName),
- // TODO: GH#18217
- o.arguments.projectRootPath ? Wo(o.arguments.projectRootPath) : void 0
- ), this.notRequired(o)),
- quickinfo: (o) => this.requiredResponse(this.getQuickInfoWorker(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "quickinfo-full": (o) => this.requiredResponse(this.getQuickInfoWorker(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- getOutliningSpans: (o) => this.requiredResponse(this.getOutliningSpans(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- outliningSpans: (o) => this.requiredResponse(this.getOutliningSpans(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- todoComments: (o) => this.requiredResponse(this.getTodoComments(o.arguments)),
- indentation: (o) => this.requiredResponse(this.getIndentation(o.arguments)),
- nameOrDottedNameSpan: (o) => this.requiredResponse(this.getNameOrDottedNameSpan(o.arguments)),
- breakpointStatement: (o) => this.requiredResponse(this.getBreakpointStatement(o.arguments)),
- braceCompletion: (o) => this.requiredResponse(this.isValidBraceCompletion(o.arguments)),
- docCommentTemplate: (o) => this.requiredResponse(this.getDocCommentTemplate(o.arguments)),
- getSpanOfEnclosingComment: (o) => this.requiredResponse(this.getSpanOfEnclosingComment(o.arguments)),
- fileReferences: (o) => this.requiredResponse(this.getFileReferences(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "fileReferences-full": (o) => this.requiredResponse(this.getFileReferences(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- format: (o) => this.requiredResponse(this.getFormattingEditsForRange(o.arguments)),
- formatonkey: (o) => this.requiredResponse(this.getFormattingEditsAfterKeystroke(o.arguments)),
- "format-full": (o) => this.requiredResponse(this.getFormattingEditsForDocumentFull(o.arguments)),
- "formatonkey-full": (o) => this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(o.arguments)),
- "formatRange-full": (o) => this.requiredResponse(this.getFormattingEditsForRangeFull(o.arguments)),
- completionInfo: (o) => this.requiredResponse(this.getCompletions(
- o.arguments,
- "completionInfo"
- /* CompletionInfo */
- )),
- completions: (o) => this.requiredResponse(this.getCompletions(
- o.arguments,
- "completions"
- /* Completions */
- )),
- "completions-full": (o) => this.requiredResponse(this.getCompletions(
- o.arguments,
- "completions-full"
- /* CompletionsFull */
- )),
- completionEntryDetails: (o) => this.requiredResponse(this.getCompletionEntryDetails(
- o.arguments,
- /*fullResult*/
- !1
- )),
- "completionEntryDetails-full": (o) => this.requiredResponse(this.getCompletionEntryDetails(
- o.arguments,
- /*fullResult*/
- !0
- )),
- compileOnSaveAffectedFileList: (o) => this.requiredResponse(this.getCompileOnSaveAffectedFileList(o.arguments)),
- compileOnSaveEmitFile: (o) => this.requiredResponse(this.emitFile(o.arguments)),
- signatureHelp: (o) => this.requiredResponse(this.getSignatureHelpItems(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "signatureHelp-full": (o) => this.requiredResponse(this.getSignatureHelpItems(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- "compilerOptionsDiagnostics-full": (o) => this.requiredResponse(this.getCompilerOptionsDiagnostics(o.arguments)),
- "encodedSyntacticClassifications-full": (o) => this.requiredResponse(this.getEncodedSyntacticClassifications(o.arguments)),
- "encodedSemanticClassifications-full": (o) => this.requiredResponse(this.getEncodedSemanticClassifications(o.arguments)),
- cleanup: () => (this.cleanup(), this.requiredResponse(
- /*response*/
- !0
- )),
- semanticDiagnosticsSync: (o) => this.requiredResponse(this.getSemanticDiagnosticsSync(o.arguments)),
- syntacticDiagnosticsSync: (o) => this.requiredResponse(this.getSyntacticDiagnosticsSync(o.arguments)),
- suggestionDiagnosticsSync: (o) => this.requiredResponse(this.getSuggestionDiagnosticsSync(o.arguments)),
- geterr: (o) => (this.errorCheck.startNew((c) => this.getDiagnostics(c, o.arguments.delay, o.arguments.files)), this.notRequired(
- /*request*/
- void 0
- )),
- geterrForProject: (o) => (this.errorCheck.startNew((c) => this.getDiagnosticsForProject(c, o.arguments.delay, o.arguments.file)), this.notRequired(
- /*request*/
- void 0
- )),
- change: (o) => (this.change(o.arguments), this.notRequired(o)),
- configure: (o) => (this.projectService.setHostConfiguration(o.arguments), this.notRequired(o)),
- reload: (o) => (this.reload(o.arguments), this.requiredResponse({ reloadFinished: !0 })),
- saveto: (o) => {
- const c = o.arguments;
- return this.saveToTmp(c.file, c.tmpfile), this.notRequired(o);
- },
- close: (o) => {
- const c = o.arguments;
- return this.closeClientFile(c.file), this.notRequired(o);
- },
- navto: (o) => this.requiredResponse(this.getNavigateToItems(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "navto-full": (o) => this.requiredResponse(this.getNavigateToItems(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- brace: (o) => this.requiredResponse(this.getBraceMatching(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "brace-full": (o) => this.requiredResponse(this.getBraceMatching(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- navbar: (o) => this.requiredResponse(this.getNavigationBarItems(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "navbar-full": (o) => this.requiredResponse(this.getNavigationBarItems(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- navtree: (o) => this.requiredResponse(this.getNavigationTree(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "navtree-full": (o) => this.requiredResponse(this.getNavigationTree(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- documentHighlights: (o) => this.requiredResponse(this.getDocumentHighlights(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "documentHighlights-full": (o) => this.requiredResponse(this.getDocumentHighlights(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- compilerOptionsForInferredProjects: (o) => (this.setCompilerOptionsForInferredProjects(o.arguments), this.requiredResponse(
- /*response*/
- !0
- )),
- projectInfo: (o) => this.requiredResponse(this.getProjectInfo(o.arguments)),
- reloadProjects: (o) => (this.projectService.reloadProjects(), this.notRequired(o)),
- jsxClosingTag: (o) => this.requiredResponse(this.getJsxClosingTag(o.arguments)),
- linkedEditingRange: (o) => this.requiredResponse(this.getLinkedEditingRange(o.arguments)),
- getCodeFixes: (o) => this.requiredResponse(this.getCodeFixes(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "getCodeFixes-full": (o) => this.requiredResponse(this.getCodeFixes(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- getCombinedCodeFix: (o) => this.requiredResponse(this.getCombinedCodeFix(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "getCombinedCodeFix-full": (o) => this.requiredResponse(this.getCombinedCodeFix(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- applyCodeActionCommand: (o) => this.requiredResponse(this.applyCodeActionCommand(o.arguments)),
- getSupportedCodeFixes: (o) => this.requiredResponse(this.getSupportedCodeFixes(o.arguments)),
- getApplicableRefactors: (o) => this.requiredResponse(this.getApplicableRefactors(o.arguments)),
- getEditsForRefactor: (o) => this.requiredResponse(this.getEditsForRefactor(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- getMoveToRefactoringFileSuggestions: (o) => this.requiredResponse(this.getMoveToRefactoringFileSuggestions(o.arguments)),
- getPasteEdits: (o) => this.requiredResponse(this.getPasteEdits(o.arguments)),
- "getEditsForRefactor-full": (o) => this.requiredResponse(this.getEditsForRefactor(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- organizeImports: (o) => this.requiredResponse(this.organizeImports(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "organizeImports-full": (o) => this.requiredResponse(this.organizeImports(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- getEditsForFileRename: (o) => this.requiredResponse(this.getEditsForFileRename(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "getEditsForFileRename-full": (o) => this.requiredResponse(this.getEditsForFileRename(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- configurePlugin: (o) => (this.configurePlugin(o.arguments), this.notRequired(o)),
- selectionRange: (o) => this.requiredResponse(this.getSmartSelectionRange(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "selectionRange-full": (o) => this.requiredResponse(this.getSmartSelectionRange(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- prepareCallHierarchy: (o) => this.requiredResponse(this.prepareCallHierarchy(o.arguments)),
- provideCallHierarchyIncomingCalls: (o) => this.requiredResponse(this.provideCallHierarchyIncomingCalls(o.arguments)),
- provideCallHierarchyOutgoingCalls: (o) => this.requiredResponse(this.provideCallHierarchyOutgoingCalls(o.arguments)),
- toggleLineComment: (o) => this.requiredResponse(this.toggleLineComment(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "toggleLineComment-full": (o) => this.requiredResponse(this.toggleLineComment(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- toggleMultilineComment: (o) => this.requiredResponse(this.toggleMultilineComment(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "toggleMultilineComment-full": (o) => this.requiredResponse(this.toggleMultilineComment(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- commentSelection: (o) => this.requiredResponse(this.commentSelection(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "commentSelection-full": (o) => this.requiredResponse(this.commentSelection(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- uncommentSelection: (o) => this.requiredResponse(this.uncommentSelection(
- o.arguments,
- /*simplifiedResult*/
- !0
- )),
- "uncommentSelection-full": (o) => this.requiredResponse(this.uncommentSelection(
- o.arguments,
- /*simplifiedResult*/
- !1
- )),
- provideInlayHints: (o) => this.requiredResponse(this.provideInlayHints(o.arguments)),
- mapCode: (o) => this.requiredResponse(this.mapCode(o.arguments))
- })), this.host = t.host, this.cancellationToken = t.cancellationToken, this.typingsInstaller = t.typingsInstaller || vL, this.byteLength = t.byteLength, this.hrtime = t.hrtime, this.logger = t.logger, this.canUseEvents = t.canUseEvents, this.suppressDiagnosticEvents = t.suppressDiagnosticEvents, this.noGetErrOnBackgroundUpdate = t.noGetErrOnBackgroundUpdate;
- const { throttleWaitMilliseconds: n } = t;
- this.eventHandler = this.canUseEvents ? t.eventHandler || ((o) => this.defaultEventHandler(o)) : void 0;
- const i = {
- executeWithRequestId: (o, c, _) => this.executeWithRequestId(o, c, _),
- getCurrentRequestId: () => this.currentRequestId,
- getPerformanceData: () => this.performanceData,
- getServerHost: () => this.host,
- logError: (o, c) => this.logError(o, c),
- sendRequestCompletedEvent: (o, c) => this.sendRequestCompletedEvent(o, c),
- isCancellationRequested: () => this.cancellationToken.isCancellationRequested()
- };
- this.errorCheck = new PZe(i);
- const s = {
- host: this.host,
- logger: this.logger,
- cancellationToken: this.cancellationToken,
- useSingleInferredProject: t.useSingleInferredProject,
- useInferredProjectPerProjectRoot: t.useInferredProjectPerProjectRoot,
- typingsInstaller: this.typingsInstaller,
- throttleWaitMilliseconds: n,
- eventHandler: this.eventHandler,
- suppressDiagnosticEvents: this.suppressDiagnosticEvents,
- globalPlugins: t.globalPlugins,
- pluginProbeLocations: t.pluginProbeLocations,
- allowLocalPluginLoads: t.allowLocalPluginLoads,
- typesMapLocation: t.typesMapLocation,
- serverMode: t.serverMode,
- session: this,
- canUseWatchEvents: t.canUseWatchEvents,
- incrementalVerifier: t.incrementalVerifier
- };
- switch (this.projectService = new u_e(s), this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)), this.gcTimer = new jue(
- this.host,
- /*delay*/
- 7e3,
- this.logger
- ), this.projectService.serverMode) {
- case 0:
- break;
- case 1:
- kPe.forEach(
- (o) => this.handlers.set(o, (c) => {
- throw new Error(`Request: ${c.command} not allowed in LanguageServiceMode.PartialSemantic`);
- })
- );
- break;
- case 2:
- MZe.forEach(
- (o) => this.handlers.set(o, (c) => {
- throw new Error(`Request: ${c.command} not allowed in LanguageServiceMode.Syntactic`);
- })
- );
- break;
- default:
- E.assertNever(this.projectService.serverMode);
- }
- }
- sendRequestCompletedEvent(t, n) {
- this.event(
- {
- request_seq: t,
- performanceData: n && EPe(n)
- },
- "requestCompleted"
- );
- }
- addPerformanceData(t, n) {
- this.performanceData || (this.performanceData = {}), this.performanceData[t] = (this.performanceData[t] ?? 0) + n;
- }
- addDiagnosticsPerformanceData(t, n, i) {
- var s, o;
- this.performanceData || (this.performanceData = {});
- let c = (s = this.performanceData.diagnosticsDuration) == null ? void 0 : s.get(t);
- c || ((o = this.performanceData).diagnosticsDuration ?? (o.diagnosticsDuration = /* @__PURE__ */ new Map())).set(t, c = {}), c[n] = i;
- }
- performanceEventHandler(t) {
- switch (t.kind) {
- case "UpdateGraph":
- this.addPerformanceData("updateGraphDurationMs", t.durationMs);
- break;
- case "CreatePackageJsonAutoImportProvider":
- this.addPerformanceData("createAutoImportProviderProgramDurationMs", t.durationMs);
- break;
- }
- }
- defaultEventHandler(t) {
- switch (t.eventName) {
- case hL:
- this.projectsUpdatedInBackgroundEvent(t.data.openFiles);
- break;
- case JH:
- this.event({
- projectName: t.data.project.getProjectName(),
- reason: t.data.reason
- }, t.eventName);
- break;
- case zH:
- this.event({
- projectName: t.data.project.getProjectName()
- }, t.eventName);
- break;
- case WH:
- case HH:
- case GH:
- case $H:
- this.event(t.data, t.eventName);
- break;
- case UH:
- this.event({
- triggerFile: t.data.triggerFile,
- configFile: t.data.configFileName,
- diagnostics: lr(t.data.diagnostics, (n) => iN(
- n,
- /*includeFileName*/
- !0
- ))
- }, t.eventName);
- break;
- case VH: {
- this.event({
- projectName: t.data.project.getProjectName(),
- languageServiceEnabled: t.data.languageServiceEnabled
- }, t.eventName);
- break;
- }
- case qH: {
- this.event({
- telemetryEventName: t.eventName,
- payload: t.data
- }, "telemetry");
- break;
- }
- }
- }
- projectsUpdatedInBackgroundEvent(t) {
- this.projectService.logger.info(`got projects updated in background ${t}`), t.length && (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate && (this.projectService.logger.info(`Queueing diagnostics update for ${t}`), this.errorCheck.startNew((n) => this.updateErrorCheck(
- n,
- t,
- 100,
- /*requireOpen*/
- !0
- ))), this.event({
- openFiles: t
- }, hL));
- }
- logError(t, n) {
- this.logErrorWorker(t, n);
- }
- logErrorWorker(t, n, i) {
- let s = "Exception on executing command " + n;
- if (t.message && (s += `:
-` + WD(t.message), t.stack && (s += `
-` + WD(t.stack))), this.logger.hasLevel(
- 3
- /* verbose */
- )) {
- if (i)
- try {
- const { file: o, project: c } = this.getFileAndProject(i), _ = c.getScriptInfoForNormalizedPath(o);
- if (_) {
- const u = Yx(_.getSnapshot());
- s += `
-
-File text of ${i.file}:${WD(u)}
-`;
- }
- } catch {
- }
- if (t.ProgramFiles) {
- s += `
-
-Program files: ${JSON.stringify(t.ProgramFiles)}
-`, s += `
-
-Projects::
-`;
- let o = 0;
- const c = (_) => {
- s += `
-Project '${_.projectName}' (${K8[_.projectKind]}) ${o}
-`, s += _.filesToString(
- /*writeProjectFileNames*/
- !0
- ), s += `
------------------------------------------------
-`, o++;
- };
- this.projectService.externalProjects.forEach(c), this.projectService.configuredProjects.forEach(c), this.projectService.inferredProjects.forEach(c);
- }
- }
- this.logger.msg(
- s,
- "Err"
- /* Err */
- );
- }
- send(t) {
- if (t.type === "event" && !this.canUseEvents) {
- this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`Session does not support events: ignored event: ${Tv(t)}`);
- return;
- }
- this.writeMessage(t);
- }
- writeMessage(t) {
- const n = m_e(t, this.logger, this.byteLength, this.host.newLine);
- this.host.write(n);
- }
- event(t, n) {
- this.send(g_e(n, t));
- }
- /** @internal */
- doOutput(t, n, i, s, o, c) {
- const _ = {
- seq: 0,
- type: "response",
- command: n,
- request_seq: i,
- success: s,
- performanceData: o && EPe(o)
- };
- if (s) {
- let u;
- if (us(t))
- _.body = t, u = t.metadata, delete t.metadata;
- else if (typeof t == "object")
- if (t.metadata) {
- const { metadata: d, ...g } = t;
- _.body = g, u = d;
- } else
- _.body = t;
- else
- _.body = t;
- u && (_.metadata = u);
- } else
- E.assert(t === void 0);
- c && (_.message = c), this.send(_);
- }
- semanticCheck(t, n) {
- var i, s;
- const o = lo();
- (i = rn) == null || i.push(rn.Phase.Session, "semanticCheck", { file: t, configFilePath: n.canonicalConfigFilePath });
- const c = yPe(n, t) ? hl : n.getLanguageService().getSemanticDiagnostics(t).filter((_) => !!_.file);
- this.sendDiagnosticsEvent(t, n, c, "semanticDiag", o), (s = rn) == null || s.pop();
- }
- syntacticCheck(t, n) {
- var i, s;
- const o = lo();
- (i = rn) == null || i.push(rn.Phase.Session, "syntacticCheck", { file: t, configFilePath: n.canonicalConfigFilePath }), this.sendDiagnosticsEvent(t, n, n.getLanguageService().getSyntacticDiagnostics(t), "syntaxDiag", o), (s = rn) == null || s.pop();
- }
- suggestionCheck(t, n) {
- var i, s;
- const o = lo();
- (i = rn) == null || i.push(rn.Phase.Session, "suggestionCheck", { file: t, configFilePath: n.canonicalConfigFilePath }), this.sendDiagnosticsEvent(t, n, n.getLanguageService().getSuggestionDiagnostics(t), "suggestionDiag", o), (s = rn) == null || s.pop();
- }
- regionSemanticCheck(t, n, i) {
- var s, o, c;
- const _ = lo();
- (s = rn) == null || s.push(rn.Phase.Session, "regionSemanticCheck", { file: t, configFilePath: n.canonicalConfigFilePath });
- let u;
- if (!this.shouldDoRegionCheck(t) || !(u = n.getLanguageService().getRegionSemanticDiagnostics(t, i))) {
- (o = rn) == null || o.pop();
- return;
- }
- this.sendDiagnosticsEvent(t, n, u.diagnostics, "regionSemanticDiag", _, u.spans), (c = rn) == null || c.pop();
- }
- // We should only do the region-based semantic check if we think it would be
- // considerably faster than a whole-file semantic check.
- /** @internal */
- shouldDoRegionCheck(t) {
- var n;
- const i = (n = this.projectService.getScriptInfoForNormalizedPath(t)) == null ? void 0 : n.textStorage.getLineInfo().getLineCount();
- return !!(i && i >= this.regionDiagLineCountThreshold);
- }
- sendDiagnosticsEvent(t, n, i, s, o, c) {
- try {
- const _ = E.checkDefined(n.getScriptInfo(t)), u = lo() - o, d = {
- file: t,
- diagnostics: i.map((g) => vPe(t, n, g)),
- spans: c?.map((g) => Am(g, _))
- };
- this.event(
- d,
- s
- ), this.addDiagnosticsPerformanceData(t, s, u);
- } catch (_) {
- this.logError(_, s);
- }
- }
- /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
- updateErrorCheck(t, n, i, s = !0) {
- if (n.length === 0)
- return;
- E.assert(!this.suppressDiagnosticEvents);
- const o = this.changeSeq, c = Math.min(i, 200);
- let _ = 0;
- const u = () => {
- if (_++, n.length > _)
- return t.delay("checkOne", c, g);
- }, d = (h, S) => {
- if (this.semanticCheck(h, S), this.changeSeq === o) {
- if (this.getPreferences(h).disableSuggestions)
- return u();
- t.immediate("suggestionCheck", () => {
- this.suggestionCheck(h, S), u();
- });
- }
- }, g = () => {
- if (this.changeSeq !== o)
- return;
- let h, S = n[_];
- if (_s(S) ? S = this.toPendingErrorCheck(S) : "ranges" in S && (h = S.ranges, S = this.toPendingErrorCheck(S.file)), !S)
- return u();
- const { fileName: T, project: C } = S;
- if (gp(C), !!C.containsFile(T, s) && (this.syntacticCheck(T, C), this.changeSeq === o)) {
- if (C.projectService.serverMode !== 0)
- return u();
- if (h)
- return t.immediate("regionSemanticCheck", () => {
- const D = this.projectService.getScriptInfoForNormalizedPath(T);
- D && this.regionSemanticCheck(T, C, h.map((P) => this.getRange({ file: T, ...P }, D))), this.changeSeq === o && t.immediate("semanticCheck", () => d(T, C));
- });
- t.immediate("semanticCheck", () => d(T, C));
- }
- };
- n.length > _ && this.changeSeq === o && t.delay("checkOne", i, g);
- }
- cleanProjects(t, n) {
- if (n) {
- this.logger.info(`cleaning ${t}`);
- for (const i of n)
- i.getLanguageService(
- /*ensureSynchronized*/
- !1
- ).cleanupSemanticCache(), i.cleanupProgram();
- }
- }
- cleanup() {
- this.cleanProjects("inferred projects", this.projectService.inferredProjects), this.cleanProjects("configured projects", as(this.projectService.configuredProjects.values())), this.cleanProjects("external projects", this.projectService.externalProjects), this.host.gc && (this.logger.info("host.gc()"), this.host.gc());
- }
- getEncodedSyntacticClassifications(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t);
- return i.getEncodedSyntacticClassifications(n, t);
- }
- getEncodedSemanticClassifications(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = t.format === "2020" ? "2020" : "original";
- return i.getLanguageService().getEncodedSemanticClassifications(n, t, s);
- }
- getProject(t) {
- return t === void 0 ? void 0 : this.projectService.findProject(t);
- }
- getConfigFileAndProject(t) {
- const n = this.getProject(t.projectFileName), i = Wo(t.file);
- return {
- configFile: n && n.hasConfigFile(i) ? i : void 0,
- project: n
- };
- }
- getConfigFileDiagnostics(t, n, i) {
- const s = n.getAllProjectErrors(), o = n.getLanguageService().getCompilerOptionsDiagnostics(), c = Ln(
- Qi(s, o),
- (_) => !!_.file && _.file.fileName === t
- );
- return i ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c) : lr(
- c,
- (_) => iN(
- _,
- /*includeFileName*/
- !1
- )
- );
- }
- convertToDiagnosticsWithLinePositionFromDiagnosticFile(t) {
- return t.map((n) => ({
- message: Em(n.messageText, this.host.newLine),
- start: n.start,
- // TODO: GH#18217
- length: n.length,
- // TODO: GH#18217
- category: U2(n),
- code: n.code,
- source: n.source,
- startLocation: n.file && z6(Qs(n.file, n.start)),
- // TODO: GH#18217
- endLocation: n.file && z6(Qs(n.file, n.start + n.length)),
- // TODO: GH#18217
- reportsUnnecessary: n.reportsUnnecessary,
- reportsDeprecated: n.reportsDeprecated,
- relatedInformation: lr(n.relatedInformation, tG)
- }));
- }
- getCompilerOptionsDiagnostics(t) {
- const n = this.getProject(t.projectFileName);
- return this.convertToDiagnosticsWithLinePosition(
- Ln(
- n.getLanguageService().getCompilerOptionsDiagnostics(),
- (i) => !i.file
- ),
- /*scriptInfo*/
- void 0
- );
- }
- convertToDiagnosticsWithLinePosition(t, n) {
- return t.map(
- (i) => ({
- message: Em(i.messageText, this.host.newLine),
- start: i.start,
- length: i.length,
- category: U2(i),
- code: i.code,
- source: i.source,
- startLocation: n && n.positionToLineOffset(i.start),
- // TODO: GH#18217
- endLocation: n && n.positionToLineOffset(i.start + i.length),
- reportsUnnecessary: i.reportsUnnecessary,
- reportsDeprecated: i.reportsDeprecated,
- relatedInformation: lr(i.relatedInformation, tG)
- })
- );
- }
- getDiagnosticsWorker(t, n, i, s) {
- const { project: o, file: c } = this.getFileAndProject(t);
- if (n && yPe(o, c))
- return hl;
- const _ = o.getScriptInfoForNormalizedPath(c), u = i(o, c);
- return s ? this.convertToDiagnosticsWithLinePosition(u, _) : u.map((d) => vPe(c, o, d));
- }
- getDefinition(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.getPositionInFile(t, i), c = this.mapDefinitionInfoLocations(s.getLanguageService().getDefinitionAtPosition(i, o) || hl, s);
- return n ? this.mapDefinitionInfo(c, s) : c.map(oX.mapToOriginalLocation);
- }
- mapDefinitionInfoLocations(t, n) {
- return t.map((i) => {
- const s = xPe(i, n);
- return s ? {
- ...s,
- containerKind: i.containerKind,
- containerName: i.containerName,
- kind: i.kind,
- name: i.name,
- failedAliasResolution: i.failedAliasResolution,
- ...i.unverified && { unverified: i.unverified }
- } : i;
- });
- }
- getDefinitionAndBoundSpan(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.getPositionInFile(t, i), c = E.checkDefined(s.getScriptInfo(i)), _ = s.getLanguageService().getDefinitionAndBoundSpan(i, o);
- if (!_ || !_.definitions)
- return {
- definitions: hl,
- textSpan: void 0
- // TODO: GH#18217
- };
- const u = this.mapDefinitionInfoLocations(_.definitions, s), { textSpan: d } = _;
- return n ? {
- definitions: this.mapDefinitionInfo(u, s),
- textSpan: Am(d, c)
- } : {
- definitions: u.map(oX.mapToOriginalLocation),
- textSpan: d
- };
- }
- findSourceDefinition(t) {
- var n;
- const { file: i, project: s } = this.getFileAndProject(t), o = this.getPositionInFile(t, i), c = s.getLanguageService().getDefinitionAtPosition(i, o);
- let _ = this.mapDefinitionInfoLocations(c || hl, s).slice();
- if (this.projectService.serverMode === 0 && (!ut(_, (T) => Wo(T.fileName) !== i && !T.isAmbient) || ut(_, (T) => !!T.failedAliasResolution))) {
- const T = gR(
- (I) => I.textSpan.start,
- hV(this.host.useCaseSensitiveFileNames)
- );
- _?.forEach((I) => T.add(I));
- const C = s.getNoDtsResolutionProject(i), D = C.getLanguageService(), P = (n = D.getDefinitionAtPosition(
- i,
- o,
- /*searchOtherFilesOnly*/
- !0,
- /*stopAtAlias*/
- !1
- )) == null ? void 0 : n.filter((I) => Wo(I.fileName) !== i);
- if (ut(P))
- for (const I of P) {
- if (I.unverified) {
- const F = h(I, s.getLanguageService().getProgram(), D.getProgram());
- if (ut(F)) {
- for (const O of F)
- T.add(O);
- continue;
- }
- }
- T.add(I);
- }
- else {
- const I = _.filter((F) => Wo(F.fileName) !== i && F.isAmbient);
- for (const F of ut(I) ? I : g()) {
- const O = d(F.fileName, i, C);
- if (!O) continue;
- const B = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
- O,
- C.currentDirectory,
- C.directoryStructureHost,
- /*deferredDeleteOk*/
- !1
- );
- if (!B) continue;
- C.containsScriptInfo(B) || (C.addRoot(B), C.updateGraph());
- const z = D.getProgram(), X = E.checkDefined(z.getSourceFile(O));
- for (const q of S(F.name, X, z))
- T.add(q);
- }
- }
- _ = as(T.values());
- }
- return _ = _.filter((T) => !T.isAmbient && !T.failedAliasResolution), this.mapDefinitionInfo(_, s);
- function d(T, C, D) {
- var P, I, F;
- const O = A5(T);
- if (O && T.lastIndexOf(Xg) === O.topLevelNodeModulesIndex) {
- const B = T.substring(0, O.packageRootIndex), z = (P = s.getModuleResolutionCache()) == null ? void 0 : P.getPackageJsonInfoCache(), X = s.getCompilationSettings(), q = CD(es(B, s.getCurrentDirectory()), kD(z, s, X));
- if (!q) return;
- const V = jz(
- q,
- {
- moduleResolution: 2
- /* Node10 */
- },
- s,
- s.getModuleResolutionCache()
- ), ae = T.substring(
- O.topLevelPackageNameIndex + 1,
- O.packageRootIndex
- ), ee = ED(EA(ae)), G = s.toPath(T);
- if (V && ut(V, (ue) => s.toPath(ue) === G))
- return (I = D.resolutionCache.resolveSingleModuleNameWithoutWatching(ee, C).resolvedModule) == null ? void 0 : I.resolvedFileName;
- {
- const ue = T.substring(O.packageRootIndex + 1), re = `${ee}/${$u(ue)}`;
- return (F = D.resolutionCache.resolveSingleModuleNameWithoutWatching(re, C).resolvedModule) == null ? void 0 : F.resolvedFileName;
- }
- }
- }
- function g() {
- const T = s.getLanguageService(), C = T.getProgram(), D = h_(C.getSourceFile(i), o);
- return (Xa(D) || Oe(D)) && xo(D.parent) && NK(D, (P) => {
- var I;
- if (P === D) return;
- const F = (I = T.getDefinitionAtPosition(
- i,
- P.getStart(),
- /*searchOtherFilesOnly*/
- !0,
- /*stopAtAlias*/
- !1
- )) == null ? void 0 : I.filter((O) => Wo(O.fileName) !== i && O.isAmbient).map((O) => ({
- fileName: O.fileName,
- name: Jp(D)
- }));
- if (ut(F))
- return F;
- }) || hl;
- }
- function h(T, C, D) {
- var P;
- const I = D.getSourceFile(T.fileName);
- if (!I)
- return;
- const F = h_(C.getSourceFile(i), o), O = C.getTypeChecker().getSymbolAtLocation(F), B = O && Jo(
- O,
- 276
- /* ImportSpecifier */
- );
- if (!B) return;
- const z = ((P = B.propertyName) == null ? void 0 : P.text) || B.name.text;
- return S(z, I, D);
- }
- function S(T, C, D) {
- const P = Eo.Core.getTopMostDeclarationNamesInFile(T, C);
- return Ai(P, (I) => {
- const F = D.getTypeChecker().getSymbolAtLocation(I), O = S4(I);
- if (F && O)
- return L6.createDefinitionInfo(
- O,
- D.getTypeChecker(),
- F,
- O,
- /*unverified*/
- !0
- );
- });
- }
- }
- getEmitOutput(t) {
- const { file: n, project: i } = this.getFileAndProject(t);
- if (!i.shouldEmitFile(i.getScriptInfo(n)))
- return { emitSkipped: !0, outputFiles: [], diagnostics: [] };
- const s = i.getLanguageService().getEmitOutput(n);
- return t.richResponse ? {
- ...s,
- diagnostics: t.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(s.diagnostics) : s.diagnostics.map((o) => iN(
- o,
- /*includeFileName*/
- !0
- ))
- } : s;
- }
- mapJSDocTagInfo(t, n, i) {
- return t ? t.map((s) => {
- var o;
- return {
- ...s,
- text: i ? this.mapDisplayParts(s.text, n) : (o = s.text) == null ? void 0 : o.map((c) => c.text).join("")
- };
- }) : [];
- }
- mapDisplayParts(t, n) {
- return t ? t.map(
- (i) => i.kind !== "linkName" ? i : {
- ...i,
- target: this.toFileSpan(i.target.fileName, i.target.textSpan, n)
- }
- ) : [];
- }
- mapSignatureHelpItems(t, n, i) {
- return t.map((s) => ({
- ...s,
- documentation: this.mapDisplayParts(s.documentation, n),
- parameters: s.parameters.map((o) => ({ ...o, documentation: this.mapDisplayParts(o.documentation, n) })),
- tags: this.mapJSDocTagInfo(s.tags, n, i)
- }));
- }
- mapDefinitionInfo(t, n) {
- return t.map((i) => ({ ...this.toFileSpanWithContext(i.fileName, i.textSpan, i.contextSpan, n), ...i.unverified && { unverified: i.unverified } }));
- }
- /*
- * When we map a .d.ts location to .ts, Visual Studio gets confused because there's no associated Roslyn Document in
- * the same project which corresponds to the file. VS Code has no problem with this, and luckily we have two protocols.
- * This retains the existing behavior for the "simplified" (VS Code) protocol but stores the .d.ts location in a
- * set of additional fields, and does the reverse for VS (store the .d.ts location where
- * it used to be and stores the .ts location in the additional fields).
- */
- static mapToOriginalLocation(t) {
- return t.originalFileName ? (E.assert(t.originalTextSpan !== void 0, "originalTextSpan should be present if originalFileName is"), {
- ...t,
- fileName: t.originalFileName,
- textSpan: t.originalTextSpan,
- targetFileName: t.fileName,
- targetTextSpan: t.textSpan,
- contextSpan: t.originalContextSpan,
- targetContextSpan: t.contextSpan
- }) : t;
- }
- toFileSpan(t, n, i) {
- const s = i.getLanguageService(), o = s.toLineColumnOffset(t, n.start), c = s.toLineColumnOffset(t, ec(n));
- return {
- file: t,
- start: { line: o.line + 1, offset: o.character + 1 },
- end: { line: c.line + 1, offset: c.character + 1 }
- };
- }
- toFileSpanWithContext(t, n, i, s) {
- const o = this.toFileSpan(t, n, s), c = i && this.toFileSpan(t, i, s);
- return c ? { ...o, contextStart: c.start, contextEnd: c.end } : o;
- }
- getTypeDefinition(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.getPositionInFile(t, n), o = this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(n, s) || hl, i);
- return this.mapDefinitionInfo(o, i);
- }
- mapImplementationLocations(t, n) {
- return t.map((i) => {
- const s = xPe(i, n);
- return s ? {
- ...s,
- kind: i.kind,
- displayParts: i.displayParts
- } : i;
- });
- }
- getImplementation(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.getPositionInFile(t, i), c = this.mapImplementationLocations(s.getLanguageService().getImplementationAtPosition(i, o) || hl, s);
- return n ? c.map(({ fileName: _, textSpan: u, contextSpan: d }) => this.toFileSpanWithContext(_, u, d, s)) : c.map(oX.mapToOriginalLocation);
- }
- getSyntacticDiagnosticsSync(t) {
- const { configFile: n } = this.getConfigFileAndProject(t);
- return n ? hl : this.getDiagnosticsWorker(
- t,
- /*isSemantic*/
- !1,
- (i, s) => i.getLanguageService().getSyntacticDiagnostics(s),
- !!t.includeLinePosition
- );
- }
- getSemanticDiagnosticsSync(t) {
- const { configFile: n, project: i } = this.getConfigFileAndProject(t);
- return n ? this.getConfigFileDiagnostics(n, i, !!t.includeLinePosition) : this.getDiagnosticsWorker(
- t,
- /*isSemantic*/
- !0,
- (s, o) => s.getLanguageService().getSemanticDiagnostics(o).filter((c) => !!c.file),
- !!t.includeLinePosition
- );
- }
- getSuggestionDiagnosticsSync(t) {
- const { configFile: n } = this.getConfigFileAndProject(t);
- return n ? hl : this.getDiagnosticsWorker(
- t,
- /*isSemantic*/
- !0,
- (i, s) => i.getLanguageService().getSuggestionDiagnostics(s),
- !!t.includeLinePosition
- );
- }
- getJsxClosingTag(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n), o = i.getJsxClosingTagAtPosition(n, s);
- return o === void 0 ? void 0 : { newText: o.newText, caretOffset: 0 };
- }
- getLinkedEditingRange(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n), o = i.getLinkedEditingRangeAtPosition(n, s), c = this.projectService.getScriptInfoForNormalizedPath(n);
- if (!(c === void 0 || o === void 0))
- return jZe(o, c);
- }
- getDocumentHighlights(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.getPositionInFile(t, i), c = s.getLanguageService().getDocumentHighlights(i, o, t.filesToSearch);
- return c ? n ? c.map(({ fileName: _, highlightSpans: u }) => {
- const d = s.getScriptInfo(_);
- return {
- file: _,
- highlightSpans: u.map(({ textSpan: g, kind: h, contextSpan: S }) => ({
- ...y_e(g, S, d),
- kind: h
- }))
- };
- }) : c : hl;
- }
- provideInlayHints(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.projectService.getScriptInfoForNormalizedPath(n);
- return i.getLanguageService().provideInlayHints(n, t, this.getPreferences(n)).map((c) => {
- const { position: _, displayParts: u } = c;
- return {
- ...c,
- position: s.positionToLineOffset(_),
- displayParts: u?.map(({ text: d, span: g, file: h }) => {
- if (g) {
- E.assertIsDefined(h, "Target file should be defined together with its span.");
- const S = this.projectService.getScriptInfo(h);
- return {
- text: d,
- span: {
- start: S.positionToLineOffset(g.start),
- end: S.positionToLineOffset(g.start + g.length),
- file: h
- }
- };
- } else
- return { text: d };
- })
- };
- });
- }
- mapCode(t) {
- var n;
- const i = this.getHostFormatOptions(), s = this.getHostPreferences(), { file: o, languageService: c } = this.getFileAndLanguageServiceForSyntacticOperation(t), _ = this.projectService.getScriptInfoForNormalizedPath(o), u = (n = t.mapping.focusLocations) == null ? void 0 : n.map((g) => g.map((h) => {
- const S = _.lineOffsetToPosition(h.start.line, h.start.offset), T = _.lineOffsetToPosition(h.end.line, h.end.offset);
- return {
- start: S,
- length: T - S
- };
- })), d = c.mapCode(o, t.mapping.contents, u, i, s);
- return this.mapTextChangesToCodeEdits(d);
- }
- setCompilerOptionsForInferredProjects(t) {
- this.projectService.setCompilerOptionsForInferredProjects(t.options, t.projectRootPath);
- }
- getProjectInfo(t) {
- return this.getProjectInfoWorker(
- t.file,
- t.projectFileName,
- t.needFileNameList,
- /*excludeConfigFiles*/
- !1
- );
- }
- getProjectInfoWorker(t, n, i, s) {
- const { project: o } = this.getFileAndProjectWorker(t, n);
- return gp(o), {
- configFileName: o.getProjectName(),
- languageServiceDisabled: !o.languageServiceEnabled,
- fileNames: i ? o.getFileNames(
- /*excludeFilesFromExternalLibraries*/
- !1,
- s
- ) : void 0
- };
- }
- getRenameInfo(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.getPositionInFile(t, n), o = this.getPreferences(n);
- return i.getLanguageService().getRenameInfo(n, s, o);
- }
- getProjects(t, n, i) {
- let s, o;
- if (t.projectFileName) {
- const c = this.getProject(t.projectFileName);
- c && (s = [c]);
- } else {
- const c = n ? this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file) : this.projectService.getScriptInfo(t.file);
- if (c)
- n || this.projectService.ensureDefaultProjectForFile(c);
- else return i ? hl : (this.projectService.logErrorForScriptInfoNotFound(t.file), Wh.ThrowNoProject());
- s = c.containingProjects, o = this.projectService.getSymlinkedProjects(c);
- }
- return s = Ln(s, (c) => c.languageServiceEnabled && !c.isOrphan()), !i && (!s || !s.length) && !o ? (this.projectService.logErrorForScriptInfoNotFound(t.file ?? t.projectFileName), Wh.ThrowNoProject()) : o ? { projects: s, symLinkedProjects: o } : s;
- }
- getDefaultProject(t) {
- if (t.projectFileName) {
- const i = this.getProject(t.projectFileName);
- if (i)
- return i;
- if (!t.file)
- return Wh.ThrowNoProject();
- }
- return this.projectService.getScriptInfo(t.file).getDefaultProject();
- }
- getRenameLocations(t, n) {
- const i = Wo(t.file), s = this.getPositionInFile(t, i), o = this.getProjects(t), c = this.getDefaultProject(t), _ = this.getPreferences(i), u = this.mapRenameInfo(
- c.getLanguageService().getRenameInfo(i, s, _),
- E.checkDefined(this.projectService.getScriptInfo(i))
- );
- if (!u.canRename) return n ? { info: u, locs: [] } : [];
- const d = AZe(
- o,
- c,
- { fileName: t.file, pos: s },
- !!t.findInStrings,
- !!t.findInComments,
- _,
- this.host.useCaseSensitiveFileNames
- );
- return n ? { info: u, locs: this.toSpanGroups(d) } : d;
- }
- mapRenameInfo(t, n) {
- if (t.canRename) {
- const { canRename: i, fileToRename: s, displayName: o, fullDisplayName: c, kind: _, kindModifiers: u, triggerSpan: d } = t;
- return { canRename: i, fileToRename: s, displayName: o, fullDisplayName: c, kind: _, kindModifiers: u, triggerSpan: Am(d, n) };
- } else
- return t;
- }
- toSpanGroups(t) {
- const n = /* @__PURE__ */ new Map();
- for (const { fileName: i, textSpan: s, contextSpan: o, originalContextSpan: c, originalTextSpan: _, originalFileName: u, ...d } of t) {
- let g = n.get(i);
- g || n.set(i, g = { file: i, locs: [] });
- const h = E.checkDefined(this.projectService.getScriptInfo(i));
- g.locs.push({ ...y_e(s, o, h), ...d });
- }
- return as(n.values());
- }
- getReferences(t, n) {
- const i = Wo(t.file), s = this.getProjects(t), o = this.getPositionInFile(t, i), c = IZe(
- s,
- this.getDefaultProject(t),
- { fileName: t.file, pos: o },
- this.host.useCaseSensitiveFileNames,
- this.logger
- );
- if (!n) return c;
- const _ = this.getPreferences(i), u = this.getDefaultProject(t), d = u.getScriptInfoForNormalizedPath(i), g = u.getLanguageService().getQuickInfoAtPosition(i, o), h = g ? P8(g.displayParts) : "", S = g && g.textSpan, T = S ? d.positionToLineOffset(S.start).offset : 0, C = S ? d.getSnapshot().getText(S.start, ec(S)) : "";
- return { refs: ta(c, (P) => P.references.map((I) => PPe(this.projectService, I, _))), symbolName: C, symbolStartOffset: T, symbolDisplayString: h };
- }
- getFileReferences(t, n) {
- const i = this.getProjects(t), s = t.file, o = this.getPreferences(Wo(s)), c = [], _ = rG(this.host.useCaseSensitiveFileNames);
- return h_e(
- i,
- /*path*/
- void 0,
- (d) => {
- if (d.getCancellationToken().isCancellationRequested()) return;
- const g = d.getLanguageService().getFileReferences(s);
- if (g)
- for (const h of g)
- _.has(h) || (c.push(h), _.add(h));
- }
- ), n ? {
- refs: c.map((d) => PPe(this.projectService, d, o)),
- symbolName: `"${t.file}"`
- } : c;
- }
- /**
- * @param fileName is the name of the file to be opened
- * @param fileContent is a version of the file content that is known to be more up to date than the one on disk
- */
- openClientFile(t, n, i, s) {
- this.projectService.openClientFileWithNormalizedPath(
- t,
- n,
- i,
- /*hasMixedContent*/
- !1,
- s
- );
- }
- getPosition(t, n) {
- return t.position !== void 0 ? t.position : n.lineOffsetToPosition(t.line, t.offset);
- }
- getPositionInFile(t, n) {
- const i = this.projectService.getScriptInfoForNormalizedPath(n);
- return this.getPosition(t, i);
- }
- getFileAndProject(t) {
- return this.getFileAndProjectWorker(t.file, t.projectFileName);
- }
- getFileAndLanguageServiceForSyntacticOperation(t) {
- const { file: n, project: i } = this.getFileAndProject(t);
- return {
- file: n,
- languageService: i.getLanguageService(
- /*ensureSynchronized*/
- !1
- )
- };
- }
- getFileAndProjectWorker(t, n) {
- const i = Wo(t), s = this.getProject(n) || this.projectService.ensureDefaultProjectForFile(i);
- return { file: i, project: s };
- }
- getOutliningSpans(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = s.getOutliningSpans(i);
- if (n) {
- const c = this.projectService.getScriptInfoForNormalizedPath(i);
- return o.map((_) => ({
- textSpan: Am(_.textSpan, c),
- hintSpan: Am(_.hintSpan, c),
- bannerText: _.bannerText,
- autoCollapse: _.autoCollapse,
- kind: _.kind
- }));
- } else
- return o;
- }
- getTodoComments(t) {
- const { file: n, project: i } = this.getFileAndProject(t);
- return i.getLanguageService().getTodoComments(n, t.descriptors);
- }
- getDocCommentTemplate(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n);
- return i.getDocCommentTemplateAtPosition(n, s, this.getPreferences(n), this.getFormatOptions(n));
- }
- getSpanOfEnclosingComment(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = t.onlyMultiLine, o = this.getPositionInFile(t, n);
- return i.getSpanOfEnclosingComment(n, o, s);
- }
- getIndentation(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n), o = t.options ? J6(t.options) : this.getFormatOptions(n), c = i.getIndentationAtPosition(n, s, o);
- return { position: s, indentation: c };
- }
- getBreakpointStatement(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n);
- return i.getBreakpointStatementAtPosition(n, s);
- }
- getNameOrDottedNameSpan(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n);
- return i.getNameOrDottedNameSpan(n, s, s);
- }
- isValidBraceCompletion(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.getPositionInFile(t, n);
- return i.isValidBraceCompletionAtPosition(n, s, t.openingBrace.charCodeAt(0));
- }
- getQuickInfoWorker(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = s.getLanguageService().getQuickInfoAtPosition(i, this.getPosition(t, o));
- if (!c)
- return;
- const _ = !!this.getPreferences(i).displayPartsForJSDoc;
- if (n) {
- const u = P8(c.displayParts);
- return {
- kind: c.kind,
- kindModifiers: c.kindModifiers,
- start: o.positionToLineOffset(c.textSpan.start),
- end: o.positionToLineOffset(ec(c.textSpan)),
- displayString: u,
- documentation: _ ? this.mapDisplayParts(c.documentation, s) : P8(c.documentation),
- tags: this.mapJSDocTagInfo(c.tags, s, _)
- };
- } else
- return _ ? c : {
- ...c,
- tags: this.mapJSDocTagInfo(
- c.tags,
- s,
- /*richResponse*/
- !1
- )
- };
- }
- getFormattingEditsForRange(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.projectService.getScriptInfoForNormalizedPath(n), o = s.lineOffsetToPosition(t.line, t.offset), c = s.lineOffsetToPosition(t.endLine, t.endOffset), _ = i.getFormattingEditsForRange(n, o, c, this.getFormatOptions(n));
- if (_)
- return _.map((u) => this.convertTextChangeToCodeEdit(u, s));
- }
- getFormattingEditsForRangeFull(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = t.options ? J6(t.options) : this.getFormatOptions(n);
- return i.getFormattingEditsForRange(n, t.position, t.endPosition, s);
- }
- getFormattingEditsForDocumentFull(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = t.options ? J6(t.options) : this.getFormatOptions(n);
- return i.getFormattingEditsForDocument(n, s);
- }
- getFormattingEditsAfterKeystrokeFull(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = t.options ? J6(t.options) : this.getFormatOptions(n);
- return i.getFormattingEditsAfterKeystroke(n, t.position, t.key, s);
- }
- getFormattingEditsAfterKeystroke(t) {
- const { file: n, languageService: i } = this.getFileAndLanguageServiceForSyntacticOperation(t), s = this.projectService.getScriptInfoForNormalizedPath(n), o = s.lineOffsetToPosition(t.line, t.offset), c = this.getFormatOptions(n), _ = i.getFormattingEditsAfterKeystroke(n, o, t.key, c);
- if (t.key === `
-` && (!_ || _.length === 0 || DZe(_, o))) {
- const { lineText: u, absolutePosition: d } = s.textStorage.getAbsolutePositionAndLineText(t.line);
- if (u && u.search("\\S") < 0) {
- const g = i.getIndentationAtPosition(n, o, c);
- let h = 0, S, T;
- for (S = 0, T = u.length; S < T; S++)
- if (u.charAt(S) === " ")
- h++;
- else if (u.charAt(S) === " ")
- h += c.tabSize;
- else
- break;
- if (g !== h) {
- const C = d + S;
- _.push({
- span: kc(d, C),
- newText: Yc.getIndentationString(g, c)
- });
- }
- }
- }
- if (_)
- return _.map((u) => ({
- start: s.positionToLineOffset(u.span.start),
- end: s.positionToLineOffset(ec(u.span)),
- newText: u.newText ? u.newText : ""
- }));
- }
- getCompletions(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getPosition(t, o), _ = s.getLanguageService().getCompletionsAtPosition(
- i,
- c,
- {
- ...t_e(this.getPreferences(i)),
- triggerCharacter: t.triggerCharacter,
- triggerKind: t.triggerKind,
- includeExternalModuleExports: t.includeExternalModuleExports,
- includeInsertTextCompletions: t.includeInsertTextCompletions
- },
- s.projectService.getFormatCodeOptions(i)
- );
- if (_ === void 0) return;
- if (n === "completions-full") return _;
- const u = t.prefix || "", d = Ai(_.entries, (h) => {
- if (_.isMemberCompletion || Ui(h.name.toLowerCase(), u.toLowerCase())) {
- const S = h.replacementSpan ? Am(h.replacementSpan, o) : void 0;
- return {
- ...h,
- replacementSpan: S,
- hasAction: h.hasAction || void 0,
- symbol: void 0
- };
- }
- });
- return n === "completions" ? (_.metadata && (d.metadata = _.metadata), d) : {
- ..._,
- optionalReplacementSpan: _.optionalReplacementSpan && Am(_.optionalReplacementSpan, o),
- entries: d
- };
- }
- getCompletionEntryDetails(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getPosition(t, o), _ = s.projectService.getFormatCodeOptions(i), u = !!this.getPreferences(i).displayPartsForJSDoc, d = Ai(t.entryNames, (g) => {
- const { name: h, source: S, data: T } = typeof g == "string" ? { name: g, source: void 0, data: void 0 } : g;
- return s.getLanguageService().getCompletionEntryDetails(i, c, h, _, S, this.getPreferences(i), T ? Bs(T, UZe) : void 0);
- });
- return n ? u ? d : d.map((g) => ({ ...g, tags: this.mapJSDocTagInfo(
- g.tags,
- s,
- /*richResponse*/
- !1
- ) })) : d.map((g) => ({
- ...g,
- codeActions: lr(g.codeActions, (h) => this.mapCodeAction(h)),
- documentation: this.mapDisplayParts(g.documentation, s),
- tags: this.mapJSDocTagInfo(g.tags, s, u)
- }));
- }
- getCompileOnSaveAffectedFileList(t) {
- const n = this.getProjects(
- t,
- /*getScriptInfoEnsuringProjectsUptoDate*/
- !0,
- /*ignoreNoProjectError*/
- !0
- ), i = this.projectService.getScriptInfo(t.file);
- return i ? wZe(
- i,
- (s) => this.projectService.getScriptInfoForPath(s),
- n,
- (s, o) => {
- if (!s.compileOnSaveEnabled || !s.languageServiceEnabled || s.isOrphan())
- return;
- const c = s.getCompilationSettings();
- if (!(c.noEmit || wl(o.fileName) && !EZe(c)))
- return {
- projectFileName: s.getProjectName(),
- fileNames: s.getCompileOnSaveAffectedFileList(o),
- projectUsesOutFile: !!c.outFile
- };
- }
- ) : hl;
- }
- emitFile(t) {
- const { file: n, project: i } = this.getFileAndProject(t);
- if (i || Wh.ThrowNoProject(), !i.languageServiceEnabled)
- return t.richResponse ? { emitSkipped: !0, diagnostics: [] } : !1;
- const s = i.getScriptInfo(n), { emitSkipped: o, diagnostics: c } = i.emitFile(s, (_, u, d) => this.host.writeFile(_, u, d));
- return t.richResponse ? {
- emitSkipped: o,
- diagnostics: t.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c) : c.map((_) => iN(
- _,
- /*includeFileName*/
- !0
- ))
- } : !o;
- }
- getSignatureHelpItems(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getPosition(t, o), _ = s.getLanguageService().getSignatureHelpItems(i, c, t), u = !!this.getPreferences(i).displayPartsForJSDoc;
- if (_ && n) {
- const d = _.applicableSpan;
- return {
- ..._,
- applicableSpan: {
- start: o.positionToLineOffset(d.start),
- end: o.positionToLineOffset(d.start + d.length)
- },
- items: this.mapSignatureHelpItems(_.items, s, u)
- };
- } else return u || !_ ? _ : {
- ..._,
- items: _.items.map((d) => ({ ...d, tags: this.mapJSDocTagInfo(
- d.tags,
- s,
- /*richResponse*/
- !1
- ) }))
- };
- }
- toPendingErrorCheck(t) {
- const n = Wo(t), i = this.projectService.tryGetDefaultProjectForFile(n);
- return i && { fileName: n, project: i };
- }
- getDiagnostics(t, n, i) {
- this.suppressDiagnosticEvents || i.length > 0 && this.updateErrorCheck(t, i, n);
- }
- change(t) {
- const n = this.projectService.getScriptInfo(t.file);
- E.assert(!!n), n.textStorage.switchToScriptVersionCache();
- const i = n.lineOffsetToPosition(t.line, t.offset), s = n.lineOffsetToPosition(t.endLine, t.endOffset);
- i >= 0 && (this.changeSeq++, this.projectService.applyChangesToFile(
- n,
- pX({
- span: { start: i, length: s - i },
- newText: t.insertString
- // TODO: GH#18217
- })
- ));
- }
- reload(t) {
- const n = Wo(t.file), i = t.tmpfile === void 0 ? void 0 : Wo(t.tmpfile), s = this.projectService.getScriptInfoForNormalizedPath(n);
- s && (this.changeSeq++, s.reloadFromFile(i));
- }
- saveToTmp(t, n) {
- const i = this.projectService.getScriptInfo(t);
- i && i.saveTo(n);
- }
- closeClientFile(t) {
- if (!t)
- return;
- const n = Os(t);
- this.projectService.closeClientFile(n);
- }
- mapLocationNavigationBarItems(t, n) {
- return lr(t, (i) => ({
- text: i.text,
- kind: i.kind,
- kindModifiers: i.kindModifiers,
- spans: i.spans.map((s) => Am(s, n)),
- childItems: this.mapLocationNavigationBarItems(i.childItems, n),
- indent: i.indent
- }));
- }
- getNavigationBarItems(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = s.getNavigationBarItems(i);
- return o ? n ? this.mapLocationNavigationBarItems(o, this.projectService.getScriptInfoForNormalizedPath(i)) : o : void 0;
- }
- toLocationNavigationTree(t, n) {
- return {
- text: t.text,
- kind: t.kind,
- kindModifiers: t.kindModifiers,
- spans: t.spans.map((i) => Am(i, n)),
- nameSpan: t.nameSpan && Am(t.nameSpan, n),
- childItems: lr(t.childItems, (i) => this.toLocationNavigationTree(i, n))
- };
- }
- getNavigationTree(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = s.getNavigationTree(i);
- return o ? n ? this.toLocationNavigationTree(o, this.projectService.getScriptInfoForNormalizedPath(i)) : o : void 0;
- }
- getNavigateToItems(t, n) {
- const i = this.getFullNavigateToItems(t);
- return n ? ta(
- i,
- ({ project: s, navigateToItems: o }) => o.map((c) => {
- const _ = s.getScriptInfo(c.fileName), u = {
- name: c.name,
- kind: c.kind,
- kindModifiers: c.kindModifiers,
- isCaseSensitive: c.isCaseSensitive,
- matchKind: c.matchKind,
- file: c.fileName,
- start: _.positionToLineOffset(c.textSpan.start),
- end: _.positionToLineOffset(ec(c.textSpan))
- };
- return c.kindModifiers && c.kindModifiers !== "" && (u.kindModifiers = c.kindModifiers), c.containerName && c.containerName.length > 0 && (u.containerName = c.containerName), c.containerKind && c.containerKind.length > 0 && (u.containerKind = c.containerKind), u;
- })
- ) : ta(i, ({ navigateToItems: s }) => s);
- }
- getFullNavigateToItems(t) {
- const { currentFileOnly: n, searchValue: i, maxResultCount: s, projectFileName: o } = t;
- if (n) {
- E.assertIsDefined(t.file);
- const { file: S, project: T } = this.getFileAndProject(t);
- return [{ project: T, navigateToItems: T.getLanguageService().getNavigateToItems(i, s, S) }];
- }
- const c = this.getHostPreferences(), _ = [], u = /* @__PURE__ */ new Map();
- if (!t.file && !o)
- this.projectService.loadAncestorProjectTree(), this.projectService.forEachEnabledProject((S) => d(S));
- else {
- const S = this.getProjects(t);
- h_e(
- S,
- /*path*/
- void 0,
- (T) => d(T)
- );
- }
- return _;
- function d(S) {
- const T = S.getLanguageService().getNavigateToItems(
- i,
- s,
- /*fileName*/
- void 0,
- /*excludeDts*/
- S.isNonTsProject(),
- /*excludeLibFiles*/
- c.excludeLibrarySymbolsInNavTo
- ), C = Ln(T, (D) => g(D) && !nG(mP(D), S));
- C.length && _.push({ project: S, navigateToItems: C });
- }
- function g(S) {
- const T = S.name;
- if (!u.has(T))
- return u.set(T, [S]), !0;
- const C = u.get(T);
- for (const D of C)
- if (h(D, S))
- return !1;
- return C.push(S), !0;
- }
- function h(S, T) {
- return S === T ? !0 : !S || !T ? !1 : S.containerKind === T.containerKind && S.containerName === T.containerName && S.fileName === T.fileName && S.isCaseSensitive === T.isCaseSensitive && S.kind === T.kind && S.kindModifiers === T.kindModifiers && S.matchKind === T.matchKind && S.name === T.name && S.textSpan.start === T.textSpan.start && S.textSpan.length === T.textSpan.length;
- }
- }
- getSupportedCodeFixes(t) {
- if (!t) return xq();
- if (t.file) {
- const { file: i, project: s } = this.getFileAndProject(t);
- return s.getLanguageService().getSupportedCodeFixes(i);
- }
- const n = this.getProject(t.projectFileName);
- return n || Wh.ThrowNoProject(), n.getLanguageService().getSupportedCodeFixes();
- }
- isLocation(t) {
- return t.line !== void 0;
- }
- extractPositionOrRange(t, n) {
- let i, s;
- return this.isLocation(t) ? i = o(t) : s = this.getRange(t, n), E.checkDefined(i === void 0 ? s : i);
- function o(c) {
- return c.position !== void 0 ? c.position : n.lineOffsetToPosition(c.line, c.offset);
- }
- }
- getRange(t, n) {
- const { startPosition: i, endPosition: s } = this.getStartAndEndPosition(t, n);
- return { pos: i, end: s };
- }
- getApplicableRefactors(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = i.getScriptInfoForNormalizedPath(n);
- return i.getLanguageService().getApplicableRefactors(n, this.extractPositionOrRange(t, s), this.getPreferences(n), t.triggerReason, t.kind, t.includeInteractiveActions).map((c) => ({ ...c, actions: c.actions.map((_) => ({ ..._, range: _.range ? { start: z6({ line: _.range.start.line, character: _.range.start.offset }), end: z6({ line: _.range.end.line, character: _.range.end.offset }) } : void 0 })) }));
- }
- getEditsForRefactor(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = s.getScriptInfoForNormalizedPath(i), c = s.getLanguageService().getEditsForRefactor(
- i,
- this.getFormatOptions(i),
- this.extractPositionOrRange(t, o),
- t.refactor,
- t.action,
- this.getPreferences(i),
- t.interactiveRefactorArguments
- );
- if (c === void 0)
- return {
- edits: []
- };
- if (n) {
- const { renameFilename: _, renameLocation: u, edits: d } = c;
- let g;
- if (_ !== void 0 && u !== void 0) {
- const h = s.getScriptInfoForNormalizedPath(Wo(_));
- g = v_e(Yx(h.getSnapshot()), _, u, d);
- }
- return {
- renameLocation: g,
- renameFilename: _,
- edits: this.mapTextChangesToCodeEdits(d),
- notApplicableReason: c.notApplicableReason
- };
- }
- return c;
- }
- getMoveToRefactoringFileSuggestions(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = i.getScriptInfoForNormalizedPath(n);
- return i.getLanguageService().getMoveToRefactoringFileSuggestions(n, this.extractPositionOrRange(t, s), this.getPreferences(n));
- }
- getPasteEdits(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = t.copiedFrom ? { file: t.copiedFrom.file, range: t.copiedFrom.spans.map((c) => this.getRange({ file: t.copiedFrom.file, startLine: c.start.line, startOffset: c.start.offset, endLine: c.end.line, endOffset: c.end.offset }, i.getScriptInfoForNormalizedPath(Wo(t.copiedFrom.file)))) } : void 0, o = i.getLanguageService().getPasteEdits(
- {
- targetFile: n,
- pastedText: t.pastedText,
- pasteLocations: t.pasteLocations.map((c) => this.getRange({ file: n, startLine: c.start.line, startOffset: c.start.offset, endLine: c.end.line, endOffset: c.end.offset }, i.getScriptInfoForNormalizedPath(n))),
- copiedFrom: s,
- preferences: this.getPreferences(n)
- },
- this.getFormatOptions(n)
- );
- return o && this.mapPasteEditsAction(o);
- }
- organizeImports(t, n) {
- E.assert(t.scope.type === "file");
- const { file: i, project: s } = this.getFileAndProject(t.scope.args), o = s.getLanguageService().organizeImports(
- {
- fileName: i,
- mode: t.mode ?? (t.skipDestructiveCodeActions ? "SortAndCombine" : void 0),
- type: "file"
- },
- this.getFormatOptions(i),
- this.getPreferences(i)
- );
- return n ? this.mapTextChangesToCodeEdits(o) : o;
- }
- getEditsForFileRename(t, n) {
- const i = Wo(t.oldFilePath), s = Wo(t.newFilePath), o = this.getHostFormatOptions(), c = this.getHostPreferences(), _ = /* @__PURE__ */ new Set(), u = [];
- return this.projectService.loadAncestorProjectTree(), this.projectService.forEachEnabledProject((d) => {
- const g = d.getLanguageService().getEditsForFileRename(i, s, o, c), h = [];
- for (const S of g)
- _.has(S.fileName) || (u.push(S), h.push(S.fileName));
- for (const S of h)
- _.add(S);
- }), n ? u.map((d) => this.mapTextChangeToCodeEdit(d)) : u;
- }
- getCodeFixes(t, n) {
- const { file: i, project: s } = this.getFileAndProject(t), o = s.getScriptInfoForNormalizedPath(i), { startPosition: c, endPosition: _ } = this.getStartAndEndPosition(t, o);
- let u;
- try {
- u = s.getLanguageService().getCodeFixesAtPosition(i, c, _, t.errorCodes, this.getFormatOptions(i), this.getPreferences(i));
- } catch (d) {
- const g = s.getLanguageService(), h = [
- ...g.getSyntacticDiagnostics(i),
- ...g.getSemanticDiagnostics(i),
- ...g.getSuggestionDiagnostics(i)
- ].map(
- (T) => Sw(c, _ - c, T.start, T.length) && T.code
- ), S = t.errorCodes.find((T) => !h.includes(T));
- throw S !== void 0 && (d.message = `BADCLIENT: Bad error code, ${S} not found in range ${c}..${_} (found: ${h.join(", ")}); could have caused this error:
-${d.message}`), d;
- }
- return n ? u.map((d) => this.mapCodeFixAction(d)) : u;
- }
- getCombinedCodeFix({ scope: t, fixId: n }, i) {
- E.assert(t.type === "file");
- const { file: s, project: o } = this.getFileAndProject(t.args), c = o.getLanguageService().getCombinedCodeFix({ type: "file", fileName: s }, n, this.getFormatOptions(s), this.getPreferences(s));
- return i ? { changes: this.mapTextChangesToCodeEdits(c.changes), commands: c.commands } : c;
- }
- applyCodeActionCommand(t) {
- const n = t.command;
- for (const i of FT(n)) {
- const { file: s, project: o } = this.getFileAndProject(i);
- o.getLanguageService().applyCodeActionCommand(i, this.getFormatOptions(s)).then(
- (c) => {
- },
- (c) => {
- }
- );
- }
- return {};
- }
- getStartAndEndPosition(t, n) {
- let i, s;
- return t.startPosition !== void 0 ? i = t.startPosition : (i = n.lineOffsetToPosition(t.startLine, t.startOffset), t.startPosition = i), t.endPosition !== void 0 ? s = t.endPosition : (s = n.lineOffsetToPosition(t.endLine, t.endOffset), t.endPosition = s), { startPosition: i, endPosition: s };
- }
- mapCodeAction({ description: t, changes: n, commands: i }) {
- return { description: t, changes: this.mapTextChangesToCodeEdits(n), commands: i };
- }
- mapCodeFixAction({ fixName: t, description: n, changes: i, commands: s, fixId: o, fixAllDescription: c }) {
- return { fixName: t, description: n, changes: this.mapTextChangesToCodeEdits(i), commands: s, fixId: o, fixAllDescription: c };
- }
- mapPasteEditsAction({ edits: t, fixId: n }) {
- return { edits: this.mapTextChangesToCodeEdits(t), fixId: n };
- }
- mapTextChangesToCodeEdits(t) {
- return t.map((n) => this.mapTextChangeToCodeEdit(n));
- }
- mapTextChangeToCodeEdit(t) {
- const n = this.projectService.getScriptInfoOrConfig(t.fileName);
- return !!t.isNewFile == !!n && (n || this.projectService.logErrorForScriptInfoNotFound(t.fileName), E.fail("Expected isNewFile for (only) new files. " + JSON.stringify({ isNewFile: !!t.isNewFile, hasScriptInfo: !!n }))), n ? { fileName: t.fileName, textChanges: t.textChanges.map((i) => RZe(i, n)) } : JZe(t);
- }
- convertTextChangeToCodeEdit(t, n) {
- return {
- start: n.positionToLineOffset(t.span.start),
- end: n.positionToLineOffset(t.span.start + t.span.length),
- newText: t.newText ? t.newText : ""
- };
- }
- getBraceMatching(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getPosition(t, o), _ = s.getBraceMatchingAtPosition(i, c);
- return _ ? n ? _.map((u) => Am(u, o)) : _ : void 0;
- }
- getDiagnosticsForProject(t, n, i) {
- if (this.suppressDiagnosticEvents)
- return;
- const { fileNames: s, languageServiceDisabled: o } = this.getProjectInfoWorker(
- i,
- /*projectFileName*/
- void 0,
- /*needFileNameList*/
- !0,
- /*excludeConfigFiles*/
- !0
- );
- if (o)
- return;
- const c = s.filter((D) => !D.includes("lib.d.ts"));
- if (c.length === 0)
- return;
- const _ = [], u = [], d = [], g = [], h = Wo(i), S = this.projectService.ensureDefaultProjectForFile(h);
- for (const D of c)
- this.getCanonicalFileName(D) === this.getCanonicalFileName(i) ? _.push(D) : this.projectService.getScriptInfo(D).isScriptOpen() ? u.push(D) : wl(D) ? g.push(D) : d.push(D);
- const C = [..._, ...u, ...d, ...g].map((D) => ({ fileName: D, project: S }));
- this.updateErrorCheck(
- t,
- C,
- n,
- /*requireOpen*/
- !1
- );
- }
- configurePlugin(t) {
- this.projectService.configurePlugin(t);
- }
- getSmartSelectionRange(t, n) {
- const { locations: i } = t, { file: s, languageService: o } = this.getFileAndLanguageServiceForSyntacticOperation(t), c = E.checkDefined(this.projectService.getScriptInfo(s));
- return lr(i, (_) => {
- const u = this.getPosition(_, c), d = o.getSmartSelectionRange(s, u);
- return n ? this.mapSelectionRange(d, c) : d;
- });
- }
- toggleLineComment(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = this.projectService.getScriptInfo(i), c = this.getRange(t, o), _ = s.toggleLineComment(i, c);
- if (n) {
- const u = this.projectService.getScriptInfoForNormalizedPath(i);
- return _.map((d) => this.convertTextChangeToCodeEdit(d, u));
- }
- return _;
- }
- toggleMultilineComment(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getRange(t, o), _ = s.toggleMultilineComment(i, c);
- if (n) {
- const u = this.projectService.getScriptInfoForNormalizedPath(i);
- return _.map((d) => this.convertTextChangeToCodeEdit(d, u));
- }
- return _;
- }
- commentSelection(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getRange(t, o), _ = s.commentSelection(i, c);
- if (n) {
- const u = this.projectService.getScriptInfoForNormalizedPath(i);
- return _.map((d) => this.convertTextChangeToCodeEdit(d, u));
- }
- return _;
- }
- uncommentSelection(t, n) {
- const { file: i, languageService: s } = this.getFileAndLanguageServiceForSyntacticOperation(t), o = this.projectService.getScriptInfoForNormalizedPath(i), c = this.getRange(t, o), _ = s.uncommentSelection(i, c);
- if (n) {
- const u = this.projectService.getScriptInfoForNormalizedPath(i);
- return _.map((d) => this.convertTextChangeToCodeEdit(d, u));
- }
- return _;
- }
- mapSelectionRange(t, n) {
- const i = {
- textSpan: Am(t.textSpan, n)
- };
- return t.parent && (i.parent = this.mapSelectionRange(t.parent, n)), i;
- }
- getScriptInfoFromProjectService(t) {
- const n = Wo(t), i = this.projectService.getScriptInfoForNormalizedPath(n);
- return i || (this.projectService.logErrorForScriptInfoNotFound(n), Wh.ThrowNoProject());
- }
- toProtocolCallHierarchyItem(t) {
- const n = this.getScriptInfoFromProjectService(t.file);
- return {
- name: t.name,
- kind: t.kind,
- kindModifiers: t.kindModifiers,
- file: t.file,
- containerName: t.containerName,
- span: Am(t.span, n),
- selectionSpan: Am(t.selectionSpan, n)
- };
- }
- toProtocolCallHierarchyIncomingCall(t) {
- const n = this.getScriptInfoFromProjectService(t.from.file);
- return {
- from: this.toProtocolCallHierarchyItem(t.from),
- fromSpans: t.fromSpans.map((i) => Am(i, n))
- };
- }
- toProtocolCallHierarchyOutgoingCall(t, n) {
- return {
- to: this.toProtocolCallHierarchyItem(t.to),
- fromSpans: t.fromSpans.map((i) => Am(i, n))
- };
- }
- prepareCallHierarchy(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.projectService.getScriptInfoForNormalizedPath(n);
- if (s) {
- const o = this.getPosition(t, s), c = i.getLanguageService().prepareCallHierarchy(n, o);
- return c && FV(c, (_) => this.toProtocolCallHierarchyItem(_));
- }
- }
- provideCallHierarchyIncomingCalls(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.getScriptInfoFromProjectService(n);
- return i.getLanguageService().provideCallHierarchyIncomingCalls(n, this.getPosition(t, s)).map((c) => this.toProtocolCallHierarchyIncomingCall(c));
- }
- provideCallHierarchyOutgoingCalls(t) {
- const { file: n, project: i } = this.getFileAndProject(t), s = this.getScriptInfoFromProjectService(n);
- return i.getLanguageService().provideCallHierarchyOutgoingCalls(n, this.getPosition(t, s)).map((c) => this.toProtocolCallHierarchyOutgoingCall(c, s));
- }
- getCanonicalFileName(t) {
- const n = this.host.useCaseSensitiveFileNames ? t : vy(t);
- return Os(n);
- }
- exit() {
- }
- notRequired(t) {
- return t && this.doOutput(
- /*info*/
- void 0,
- t.command,
- t.seq,
- /*success*/
- !0,
- this.performanceData
- ), { responseRequired: !1, performanceData: this.performanceData };
- }
- requiredResponse(t) {
- return { response: t, responseRequired: !0, performanceData: this.performanceData };
- }
- addProtocolHandler(t, n) {
- if (this.handlers.has(t))
- throw new Error(`Protocol handler already exists for command "${t}"`);
- this.handlers.set(t, n);
- }
- setCurrentRequest(t) {
- E.assert(this.currentRequestId === void 0), this.currentRequestId = t, this.cancellationToken.setRequest(t);
- }
- resetCurrentRequest(t) {
- E.assert(this.currentRequestId === t), this.currentRequestId = void 0, this.cancellationToken.resetRequest(t);
- }
- // eslint-disable-line @typescript-eslint/unified-signatures
- executeWithRequestId(t, n, i) {
- const s = this.performanceData;
- try {
- return this.performanceData = i, this.setCurrentRequest(t), n();
- } finally {
- this.resetCurrentRequest(t), this.performanceData = s;
- }
- }
- executeCommand(t) {
- const n = this.handlers.get(t.command);
- if (n) {
- const i = this.executeWithRequestId(
- t.seq,
- () => n(t),
- /*perfomanceData*/
- void 0
- );
- return this.projectService.enableRequestedPlugins(), i;
- } else
- return this.logger.msg(
- `Unrecognized JSON command:${Tv(t)}`,
- "Err"
- /* Err */
- ), this.doOutput(
- /*info*/
- void 0,
- "unknown",
- t.seq,
- /*success*/
- !1,
- /*performanceData*/
- void 0,
- `Unrecognized JSON command: ${t.command}`
- ), { responseRequired: !1 };
- }
- onMessage(t) {
- var n, i, s, o, c, _, u;
- this.gcTimer.scheduleCollect();
- let d;
- const g = this.performanceData;
- this.logger.hasLevel(
- 2
- /* requestTime */
- ) && (d = this.hrtime(), this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`request:${WD(this.toStringMessage(t))}`));
- let h, S;
- try {
- h = this.parseMessage(t), S = h.arguments && h.arguments.file ? h.arguments : void 0, (n = rn) == null || n.instant(rn.Phase.Session, "request", { seq: h.seq, command: h.command }), (i = rn) == null || i.push(
- rn.Phase.Session,
- "executeCommand",
- { seq: h.seq, command: h.command },
- /*separateBeginAndEnd*/
- !0
- );
- const { response: T, responseRequired: C, performanceData: D } = this.executeCommand(h);
- if ((s = rn) == null || s.pop(), this.logger.hasLevel(
- 2
- /* requestTime */
- )) {
- const P = CZe(this.hrtime(d)).toFixed(4);
- C ? this.logger.perftrc(`${h.seq}::${h.command}: elapsed time (in milliseconds) ${P}`) : this.logger.perftrc(`${h.seq}::${h.command}: async elapsed time (in milliseconds) ${P}`);
- }
- (o = rn) == null || o.instant(rn.Phase.Session, "response", { seq: h.seq, command: h.command, success: !!T }), T ? this.doOutput(
- T,
- h.command,
- h.seq,
- /*success*/
- !0,
- D
- ) : C && this.doOutput(
- /*info*/
- void 0,
- h.command,
- h.seq,
- /*success*/
- !1,
- D,
- "No content available."
- );
- } catch (T) {
- if ((c = rn) == null || c.popAll(), T instanceof JE) {
- (_ = rn) == null || _.instant(rn.Phase.Session, "commandCanceled", { seq: h?.seq, command: h?.command }), this.doOutput(
- { canceled: !0 },
- h.command,
- h.seq,
- /*success*/
- !0,
- this.performanceData
- );
- return;
- }
- this.logErrorWorker(T, this.toStringMessage(t), S), (u = rn) == null || u.instant(rn.Phase.Session, "commandError", { seq: h?.seq, command: h?.command, message: T.message }), this.doOutput(
- /*info*/
- void 0,
- h ? h.command : "unknown",
- h ? h.seq : 0,
- /*success*/
- !1,
- this.performanceData,
- "Error processing request. " + T.message + `
-` + T.stack
- );
- } finally {
- this.performanceData = g;
- }
- }
- parseMessage(t) {
- return JSON.parse(t);
- }
- toStringMessage(t) {
- return t;
- }
- getFormatOptions(t) {
- return this.projectService.getFormatCodeOptions(t);
- }
- getPreferences(t) {
- return this.projectService.getPreferences(t);
- }
- getHostFormatOptions() {
- return this.projectService.getHostFormatCodeOptions();
- }
- getHostPreferences() {
- return this.projectService.getHostPreferences();
- }
- };
- function EPe(e) {
- const t = e.diagnosticsDuration && as(e.diagnosticsDuration, ([n, i]) => ({ ...i, file: n }));
- return { ...e, diagnosticsDuration: t };
- }
- function Am(e, t) {
- return {
- start: t.positionToLineOffset(e.start),
- end: t.positionToLineOffset(ec(e))
- };
- }
- function y_e(e, t, n) {
- const i = Am(e, n), s = t && Am(t, n);
- return s ? { ...i, contextStart: s.start, contextEnd: s.end } : i;
- }
- function RZe(e, t) {
- return { start: DPe(t, e.span.start), end: DPe(t, ec(e.span)), newText: e.newText };
- }
- function DPe(e, t) {
- return __e(e) ? BZe(e.getLineAndCharacterOfPosition(t)) : e.positionToLineOffset(t);
- }
- function jZe(e, t) {
- const n = e.ranges.map(
- (i) => ({
- start: t.positionToLineOffset(i.start),
- end: t.positionToLineOffset(i.start + i.length)
- })
- );
- return e.wordPattern ? { ranges: n, wordPattern: e.wordPattern } : { ranges: n };
- }
- function BZe(e) {
- return { line: e.line + 1, offset: e.character + 1 };
- }
- function JZe(e) {
- E.assert(e.textChanges.length === 1);
- const t = xa(e.textChanges);
- return E.assert(t.span.start === 0 && t.span.length === 0), { fileName: e.fileName, textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: t.newText }] };
- }
- function v_e(e, t, n, i) {
- const s = zZe(e, t, i), { line: o, character: c } = nC(BT(s), n);
- return { line: o + 1, offset: c + 1 };
- }
- function zZe(e, t, n) {
- for (const { fileName: i, textChanges: s } of n)
- if (i === t)
- for (let o = s.length - 1; o >= 0; o--) {
- const { newText: c, span: { start: _, length: u } } = s[o];
- e = e.slice(0, _) + c + e.slice(_ + u);
- }
- return e;
- }
- function PPe(e, { fileName: t, textSpan: n, contextSpan: i, isWriteAccess: s, isDefinition: o }, { disableLineTextInReferences: c }) {
- const _ = E.checkDefined(e.getScriptInfo(t)), u = y_e(n, i, _), d = c ? void 0 : WZe(_, u);
- return {
- file: t,
- ...u,
- lineText: d,
- isWriteAccess: s,
- isDefinition: o
- };
- }
- function WZe(e, t) {
- const n = e.lineToTextSpan(t.start.line - 1);
- return e.getSnapshot().getText(n.start, ec(n)).replace(/\r|\n/g, "");
- }
- function UZe(e) {
- return e === void 0 || e && typeof e == "object" && typeof e.exportName == "string" && (e.fileName === void 0 || typeof e.fileName == "string") && (e.ambientModuleName === void 0 || typeof e.ambientModuleName == "string" && (e.isPackageJsonImport === void 0 || typeof e.isPackageJsonImport == "boolean"));
- }
- var W6 = 4, b_e = /* @__PURE__ */ ((e) => (e[e.PreStart = 0] = "PreStart", e[e.Start = 1] = "Start", e[e.Entire = 2] = "Entire", e[e.Mid = 3] = "Mid", e[e.End = 4] = "End", e[e.PostEnd = 5] = "PostEnd", e))(b_e || {}), VZe = class {
- constructor() {
- this.goSubtree = !0, this.lineIndex = new sN(), this.endBranch = [], this.state = 2, this.initialText = "", this.trailingText = "", this.lineIndex.root = new U6(), this.startPath = [this.lineIndex.root], this.stack = [this.lineIndex.root];
- }
- get done() {
- return !1;
- }
- insertLines(e, t) {
- t && (this.trailingText = ""), e ? e = this.initialText + e + this.trailingText : e = this.initialText + this.trailingText;
- const i = sN.linesFromText(e).lines;
- i.length > 1 && i[i.length - 1] === "" && i.pop();
- let s, o;
- for (let _ = this.endBranch.length - 1; _ >= 0; _--)
- this.endBranch[_].updateCounts(), this.endBranch[_].charCount() === 0 && (o = this.endBranch[_], _ > 0 ? s = this.endBranch[_ - 1] : s = this.branchNode);
- o && s.remove(o);
- const c = this.startPath[this.startPath.length - 1];
- if (i.length > 0)
- if (c.text = i[0], i.length > 1) {
- let _ = new Array(i.length - 1), u = c;
- for (let h = 1; h < i.length; h++)
- _[h - 1] = new bL(i[h]);
- let d = this.startPath.length - 2;
- for (; d >= 0; ) {
- const h = this.startPath[d];
- _ = h.insertAt(u, _), d--, u = h;
- }
- let g = _.length;
- for (; g > 0; ) {
- const h = new U6();
- h.add(this.lineIndex.root), _ = h.insertAt(this.lineIndex.root, _), g = _.length, this.lineIndex.root = h;
- }
- this.lineIndex.root.updateCounts();
- } else
- for (let _ = this.startPath.length - 2; _ >= 0; _--)
- this.startPath[_].updateCounts();
- else {
- this.startPath[this.startPath.length - 2].remove(c);
- for (let u = this.startPath.length - 2; u >= 0; u--)
- this.startPath[u].updateCounts();
- }
- return this.lineIndex;
- }
- post(e, t, n) {
- n === this.lineCollectionAtBranch && (this.state = 4), this.stack.pop();
- }
- pre(e, t, n, i, s) {
- const o = this.stack[this.stack.length - 1];
- this.state === 2 && s === 1 && (this.state = 1, this.branchNode = o, this.lineCollectionAtBranch = n);
- let c;
- function _(u) {
- return u.isLeaf() ? new bL("") : new U6();
- }
- switch (s) {
- case 0:
- this.goSubtree = !1, this.state !== 4 && o.add(n);
- break;
- case 1:
- this.state === 4 ? this.goSubtree = !1 : (c = _(n), o.add(c), this.startPath.push(c));
- break;
- case 2:
- this.state !== 4 ? (c = _(n), o.add(c), this.startPath.push(c)) : n.isLeaf() || (c = _(n), o.add(c), this.endBranch.push(c));
- break;
- case 3:
- this.goSubtree = !1;
- break;
- case 4:
- this.state !== 4 ? this.goSubtree = !1 : n.isLeaf() || (c = _(n), o.add(c), this.endBranch.push(c));
- break;
- case 5:
- this.goSubtree = !1, this.state !== 1 && o.add(n);
- break;
- }
- this.goSubtree && this.stack.push(c);
- }
- // just gather text from the leaves
- leaf(e, t, n) {
- this.state === 1 ? this.initialText = n.text.substring(0, e) : this.state === 2 ? (this.initialText = n.text.substring(0, e), this.trailingText = n.text.substring(e + t)) : this.trailingText = n.text.substring(e + t);
- }
- }, qZe = class {
- constructor(e, t, n) {
- this.pos = e, this.deleteLen = t, this.insertedText = n;
- }
- getTextChangeRange() {
- return Tw(Ul(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0);
- }
- }, iG = class AT {
- constructor() {
- this.changes = [], this.versions = new Array(AT.maxVersions), this.minVersion = 0, this.currentVersion = 0;
- }
- versionToIndex(t) {
- if (!(t < this.minVersion || t > this.currentVersion))
- return t % AT.maxVersions;
- }
- currentVersionToIndex() {
- return this.currentVersion % AT.maxVersions;
- }
- // REVIEW: can optimize by coalescing simple edits
- edit(t, n, i) {
- this.changes.push(new qZe(t, n, i)), (this.changes.length > AT.changeNumberThreshold || n > AT.changeLengthThreshold || i && i.length > AT.changeLengthThreshold) && this.getSnapshot();
- }
- getSnapshot() {
- return this._getSnapshot();
- }
- _getSnapshot() {
- let t = this.versions[this.currentVersionToIndex()];
- if (this.changes.length > 0) {
- let n = t.index;
- for (const i of this.changes)
- n = n.edit(i.pos, i.deleteLen, i.insertedText);
- t = new wPe(this.currentVersion + 1, this, n, this.changes), this.currentVersion = t.version, this.versions[this.currentVersionToIndex()] = t, this.changes = [], this.currentVersion - this.minVersion >= AT.maxVersions && (this.minVersion = this.currentVersion - AT.maxVersions + 1);
- }
- return t;
- }
- getSnapshotVersion() {
- return this._getSnapshot().version;
- }
- getAbsolutePositionAndLineText(t) {
- return this._getSnapshot().index.lineNumberToInfo(t);
- }
- lineOffsetToPosition(t, n) {
- return this._getSnapshot().index.absolutePositionOfStartOfLine(t) + (n - 1);
- }
- positionToLineOffset(t) {
- return this._getSnapshot().index.positionToLineOffset(t);
- }
- lineToTextSpan(t) {
- const n = this._getSnapshot().index, { lineText: i, absolutePosition: s } = n.lineNumberToInfo(t + 1), o = i !== void 0 ? i.length : n.absolutePositionOfStartOfLine(t + 2) - s;
- return Ul(s, o);
- }
- getTextChangesBetweenVersions(t, n) {
- if (t < n)
- if (t >= this.minVersion) {
- const i = [];
- for (let s = t + 1; s <= n; s++) {
- const o = this.versions[this.versionToIndex(s)];
- for (const c of o.changesSincePreviousVersion)
- i.push(c.getTextChangeRange());
- }
- return pY(i);
- } else
- return;
- else
- return OI;
- }
- getLineCount() {
- return this._getSnapshot().index.getLineCount();
- }
- static fromString(t) {
- const n = new AT(), i = new wPe(0, n, new sN());
- n.versions[n.currentVersion] = i;
- const s = sN.linesFromText(t);
- return i.index.load(s.lines), n;
- }
- };
- iG.changeNumberThreshold = 8, iG.changeLengthThreshold = 256, iG.maxVersions = 8;
- var sG = iG, wPe = class A7e {
- constructor(t, n, i, s = hl) {
- this.version = t, this.cache = n, this.index = i, this.changesSincePreviousVersion = s;
- }
- getText(t, n) {
- return this.index.getText(t, n - t);
- }
- getLength() {
- return this.index.getLength();
- }
- getChangeRange(t) {
- if (t instanceof A7e && this.cache === t.cache)
- return this.version <= t.version ? OI : this.cache.getTextChangesBetweenVersions(t.version, this.version);
- }
- }, sN = class fme {
- constructor() {
- this.checkEdits = !1;
- }
- absolutePositionOfStartOfLine(t) {
- return this.lineNumberToInfo(t).absolutePosition;
- }
- positionToLineOffset(t) {
- const { oneBasedLine: n, zeroBasedColumn: i } = this.root.charOffsetToLineInfo(1, t);
- return { line: n, offset: i + 1 };
- }
- positionToColumnAndLineText(t) {
- return this.root.charOffsetToLineInfo(1, t);
- }
- getLineCount() {
- return this.root.lineCount();
- }
- lineNumberToInfo(t) {
- const n = this.getLineCount();
- if (t <= n) {
- const { position: i, leaf: s } = this.root.lineNumberToInfo(t, 0);
- return { absolutePosition: i, lineText: s && s.text };
- } else
- return { absolutePosition: this.root.charCount(), lineText: void 0 };
- }
- load(t) {
- if (t.length > 0) {
- const n = [];
- for (let i = 0; i < t.length; i++)
- n[i] = new bL(t[i]);
- this.root = fme.buildTreeFromBottom(n);
- } else
- this.root = new U6();
- }
- walk(t, n, i) {
- this.root.walk(t, n, i);
- }
- getText(t, n) {
- let i = "";
- return n > 0 && t < this.root.charCount() && this.walk(t, n, {
- goSubtree: !0,
- done: !1,
- leaf: (s, o, c) => {
- i = i.concat(c.text.substring(s, s + o));
- }
- }), i;
- }
- getLength() {
- return this.root.charCount();
- }
- every(t, n, i) {
- i || (i = this.root.charCount());
- const s = {
- goSubtree: !0,
- done: !1,
- leaf(o, c, _) {
- t(_, o, c) || (this.done = !0);
- }
- };
- return this.walk(n, i - n, s), !s.done;
- }
- edit(t, n, i) {
- if (this.root.charCount() === 0)
- return E.assert(n === 0), i !== void 0 ? (this.load(fme.linesFromText(i).lines), this) : void 0;
- {
- let s;
- if (this.checkEdits) {
- const _ = this.getText(0, this.root.charCount());
- s = _.slice(0, t) + i + _.slice(t + n);
- }
- const o = new VZe();
- let c = !1;
- if (t >= this.root.charCount()) {
- t = this.root.charCount() - 1;
- const _ = this.getText(t, 1);
- i ? i = _ + i : i = _, n = 0, c = !0;
- } else if (n > 0) {
- const _ = t + n, { zeroBasedColumn: u, lineText: d } = this.positionToColumnAndLineText(_);
- u === 0 && (n += d.length, i = i ? i + d : d);
- }
- if (this.root.walk(t, n, o), o.insertLines(i, c), this.checkEdits) {
- const _ = o.lineIndex.getText(0, o.lineIndex.getLength());
- E.assert(s === _, "buffer edit mismatch");
- }
- return o.lineIndex;
- }
- }
- static buildTreeFromBottom(t) {
- if (t.length < W6)
- return new U6(t);
- const n = new Array(Math.ceil(t.length / W6));
- let i = 0;
- for (let s = 0; s < n.length; s++) {
- const o = Math.min(i + W6, t.length);
- n[s] = new U6(t.slice(i, o)), i = o;
- }
- return this.buildTreeFromBottom(n);
- }
- static linesFromText(t) {
- const n = BT(t);
- if (n.length === 0)
- return { lines: [], lineMap: n };
- const i = new Array(n.length), s = n.length - 1;
- for (let c = 0; c < s; c++)
- i[c] = t.substring(n[c], n[c + 1]);
- const o = t.substring(n[s]);
- return o.length > 0 ? i[s] = o : i.pop(), { lines: i, lineMap: n };
- }
- }, U6 = class pme {
- constructor(t = []) {
- this.children = t, this.totalChars = 0, this.totalLines = 0, t.length && this.updateCounts();
- }
- isLeaf() {
- return !1;
- }
- updateCounts() {
- this.totalChars = 0, this.totalLines = 0;
- for (const t of this.children)
- this.totalChars += t.charCount(), this.totalLines += t.lineCount();
- }
- execWalk(t, n, i, s, o) {
- return i.pre && i.pre(t, n, this.children[s], this, o), i.goSubtree ? (this.children[s].walk(t, n, i), i.post && i.post(t, n, this.children[s], this, o)) : i.goSubtree = !0, i.done;
- }
- skipChild(t, n, i, s, o) {
- s.pre && !s.done && (s.pre(t, n, this.children[i], this, o), s.goSubtree = !0);
- }
- walk(t, n, i) {
- let s = 0, o = this.children[s].charCount(), c = t;
- for (; c >= o; )
- this.skipChild(
- c,
- n,
- s,
- i,
- 0
- /* PreStart */
- ), c -= o, s++, o = this.children[s].charCount();
- if (c + n <= o) {
- if (this.execWalk(
- c,
- n,
- i,
- s,
- 2
- /* Entire */
- ))
- return;
- } else {
- if (this.execWalk(
- c,
- o - c,
- i,
- s,
- 1
- /* Start */
- ))
- return;
- let _ = n - (o - c);
- for (s++, o = this.children[s].charCount(); _ > o; ) {
- if (this.execWalk(
- 0,
- o,
- i,
- s,
- 3
- /* Mid */
- ))
- return;
- _ -= o, s++, o = this.children[s].charCount();
- }
- if (_ > 0 && this.execWalk(
- 0,
- _,
- i,
- s,
- 4
- /* End */
- ))
- return;
- }
- if (i.pre) {
- const _ = this.children.length;
- if (s < _ - 1)
- for (let u = s + 1; u < _; u++)
- this.skipChild(
- 0,
- 0,
- u,
- i,
- 5
- /* PostEnd */
- );
- }
- }
- // Input position is relative to the start of this node.
- // Output line number is absolute.
- charOffsetToLineInfo(t, n) {
- if (this.children.length === 0)
- return { oneBasedLine: t, zeroBasedColumn: n, lineText: void 0 };
- for (const o of this.children) {
- if (o.charCount() > n)
- return o.isLeaf() ? { oneBasedLine: t, zeroBasedColumn: n, lineText: o.text } : o.charOffsetToLineInfo(t, n);
- n -= o.charCount(), t += o.lineCount();
- }
- const i = this.lineCount();
- if (i === 0)
- return { oneBasedLine: 1, zeroBasedColumn: 0, lineText: void 0 };
- const s = E.checkDefined(this.lineNumberToInfo(i, 0).leaf);
- return { oneBasedLine: i, zeroBasedColumn: s.charCount(), lineText: void 0 };
- }
- /**
- * Input line number is relative to the start of this node.
- * Output line number is relative to the child.
- * positionAccumulator will be an absolute position once relativeLineNumber reaches 0.
- */
- lineNumberToInfo(t, n) {
- for (const i of this.children) {
- const s = i.lineCount();
- if (s >= t)
- return i.isLeaf() ? { position: n, leaf: i } : i.lineNumberToInfo(t, n);
- t -= s, n += i.charCount();
- }
- return { position: n, leaf: void 0 };
- }
- splitAfter(t) {
- let n;
- const i = this.children.length;
- t++;
- const s = t;
- if (t < i) {
- for (n = new pme(); t < i; )
- n.add(this.children[t]), t++;
- n.updateCounts();
- }
- return this.children.length = s, n;
- }
- remove(t) {
- const n = this.findChildIndex(t), i = this.children.length;
- if (n < i - 1)
- for (let s = n; s < i - 1; s++)
- this.children[s] = this.children[s + 1];
- this.children.pop();
- }
- findChildIndex(t) {
- const n = this.children.indexOf(t);
- return E.assert(n !== -1), n;
- }
- insertAt(t, n) {
- let i = this.findChildIndex(t);
- const s = this.children.length, o = n.length;
- if (s < W6 && i === s - 1 && o === 1)
- return this.add(n[0]), this.updateCounts(), [];
- {
- const c = this.splitAfter(i);
- let _ = 0;
- for (i++; i < W6 && _ < o; )
- this.children[i] = n[_], i++, _++;
- let u = [], d = 0;
- if (_ < o) {
- d = Math.ceil((o - _) / W6), u = new Array(d);
- let g = 0;
- for (let S = 0; S < d; S++)
- u[S] = new pme();
- let h = u[0];
- for (; _ < o; )
- h.add(n[_]), _++, h.children.length === W6 && (g++, h = u[g]);
- for (let S = u.length - 1; S >= 0; S--)
- u[S].children.length === 0 && u.pop();
- }
- c && u.push(c), this.updateCounts();
- for (let g = 0; g < d; g++)
- u[g].updateCounts();
- return u;
- }
- }
- // assume there is room for the item; return true if more room
- add(t) {
- this.children.push(t), E.assert(this.children.length <= W6);
- }
- charCount() {
- return this.totalChars;
- }
- lineCount() {
- return this.totalLines;
- }
- }, bL = class {
- constructor(e) {
- this.text = e;
- }
- isLeaf() {
- return !0;
- }
- walk(e, t, n) {
- n.leaf(e, t, this);
- }
- charCount() {
- return this.text.length;
- }
- lineCount() {
- return 1;
- }
- }, APe = class N7e {
- constructor(t, n, i, s, o, c) {
- this.telemetryEnabled = t, this.logger = n, this.host = i, this.globalTypingsCacheLocation = s, this.event = o, this.maxActiveRequestCount = c, this.activeRequestCount = 0, this.requestQueue = iw(), this.requestMap = /* @__PURE__ */ new Map(), this.requestedRegistry = !1, this.packageInstallId = 0;
- }
- isKnownTypesPackageName(t) {
- var n;
- return Dm.validatePackageName(t) !== Dm.NameValidationResult.Ok ? !1 : (this.requestedRegistry || (this.requestedRegistry = !0, this.installer.send({ kind: "typesRegistry" })), !!((n = this.typesRegistryCache) != null && n.has(t)));
- }
- installPackage(t) {
- this.packageInstallId++;
- const n = { kind: "installPackage", ...t, id: this.packageInstallId }, i = new Promise((s, o) => {
- (this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: s, reject: o });
- });
- return this.installer.send(n), i;
- }
- attach(t) {
- this.projectService = t, this.installer = this.createInstallerProcess();
- }
- onProjectClosed(t) {
- this.installer.send({ projectName: t.getProjectName(), kind: "closeProject" });
- }
- enqueueInstallTypingsRequest(t, n, i) {
- const s = Nue(t, n, i);
- this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Scheduling throttled operation:${Tv(s)}`), this.activeRequestCount < this.maxActiveRequestCount ? this.scheduleRequest(s) : (this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Deferring request for: ${s.projectName}`), this.requestQueue.enqueue(s), this.requestMap.set(s.projectName, s));
- }
- handleMessage(t) {
- var n, i;
- switch (this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Received response:${Tv(t)}`), t.kind) {
- case AU:
- this.typesRegistryCache = new Map(Object.entries(t.typesRegistry));
- break;
- case MF: {
- const s = (n = this.packageInstalledPromise) == null ? void 0 : n.get(t.id);
- E.assertIsDefined(s, "Should find the promise for package install"), (i = this.packageInstalledPromise) == null || i.delete(t.id), t.success ? s.resolve({ successMessage: t.message }) : s.reject(t.message), this.projectService.updateTypingsForProject(t), this.event(t, "setTypings");
- break;
- }
- case Jie: {
- const s = {
- message: t.message
- };
- this.event(s, "typesInstallerInitializationFailed");
- break;
- }
- case NU: {
- const s = {
- eventId: t.eventId,
- packages: t.packagesToInstall
- };
- this.event(s, "beginInstallTypes");
- break;
- }
- case IU: {
- if (this.telemetryEnabled) {
- const c = {
- telemetryEventName: "typingsInstalled",
- payload: {
- installedPackages: t.packagesToInstall.join(","),
- installSuccess: t.installSuccess,
- typingsInstallerVersion: t.typingsInstallerVersion
- }
- };
- this.event(c, "telemetry");
- }
- const s = {
- eventId: t.eventId,
- packages: t.packagesToInstall,
- success: t.installSuccess
- };
- this.event(s, "endInstallTypes");
- break;
- }
- case LF: {
- this.projectService.updateTypingsForProject(t);
- break;
- }
- case FF: {
- for (this.activeRequestCount > 0 ? this.activeRequestCount-- : E.fail("TIAdapter:: Received too many responses"); !this.requestQueue.isEmpty(); ) {
- const s = this.requestQueue.dequeue();
- if (this.requestMap.get(s.projectName) === s) {
- this.requestMap.delete(s.projectName), this.scheduleRequest(s);
- break;
- }
- this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Skipping defunct request for: ${s.projectName}`);
- }
- this.projectService.updateTypingsForProject(t), this.event(t, "setTypings");
- break;
- }
- case QA:
- this.projectService.watchTypingLocations(t);
- break;
- }
- }
- scheduleRequest(t) {
- this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`), this.activeRequestCount++, this.host.setTimeout(
- () => {
- this.logger.hasLevel(
- 3
- /* verbose */
- ) && this.logger.info(`TIAdapter:: Sending request:${Tv(t)}`), this.installer.send(t);
- },
- N7e.requestDelayMillis,
- `${t.projectName}::${t.kind}`
- );
- }
- };
- APe.requestDelayMillis = 100;
- var NPe = APe, IPe = {};
- La(IPe, {
- ActionInvalidate: () => LF,
- ActionPackageInstalled: () => MF,
- ActionSet: () => FF,
- ActionWatchTypingLocations: () => QA,
- Arguments: () => OU,
- AutoImportProviderProject: () => Que,
- AuxiliaryProject: () => $ue,
- CharRangeSection: () => b_e,
- CloseFileWatcherEvent: () => $H,
- CommandNames: () => bPe,
- ConfigFileDiagEvent: () => UH,
- ConfiguredProject: () => Yue,
- ConfiguredProjectLoadKind: () => n_e,
- CreateDirectoryWatcherEvent: () => GH,
- CreateFileWatcherEvent: () => HH,
- Errors: () => Wh,
- EventBeginInstallTypes: () => NU,
- EventEndInstallTypes: () => IU,
- EventInitializationFailed: () => Jie,
- EventTypesRegistry: () => AU,
- ExternalProject: () => RH,
- GcTimer: () => jue,
- InferredProject: () => Gue,
- LargeFileReferencedEvent: () => WH,
- LineIndex: () => sN,
- LineLeaf: () => bL,
- LineNode: () => U6,
- LogLevel: () => wue,
- Msg: () => Aue,
- OpenFileInfoTelemetryEvent: () => Zue,
- Project: () => _k,
- ProjectInfoTelemetryEvent: () => qH,
- ProjectKind: () => K8,
- ProjectLanguageServiceStateEvent: () => VH,
- ProjectLoadingFinishEvent: () => zH,
- ProjectLoadingStartEvent: () => JH,
- ProjectService: () => u_e,
- ProjectsUpdatedInBackgroundEvent: () => hL,
- ScriptInfo: () => Wue,
- ScriptVersionCache: () => sG,
- Session: () => CPe,
- TextStorage: () => zue,
- ThrottledOperations: () => Rue,
- TypingsInstallerAdapter: () => NPe,
- allFilesAreJsOrDts: () => Vue,
- allRootFilesAreJsOrDts: () => Uue,
- asNormalizedPath: () => GDe,
- convertCompilerOptions: () => yL,
- convertFormatOptions: () => J6,
- convertScriptKindName: () => QH,
- convertTypeAcquisition: () => e_e,
- convertUserPreferences: () => t_e,
- convertWatchOptions: () => nN,
- countEachFileTypes: () => eN,
- createInstallTypingsRequest: () => Nue,
- createModuleSpecifierCache: () => p_e,
- createNormalizedPathMap: () => $De,
- createPackageJsonCache: () => d_e,
- createSortedArray: () => Mue,
- emptyArray: () => hl,
- findArgument: () => Hve,
- formatDiagnosticToProtocol: () => iN,
- formatMessage: () => m_e,
- getBaseConfigFileName: () => MH,
- getLocationInNewDocument: () => v_e,
- hasArgument: () => qve,
- hasNoTypeScriptSource: () => que,
- indent: () => WD,
- isBackgroundProject: () => rN,
- isConfigFile: () => __e,
- isConfiguredProject: () => B0,
- isDynamicFileName: () => Z8,
- isExternalProject: () => tN,
- isInferredProject: () => B6,
- isInferredProjectName: () => Iue,
- isProjectDeferredClose: () => gL,
- makeAutoImportProviderProjectName: () => Fue,
- makeAuxiliaryProjectName: () => Lue,
- makeInferredProjectName: () => Oue,
- maxFileSize: () => BH,
- maxProgramSizeForNonTsFiles: () => jH,
- normalizedPathToPath: () => j6,
- nowString: () => Gve,
- nullCancellationToken: () => hPe,
- nullTypingsInstaller: () => vL,
- protocol: () => Bue,
- stringifyIndented: () => Tv,
- toEvent: () => g_e,
- toNormalizedPath: () => Wo,
- tryConvertScriptKindName: () => XH,
- typingsInstaller: () => Pue,
- updateProjectIfDirty: () => gp
- }), typeof console < "u" && (E.loggingHost = {
- log(e, t) {
- switch (e) {
- case 1:
- return console.error(t);
- case 2:
- return console.warn(t);
- case 3:
- return console.log(t);
- case 4:
- return console.log(t);
- }
- }
- });
- })({ get exports() {
- return sa;
- }, set exports($a) {
- sa = $a, su.exports && (su.exports = $a);
- } });
-})(k7e);
-var q_t = k7e.exports;
-const H_t = /* @__PURE__ */ E_t(q_t);
-function ome(su) {
- F_t(su) ? (D_t("show-in-ide"), d7e(`${m7e}show-in-ide`, L_t(su))) : (P_t("show-in-ide"), d7e(`${m7e}show-in-ide`, su));
-}
-ZP.on("show-in-ide", (su) => {
- const sa = su.detail.node;
- if (su.detail.source) {
- ome(su.detail.source);
- return;
- }
- if (!sa)
- return;
- if (sa.isFlowComponent) {
- ome(sa.node);
- return;
- }
- const $a = I7e(sa);
- $a && ome($a);
-});
-function I7e(su) {
- if (!su.isReactComponent)
- return;
- const sa = y7e(su.node);
- if (sa)
- return sa;
- const $a = O_t(su.node);
- if ($a)
- return $a;
- const qu = su.children.sort((La, Pf) => La.siblingIndex - Pf.siblingIndex).find((La) => La.isReactComponent && I7e(La) !== void 0);
- if (!qu)
- throw new Error(`Could not find the source of ${su.nameAndIdentifier}`);
- return y7e(qu.node);
-}
-function G_t(su) {
- sme.active || sme.setActive(!0), w_t("copilot-init-app", { framework: su }, async (sa) => {
- if (sa.data.success)
- document.body.innerHTML = `
The files have been created
-
You need to restart the server for the changes to have effect.
`;
- else {
- const $a = sa.data.reason;
- x7e($a);
- }
- }), sme.setActive(!1);
-}
-function $_t(su) {
- return cme(su) === "PreconfiguredAuthProvider" || cme(su) === "RouterProvider";
-}
-function X_t(su) {
- return !!W_t(su);
-}
-class Q_t {
- constructor() {
- this.root = null, this.flatNodes = [], this._hasFlowComponent = !1, this.fiberNodeUuids = /* @__PURE__ */ new WeakMap();
- }
- getChildren(sa) {
- return this.flatNodes.find((qu) => qu.uuid === sa)?.children || [];
- }
- get allNodesFlat() {
- return this.flatNodes;
- }
- getNodeOfElement(sa) {
- if (sa)
- return sa.__copilotTreeNode ? sa.__copilotTreeNode : this.flatNodes.find(($a) => $a.element === sa);
- }
- addToTree(sa, $a) {
- const qu = N_t(sa);
- if (!qu && M_t(sa)) {
- const wf = ame(sa);
- if (wf && wf.nextElementSibling) {
- this.addToTree(wf.nextElementSibling, $a);
- return;
- }
- }
- if (qu && sa.localName === "react-router-outlet") {
- Array.from(sa.children).forEach((wf) => {
- const U_ = v7e(wf);
- U_ && this.addToTree(U_, $a);
- });
- return;
- }
- let La, Pf;
- if (!qu)
- La = b7e(sa) ? ame(sa) : void 0, $_t(sa) || (Pf = this.generateNodeFromFiber(sa, $a));
- else if (!X_t(sa)) {
- const wf = this.generateNodeFromFlow(sa, $a);
- if (!wf)
- return;
- this._hasFlowComponent = !0, Pf = wf, La = sa;
- }
- if ($a)
- Pf && (Pf.parent = $a, $a.children || ($a.children = []), $a.children.push(Pf));
- else {
- if (!Pf) {
- x7e("Tree root node is undefined");
- return;
- }
- this.root = Pf;
- }
- La && (La.__copilotTreeNode = Pf), Pf && (this.flatNodes.push(Pf), ZP.emit("copilot-tree-node-added", { node: Pf, parent: $a }));
- const KP = Pf ?? $a;
- qu ? Array.from(sa.children).forEach((wf) => this.addToTree(wf, KP)) : R_t(sa).forEach((wf) => this.addToTree(wf, KP));
- }
- generateNodeFromFiber(sa, $a) {
- const qu = b7e(sa) ? ame(sa) : void 0, La = $a?.children.length ?? 0, Pf = this;
- return {
- node: sa,
- parent: $a,
- element: qu,
- depth: $a && $a.depth + 1 || 0,
- children: [],
- siblingIndex: La,
- isFlowComponent: !1,
- isReactComponent: !0,
- get uuid() {
- if (Pf.fiberNodeUuids.has(sa))
- return Pf.fiberNodeUuids.get(sa);
- if (sa.alternate && Pf.fiberNodeUuids.has(sa.alternate))
- return Pf.fiberNodeUuids.get(sa.alternate);
- const wf = A_t();
- return Pf.fiberNodeUuids.set(sa, wf), wf;
- },
- get name() {
- return g7e(cme(sa));
- },
- get identifier() {
- return h7e(qu);
- },
- get nameAndIdentifier() {
- return T7e(this.name, this.identifier);
- },
- get previousSibling() {
- if (La !== 0)
- return $a?.children[La - 1];
- },
- get nextSibling() {
- if (!($a === void 0 || La === $a.children.length - 1))
- return $a.children[La + 1];
- }
- };
- }
- generateNodeFromFlow(sa, $a) {
- const qu = j_t(sa);
- if (!qu || this.ignoreFlowNode($a, qu))
- return;
- const La = $a?.children.length ?? 0;
- return {
- node: qu,
- parent: $a,
- element: sa,
- depth: $a && $a.depth + 1 || 0,
- children: [],
- siblingIndex: La,
- get uuid() {
- return `${qu.uiId}#${qu.nodeId}`;
- },
- isFlowComponent: !0,
- isReactComponent: !1,
- get name() {
- return B_t(qu) ?? g7e(qu.element.localName);
- },
- get identifier() {
- return h7e(sa);
- },
- get nameAndIdentifier() {
- return T7e(this.name, this.identifier);
- },
- get previousSibling() {
- if (La !== 0)
- return $a?.children[La - 1];
- },
- get nextSibling() {
- if (!($a === void 0 || La === $a.children.length - 1))
- return $a.children[La + 1];
- }
- };
- }
- clearTree() {
- this.root = null, this.flatNodes = [], this._hasFlowComponent = !1, ZP.emit("copilot-tree-cleared", {});
- }
- createTree() {
- this.clearTree();
- const sa = J_t();
- sa && (this.addToTree(sa), this.addOverlayContentToTreeIfExists("vaadin-popover-overlay"), this.addOverlayContentToTreeIfExists("vaadin-dialog-overlay"), ZP.emit("copilot-tree-created", {}));
- }
- ignoreFlowNode(sa, $a) {
- return !!(sa?.element?.localName === "vaadin-radio-button" || sa?.element?.localName === "vaadin-date-time-picker" || sa?.element?.localName === "vaadin-grid" || $a?.javaClass?.startsWith("com.vaadin.flow.data.renderer"));
- }
- addOverlayContentToTreeIfExists(sa) {
- const $a = document.body.querySelector(sa);
- if (!$a)
- return;
- const qu = $a.owner;
- if (qu) {
- if (!this.getNodeOfElement(qu)) {
- const La = z_t(v7e(qu));
- this.addToTree(La ?? qu, this.root);
- }
- Array.from($a.children).forEach((La) => this.addToTree(La, this.getNodeOfElement(qu)));
- }
- }
- hasFlowComponents() {
- return this._hasFlowComponent;
- }
- findNodeByUuid(sa) {
- return this.flatNodes.find(($a) => $a.uuid === sa);
- }
- getElementByNodeUuid(sa) {
- return this.findNodeByUuid(sa)?.element;
- }
-}
-function T7e(su, sa) {
- return sa ? `${su} "${sa}"` : su;
-}
-ZP.on("location-changed", () => {
- window.Vaadin.copilot.tree.createTree();
-});
-ZP.on("component-tree-updated", () => {
- window.Vaadin.copilot.tree.createTree();
-});
-ZP.on("navigate", (su) => {
- const sa = window.history.state?.idx, $a = {};
- sa !== void 0 && ($a.idx = sa + 1), window.history.pushState($a, "", su.detail.path), window.dispatchEvent(new PopStateEvent("popstate"));
-});
-window.Vaadin.copilot.comm = I_t;
-window.Vaadin.copilot.ts = H_t;
-window.Vaadin.copilot.tree = new Q_t();
-window.Vaadin.copilot.initEmptyApp = G_t;
diff --git a/src/main/frontend/generated/jar-resources/copilot/copilot-info-plugin-a_iJ8RCS.js b/src/main/frontend/generated/jar-resources/copilot/copilot-info-plugin-a_iJ8RCS.js
deleted file mode 100644
index 097bb49..0000000
--- a/src/main/frontend/generated/jar-resources/copilot/copilot-info-plugin-a_iJ8RCS.js
+++ /dev/null
@@ -1,231 +0,0 @@
-import { a as k, _ as D, y as b, Q as E, $, e as f, u as c, a0 as w, F as S, E as A, U as T, M as P, b as R, l as C } from "./copilot-DD4YG2QN.js";
-import { r as I } from "./state-BQmijGwF.js";
-import { B as H } from "./base-panel-B8VfoxFZ.js";
-import { showNotification as U } from "./copilot-notification-Cnh_SAYH.js";
-import { i as m } from "./icons-InFn_YP5.js";
-const N = "copilot-info-panel{--dev-tools-red-color: red;--dev-tools-grey-color: gray;--dev-tools-green-color: green;position:relative}copilot-info-panel div.info-tray{display:flex;flex-direction:column;gap:10px}copilot-info-panel vaadin-button{margin-inline:var(--lumo-space-l)}copilot-info-panel dl{display:grid;grid-template-columns:auto auto;gap:0;margin:var(--space-100) var(--space-50);font:var(--font-xsmall)}copilot-info-panel dl>dt,copilot-info-panel dl>dd{padding:3px 10px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}copilot-info-panel dd.live-reload-status>span{overflow:hidden;text-overflow:ellipsis;display:block;color:var(--status-color)}copilot-info-panel dd span.hidden{display:none}copilot-info-panel dd span.true{color:var(--dev-tools-green-color);font-size:large}copilot-info-panel dd span.false{color:var(--dev-tools-red-color);font-size:large}copilot-info-panel code{white-space:nowrap;-webkit-user-select:all;user-select:all}copilot-info-panel .checks{display:inline-grid;grid-template-columns:auto 1fr;gap:var(--space-50)}copilot-info-panel span.hint{font-size:var(--font-size-0);background:var(--gray-50);padding:var(--space-75);border-radius:var(--radius-2)}";
-var j = function() {
- var e = document.getSelection();
- if (!e.rangeCount)
- return function() {
- };
- for (var t = document.activeElement, o = [], s = 0; s < e.rangeCount; s++)
- o.push(e.getRangeAt(s));
- switch (t.tagName.toUpperCase()) {
- case "INPUT":
- case "TEXTAREA":
- t.blur();
- break;
- default:
- t = null;
- break;
- }
- return e.removeAllRanges(), function() {
- e.type === "Caret" && e.removeAllRanges(), e.rangeCount || o.forEach(function(r) {
- e.addRange(r);
- }), t && t.focus();
- };
-}, B = j, h = {
- "text/plain": "Text",
- "text/html": "Url",
- default: "Text"
-}, L = "Copy to clipboard: #{key}, Enter";
-function O(e) {
- var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
- return e.replace(/#{\s*key\s*}/g, t);
-}
-function F(e, t) {
- var o, s, r, n, l, a, d = !1;
- t || (t = {}), o = t.debug || !1;
- try {
- r = B(), n = document.createRange(), l = document.getSelection(), a = document.createElement("span"), a.textContent = e, a.ariaHidden = "true", a.style.all = "unset", a.style.position = "fixed", a.style.top = 0, a.style.clip = "rect(0, 0, 0, 0)", a.style.whiteSpace = "pre", a.style.webkitUserSelect = "text", a.style.MozUserSelect = "text", a.style.msUserSelect = "text", a.style.userSelect = "text", a.addEventListener("copy", function(i) {
- if (i.stopPropagation(), t.format)
- if (i.preventDefault(), typeof i.clipboardData > "u") {
- o && console.warn("unable to use e.clipboardData"), o && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
- var y = h[t.format] || h.default;
- window.clipboardData.setData(y, e);
- } else
- i.clipboardData.clearData(), i.clipboardData.setData(t.format, e);
- t.onCopy && (i.preventDefault(), t.onCopy(i.clipboardData));
- }), document.body.appendChild(a), n.selectNodeContents(a), l.addRange(n);
- var p = document.execCommand("copy");
- if (!p)
- throw new Error("copy command was unsuccessful");
- d = !0;
- } catch (i) {
- o && console.error("unable to copy using execCommand: ", i), o && console.warn("trying IE specific stuff");
- try {
- window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), d = !0;
- } catch (y) {
- o && console.error("unable to copy using clipboardData: ", y), o && console.error("falling back to prompt"), s = O("message" in t ? t.message : L), window.prompt(s, e);
- }
- } finally {
- l && (typeof l.removeRange == "function" ? l.removeRange(n) : l.removeAllRanges()), a && document.body.removeChild(a), r();
- }
- return d;
-}
-var J = F;
-const M = /* @__PURE__ */ k(J);
-var V = Object.defineProperty, W = Object.getOwnPropertyDescriptor, g = (e, t, o, s) => {
- for (var r = s > 1 ? void 0 : s ? W(t, o) : t, n = e.length - 1, l; n >= 0; n--)
- (l = e[n]) && (r = (s ? l(t, o, r) : l(r)) || r);
- return s && r && V(t, o, r), r;
-};
-let v = class extends H {
- constructor() {
- super(...arguments), this.serverInfo = [], this.clientInfo = [{ name: "Browser", version: navigator.userAgent }], this.handleServerInfoEvent = (e) => {
- const t = JSON.parse(e.data.info);
- this.serverInfo = t.versions, D().then((o) => {
- o && (this.clientInfo.unshift({ name: "Vaadin Employee", version: "true", more: void 0 }), this.requestUpdate("clientInfo"));
- }), b() === "success" && E("hotswap-active", { value: $() });
- };
- }
- connectedCallback() {
- super.connectedCallback(), this.onCommand("copilot-info", this.handleServerInfoEvent), this.onEventBus("system-info-with-callback", (e) => {
- e.detail.callback(this.getInfoForClipboard(e.detail.notify));
- }), this.reaction(
- () => f.idePluginState,
- () => {
- this.requestUpdate("serverInfo");
- }
- );
- }
- getIndex(e) {
- return this.serverInfo.findIndex((t) => t.name === e);
- }
- render() {
- return c`
-
You have a running plugin. Enjoy your awesome development workflow!
`;
- }
- renderPluginIsNotInstalledContent(e) {
- let t = null, o = "Install from Marketplace";
- return e.intellij ? (t = be, o = "Install from JetBrains Marketplace") : e.vscode && (t = we, o = "Install from VSCode Marketplace"), l`
-
-
Install the Vaadin IDE Plugin to ensure a smooth development workflow
-
- Installing the plugin is not required, but strongly recommended. Some Vaadin Copilot functionality, such
- as undo, will not function optimally without the plugin.
-
- JRebel ${c.linkExternal} is a commercial hotswap solution. Vaadin
- detects the JRebel Agent and automatically reloads the application in the browser after the Java changes have
- been hotpatched.
-
- Read more
-
Use 'Debug using Hotswap Agent' launch configuration
-
-
- Vaadin IntelliJ plugin offers launch mode that does not require any manual configuration!
-
- In order to run recommended launch configuration, you should click three dots right next to Debug button
- and select Debug using Hotswap Agent option.
-
- To manually configure IntelliJ, add the
- -XX:HotswapAgent=fatjar -XX:+AllowEnhancedClassRedefinition -XX:+UpdateClasses JVM
- arguments when launching the application
-
` : l`
- Add the
- -XX:HotswapAgent=fatjar -XX:+AllowEnhancedClassRedefinition -XX:+UpdateClasses JVM
- arguments when launching the application
-
Go to VS Code and launch the 'Debug using Hotswap Agent' configuration
` : h}
-
-
` : h}
-
- ${e.intellij || e.vscode ? l`If there is a problem, you can manually
- download JetBrains Runtime JDK and set up
- your debug configuration to use it.` : l`Download JetBrains Runtime JDK and set up
- your debug configuration to use it.`}
-
-
-
-
-
- `;
- }
- renderInstallHotswapAgentJdkSection(e) {
- const t = a.jdkInfo?.hotswapAgentFound, o = a.jdkInfo?.extendedClassDefCapable;
- return l`
-
- Hotswap Agent provides application level support for hot reloading, such as reinitalizing Vaadin @Route or
- @BrowserCallable classes when they are updated
-
- ${e.intellij ? l`
Launch as mentioned in the previous step
` : h}
- ${!e.intellij && !o ? l`
First install JetBrains Runtime as mentioned in the step above.
` : h}
- ${e.intellij ? l`
- To manually configure IntelliJ, download HotswapAgent and install the jar file as
- [JAVA_HOME]/lib/hotswap/hotswap-agent.jar in the JetBrains Runtime JDK. Note that the
- file must be renamed to exactly match this path.
-
` : l`
- Download HotswapAgent and install the jar file as
- [JAVA_HOME]/lib/hotswap/hotswap-agent.jar in the JetBrains Runtime JDK. Note that the
- file must be renamed to exactly match this path.
-
`}
-
-
-
-
- `;
- }
- renderHotswapAgentVersionSection() {
- if (!a.jdkInfo?.hotswapAgentFound)
- return h;
- const e = a.jdkInfo?.hotswapVersionOk, t = a.jdkInfo?.hotswapVersion, o = a.jdkInfo?.hotswapAgentLocation;
- return l`
-